diff options
Diffstat (limited to 'unix/tclXtTest.c')
| -rw-r--r-- | unix/tclXtTest.c | 60 |
1 files changed, 22 insertions, 38 deletions
diff --git a/unix/tclXtTest.c b/unix/tclXtTest.c index c6bcc18..8437f2a 100644 --- a/unix/tclXtTest.c +++ b/unix/tclXtTest.c @@ -1,28 +1,20 @@ -/* +/* * tclXtTest.c -- * * Contains commands for Xt notifier specific tests on Unix. * - * Copyright © 1997 Sun Microsystems, Inc. + * Copyright (c) 1997 by Sun Microsystems, Inc. * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * See the file "license.terms" for information on usage and redistribution of + * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ -#ifndef USE_TCL_STUBS -# define USE_TCL_STUBS -#endif #include <X11/Intrinsic.h> #include "tcl.h" -static Tcl_ObjCmdProc TesteventloopCmd; - -/* - * Functions defined in tclXtNotify.c for use by users of the Xt Notifier: - */ - -extern void InitNotifier(void); -extern XtAppContext TclSetAppContext(XtAppContext ctx); +static int TesteventloopCmd(ClientData clientData, + Tcl_Interp *interp, int argc, CONST char **argv); +extern void InitNotifier(void); /* *---------------------------------------------------------------------- @@ -43,17 +35,17 @@ extern XtAppContext TclSetAppContext(XtAppContext ctx); *---------------------------------------------------------------------- */ -DLLEXPORT int +int Tclxttest_Init( Tcl_Interp *interp) /* Interpreter for application. */ { - if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) { + if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { return TCL_ERROR; } XtToolkitInitialize(); InitNotifier(); - Tcl_CreateObjCommand(interp, "testeventloop", TesteventloopCmd, - NULL, NULL); + Tcl_CreateCommand(interp, "testeventloop", TesteventloopCmd, + (ClientData) 0, NULL); return TCL_OK; } @@ -77,22 +69,23 @@ Tclxttest_Init( static int TesteventloopCmd( - TCL_UNUSED(void *), + ClientData clientData, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ - Tcl_Obj *const objv[]) /* Argument objects. */ + int argc, /* Number of arguments. */ + CONST char **argv) /* Argument strings. */ { static int *framePtr = NULL;/* Pointer to integer on stack frame of * innermost invocation of the "wait" * subcommand. */ - if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "option ..."); - return TCL_ERROR; + if (argc < 2) { + Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0], + " option ... \"", NULL); + return TCL_ERROR; } - if (strcmp(Tcl_GetString(objv[1]), "done") == 0) { + if (strcmp(argv[1], "done") == 0) { *framePtr = 1; - } else if (strcmp(Tcl_GetString(objv[1]), "wait") == 0) { + } else if (strcmp(argv[1], "wait") == 0) { int *oldFramePtr; int done; int oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL); @@ -116,18 +109,9 @@ TesteventloopCmd( (void) Tcl_SetServiceMode(oldMode); framePtr = oldFramePtr; } else { - Tcl_AppendResult(interp, "bad option \"", Tcl_GetString(objv[1]), - "\": must be done or wait", (void *)NULL); + Tcl_AppendResult(interp, "bad option \"", argv[1], + "\": must be done or wait", NULL); return TCL_ERROR; } return TCL_OK; } - -/* - * Local Variables: - * mode: c - * c-basic-offset: 4 - * fill-column: 78 - * tab-width: 8 - * End: - */ |
