File indexing completed on 2026-03-29 08:35:55
0001
0002
0003
0004
0005 #ifndef _ITCLDECLS
0006 #define _ITCLDECLS
0007
0008 #if defined(USE_ITCL_STUBS)
0009
0010 ITCLAPI const char *Itcl_InitStubs(
0011 Tcl_Interp *, const char *version, int exact);
0012 #else
0013
0014 #define Itcl_InitStubs(interp, version, exact) Tcl_PkgRequireEx(interp,"itcl",version,exact,NULL)
0015
0016 #endif
0017
0018 #if (TCL_MAJOR_VERSION < 9) && defined(TCL_MINOR_VERSION) && (TCL_MINOR_VERSION < 7)
0019 # define Tcl_ObjCmdProc2 Tcl_ObjCmdProc
0020 #endif
0021
0022
0023
0024 #define ITCL_STUBS_EPOCH 0
0025 #define ITCL_STUBS_REVISION 157
0026
0027 #ifdef __cplusplus
0028 extern "C" {
0029 #endif
0030
0031
0032
0033
0034
0035
0036 ITCLAPI int Itcl_RegisterObjC2(Tcl_Interp *interp,
0037 const char *name, Tcl_ObjCmdProc2 *proc,
0038 void *clientData,
0039 Tcl_CmdDeleteProc *deleteProc);
0040
0041 ITCLAPI int Itcl_FindC2(Tcl_Interp *interp, const char *name,
0042 Tcl_ObjCmdProc2 **objProcPtr,
0043 void **cDataPtr);
0044
0045 ITCLAPI int Itcl_RegisterC(Tcl_Interp *interp, const char *name,
0046 Tcl_CmdProc *proc, void *clientData,
0047 Tcl_CmdDeleteProc *deleteProc);
0048
0049 ITCLAPI int Itcl_RegisterObjC(Tcl_Interp *interp,
0050 const char *name, Tcl_ObjCmdProc *proc,
0051 void *clientData,
0052 Tcl_CmdDeleteProc *deleteProc);
0053
0054 ITCLAPI int Itcl_FindC(Tcl_Interp *interp, const char *name,
0055 Tcl_CmdProc **argProcPtr,
0056 Tcl_ObjCmdProc **objProcPtr, void **cDataPtr);
0057
0058 ITCLAPI void Itcl_InitStack(Itcl_Stack *stack);
0059
0060 ITCLAPI void Itcl_DeleteStack(Itcl_Stack *stack);
0061
0062 ITCLAPI void Itcl_PushStack(void *cdata, Itcl_Stack *stack);
0063
0064 ITCLAPI void * Itcl_PopStack(Itcl_Stack *stack);
0065
0066 ITCLAPI void * Itcl_PeekStack(Itcl_Stack *stack);
0067
0068 ITCLAPI void * Itcl_GetStackValue(Itcl_Stack *stack, Tcl_Size pos);
0069
0070 ITCLAPI void Itcl_InitList(Itcl_List *listPtr);
0071
0072 ITCLAPI void Itcl_DeleteList(Itcl_List *listPtr);
0073
0074 ITCLAPI Itcl_ListElem * Itcl_CreateListElem(Itcl_List *listPtr);
0075
0076 ITCLAPI Itcl_ListElem * Itcl_DeleteListElem(Itcl_ListElem *elemPtr);
0077
0078 ITCLAPI Itcl_ListElem * Itcl_InsertList(Itcl_List *listPtr, void *val);
0079
0080 ITCLAPI Itcl_ListElem * Itcl_InsertListElem(Itcl_ListElem *pos, void *val);
0081
0082 ITCLAPI Itcl_ListElem * Itcl_AppendList(Itcl_List *listPtr, void *val);
0083
0084 ITCLAPI Itcl_ListElem * Itcl_AppendListElem(Itcl_ListElem *pos, void *val);
0085
0086 ITCLAPI void Itcl_SetListValue(Itcl_ListElem *elemPtr, void *val);
0087
0088 ITCLAPI void Itcl_EventuallyFree(void *cdata, Tcl_FreeProc *fproc);
0089
0090 ITCLAPI void Itcl_PreserveData(void *cdata);
0091
0092 ITCLAPI void Itcl_ReleaseData(void *cdata);
0093
0094 ITCLAPI Itcl_InterpState Itcl_SaveInterpState(Tcl_Interp *interp, int status);
0095
0096 ITCLAPI int Itcl_RestoreInterpState(Tcl_Interp *interp,
0097 Itcl_InterpState state);
0098
0099 ITCLAPI void Itcl_DiscardInterpState(Itcl_InterpState state);
0100
0101 ITCLAPI void * Itcl_Alloc(size_t size);
0102
0103 ITCLAPI void Itcl_Free(void *ptr);
0104
0105 typedef struct {
0106 const struct ItclIntStubs *itclIntStubs;
0107 } ItclStubHooks;
0108
0109 typedef struct ItclStubs {
0110 int magic;
0111 int epoch;
0112 int revision;
0113 const ItclStubHooks *hooks;
0114
0115 int (*itcl_RegisterObjC2) (Tcl_Interp *interp, const char *name, Tcl_ObjCmdProc2 *proc, void *clientData, Tcl_CmdDeleteProc *deleteProc);
0116 int (*itcl_FindC2) (Tcl_Interp *interp, const char *name, Tcl_ObjCmdProc2 **objProcPtr, void **cDataPtr);
0117 int (*itcl_RegisterC) (Tcl_Interp *interp, const char *name, Tcl_CmdProc *proc, void *clientData, Tcl_CmdDeleteProc *deleteProc);
0118 int (*itcl_RegisterObjC) (Tcl_Interp *interp, const char *name, Tcl_ObjCmdProc *proc, void *clientData, Tcl_CmdDeleteProc *deleteProc);
0119 int (*itcl_FindC) (Tcl_Interp *interp, const char *name, Tcl_CmdProc **argProcPtr, Tcl_ObjCmdProc **objProcPtr, void **cDataPtr);
0120 void (*itcl_InitStack) (Itcl_Stack *stack);
0121 void (*itcl_DeleteStack) (Itcl_Stack *stack);
0122 void (*itcl_PushStack) (void *cdata, Itcl_Stack *stack);
0123 void * (*itcl_PopStack) (Itcl_Stack *stack);
0124 void * (*itcl_PeekStack) (Itcl_Stack *stack);
0125 void * (*itcl_GetStackValue) (Itcl_Stack *stack, Tcl_Size pos);
0126 void (*itcl_InitList) (Itcl_List *listPtr);
0127 void (*itcl_DeleteList) (Itcl_List *listPtr);
0128 Itcl_ListElem * (*itcl_CreateListElem) (Itcl_List *listPtr);
0129 Itcl_ListElem * (*itcl_DeleteListElem) (Itcl_ListElem *elemPtr);
0130 Itcl_ListElem * (*itcl_InsertList) (Itcl_List *listPtr, void *val);
0131 Itcl_ListElem * (*itcl_InsertListElem) (Itcl_ListElem *pos, void *val);
0132 Itcl_ListElem * (*itcl_AppendList) (Itcl_List *listPtr, void *val);
0133 Itcl_ListElem * (*itcl_AppendListElem) (Itcl_ListElem *pos, void *val);
0134 void (*itcl_SetListValue) (Itcl_ListElem *elemPtr, void *val);
0135 void (*itcl_EventuallyFree) (void *cdata, Tcl_FreeProc *fproc);
0136 void (*itcl_PreserveData) (void *cdata);
0137 void (*itcl_ReleaseData) (void *cdata);
0138 Itcl_InterpState (*itcl_SaveInterpState) (Tcl_Interp *interp, int status);
0139 int (*itcl_RestoreInterpState) (Tcl_Interp *interp, Itcl_InterpState state);
0140 void (*itcl_DiscardInterpState) (Itcl_InterpState state);
0141 void * (*itcl_Alloc) (size_t size);
0142 void (*itcl_Free) (void *ptr);
0143 } ItclStubs;
0144
0145 extern const ItclStubs *itclStubsPtr;
0146
0147 #ifdef __cplusplus
0148 }
0149 #endif
0150
0151 #if defined(USE_ITCL_STUBS)
0152
0153
0154
0155
0156
0157 #define Itcl_RegisterObjC2 \
0158 (itclStubsPtr->itcl_RegisterObjC2)
0159 #define Itcl_FindC2 \
0160 (itclStubsPtr->itcl_FindC2)
0161 #define Itcl_RegisterC \
0162 (itclStubsPtr->itcl_RegisterC)
0163 #define Itcl_RegisterObjC \
0164 (itclStubsPtr->itcl_RegisterObjC)
0165 #define Itcl_FindC \
0166 (itclStubsPtr->itcl_FindC)
0167 #define Itcl_InitStack \
0168 (itclStubsPtr->itcl_InitStack)
0169 #define Itcl_DeleteStack \
0170 (itclStubsPtr->itcl_DeleteStack)
0171 #define Itcl_PushStack \
0172 (itclStubsPtr->itcl_PushStack)
0173 #define Itcl_PopStack \
0174 (itclStubsPtr->itcl_PopStack)
0175 #define Itcl_PeekStack \
0176 (itclStubsPtr->itcl_PeekStack)
0177 #define Itcl_GetStackValue \
0178 (itclStubsPtr->itcl_GetStackValue)
0179 #define Itcl_InitList \
0180 (itclStubsPtr->itcl_InitList)
0181 #define Itcl_DeleteList \
0182 (itclStubsPtr->itcl_DeleteList)
0183 #define Itcl_CreateListElem \
0184 (itclStubsPtr->itcl_CreateListElem)
0185 #define Itcl_DeleteListElem \
0186 (itclStubsPtr->itcl_DeleteListElem)
0187 #define Itcl_InsertList \
0188 (itclStubsPtr->itcl_InsertList)
0189 #define Itcl_InsertListElem \
0190 (itclStubsPtr->itcl_InsertListElem)
0191 #define Itcl_AppendList \
0192 (itclStubsPtr->itcl_AppendList)
0193 #define Itcl_AppendListElem \
0194 (itclStubsPtr->itcl_AppendListElem)
0195 #define Itcl_SetListValue \
0196 (itclStubsPtr->itcl_SetListValue)
0197 #define Itcl_EventuallyFree \
0198 (itclStubsPtr->itcl_EventuallyFree)
0199 #define Itcl_PreserveData \
0200 (itclStubsPtr->itcl_PreserveData)
0201 #define Itcl_ReleaseData \
0202 (itclStubsPtr->itcl_ReleaseData)
0203 #define Itcl_SaveInterpState \
0204 (itclStubsPtr->itcl_SaveInterpState)
0205 #define Itcl_RestoreInterpState \
0206 (itclStubsPtr->itcl_RestoreInterpState)
0207 #define Itcl_DiscardInterpState \
0208 (itclStubsPtr->itcl_DiscardInterpState)
0209 #define Itcl_Alloc \
0210 (itclStubsPtr->itcl_Alloc)
0211 #define Itcl_Free \
0212 (itclStubsPtr->itcl_Free)
0213
0214 #endif
0215
0216
0217
0218 #if (TCL_MAJOR_VERSION < 9)
0219 # if defined(TCL_MINOR_VERSION) && (TCL_MINOR_VERSION < 7)
0220 # undef Tcl_ObjCmdProc2
0221 # endif
0222 # undef Itcl_RegisterObjC2
0223 # define Itcl_RegisterObjC2 Itcl_RegisterObjC
0224 # undef Itcl_FindC2
0225 # define Itcl_FindC2(interp, name, objProcPtr, cDataPtr) \
0226 Itcl_FindC(interp, name, NULL, objProcPtr, cDataPtr)
0227 #endif
0228
0229 #endif