BRL-CAD

Routines for maintaining a command history. More...

#include "common.h"
#include <string.h>
#include "bu/cmd.h"
#include "bu/malloc.h"
#include "bu/str.h"
Include dependency graph for cmdhist.c:

Go to the source code of this file.

Functions

HIDDEN void cmdhist_record (struct bu_cmdhist_obj *chop, struct bu_vls *cmdp, struct timeval *start, struct timeval *finish, int status)
 
HIDDEN int cmdhist_timediff (struct timeval *tvdiff, struct timeval *start, struct timeval *finish)
 
int bu_cmdhist_history (void *data, int argc, const char *argv[])
 
int bu_cmdhist_add (void *clientData, int argc, const char **argv)
 Add a command to the history list. More...
 
int bu_cmdhist_prev (void *clientData, int argc, const char **argv)
 
int bu_cmdhist_curr (void *clientData, int argc, const char **argv)
 
int bu_cmdhist_next (void *clientData, int argc, const char **argv)
 

Detailed Description

Routines for maintaining a command history.

Definition in file cmdhist.c.

Function Documentation

HIDDEN void cmdhist_record ( struct bu_cmdhist_obj chop,
struct bu_vls cmdp,
struct timeval *  start,
struct timeval *  finish,
int  status 
)

Stores the given command with start and finish times in the history vls'es. 'status' is either BRLCAD_OK or BRLCAD_ERROR.

Definition at line 34 of file cmdhist.c.

References BU_ALLOC, BU_LIST_INSERT, BU_STR_EQUAL, bu_vls_addr(), bu_vls_init(), bu_vls_vlscat(), bu_cmdhist_obj::cho_curr, bu_cmdhist_obj::cho_head, bu_cmdhist::h_command, bu_cmdhist::h_finish, bu_cmdhist::h_start, bu_cmdhist::h_status, bu_cmdhist::l, and UNLIKELY.

Referenced by bu_cmdhist_add().

Here is the call graph for this function:

HIDDEN int cmdhist_timediff ( struct timeval *  tvdiff,
struct timeval *  start,
struct timeval *  finish 
)

Definition at line 55 of file cmdhist.c.

References UNLIKELY.

Referenced by bu_cmdhist_history().

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

Definition at line 74 of file cmdhist.c.

References BRLCAD_ERROR, BRLCAD_OK, BU_LIST_FOR, BU_LIST_NOT_HEAD, BU_LIST_PREV, bu_log(), BU_STR_EQUAL, bu_vls_addr(), bu_vls_fwrite(), BU_VLS_INIT_ZERO, bu_vls_printf(), bu_vls_trunc(), bu_vls_vlscat(), bu_cmdhist_obj::cho_head, cmdhist_timediff(), bu_cmdhist::h_command, bu_cmdhist::h_finish, bu_cmdhist::h_start, bu_cmdhist::h_status, bu_cmdhist::l, and UNLIKELY.

Here is the call graph for this function: