Registers a console command and its parsing function.
#include <netware.h> int RegisterCommand ( void *NLMHandle, rtag_t rTag, uint32_t keywordFlags, const char *keyword, uint32_t handlerFlags, uint32_t insertionFlags, CommandHandler_t handler, void *callerReference);
(IN) Points to the handle for the NML that consumes the command.
Specifies a resource tag created by calling AllocateResourceTag with the signature parameter set to CommandLineServicesSignature.
(IN) Specifies the data type of keyword with one of the following flags:
Points to a developer-defined keyword, which is used to identify the command.
If the keywordFlags parameter is set to a string, the keyword is a length-preceded string. The maximum length of a command is 48 bytes. Spaces are not allowed in a keyword. For example, use the following string to register a mycommand keyword:
"\x09""mycommand"
(IN) Specifies how to handle the command, using a bit mask of the following flags:
Specifies where the command should be inserted if the command allows chaining. Use one of the following flags:
(IN/OUT) Specifies the handler for the command. For a description of the prototype, see CommandHandler_t.
Points to a developer-defined value that is passed to the handler.
If successful, returns 0. Otherwise, returns one of the following error codes:
The function pointer to the handler must be wrappered with the NX_WRAP_INTERFACE macro to ensure accurate library context is established if that context is needed.
This function can only be used by an application that runs in the kernel (ring 0); it cannot be used by an application that runs in protected address space (ring 3). If your application needs to run in ring 3, you need to split it into multiple NLM applications and run the NLM responsible for registering the command in ring 0.