00001 /* C M D . H 00002 * BRL-CAD 00003 * 00004 * Copyright (c) 1993-2006 United States Government as represented by 00005 * the U.S. Army Research Laboratory. 00006 * 00007 * This library is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public License 00009 * as published by the Free Software Foundation; either version 2.1 of 00010 * the License, or (at your option) any later version. 00011 * 00012 * This library is distributed in the hope that it will be useful, but 00013 * WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Library General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with this file; see the file named COPYING for more 00019 * information. 00020 */ 00021 /** @addtogroup libbu */ 00022 /*@{*/ 00023 /** @file cmd.h 00024 *@brief 00025 * Command history data structures 00026 */ 00027 #ifndef __CMD_H__ 00028 #define __CMD_H__ 00029 00030 #include "common.h" 00031 00032 #ifdef HAVE_SYS_TIME_H 00033 # include <sys/time.h> 00034 #endif 00035 #include <time.h> 00036 #include "bu.h" 00037 00038 #define MAXARGS 9000 00039 #define CMD_NULL (int (*)())NULL 00040 #define CMDHIST_NULL (struct bu_cmdhist *)NULL 00041 #define CMDHIST_OBJ_NULL (struct bu_cmdhist_obj *)NULL 00042 00043 struct bu_cmdhist { 00044 struct bu_list l; 00045 struct bu_vls h_command; 00046 struct timeval h_start; 00047 struct timeval h_finish; 00048 int h_status; 00049 }; 00050 00051 struct bu_cmdhist_obj { 00052 struct bu_list l; 00053 struct bu_vls cho_name; 00054 struct bu_cmdhist cho_head; 00055 struct bu_cmdhist *cho_curr; 00056 }; 00057 00058 BU_EXPORT BU_EXTERN(int bu_cmd, 00059 ()); 00060 BU_EXPORT BU_EXTERN(void bu_register_cmds, 00061 ()); 00062 00063 /* bu_cmdhist routines are defined in libbu/cmdhist.c */ 00064 BU_EXPORT BU_EXTERN(int bu_cmdhist_history, 00065 ()); 00066 BU_EXPORT BU_EXTERN(int bu_cmdhist_add, 00067 ()); 00068 BU_EXPORT BU_EXTERN(int bu_cmdhist_curr, 00069 ()); 00070 BU_EXPORT BU_EXTERN(int bu_cmdhist_next, 00071 ()); 00072 BU_EXPORT BU_EXTERN(int bu_cmdhist_prev, 00073 ()); 00074 00075 BU_EXPORT BU_EXTERN(int cho_open_tcl, 00076 ()); 00077 00078 #endif /* __CMD_H__ */ 00079 /*@}*/ 00080 /* 00081 * Local Variables: 00082 * mode: C 00083 * tab-width: 8 00084 * c-basic-offset: 4 00085 * indent-tabs-mode: t 00086 * End: 00087 * ex: shiftwidth=4 tabstop=8 00088 */ 00089