BRL-CAD
Collaboration diagram for Command Processing:

Files

file  cmd.c
 Routine(s) for processing subcommands.
 
file  cmdhist.c
 Routines for maintaining a command history.
 

Data Structures

struct  bu_cmdtab
 
struct  bu_cmdhist
 
struct  bu_cmdhist_obj
 

Macros

#define BU_CMD_NULL   (int (*)(void *, int, const char **))NULL
 
#define BU_CMDHIST_NULL   (struct bu_cmdhist *)NULL
 
#define BU_CMDHIST_OBJ_NULL   (struct bu_cmdhist_obj *)NULL
 

Functions

int bu_cmd (const struct bu_cmdtab *cmds, int argc, const char *argv[], int cmd_index, void *data, int *result)
 
int bu_cmdhist_history (void *data, int argc, const char **argv)
 Prints out the command history. More...
 
int bu_cmdhist_add (void *data, int argc, const char **argv)
 Add a command to the history list. More...
 
int bu_cmdhist_curr (void *data, int argc, const char **argv)
 
int bu_cmdhist_next (void *data, int argc, const char **argv)
 
int bu_cmdhist_prev (void *data, int argc, const char **argv)
 

Detailed Description

Macro Definition Documentation

#define BU_CMD_NULL   (int (*)(void *, int, const char **))NULL

Definition at line 37 of file cmd.h.

Referenced by Bu_Init(), cho_cmd(), Dm_Init(), dmo_cmd(), Fb_Init(), fbo_cmd(), ged_constraint(), and ged_edarb().

#define BU_CMDHIST_NULL   (struct bu_cmdhist *)NULL

Definition at line 60 of file cmd.h.

#define BU_CMDHIST_OBJ_NULL   (struct bu_cmdhist_obj *)NULL

Definition at line 68 of file cmd.h.

Referenced by cho_open(), and cho_open_tcl().

Function Documentation

int bu_cmd ( const struct bu_cmdtab cmds,
int  argc,
const char *  argv[],
int  cmd_index,
void *  data,
int *  result 
)

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 created and added to interp.

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.

Referenced by bu_observer_cmd(), cho_cmd(), dmo_cmd(), fbo_cmd(), ged_constraint(), and ged_edarb().

int bu_cmdhist_history ( void *  data,
int  argc,
const char **  argv 
)

Prints out the command history.

USAGE: history [-delays] [-outfile filename]

Referenced by cho_cmd().

int bu_cmdhist_add ( void *  data,
int  argc,
const char **  argv 
)

Add a command to the history list.

USAGE: procname add cmd

Definition at line 147 of file cmdhist.c.

References BRLCAD_ERROR, BRLCAD_OK, bu_log(), bu_vls_free(), BU_VLS_INIT_ZERO, bu_vls_putc(), bu_vls_strcpy(), cmdhist_record(), and UNLIKELY.

Referenced by cho_cmd().

Here is the call graph for this function:

int bu_cmdhist_curr ( void *  data,
int  argc,
const char **  argv 
)

Return the current command.

USAGE: procname curr

Definition at line 196 of file cmdhist.c.

References BRLCAD_ERROR, BRLCAD_OK, BU_LIST_NOT_HEAD, bu_log(), bu_cmdhist_obj::cho_curr, bu_cmdhist_obj::cho_head, and bu_cmdhist::l.

Referenced by cho_cmd().

Here is the call graph for this function:

int bu_cmdhist_next ( void *  data,
int  argc,
const char **  argv 
)

Set the current command to the next command.

USAGE: procname next

Definition at line 216 of file cmdhist.c.

References BRLCAD_ERROR, BRLCAD_OK, BU_LIST_IS_HEAD, BU_LIST_PNEXT, bu_log(), bu_cmdhist_obj::cho_curr, bu_cmdhist_obj::cho_head, and bu_cmdhist::l.

Referenced by cho_cmd().

Here is the call graph for this function:

int bu_cmdhist_prev ( void *  data,
int  argc,
const char **  argv 
)

Set the current command to the previous command.

USAGE: procname prev

Definition at line 176 of file cmdhist.c.

References BRLCAD_ERROR, BRLCAD_OK, BU_LIST_NOT_HEAD, BU_LIST_PLAST, bu_log(), bu_cmdhist_obj::cho_curr, bu_cmdhist_obj::cho_head, and bu_cmdhist::l.

Referenced by cho_cmd().

Here is the call graph for this function: