ext/ preprocessor/ struct.bi

This file is part of the <ext/Preprocessor> library API, and can be directly included by user programs.

Summary
ext/ preprocessor/ struct.biThis file is part of the <ext/Preprocessor> library API, and can be directly included by user programs.
LicenseCopyright © 2009, FreeBASIC Extended Library Development Group Copyright © 2002, Paul Mensonides
Macros
fbextPP_Structdefines a new preprocessor struct sname_ with members mdecls_.
fbextPP_StructNewexpands to an instance of the struct sname_.
fbextPP_StructMemberexpands to the value of the member member_ of the struct struct_.
fbextPP_StructSetMemberexpands to a copy of a struct struct_ with member member_ set to value_.
fbextPP_StructSetMembers

License

Copyright © 2009, FreeBASIC Extended Library Development Group Copyright © 2002, Paul Mensonides

Distributed under the Boost Software License, Version 1.0.  See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Distributed under the FreeBASIC Extended Library Group license.  See accompanying file LICENSE.txt or copy at http://code.google.com- /p- /fb-extended-lib- /wiki- /License

Macros

fbextPP_Struct

# macro fbextPP_Struct(sname_,
mdecls_)

defines a new preprocessor struct sname_ with members mdecls_.

fbextPP_StructNew

expands to an instance of the struct sname_.  The instance members are initialized with the initializers in minits, if any.  Note that minits_ must have (:) as the first element.

Parameters

sname_is the name of the struct created with fbextPP_Struct.
minits_is a sequence of two-element tuples representing member initializers, and has the form, (member, initvalue)

fbextPP_StructMember

# define fbextPP_StructMember(
   struct_,
   member_
) _fbextPP_StructMember_aux(fbextPP_TupleRemParens(2, struct_), member_)

expands to the value of the member member_ of the struct struct_.

fbextPP_StructSetMember

# define fbextPP_StructSetMember(
   struct_,
   member_,
   value_
) _fbextPP_StructSetMember_aux(fbextPP_TupleRemParens(2, struct_), member_, value_)

expands to a copy of a struct struct_ with member member_ set to value_.

fbextPP_StructSetMembers

# define fbextPP_StructSetMembers(
   struct_,
   memvalues_
) fbextPP_SeqFoldLeft(_fbextPP_StructSetMembers_O, struct_, memvalues_)
# macro fbextPP_Struct(sname_,
mdecls_)
defines a new preprocessor struct sname_ with members mdecls_.
# define fbextPP_StructMember(
   struct_,
   member_
) _fbextPP_StructMember_aux(fbextPP_TupleRemParens(2, struct_), member_)
expands to the value of the member member_ of the struct struct_.
# define fbextPP_StructSetMember(
   struct_,
   member_,
   value_
) _fbextPP_StructSetMember_aux(fbextPP_TupleRemParens(2, struct_), member_, value_)
expands to a copy of a struct struct_ with member member_ set to value_.
# define fbextPP_StructSetMembers(
   struct_,
   memvalues_
) fbextPP_SeqFoldLeft(_fbextPP_StructSetMembers_O, struct_, memvalues_)