Difference between revisions of "Ns TclInitInterps()"

From AOLserver Wiki
Jump to navigation Jump to search
(created page)
 
Line 1: Line 1:
 
'''Ns_TclInitInterps()'''
 
'''Ns_TclInitInterps()'''
  
Generally called during module initialisation (see [[Ns_ModuleInit]]):
+
Generally called during module initialisation (see [[Ns_ModuleInit()]]):
  
 
<pre>
 
<pre>

Revision as of 16:16, 3 December 2005

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;
}