summaryrefslogtreecommitdiffstats
path: root/unix/dltest/pkgua.c
diff options
context:
space:
mode:
Diffstat (limited to 'unix/dltest/pkgua.c')
-rw-r--r--unix/dltest/pkgua.c37
1 files changed, 23 insertions, 14 deletions
diff --git a/unix/dltest/pkgua.c b/unix/dltest/pkgua.c
index 9c36e88..417bedb 100644
--- a/unix/dltest/pkgua.c
+++ b/unix/dltest/pkgua.c
@@ -11,16 +11,25 @@
* 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
@@ -49,7 +58,7 @@ PkguaInitTokensHashTable(void)
interpTokenMapInitialised = 1;
}
-void
+static void
PkguaFreeTokensHashTable(void)
{
Tcl_HashSearch search;
@@ -77,7 +86,7 @@ PkguaInterpToTokens(
for (newEntry=0 ; newEntry<MAX_REGISTERED_COMMANDS+1 ; ++newEntry) {
cmdTokens[newEntry] = NULL;
}
- Tcl_SetHashValue(entryPtr, (ClientData) cmdTokens);
+ Tcl_SetHashValue(entryPtr, cmdTokens);
} else {
cmdTokens = (Tcl_Command *) Tcl_GetHashValue(entryPtr);
}
@@ -120,10 +129,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) {
@@ -164,7 +173,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");
@@ -191,7 +200,7 @@ PkguaQuoteObjCmd(
*----------------------------------------------------------------------
*/
-int
+EXTERN int
Pkgua_Init(
Tcl_Interp *interp) /* Interpreter in which the package is to be
* made available. */
@@ -219,11 +228,11 @@ Pkgua_Init(
cmdTokens = PkguaInterpToTokens(interp);
cmdTokens[cmdIndex++] =
- Tcl_CreateObjCommand(interp, "pkgua_eq", PkguaEqObjCmd,
- (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
+ Tcl_CreateObjCommand(interp, "pkgua_eq", PkguaEqObjCmd, NULL,
+ NULL);
cmdTokens[cmdIndex++] =
Tcl_CreateObjCommand(interp, "pkgua_quote", PkguaQuoteObjCmd,
- (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
+ NULL, NULL);
return TCL_OK;
}
@@ -244,7 +253,7 @@ Pkgua_Init(
*----------------------------------------------------------------------
*/
-int
+EXTERN int
Pkgua_SafeInit(
Tcl_Interp *interp) /* Interpreter in which the package is to be
* made available. */
@@ -269,7 +278,7 @@ Pkgua_SafeInit(
*----------------------------------------------------------------------
*/
-int
+EXTERN int
Pkgua_Unload(
Tcl_Interp *interp, /* Interpreter from which the package is to be
* unloaded. */
@@ -322,7 +331,7 @@ Pkgua_Unload(
*----------------------------------------------------------------------
*/
-int
+EXTERN int
Pkgua_SafeUnload(
Tcl_Interp *interp, /* Interpreter from which the package is to be
* unloaded. */