Routine(s) for processing subcommands.
More...
Routine(s) for processing subcommands.
◆ BU_CMD_NULL
Definition at line 37 of file cmd.h.
◆ bu_cmd()
Routine(s) for processing subcommands.
This function is intended to be used for parsing subcommands. If the command is found in the array of commands, the associated function is called. Otherwise, an error message is printed along with a list of available commands. This behavior can be suppressed by registering a bu_log() callback.
int bu_cmd(const struct bu_cmdtab *cmds, int argc, const char *argv[], int cmd_index, void *data, int *result)
Routine(s) for processing subcommands.
void bu_log_hook_restore_all(struct bu_hook_list *restore_hlp)
void bu_log_hook_delete_all(void)
void bu_log_add_hook(bu_hook_t func, void *clientdata)
void bu_log_hook_save_all(struct bu_hook_list *save_hlp)
#define BU_HOOK_LIST_INIT_ZERO
- Parameters
-
cmds | - commands and related function pointers |
argc | - number of arguments in argv |
argv | - command to execute and its arguments |
cmd_index | - indicates which argv element holds the subcommand |
data | - data/state associated with the command |
result | - if non-NULL, return value from the command |
- Returns
- BRLCAD_OK if command was found, otherwise, BRLCAD_ERROR.
◆ bu_cmd_valid()
Returns BRLCAD_OK if cmdname defines a command in the cmds table, and BRLCAD_ERROR otherwise