Ns TclInitInterps()

From AOLserver Wiki
Revision as of 16:16, 3 December 2005 by Caveman (talk | contribs) (Ns TclInitInterps moved to Ns TclInitInterps())
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Ns_TclInitInterps()

Generally called during module initialisation (see Ns_ModuleInit()):

int Ns_ModuleInit(char *hServer, char *hModule)
{

    return (Ns_TclInitInterps(hServer, MyInterpInitFuncName, NULL));

}

static int MyInterpInitFuncName(Tcl_Interp *interp, void *context)
{
    Tcl_CreateCommand(interp, "ns_myfuncname", MyFuncNameCmd, NULL, NULL);

    return NS_OK;
}

static int MyFuncNameCmd(ClientData context, Tcl_Interp *interp, int argc, char **argv)
{

    Tcl_AppendResult(interp, "MyFuncResultData", NULL);

    return NS_OK;
}