41
41
/* For convenience. */
43
#define classBaseName(cd) ((cd) -> iff -> name -> text)
44
#define classFQCName(cd) ((cd) -> iff -> fqcname)
43
#define classBaseName(cd) ((cd)->iff->name->text)
44
#define classFQCName(cd) ((cd)->iff->fqcname)
47
47
/* Handle module flags. */
49
49
#define MOD_HAS_DELAYED_DTORS 0x0001 /* It has a class with a delayed dtor. */
50
#define MOD_IS_ORDERED 0x0002 /* Set if the module has been ordered. */
52
#define hasDelayedDtors(m) ((m) -> modflags & MOD_HAS_DELAYED_DTORS)
53
#define setHasDelayedDtors(m) ((m) -> modflags |= MOD_HAS_DELAYED_DTORS)
54
#define isOrdered(m) ((m) -> modflags & MOD_IS_ORDERED)
55
#define setIsOrdered(m) ((m) -> modflags |= MOD_IS_ORDERED)
51
#define hasDelayedDtors(m) ((m)->modflags & MOD_HAS_DELAYED_DTORS)
52
#define setHasDelayedDtors(m) ((m)->modflags |= MOD_HAS_DELAYED_DTORS)
58
55
/* Handle section flags. */
60
#define SECT_IS_PUBLIC 0x0001 /* It is public. */
61
#define SECT_IS_PROT 0x0002 /* It is protected. */
62
#define SECT_IS_PRIVATE 0x0004 /* It is private. */
63
#define SECT_IS_SLOT 0x0008 /* It is a slot. */
64
#define SECT_IS_SIGNAL 0x0010 /* It is a signal. */
65
#define SECT_MASK 0x001f /* The mask of all flags. */
68
/* Handle class flags. */
70
#define CLASS_HAS_ENUMS 0x00010000 /* It has enums. */
71
#define CLASS_HAS_SIGSLOTS 0x00020000 /* It has signals or slots. */
72
#define CLASS_IS_ABSTRACT 0x00040000 /* It is an abstract class. */
73
#define CLASS_HAS_SHADOW 0x00080000 /* It is has a shadow class. */
74
#define CLASS_IS_OPAQUE 0x00100000 /* It is opaque. */
75
#define CLASS_HAS_VAR_HANDLERS 0x00200000 /* It has variable handlers. */
76
#define CLASS_DTOR_RELEASE_GIL 0x00400000 /* The dtor releases the GIL. */
77
#define CLASS_IS_PROTECTED 0x00800000 /* It is protected. */
78
#define CLASS_IS_PROTECTED_SAV 0x01000000 /* It is protected (saved). */
79
#define CLASS_IS_RENAMED 0x02000000 /* It has a different Python name. */
80
#define CLASS_IS_INCOMPLETE 0x04000000 /* The specification is incomplete. */
81
#define CLASS_CAN_CREATE 0x08000000 /* It has usable ctors. */
82
#define CLASS_IS_EXTERNAL 0x10000000 /* It is external. */
83
#define CLASS_IS_DELAYED_DTOR 0x20000000 /* The dtor is delayed. */
84
#define CLASS_NO_DEFAULT_CTORS 0x40000000 /* Don't create default ctors. */
86
#define hasEnums(cd) ((cd) -> classflags & CLASS_HAS_ENUMS)
87
#define setHasEnums(cd) ((cd) -> classflags |= CLASS_HAS_ENUMS)
88
#define hasSigSlots(cd) ((cd) -> classflags & CLASS_HAS_SIGSLOTS)
89
#define setHasSigSlots(cd) ((cd) -> classflags |= CLASS_HAS_SIGSLOTS)
90
#define isAbstractClass(cd) ((cd) -> classflags & CLASS_IS_ABSTRACT)
91
#define setIsAbstractClass(cd) ((cd) -> classflags |= CLASS_IS_ABSTRACT)
92
#define hasShadow(cd) ((cd) -> classflags & CLASS_HAS_SHADOW)
93
#define setHasShadow(cd) ((cd) -> classflags |= CLASS_HAS_SHADOW)
94
#define resetHasShadow(cd) ((cd) -> classflags &= ~CLASS_HAS_SHADOW)
95
#define isOpaque(cd) ((cd) -> classflags & CLASS_IS_OPAQUE)
96
#define setIsOpaque(cd) ((cd) -> classflags |= CLASS_IS_OPAQUE)
97
#define hasVarHandlers(cd) ((cd) -> classflags & CLASS_HAS_VAR_HANDLERS)
98
#define setHasVarHandlers(cd) ((cd) -> classflags |= CLASS_HAS_VAR_HANDLERS)
99
#define isProtectedClass(cd) ((cd) -> classflags & CLASS_IS_PROTECTED)
100
#define setIsProtectedClass(cd) ((cd) -> classflags |= CLASS_IS_PROTECTED)
101
#define resetIsProtectedClass(cd) ((cd) -> classflags &= ~CLASS_IS_PROTECTED)
102
#define wasProtectedClass(cd) ((cd) -> classflags & CLASS_IS_PROTECTED_SAV)
103
#define setWasProtectedClass(cd) ((cd) -> classflags |= CLASS_IS_PROTECTED_SAV)
104
#define resetWasProtectedClass(cd) ((cd) -> classflags &= ~CLASS_IS_PROTECTED_SAV)
105
#define isReleaseGILDtor(c) ((cd) -> classflags & CLASS_DTOR_RELEASE_GIL)
106
#define setIsReleaseGILDtor(c) ((cd) -> classflags |= CLASS_DTOR_RELEASE_GIL)
107
#define isRenamedClass(cd) ((cd) -> classflags & CLASS_IS_RENAMED)
108
#define setIsRenamedClass(cd) ((cd) -> classflags |= CLASS_IS_RENAMED)
109
#define isIncomplete(cd) ((cd) -> classflags & CLASS_IS_INCOMPLETE)
110
#define setIsIncomplete(cd) ((cd) -> classflags |= CLASS_IS_INCOMPLETE)
111
#define canCreate(cd) ((cd) -> classflags & CLASS_CAN_CREATE)
112
#define setCanCreate(cd) ((cd) -> classflags |= CLASS_CAN_CREATE)
113
#define resetCanCreate(cd) ((cd) -> classflags &= ~CLASS_CAN_CREATE)
114
#define isExternal(cd) ((cd) -> classflags & CLASS_IS_EXTERNAL)
115
#define setIsExternal(cd) ((cd) -> classflags |= CLASS_IS_EXTERNAL)
116
#define isDelayedDtor(cd) ((cd) -> classflags & CLASS_IS_DELAYED_DTOR)
117
#define setIsDelayedDtor(cd) ((cd) -> classflags |= CLASS_IS_DELAYED_DTOR)
118
#define noDefaultCtors(cd) ((cd) -> classflags & CLASS_NO_DEFAULT_CTORS)
119
#define setNoDefaultCtors(cd) ((cd) -> classflags |= CLASS_NO_DEFAULT_CTORS)
121
#define isPublicDtor(cd) ((cd) -> classflags & SECT_IS_PUBLIC)
122
#define setIsPublicDtor(cd) ((cd) -> classflags |= SECT_IS_PUBLIC)
123
#define isProtectedDtor(cd) ((cd) -> classflags & SECT_IS_PROT)
124
#define isPrivateDtor(cd) ((cd) -> classflags & SECT_IS_PRIVATE)
126
#define isDtor(cd) ((cd) -> classflags & (SECT_IS_PUBLIC | SECT_IS_PROT | SECT_IS_PRIVATE))
129
/* Handle ctor flags. */
131
#define CTOR_RELEASE_GIL 0x00010000 /* The ctor releases the GIL. */
132
#define CTOR_EXPLICIT 0x00020000 /* The ctor is explicit. */
133
#define CTOR_CAST 0x00040000 /* The ctor is a cast. */
135
#define isPublicCtor(c) ((c) -> ctorflags & SECT_IS_PUBLIC)
136
#define setIsPublicCtor(c) ((c) -> ctorflags |= SECT_IS_PUBLIC)
137
#define isProtectedCtor(c) ((c) -> ctorflags & SECT_IS_PROT)
138
#define setIsProtectedCtor(c) ((c) -> ctorflags |= SECT_IS_PROT)
139
#define isPrivateCtor(c) ((c) -> ctorflags & SECT_IS_PRIVATE)
140
#define setIsPrivateCtor(c) ((c) -> ctorflags |= SECT_IS_PRIVATE)
142
#define isReleaseGILCtor(c) ((c) -> ctorflags & CTOR_RELEASE_GIL)
143
#define setIsReleaseGILCtor(c) ((c) -> ctorflags |= CTOR_RELEASE_GIL)
144
#define isExplicitCtor(c) ((c) -> ctorflags & CTOR_EXPLICIT)
145
#define setIsExplicitCtor(c) ((c) -> ctorflags |= CTOR_EXPLICIT)
146
#define isCastCtor(c) ((c) -> ctorflags & CTOR_CAST)
57
#define SECT_IS_PUBLIC 0x01 /* It is public. */
58
#define SECT_IS_PROT 0x02 /* It is protected. */
59
#define SECT_IS_PRIVATE 0x04 /* It is private. */
60
#define SECT_IS_SLOT 0x08 /* It is a slot. */
61
#define SECT_IS_SIGNAL 0x10 /* It is a signal. */
62
#define SECT_MASK 0x1f /* The mask of all flags. */
65
/* Handle class flags. These are combined with the section flags. */
67
#define CLASS_HAS_ENUMS 0x00000100 /* It has enums. */
68
#define CLASS_HAS_SIGSLOTS 0x00000200 /* It has signals or slots. */
69
#define CLASS_IS_ABSTRACT 0x00000400 /* It is an abstract class. */
70
#define CLASS_HAS_SHADOW 0x00000800 /* It is has a shadow class. */
71
#define CLASS_IS_OPAQUE 0x00001000 /* It is opaque. */
72
#define CLASS_HAS_VAR_HANDLERS 0x00002000 /* It has variable handlers. */
73
#define CLASS_DTOR_RELEASE_GIL 0x00004000 /* The dtor releases the GIL. */
74
#define CLASS_IS_PROTECTED 0x00008000 /* It is protected. */
75
#define CLASS_IS_PROTECTED_SAV 0x00010000 /* It is protected (saved). */
76
#define CLASS_IS_RENAMED 0x00020000 /* It has a different Python name. */
77
#define CLASS_IS_INCOMPLETE 0x00040000 /* The specification is incomplete. */
78
#define CLASS_CAN_CREATE 0x00080000 /* It has usable ctors. */
79
#define CLASS_IS_EXTERNAL 0x00100000 /* It is external. */
80
#define CLASS_IS_DELAYED_DTOR 0x00200000 /* The dtor is delayed. */
81
#define CLASS_NO_DEFAULT_CTORS 0x00400000 /* Don't create default ctors. */
82
#define CLASS_QOBJECT_SUB 0x00800000 /* It is derived from QObject. */
83
#define CLASS_DTOR_HOLD_GIL 0x01000000 /* The dtor holds the GIL. */
85
#define hasEnums(cd) ((cd)->classflags & CLASS_HAS_ENUMS)
86
#define setHasEnums(cd) ((cd)->classflags |= CLASS_HAS_ENUMS)
87
#define hasSigSlots(cd) ((cd)->classflags & CLASS_HAS_SIGSLOTS)
88
#define setHasSigSlots(cd) ((cd)->classflags |= CLASS_HAS_SIGSLOTS)
89
#define isAbstractClass(cd) ((cd)->classflags & CLASS_IS_ABSTRACT)
90
#define setIsAbstractClass(cd) ((cd)->classflags |= CLASS_IS_ABSTRACT)
91
#define hasShadow(cd) ((cd)->classflags & CLASS_HAS_SHADOW)
92
#define setHasShadow(cd) ((cd)->classflags |= CLASS_HAS_SHADOW)
93
#define resetHasShadow(cd) ((cd)->classflags &= ~CLASS_HAS_SHADOW)
94
#define isOpaque(cd) ((cd)->classflags & CLASS_IS_OPAQUE)
95
#define setIsOpaque(cd) ((cd)->classflags |= CLASS_IS_OPAQUE)
96
#define hasVarHandlers(cd) ((cd)->classflags & CLASS_HAS_VAR_HANDLERS)
97
#define setHasVarHandlers(cd) ((cd)->classflags |= CLASS_HAS_VAR_HANDLERS)
98
#define isProtectedClass(cd) ((cd)->classflags & CLASS_IS_PROTECTED)
99
#define setIsProtectedClass(cd) ((cd)->classflags |= CLASS_IS_PROTECTED)
100
#define resetIsProtectedClass(cd) ((cd)->classflags &= ~CLASS_IS_PROTECTED)
101
#define wasProtectedClass(cd) ((cd)->classflags & CLASS_IS_PROTECTED_SAV)
102
#define setWasProtectedClass(cd) ((cd)->classflags |= CLASS_IS_PROTECTED_SAV)
103
#define resetWasProtectedClass(cd) ((cd)->classflags &= ~CLASS_IS_PROTECTED_SAV)
104
#define isReleaseGILDtor(c) ((cd)->classflags & CLASS_DTOR_RELEASE_GIL)
105
#define setIsReleaseGILDtor(c) ((cd)->classflags |= CLASS_DTOR_RELEASE_GIL)
106
#define isRenamedClass(cd) ((cd)->classflags & CLASS_IS_RENAMED)
107
#define setIsRenamedClass(cd) ((cd)->classflags |= CLASS_IS_RENAMED)
108
#define isIncomplete(cd) ((cd)->classflags & CLASS_IS_INCOMPLETE)
109
#define setIsIncomplete(cd) ((cd)->classflags |= CLASS_IS_INCOMPLETE)
110
#define canCreate(cd) ((cd)->classflags & CLASS_CAN_CREATE)
111
#define setCanCreate(cd) ((cd)->classflags |= CLASS_CAN_CREATE)
112
#define resetCanCreate(cd) ((cd)->classflags &= ~CLASS_CAN_CREATE)
113
#define isExternal(cd) ((cd)->classflags & CLASS_IS_EXTERNAL)
114
#define setIsExternal(cd) ((cd)->classflags |= CLASS_IS_EXTERNAL)
115
#define isDelayedDtor(cd) ((cd)->classflags & CLASS_IS_DELAYED_DTOR)
116
#define setIsDelayedDtor(cd) ((cd)->classflags |= CLASS_IS_DELAYED_DTOR)
117
#define noDefaultCtors(cd) ((cd)->classflags & CLASS_NO_DEFAULT_CTORS)
118
#define setNoDefaultCtors(cd) ((cd)->classflags |= CLASS_NO_DEFAULT_CTORS)
119
#define isQObjectSubClass(cd) ((cd)->classflags & CLASS_QOBJECT_SUB)
120
#define setIsQObjectSubClass(cd) ((cd)->classflags |= CLASS_QOBJECT_SUB)
121
#define isHoldGILDtor(c) ((cd)->classflags & CLASS_DTOR_HOLD_GIL)
122
#define setIsHoldGILDtor(c) ((cd)->classflags |= CLASS_DTOR_HOLD_GIL)
124
#define isPublicDtor(cd) ((cd)->classflags & SECT_IS_PUBLIC)
125
#define setIsPublicDtor(cd) ((cd)->classflags |= SECT_IS_PUBLIC)
126
#define isProtectedDtor(cd) ((cd)->classflags & SECT_IS_PROT)
127
#define isPrivateDtor(cd) ((cd)->classflags & SECT_IS_PRIVATE)
129
#define isDtor(cd) ((cd)->classflags & (SECT_IS_PUBLIC | SECT_IS_PROT | SECT_IS_PRIVATE))
132
/* Handle ctor flags. These are combined with the section flags. */
134
#define CTOR_RELEASE_GIL 0x00000100 /* The ctor releases the GIL. */
135
#define CTOR_EXPLICIT 0x00000200 /* The ctor is explicit. */
136
#define CTOR_CAST 0x00000400 /* The ctor is a cast. */
137
#define CTOR_HOLD_GIL 0x00000800 /* The ctor holds the GIL. */
139
#define isPublicCtor(c) ((c)->ctorflags & SECT_IS_PUBLIC)
140
#define setIsPublicCtor(c) ((c)->ctorflags |= SECT_IS_PUBLIC)
141
#define isProtectedCtor(c) ((c)->ctorflags & SECT_IS_PROT)
142
#define setIsProtectedCtor(c) ((c)->ctorflags |= SECT_IS_PROT)
143
#define isPrivateCtor(c) ((c)->ctorflags & SECT_IS_PRIVATE)
144
#define setIsPrivateCtor(c) ((c)->ctorflags |= SECT_IS_PRIVATE)
146
#define isReleaseGILCtor(c) ((c)->ctorflags & CTOR_RELEASE_GIL)
147
#define setIsReleaseGILCtor(c) ((c)->ctorflags |= CTOR_RELEASE_GIL)
148
#define isExplicitCtor(c) ((c)->ctorflags & CTOR_EXPLICIT)
149
#define setIsExplicitCtor(c) ((c)->ctorflags |= CTOR_EXPLICIT)
150
#define isCastCtor(c) ((c)->ctorflags & CTOR_CAST)
151
#define isHoldGILCtor(c) ((c)->ctorflags & CTOR_HOLD_GIL)
152
#define setIsHoldGILCtor(c) ((c)->ctorflags |= CTOR_HOLD_GIL)
149
155
/* Handle member flags. */
151
157
#define MEMBR_NUMERIC 0x0001 /* It is a numeric slot. */
153
#define isNumeric(m) ((m) -> memberflags & MEMBR_NUMERIC)
154
#define setIsNumeric(m) ((m) -> memberflags |= MEMBR_NUMERIC)
157
/* Handle enum flags. */
159
#define ENUM_WAS_PROT 0x00010000 /* It was defined as protected. */
160
#define ENUM_IS_RENAMED 0x00020000 /* It has been renamed. */
162
#define isProtectedEnum(e) ((e) -> enumflags & SECT_IS_PROT)
163
#define setIsProtectedEnum(e) ((e) -> enumflags |= SECT_IS_PROT)
164
#define resetIsProtectedEnum(e) ((e) -> enumflags &= ~SECT_IS_PROT)
166
#define wasProtectedEnum(e) ((e) -> enumflags & ENUM_WAS_PROT)
167
#define setWasProtectedEnum(e) ((e) -> enumflags |= ENUM_WAS_PROT)
168
#define resetWasProtectedEnum(e) ((e) -> enumflags &= ~ENUM_WAS_PROT)
169
#define isRenamedEnum(e) ((e) -> enumflags & ENUM_IS_RENAMED)
170
#define setIsRenamedEnum(e) ((e) -> enumflags |= ENUM_IS_RENAMED)
159
#define isNumeric(m) ((m)->memberflags & MEMBR_NUMERIC)
160
#define setIsNumeric(m) ((m)->memberflags |= MEMBR_NUMERIC)
163
/* Handle enum flags. These are combined with the section flags. */
165
#define ENUM_WAS_PROT 0x00000100 /* It was defined as protected. */
166
#define ENUM_IS_RENAMED 0x00000200 /* It has been renamed. */
168
#define isProtectedEnum(e) ((e)->enumflags & SECT_IS_PROT)
169
#define setIsProtectedEnum(e) ((e)->enumflags |= SECT_IS_PROT)
170
#define resetIsProtectedEnum(e) ((e)->enumflags &= ~SECT_IS_PROT)
172
#define wasProtectedEnum(e) ((e)->enumflags & ENUM_WAS_PROT)
173
#define setWasProtectedEnum(e) ((e)->enumflags |= ENUM_WAS_PROT)
174
#define resetWasProtectedEnum(e) ((e)->enumflags &= ~ENUM_WAS_PROT)
175
#define isRenamedEnum(e) ((e)->enumflags & ENUM_IS_RENAMED)
176
#define setIsRenamedEnum(e) ((e)->enumflags |= ENUM_IS_RENAMED)
173
179
/* Handle hierarchy flags. */
175
181
#define HIER_IS_DUPLICATE 0x0001 /* It is a super class duplicate. */
176
182
#define HIER_HAS_DUPLICATE 0x0002 /* It has a super class duplicate. */
178
#define isDuplicateSuper(m) ((m) -> mroflags & HIER_IS_DUPLICATE)
179
#define setIsDuplicateSuper(m) ((m) -> mroflags |= HIER_IS_DUPLICATE)
180
#define hasDuplicateSuper(m) ((m) -> mroflags & HIER_HAS_DUPLICATE)
181
#define setHasDuplicateSuper(m) ((m) -> mroflags |= HIER_HAS_DUPLICATE)
184
/* Handle overload flags. */
186
#define OVER_IS_VIRTUAL 0x00010000 /* It is virtual. */
187
#define OVER_IS_ABSTRACT 0x00020000 /* It is abstract. */
188
#define OVER_IS_CONST 0x00040000 /* It is a const function. */
189
#define OVER_IS_STATIC 0x00080000 /* It is a static function. */
190
#define OVER_IS_AUTOGEN 0x00100000 /* It is auto-generated. */
191
#define OVER_IS_NEW_THREAD 0x00200000 /* It is in a new thread. */
192
#define OVER_IS_FACTORY 0x00400000 /* It is a factory method. */
193
#define OVER_IS_FACTORY 0x00400000 /* It is a factory method. */
194
#define OVER_XFERRED_BACK 0x00800000 /* Ownership is transferred back. */
195
#define OVER_RELEASE_GIL 0x01000000 /* The function releases the GIL. */
196
#define OVER_IS_VIRTUAL_REIMP 0x02000000 /* It is a re-implementation of a virtual. */
197
#define OVER_DONT_DEREF_SELF 0x04000000 /* For comparison operators, don't dereference self. */
199
#define isPublic(o) ((o) -> overflags & SECT_IS_PUBLIC)
200
#define setIsPublic(o) ((o) -> overflags |= SECT_IS_PUBLIC)
201
#define isProtected(o) ((o) -> overflags & SECT_IS_PROT)
202
#define setIsProtected(o) ((o) -> overflags |= SECT_IS_PROT)
203
#define isPrivate(o) ((o) -> overflags & SECT_IS_PRIVATE)
204
#define setIsPrivate(o) ((o) -> overflags |= SECT_IS_PRIVATE)
205
#define isSlot(o) ((o) -> overflags & SECT_IS_SLOT)
206
#define setIsSlot(o) ((o) -> overflags |= SECT_IS_SLOT)
207
#define isSignal(o) ((o) -> overflags & SECT_IS_SIGNAL)
208
#define setIsSignal(o) ((o) -> overflags |= SECT_IS_SIGNAL)
210
#define isVirtual(o) ((o) -> overflags & OVER_IS_VIRTUAL)
211
#define setIsVirtual(o) ((o) -> overflags |= OVER_IS_VIRTUAL)
212
#define isAbstract(o) ((o) -> overflags & OVER_IS_ABSTRACT)
213
#define setIsAbstract(o) ((o) -> overflags |= OVER_IS_ABSTRACT)
214
#define isConst(o) ((o) -> overflags & OVER_IS_CONST)
215
#define setIsConst(o) ((o) -> overflags |= OVER_IS_CONST)
216
#define isStatic(o) ((o) -> overflags & OVER_IS_STATIC)
217
#define setIsStatic(o) ((o) -> overflags |= OVER_IS_STATIC)
218
#define isAutoGen(o) ((o) -> overflags & OVER_IS_AUTOGEN)
219
#define setIsAutoGen(o) ((o) -> overflags |= OVER_IS_AUTOGEN)
220
#define resetIsAutoGen(o) ((o) -> overflags &= ~OVER_IS_AUTOGEN)
221
#define isNewThread(o) ((o) -> overflags & OVER_IS_NEW_THREAD)
222
#define setIsNewThread(o) ((o) -> overflags |= OVER_IS_NEW_THREAD)
223
#define isFactory(o) ((o) -> overflags & OVER_IS_FACTORY)
224
#define setIsFactory(o) ((o) -> overflags |= OVER_IS_FACTORY)
225
#define isResultTransferredBack(o) ((o) -> overflags & OVER_XFERRED_BACK)
226
#define setIsResultTransferredBack(o) ((o) -> overflags |= OVER_XFERRED_BACK)
227
#define isReleaseGIL(o) ((o) -> overflags & OVER_RELEASE_GIL)
228
#define setIsReleaseGIL(o) ((o) -> overflags |= OVER_RELEASE_GIL)
229
#define isVirtualReimp(o) ((o) -> overflags & OVER_IS_VIRTUAL_REIMP)
230
#define setIsVirtualReimp(o) ((o) -> overflags |= OVER_IS_VIRTUAL_REIMP)
231
#define dontDerefSelf(o) ((o) -> overflags & OVER_DONT_DEREF_SELF)
232
#define setDontDerefSelf(o) ((o) -> overflags |= OVER_DONT_DEREF_SELF)
184
#define isDuplicateSuper(m) ((m)->mroflags & HIER_IS_DUPLICATE)
185
#define setIsDuplicateSuper(m) ((m)->mroflags |= HIER_IS_DUPLICATE)
186
#define hasDuplicateSuper(m) ((m)->mroflags & HIER_HAS_DUPLICATE)
187
#define setHasDuplicateSuper(m) ((m)->mroflags |= HIER_HAS_DUPLICATE)
190
/* Handle overload flags. These are combined with the section flags. */
192
#define OVER_IS_VIRTUAL 0x00000100 /* It is virtual. */
193
#define OVER_IS_ABSTRACT 0x00000200 /* It is abstract. */
194
#define OVER_IS_CONST 0x00000400 /* It is a const function. */
195
#define OVER_IS_STATIC 0x00000800 /* It is a static function. */
196
#define OVER_IS_AUTOGEN 0x00001000 /* It is auto-generated. */
197
#define OVER_IS_NEW_THREAD 0x00002000 /* It is in a new thread. */
198
#define OVER_IS_FACTORY 0x00004000 /* It is a factory method. */
199
#define OVER_XFERRED_BACK 0x00008000 /* Ownership is transferred back. */
200
#define OVER_RELEASE_GIL 0x00010000 /* The function releases the GIL. */
201
#define OVER_IS_VIRTUAL_REIMP 0x00020000 /* It is a re-implementation of a virtual. */
202
#define OVER_DONT_DEREF_SELF 0x00040000 /* For comparison operators, don't dereference self. */
203
#define OVER_HOLD_GIL 0x00080000 /* The function holds the GIL. */
205
#define isPublic(o) ((o)->overflags & SECT_IS_PUBLIC)
206
#define setIsPublic(o) ((o)->overflags |= SECT_IS_PUBLIC)
207
#define isProtected(o) ((o)->overflags & SECT_IS_PROT)
208
#define setIsProtected(o) ((o)->overflags |= SECT_IS_PROT)
209
#define isPrivate(o) ((o)->overflags & SECT_IS_PRIVATE)
210
#define setIsPrivate(o) ((o)->overflags |= SECT_IS_PRIVATE)
211
#define isSlot(o) ((o)->overflags & SECT_IS_SLOT)
212
#define setIsSlot(o) ((o)->overflags |= SECT_IS_SLOT)
213
#define isSignal(o) ((o)->overflags & SECT_IS_SIGNAL)
214
#define setIsSignal(o) ((o)->overflags |= SECT_IS_SIGNAL)
216
#define isVirtual(o) ((o)->overflags & OVER_IS_VIRTUAL)
217
#define setIsVirtual(o) ((o)->overflags |= OVER_IS_VIRTUAL)
218
#define isAbstract(o) ((o)->overflags & OVER_IS_ABSTRACT)
219
#define setIsAbstract(o) ((o)->overflags |= OVER_IS_ABSTRACT)
220
#define isConst(o) ((o)->overflags & OVER_IS_CONST)
221
#define setIsConst(o) ((o)->overflags |= OVER_IS_CONST)
222
#define isStatic(o) ((o)->overflags & OVER_IS_STATIC)
223
#define setIsStatic(o) ((o)->overflags |= OVER_IS_STATIC)
224
#define isAutoGen(o) ((o)->overflags & OVER_IS_AUTOGEN)
225
#define setIsAutoGen(o) ((o)->overflags |= OVER_IS_AUTOGEN)
226
#define resetIsAutoGen(o) ((o)->overflags &= ~OVER_IS_AUTOGEN)
227
#define isNewThread(o) ((o)->overflags & OVER_IS_NEW_THREAD)
228
#define setIsNewThread(o) ((o)->overflags |= OVER_IS_NEW_THREAD)
229
#define isFactory(o) ((o)->overflags & OVER_IS_FACTORY)
230
#define setIsFactory(o) ((o)->overflags |= OVER_IS_FACTORY)
231
#define isResultTransferredBack(o) ((o)->overflags & OVER_XFERRED_BACK)
232
#define setIsResultTransferredBack(o) ((o)->overflags |= OVER_XFERRED_BACK)
233
#define isReleaseGIL(o) ((o)->overflags & OVER_RELEASE_GIL)
234
#define setIsReleaseGIL(o) ((o)->overflags |= OVER_RELEASE_GIL)
235
#define isVirtualReimp(o) ((o)->overflags & OVER_IS_VIRTUAL_REIMP)
236
#define setIsVirtualReimp(o) ((o)->overflags |= OVER_IS_VIRTUAL_REIMP)
237
#define dontDerefSelf(o) ((o)->overflags & OVER_DONT_DEREF_SELF)
238
#define setDontDerefSelf(o) ((o)->overflags |= OVER_DONT_DEREF_SELF)
239
#define isHoldGIL(o) ((o)->overflags & OVER_HOLD_GIL)
240
#define setIsHoldGIL(o) ((o)->overflags |= OVER_HOLD_GIL)
235
243
/* Handle variable flags. */
237
245
#define VAR_IS_STATIC 0x01 /* It is a static variable. */
238
246
#define VAR_NEEDS_HANDLER 0x02 /* It the variable needs a handler. */
240
#define isStaticVar(v) ((v) -> varflags & VAR_IS_STATIC)
241
#define setIsStaticVar(v) ((v) -> varflags |= VAR_IS_STATIC)
242
#define needsHandler(v) ((v) -> varflags & VAR_NEEDS_HANDLER)
243
#define setNeedsHandler(v) ((v) -> varflags |= VAR_NEEDS_HANDLER)
248
#define isStaticVar(v) ((v)->varflags & VAR_IS_STATIC)
249
#define setIsStaticVar(v) ((v)->varflags |= VAR_IS_STATIC)
250
#define needsHandler(v) ((v)->varflags & VAR_NEEDS_HANDLER)
251
#define setNeedsHandler(v) ((v)->varflags |= VAR_NEEDS_HANDLER)
246
254
/* Handle argument flags. */
248
#define ARG_IS_REF 0x0001 /* It is a reference. */
256
#define ARG_IS_REF 0x0001 /* It is a reference. */
249
257
#define ARG_IS_CONST 0x0002 /* It is a const. */
250
#define ARG_XFERRED 0x0004 /* Ownership is transferred. */
258
#define ARG_XFERRED 0x0004 /* Ownership is transferred. */
251
259
#define ARG_THIS_XFERRED 0x0008 /* Ownership of this is transferred. */
252
260
#define ARG_XFERRED_BACK 0x0010 /* Ownership is transferred back. */
253
#define ARG_ARRAY 0x0020 /* Used as an array. */
261
#define ARG_ARRAY 0x0020 /* Used as an array. */
254
262
#define ARG_ARRAY_SIZE 0x0040 /* Used as an array size. */
255
263
#define ARG_ALLOW_NONE 0x0080 /* Allow None as a value. */
256
264
#define ARG_GET_WRAPPER 0x0100 /* Get the wrapper object. */
257
#define ARG_IN 0x0200 /* It passes an argument. */
258
#define ARG_OUT 0x0400 /* It returns a result. */
265
#define ARG_IN 0x0200 /* It passes an argument. */
266
#define ARG_OUT 0x0400 /* It returns a result. */
259
267
#define ARG_CONSTRAINED 0x0800 /* Suppress type conversion. */
261
#define isReference(a) ((a) -> argflags & ARG_IS_REF)
262
#define setIsReference(a) ((a) -> argflags |= ARG_IS_REF)
263
#define resetIsReference(a) ((a) -> argflags &= ~ARG_IS_REF)
264
#define isConstArg(a) ((a) -> argflags & ARG_IS_CONST)
265
#define setIsConstArg(a) ((a) -> argflags |= ARG_IS_CONST)
266
#define resetIsConstArg(a) ((a) -> argflags &= ~ARG_IS_CONST)
267
#define isTransferred(a) ((a) -> argflags & ARG_XFERRED)
268
#define setIsTransferred(a) ((a) -> argflags |= ARG_XFERRED)
269
#define isThisTransferred(a) ((a) -> argflags & ARG_THIS_XFERRED)
270
#define setIsThisTransferred(a) ((a) -> argflags |= ARG_THIS_XFERRED)
271
#define isTransferredBack(a) ((a) -> argflags & ARG_XFERRED_BACK)
272
#define setIsTransferredBack(a) ((a) -> argflags |= ARG_XFERRED_BACK)
273
#define isArray(a) ((a) -> argflags & ARG_ARRAY)
274
#define setArray(a) ((a) -> argflags |= ARG_ARRAY)
275
#define isArraySize(a) ((a) -> argflags & ARG_ARRAY_SIZE)
276
#define setArraySize(a) ((a) -> argflags |= ARG_ARRAY_SIZE)
277
#define isAllowNone(a) ((a) -> argflags & ARG_ALLOW_NONE)
278
#define setAllowNone(a) ((a) -> argflags |= ARG_ALLOW_NONE)
279
#define isGetWrapper(a) ((a) -> argflags & ARG_GET_WRAPPER)
280
#define setGetWrapper(a) ((a) -> argflags |= ARG_GET_WRAPPER)
281
#define isInArg(a) ((a) -> argflags & ARG_IN)
282
#define setIsInArg(a) ((a) -> argflags |= ARG_IN)
283
#define isOutArg(a) ((a) -> argflags & ARG_OUT)
284
#define setIsOutArg(a) ((a) -> argflags |= ARG_OUT)
285
#define isConstrained(a) ((a) -> argflags & ARG_CONSTRAINED)
286
#define setIsConstrained(a) ((a) -> argflags |= ARG_CONSTRAINED)
287
#define resetIsConstrained(a) ((a) -> argflags &= ~ARG_CONSTRAINED)
269
#define isReference(a) ((a)->argflags & ARG_IS_REF)
270
#define setIsReference(a) ((a)-> argflags |= ARG_IS_REF)
271
#define resetIsReference(a) ((a)->argflags &= ~ARG_IS_REF)
272
#define isConstArg(a) ((a)->argflags & ARG_IS_CONST)
273
#define setIsConstArg(a) ((a)->argflags |= ARG_IS_CONST)
274
#define resetIsConstArg(a) ((a)->argflags &= ~ARG_IS_CONST)
275
#define isTransferred(a) ((a)->argflags & ARG_XFERRED)
276
#define setIsTransferred(a) ((a)->argflags |= ARG_XFERRED)
277
#define isThisTransferred(a) ((a)->argflags & ARG_THIS_XFERRED)
278
#define setIsThisTransferred(a) ((a)->argflags |= ARG_THIS_XFERRED)
279
#define isTransferredBack(a) ((a)->argflags & ARG_XFERRED_BACK)
280
#define setIsTransferredBack(a) ((a)->argflags |= ARG_XFERRED_BACK)
281
#define isArray(a) ((a)->argflags & ARG_ARRAY)
282
#define setArray(a) ((a)->argflags |= ARG_ARRAY)
283
#define isArraySize(a) ((a)->argflags & ARG_ARRAY_SIZE)
284
#define setArraySize(a) ((a)->argflags |= ARG_ARRAY_SIZE)
285
#define isAllowNone(a) ((a)->argflags & ARG_ALLOW_NONE)
286
#define setAllowNone(a) ((a)->argflags |= ARG_ALLOW_NONE)
287
#define isGetWrapper(a) ((a)->argflags & ARG_GET_WRAPPER)
288
#define setGetWrapper(a) ((a)->argflags |= ARG_GET_WRAPPER)
289
#define isInArg(a) ((a)->argflags & ARG_IN)
290
#define setIsInArg(a) ((a)->argflags |= ARG_IN)
291
#define isOutArg(a) ((a)->argflags & ARG_OUT)
292
#define setIsOutArg(a) ((a)->argflags |= ARG_OUT)
293
#define isConstrained(a) ((a)->argflags & ARG_CONSTRAINED)
294
#define setIsConstrained(a) ((a)->argflags |= ARG_CONSTRAINED)
295
#define resetIsConstrained(a) ((a)->argflags &= ~ARG_CONSTRAINED)
290
298
/* Handle name flags. */
498
507
typedef struct _nodeDef {
499
int ordered; /* Set if in order. */
500
struct _classDef *cd; /* The class. */
501
struct _nodeDef *parent; /* The parent. */
502
struct _nodeDef *child; /* The first child. */
503
struct _nodeDef *next; /* The next sibling. */
508
int ordered; /* Set if in order. */
509
struct _classDef *cd; /* The class. */
510
struct _nodeDef *parent; /* The parent. */
511
struct _nodeDef *child; /* The first child. */
512
struct _nodeDef *next; /* The next sibling. */
507
516
/* A module definition. */
509
518
typedef struct _moduleDef {
510
char *fullname; /* The full module name. */
511
char *name; /* The module base name. */
512
int version; /* The module version. */
513
int modflags; /* The module flags. */
514
int modulenr; /* The module number. */
515
char *file; /* The filename. */
516
qualDef *qualifiers; /* The list of qualifiers. */
517
nodeDef root; /* Root of class tree. */
518
int nrtimelines; /* The nr. of timelines. */
519
int nrclasses; /* The nr. of classes. */
520
int nrexceptions; /* The nr. of exceptions. */
521
int nrmappedtypes; /* The nr. of mapped types. */
522
int nrenums; /* The nr. of named enums. */
523
int nrtypedefs; /* The nr. of typedefs. */
524
int nrvirthandlers; /* The nr. of virtual handlers. */
525
struct _virtHandlerDef *virthandlers; /* The virtual handlers. */
526
licenseDef *license; /* The software license. */
527
struct _moduleListDef *imports; /* The list of imports. */
528
struct _moduleDef *next; /* Next in the list. */
519
char *fullname; /* The full module name. */
520
char *name; /* The module base name. */
521
int version; /* The module version. */
522
int modflags; /* The module flags. */
523
int modulenr; /* The module number. */
524
char *file; /* The filename. */
525
qualDef *qualifiers; /* The list of qualifiers. */
526
nodeDef root; /* Root of class tree. */
527
int nrtimelines; /* The nr. of timelines. */
528
int nrclasses; /* The nr. of classes. */
529
int nrexceptions; /* The nr. of exceptions. */
530
int nrmappedtypes; /* The nr. of mapped types. */
531
int nrenums; /* The nr. of named enums. */
532
int nrtypedefs; /* The nr. of typedefs. */
533
int nrvirthandlers; /* The nr. of virtual handlers. */
534
struct _virtHandlerDef *virthandlers; /* The virtual handlers. */
535
licenseDef *license; /* The software license. */
536
struct _moduleListDef *allimports; /* The list of all imports. */
537
struct _moduleListDef *imports; /* The list of direct imports. */
538
struct _moduleDef *next; /* Next in the list. */
532
542
/* An entry in a linked module list. */
534
544
typedef struct _moduleListDef {
535
moduleDef *module; /* The module itself. */
536
struct _moduleListDef *next; /* The next in the list. */
545
moduleDef *module; /* The module itself. */
546
struct _moduleListDef *next; /* The next in the list. */
540
550
/* A literal code block. */
542
552
typedef struct _codeBlock {
543
char *frag; /* The code itself. */
544
char *filename; /* The original file. */
545
int linenr; /* The line in the file. */
546
struct _codeBlock *next; /* Next in the list. */
553
char *frag; /* The code itself. */
554
char *filename; /* The original file. */
555
int linenr; /* The line in the file. */
556
struct _codeBlock *next; /* Next in the list. */
550
560
/* The arguments to a throw specifier. */
552
562
typedef struct _throwArgs {
553
int nrArgs; /* The number of arguments. */
554
struct _exceptionDef *args[MAX_NR_ARGS]; /* The arguments. */
563
int nrArgs; /* The number of arguments. */
564
struct _exceptionDef *args[MAX_NR_ARGS]; /* The arguments. */
558
568
/* An exception. */
560
570
typedef struct _exceptionDef {
561
int exceptionnr; /* The exception number. */
562
struct _ifaceFileDef *iff; /* The interface file. */
563
char *pyname; /* The exception Python name. */
564
struct _classDef *cd; /* The exception class. */
565
char *bibase; /* The builtin base exception. */
566
struct _exceptionDef *base; /* The defined base exception. */
567
codeBlock *hdrcode; /* Optional header code. */
568
codeBlock *raisecode; /* Raise exception code. */
569
struct _exceptionDef *next; /* The next in the list. */
571
int exceptionnr; /* The exception number. */
572
struct _ifaceFileDef *iff; /* The interface file. */
573
char *pyname; /* The exception Python name. */
574
struct _classDef *cd; /* The exception class. */
575
char *bibase; /* The builtin base exception. */
576
struct _exceptionDef *base; /* The defined base exception. */
577
codeBlock *hdrcode; /* Optional header code. */
578
codeBlock *raisecode; /* Raise exception code. */
579
struct _exceptionDef *next; /* The next in the list. */
575
585
typedef struct _valueDef {
576
valueType vtype; /* The type. */
577
char vunop; /* Any unary operator. */
578
char vbinop; /* Any binary operator. */
586
valueType vtype; /* The type. */
587
char vunop; /* Any unary operator. */
588
char vbinop; /* Any binary operator. */
580
char vqchar; /* Quoted character value. */
581
long vnum; /* Numeric value. */
582
double vreal; /* Real value. */
583
char *vstr; /* String value. */
584
scopedNameDef *vscp; /* Scoped value. */
585
struct _fcallDef *fcd; /* Function call. */
590
char vqchar; /* Quoted character value. */
591
long vnum; /* Numeric value. */
592
double vreal; /* Real value. */
593
char *vstr; /* String value. */
594
scopedNameDef *vscp; /* Scoped value. */
595
struct _fcallDef *fcd; /* Function call. */
587
struct _valueDef *next; /* Next in the expression. */
597
struct _valueDef *next; /* Next in the expression. */
591
601
/* A member function argument (or result). */
594
argType atype; /* The type. */
595
char *name; /* The name. */
596
int argflags; /* The argument flags. */
597
int nrderefs; /* Nr. of dereferences. */
598
valueDef *defval; /* The default value. */
604
argType atype; /* The type. */
605
char *name; /* The name. */
606
int argflags; /* The argument flags. */
607
int nrderefs; /* Nr. of dereferences. */
608
valueDef *defval; /* The default value. */
600
610
struct _signatureDef *sa; /* If it is a function. */
601
611
struct _templateDef *td; /* If it is a template. */
612
622
/* An entry in a linked argument list. */
613
623
typedef struct _argList {
614
argDef arg; /* The argument itself. */
615
struct _argList *next; /* Next in the list. */
624
argDef arg; /* The argument itself. */
625
struct _argList *next; /* Next in the list. */
619
629
/* A function call. */
621
631
typedef struct _fcallDef {
622
argDef type; /* The type. */
623
int nrArgs; /* The number of arguments. */
624
struct _valueDef *args[MAX_NR_ARGS]; /* The arguments. */
632
argDef type; /* The type. */
633
int nrArgs; /* The number of arguments. */
634
struct _valueDef *args[MAX_NR_ARGS]; /* The arguments. */
628
638
/* An interface file definition. */
630
640
typedef struct _ifaceFileDef {
631
nameDef *name; /* The name. */
632
ifaceFileType type; /* Interface file type. */
633
scopedNameDef *fqcname; /* The fully qualified C++ name. */
634
moduleDef *module; /* The owning module. */
635
struct _ifaceFileList *used; /* Interface files used. */
636
struct _ifaceFileDef *next; /* Next in the list. */
641
nameDef *name; /* The name. */
642
ifaceFileType type; /* Interface file type. */
643
scopedNameDef *fqcname; /* The fully qualified C++ name. */
644
moduleDef *module; /* The owning module. */
645
struct _ifaceFileList *used; /* Interface files used. */
646
struct _ifaceFileDef *next; /* Next in the list. */
640
650
/* An entry in a linked interface file list. */
642
652
typedef struct _ifaceFileList {
643
ifaceFileDef *iff; /* The interface file itself. */
644
int header; /* If needed in the .h file. */
645
struct _ifaceFileList *next; /* Next in the list. */
653
ifaceFileDef *iff; /* The interface file itself. */
654
int header; /* If needed in the .h file. */
655
struct _ifaceFileList *next; /* Next in the list. */
649
659
/* A mapped type. */
651
661
typedef struct _mappedTypeDef {
652
argDef type; /* The type being mapped. */
653
int mappednr; /* The mapped type number. */
654
ifaceFileDef *iff; /* The interface file. */
655
codeBlock *hdrcode; /* Header code. */
656
codeBlock *convfromcode; /* Convert from C++ code. */
657
codeBlock *convtocode; /* Convert to C++ code. */
658
struct _mappedTypeDef *next; /* Next in the list. */
662
argDef type; /* The type being mapped. */
663
int mappednr; /* The mapped type number. */
664
ifaceFileDef *iff; /* The interface file. */
665
codeBlock *hdrcode; /* Header code. */
666
codeBlock *convfromcode; /* Convert from C++ code. */
667
codeBlock *convtocode; /* Convert to C++ code. */
668
struct _mappedTypeDef *next; /* Next in the list. */
662
672
/* A function signature. */
664
674
typedef struct _signatureDef {
665
argDef result; /* The result. */
666
int nrArgs; /* The number of arguments. */
667
argDef args[MAX_NR_ARGS]; /* The arguments. */
675
argDef result; /* The result. */
676
int nrArgs; /* The number of arguments. */
677
argDef args[MAX_NR_ARGS]; /* The arguments. */
671
681
/* A list of function signatures. */
673
683
typedef struct _signatureList {
674
struct _signatureDef *sd; /* The signature. */
675
struct _signatureList *next; /* Next in the list. */
684
struct _signatureDef *sd; /* The signature. */
685
struct _signatureList *next; /* Next in the list. */
679
689
/* A template type. */
681
691
typedef struct _templateDef {
682
scopedNameDef *fqname; /* The name. */
683
signatureDef types; /* The types. */
692
scopedNameDef *fqname; /* The name. */
693
signatureDef types; /* The types. */
687
697
/* A list of virtual handlers. */
689
699
typedef struct _virtHandlerDef {
690
int virthandlernr; /* The nr. of the virtual handler. */
691
int vhflags; /* The virtual handler flags. */
692
signatureDef *pysig; /* The Python signature. */
693
signatureDef *cppsig; /* The C++ signature. */
694
struct _moduleDef *module; /* The defining module. */
695
codeBlock *virtcode; /* Virtual handler code. */
696
struct _virtHandlerDef *next; /* Next in the list. */
700
int virthandlernr; /* The nr. of the virtual handler. */
701
int vhflags; /* The virtual handler flags. */
702
signatureDef *pysig; /* The Python signature. */
703
signatureDef *cppsig; /* The C++ signature. */
704
struct _moduleDef *module; /* The defining module. */
705
codeBlock *virtcode; /* Virtual handler code. */
706
struct _virtHandlerDef *next; /* Next in the list. */
697
707
} virtHandlerDef;
700
710
/* A typedef definition. */
702
712
typedef struct _typedefDef {
703
scopedNameDef *fqname; /* The fully qualified name. */
704
struct _classDef *ecd; /* The enclosing class. */
705
moduleDef *module; /* The owning module. */
706
argDef type; /* The actual type. */
707
struct _typedefDef *next; /* Next in the list. */
713
scopedNameDef *fqname; /* The fully qualified name. */
714
struct _classDef *ecd; /* The enclosing class. */
715
moduleDef *module; /* The owning module. */
716
argDef type; /* The actual type. */
717
struct _typedefDef *next; /* Next in the list. */
711
721
/* A variable definition. */
713
723
typedef struct _varDef {
714
nameDef *pyname; /* The variable Python name. */
715
scopedNameDef *fqcname; /* The fully qualified C/C++ name. */
716
struct _classDef *ecd; /* The enclosing class. */
717
moduleDef *module; /* The owning module. */
718
int varflags; /* The variable flags. */
719
argDef type; /* The actual type. */
720
codeBlock *accessfunc; /* The access function. */
721
codeBlock *getcode; /* The get code. */
722
codeBlock *setcode; /* The set code. */
723
struct _varDef *next; /* Next in the list. */
724
nameDef *pyname; /* The variable Python name. */
725
scopedNameDef *fqcname; /* The fully qualified C/C++ name. */
726
struct _classDef *ecd; /* The enclosing class. */
727
moduleDef *module; /* The owning module. */
728
int varflags; /* The variable flags. */
729
argDef type; /* The actual type. */
730
codeBlock *accessfunc; /* The access function. */
731
codeBlock *getcode; /* The get code. */
732
codeBlock *setcode; /* The set code. */
733
struct _varDef *next; /* Next in the list. */
727
737
/* An overloaded member function definition. */
729
739
typedef struct _overDef {
730
char *cppname; /* The C++ name. */
731
int overflags; /* The overload flags. */
732
struct _memberDef *common; /* Common parts. */
733
signatureDef pysig; /* The Python signature. */
734
signatureDef *cppsig; /* The C++ signature. */
735
throwArgs *exceptions; /* The exceptions. */
736
codeBlock *methodcode; /* Method code. */
737
virtHandlerDef *virthandler; /* The virtual handler. */
738
char *prehook; /* The pre-hook name. */
739
char *posthook; /* The post-hook name. */
740
struct _overDef *next; /* Next in the list. */
740
char *cppname; /* The C++ name. */
741
int overflags; /* The overload flags. */
742
struct _memberDef *common; /* Common parts. */
743
signatureDef pysig; /* The Python signature. */
744
signatureDef *cppsig; /* The C++ signature. */
745
throwArgs *exceptions; /* The exceptions. */
746
codeBlock *methodcode; /* Method code. */
747
virtHandlerDef *virthandler; /* The virtual handler. */
748
char *prehook; /* The pre-hook name. */
749
char *posthook; /* The post-hook name. */
750
struct _overDef *next; /* Next in the list. */
744
754
/* An overloaded constructor definition. */
746
756
typedef struct _ctorDef {
747
int ctorflags; /* The ctor flags. */
748
signatureDef pysig; /* The Python signature. */
749
signatureDef *cppsig; /* The C++ signature, NULL if /NoDerived/. */
750
throwArgs *exceptions; /* The exceptions. */
751
codeBlock *methodcode; /* Method code. */
752
char *prehook; /* The pre-hook name. */
753
char *posthook; /* The post-hook name. */
754
struct _ctorDef *next; /* Next in the list. */
757
int ctorflags; /* The ctor flags. */
758
signatureDef pysig; /* The Python signature. */
759
signatureDef *cppsig; /* The C++ signature, NULL if /NoDerived/. */
760
throwArgs *exceptions; /* The exceptions. */
761
codeBlock *methodcode; /* Method code. */
762
char *prehook; /* The pre-hook name. */
763
char *posthook; /* The post-hook name. */
764
struct _ctorDef *next; /* Next in the list. */
758
768
/* An enumerated type member definition. */
760
770
typedef struct _enumMemberDef {
761
nameDef *pyname; /* The Python name. */
762
char *cname; /* The C/C++ name. */
763
struct _enumDef *ed; /* The enclosing enum. */
764
struct _enumMemberDef *next; /* Next in the list. */
771
nameDef *pyname; /* The Python name. */
772
char *cname; /* The C/C++ name. */
773
struct _enumDef *ed; /* The enclosing enum. */
774
struct _enumMemberDef *next; /* Next in the list. */
768
778
/* An enumerated type definition. */
770
780
typedef struct _enumDef {
771
int enumflags; /* The enum flags. */
772
scopedNameDef *fqcname; /* The name (may be NULL). */
773
nameDef *pyname; /* The Python name (may be NULL). */
774
int enumnr; /* The enum number. */
775
struct _classDef *ecd; /* The enclosing class. */
776
struct _classDef *pcd; /* The publishing class. */
777
moduleDef *module; /* The owning module. */
778
enumMemberDef *members; /* The list of members. */
779
struct _memberDef *slots; /* The list of slots. */
780
struct _overDef *overs; /* The list of slot overloads. */
781
struct _enumDef *next; /* Next in the list. */
781
int enumflags; /* The enum flags. */
782
scopedNameDef *fqcname; /* The name (may be NULL). */
783
nameDef *pyname; /* The Python name (may be NULL). */
784
int enumnr; /* The enum number. */
785
struct _classDef *ecd; /* The enclosing class. */
786
struct _classDef *pcd; /* The publishing class. */
787
moduleDef *module; /* The owning module. */
788
enumMemberDef *members; /* The list of members. */
789
struct _memberDef *slots; /* The list of slots. */
790
struct _overDef *overs; /* The list of slot overloads. */
791
struct _enumDef *next; /* Next in the list. */
785
795
/* An member function definition. */
787
797
typedef struct _memberDef {
788
nameDef *pyname; /* The Python name. */
789
int memberflags; /* The member flags. */
790
slotType slot; /* The slot type. */
791
moduleDef *module; /* The owning module. */
792
struct _memberDef *next; /* Next in the list. */
798
nameDef *pyname; /* The Python name. */
799
int memberflags; /* The member flags. */
800
slotType slot; /* The slot type. */
801
moduleDef *module; /* The owning module. */
802
struct _memberDef *next; /* Next in the list. */
796
806
/* A list of visible member functions. */
798
808
typedef struct _visibleList {
799
memberDef *m; /* The member definition. */
800
struct _classDef *cd; /* The class. */
801
struct _visibleList *next; /* Next in the list. */
809
memberDef *m; /* The member definition. */
810
struct _classDef *cd; /* The class. */
811
struct _visibleList *next; /* Next in the list. */
805
815
/* An entry in a linked class list. */
807
817
typedef struct _classList {
808
struct _classDef *cd; /* The class itself. */
809
struct _classList *next; /* Next in the list. */
818
struct _classDef *cd; /* The class itself. */
819
struct _classList *next; /* Next in the list. */
813
823
/* A virtual overload definition. */
815
825
typedef struct _virtOverDef {
816
overDef o; /* The overload. */
817
struct _classDef *scope; /* The overload scope. */
818
struct _virtOverDef *next; /* Next in the list. */
826
overDef o; /* The overload. */
827
struct _classDef *scope; /* The overload scope. */
828
struct _virtOverDef *next; /* Next in the list. */
822
832
/* A class that appears in a class's hierarchy. */
824
834
typedef struct _mroDef {
825
struct _classDef *cd; /* The class. */
826
int mroflags; /* The hierarchy flags. */
827
struct _mroDef *next; /* The next in the list. */
835
struct _classDef *cd; /* The class. */
836
int mroflags; /* The hierarchy flags. */
837
struct _mroDef *next; /* The next in the list. */
831
841
/* A class definition. */
833
843
typedef struct _classDef {
834
int classflags; /* The class flags. */
835
int classnr; /* The class number. */
836
char *pyname; /* The Python name. */
837
ifaceFileDef *iff; /* The interface file. */
838
struct _classDef *ecd; /* The enclosing scope. */
839
struct _classDef *real; /* The real class if this is a proxy or extender. */
840
nodeDef *node; /* Position in class tree. */
841
classList *supers; /* The parent classes. */
842
mroDef *mro; /* The super-class hierarchy. */
843
templateDef *td; /* The instantiated template. */
844
ctorDef *ctors; /* The constructors. */
845
ctorDef *defctor; /* The default ctor. */
846
codeBlock *dealloccode; /* Handwritten dealloc code. */
847
codeBlock *dtorcode; /* Handwritten dtor code. */
848
throwArgs *dtorexceptions; /* The dtor exceptions. */
849
memberDef *members; /* The member functions. */
850
overDef *overs; /* The overloads. */
851
argList *casts; /* The operator casts. */
852
virtOverDef *vmembers; /* The virtual members. */
853
visibleList *visible; /* The visible members. */
854
codeBlock *cppcode; /* Class C++ code. */
855
codeBlock *hdrcode; /* Class header code. */
856
codeBlock *convtosubcode; /* Convert to sub C++ code. */
857
struct _classDef *subbase; /* Sub-class base class. */
858
codeBlock *convtocode; /* Convert to C++ code. */
859
codeBlock *travcode; /* Traverse code. */
860
codeBlock *clearcode; /* Clear code. */
861
codeBlock *readbufcode; /* Read buffer code. */
862
codeBlock *writebufcode; /* Write buffer code. */
863
codeBlock *segcountcode; /* Segment count code. */
864
codeBlock *charbufcode; /* Character buffer code. */
865
struct _classDef *next; /* Next in the list. */
844
int classflags; /* The class flags. */
845
int userflags; /* The user type flags. */
846
int classnr; /* The class number. */
847
char *pyname; /* The Python name. */
848
ifaceFileDef *iff; /* The interface file. */
849
struct _classDef *ecd; /* The enclosing scope. */
850
struct _classDef *real; /* The real class if this is a proxy or extender. */
851
nodeDef *node; /* Position in class tree. */
852
classList *supers; /* The parent classes. */
853
mroDef *mro; /* The super-class hierarchy. */
854
templateDef *td; /* The instantiated template. */
855
ctorDef *ctors; /* The constructors. */
856
ctorDef *defctor; /* The default ctor. */
857
codeBlock *dealloccode; /* Handwritten dealloc code. */
858
codeBlock *dtorcode; /* Handwritten dtor code. */
859
throwArgs *dtorexceptions; /* The dtor exceptions. */
860
memberDef *members; /* The member functions. */
861
overDef *overs; /* The overloads. */
862
argList *casts; /* The operator casts. */
863
virtOverDef *vmembers; /* The virtual members. */
864
visibleList *visible; /* The visible members. */
865
codeBlock *cppcode; /* Class C++ code. */
866
codeBlock *hdrcode; /* Class header code. */
867
codeBlock *convtosubcode; /* Convert to sub C++ code. */
868
struct _classDef *subbase; /* Sub-class base class. */
869
codeBlock *convtocode; /* Convert to C++ code. */
870
codeBlock *travcode; /* Traverse code. */
871
codeBlock *clearcode; /* Clear code. */
872
codeBlock *readbufcode; /* Read buffer code. */
873
codeBlock *writebufcode; /* Write buffer code. */
874
codeBlock *segcountcode; /* Segment count code. */
875
codeBlock *charbufcode; /* Character buffer code. */
876
struct _classDef *next; /* Next in the list. */
869
880
/* A class template definition. */
871
882
typedef struct _classTmplDef {
872
signatureDef sig; /* The template arguments. */
873
classDef *cd; /* The class itself. */
874
struct _classTmplDef *next; /* The next in the list. */
883
signatureDef sig; /* The template arguments. */
884
classDef *cd; /* The class itself. */
885
struct _classTmplDef *next; /* The next in the list. */
878
889
/* A mapped type template definition. */
880
891
typedef struct _mappedTypeTmplDef {
881
signatureDef sig; /* The template arguments. */
882
mappedTypeDef *mt; /* The mapped type itself. */
883
struct _mappedTypeTmplDef *next; /* The next in the list. */
892
signatureDef sig; /* The template arguments. */
893
mappedTypeDef *mt; /* The mapped type itself. */
894
struct _mappedTypeTmplDef *next; /* The next in the list. */
884
895
} mappedTypeTmplDef;
887
898
/* The parse tree corresponding to the specification file. */
890
moduleDef *module; /* This module. */
891
moduleDef *modules; /* The list of modules. */
892
moduleListDef *allimports; /* The list of all imports. */
893
nameDef *namecache; /* The name cache. */
894
ifaceFileDef *ifacefiles; /* The list of interface files. */
895
classDef *classes; /* The list of classes. */
896
classTmplDef *classtemplates; /* The list of class templates. */
897
classDef *proxies; /* The list of proxy classes. */
898
exceptionDef *exceptions; /* The list of exceptions. */
899
mappedTypeDef *mappedtypes; /* The mapped types. */
900
mappedTypeTmplDef *mappedtypetemplates; /* The list of mapped type templates. */
901
int qobjclass; /* QObject class, -1 if none. */
902
enumDef *enums; /* List of enums. */
903
varDef *vars; /* List of variables. */
904
memberDef *othfuncs; /* List of other functions. */
905
overDef *overs; /* Global overloads. */
906
typedefDef *typedefs; /* List of typedefs. */
907
codeBlock *copying; /* Software license. */
908
codeBlock *exphdrcode; /* Exported header code. */
909
codeBlock *hdrcode; /* Header code. */
910
codeBlock *cppcode; /* Global C++ code. */
911
codeBlock *docs; /* Documentation. */
912
codeBlock *preinitcode; /* Pre-initialisation code. */
913
codeBlock *postinitcode; /* Post-initialisation code. */
914
codeBlock *unitcode; /* Compileation unit code. */
915
ifaceFileList *used; /* Interface files used. */
916
int sigslots; /* Set if signals or slots are used. */
917
int genc; /* Set if we are generating C code. */
918
struct _stringList *options; /* The list of options. */
901
moduleDef *module; /* This module. */
902
moduleDef *modules; /* The list of modules. */
903
nameDef *namecache; /* The name cache. */
904
ifaceFileDef *ifacefiles; /* The list of interface files. */
905
classDef *classes; /* The list of classes. */
906
classTmplDef *classtemplates; /* The list of class templates. */
907
classDef *proxies; /* The list of proxy classes. */
908
exceptionDef *exceptions; /* The list of exceptions. */
909
mappedTypeDef *mappedtypes; /* The mapped types. */
910
mappedTypeTmplDef *mappedtypetemplates; /* The list of mapped type templates. */
911
int qobjclass; /* QObject class, -1 if none. */
912
enumDef *enums; /* List of enums. */
913
varDef *vars; /* List of variables. */
914
memberDef *othfuncs; /* List of other functions. */
915
overDef *overs; /* Global overloads. */
916
typedefDef *typedefs; /* List of typedefs. */
917
codeBlock *copying; /* Software license. */
918
codeBlock *exphdrcode; /* Exported header code. */
919
codeBlock *hdrcode; /* Header code. */
920
codeBlock *cppcode; /* Global C++ code. */
921
codeBlock *docs; /* Documentation. */
922
codeBlock *preinitcode; /* Pre-initialisation code. */
923
codeBlock *postinitcode; /* Post-initialisation code. */
924
codeBlock *unitcode; /* Compilation unit code. */
925
ifaceFileList *used; /* Interface files used. */
926
int sigslots; /* Set if signals or slots are used. */
927
int genc; /* Set if we are generating C code. */
928
struct _stringList *options; /* The list of options. */
922
932
/* A list of strings. */
924
934
typedef struct _stringList {
925
const char *s; /* The string. */
926
struct _stringList *next; /* The next in the list. */
935
const char *s; /* The string. */
936
struct _stringList *next; /* The next in the list. */
930
940
/* File specific context information for the parser. */
932
942
typedef struct _parserContext {
933
int ifdepth; /* The depth of nested if's. */
934
moduleDef *prevmod; /* The previous module. */
943
int ifdepth; /* The depth of nested if's. */
944
moduleDef *prevmod; /* The previous module. */
938
extern char *sipVersion; /* The version of SIP. */
939
extern stringList *includeDirList; /* The include directory list for SIP files. */
948
extern char *sipVersion; /* The version of SIP. */
949
extern stringList *includeDirList; /* The include directory list for SIP files. */
942
952
void parse(sipSpec *,FILE *,char *,stringList *,stringList *);