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