Azinix

nmTcl.c File Reference

Routines needed to interface with Tcl. More...

#include "nm.h"
#include "evl.h"

Go to the source code of this file.

Functions

int Nm_Tcl (Tcl_Interp *interp, Nm_TclCD_t *cd)
 If we want to use narya with a tcl script, we call this function to register the commands exported from C, initialize the tclToC table, and then invoke the script.
int sourceTclrc (Tcl_Interp *interp)
 Source an init file called .tclrc.
void Nm_TclResult (Tcl_Interp *interp, ClientData cd, void *ptr)
 Code to take a raw pointer and set it as the result of a tcl command.
int Nm_TclGetStringVar (Tcl_Interp *interp, char *tclVarName, char **result)
 Code encapsulating getting a string var from Tcl environment.
int Nm_TclGetDoubleVar (Tcl_Interp *interp, char *tclVarName, double *result)
 Code encapsulating getting a double var from Tcl environment.
int Nm_TclGetArrayVar (Tcl_Interp *interp, char *tclVarName, array_t *result)
 Code encapsulating getting an array var from Tcl environment.
int Nm_TclGetIntVar (Tcl_Interp *interp, char *tclVarName, int *result)
 Code encapsulating getting an int var from Tcl environment.
Nm_TclCD_tNm_TclCDInit ()
 Allocate a client data structure.
int Nm_TclCDStorePtr (Nm_TclCD_t *cd, void *ptr)
 Store a pointer in the CD structure. Return the int id of this pointer.
void * Nm_TclCDReadPtrFromObj (Tcl_Interp *interp, Nm_TclCD_t *cd, Tcl_Obj *const obj)
 Read a pointer from the CD structure from obj argument.
void * Nm_TclCDReadPtr (Nm_TclCD_t *cd, int id)
 Read a pointer from the CD structure.
void Nm_TclCDReuseId (Nm_TclCD_t *cd, int id)
 Return an id to the pool of available ids.
int pktReadTcpInfo (ClientData cd, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Return information in tcl string form for the tcp packet.


Detailed Description

Routines needed to interface with Tcl.

Definition in file nmTcl.c.


Function Documentation

int Nm_Tcl ( Tcl_Interp *  interp,
Nm_TclCD_t cd 
)

If we want to use narya with a tcl script, we call this function to register the commands exported from C, initialize the tclToC table, and then invoke the script.

Definition at line 113 of file nmTcl.c.

Nm_TclCD_t* Nm_TclCDInit (  ) 

Allocate a client data structure.

Definition at line 894 of file nmTcl.c.

void* Nm_TclCDReadPtr ( Nm_TclCD_t cd,
int  id 
)

Read a pointer from the CD structure.

Definition at line 949 of file nmTcl.c.

void* Nm_TclCDReadPtrFromObj ( Tcl_Interp *  interp,
Nm_TclCD_t cd,
Tcl_Obj *const  obj 
)

Read a pointer from the CD structure from obj argument.

Definition at line 935 of file nmTcl.c.

void Nm_TclCDReuseId ( Nm_TclCD_t cd,
int  id 
)

Return an id to the pool of available ids.

Definition at line 962 of file nmTcl.c.

int Nm_TclCDStorePtr ( Nm_TclCD_t cd,
void *  ptr 
)

Store a pointer in the CD structure. Return the int id of this pointer.

Definition at line 910 of file nmTcl.c.

int Nm_TclGetArrayVar ( Tcl_Interp *  interp,
char *  tclVarName,
array_t result 
)

Code encapsulating getting an array var from Tcl environment.

Definition at line 851 of file nmTcl.c.

int Nm_TclGetDoubleVar ( Tcl_Interp *  interp,
char *  tclVarName,
double *  result 
)

Code encapsulating getting a double var from Tcl environment.

Definition at line 832 of file nmTcl.c.

int Nm_TclGetIntVar ( Tcl_Interp *  interp,
char *  tclVarName,
int *  result 
)

Code encapsulating getting an int var from Tcl environment.

Definition at line 877 of file nmTcl.c.

int Nm_TclGetStringVar ( Tcl_Interp *  interp,
char *  tclVarName,
char **  result 
)

Code encapsulating getting a string var from Tcl environment.

Definition at line 815 of file nmTcl.c.

void Nm_TclResult ( Tcl_Interp *  interp,
ClientData  cd,
void *  ptr 
)

Code to take a raw pointer and set it as the result of a tcl command.

Definition at line 622 of file nmTcl.c.

int pktReadTcpInfo ( ClientData  cd,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj *const  objv[] 
)

Return information in tcl string form for the tcp packet.

Definition at line 1119 of file nmTcl.c.

int sourceTclrc ( Tcl_Interp *  interp  ) 

Source an init file called .tclrc.

Look in local directory only.

Definition at line 157 of file nmTcl.c.