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