PLplot  5.15.0
sip.h
Go to the documentation of this file.
1 /*
2  * The SIP module interface.
3  *
4  * Copyright (c) 2020 Riverbank Computing Limited <info@riverbankcomputing.com>
5  *
6  * This file is part of SIP.
7  *
8  * This copy of SIP is licensed for use under the terms of the SIP License
9  * Agreement. See the file LICENSE for more details.
10  *
11  * This copy of SIP may also used under the terms of the GNU General Public
12  * License v2 or v3 as published by the Free Software Foundation which can be
13  * found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package.
14  *
15  * SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17  */
18 
19 
20 #ifndef _SIP_H
21 #define _SIP_H
22 
23 
24 #include <Python.h>
25 
26 /* Sanity check on the Python version. */
27 #if PY_VERSION_HEX < 0x03050000
28 #error "This version of SIP requires Python v3.5 or later"
29 #endif
30 
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 
37 /* The patch version of this implementation of the ABI. */
38 #define SIP_MODULE_PATCH_VERSION 1
39 
40 
41 /*
42  * The changes to this version of the ABI.
43  *
44  * Preserve any current exception in the wrapper tp_dealloc functions.
45  */
46 
47 
48 /* The ABI version implemented. */
49 #define SIP_ABI_MAJOR_VERSION 12
50 #define SIP_ABI_MINOR_VERSION 8
51 
52 /* The version of the code generator. */
53 #define SIP_VERSION 0x60101
54 #define SIP_VERSION_STR "6.1.1"
55 
56 /* These are all dependent on the user-specified name of the sip module. */
57 #define _SIP_MODULE_FQ_NAME "PyQt5.sip"
58 #define _SIP_MODULE_NAME "sip"
59 #define _SIP_MODULE_SHARED 1
60 #define _SIP_MODULE_ENTRY PyInit_sip
61 #define _SIP_MODULE_LEGACY 1
62 
63 /* Support the historical names. */
64 #define SIP_API_MAJOR_NR SIP_ABI_MAJOR_VERSION
65 #define SIP_API_MINOR_NR SIP_ABI_MINOR_VERSION
66 
67 
68 /*
69  * Qt includes this typedef and its meta-object system explicitly converts
70  * types to uint. If these correspond to signal arguments then that conversion
71  * is exposed. Therefore SIP generates code that uses it. This definition is
72  * for the cases that SIP is generating non-Qt related bindings with compilers
73  * that don't include it themselves (i.e. MSVC).
74  */
75 typedef unsigned int uint;
76 
77 
78 /* Some C++ compatibility stuff. */
79 #if defined(__cplusplus)
80 
81 /*
82  * Cast a PyCFunctionWithKeywords to a PyCFunction in such a way that it
83  * suppresses the GCC -Wcast-function-type warning.
84  */
85 #define SIP_MLMETH_CAST(m) reinterpret_cast<PyCFunction>(reinterpret_cast<void (*)(void)>(m))
86 
87 #if __cplusplus >= 201103L || defined(_MSVC_LANG)
88 
89 /* C++11 and later. */
90 #define SIP_NULLPTR nullptr
91 #define SIP_OVERRIDE override
92 
93 #else
94 
95 /* Earlier versions of C++. */
96 #define SIP_NULLPTR NULL
97 #define SIP_OVERRIDE
98 
99 #endif
100 
101 #else
102 
103 /* Cast a PyCFunctionWithKeywords to a PyCFunction. */
104 #define SIP_MLMETH_CAST(m) ((PyCFunction)(m))
105 
106 /* C. */
107 #define SIP_NULLPTR NULL
108 #define SIP_OVERRIDE
109 
110 #endif
111 
112 
113 /* Remove in v5.1. */
114 #define SIP_SSIZE_T Py_ssize_t
115 #define SIP_SSIZE_T_FORMAT "%zd"
116 #define SIP_USE_PYCAPSULE
117 #define SIP_MODULE_RETURN(v) return (v)
118 
119 /*
120  * Remove in v5.1. These are undocumented and can be removed when PyQt5 drops
121  * support for Python v2.
122  */
123 #define SIPLong_Check PyLong_Check
124 #define SIPLong_FromLong PyLong_FromLong
125 #define SIPLong_AsLong PyLong_AsLong
126 
127 #define SIPBytes_Check PyBytes_Check
128 #define SIPBytes_FromString PyBytes_FromString
129 #define SIPBytes_FromStringAndSize PyBytes_FromStringAndSize
130 #define SIPBytes_AsString PyBytes_AsString
131 #define SIPBytes_Size PyBytes_Size
132 #define SIPBytes_AS_STRING PyBytes_AS_STRING
133 #define SIPBytes_GET_SIZE PyBytes_GET_SIZE
134 
135 
136 /*
137  * The mask that can be passed to sipTrace().
138  */
139 #define SIP_TRACE_CATCHERS 0x0001
140 #define SIP_TRACE_CTORS 0x0002
141 #define SIP_TRACE_DTORS 0x0004
142 #define SIP_TRACE_INITS 0x0008
143 #define SIP_TRACE_DEALLOCS 0x0010
144 #define SIP_TRACE_METHODS 0x0020
145 
146 
147 /*
148  * Hide some thread dependent stuff.
149  */
150 #ifdef WITH_THREAD
151 typedef PyGILState_STATE sip_gilstate_t;
152 #define SIP_RELEASE_GIL(gs) PyGILState_Release(gs);
153 #define SIP_BLOCK_THREADS {PyGILState_STATE sipGIL = PyGILState_Ensure();
154 #define SIP_UNBLOCK_THREADS PyGILState_Release(sipGIL);}
155 #else
156 typedef int sip_gilstate_t;
157 #define SIP_RELEASE_GIL(gs)
158 #define SIP_BLOCK_THREADS
159 #define SIP_UNBLOCK_THREADS
160 #endif
161 
162 
163 /*
164  * Forward declarations of types.
165  */
166 struct _sipBufferDef;
167 typedef struct _sipBufferDef sipBufferDef;
168 
169 struct _sipBufferInfoDef;
170 typedef struct _sipBufferInfoDef sipBufferInfoDef;
171 
172 struct _sipCFunctionDef;
173 typedef struct _sipCFunctionDef sipCFunctionDef;
174 
175 struct _sipDateDef;
176 typedef struct _sipDateDef sipDateDef;
177 
178 struct _sipEnumTypeObject;
180 
181 struct _sipMethodDef;
182 typedef struct _sipMethodDef sipMethodDef;
183 
184 struct _sipSimpleWrapper;
185 typedef struct _sipSimpleWrapper sipSimpleWrapper;
186 
187 struct _sipTimeDef;
188 typedef struct _sipTimeDef sipTimeDef;
189 
190 struct _sipTypeDef;
191 typedef struct _sipTypeDef sipTypeDef;
192 
193 struct _sipWrapperType;
194 typedef struct _sipWrapperType sipWrapperType;
195 
196 struct _sipWrapper;
197 typedef struct _sipWrapper sipWrapper;
198 
199 
200 /*
201  * The different events a handler can be registered for.
202  */
203 typedef enum
204 {
205  sipEventWrappedInstance, /* After wrapping a C/C++ instance. */
206  sipEventCollectingWrapper, /* When garbage collecting a wrapper object. */
209 
210 /*
211  * The event handlers.
212  */
213 typedef void (*sipWrappedInstanceEventHandler)(void *sipCpp);
215 
216 
217 /*
218  * The operation an access function is being asked to perform.
219  */
220 typedef enum
221 {
222  UnguardedPointer, /* Return the unguarded pointer. */
223  GuardedPointer, /* Return the guarded pointer, ie. 0 if it has gone. */
224  ReleaseGuard /* Release the guard, if any. */
226 
227 
228 /*
229  * Some convenient function pointers.
230  */
231 typedef void *(*sipInitFunc)(sipSimpleWrapper *, PyObject *, PyObject *,
232  PyObject **, PyObject **, PyObject **);
233 typedef int (*sipFinalFunc)(PyObject *, void *, PyObject *, PyObject **);
234 typedef void *(*sipAccessFunc)(sipSimpleWrapper *, AccessFuncOp);
235 typedef int (*sipTraverseFunc)(void *, visitproc, void *);
236 typedef int (*sipClearFunc)(void *);
237 typedef int (*sipGetBufferFuncLimited)(PyObject *, void *, sipBufferDef *);
238 typedef void (*sipReleaseBufferFuncLimited)(PyObject *, void *);
239 #if !defined(Py_LIMITED_API)
240 typedef int (*sipGetBufferFunc)(PyObject *, void *, Py_buffer *, int);
241 typedef void (*sipReleaseBufferFunc)(PyObject *, void *, Py_buffer *);
242 #endif
243 typedef void (*sipDeallocFunc)(sipSimpleWrapper *);
244 typedef void *(*sipCastFunc)(void *, const sipTypeDef *);
245 typedef const sipTypeDef *(*sipSubClassConvertFunc)(void **);
246 typedef int (*sipConvertToFunc)(PyObject *, void **, int *, PyObject *);
247 typedef PyObject *(*sipConvertFromFunc)(void *, PyObject *);
250  sipSimpleWrapper *, PyObject *, ...);
251 typedef void (*sipAssignFunc)(void *, Py_ssize_t, void *);
252 typedef void *(*sipArrayFunc)(Py_ssize_t);
253 typedef void *(*sipCopyFunc)(const void *, Py_ssize_t);
254 typedef void (*sipReleaseFunc)(void *, int);
255 typedef PyObject *(*sipPickleFunc)(void *);
256 typedef int (*sipAttrGetterFunc)(const sipTypeDef *, PyObject *);
257 typedef PyObject *(*sipVariableGetterFunc)(void *, PyObject *, PyObject *);
258 typedef int (*sipVariableSetterFunc)(void *, PyObject *, PyObject *);
259 typedef void *(*sipProxyResolverFunc)(void *);
261 typedef void (*sipWrapperVisitorFunc)(sipSimpleWrapper *, void *);
262 
263 
264 #if !defined(Py_LIMITED_API)
265 /*
266  * The meta-type of a wrapper type.
267  */
268 struct _sipWrapperType {
269  /*
270  * The super-metatype. This must be first in the structure so that it can
271  * be cast to a PyTypeObject *.
272  */
273  PyHeapTypeObject super;
274 
275  /* Set if the type is a user implemented Python sub-class. */
276  unsigned wt_user_type : 1;
277 
278  /* Set if the type's dictionary contains all lazy attributes. */
279  unsigned wt_dict_complete : 1;
280 
281  /* Unused and available for future use. */
282  unsigned wt_unused : 30;
283 
284  /* The generated type structure. */
285  sipTypeDef *wt_td;
286 
287  /* The list of init extenders. */
289 
290  /* The handler called whenever a new user type has been created. */
292 
293  /*
294  * For the user to use. Note that any data structure will leak if the
295  * type is garbage collected.
296  */
297  void *wt_user_data;
298 };
299 
300 
301 /*
302  * The type of a simple C/C++ wrapper object.
303  */
304 struct _sipSimpleWrapper {
305  PyObject_HEAD
306 
307  /*
308  * The data, initially a pointer to the C/C++ object, as interpreted by the
309  * access function.
310  */
311  void *data;
312 
313  /* The optional access function. */
315 
316  /* Object flags. */
317  unsigned sw_flags;
318 
319  /* The optional dictionary of extra references keyed by argument number. */
320  PyObject *extra_refs;
321 
322  /* For the user to use. */
323  PyObject *user;
324 
325  /* The instance dictionary. */
326  PyObject *dict;
327 
328  /* The main instance if this is a mixin. */
329  PyObject *mixin_main;
330 
331  /* Next object at this address. */
332  struct _sipSimpleWrapper *next;
333 };
334 
335 
336 /*
337  * The type of a C/C++ wrapper object that supports parent/child relationships.
338  */
339 struct _sipWrapper {
340  /* The super-type. */
342 
343  /* First child object. */
344  struct _sipWrapper *first_child;
345 
346  /* Next sibling. */
347  struct _sipWrapper *sibling_next;
348 
349  /* Previous sibling. */
350  struct _sipWrapper *sibling_prev;
351 
352  /* Owning object. */
353  struct _sipWrapper *parent;
354 };
355 
356 
357 /*
358  * Removed in v5.1.
359  * The meta-type of an enum type. (This is exposed only to support the
360  * deprecated sipConvertFromNamedEnum() macro.)
361  */
362 struct _sipEnumTypeObject {
363  /*
364  * The super-metatype. This must be first in the structure so that it can
365  * be cast to a PyTypeObject *.
366  */
367  PyHeapTypeObject super;
368 
369  /* The generated type structure. */
370  struct _sipTypeDef *type;
371 };
372 #endif
373 
374 
375 /*
376  * The information describing an encoded type ID.
377  */
378 typedef struct _sipEncodedTypeDef {
379  /* The type number. */
380  unsigned sc_type : 16;
381 
382  /* The module number (255 for this one). */
383  unsigned sc_module : 8;
384 
385  /* A context specific flag. */
386  unsigned sc_flag : 1;
388 
389 
390 /*
391  * The information describing an enum member.
392  */
393 typedef struct _sipEnumMemberDef {
394  /* The member name. */
395  const char *em_name;
396 
397  /* The member value. */
398  int em_val;
399 
400  /* The member enum, -ve if anonymous. */
401  int em_enum;
403 
404 
405 /*
406  * The information describing static instances.
407  */
408 typedef struct _sipInstancesDef {
409  /* The types. */
411 
412  /* The void *. */
414 
415  /* The chars. */
417 
418  /* The strings. */
420 
421  /* The ints. */
422  struct _sipIntInstanceDef *id_int;
423 
424  /* The longs. */
426 
427  /* The unsigned longs. */
429 
430  /* The long longs. */
432 
433  /* The unsigned long longs. */
435 
436  /* The doubles. */
439 
440 
441 /*
442  * The information describing a type initialiser extender.
443  */
444 typedef struct _sipInitExtenderDef {
445  /* The API version range index. */
446  int ie_api_range;
447 
448  /* The extender function. */
450 
451  /* The class being extended. */
453 
454  /* The next extender for this class. */
457 
458 
459 /*
460  * The information describing a sub-class convertor.
461  */
462 typedef struct _sipSubClassConvertorDef {
463  /* The convertor. */
465 
466  /* The encoded base type. */
468 
469  /* The base type. */
470  struct _sipTypeDef *scc_basetype;
472 
473 
474 /*
475  * The structure populated by %BIGetBufferCode when the limited API is enabled.
476  */
477 struct _sipBufferDef {
478  /* The address of the buffer. */
479  void *bd_buffer;
480 
481  /* The length of the buffer. */
482  Py_ssize_t bd_length;
483 
484  /* Set if the buffer is read-only. */
485  int bd_readonly;
486 };
487 
488 
489 /*
490  * The structure describing a Python buffer.
491  */
492 struct _sipBufferInfoDef {
493  /* This is internal to sip. */
494  void *bi_internal;
495 
496  /* The address of the buffer. */
497  void *bi_buf;
498 
499  /* A reference to the object implementing the buffer interface. */
500  PyObject *bi_obj;
501 
502  /* The length of the buffer in bytes. */
503  Py_ssize_t bi_len;
504 
505  /* The number of dimensions. */
506  int bi_ndim;
507 
508  /* The format of each element of the buffer. */
509  char *bi_format;
510 };
511 
512 
513 /*
514  * The structure describing a Python C function.
515  */
516 struct _sipCFunctionDef {
517  /* The C function. */
518  PyMethodDef *cf_function;
519 
520  /* The optional bound object. */
521  PyObject *cf_self;
522 };
523 
524 
525 /*
526  * The structure describing a Python method.
527  */
528 struct _sipMethodDef {
529  /* The function that implements the method. */
530  PyObject *pm_function;
531 
532  /* The bound object. */
533  PyObject *pm_self;
534 };
535 
536 
537 /*
538  * The structure describing a Python date.
539  */
540 struct _sipDateDef {
541  /* The year. */
542  int pd_year;
543 
544  /* The month (1-12). */
545  int pd_month;
546 
547  /* The day (1-31). */
548  int pd_day;
549 };
550 
551 
552 /*
553  * The structure describing a Python time.
554  */
555 struct _sipTimeDef {
556  /* The hour (0-23). */
557  int pt_hour;
558 
559  /* The minute (0-59). */
560  int pt_minute;
561 
562  /* The second (0-59). */
563  int pt_second;
564 
565  /* The microsecond (0-999999). */
566  int pt_microsecond;
567 };
568 
569 
570 /*
571  * The different error states of handwritten code.
572  */
573 typedef enum {
574  sipErrorNone, /* There is no error. */
575  sipErrorFail, /* The error is a failure. */
576  sipErrorContinue /* It may not apply if a later operation succeeds. */
578 
579 
580 /*
581  * The different Python slot types. New slots must be added to the end,
582  * otherwise the major version of the internal ABI must be changed.
583  */
584 typedef enum {
585  str_slot, /* __str__ */
586  int_slot, /* __int__ */
587  float_slot, /* __float__ */
588  len_slot, /* __len__ */
589  contains_slot, /* __contains__ */
590  add_slot, /* __add__ for number */
591  concat_slot, /* __add__ for sequence types */
592  sub_slot, /* __sub__ */
593  mul_slot, /* __mul__ for number types */
594  repeat_slot, /* __mul__ for sequence types */
595  div_slot, /* __div__ */
596  mod_slot, /* __mod__ */
597  floordiv_slot, /* __floordiv__ */
598  truediv_slot, /* __truediv__ */
599  and_slot, /* __and__ */
600  or_slot, /* __or__ */
601  xor_slot, /* __xor__ */
602  lshift_slot, /* __lshift__ */
603  rshift_slot, /* __rshift__ */
604  iadd_slot, /* __iadd__ for number types */
605  iconcat_slot, /* __iadd__ for sequence types */
606  isub_slot, /* __isub__ */
607  imul_slot, /* __imul__ for number types */
608  irepeat_slot, /* __imul__ for sequence types */
609  idiv_slot, /* __idiv__ */
610  imod_slot, /* __imod__ */
611  ifloordiv_slot, /* __ifloordiv__ */
612  itruediv_slot, /* __itruediv__ */
613  iand_slot, /* __iand__ */
614  ior_slot, /* __ior__ */
615  ixor_slot, /* __ixor__ */
616  ilshift_slot, /* __ilshift__ */
617  irshift_slot, /* __irshift__ */
618  invert_slot, /* __invert__ */
619  call_slot, /* __call__ */
620  getitem_slot, /* __getitem__ */
621  setitem_slot, /* __setitem__ */
622  delitem_slot, /* __delitem__ */
623  lt_slot, /* __lt__ */
624  le_slot, /* __le__ */
625  eq_slot, /* __eq__ */
626  ne_slot, /* __ne__ */
627  gt_slot, /* __gt__ */
628  ge_slot, /* __ge__ */
629  bool_slot, /* __bool__, __nonzero__ */
630  neg_slot, /* __neg__ */
631  repr_slot, /* __repr__ */
632  hash_slot, /* __hash__ */
633  pos_slot, /* __pos__ */
634  abs_slot, /* __abs__ */
635  index_slot, /* __index__ */
636  iter_slot, /* __iter__ */
637  next_slot, /* __next__ */
638  setattr_slot, /* __setattr__, __delattr__ */
639  matmul_slot, /* __matmul__ (for Python v3.5 and later) */
640  imatmul_slot, /* __imatmul__ (for Python v3.5 and later) */
641  await_slot, /* __await__ (for Python v3.5 and later) */
642  aiter_slot, /* __aiter__ (for Python v3.5 and later) */
643  anext_slot, /* __anext__ (for Python v3.5 and later) */
644 } sipPySlotType;
645 
646 
647 /*
648  * The information describing a Python slot function.
649  */
650 typedef struct _sipPySlotDef {
651  /* The function. */
652  void *psd_func;
653 
654  /* The type. */
657 
658 
659 /*
660  * The information describing a Python slot extender.
661  */
662 typedef struct _sipPySlotExtenderDef {
663  /* The function. */
664  void *pse_func;
665 
666  /* The type. */
668 
669  /* The encoded class. */
672 
673 
674 /*
675  * The information describing a typedef.
676  */
677 typedef struct _sipTypedefDef {
678  /* The typedef name. */
679  const char *tdd_name;
680 
681  /* The typedef value. */
682  const char *tdd_type_name;
684 
685 
686 /*
687  * The information describing a variable or property.
688  */
689 
690 typedef enum
691 {
692  PropertyVariable, /* A property. */
693  InstanceVariable, /* An instance variable. */
694  ClassVariable /* A class (i.e. static) variable. */
696 
697 typedef struct _sipVariableDef {
698  /* The type of variable. */
700 
701  /* The name. */
702  const char *vd_name;
703 
704  /*
705  * The getter. If this is a variable (rather than a property) then the
706  * actual type is sipVariableGetterFunc.
707  */
708  PyMethodDef *vd_getter;
709 
710  /*
711  * The setter. If this is a variable (rather than a property) then the
712  * actual type is sipVariableSetterFunc. It is NULL if the property cannot
713  * be set or the variable is const.
714  */
715  PyMethodDef *vd_setter;
716 
717  /* The property deleter. */
718  PyMethodDef *vd_deleter;
719 
720  /* The docstring. */
721  const char *vd_docstring;
723 
724 
725 /*
726  * The information describing a type, either a C++ class (or C struct), a C++
727  * namespace, a mapped type or a named enum.
728  */
729 struct _sipTypeDef {
730  /* The version range index, -1 if the type isn't versioned. */
731  int td_version;
732 
733  /* The next version of this type. */
735 
736  /*
737  * The module, 0 if the type hasn't been initialised.
738  */
740 
741  /* Type flags, see the sipType*() macros. */
742  int td_flags;
743 
744  /* The C/C++ name of the type. */
745  int td_cname;
746 
747  /* The Python type object. */
748  PyTypeObject *td_py_type;
749 
750  /* Any additional fixed data generated by a plugin. */
751  void *td_plugin_data;
752 };
753 
754 
755 /*
756  * The information describing a container (ie. a class, namespace or a mapped
757  * type).
758  */
759 typedef struct _sipContainerDef {
760  /*
761  * The Python name of the type, -1 if this is a namespace extender (in the
762  * context of a class) or doesn't require a namespace (in the context of a
763  * mapped type). */
764  int cod_name;
765 
766  /*
767  * The scoping type or the namespace this is extending if it is a namespace
768  * extender.
769  */
771 
772  /* The number of lazy methods. */
773  int cod_nrmethods;
774 
775  /* The table of lazy methods. */
776  PyMethodDef *cod_methods;
777 
778  /* The number of lazy enum members. */
779  int cod_nrenummembers;
780 
781  /* The table of lazy enum members. */
783 
784  /* The number of variables. */
785  int cod_nrvariables;
786 
787  /* The table of variables. */
789 
790  /* The static instances. */
793 
794 
795 /*
796  * The information describing a C++ class (or C struct) or a C++ namespace.
797  */
798 typedef struct _sipClassTypeDef {
799  /* The base type information. */
801 
802  /* The container information. */
804 
805  /* The docstring. */
806  const char *ctd_docstring;
807 
808  /*
809  * The meta-type name, -1 to use the meta-type of the first super-type
810  * (normally sipWrapperType).
811  */
812  int ctd_metatype;
813 
814  /* The super-type name, -1 to use sipWrapper. */
815  int ctd_supertype;
816 
817  /* The super-types. */
819 
820  /* The table of Python slots. */
822 
823  /* The initialisation function. */
825 
826  /* The traverse function. */
828 
829  /* The clear function. */
831 
832  /* The get buffer function. */
833 #if defined(Py_LIMITED_API)
835 #else
837 #endif
838 
839  /* The release buffer function. */
840 #if defined(Py_LIMITED_API)
842 #else
844 #endif
845 
846  /* The deallocation function. */
848 
849  /* The optional assignment function. */
851 
852  /* The optional array allocation function. */
854 
855  /* The optional copy function. */
857 
858  /* The release function, 0 if a C struct. */
860 
861  /* The cast function, 0 if a C struct. */
863 
864  /* The optional convert to function. */
866 
867  /* The optional convert from function. */
869 
870  /* The next namespace extender. */
872 
873  /* The pickle function. */
875 
876  /* The finalisation function. */
878 
879  /* The mixin initialisation function. */
880  initproc ctd_init_mixin;
882 
883 
884 /*
885  * The information describing a mapped type.
886  */
887 typedef struct _sipMappedTypeDef {
888  /* The base type information. */
890 
891  /* The container information. */
893 
894  /* The optional assignment function. */
896 
897  /* The optional array allocation function. */
899 
900  /* The optional copy function. */
902 
903  /* The optional release function. */
905 
906  /* The convert to function. */
908 
909  /* The convert from function. */
912 
913 
914 /*
915  * The information describing a named enum.
916  */
917 typedef struct _sipEnumTypeDef {
918  /* The base type information. */
920 
921  /* The Python name of the enum. */
922  int etd_name;
923 
924  /* The scoping type, -1 if it is defined at the module level. */
925  int etd_scope;
926 
927  /* The Python slots. */
928  struct _sipPySlotDef *etd_pyslots;
930 
931 
932 /*
933  * The information describing an external type.
934  */
935 typedef struct _sipExternalTypeDef {
936  /* The index into the type table. */
937  int et_nr;
938 
939  /* The name of the type. */
940  const char *et_name;
942 
943 
944 /*
945  * Remove in v5.1.
946  * The information describing a mapped class. This (and anything that uses it)
947  * is deprecated.
948  */
950 
951 
952 /*
953  * Defines an entry in the module specific list of delayed dtor calls.
954  */
955 typedef struct _sipDelayedDtor {
956  /* The C/C++ instance. */
957  void *dd_ptr;
958 
959  /* The class name. */
960  const char *dd_name;
961 
962  /* Non-zero if dd_ptr is a derived class instance. */
963  int dd_isderived;
964 
965  /* Next in the list. */
966  struct _sipDelayedDtor *dd_next;
968 
969 
970 /*
971  * Defines an entry in the table of global functions all of whose overloads
972  * are versioned (so their names can't be automatically added to the module
973  * dictionary).
974  */
975 typedef struct _sipVersionedFunctionDef {
976  /* The name, -1 marks the end of the table. */
977  int vf_name;
978 
979  /* The function itself. */
980  PyCFunction vf_function;
981 
982  /* The METH_* flags. */
983  int vf_flags;
984 
985  /* The docstring. */
986  const char *vf_docstring;
987 
988  /* The API version range index. */
989  int vf_api_range;
991 
992 
993 /*
994  * Defines a virtual error handler.
995  */
996 typedef struct _sipVirtErrorHandlerDef {
997  /* The name of the handler. */
998  const char *veh_name;
999 
1000  /* The handler function. */
1003 
1004 
1005 /*
1006  * Defines a type imported from another module.
1007  */
1008 typedef union _sipImportedTypeDef {
1009  /* The type name before the module is imported. */
1010  const char *it_name;
1011 
1012  /* The type after the module is imported. */
1013  sipTypeDef *it_td;
1015 
1016 
1017 /*
1018  * Defines a virtual error handler imported from another module.
1019  */
1020 typedef union _sipImportedVirtErrorHandlerDef {
1021  /* The handler name before the module is imported. */
1022  const char *iveh_name;
1023 
1024  /* The handler after the module is imported. */
1027 
1028 
1029 /*
1030  * Defines an exception imported from another module.
1031  */
1032 typedef union _sipImportedExceptionDef {
1033  /* The exception name before the module is imported. */
1034  const char *iexc_name;
1035 
1036  /* The exception object after the module is imported. */
1037  PyObject *iexc_object;
1039 
1040 
1041 /*
1042  * The information describing an imported module.
1043  */
1044 typedef struct _sipImportedModuleDef {
1045  /* The module name. */
1046  const char *im_name;
1047 
1048  /* The types imported from the module. */
1050 
1051  /* The virtual error handlers imported from the module. */
1053 
1054  /* The exceptions imported from the module. */
1057 
1058 
1059 /*
1060  * The main client module structure.
1061  */
1062 typedef struct _sipExportedModuleDef {
1063  /* The next in the list. */
1065 
1066  /* The SIP API minor version number. */
1067  unsigned em_api_minor;
1068 
1069  /* The module name. */
1070  int em_name;
1071 
1072  /* The module name as an object. */
1073  PyObject *em_nameobj;
1074 
1075  /* The string pool. */
1076  const char *em_strings;
1077 
1078  /* The imported modules. */
1080 
1081  /* The optional Qt support API. */
1082  struct _sipQtAPI *em_qt_api;
1083 
1084  /* The number of types. */
1085  int em_nrtypes;
1086 
1087  /* The table of types. */
1088  sipTypeDef **em_types;
1089 
1090  /* The table of external types. */
1092 
1093  /* The number of members in global enums. */
1094  int em_nrenummembers;
1095 
1096  /* The table of members in global enums. */
1098 
1099  /* The number of typedefs. */
1100  int em_nrtypedefs;
1101 
1102  /* The table of typedefs. */
1104 
1105  /* The table of virtual error handlers. */
1107 
1108  /* The sub-class convertors. */
1110 
1111  /* The static instances. */
1113 
1114  /* The license. */
1115  struct _sipLicenseDef *em_license;
1116 
1117  /* The table of exception types. */
1118  PyObject **em_exceptions;
1119 
1120  /* The table of Python slot extenders. */
1122 
1123  /* The table of initialiser extenders. */
1125 
1126  /* The delayed dtor handler. */
1127  void (*em_delayeddtors)(const sipDelayedDtor *);
1128 
1129  /* The list of delayed dtors. */
1131 
1132  /*
1133  * The array of API version definitions. Each definition takes up 3
1134  * elements. If the third element of a 3-tuple is negative then the first
1135  * two elements define an API and its default version. All such
1136  * definitions will appear at the end of the array. If the first element
1137  * of a 3-tuple is negative then that is the last element of the array.
1138  */
1139  int *em_versions;
1140 
1141  /* The optional table of versioned functions. */
1144 
1145 
1146 /*
1147  * The information describing a license to be added to a dictionary.
1148  */
1149 typedef struct _sipLicenseDef {
1150  /* The type of license. */
1151  const char *lc_type;
1152 
1153  /* The licensee. */
1154  const char *lc_licensee;
1155 
1156  /* The timestamp. */
1157  const char *lc_timestamp;
1158 
1159  /* The signature. */
1160  const char *lc_signature;
1162 
1163 
1164 /*
1165  * The information describing a void pointer instance to be added to a
1166  * dictionary.
1167  */
1168 typedef struct _sipVoidPtrInstanceDef {
1169  /* The void pointer name. */
1170  const char *vi_name;
1171 
1172  /* The void pointer value. */
1173  void *vi_val;
1175 
1176 
1177 /*
1178  * The information describing a char instance to be added to a dictionary.
1179  */
1180 typedef struct _sipCharInstanceDef {
1181  /* The char name. */
1182  const char *ci_name;
1183 
1184  /* The char value. */
1185  char ci_val;
1186 
1187  /* The encoding used, either 'A', 'L', '8' or 'N'. */
1188  char ci_encoding;
1190 
1191 
1192 /*
1193  * The information describing a string instance to be added to a dictionary.
1194  * This is also used as a hack to add (or fix) other types rather than add a
1195  * new table type and so requiring a new major version of the API.
1196  */
1197 typedef struct _sipStringInstanceDef {
1198  /* The string name. */
1199  const char *si_name;
1200 
1201  /* The string value. */
1202  const char *si_val;
1203 
1204  /*
1205  * The encoding used, either 'A', 'L', '8' or 'N'. 'w' and 'W' are also
1206  * used to support the fix for wchar_t.
1207  */
1208  char si_encoding;
1210 
1211 
1212 /*
1213  * The information describing an int instance to be added to a dictionary.
1214  */
1215 typedef struct _sipIntInstanceDef {
1216  /* The int name. */
1217  const char *ii_name;
1218 
1219  /* The int value. */
1220  int ii_val;
1222 
1223 
1224 /*
1225  * The information describing a long instance to be added to a dictionary.
1226  */
1227 typedef struct _sipLongInstanceDef {
1228  /* The long name. */
1229  const char *li_name;
1230 
1231  /* The long value. */
1232  long li_val;
1234 
1235 
1236 /*
1237  * The information describing an unsigned long instance to be added to a
1238  * dictionary.
1239  */
1240 typedef struct _sipUnsignedLongInstanceDef {
1241  /* The unsigned long name. */
1242  const char *uli_name;
1243 
1244  /* The unsigned long value. */
1245  unsigned long uli_val;
1247 
1248 
1249 /*
1250  * The information describing a long long instance to be added to a dictionary.
1251  */
1252 typedef struct _sipLongLongInstanceDef {
1253  /* The long long name. */
1254  const char *lli_name;
1255 
1256  /* The long long value. */
1257 #if defined(HAVE_LONG_LONG)
1258  PY_LONG_LONG lli_val;
1259 #else
1260  long lli_val;
1261 #endif
1263 
1264 
1265 /*
1266  * The information describing an unsigned long long instance to be added to a
1267  * dictionary.
1268  */
1269 typedef struct _sipUnsignedLongLongInstanceDef {
1270  /* The unsigned long long name. */
1271  const char *ulli_name;
1272 
1273  /* The unsigned long long value. */
1274 #if defined(HAVE_LONG_LONG)
1275  unsigned PY_LONG_LONG ulli_val;
1276 #else
1277  unsigned long ulli_val;
1278 #endif
1280 
1281 
1282 /*
1283  * The information describing a double instance to be added to a dictionary.
1284  */
1285 typedef struct _sipDoubleInstanceDef {
1286  /* The double name. */
1287  const char *di_name;
1288 
1289  /* The double value. */
1290  double di_val;
1292 
1293 
1294 /*
1295  * The information describing a class or enum instance to be added to a
1296  * dictionary.
1297  */
1298 typedef struct _sipTypeInstanceDef {
1299  /* The type instance name. */
1300  const char *ti_name;
1301 
1302  /* The actual instance. */
1303  void *ti_ptr;
1304 
1305  /* A pointer to the generated type. */
1306  struct _sipTypeDef **ti_type;
1307 
1308  /* The wrapping flags. */
1309  int ti_flags;
1311 
1312 
1313 /*
1314  * Remove in v5.1.
1315  * Define a mapping between a wrapped type identified by a string and the
1316  * corresponding Python type.
1317  */
1318 typedef struct _sipStringTypeClassMap {
1319  /* The type as a string. */
1320  const char *typeString;
1321 
1322  /* A pointer to the Python type. */
1323  struct _sipWrapperType **pyType;
1325 
1326 
1327 /*
1328  * Remove in v5.1.
1329  * Define a mapping between a wrapped type identified by an integer and the
1330  * corresponding Python type.
1331  */
1332 typedef struct _sipIntTypeClassMap {
1333  /* The type as an integer. */
1334  int typeInt;
1335 
1336  /* A pointer to the Python type. */
1337  struct _sipWrapperType **pyType;
1339 
1340 
1341 /*
1342  * A Python method's component parts. This allows us to re-create the method
1343  * without changing the reference counts of the components.
1344  */
1345 typedef struct _sipPyMethod {
1346  /* The function. */
1347  PyObject *mfunc;
1348 
1349  /* Self if it is a bound method. */
1350  PyObject *mself;
1352 
1353 
1354 /*
1355  * A slot (in the Qt, rather than Python, sense).
1356  */
1357 typedef struct _sipSlot {
1358  /* Name if a Qt or Python signal. */
1359  char *name;
1360 
1361  /* Signal or Qt slot object. */
1362  PyObject *pyobj;
1363 
1364  /* Python slot method, pyobj is NULL. */
1365  sipPyMethod meth;
1366 
1367  /* A weak reference to the slot, Py_True if pyobj has an extra reference. */
1368  PyObject *weakSlot;
1370 
1371 
1372 /*
1373  * The API exported by the SIP module, ie. pointers to all the data and
1374  * functions that can be used by generated code.
1375  */
1376 typedef struct _sipAPIDef {
1377  /*
1378  * This must be the first entry and it's signature must not change so that
1379  * version number mismatches can be detected and reported.
1380  */
1381  int (*api_export_module)(sipExportedModuleDef *client, unsigned api_major,
1382  unsigned api_minor, void *unused);
1383 
1384  /*
1385  * The following are part of the public API.
1386  */
1387  PyTypeObject *api_simplewrapper_type;
1388  PyTypeObject *api_wrapper_type;
1389  PyTypeObject *api_wrappertype_type;
1390  PyTypeObject *api_voidptr_type;
1391 
1392  void (*api_bad_catcher_result)(PyObject *method);
1393  void (*api_bad_length_for_slice)(Py_ssize_t seqlen, Py_ssize_t slicelen);
1394  PyObject *(*api_build_result)(int *isErr, const char *fmt, ...);
1395  PyObject *(*api_call_method)(int *isErr, PyObject *method, const char *fmt,
1396  ...);
1398  sipSimpleWrapper *, PyObject *, const char *, ...);
1399  PyObject *(*api_connect_rx)(PyObject *txObj, const char *sig,
1400  PyObject *rxObj, const char *slot, int type);
1401  Py_ssize_t (*api_convert_from_sequence_index)(Py_ssize_t idx,
1402  Py_ssize_t len);
1403  int (*api_can_convert_to_type)(PyObject *pyObj, const sipTypeDef *td,
1404  int flags);
1405  void *(*api_convert_to_type)(PyObject *pyObj, const sipTypeDef *td,
1406  PyObject *transferObj, int flags, int *statep, int *iserrp);
1407  void *(*api_force_convert_to_type)(PyObject *pyObj, const sipTypeDef *td,
1408  PyObject *transferObj, int flags, int *statep, int *iserrp);
1409 
1410  /*
1411  * The following are deprecated parts of the public API.
1412  */
1413  int (*api_can_convert_to_enum)(PyObject *pyObj, const sipTypeDef *td);
1414 
1415  /*
1416  * The following are part of the public API.
1417  */
1418  void (*api_release_type)(void *cpp, const sipTypeDef *td, int state);
1419  PyObject *(*api_convert_from_type)(void *cpp, const sipTypeDef *td,
1420  PyObject *transferObj);
1421  PyObject *(*api_convert_from_new_type)(void *cpp, const sipTypeDef *td,
1422  PyObject *transferObj);
1423  PyObject *(*api_convert_from_enum)(int eval, const sipTypeDef *td);
1424  int (*api_get_state)(PyObject *transferObj);
1425  PyObject *(*api_disconnect_rx)(PyObject *txObj, const char *sig,
1426  PyObject *rxObj, const char *slot);
1427  void (*api_free)(void *mem);
1428  PyObject *(*api_get_pyobject)(void *cppPtr, const sipTypeDef *td);
1429  void *(*api_malloc)(size_t nbytes);
1430  int (*api_parse_result)(int *isErr, PyObject *method, PyObject *res,
1431  const char *fmt, ...);
1432  void (*api_trace)(unsigned mask, const char *fmt, ...);
1433  void (*api_transfer_back)(PyObject *self);
1434  void (*api_transfer_to)(PyObject *self, PyObject *owner);
1435  void (*api_transfer_break)(PyObject *self);
1436  unsigned long (*api_long_as_unsigned_long)(PyObject *o);
1437  PyObject *(*api_convert_from_void_ptr)(void *val);
1438  PyObject *(*api_convert_from_const_void_ptr)(const void *val);
1439  PyObject *(*api_convert_from_void_ptr_and_size)(void *val,
1440  Py_ssize_t size);
1441  PyObject *(*api_convert_from_const_void_ptr_and_size)(const void *val,
1442  Py_ssize_t size);
1443  void *(*api_convert_to_void_ptr)(PyObject *obj);
1444  int (*api_export_symbol)(const char *name, void *sym);
1445  void *(*api_import_symbol)(const char *name);
1446  const sipTypeDef *(*api_find_type)(const char *type);
1447  int (*api_register_py_type)(PyTypeObject *type);
1448  const sipTypeDef *(*api_type_from_py_type_object)(PyTypeObject *py_type);
1449  const sipTypeDef *(*api_type_scope)(const sipTypeDef *td);
1450  const char *(*api_resolve_typedef)(const char *name);
1451  int (*api_register_attribute_getter)(const sipTypeDef *td,
1452  sipAttrGetterFunc getter);
1453  int (*api_is_api_enabled)(const char *name, int from, int to);
1454  sipErrorState (*api_bad_callable_arg)(int arg_nr, PyObject *arg);
1455  void *(*api_get_address)(struct _sipSimpleWrapper *w);
1456  void (*api_set_destroy_on_exit)(int);
1457  int (*api_enable_autoconversion)(const sipTypeDef *td, int enable);
1458  void *(*api_get_mixin_address)(struct _sipSimpleWrapper *w,
1459  const sipTypeDef *td);
1460  PyObject *(*api_convert_from_new_pytype)(void *cpp, PyTypeObject *py_type,
1461  sipWrapper *owner, sipSimpleWrapper **selfp, const char *fmt, ...);
1462  PyObject *(*api_convert_to_typed_array)(void *data, const sipTypeDef *td,
1463  const char *format, size_t stride, Py_ssize_t len, int flags);
1464  PyObject *(*api_convert_to_array)(void *data, const char *format,
1465  Py_ssize_t len, int flags);
1466  int (*api_register_proxy_resolver)(const sipTypeDef *td,
1467  sipProxyResolverFunc resolver);
1468  PyInterpreterState *(*api_get_interpreter)(void);
1471  void (*api_set_type_user_data)(sipWrapperType *, void *);
1472  void *(*api_get_type_user_data)(const sipWrapperType *);
1473  PyObject *(*api_py_type_dict)(const PyTypeObject *);
1474  const char *(*api_py_type_name)(const PyTypeObject *);
1475  int (*api_get_method)(PyObject *, sipMethodDef *);
1476  PyObject *(*api_from_method)(const sipMethodDef *);
1477  int (*api_get_c_function)(PyObject *, sipCFunctionDef *);
1478  int (*api_get_date)(PyObject *, sipDateDef *);
1479  PyObject *(*api_from_date)(const sipDateDef *);
1480  int (*api_get_datetime)(PyObject *, sipDateDef *, sipTimeDef *);
1481  PyObject *(*api_from_datetime)(const sipDateDef *, const sipTimeDef *);
1482  int (*api_get_time)(PyObject *, sipTimeDef *);
1483  PyObject *(*api_from_time)(const sipTimeDef *);
1484  int (*api_is_user_type)(const sipWrapperType *);
1485  struct _frame *(*api_get_frame)(int);
1486  int (*api_check_plugin_for_type)(const sipTypeDef *, const char *);
1487  PyObject *(*api_unicode_new)(Py_ssize_t, unsigned, int *, void **);
1488  void (*api_unicode_write)(int, void *, int, unsigned);
1489  void *(*api_unicode_data)(PyObject *, int *, Py_ssize_t *);
1490  int (*api_get_buffer_info)(PyObject *, sipBufferInfoDef *);
1492  PyObject *(*api_get_user_object)(const sipSimpleWrapper *);
1493  void (*api_set_user_object)(sipSimpleWrapper *, PyObject *);
1494 
1495  /*
1496  * The following are not part of the public API.
1497  */
1498  int (*api_init_module)(sipExportedModuleDef *client, PyObject *mod_dict);
1499  int (*api_parse_args)(PyObject **parseErrp, PyObject *sipArgs,
1500  const char *fmt, ...);
1501  int (*api_parse_pair)(PyObject **parseErrp, PyObject *arg0, PyObject *arg1,
1502  const char *fmt, ...);
1503 
1504  /*
1505  * The following are part of the public API.
1506  */
1507  void (*api_instance_destroyed)(sipSimpleWrapper *sipSelf);
1508 
1509  /*
1510  * The following are not part of the public API.
1511  */
1512  void (*api_no_function)(PyObject *parseErr, const char *func,
1513  const char *doc);
1514  void (*api_no_method)(PyObject *parseErr, const char *scope,
1515  const char *method, const char *doc);
1516  void (*api_abstract_method)(const char *classname, const char *method);
1517  void (*api_bad_class)(const char *classname);
1518  void *(*api_get_cpp_ptr)(sipSimpleWrapper *w, const sipTypeDef *td);
1519  void *(*api_get_complex_cpp_ptr)(sipSimpleWrapper *w);
1520  PyObject *(*api_is_py_method)(sip_gilstate_t *gil, char *pymc,
1521  sipSimpleWrapper *sipSelf, const char *cname, const char *mname);
1522  void (*api_call_hook)(const char *hookname);
1523  void (*api_end_thread)(void);
1524  void (*api_raise_unknown_exception)(void);
1525  void (*api_raise_type_exception)(const sipTypeDef *td, void *ptr);
1526  int (*api_add_type_instance)(PyObject *dict, const char *name,
1527  void *cppPtr, const sipTypeDef *td);
1528  void (*api_bad_operator_arg)(PyObject *self, PyObject *arg,
1529  sipPySlotType st);
1530  PyObject *(*api_pyslot_extend)(sipExportedModuleDef *mod, sipPySlotType st,
1531  const sipTypeDef *type, PyObject *arg0, PyObject *arg1);
1533  char (*api_bytes_as_char)(PyObject *obj);
1534  const char *(*api_bytes_as_string)(PyObject *obj);
1535  char (*api_string_as_ascii_char)(PyObject *obj);
1536  const char *(*api_string_as_ascii_string)(PyObject **obj);
1537  char (*api_string_as_latin1_char)(PyObject *obj);
1538  const char *(*api_string_as_latin1_string)(PyObject **obj);
1539  char (*api_string_as_utf8_char)(PyObject *obj);
1540  const char *(*api_string_as_utf8_string)(PyObject **obj);
1541 #if defined(HAVE_WCHAR_H)
1542  wchar_t (*api_unicode_as_wchar)(PyObject *obj);
1543  wchar_t *(*api_unicode_as_wstring)(PyObject *obj);
1544 #else
1545  int (*api_unicode_as_wchar)(PyObject *obj);
1546  int *(*api_unicode_as_wstring)(PyObject *obj);
1547 #endif
1548  int (*api_deprecated)(const char *classname, const char *method);
1549  void (*api_keep_reference)(PyObject *self, int key, PyObject *obj);
1550  int (*api_parse_kwd_args)(PyObject **parseErrp, PyObject *sipArgs,
1551  PyObject *sipKwdArgs, const char **kwdlist, PyObject **unused,
1552  const char *fmt, ...);
1553  void (*api_add_exception)(sipErrorState es, PyObject **parseErrp);
1555  sipSimpleWrapper *, PyObject *method, PyObject *res,
1556  const char *fmt, ...);
1559  int (*api_init_mixin)(PyObject *self, PyObject *args, PyObject *kwds,
1560  const sipClassTypeDef *ctd);
1561  PyObject *(*api_get_reference)(PyObject *self, int key);
1562 
1563  /*
1564  * The following are part of the public API.
1565  */
1567 
1568  /*
1569  * The following are not part of the public API.
1570  */
1572 
1573  /*
1574  * The following may be used by Qt support code but no other handwritten
1575  * code.
1576  */
1577  void (*api_free_sipslot)(sipSlot *slot);
1578  int (*api_same_slot)(const sipSlot *sp, PyObject *rxObj, const char *slot);
1579  void *(*api_convert_rx)(sipWrapper *txSelf, const char *sigargs,
1580  PyObject *rxObj, const char *slot, const char **memberp,
1581  int flags);
1582  PyObject *(*api_invoke_slot)(const sipSlot *slot, PyObject *sigargs);
1583  PyObject *(*api_invoke_slot_ex)(const sipSlot *slot, PyObject *sigargs,
1584  int check_receiver);
1585  int (*api_save_slot)(sipSlot *sp, PyObject *rxObj, const char *slot);
1586  void (*api_clear_any_slot_reference)(sipSlot *slot);
1587  int (*api_visit_slot)(sipSlot *slot, visitproc visit, void *arg);
1588 
1589  /*
1590  * The following are deprecated parts of the public API.
1591  */
1592  PyTypeObject *(*api_find_named_enum)(const char *type);
1593  const sipMappedType *(*api_find_mapped_type)(const char *type);
1594  sipWrapperType *(*api_find_class)(const char *type);
1595  sipWrapperType *(*api_map_int_to_class)(int typeInt,
1596  const sipIntTypeClassMap *map, int maplen);
1597  sipWrapperType *(*api_map_string_to_class)(const char *typeString,
1598  const sipStringTypeClassMap *map, int maplen);
1599 
1600  /*
1601  * The following are part of the public API.
1602  */
1603  int (*api_enable_gc)(int enable);
1604  void (*api_print_object)(PyObject *o);
1605  int (*api_register_event_handler)(sipEventType type, const sipTypeDef *td,
1606  void *handler);
1607  int (*api_convert_to_enum)(PyObject *obj, const sipTypeDef *td);
1608  int (*api_convert_to_bool)(PyObject *obj);
1609  int (*api_enable_overflow_checking)(int enable);
1610  char (*api_long_as_char)(PyObject *o);
1611  signed char (*api_long_as_signed_char)(PyObject *o);
1612  unsigned char (*api_long_as_unsigned_char)(PyObject *o);
1613  short (*api_long_as_short)(PyObject *o);
1614  unsigned short (*api_long_as_unsigned_short)(PyObject *o);
1615  int (*api_long_as_int)(PyObject *o);
1616  unsigned int (*api_long_as_unsigned_int)(PyObject *o);
1617  long (*api_long_as_long)(PyObject *o);
1618 #if defined(HAVE_LONG_LONG)
1619  PY_LONG_LONG (*api_long_as_long_long)(PyObject *o);
1620  unsigned PY_LONG_LONG (*api_long_as_unsigned_long_long)(PyObject *o);
1621 #else
1622  void *api_long_as_long_long;
1624 #endif
1625 
1626  /*
1627  * The following are not part of the public API.
1628  */
1629  void (*api_instance_destroyed_ex)(sipSimpleWrapper **sipSelfp);
1630 
1631  /*
1632  * The following are part of the public API.
1633  */
1634  int (*api_convert_from_slice_object)(PyObject *slice, Py_ssize_t length,
1635  Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step,
1636  Py_ssize_t *slicelength);
1637  size_t (*api_long_as_size_t)(PyObject *o);
1638  void (*api_visit_wrappers)(sipWrapperVisitorFunc visitor, void *closure);
1639  int (*api_register_exit_notifier)(PyMethodDef *md);
1640 
1641  /*
1642  * The following are not part of the public API.
1643  */
1644  PyObject *(*api_is_py_method_12_8)(sip_gilstate_t *gil, char *pymc,
1645  sipSimpleWrapper **sipSelfp, const char *cname, const char *mname);
1647 
1648 const sipAPIDef *sip_init_library(PyObject *mod_dict);
1649 
1650 
1651 /*
1652  * The API implementing the optional Qt support.
1653  */
1654 typedef struct _sipQtAPI {
1656  void *(*qt_create_universal_signal)(void *, const char **);
1657  void *(*qt_find_universal_signal)(void *, const char **);
1658  void *(*qt_create_universal_slot)(struct _sipWrapper *, const char *,
1659  PyObject *, const char *, const char **, int);
1660  void (*qt_destroy_universal_slot)(void *);
1661  void *(*qt_find_slot)(void *, const char *, PyObject *, const char *,
1662  const char **);
1663  int (*qt_connect)(void *, const char *, void *, const char *, int);
1664  int (*qt_disconnect)(void *, const char *, void *, const char *);
1665  int (*qt_same_name)(const char *, const char *);
1666  sipSlot *(*qt_find_sipslot)(void *, void **);
1667  int (*qt_emit_signal)(PyObject *, const char *, PyObject *);
1668  int (*qt_connect_py_signal)(PyObject *, const char *, PyObject *,
1669  const char *);
1670  void (*qt_disconnect_py_signal)(PyObject *, const char *, PyObject *,
1671  const char *);
1673 
1674 
1675 /*
1676  * These are flags that can be passed to sipCanConvertToType(),
1677  * sipConvertToType() and sipForceConvertToType().
1678  */
1679 #define SIP_NOT_NONE 0x01 /* Disallow None. */
1680 #define SIP_NO_CONVERTORS 0x02 /* Disable any type convertors. */
1681 
1682 
1683 /*
1684  * These are flags that can be passed to sipConvertToArray(). These are held
1685  * in sw_flags.
1686  */
1687 #define SIP_READ_ONLY 0x01 /* The array is read-only. */
1688 #define SIP_OWNS_MEMORY 0x02 /* The array owns its memory. */
1689 
1690 
1691 /*
1692  * These are the state flags returned by %ConvertToTypeCode. Note that the
1693  * values share the same "flagspace" as the contents of sw_flags.
1694  */
1695 #define SIP_TEMPORARY 0x01 /* A temporary instance. */
1696 #define SIP_DERIVED_CLASS 0x02 /* The instance is derived. */
1697 
1698 
1699 /*
1700  * These flags are specific to the Qt support API.
1701  */
1702 #define SIP_SINGLE_SHOT 0x01 /* The connection is single shot. */
1703 
1704 
1705 /*
1706  * Useful macros, not part of the public API.
1707  */
1708 
1709 /* These are held in sw_flags. */
1710 #define SIP_INDIRECT 0x0004 /* If there is a level of indirection. */
1711 #define SIP_ACCFUNC 0x0008 /* If there is an access function. */
1712 #define SIP_NOT_IN_MAP 0x0010 /* If Python object is not in the map. */
1713 
1714 #if !defined(Py_LIMITED_API)
1715 #define SIP_PY_OWNED 0x0020 /* If owned by Python. */
1716 #define SIP_SHARE_MAP 0x0040 /* If the map slot might be occupied. */
1717 #define SIP_CPP_HAS_REF 0x0080 /* If C/C++ has a reference. */
1718 #define SIP_POSSIBLE_PROXY 0x0100 /* If there might be a proxy slot. */
1719 #define SIP_ALIAS 0x0200 /* If it is an alias. */
1720 #define SIP_CREATED 0x0400 /* If the C/C++ object has been created. */
1721 
1722 #define sipIsDerived(sw) ((sw)->sw_flags & SIP_DERIVED_CLASS)
1723 #define sipIsIndirect(sw) ((sw)->sw_flags & SIP_INDIRECT)
1724 #define sipIsAccessFunc(sw) ((sw)->sw_flags & SIP_ACCFUNC)
1725 #define sipNotInMap(sw) ((sw)->sw_flags & SIP_NOT_IN_MAP)
1726 #define sipSetNotInMap(sw) ((sw)->sw_flags |= SIP_NOT_IN_MAP)
1727 #define sipIsPyOwned(sw) ((sw)->sw_flags & SIP_PY_OWNED)
1728 #define sipSetPyOwned(sw) ((sw)->sw_flags |= SIP_PY_OWNED)
1729 #define sipResetPyOwned(sw) ((sw)->sw_flags &= ~SIP_PY_OWNED)
1730 #define sipCppHasRef(sw) ((sw)->sw_flags & SIP_CPP_HAS_REF)
1731 #define sipSetCppHasRef(sw) ((sw)->sw_flags |= SIP_CPP_HAS_REF)
1732 #define sipResetCppHasRef(sw) ((sw)->sw_flags &= ~SIP_CPP_HAS_REF)
1733 #define sipPossibleProxy(sw) ((sw)->sw_flags & SIP_POSSIBLE_PROXY)
1734 #define sipSetPossibleProxy(sw) ((sw)->sw_flags |= SIP_POSSIBLE_PROXY)
1735 #define sipIsAlias(sw) ((sw)->sw_flags & SIP_ALIAS)
1736 #define sipWasCreated(sw) ((sw)->sw_flags & SIP_CREATED)
1737 #endif
1738 
1739 #define SIP_TYPE_TYPE_MASK 0x0007 /* The type type mask. */
1740 #define SIP_TYPE_CLASS 0x0000 /* If the type is a C++ class. */
1741 #define SIP_TYPE_NAMESPACE 0x0001 /* If the type is a C++ namespace. */
1742 #define SIP_TYPE_MAPPED 0x0002 /* If the type is a mapped type. */
1743 #define SIP_TYPE_ENUM 0x0003 /* If the type is a named enum. */
1744 #define SIP_TYPE_SCOPED_ENUM 0x0004 /* If the type is a scoped enum. */
1745 #define SIP_TYPE_ABSTRACT 0x0008 /* If the type is abstract. */
1746 #define SIP_TYPE_SCC 0x0010 /* If the type is subject to sub-class convertors. */
1747 #define SIP_TYPE_ALLOW_NONE 0x0020 /* If the type can handle None. */
1748 #define SIP_TYPE_STUB 0x0040 /* If the type is a stub. */
1749 #define SIP_TYPE_NONLAZY 0x0080 /* If the type has a non-lazy method. */
1750 #define SIP_TYPE_SUPER_INIT 0x0100 /* If the instance's super init should be called. */
1751 #define SIP_TYPE_LIMITED_API 0x0200 /* Use the limited API. If this is more generally required it may need to be moved to the module definition. */
1752 
1753 
1754 /*
1755  * The following are part of the public API.
1756  */
1757 #define sipTypeIsClass(td) (((td)->td_flags & SIP_TYPE_TYPE_MASK) == SIP_TYPE_CLASS)
1758 #define sipTypeIsNamespace(td) (((td)->td_flags & SIP_TYPE_TYPE_MASK) == SIP_TYPE_NAMESPACE)
1759 #define sipTypeIsMapped(td) (((td)->td_flags & SIP_TYPE_TYPE_MASK) == SIP_TYPE_MAPPED)
1760 #define sipTypeIsEnum(td) (((td)->td_flags & SIP_TYPE_TYPE_MASK) == SIP_TYPE_ENUM)
1761 #define sipTypeIsScopedEnum(td) (((td)->td_flags & SIP_TYPE_TYPE_MASK) == SIP_TYPE_SCOPED_ENUM)
1762 #define sipTypeAsPyTypeObject(td) ((td)->td_py_type)
1763 #define sipTypeName(td) sipNameFromPool((td)->td_module, (td)->td_cname)
1764 #define sipTypePluginData(td) ((td)->td_plugin_data)
1765 
1766 
1767 /*
1768  * Remove in v5.1.
1769  */
1770 #define sipClassName(w) PyString_FromString(Py_TYPE(w)->tp_name)
1771 #define sipIsExactWrappedType(wt) (sipTypeAsPyTypeObject((wt)->wt_td) == (PyTypeObject *)(wt))
1772 
1773 
1774 /*
1775  * The following are not part of the public API.
1776  */
1777 #define sipTypeIsAbstract(td) ((td)->td_flags & SIP_TYPE_ABSTRACT)
1778 #define sipTypeHasSCC(td) ((td)->td_flags & SIP_TYPE_SCC)
1779 #define sipTypeAllowNone(td) ((td)->td_flags & SIP_TYPE_ALLOW_NONE)
1780 #define sipTypeIsStub(td) ((td)->td_flags & SIP_TYPE_STUB)
1781 #define sipTypeSetStub(td) ((td)->td_flags |= SIP_TYPE_STUB)
1782 #define sipTypeHasNonlazyMethod(td) ((td)->td_flags & SIP_TYPE_NONLAZY)
1783 #define sipTypeCallSuperInit(td) ((td)->td_flags & SIP_TYPE_SUPER_INIT)
1784 #define sipTypeUseLimitedAPI(td) ((td)->td_flags & SIP_TYPE_LIMITED_API)
1785 
1786 /*
1787  * Get various names from the string pool for various data types.
1788  */
1789 #define sipNameFromPool(em, mr) (&((em)->em_strings)[(mr)])
1790 #define sipNameOfModule(em) sipNameFromPool((em), (em)->em_name)
1791 #define sipPyNameOfContainer(cod, td) sipNameFromPool((td)->td_module, (cod)->cod_name)
1792 #define sipPyNameOfEnum(etd) sipNameFromPool((etd)->etd_base.td_module, (etd)->etd_name)
1793 
1794 
1795 /*
1796  * The following are PyQt4-specific extensions. In SIP v5 they will be pushed
1797  * out to a plugin supplied by PyQt4.
1798  */
1799 
1800 /*
1801  * The description of a Qt signal for PyQt4.
1802  */
1803 typedef struct _pyqt4QtSignal {
1804  /* The C++ name and signature of the signal. */
1805  const char *signature;
1806 
1807  /* The optional docstring. */
1808  const char *docstring;
1809 
1810  /*
1811  * If the signal is an overload of regular methods then this points to the
1812  * code that implements those methods.
1813  */
1814  PyMethodDef *non_signals;
1815 
1816  /*
1817  * The hack to apply when built against Qt5:
1818  *
1819  * 0 - no hack
1820  * 1 - add an optional None
1821  * 2 - add an optional []
1822  * 3 - add an optional False
1823  */
1824  int hack;
1826 
1827 
1828 /*
1829  * This is the PyQt4-specific extension to the generated class type structure.
1830  */
1831 typedef struct _pyqt4ClassPluginDef {
1832  /* A pointer to the QObject sub-class's staticMetaObject class variable. */
1833  const void *static_metaobject;
1834 
1835  /*
1836  * A set of flags. At the moment only bit 0 is used to say if the type is
1837  * derived from QFlags.
1838  */
1839  unsigned flags;
1840 
1841  /*
1842  * The table of signals emitted by the type. These are grouped by signal
1843  * name.
1844  */
1845  const pyqt4QtSignal *qt_signals;
1847 
1848 
1849 /*
1850  * The following are PyQt5-specific extensions. In SIP v5 they will be pushed
1851  * out to a plugin supplied by PyQt5.
1852  */
1853 
1854 /*
1855  * The description of a Qt signal for PyQt5.
1856  */
1857 typedef int (*pyqt5EmitFunc)(void *, PyObject *);
1858 
1859 typedef struct _pyqt5QtSignal {
1860  /* The normalised C++ name and signature of the signal. */
1861  const char *signature;
1862 
1863  /* The optional docstring. */
1864  const char *docstring;
1865 
1866  /*
1867  * If the signal is an overload of regular methods then this points to the
1868  * code that implements those methods.
1869  */
1870  PyMethodDef *non_signals;
1871 
1872  /*
1873  * If the signal has optional arguments then this function will implement
1874  * emit() for the signal.
1875  */
1878 
1879 
1880 /*
1881  * This is the PyQt5-specific extension to the generated class type structure.
1882  */
1883 typedef struct _pyqt5ClassPluginDef {
1884  /* A pointer to the QObject sub-class's staticMetaObject class variable. */
1885  const void *static_metaobject;
1886 
1887  /*
1888  * A set of flags. At the moment only bit 0 is used to say if the type is
1889  * derived from QFlags.
1890  */
1891  unsigned flags;
1892 
1893  /*
1894  * The table of signals emitted by the type. These are grouped by signal
1895  * name.
1896  */
1897  const pyqt5QtSignal *qt_signals;
1898 
1899  /* The name of the interface that the class defines. */
1900  const char *qt_interface;
1902 
1903 
1904 #ifdef __cplusplus
1905 }
1906 #endif
1907 
1908 
1909 #endif
sipVariableType
Definition: build/sip.h:691
int sip_gilstate_t
Definition: build/sip.h:156
sipPySlotType
Definition: build/sip.h:584
sipEventType
Definition: build/sip.h:204
sipErrorState
Definition: build/sip.h:573
struct _sipLongInstanceDef sipLongInstanceDef
struct _pyqt5QtSignal pyqt5QtSignal
int(* sipTraverseFunc)(void *, visitproc, void *)
Definition: sip.h:235
const sipTypeDef *(* sipSubClassConvertFunc)(void **)
Definition: sip.h:245
void(* sipWrapperVisitorFunc)(sipSimpleWrapper *, void *)
Definition: sip.h:261
void(* sipReleaseBufferFuncLimited)(PyObject *, void *)
Definition: sip.h:238
sipVariableType
Definition: sip.h:691
@ ClassVariable
Definition: sip.h:694
@ InstanceVariable
Definition: sip.h:693
@ PropertyVariable
Definition: sip.h:692
struct _sipTypedefDef sipTypedefDef
struct _sipVoidPtrInstanceDef sipVoidPtrInstanceDef
void *(* sipArrayFunc)(Py_ssize_t)
Definition: sip.h:252
int sip_gilstate_t
Definition: sip.h:156
union _sipImportedTypeDef sipImportedTypeDef
void(* sipAssignFunc)(void *, Py_ssize_t, void *)
Definition: sip.h:251
struct _sipMappedTypeDef sipMappedTypeDef
struct _sipLongLongInstanceDef sipLongLongInstanceDef
int(* sipVariableSetterFunc)(void *, PyObject *, PyObject *)
Definition: sip.h:258
struct _sipTypeInstanceDef sipTypeInstanceDef
struct _sipInitExtenderDef sipInitExtenderDef
int(* sipFinalFunc)(PyObject *, void *, PyObject *, PyObject **)
Definition: sip.h:233
int(* sipGetBufferFunc)(PyObject *, void *, Py_buffer *, int)
Definition: sip.h:240
struct _sipVariableDef sipVariableDef
struct _sipContainerDef sipContainerDef
PyObject *(* sipPickleFunc)(void *)
Definition: sip.h:255
void *(* sipInitFunc)(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **)
Definition: sip.h:231
void(* sipVirtErrorHandlerFunc)(sipSimpleWrapper *, sip_gilstate_t)
Definition: sip.h:248
int(* sipAttrGetterFunc)(const sipTypeDef *, PyObject *)
Definition: sip.h:256
sipPySlotType
Definition: sip.h:584
@ ne_slot
Definition: sip.h:626
@ mul_slot
Definition: sip.h:593
@ iadd_slot
Definition: sip.h:604
@ float_slot
Definition: sip.h:587
@ xor_slot
Definition: sip.h:601
@ lt_slot
Definition: sip.h:623
@ str_slot
Definition: sip.h:585
@ aiter_slot
Definition: sip.h:642
@ irshift_slot
Definition: sip.h:617
@ hash_slot
Definition: sip.h:632
@ rshift_slot
Definition: sip.h:603
@ gt_slot
Definition: sip.h:627
@ index_slot
Definition: sip.h:635
@ or_slot
Definition: sip.h:600
@ lshift_slot
Definition: sip.h:602
@ delitem_slot
Definition: sip.h:622
@ next_slot
Definition: sip.h:637
@ floordiv_slot
Definition: sip.h:597
@ le_slot
Definition: sip.h:624
@ div_slot
Definition: sip.h:595
@ itruediv_slot
Definition: sip.h:612
@ iter_slot
Definition: sip.h:636
@ matmul_slot
Definition: sip.h:639
@ bool_slot
Definition: sip.h:629
@ imatmul_slot
Definition: sip.h:640
@ iconcat_slot
Definition: sip.h:605
@ abs_slot
Definition: sip.h:634
@ mod_slot
Definition: sip.h:596
@ irepeat_slot
Definition: sip.h:608
@ ge_slot
Definition: sip.h:628
@ ixor_slot
Definition: sip.h:615
@ neg_slot
Definition: sip.h:630
@ anext_slot
Definition: sip.h:643
@ imod_slot
Definition: sip.h:610
@ imul_slot
Definition: sip.h:607
@ await_slot
Definition: sip.h:641
@ pos_slot
Definition: sip.h:633
@ concat_slot
Definition: sip.h:591
@ repeat_slot
Definition: sip.h:594
@ int_slot
Definition: sip.h:586
@ sub_slot
Definition: sip.h:592
@ repr_slot
Definition: sip.h:631
@ getitem_slot
Definition: sip.h:620
@ truediv_slot
Definition: sip.h:598
@ idiv_slot
Definition: sip.h:609
@ eq_slot
Definition: sip.h:625
@ ior_slot
Definition: sip.h:614
@ ilshift_slot
Definition: sip.h:616
@ add_slot
Definition: sip.h:590
@ invert_slot
Definition: sip.h:618
@ call_slot
Definition: sip.h:619
@ iand_slot
Definition: sip.h:613
@ ifloordiv_slot
Definition: sip.h:611
@ isub_slot
Definition: sip.h:606
@ setitem_slot
Definition: sip.h:621
@ len_slot
Definition: sip.h:588
@ setattr_slot
Definition: sip.h:638
@ and_slot
Definition: sip.h:599
@ contains_slot
Definition: sip.h:589
AccessFuncOp
Definition: sip.h:221
@ GuardedPointer
Definition: sip.h:223
@ UnguardedPointer
Definition: sip.h:222
@ ReleaseGuard
Definition: sip.h:224
int(* pyqt5EmitFunc)(void *, PyObject *)
Definition: sip.h:1857
struct _sipPySlotDef sipPySlotDef
struct _sipImportedModuleDef sipImportedModuleDef
void(* sipWrappedInstanceEventHandler)(void *sipCpp)
Definition: sip.h:213
struct _sipDelayedDtor sipDelayedDtor
struct _sipQtAPI sipQtAPI
struct _sipAPIDef sipAPIDef
struct _sipLicenseDef sipLicenseDef
int(* sipVirtHandlerFunc)(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,...)
Definition: sip.h:249
struct _sipCharInstanceDef sipCharInstanceDef
struct _sipInstancesDef sipInstancesDef
void *(* sipAccessFunc)(sipSimpleWrapper *, AccessFuncOp)
Definition: sip.h:234
unsigned int uint
Definition: sip.h:75
const sipAPIDef * sip_init_library(PyObject *mod_dict)
struct _sipEnumTypeDef sipEnumTypeDef
void(* sipCollectingWrapperEventHandler)(sipSimpleWrapper *sipSelf)
Definition: sip.h:214
PyObject *(* sipConvertFromFunc)(void *, PyObject *)
Definition: sip.h:247
int(* sipConvertToFunc)(PyObject *, void **, int *, PyObject *)
Definition: sip.h:246
struct _sipPySlotExtenderDef sipPySlotExtenderDef
sipEventType
Definition: sip.h:204
@ sipEventNrEvents
Definition: sip.h:207
@ sipEventWrappedInstance
Definition: sip.h:205
@ sipEventCollectingWrapper
Definition: sip.h:206
void *(* sipCastFunc)(void *, const sipTypeDef *)
Definition: sip.h:244
struct _sipEncodedTypeDef sipEncodedTypeDef
void *(* sipProxyResolverFunc)(void *)
Definition: sip.h:259
sipErrorState
Definition: sip.h:573
@ sipErrorNone
Definition: sip.h:574
@ sipErrorFail
Definition: sip.h:575
@ sipErrorContinue
Definition: sip.h:576
struct _sipStringInstanceDef sipStringInstanceDef
void(* sipReleaseFunc)(void *, int)
Definition: sip.h:254
sipTypeDef sipMappedType
Definition: sip.h:949
struct _pyqt5ClassPluginDef pyqt5ClassPluginDef
struct _sipVersionedFunctionDef sipVersionedFunctionDef
int(* sipGetBufferFuncLimited)(PyObject *, void *, sipBufferDef *)
Definition: sip.h:237
struct _sipSlot sipSlot
struct _sipStringTypeClassMap sipStringTypeClassMap
struct _pyqt4ClassPluginDef pyqt4ClassPluginDef
void(* sipDeallocFunc)(sipSimpleWrapper *)
Definition: sip.h:243
struct _sipVirtErrorHandlerDef sipVirtErrorHandlerDef
int(* sipNewUserTypeFunc)(sipWrapperType *)
Definition: sip.h:260
struct _sipIntTypeClassMap sipIntTypeClassMap
struct _sipClassTypeDef sipClassTypeDef
struct _sipEnumMemberDef sipEnumMemberDef
struct _sipExternalTypeDef sipExternalTypeDef
union _sipImportedVirtErrorHandlerDef sipImportedVirtErrorHandlerDef
union _sipImportedExceptionDef sipImportedExceptionDef
struct _sipIntInstanceDef sipIntInstanceDef
struct _sipUnsignedLongLongInstanceDef sipUnsignedLongLongInstanceDef
struct _sipSubClassConvertorDef sipSubClassConvertorDef
struct _sipExportedModuleDef sipExportedModuleDef
struct _sipUnsignedLongInstanceDef sipUnsignedLongInstanceDef
void *(* sipCopyFunc)(const void *, Py_ssize_t)
Definition: sip.h:253
void(* sipReleaseBufferFunc)(PyObject *, void *, Py_buffer *)
Definition: sip.h:241
struct _pyqt4QtSignal pyqt4QtSignal
struct _sipPyMethod sipPyMethod
int(* sipClearFunc)(void *)
Definition: sip.h:236
struct _sipDoubleInstanceDef sipDoubleInstanceDef
const void * static_metaobject
Definition: build/sip.h:1833
const pyqt4QtSignal * qt_signals
Definition: build/sip.h:1845
const char * docstring
Definition: build/sip.h:1808
const char * signature
Definition: build/sip.h:1805
PyMethodDef * non_signals
Definition: build/sip.h:1814
const void * static_metaobject
Definition: build/sip.h:1885
const pyqt5QtSignal * qt_signals
Definition: build/sip.h:1897
const char * qt_interface
Definition: build/sip.h:1900
const char * docstring
Definition: build/sip.h:1864
const char * signature
Definition: build/sip.h:1861
pyqt5EmitFunc emitter
Definition: build/sip.h:1876
PyMethodDef * non_signals
Definition: build/sip.h:1870
int(* api_convert_to_bool)(PyObject *obj)
Definition: build/sip.h:1608
void(* api_end_thread)(void)
Definition: build/sip.h:1523
int(* api_init_module)(sipExportedModuleDef *client, PyObject *mod_dict)
Definition: build/sip.h:1498
int(* api_register_event_handler)(sipEventType type, const sipTypeDef *td, void *handler)
Definition: build/sip.h:1605
void(* api_abstract_method)(const char *classname, const char *method)
Definition: build/sip.h:1516
Py_ssize_t(* api_convert_from_sequence_index)(Py_ssize_t idx, Py_ssize_t len)
Definition: build/sip.h:1401
char(* api_long_as_char)(PyObject *o)
Definition: build/sip.h:1610
void * api_long_as_unsigned_long_long
Definition: build/sip.h:1623
int(* api_long_as_int)(PyObject *o)
Definition: build/sip.h:1615
void(* api_set_user_object)(sipSimpleWrapper *, PyObject *)
Definition: build/sip.h:1493
int(* api_visit_slot)(sipSlot *slot, visitproc visit, void *arg)
Definition: build/sip.h:1587
int(* api_deprecated)(const char *classname, const char *method)
Definition: build/sip.h:1548
void(* api_transfer_back)(PyObject *self)
Definition: build/sip.h:1433
void(* api_add_delayed_dtor)(sipSimpleWrapper *w)
Definition: build/sip.h:1532
int(* api_convert_from_slice_object)(PyObject *slice, Py_ssize_t length, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, Py_ssize_t *slicelength)
Definition: build/sip.h:1634
void(* api_free_sipslot)(sipSlot *slot)
Definition: build/sip.h:1577
int(* api_unicode_as_wchar)(PyObject *obj)
Definition: build/sip.h:1545
void(* api_print_object)(PyObject *o)
Definition: build/sip.h:1604
void(* api_set_destroy_on_exit)(int)
Definition: build/sip.h:1456
int(* api_save_slot)(sipSlot *sp, PyObject *rxObj, const char *slot)
Definition: build/sip.h:1585
void(* api_release_buffer_info)(sipBufferInfoDef *)
Definition: build/sip.h:1491
int(* api_register_py_type)(PyTypeObject *type)
Definition: build/sip.h:1447
int(* api_export_module)(sipExportedModuleDef *client, unsigned api_major, unsigned api_minor, void *unused)
Definition: build/sip.h:1381
int(* api_export_symbol)(const char *name, void *sym)
Definition: build/sip.h:1444
int(* api_parse_args)(PyObject **parseErrp, PyObject *sipArgs, const char *fmt,...)
Definition: build/sip.h:1499
int(* api_parse_result)(int *isErr, PyObject *method, PyObject *res, const char *fmt,...)
Definition: build/sip.h:1430
void(* api_keep_reference)(PyObject *self, int key, PyObject *obj)
Definition: build/sip.h:1549
sipErrorState(* api_bad_callable_arg)(int arg_nr, PyObject *arg)
Definition: build/sip.h:1454
int(* api_convert_to_enum)(PyObject *obj, const sipTypeDef *td)
Definition: build/sip.h:1607
PyTypeObject * api_wrapper_type
Definition: build/sip.h:1388
int(* api_register_proxy_resolver)(const sipTypeDef *td, sipProxyResolverFunc resolver)
Definition: build/sip.h:1466
int(* api_init_mixin)(PyObject *self, PyObject *args, PyObject *kwds, const sipClassTypeDef *ctd)
Definition: build/sip.h:1559
void(* api_unicode_write)(int, void *, int, unsigned)
Definition: build/sip.h:1488
void(* api_instance_destroyed_ex)(sipSimpleWrapper **sipSelfp)
Definition: build/sip.h:1629
int(* api_is_api_enabled)(const char *name, int from, int to)
Definition: build/sip.h:1453
int(* api_can_convert_to_type)(PyObject *pyObj, const sipTypeDef *td, int flags)
Definition: build/sip.h:1403
char(* api_string_as_utf8_char)(PyObject *obj)
Definition: build/sip.h:1539
sipNewUserTypeFunc(* api_set_new_user_type_handler)(const sipTypeDef *, sipNewUserTypeFunc)
Definition: build/sip.h:1469
int(* api_get_time)(PyObject *, sipTimeDef *)
Definition: build/sip.h:1482
int(* api_check_plugin_for_type)(const sipTypeDef *, const char *)
Definition: build/sip.h:1486
int(* api_get_state)(PyObject *transferObj)
Definition: build/sip.h:1424
int(* api_enable_overflow_checking)(int enable)
Definition: build/sip.h:1609
int(* api_get_date)(PyObject *, sipDateDef *)
Definition: build/sip.h:1478
void(* api_release_type)(void *cpp, const sipTypeDef *td, int state)
Definition: build/sip.h:1418
void(* api_bad_class)(const char *classname)
Definition: build/sip.h:1517
int(* api_parse_pair)(PyObject **parseErrp, PyObject *arg0, PyObject *arg1, const char *fmt,...)
Definition: build/sip.h:1501
void(* api_no_method)(PyObject *parseErr, const char *scope, const char *method, const char *doc)
Definition: build/sip.h:1514
void * api_long_as_long_long
Definition: build/sip.h:1622
PyTypeObject * api_wrappertype_type
Definition: build/sip.h:1389
int(* api_is_owned_by_python)(sipSimpleWrapper *)
Definition: build/sip.h:1566
size_t(* api_long_as_size_t)(PyObject *o)
Definition: build/sip.h:1637
void(* api_no_function)(PyObject *parseErr, const char *func, const char *doc)
Definition: build/sip.h:1512
unsigned short(* api_long_as_unsigned_short)(PyObject *o)
Definition: build/sip.h:1614
int(* api_get_buffer_info)(PyObject *, sipBufferInfoDef *)
Definition: build/sip.h:1490
short(* api_long_as_short)(PyObject *o)
Definition: build/sip.h:1613
char(* api_string_as_latin1_char)(PyObject *obj)
Definition: build/sip.h:1537
void(* api_transfer_break)(PyObject *self)
Definition: build/sip.h:1435
signed char(* api_long_as_signed_char)(PyObject *o)
Definition: build/sip.h:1611
unsigned long(* api_long_as_unsigned_long)(PyObject *o)
Definition: build/sip.h:1436
void(* api_call_procedure_method)(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const char *,...)
Definition: build/sip.h:1397
void(* api_call_error_handler)(sipVirtErrorHandlerFunc, sipSimpleWrapper *, sip_gilstate_t)
Definition: build/sip.h:1557
void(* api_call_hook)(const char *hookname)
Definition: build/sip.h:1522
int(* api_register_attribute_getter)(const sipTypeDef *td, sipAttrGetterFunc getter)
Definition: build/sip.h:1451
void(* api_transfer_to)(PyObject *self, PyObject *owner)
Definition: build/sip.h:1434
void(* api_trace)(unsigned mask, const char *fmt,...)
Definition: build/sip.h:1432
void(* api_bad_operator_arg)(PyObject *self, PyObject *arg, sipPySlotType st)
Definition: build/sip.h:1528
int(* api_is_derived_class)(sipSimpleWrapper *)
Definition: build/sip.h:1571
int(* api_get_c_function)(PyObject *, sipCFunctionDef *)
Definition: build/sip.h:1477
int(* api_same_slot)(const sipSlot *sp, PyObject *rxObj, const char *slot)
Definition: build/sip.h:1578
int(* api_get_datetime)(PyObject *, sipDateDef *, sipTimeDef *)
Definition: build/sip.h:1480
void(* api_add_exception)(sipErrorState es, PyObject **parseErrp)
Definition: build/sip.h:1553
void(* api_bad_length_for_slice)(Py_ssize_t seqlen, Py_ssize_t slicelen)
Definition: build/sip.h:1393
void(* api_set_type_user_data)(sipWrapperType *, void *)
Definition: build/sip.h:1471
void(* api_visit_wrappers)(sipWrapperVisitorFunc visitor, void *closure)
Definition: build/sip.h:1638
int(* api_register_exit_notifier)(PyMethodDef *md)
Definition: build/sip.h:1639
int(* api_add_type_instance)(PyObject *dict, const char *name, void *cppPtr, const sipTypeDef *td)
Definition: build/sip.h:1526
void(* api_bad_catcher_result)(PyObject *method)
Definition: build/sip.h:1392
void(* api_raise_type_exception)(const sipTypeDef *td, void *ptr)
Definition: build/sip.h:1525
int(* api_enable_autoconversion)(const sipTypeDef *td, int enable)
Definition: build/sip.h:1457
void(* api_free)(void *mem)
Definition: build/sip.h:1427
void(* api_raise_unknown_exception)(void)
Definition: build/sip.h:1524
int(* api_parse_kwd_args)(PyObject **parseErrp, PyObject *sipArgs, PyObject *sipKwdArgs, const char **kwdlist, PyObject **unused, const char *fmt,...)
Definition: build/sip.h:1550
int(* api_is_user_type)(const sipWrapperType *)
Definition: build/sip.h:1484
PyTypeObject * api_simplewrapper_type
Definition: build/sip.h:1387
void(* api_clear_any_slot_reference)(sipSlot *slot)
Definition: build/sip.h:1586
int(* api_can_convert_to_enum)(PyObject *pyObj, const sipTypeDef *td)
Definition: build/sip.h:1413
long(* api_long_as_long)(PyObject *o)
Definition: build/sip.h:1617
unsigned int(* api_long_as_unsigned_int)(PyObject *o)
Definition: build/sip.h:1616
int(* api_enable_gc)(int enable)
Definition: build/sip.h:1603
unsigned char(* api_long_as_unsigned_char)(PyObject *o)
Definition: build/sip.h:1612
char(* api_bytes_as_char)(PyObject *obj)
Definition: build/sip.h:1533
void(* api_instance_destroyed)(sipSimpleWrapper *sipSelf)
Definition: build/sip.h:1507
int(* api_parse_result_ex)(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *method, PyObject *res, const char *fmt,...)
Definition: build/sip.h:1554
PyTypeObject * api_voidptr_type
Definition: build/sip.h:1390
char(* api_string_as_ascii_char)(PyObject *obj)
Definition: build/sip.h:1535
int(* api_get_method)(PyObject *, sipMethodDef *)
Definition: build/sip.h:1475
void * bd_buffer
Definition: build/sip.h:479
Py_ssize_t bd_length
Definition: build/sip.h:482
void * bi_internal
Definition: build/sip.h:494
PyObject * bi_obj
Definition: build/sip.h:500
Py_ssize_t bi_len
Definition: build/sip.h:503
PyObject * cf_self
Definition: build/sip.h:521
PyMethodDef * cf_function
Definition: build/sip.h:518
const char * ci_name
Definition: build/sip.h:1182
sipDeallocFunc ctd_dealloc
Definition: build/sip.h:847
sipGetBufferFunc ctd_getbuffer
Definition: build/sip.h:836
sipConvertToFunc ctd_cto
Definition: build/sip.h:865
const char * ctd_docstring
Definition: build/sip.h:806
sipCopyFunc ctd_copy
Definition: build/sip.h:856
sipClearFunc ctd_clear
Definition: build/sip.h:830
sipFinalFunc ctd_final
Definition: build/sip.h:877
sipConvertFromFunc ctd_cfrom
Definition: build/sip.h:868
sipTypeDef ctd_base
Definition: build/sip.h:800
sipReleaseBufferFunc ctd_releasebuffer
Definition: build/sip.h:843
sipInitFunc ctd_init
Definition: build/sip.h:824
sipPickleFunc ctd_pickle
Definition: build/sip.h:874
sipReleaseFunc ctd_release
Definition: build/sip.h:859
sipEncodedTypeDef * ctd_supers
Definition: build/sip.h:818
sipContainerDef ctd_container
Definition: build/sip.h:803
sipArrayFunc ctd_array
Definition: build/sip.h:853
sipAssignFunc ctd_assign
Definition: build/sip.h:850
initproc ctd_init_mixin
Definition: build/sip.h:880
sipTraverseFunc ctd_traverse
Definition: build/sip.h:827
struct _sipClassTypeDef * ctd_nsextender
Definition: build/sip.h:871
sipPySlotDef * ctd_pyslots
Definition: build/sip.h:821
sipCastFunc ctd_cast
Definition: build/sip.h:862
PyMethodDef * cod_methods
Definition: build/sip.h:776
sipVariableDef * cod_variables
Definition: build/sip.h:788
sipInstancesDef cod_instances
Definition: build/sip.h:791
sipEnumMemberDef * cod_enummembers
Definition: build/sip.h:782
sipEncodedTypeDef cod_scope
Definition: build/sip.h:770
int pd_month
Definition: build/sip.h:545
struct _sipDelayedDtor * dd_next
Definition: build/sip.h:966
const char * dd_name
Definition: build/sip.h:960
const char * di_name
Definition: build/sip.h:1287
unsigned sc_type
Definition: build/sip.h:380
unsigned sc_flag
Definition: build/sip.h:386
unsigned sc_module
Definition: build/sip.h:383
const char * em_name
Definition: build/sip.h:395
struct _sipPySlotDef * etd_pyslots
Definition: build/sip.h:928
sipTypeDef etd_base
Definition: build/sip.h:919
struct _sipTypeDef * type
Definition: build/sip.h:370
PyHeapTypeObject super
Definition: build/sip.h:367
sipTypedefDef * em_typedefs
Definition: build/sip.h:1103
sipVirtErrorHandlerDef * em_virterrorhandlers
Definition: build/sip.h:1106
sipInstancesDef em_instances
Definition: build/sip.h:1112
sipExternalTypeDef * em_external
Definition: build/sip.h:1091
sipSubClassConvertorDef * em_convertors
Definition: build/sip.h:1109
PyObject ** em_exceptions
Definition: build/sip.h:1118
void(* em_delayeddtors)(const sipDelayedDtor *)
Definition: build/sip.h:1127
sipPySlotExtenderDef * em_slotextend
Definition: build/sip.h:1121
struct _sipQtAPI * em_qt_api
Definition: build/sip.h:1082
struct _sipLicenseDef * em_license
Definition: build/sip.h:1115
sipInitExtenderDef * em_initextend
Definition: build/sip.h:1124
struct _sipExportedModuleDef * em_next
Definition: build/sip.h:1064
const char * em_strings
Definition: build/sip.h:1076
sipEnumMemberDef * em_enummembers
Definition: build/sip.h:1097
PyObject * em_nameobj
Definition: build/sip.h:1073
sipImportedModuleDef * em_imports
Definition: build/sip.h:1079
sipVersionedFunctionDef * em_versioned_functions
Definition: build/sip.h:1142
sipDelayedDtor * em_ddlist
Definition: build/sip.h:1130
sipTypeDef ** em_types
Definition: build/sip.h:1088
const char * et_name
Definition: build/sip.h:940
const char * im_name
Definition: build/sip.h:1046
sipImportedExceptionDef * im_imported_exceptions
Definition: build/sip.h:1055
sipImportedTypeDef * im_imported_types
Definition: build/sip.h:1049
sipImportedVirtErrorHandlerDef * im_imported_veh
Definition: build/sip.h:1052
sipEncodedTypeDef ie_class
Definition: build/sip.h:452
struct _sipInitExtenderDef * ie_next
Definition: build/sip.h:455
sipInitFunc ie_extender
Definition: build/sip.h:449
struct _sipTypeInstanceDef * id_type
Definition: build/sip.h:410
struct _sipCharInstanceDef * id_char
Definition: build/sip.h:416
struct _sipVoidPtrInstanceDef * id_voidp
Definition: build/sip.h:413
struct _sipUnsignedLongLongInstanceDef * id_ullong
Definition: build/sip.h:434
struct _sipStringInstanceDef * id_string
Definition: build/sip.h:419
struct _sipLongLongInstanceDef * id_llong
Definition: build/sip.h:431
struct _sipIntInstanceDef * id_int
Definition: build/sip.h:422
struct _sipLongInstanceDef * id_long
Definition: build/sip.h:425
struct _sipUnsignedLongInstanceDef * id_ulong
Definition: build/sip.h:428
struct _sipDoubleInstanceDef * id_double
Definition: build/sip.h:437
const char * ii_name
Definition: build/sip.h:1217
struct _sipWrapperType ** pyType
Definition: build/sip.h:1337
const char * lc_type
Definition: build/sip.h:1151
const char * lc_timestamp
Definition: build/sip.h:1157
const char * lc_signature
Definition: build/sip.h:1160
const char * lc_licensee
Definition: build/sip.h:1154
const char * li_name
Definition: build/sip.h:1229
const char * lli_name
Definition: build/sip.h:1254
sipContainerDef mtd_container
Definition: build/sip.h:892
sipArrayFunc mtd_array
Definition: build/sip.h:898
sipReleaseFunc mtd_release
Definition: build/sip.h:904
sipConvertFromFunc mtd_cfrom
Definition: build/sip.h:910
sipCopyFunc mtd_copy
Definition: build/sip.h:901
sipTypeDef mtd_base
Definition: build/sip.h:889
sipConvertToFunc mtd_cto
Definition: build/sip.h:907
sipAssignFunc mtd_assign
Definition: build/sip.h:895
PyObject * pm_function
Definition: build/sip.h:530
PyObject * pm_self
Definition: build/sip.h:533
PyObject * mself
Definition: build/sip.h:1350
PyObject * mfunc
Definition: build/sip.h:1347
void * psd_func
Definition: build/sip.h:652
sipPySlotType psd_type
Definition: build/sip.h:655
sipEncodedTypeDef pse_class
Definition: build/sip.h:670
sipPySlotType pse_type
Definition: build/sip.h:667
int(* qt_connect)(void *, const char *, void *, const char *, int)
Definition: build/sip.h:1663
void(* qt_destroy_universal_slot)(void *)
Definition: build/sip.h:1660
void(* qt_disconnect_py_signal)(PyObject *, const char *, PyObject *, const char *)
Definition: build/sip.h:1670
int(* qt_same_name)(const char *, const char *)
Definition: build/sip.h:1665
int(* qt_connect_py_signal)(PyObject *, const char *, PyObject *, const char *)
Definition: build/sip.h:1668
sipTypeDef ** qt_qobject
Definition: build/sip.h:1655
int(* qt_emit_signal)(PyObject *, const char *, PyObject *)
Definition: build/sip.h:1667
int(* qt_disconnect)(void *, const char *, void *, const char *)
Definition: build/sip.h:1664
PyObject_HEAD void * data
Definition: build/sip.h:311
unsigned sw_flags
Definition: build/sip.h:317
PyObject * extra_refs
Definition: build/sip.h:320
PyObject * user
Definition: build/sip.h:323
PyObject * dict
Definition: build/sip.h:326
struct _sipSimpleWrapper * next
Definition: build/sip.h:332
sipAccessFunc access_func
Definition: build/sip.h:314
PyObject * mixin_main
Definition: build/sip.h:329
char * name
Definition: build/sip.h:1359
PyObject * pyobj
Definition: build/sip.h:1362
PyObject * weakSlot
Definition: build/sip.h:1368
sipPyMethod meth
Definition: build/sip.h:1365
const char * si_val
Definition: build/sip.h:1202
const char * si_name
Definition: build/sip.h:1199
const char * typeString
Definition: build/sip.h:1320
struct _sipWrapperType ** pyType
Definition: build/sip.h:1323
sipEncodedTypeDef scc_base
Definition: build/sip.h:467
struct _sipTypeDef * scc_basetype
Definition: build/sip.h:470
sipSubClassConvertFunc scc_convertor
Definition: build/sip.h:464
int pt_minute
Definition: build/sip.h:560
int pt_microsecond
Definition: build/sip.h:566
int pt_second
Definition: build/sip.h:563
int td_cname
Definition: build/sip.h:745
void * td_plugin_data
Definition: build/sip.h:751
PyTypeObject * td_py_type
Definition: build/sip.h:748
struct _sipExportedModuleDef * td_module
Definition: build/sip.h:739
int td_flags
Definition: build/sip.h:742
int td_version
Definition: build/sip.h:731
struct _sipTypeDef * td_next_version
Definition: build/sip.h:734
struct _sipTypeDef ** ti_type
Definition: build/sip.h:1306
const char * ti_name
Definition: build/sip.h:1300
const char * tdd_type_name
Definition: build/sip.h:682
const char * tdd_name
Definition: build/sip.h:679
const char * vd_name
Definition: build/sip.h:702
PyMethodDef * vd_getter
Definition: build/sip.h:708
const char * vd_docstring
Definition: build/sip.h:721
PyMethodDef * vd_deleter
Definition: build/sip.h:718
sipVariableType vd_type
Definition: build/sip.h:699
PyMethodDef * vd_setter
Definition: build/sip.h:715
const char * vf_docstring
Definition: build/sip.h:986
PyCFunction vf_function
Definition: build/sip.h:980
sipVirtErrorHandlerFunc veh_handler
Definition: build/sip.h:1001
const char * veh_name
Definition: build/sip.h:998
const char * vi_name
Definition: build/sip.h:1170
sipTypeDef * wt_td
Definition: build/sip.h:285
PyHeapTypeObject super
Definition: build/sip.h:273
void * wt_user_data
Definition: build/sip.h:297
struct _sipInitExtenderDef * wt_iextend
Definition: build/sip.h:288
unsigned wt_dict_complete
Definition: build/sip.h:279
unsigned wt_user_type
Definition: build/sip.h:276
sipNewUserTypeFunc wt_new_user_type_handler
Definition: build/sip.h:291
unsigned wt_unused
Definition: build/sip.h:282
struct _sipWrapper * sibling_next
Definition: build/sip.h:347
sipSimpleWrapper super
Definition: build/sip.h:341
struct _sipWrapper * parent
Definition: build/sip.h:353
struct _sipWrapper * first_child
Definition: build/sip.h:344
struct _sipWrapper * sibling_prev
Definition: build/sip.h:350
static const char * name
Definition: tkMain.c:135
const char * iexc_name
Definition: build/sip.h:1034
const char * it_name
Definition: build/sip.h:1010
sipTypeDef * it_td
Definition: build/sip.h:1013
sipVirtErrorHandlerFunc iveh_handler
Definition: build/sip.h:1025