diff options
Diffstat (limited to 'unix/dltest')
-rw-r--r-- | unix/dltest/pkga.c | 32 | ||||
-rw-r--r-- | unix/dltest/pkgb.c | 35 | ||||
-rw-r--r-- | unix/dltest/pkgc.c | 37 | ||||
-rw-r--r-- | unix/dltest/pkgd.c | 39 | ||||
-rw-r--r-- | unix/dltest/pkge.c | 15 | ||||
-rw-r--r-- | unix/dltest/pkgua.c | 41 |
6 files changed, 76 insertions, 123 deletions
diff --git a/unix/dltest/pkga.c b/unix/dltest/pkga.c index 8d40758..f001cdf 100644 --- a/unix/dltest/pkga.c +++ b/unix/dltest/pkga.c @@ -10,25 +10,16 @@ * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ -#undef STATIC_BUILD #include "tcl.h" /* - * TCL_STORAGE_CLASS is set unconditionally to DLLEXPORT because the - * Pkga_Init declaration is in the source file itself, which is only - * accessed when we are building a library. - */ -#undef TCL_STORAGE_CLASS -#define TCL_STORAGE_CLASS DLLEXPORT - -/* * Prototypes for procedures defined later in this file: */ static int Pkga_EqObjCmd(ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); + Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]); static int Pkga_QuoteObjCmd(ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); + Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]); /* *---------------------------------------------------------------------- @@ -53,10 +44,10 @@ Pkga_EqObjCmd( ClientData dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *const objv[]) /* Argument objects. */ + Tcl_Obj *CONST objv[]) /* Argument objects. */ { int result; - const char *str1, *str2; + CONST char *str1, *str2; int len1, len2; if (objc != 3) { @@ -97,7 +88,7 @@ Pkga_QuoteObjCmd( ClientData dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *const objv[]) /* Argument strings. */ + Tcl_Obj *CONST objv[]) /* Argument strings. */ { if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "value"); @@ -124,22 +115,23 @@ Pkga_QuoteObjCmd( *---------------------------------------------------------------------- */ -EXTERN int +int Pkga_Init( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ { int code; - if (Tcl_InitStubs(interp, "8.6-", 0) == NULL) { + if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { return TCL_ERROR; } - code = Tcl_PkgProvideEx(interp, "Pkga", "1.0", NULL); + code = Tcl_PkgProvide(interp, "Pkga", "1.0"); if (code != TCL_OK) { return code; } - Tcl_CreateObjCommand(interp, "pkga_eq", Pkga_EqObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "pkga_quote", Pkga_QuoteObjCmd, NULL, - NULL); + Tcl_CreateObjCommand(interp, "pkga_eq", Pkga_EqObjCmd, + (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); + Tcl_CreateObjCommand(interp, "pkga_quote", Pkga_QuoteObjCmd, + (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); return TCL_OK; } diff --git a/unix/dltest/pkgb.c b/unix/dltest/pkgb.c index 772b239..489f66b 100644 --- a/unix/dltest/pkgb.c +++ b/unix/dltest/pkgb.c @@ -11,25 +11,16 @@ * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ -#undef STATIC_BUILD #include "tcl.h" /* - * TCL_STORAGE_CLASS is set unconditionally to DLLEXPORT because the - * Pkgb_Init declaration is in the source file itself, which is only - * accessed when we are building a library. - */ -#undef TCL_STORAGE_CLASS -#define TCL_STORAGE_CLASS DLLEXPORT - -/* * Prototypes for procedures defined later in this file: */ static int Pkgb_SubObjCmd(ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); + Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]); static int Pkgb_UnsafeObjCmd(ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); + Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]); /* *---------------------------------------------------------------------- @@ -53,7 +44,7 @@ Pkgb_SubObjCmd( ClientData dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *const objv[]) /* Argument objects. */ + Tcl_Obj *CONST objv[]) /* Argument objects. */ { int first, second; @@ -91,7 +82,7 @@ Pkgb_UnsafeObjCmd( ClientData dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *const objv[]) /* Argument objects. */ + Tcl_Obj *CONST objv[]) /* Argument objects. */ { return Tcl_EvalEx(interp, "list unsafe command invoked", -1, TCL_EVAL_GLOBAL); } @@ -113,23 +104,24 @@ Pkgb_UnsafeObjCmd( *---------------------------------------------------------------------- */ -EXTERN int +int Pkgb_Init( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ { int code; - if (Tcl_InitStubs(interp, "8.6-", 0) == NULL) { + if (Tcl_InitStubs(interp, "8.5-9.1", 0) == NULL) { return TCL_ERROR; } code = Tcl_PkgProvideEx(interp, "Pkgb", "2.3", NULL); if (code != TCL_OK) { return code; } - Tcl_CreateObjCommand(interp, "pkgb_sub", Pkgb_SubObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "pkgb_unsafe", Pkgb_UnsafeObjCmd, NULL, - NULL); + Tcl_CreateObjCommand(interp, "pkgb_sub", Pkgb_SubObjCmd, + (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); + Tcl_CreateObjCommand(interp, "pkgb_unsafe", Pkgb_UnsafeObjCmd, + (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); return TCL_OK; } @@ -150,20 +142,21 @@ Pkgb_Init( *---------------------------------------------------------------------- */ -EXTERN int +int Pkgb_SafeInit( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ { int code; - if (Tcl_InitStubs(interp, "8.6-", 0) == NULL) { + if (Tcl_InitStubs(interp, "8.5-9.1", 0) == NULL) { return TCL_ERROR; } code = Tcl_PkgProvideEx(interp, "Pkgb", "2.3", NULL); if (code != TCL_OK) { return code; } - Tcl_CreateObjCommand(interp, "pkgb_sub", Pkgb_SubObjCmd, NULL, NULL); + Tcl_CreateObjCommand(interp, "pkgb_sub", Pkgb_SubObjCmd, (ClientData) 0, + (Tcl_CmdDeleteProc *) NULL); return TCL_OK; } diff --git a/unix/dltest/pkgc.c b/unix/dltest/pkgc.c index a70f929..6ad5ab4 100644 --- a/unix/dltest/pkgc.c +++ b/unix/dltest/pkgc.c @@ -11,25 +11,16 @@ * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ -#undef STATIC_BUILD #include "tcl.h" /* - * TCL_STORAGE_CLASS is set unconditionally to DLLEXPORT because the - * Pkgc_Init declaration is in the source file itself, which is only - * accessed when we are building a library. - */ -#undef TCL_STORAGE_CLASS -#define TCL_STORAGE_CLASS DLLEXPORT - -/* * Prototypes for procedures defined later in this file: */ static int Pkgc_SubObjCmd(ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); + Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]); static int Pkgc_UnsafeObjCmd(ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); + Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]); /* *---------------------------------------------------------------------- @@ -53,7 +44,7 @@ Pkgc_SubObjCmd( ClientData dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *const objv[]) /* Argument objects. */ + Tcl_Obj *CONST objv[]) /* Argument objects. */ { int first, second; @@ -91,7 +82,7 @@ Pkgc_UnsafeObjCmd( ClientData dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *const objv[]) /* Argument objects. */ + Tcl_Obj *CONST objv[]) /* Argument objects. */ { Tcl_SetObjResult(interp, Tcl_NewStringObj("unsafe command invoked", -1)); return TCL_OK; @@ -114,23 +105,24 @@ Pkgc_UnsafeObjCmd( *---------------------------------------------------------------------- */ -EXTERN int +int Pkgc_Init( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ { int code; - if (Tcl_InitStubs(interp, "8.6-", 0) == NULL) { + if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { return TCL_ERROR; } - code = Tcl_PkgProvideEx(interp, "Pkgc", "1.7.2", NULL); + code = Tcl_PkgProvide(interp, "Pkgc", "1.7.2"); if (code != TCL_OK) { return code; } - Tcl_CreateObjCommand(interp, "pkgc_sub", Pkgc_SubObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "pkgc_unsafe", Pkgc_UnsafeObjCmd, NULL, - NULL); + Tcl_CreateObjCommand(interp, "pkgc_sub", Pkgc_SubObjCmd, + (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); + Tcl_CreateObjCommand(interp, "pkgc_unsafe", Pkgc_UnsafeObjCmd, + (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); return TCL_OK; } @@ -151,7 +143,7 @@ Pkgc_Init( *---------------------------------------------------------------------- */ -EXTERN int +int Pkgc_SafeInit( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ @@ -161,10 +153,11 @@ Pkgc_SafeInit( if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { return TCL_ERROR; } - code = Tcl_PkgProvideEx(interp, "Pkgc", "1.7.2", NULL); + code = Tcl_PkgProvide(interp, "Pkgc", "1.7.2"); if (code != TCL_OK) { return code; } - Tcl_CreateObjCommand(interp, "pkgc_sub", Pkgc_SubObjCmd, NULL, NULL); + Tcl_CreateObjCommand(interp, "pkgc_sub", Pkgc_SubObjCmd, (ClientData) 0, + (Tcl_CmdDeleteProc *) NULL); return TCL_OK; } diff --git a/unix/dltest/pkgd.c b/unix/dltest/pkgd.c index e6538cd..7fe7c49 100644 --- a/unix/dltest/pkgd.c +++ b/unix/dltest/pkgd.c @@ -11,25 +11,16 @@ * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ -#undef STATIC_BUILD #include "tcl.h" /* - * TCL_STORAGE_CLASS is set unconditionally to DLLEXPORT because the - * Pkgd_Init declaration is in the source file itself, which is only - * accessed when we are building a library. - */ -#undef TCL_STORAGE_CLASS -#define TCL_STORAGE_CLASS DLLEXPORT - -/* * Prototypes for procedures defined later in this file: */ static int Pkgd_SubObjCmd(ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); + Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]); static int Pkgd_UnsafeObjCmd(ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); + Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]); /* *---------------------------------------------------------------------- @@ -53,7 +44,7 @@ Pkgd_SubObjCmd( ClientData dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *const objv[]) /* Argument objects. */ + Tcl_Obj *CONST objv[]) /* Argument objects. */ { int first, second; @@ -91,7 +82,7 @@ Pkgd_UnsafeObjCmd( ClientData dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *const objv[]) /* Argument objects. */ + Tcl_Obj *CONST objv[]) /* Argument objects. */ { Tcl_SetObjResult(interp, Tcl_NewStringObj("unsafe command invoked", -1)); return TCL_OK; @@ -114,23 +105,24 @@ Pkgd_UnsafeObjCmd( *---------------------------------------------------------------------- */ -EXTERN int +int Pkgd_Init( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ { int code; - if (Tcl_InitStubs(interp, "8.6-", 0) == NULL) { + if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { return TCL_ERROR; } - code = Tcl_PkgProvideEx(interp, "Pkgd", "7.3", NULL); + code = Tcl_PkgProvide(interp, "Pkgd", "7.3"); if (code != TCL_OK) { return code; } - Tcl_CreateObjCommand(interp, "pkgd_sub", Pkgd_SubObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "pkgd_unsafe", Pkgd_UnsafeObjCmd, NULL, - NULL); + Tcl_CreateObjCommand(interp, "pkgd_sub", Pkgd_SubObjCmd, + (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); + Tcl_CreateObjCommand(interp, "pkgd_unsafe", Pkgd_UnsafeObjCmd, + (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); return TCL_OK; } @@ -151,20 +143,21 @@ Pkgd_Init( *---------------------------------------------------------------------- */ -EXTERN int +int Pkgd_SafeInit( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ { int code; - if (Tcl_InitStubs(interp, "8.6-", 0) == NULL) { + if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { return TCL_ERROR; } - code = Tcl_PkgProvideEx(interp, "Pkgd", "7.3", NULL); + code = Tcl_PkgProvide(interp, "Pkgd", "7.3"); if (code != TCL_OK) { return code; } - Tcl_CreateObjCommand(interp, "pkgd_sub", Pkgd_SubObjCmd, NULL, NULL); + Tcl_CreateObjCommand(interp, "pkgd_sub", Pkgd_SubObjCmd, (ClientData) 0, + (Tcl_CmdDeleteProc *) NULL); return TCL_OK; } diff --git a/unix/dltest/pkge.c b/unix/dltest/pkge.c index ccd15e3..abd2359 100644 --- a/unix/dltest/pkge.c +++ b/unix/dltest/pkge.c @@ -11,17 +11,8 @@ * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ -#undef STATIC_BUILD #include "tcl.h" -/* - * TCL_STORAGE_CLASS is set unconditionally to DLLEXPORT because the - * Pkge_Init declaration is in the source file itself, which is only - * accessed when we are building a library. - */ -#undef TCL_STORAGE_CLASS -#define TCL_STORAGE_CLASS DLLEXPORT - /* *---------------------------------------------------------------------- @@ -40,14 +31,14 @@ *---------------------------------------------------------------------- */ -EXTERN int +int Pkge_Init( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ { - static const char script[] = "if 44 {open non_existent}"; + static char script[] = "if 44 {open non_existent}"; - if (Tcl_InitStubs(interp, "8.6-", 0) == NULL) { + if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { return TCL_ERROR; } return Tcl_Eval(interp, script); diff --git a/unix/dltest/pkgua.c b/unix/dltest/pkgua.c index 87df4a0..9c36e88 100644 --- a/unix/dltest/pkgua.c +++ b/unix/dltest/pkgua.c @@ -11,25 +11,16 @@ * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ -#undef STATIC_BUILD #include "tcl.h" /* - * TCL_STORAGE_CLASS is set unconditionally to DLLEXPORT because the - * Pkgua_Init declaration is in the source file itself, which is only - * accessed when we are building a library. - */ -#undef TCL_STORAGE_CLASS -#define TCL_STORAGE_CLASS DLLEXPORT - -/* * Prototypes for procedures defined later in this file: */ static int PkguaEqObjCmd(ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); + Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]); static int PkguaQuoteObjCmd(ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); + Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]); /* * In the following hash table we are going to store a struct that holds all @@ -58,7 +49,7 @@ PkguaInitTokensHashTable(void) interpTokenMapInitialised = 1; } -static void +void PkguaFreeTokensHashTable(void) { Tcl_HashSearch search; @@ -86,7 +77,7 @@ PkguaInterpToTokens( for (newEntry=0 ; newEntry<MAX_REGISTERED_COMMANDS+1 ; ++newEntry) { cmdTokens[newEntry] = NULL; } - Tcl_SetHashValue(entryPtr, cmdTokens); + Tcl_SetHashValue(entryPtr, (ClientData) cmdTokens); } else { cmdTokens = (Tcl_Command *) Tcl_GetHashValue(entryPtr); } @@ -129,10 +120,10 @@ PkguaEqObjCmd( ClientData dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *const objv[]) /* Argument objects. */ + Tcl_Obj *CONST objv[]) /* Argument objects. */ { int result; - const char *str1, *str2; + CONST char *str1, *str2; int len1, len2; if (objc != 3) { @@ -173,7 +164,7 @@ PkguaQuoteObjCmd( ClientData dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *const objv[]) /* Argument strings. */ + Tcl_Obj *CONST objv[]) /* Argument strings. */ { if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "value"); @@ -200,7 +191,7 @@ PkguaQuoteObjCmd( *---------------------------------------------------------------------- */ -EXTERN int +int Pkgua_Init( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ @@ -208,7 +199,7 @@ Pkgua_Init( int code, cmdIndex = 0; Tcl_Command *cmdTokens; - if (Tcl_InitStubs(interp, "8.6-", 0) == NULL) { + if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { return TCL_ERROR; } @@ -219,7 +210,7 @@ Pkgua_Init( PkguaInitTokensHashTable(); - code = Tcl_PkgProvideEx(interp, "Pkgua", "1.0", NULL); + code = Tcl_PkgProvide(interp, "Pkgua", "1.0"); if (code != TCL_OK) { return code; } @@ -228,11 +219,11 @@ Pkgua_Init( cmdTokens = PkguaInterpToTokens(interp); cmdTokens[cmdIndex++] = - Tcl_CreateObjCommand(interp, "pkgua_eq", PkguaEqObjCmd, NULL, - NULL); + Tcl_CreateObjCommand(interp, "pkgua_eq", PkguaEqObjCmd, + (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); cmdTokens[cmdIndex++] = Tcl_CreateObjCommand(interp, "pkgua_quote", PkguaQuoteObjCmd, - NULL, NULL); + (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); return TCL_OK; } @@ -253,7 +244,7 @@ Pkgua_Init( *---------------------------------------------------------------------- */ -EXTERN int +int Pkgua_SafeInit( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ @@ -278,7 +269,7 @@ Pkgua_SafeInit( *---------------------------------------------------------------------- */ -EXTERN int +int Pkgua_Unload( Tcl_Interp *interp, /* Interpreter from which the package is to be * unloaded. */ @@ -331,7 +322,7 @@ Pkgua_Unload( *---------------------------------------------------------------------- */ -EXTERN int +int Pkgua_SafeUnload( Tcl_Interp *interp, /* Interpreter from which the package is to be * unloaded. */ |