📄 sip.h
字号:
typedef struct _signatureList { struct _signatureDef *sd; /* The signature. */ struct _signatureList *next; /* Next in the list. */} signatureList;/* A template type. */typedef struct _templateDef { scopedNameDef *fqname; /* The name. */ signatureDef types; /* The types. */} templateDef;/* A list of virtual handlers. */typedef struct _virtHandlerDef { int virthandlernr; /* The nr. of the virtual handler. */ int vhflags; /* The virtual handler flags. */ signatureDef *sd; /* The signature. */ struct _moduleDef *module; /* The defining module. */ codeBlock *virtcode; /* Virtual handler code. */ struct _virtHandlerDef *next; /* Next in the list. */} virtHandlerDef;/* A typedef definition. */typedef struct _typedefDef { scopedNameDef *fqname; /* The fully qualified name. */ struct _classDef *ecd; /* The enclosing class. */ moduleDef *module; /* The owning module. */ argDef type; /* The actual type. */ struct _typedefDef *next; /* Next in the list. */} typedefDef;/* A variable definition. */typedef struct _varDef { nameDef *pyname; /* The variable Python name. */ scopedNameDef *fqcname; /* The fully qualified C/C++ name. */ struct _classDef *ecd; /* The enclosing class. */ moduleDef *module; /* The owning module. */ int varflags; /* The variable flags. */ argDef type; /* The actual type. */ codeBlock *accessfunc; /* The access function. */ codeBlock *getcode; /* The get code. */ codeBlock *setcode; /* The set code. */ struct _varDef *next; /* Next in the list. */} varDef;/* An overloaded member function definition. */typedef struct _overDef { char *cppname; /* The C++ name. */ int overflags; /* The overload flags. */ struct _memberDef *common; /* Common parts. */ signatureDef pysig; /* The Python signature. */ signatureDef *cppsig; /* The C++ signature. */ throwArgs *exceptions; /* The exceptions. */ codeBlock *methodcode; /* Method code. */ virtHandlerDef *virthandler; /* The virtual handler. */ char *prehook; /* The pre-hook name. */ char *posthook; /* The post-hook name. */ struct _overDef *next; /* Next in the list. */} overDef;/* An overloaded constructor definition. */typedef struct _ctorDef { int ctorflags; /* The ctor flags. */ signatureDef pysig; /* The Python signature. */ signatureDef *cppsig; /* The C++ signature. */ throwArgs *exceptions; /* The exceptions. */ codeBlock *methodcode; /* Method code. */ char *prehook; /* The pre-hook name. */ char *posthook; /* The post-hook name. */ struct _ctorDef *next; /* Next in the list. */} ctorDef;/* An enumerated type member definition. */typedef struct _enumMemberDef { nameDef *pyname; /* The Python name. */ char *cname; /* The C/C++ name. */ struct _enumDef *ed; /* The enclosing enum. */ struct _enumMemberDef *next; /* Next in the list. */} enumMemberDef;/* An enumerated type definition. */typedef struct _enumDef { int enumflags; /* The enum flags. */ scopedNameDef *fqcname; /* The name (may be NULL). */ nameDef *pyname; /* The Python name (may be NULL). */ int enumnr; /* The enum number. */ struct _classDef *ecd; /* The enclosing class. */ struct _classDef *pcd; /* The publishing class. */ moduleDef *module; /* The owning module. */ enumMemberDef *members; /* The list of members. */ struct _memberDef *slots; /* The list of slots. */ struct _overDef *overs; /* The list of slot overloads. */ struct _enumDef *next; /* Next in the list. */} enumDef;/* An member function definition. */typedef struct _memberDef { nameDef *pyname; /* The Python name. */ int memberflags; /* The member flags. */ slotType slot; /* The slot type. */ moduleDef *module; /* The owning module. */ struct _memberDef *next; /* Next in the list. */} memberDef;/* A list of visible member functions. */typedef struct _visibleList { memberDef *m; /* The member definition. */ struct _classDef *cd; /* The class. */ struct _visibleList *next; /* Next in the list. */} visibleList;/* An entry in a linked class list. */typedef struct _classList { struct _classDef *cd; /* The class itself. */ struct _classList *next; /* Next in the list. */} classList;/* A virtual overload definition. */typedef struct _virtOverDef { overDef o; /* The overload. */ struct _classDef *scope; /* The overload scope. */ struct _virtOverDef *next; /* Next in the list. */} virtOverDef;/* A class that appears in a class's hierarchy. */typedef struct _mroDef { struct _classDef *cd; /* The class. */ int mroflags; /* The hierarchy flags. */ struct _mroDef *next; /* The next in the list. */} mroDef;/* A class definition. */typedef struct _classDef { int classflags; /* The class flags. */ int classnr; /* The class number. */ char *pyname; /* The Python name. */ ifaceFileDef *iff; /* The interface file. */ struct _classDef *ecd; /* The enclosing scope. */ struct _classDef *real; /* The real class if this is a proxy or extender. */ nodeDef *node; /* Position in class tree. */ classList *supers; /* The parent classes. */ mroDef *mro; /* The super-class hierarchy. */ templateDef *td; /* The instantiated template. */ ctorDef *ctors; /* The constructors. */ ctorDef *defctor; /* The default ctor. */ codeBlock *dealloccode; /* Handwritten dealloc code. */ codeBlock *dtorcode; /* Handwritten dtor code. */ throwArgs *dtorexceptions; /* The dtor exceptions. */ memberDef *members; /* The member functions. */ overDef *overs; /* The overloads. */ argList *casts; /* The operator casts. */ virtOverDef *vmembers; /* The virtual members. */ visibleList *visible; /* The visible members. */ codeBlock *cppcode; /* Class C++ code. */ codeBlock *hdrcode; /* Class header code. */ codeBlock *convtosubcode; /* Convert to sub C++ code. */ struct _classDef *subbase; /* Sub-class base class. */ codeBlock *convtocode; /* Convert to C++ code. */ codeBlock *travcode; /* Traverse code. */ codeBlock *clearcode; /* Clear code. */ codeBlock *readbufcode; /* Read buffer code. */ codeBlock *writebufcode; /* Write buffer code. */ codeBlock *segcountcode; /* Segment count code. */ codeBlock *charbufcode; /* Character buffer code. */ struct _classDef *next; /* Next in the list. */} classDef;/* A class template definition. */typedef struct _classTmplDef { signatureDef sig; /* The template arguments. */ classDef *cd; /* The class itself. */ struct _classTmplDef *next; /* The next in the list. */} classTmplDef;/* A mapped type template definition. */typedef struct _mappedTypeTmplDef { signatureDef sig; /* The template arguments. */ mappedTypeDef *mt; /* The mapped type itself. */ struct _mappedTypeTmplDef *next; /* The next in the list. */} mappedTypeTmplDef;/* The parse tree corresponding to the specification file. */typedef struct { moduleDef *module; /* This module. */ moduleDef *modules; /* The list of modules. */ moduleListDef *allimports; /* The list of all imports. */ nameDef *namecache; /* The name cache. */ ifaceFileDef *ifacefiles; /* The list of interface files. */ classDef *classes; /* The list of classes. */ classTmplDef *classtemplates; /* The list of class templates. */ classDef *proxies; /* The list of proxy classes. */ exceptionDef *exceptions; /* The list of exceptions. */ mappedTypeDef *mappedtypes; /* The mapped types. */ mappedTypeTmplDef *mappedtypetemplates; /* The list of mapped type templates. */ int qobjclass; /* QObject class, -1 if none. */ enumDef *enums; /* List of enums. */ varDef *vars; /* List of variables. */ memberDef *othfuncs; /* List of other functions. */ overDef *overs; /* Global overloads. */ typedefDef *typedefs; /* List of typedefs. */ codeBlock *copying; /* Software license. */ codeBlock *hdrcode; /* Header code. */ codeBlock *cppcode; /* Global C++ code. */ codeBlock *docs; /* Documentation. */ codeBlock *preinitcode; /* Pre-initialisation code. */ codeBlock *postinitcode; /* Post-initialisation code. */ ifaceFileList *used; /* Interface files used. */ int sigslots; /* Set if signals or slots are used. */ int genc; /* Set if we are generating C code. */ int emitters; /* Set if we are generating signal emitters. */} sipSpec;/* A list of strings. */typedef struct _stringList { char *s; /* The string. */ struct _stringList *next; /* The next in the list. */} stringList;/* File specific context information for the parser. */typedef struct _parserContext { int ifdepth; /* The depth of nested if's. */ moduleDef *prevmod; /* The previous module. */} parserContext;extern char *sipVersion; /* The version of SIP. */extern stringList *includeDirList; /* The include directory list for SIP files. */void parse(sipSpec *,FILE *,char *,stringList *,stringList *);void parserEOF(char *,parserContext *);void transform(sipSpec *);void generateCode(sipSpec *,char *,char *,char *,char *,char *,int,int,int,int,stringList *);void warning(char *,...);void fatal(char *,...);void fatalScopedName(scopedNameDef *);void setInputFile(FILE *,char *,parserContext *,int);void *sipMalloc(size_t);char *sipStrdup(char *);char *concat(char *,...);void append(char **,char *);ifaceFileList *addToUsedList(ifaceFileList **, ifaceFileDef *);int excludedFeature(stringList *,qualDef *);int sameSignature(signatureDef *,signatureDef *,int);int sameTemplateSignature(signatureDef *sd1, signatureDef *sd2, int deep);int sameScopedName(scopedNameDef *,scopedNameDef *);int sameBaseType(argDef *,argDef *);char *scopedNameTail(scopedNameDef *);scopedNameDef *text2scopePart(char *);scopedNameDef *copyScopedName(scopedNameDef *);void appendScopedName(scopedNameDef **,scopedNameDef *);void freeScopedName(scopedNameDef *);void appendToClassList(classList **,classDef *);void prOverloadName(FILE *fp, overDef *od);int isIntReturnSlot(memberDef *md);int isLongReturnSlot(memberDef *md);int isVoidReturnSlot(memberDef *md);int isNumberSlot(memberDef *md);int isRichCompareSlot(memberDef *md);mappedTypeDef *allocMappedType(argDef *type);void appendTypeStrings(scopedNameDef *ename, signatureDef *patt, signatureDef *src, signatureDef *known, scopedNameDef **names, scopedNameDef **values);codeBlock *templateCode(sipSpec *pt, ifaceFileList **used, codeBlock *ocb, scopedNameDef *names, scopedNameDef *values);ifaceFileDef *findIfaceFile(sipSpec *pt, moduleDef *mod, scopedNameDef *fqname, ifaceFileType iftype, argDef *ad);void yywarning(char *);/* These are only here because bison publically references them. *//* Represent a set of option flags. */#define MAX_NR_FLAGS 5typedef enum { bool_flag, string_flag, name_flag, opt_name_flag, integer_flag} flagType;typedef struct { char *fname; /* The flag name. */ flagType ftype; /* The flag type. */ union { /* The flag value. */ char *sval; /* A string value. */ long ival; /* An integer value. */ } fvalue;} optFlag;typedef struct { int nrFlags; /* The number of flags. */ optFlag flags[MAX_NR_FLAGS]; /* Each flag. */} optFlags;#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -