BRL-CAD
|
Routine(s) for processing subcommands. More...
Files | |
file | cmd.h |
Data Structures | |
struct | bu_cmdtab |
Macros | |
#define | BU_CMD_NULL (int (*)(void *, int, const char **))NULL |
Functions | |
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. More... | |
int | bu_cmd_valid (const struct bu_cmdtab *cmds, const char *cmdname) |
DEPRECATED int | bu_cmdhist_history (void *data, int argc, const char **argv) |
Routines for maintaining a command history. More... | |
DEPRECATED int | bu_cmdhist_add (void *data, int argc, const char **argv) |
DEPRECATED int | bu_cmdhist_curr (void *data, int argc, const char **argv) |
DEPRECATED int | bu_cmdhist_next (void *data, int argc, const char **argv) |
DEPRECATED int | bu_cmdhist_prev (void *data, int argc, const char **argv) |
Routine(s) for processing subcommands.
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.
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.
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 |
int bu_cmd_valid | ( | const struct bu_cmdtab * | cmds, |
const char * | cmdname | ||
) |
Returns BRLCAD_OK if cmdname defines a command in the cmds table, and BRLCAD_ERROR otherwise
DEPRECATED int bu_cmdhist_history | ( | void * | data, |
int | argc, | ||
const char ** | argv | ||
) |
Routines for maintaining a command history.
Prints out the command history.
USAGE: history [-delays] [-outfile filename]
DEPRECATED int bu_cmdhist_add | ( | void * | data, |
int | argc, | ||
const char ** | argv | ||
) |
Add a command to the history list.
USAGE: procname add cmd
DEPRECATED int bu_cmdhist_curr | ( | void * | data, |
int | argc, | ||
const char ** | argv | ||
) |
Return the current command.
USAGE: procname curr
DEPRECATED int bu_cmdhist_next | ( | void * | data, |
int | argc, | ||
const char ** | argv | ||
) |
Set the current command to the next command.
USAGE: procname next
DEPRECATED int bu_cmdhist_prev | ( | void * | data, |
int | argc, | ||
const char ** | argv | ||
) |
Set the current command to the previous command.
USAGE: procname prev