CommandHandler_t

Defines the prototype for the handler function called by the RegisterCommand function.

Service:NetWare Platform

Syntax

  #include <netware.h>
  
  typedef int (
     *CommandHandler_t)
     (
        int           funcCode,
        void         *scrID,
        const char   *command,
        const char   *upperCaseCommand,
        void         *callerReference);
  

Parameters

funcCode

Specifies the type of function with one of the following commands:

Flag

Value

Description

CMD_HELP_ON_CMD

0x00000000

CMD_GET_SUB_CMDS

0x00000001

CMD_PROCESS_CMD

0x00000002

CMD_MAX_HELP_CMDS

ProcessCommand

scrID

(IN) Points to the console screen that the caller has opened for use. See OpenScreen in Volume 1.

command

(IN) Points to the command line string that needs to be parsed. This string is in raw format (ASCIIZ).

upperCaseCommand

(IN) Points to a copy of the command line that has been converted to an upper case ASCIIZ string.

callerReference

(IN) Points to a developer-defined value that is passed from the RegisterCommand function to the parser function.

Return Values

This handler function must return one of the following. If two #defines are given, the second one specifies a more intuitive name.

Decimal

Constant

Description

0x00000000

CMD_CMD_EXECUTED CMD_CHAIN_NEXT_CMD

The command was processed successfully; proceed with the next handler for this same command string.

0x70000000

CMD_HALT_CMD_CHAIN CMD_PROCESSED_OK

The command was processed, but the next command in the chain could not be processed.

0x70000010

CMD_BAD_CMD_SYNTAX CMD_SYNTAX_ERROR

The command cannot be processed because of a syntax error.

0x70000011

CMD_NOT_RUNNING

The command requires the server to be up.

0x70000012

CMD_LINE_FAULT

The command line had a fault, but no error was displayed.

0x70000021

CMD_BAD_MOD_HANDLE

The NLMâ„¢ handle is invalid.

0x70000022

CMD_BAD_RTAG

The resource tag is invalid.

0x70000023

CMD_BAD_KEY

The keyword is invalid because it is NULL.

0x70000024

CMD_RTAG_AND_MOD

The resource tag doesn't belong to the NLM.

0x70000025

CMD_NO_HANDLER

The handler is missing because the handler parameter is NULL.

0x70000026

CMD_KEY_TOO_LONG

The keyword is longer than 48 bytes.

0x70000027

CMD_INVAL_PERM

The syntax indicates that this command is a permanent command but the syntax doesn't include a flag to indicate whether to set the command at the top or the bottom.

0x70000028

CMD_NO_MEMORY

Unable to allocate memory for the command.

0x70000029

CMD_NOT_REGISTERED

The command cannot be registered.

0x7000002A

CMD_HAS_CHAIN

The command is trying to register as a no chaining command, but the command has already been registered to allow chaining.

0x7000002B

CMD_CANT_MAKE_HEAD

The command cannot be the permanent head because another handler has registered a permanent top command.

0x7000002C

CMD_CANT_MAKE_TAIL

The command cannot be permanent tail because another handler has registered a permanent tail command.

0x7000002D

CMD_PASS_TO_NEXT CMD_NOT_MY_COMMAND

The command was not processed, but passed to the next handler.

0x7000002E

CMD_PRIV_ON_ALT

The caller has no privileges on the alternate handler.

0x7000002F

CMD_STOP_CMDS

The system is no longer parsing commands.

Remarks

The handler function for the RegisterCommand function must conform to this prototype.

The function pointer to the handler must be wrappered with the NX_WRAP_INTERFACE macro to ensure accurate library context is established.