Rechercher une page de manuel
Ns_TclInitModule.3aolserver
Langue: en
Version: 4.0 (debian - 07/07/09)
Section: 3 (Bibliothèques de fonctions)
NAME
Ns_TclInitInterps, Ns_TclInitModule, Ns_TclInterpServer, Ns_TclLibrary - library proceduresSYNOPSIS
#include "ns.h" int Ns_TclInitInterps(server, initProc, arg) Ns_TclInitModule(arg, arg) char * Ns_TclInterpServer(interp) char * Ns_TclLibrary(void)
ARGUMENTS
- char *server (in)
Name of virtual server. - Ns_TclInterpInitProc *initProc (in)
Procedure to call to initialize interps. - void *arg (in)
Callback data to pass to initProc. - Tcl_Interp *interp (in)
Tcl interp to get server.
DESCRIPTION
Ns_TclInitInterps arranges for initProc to be called on the startup initialization interp. initProc should have arguments and result that match the type Ns_TclInterpInitProc:
-
typedef int Ns_TclInterpInitProc(Tcl_Interp *interp, void *arg);
-
static Ns_TclInterpInitProc AddCmds; static Tcl_CmdProc MsgCmd; int Ns_ModuleInit(char *server, char *module) { static char *arg = "hello"; return Ns_TclInitInterps(server, AddCmds, arg); } static int AddCmds(Tcl_Interp *interp, void *arg) { Tcl_CreateCommand(interp, "msg", MsgCmd, arg, NULL); return TCL_OK; } static int MsgCmd(ClientData arg, Tcl_Interp *interp, int argc, char **argv) { Tcl_SetResult(interp, (char *) arg, TCL_STATIC); return TCL_OK; }
Ns_TclInterpServer returns the virtual server in which the given interp was created.
Ns_TclLibrary returns the shared Tcl library of the server installation (e.g., /usr/local/aolserver/modules/tcl).
SEE ALSO
Ns_TclRegisterAtCreate(3), Ns_TclAllocInterp(3)KEYWORDS
Contenus ©2006-2024 Benjamin Poulain
Design ©2006-2024 Maxime Vantorre