diff options
Diffstat (limited to 'tools/tsdPerf.c')
-rw-r--r-- | tools/tsdPerf.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/tools/tsdPerf.c b/tools/tsdPerf.c index 9399b3b..40004b1 100644 --- a/tools/tsdPerf.c +++ b/tools/tsdPerf.c @@ -1,5 +1,7 @@ #include <tcl.h> +extern DLLEXPORT Tcl_PackageInitProc Tsdperf_Init; + static Tcl_ThreadDataKey key; typedef struct { @@ -7,7 +9,7 @@ typedef struct { } TsdPerf; -int +static int tsdPerfSetObjCmd(ClientData cdata, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { TsdPerf *perf = Tcl_GetThreadData(&key, sizeof(TsdPerf)); int i; @@ -26,7 +28,8 @@ tsdPerfSetObjCmd(ClientData cdata, Tcl_Interp *interp, int objc, Tcl_Obj *const return TCL_OK; } -int tsdPerfGetObjCmd(ClientData cdata, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { +static int +tsdPerfGetObjCmd(ClientData cdata, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { TsdPerf *perf = Tcl_GetThreadData(&key, sizeof(TsdPerf)); @@ -35,19 +38,14 @@ int tsdPerfGetObjCmd(ClientData cdata, Tcl_Interp *interp, int objc, Tcl_Obj *co return TCL_OK; } - int -Tsdperf_Init (Tcl_Interp *interp) { - if (NULL == Tcl_InitStubs(interp, TCL_VERSION, 0)) { +Tsdperf_Init(Tcl_Interp *interp) { + if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { return TCL_ERROR; } - - Tcl_CreateObjCommand(interp, "tsdPerfSet", tsdPerfSetObjCmd, (ClientData)NULL, - (Tcl_CmdDeleteProc *)NULL); - Tcl_CreateObjCommand(interp, "tsdPerfGet", tsdPerfGetObjCmd, (ClientData)NULL, - (Tcl_CmdDeleteProc *)NULL); - + Tcl_CreateObjCommand(interp, "tsdPerfSet", tsdPerfSetObjCmd, NULL, NULL); + Tcl_CreateObjCommand(interp, "tsdPerfGet", tsdPerfGetObjCmd, NULL, NULL); return TCL_OK; } |