CMDAddBuiltInCommand

Synopsis

extern "C" CMDAPIIMPORT BOOL CMDAddBuiltInCommand ( const char * name, int (* CMDCALLBACK function)(void *, int, char**) ) ;

Description

This function adds a command named by the name parameter to the process' list of built-in commands. When the command is invoked, the command interpreter will call the function pointed to by the function parameter.

The callback function is declared in a manner similar to

extern "C" int CMDCALLBACK myfunction ( void * Interpreter, int Count, char * * Arguments )

The Interpreter parameter provides the command with a means of accessing the invoking instance of the interpreter (so that it can query the error level, for example). The command tails are stored as NUL-terminated strings, an array of pointers to which is passed in the Arguments parameter and the number of which is passed in the Count parameter.

Note: The array is not terminated with an additional null pointer.


The 32-bit Command Interpreter is © Copyright Jonathan de Boyne Pollard. "Moral" rights are asserted.