⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sip.h

📁 这是关于RFC3261实现sip的源代码
💻 H
📖 第 1 页 / 共 2 页
字号:
	struct _sipExportedModuleDef *im_module;	/* The imported module. */} sipImportedModuleDef;/* * The main client module structure. */typedef struct _sipExportedModuleDef {	struct _sipExportedModuleDef *em_next;	/* The next in the list. */	unsigned em_api_minor;		/* The SIP API minor version number. */	char *em_name;			/* The module name. */	PyObject *em_nameobj;		/* The module name as an object. */	int em_version;			/* The module version. */	sipImportedModuleDef *em_imports;	/* The imported modules. */	struct _sipQtAPI *em_qt_api;	/* The optional Qt support API. */	int em_nrtypes;			/* The number of types. */	struct _sipWrapperType **em_types;	/* The table of type types. */	sipExternalTypeDef *em_external;	/* The table of external types. */	sipMappedType **em_mappedtypes;	/* The table of mapped types. */	int em_nrenums;			/* The number of enums. */	PyTypeObject **em_enums;	/* The table of enum types. */	sipEnumDef *em_enumdefs;	/* The table of enum type data. */	int em_nrenummembers;		/* The number of members in global enums. */	sipEnumMemberDef *em_enummembers;	/* The table of members in global enums. */	sipTypedefDef *em_typedefs;	/* The table of typedefs. */	sipVirtHandlerFunc *em_virthandlers;	/* The table of virtual handlers. */	sipSubClassConvertorDef *em_convertors;	/* The sub-class convertors. */	sipInstancesDef em_instances;	/* The static instances. */	struct _sipLicenseDef *em_license;	/* The license. */	PyObject **em_exceptions;	/* The table of exception types. */	sipPySlotExtenderDef *em_slotextend;	/* The table of Python slot extenders. */	sipInitExtenderDef *em_initextend;	/* The table of initialiser extenders. */	void (*em_delayeddtors)(const sipDelayedDtor *);	/* The delayed dtor handler. */	sipDelayedDtor *em_ddlist;	/* The list of delayed dtors. */} sipExportedModuleDef;/* * The API implementing the optional Qt support. */typedef struct _sipQtAPI {	struct _sipWrapperType **qt_qobject;	/* The QObject type. */	int (*qt_is_qt_signal)(void *, const char *);	void *(*qt_create_universal_signal_shortcut)(void *, const char *, const char **);	void *(*qt_create_universal_signal)(void *, const struct _sipSignature *);	void *(*qt_find_universal_signal_shortcut)(void *, const char *, const char **);	void *(*qt_find_universal_signal)(void *, const struct _sipSignature *);	int (*qt_emit_signal_shortcut)(void *, const char *, PyObject *);	int (*qt_emit_signal)(void *, const struct _sipSignature *, PyObject *);	void *(*qt_create_universal_slot)(struct _sipWrapper *, struct _sipSlotConnection *, const char **);	void (*qt_destroy_universal_slot)(void *);	void *(*qt_find_slot)(void *, const char *, PyObject *, const char *, const char **);	int (*qt_connect)(void *, const char *, void *, const char *, int);	int (*qt_disconnect)(void *, const char *, void *, const char *);	int (*qt_signals_blocked)(void *);	const void *(*qt_get_sender)();	void (*qt_forget_sender)();	int (*qt_same_name)(const char *, const char *);} sipQtAPI;/* * The information describing a license to be added to a dictionary. */typedef struct _sipLicenseDef {	char *lc_type;			/* The type of license. */	char *lc_licensee;		/* The licensee. */	char *lc_timestamp;		/* The timestamp. */	char *lc_signature;		/* The signature. */} sipLicenseDef;/* * The information describing a void pointer instance to be added to a * dictionary. */typedef struct _sipVoidPtrInstanceDef {	char *vi_name;			/* The void pointer name. */	void *vi_val;			/* The void pointer value. */} sipVoidPtrInstanceDef;/* * The information describing a char instance to be added to a dictionary. */typedef struct _sipCharInstanceDef {	char *ci_name;			/* The char name. */	char ci_val;			/* The char value. */} sipCharInstanceDef;/* * The information describing a string instance to be added to a dictionary. */typedef struct _sipStringInstanceDef {	char *si_name;			/* The string name. */	char *si_val;			/* The string value. */} sipStringInstanceDef;/* * The information describing an int instance to be added to a dictionary. */typedef struct _sipIntInstanceDef {	char *ii_name;			/* The int name. */	int ii_val;			/* The int value. */} sipIntInstanceDef;/* * The information describing a long instance to be added to a dictionary. */typedef struct _sipLongInstanceDef {	char *li_name;			/* The long name. */	long li_val;			/* The long value. */} sipLongInstanceDef;/* * The information describing an unsigned long instance to be added to a * dictionary. */typedef struct _sipUnsignedLongInstanceDef {	char *uli_name;			/* The unsigned long name. */	unsigned long uli_val;		/* The unsigned long value. */} sipUnsignedLongInstanceDef;/* * The information describing a long long instance to be added to a dictionary. */typedef struct _sipLongLongInstanceDef {	char *lli_name;			/* The long long name. */#if defined(HAVE_LONG_LONG)	long long lli_val;		/* The long long value. */#else	long lli_val;#endif} sipLongLongInstanceDef;/* * The information describing an unsigned long long instance to be added to a * dictionary. */typedef struct _sipUnsignedLongLongInstanceDef {	char *ulli_name;		/* The unsigned long long name. */#if defined(HAVE_LONG_LONG)	unsigned long long ulli_val;	/* The unsigned long long value. */#else	unsigned long ulli_val;#endif} sipUnsignedLongLongInstanceDef;/* * The information describing a double instance to be added to a dictionary. */typedef struct _sipDoubleInstanceDef {	char *di_name;			/* The double name. */	double di_val;			/* The double value. */} sipDoubleInstanceDef;/* * The information describing a class instance to be added to a dictionary. */typedef struct _sipClassInstanceDef {	char *ci_name;			/* The class instance name. */	void *ci_ptr;			/* The actual instance. */	struct _sipWrapperType **ci_type;	/* A pointer to the Python type. */	int ci_flags;			/* The wrapping flags. */} sipClassInstanceDef;/* * The information describing an enum instance to be added to a dictionary. */typedef struct _sipEnumInstanceDef {	char *ei_name;			/* The enum instance name. */	int ei_val;			/* The enum value. */	PyTypeObject **ei_type;		/* A pointer to the Python type. */} sipEnumInstanceDef;/* * Define a mapping between a wrapped type identified by a string and the * corresponding Python type. */typedef struct _sipStringTypeClassMap {	char *typeString;		/* The type as a string. */	struct _sipWrapperType **pyType;	/* A pointer to the Python type. */} sipStringTypeClassMap;/* * Define a mapping between a wrapped type identified by an integer and the * corresponding Python type. */typedef struct _sipIntTypeClassMap {	int typeInt;			/* The type as an integer. */	struct _sipWrapperType **pyType;	/* A pointer to the Python type. */} sipIntTypeClassMap;/* * A Python method's component parts.  This allows us to re-create the method * without changing the reference counts of the components. */typedef struct _sipPyMethod {	PyObject *mfunc;		/* The function. */	PyObject *mself;		/* Self if it is a bound method. */	PyObject *mclass;		/* The class. */} sipPyMethod;/* * Cache a reference to a Python member function. */typedef struct _sipMethodCache {	int mcflags;			/* Method cache flags. */	sipPyMethod pyMethod;		/* The method. */} sipMethodCache;/* * A slot (in the Qt, rather than Python, sense). */typedef struct _sipSlot {	char *name;			/* Name if a Qt or Python signal. */	PyObject *pyobj;		/* Signal or Qt slot object. */	sipPyMethod meth;		/* Python slot method, pyobj is NULL. */	PyObject *weakSlot;		/* A weak reference to the slot. */} sipSlot;/* * A receiver of a Python signal. */typedef struct _sipPySigRx {	sipSlot rx;			/* The receiver. */	struct _sipPySigRx *next;	/* Next in the list. */} sipPySigRx;/* * A Python signal. */typedef struct _sipPySig {	char *name;			/* The name of the signal. */	sipPySigRx *rxlist;		/* The list of receivers. */	struct _sipPySig *next;		/* Next in the list. */} sipPySig;/* * This defines a single dynamic signal argument type. */typedef struct _sipSigArg {	sipSigArgType atype;		/* The type. */	union {		sipWrapperType *wt;	/* The Python type for classes. */		sipMappedType *mt;	/* The data for mapped types. */		PyTypeObject *et;	/* The Python type for named enums. */	} u;} sipSigArg;/* * A parsed signal signature. */typedef struct _sipSignature {	int sg_nrargs;			/* The number of arguments. */	sipSigArg *sg_args;		/* The parsed arguments (heap). */	char *sg_signature;		/* The unparsed signature (heap). */	struct _sipSignature *sg_next;	/* The next in the list. */} sipSignature;/* * A connection to a universal slot. */typedef struct _sipSlotConnection {	void *sc_transmitter;		/* The transmitter QObject. */	const sipSignature *sc_signature;	/* The parsed signature. */	sipSlot sc_slot;		/* The slot. */} sipSlotConnection;/* * Maps the name of a Qt signal to a wrapper function to emit it. */typedef struct _sipQtSignal {	char *st_name;			/* The signal name. */	sipEmitFunc st_emitfunc;	/* The emitter function. */} sipQtSignal;/* * The API exported by the SIP module, ie. pointers to all the data and * functions that can be used by generated code. */typedef struct _sipAPIDef {	/*	 * This must be the first entry and it's signature must not change so	 * that version number mismatches can be detected and reported.	 */	int (*api_export_module)(sipExportedModuleDef *client,unsigned api_major,unsigned api_minor,PyObject *mod_dict);	/*	 * The following are part of the public API.	 */	void (*api_bad_catcher_result)(PyObject *method);	void (*api_bad_length_for_slice)(int seqlen,int slicelen);	PyObject *(*api_build_result)(int *isErr,char *fmt,...);	PyObject *(*api_call_method)(int *isErr,PyObject *method,char *fmt,...);	PyObject *(*api_class_name)(PyObject *self);	PyObject *(*api_connect_rx)(PyObject *txObj,const char *sig,PyObject *rxObj,const char *slot, int type);	int (*api_convert_from_sequence_index)(int idx,int len);	int (*api_can_convert_to_instance)(PyObject *pyObj, sipWrapperType *type, int flags);	int (*api_can_convert_to_mapped_type)(PyObject *pyObj, sipMappedType *mt, int flags);	void *(*api_convert_to_instance)(PyObject *pyObj, sipWrapperType *type, PyObject *transferObj, int flags, int *statep, int *iserrp);	void *(*api_convert_to_mapped_type)(PyObject *pyObj, sipMappedType *mt, PyObject *transferObj, int flags, int *statep, int *iserrp);	void *(*api_force_convert_to_instance)(PyObject *pyObj, sipWrapperType *type, PyObject *transferObj, int flags, int *statep, int *iserrp);	void *(*api_force_convert_to_mapped_type)(PyObject *pyObj, sipMappedType *mt, PyObject *transferObj, int flags, int *statep, int *iserrp);	void (*api_release_instance)(void *cpp, sipWrapperType *type, int state);	void (*api_release_mapped_type)(void *cpp, const sipMappedType *mt, int state);	PyObject *(*api_convert_from_instance)(void *cpp, sipWrapperType *type, PyObject *transferObj);	PyObject *(*api_convert_from_new_instance)(void *cpp, sipWrapperType *type, PyObject *transferObj);	PyObject *(*api_convert_from_mapped_type)(void *cpp, const sipMappedType *mt, PyObject *transferObj);	void *(*api_convert_to_cpp)(PyObject *sipSelf,sipWrapperType *type,int *iserrp);	int (*api_get_state)(PyObject *transferObj);	const sipMappedType *(*api_find_mapped_type)(const char *type);	PyObject *(*api_disconnect_rx)(PyObject *txObj,const char *sig,PyObject *rxObj,const char *slot);	int (*api_emit_signal)(PyObject *self,const char *sig,PyObject *sigargs);	void (*api_free)(void *mem);	PyObject *(*api_get_sender)();	PyObject *(*api_get_wrapper)(void *cppPtr,sipWrapperType *type);	void *(*api_malloc)(size_t nbytes);	sipWrapperType *(*api_map_int_to_class)(int typeInt,const sipIntTypeClassMap *map,int maplen);	sipWrapperType *(*api_map_string_to_class)(const char *typeString,const sipStringTypeClassMap *map,int maplen);	int (*api_parse_result)(int *isErr,PyObject *method,PyObject *res,char *fmt,...);	void (*api_trace)(unsigned mask,const char *fmt,...);	void (*api_transfer)(PyObject *self,int toCpp);	void (*api_transfer_back)(PyObject *self);	void (*api_transfer_to)(PyObject *self,PyObject *owner);	int (*api_wrapper_check)(PyObject *o);	unsigned long (*api_long_as_unsigned_long)(PyObject *o);	PyObject *(*api_convert_from_named_enum)(int eval, PyTypeObject *et);	/*	 * The following may be used by Qt support code but no other	 * handwritten code.	 */	PyObject *(*api_convert_from_void_ptr)(void *val);	void (*api_free_connection)(sipSlotConnection *conn);	int (*api_emit_to_slot)(sipSlot *slot, PyObject *sigargs);	int (*api_same_connection)(sipSlotConnection *conn, void *tx, const char *sig, PyObject *rxObj, const char *slot);	void *(*api_convert_rx)(sipWrapper *txSelf, const char *sigargs, PyObject *rxObj, const char *slot, const char **memberp);	/*	 * The following are not part of the public API.	 */	int (*api_parse_args)(int *argsParsedp,PyObject *sipArgs,char *fmt,...);	int (*api_parse_pair)(int *argsParsedp,PyObject *arg0,PyObject *arg1,char *fmt,...);	void (*api_common_ctor)(sipMethodCache *cache,int nrmeths);	void (*api_common_dtor)(sipWrapper *sipSelf);	void *(*api_convert_to_void_ptr)(PyObject *obj);	void (*api_no_function)(int argsParsed,char *func);	void (*api_no_method)(int argsParsed,char *classname,char *method);	void (*api_abstract_method)(char *classname,char *method);	void (*api_bad_class)(const char *classname);	void (*api_bad_set_type)(const char *classname,const char *var);	void *(*api_get_cpp_ptr)(sipWrapper *w,sipWrapperType *type);	void *(*api_get_complex_cpp_ptr)(sipWrapper *w);	PyObject *(*api_is_py_method)(sip_gilstate_t *gil,sipMethodCache *pymc,sipWrapper *sipSelf,char *cname,char *mname);	void (*api_call_hook)(char *hookname);	void (*api_start_thread)(void);	void (*api_end_thread)(void);	void (*api_raise_unknown_exception)(void);	void (*api_raise_class_exception)(sipWrapperType *type,void *ptr);	void (*api_raise_sub_class_exception)(sipWrapperType *type,void *ptr);	int (*api_add_class_instance)(PyObject *dict,char *name,void *cppPtr,sipWrapperType *wt);	int (*api_add_enum_instance)(PyObject *dict,char *name,int value,PyTypeObject *type);	void (*api_bad_operator_arg)(PyObject *self, PyObject *arg, sipPySlotType st);	PyObject *(*api_pyslot_extend)(sipExportedModuleDef *mod, sipPySlotType st, sipWrapperType *type, PyObject *arg0, PyObject *arg1);	void (*api_add_delayed_dtor)(sipWrapper *w);	int (*api_add_mapped_type_instance)(PyObject *dict,char *name,void *cppPtr,sipMappedType *mt);} sipAPIDef;/* * These are flags that can be passed to sipCanConvertToInstance(), * sipConvertToInstance() and sipForceConvertToInstance(). */#define	SIP_NOT_NONE		0x01	/* Disallow None. */#define	SIP_NO_CONVERTORS	0x02	/* Disable any type convertors. *//* * These are the state flags returned by %ConvertToTypeCode.  Note that these * share the same "namespace" as the flags below. */#define	SIP_TEMPORARY		0x01	/* A temporary instance. */#define	SIP_DERIVED_CLASS	0x02	/* The instance is derived. *//* * Useful macros, not part of the public API. */#define	SIP_PY_OWNED		0x04	/* Owned by Python. */#define	SIP_INDIRECT		0x08	/* If there is a level of indirection. */#define	SIP_ACCFUNC		0x10	/* If there is an access function. */#define	SIP_NOT_IN_MAP		0x20	/* If Python object not in the map. */#define	SIP_SHARE_MAP		0x40	/* If the map slot might be occupied. */#define	sipIsPyOwned(w)		((w) -> flags & SIP_PY_OWNED)#define	sipSetPyOwned(w)	((w) -> flags |= SIP_PY_OWNED)#define	sipResetPyOwned(w)	((w) -> flags &= ~SIP_PY_OWNED)#define	sipIsDerived(w)		((w) -> flags & SIP_DERIVED_CLASS)#define	sipIsIndirect(w)	((w) -> flags & SIP_INDIRECT)#define	sipIsAccessFunc(w)	((w) -> flags & SIP_ACCFUNC)#define	sipNotInMap(w)		((w) -> flags & SIP_NOT_IN_MAP)#define	SIP_TYPE_ABSTRACT	0x01	/* If the type is abstract. */#define	SIP_TYPE_SCC		0x02	/* If the type is subject to sub-class convertors. */#define	sipTypeIsAbstract(wt)	((wt)->type->td_flags & SIP_TYPE_ABSTRACT)#define	sipTypeHasSCC(wt)	((wt)->type->td_flags & SIP_TYPE_SCC)#ifdef __cplusplus}#endif#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -