Main Page | Features | Central Services | csv-Files | Types | Transfer | Access | API-C | API-VB/ActiveX | API-Java | Examples | Downloads
Functions
Command Line API Calls File Reference

TINE console command line API. More...

Functions

int RegisterUserCommand (char *cmd, int(*fcn)(int, int, int, int), int *iparam, float *fparam, int access)
 Registers a user-defined command or variable which can be accessed via the TINE command line interpreter.
int RegisterUserFunction (char *name, int(*fcn)(int argc, char *argv[]))
 Registers a user-defined function which can be accessed via the TINE command line interpreter.

Detailed Description

TINE console command line API.

The API routines offered here allow the developer to register his own command-line calling routines to be used for interacting with a running server at the command line.


Function Documentation

int RegisterUserCommand ( char *  cmd,
int(*)(int, int, int, int)  fcn,
int *  iparam,
float *  fparam,
int  access 
)

Registers a user-defined command or variable which can be accessed via the TINE command line interpreter.

As a console application, a running tine server (or client) offers a variety of services at the command line (just type 'help'). For instance, you can turn debugging on or off, get the current server statistics, examine the connection tables, etc. This interface is avaible via the 'remote' accessor even if the server is running in the background. It it often frequently desireable to examine or alter server-specific variables or call a server specific routine. This can be partially achieved by making use of this registration function.

Parameters:
cmdis the command string to be parsed by the command interpreter.
fcnis an optional user defined function taking four integer arguments.
iparamis a pointer to an optional global integer variable.
fparamis a pointer to an optional global float variable.
accessis a TINE access code (either CA_READ or CA_READ|CA_WRITE). To allow 'set' commands at the command line, you should include the CA_WRITE flag.
Note:
Only one of fcn, iparam, or fparm, should be non-NULL when making this call. If the users types "get <cmd>" without arguments at the command line, then either iparam or fparam is displayed on the console, depending on which parameter was non-NULL at registration time. Likewise "set <cmd> = <val>" can set this variable to a value entered at the console. If a function is registered, then "get <cmd>(arg1,arg2,arg3,arg4)" will call the function registered with the arguments supplied. "set <cmd>(arg1,arg2,arg3,arg4) = <val>" will set all arguments equal to <val> and then call the function. If fewer arguments than 4 are supplied then the function will be called with '0' for the missing arguments.
A more reasonable command line function registration call is underway. However the routine so presented is generally sufficient for checking hardware readouts etc. and checking and setting the contents of global variables.
Returns:
0 if successful, otherwise a TINE completion code
int RegisterUserFunction ( char *  name,
int(*)(int argc, char *argv[])  fcn 
)

Registers a user-defined function which can be accessed via the TINE command line interpreter.

As a console application, a running tine server (or client) offers a variety of services at the command line (just type 'help'). For instance, you can turn debugging on or off, get the current server statistics, examine the connection tables, etc. This interface is avaible via the 'remote' accessor even if the server is running in the background. It it often frequently desireable to examine or alter server-specific variables or call a server specific routine. This can be partially achieved by making use of this registration function.

Parameters:
nameis a string identifying the function to be parsed by the command interpreter.
fcnis the user defined function taking the argc and argv.
Returns:
0 if successful, otherwise a TINE completion code

Generated for TINE API by  doxygen 1.5.8