00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00038 #ifndef __NUSMV_SHELL_CMD_CMD_INT_H__
00039 #define __NUSMV_SHELL_CMD_CMD_INT_H__
00040
00041 #if HAVE_CONFIG_H
00042 # include "nusmv-config.h"
00043 #endif
00044
00045 #include "nusmv/shell/cmd/cmd.h"
00046
00047 #include "nusmv/core/cinit/cinit.h"
00048 #include "nusmv/core/opt/opt.h"
00049 #include "nusmv/core/dd/dd.h"
00050 #include "nusmv/core/utils/utils.h"
00051 #include "nusmv/core/utils/array.h"
00052 #include "nusmv/core/utils/avl.h"
00053
00054
00055 #if NUSMV_STDC_HEADERS
00056 # include <string.h>
00057 # include <stdlib.h>
00058 #else
00059 void free();
00060 # if NUSMV_HAVE_STRING_H
00061 # include <string.h>
00062 # else
00063 # ifndef strncpy
00064 char* strncpy(char*, const char*, size_t);
00065 # endif
00066 # endif
00067 #endif
00068
00069
00070
00071
00072
00073
00074
00080 #define BSD_COMP
00081
00082 #if defined(IOCTL_WITH_TERMIOS) && IOCTL_WITH_TERMIOS
00083 # include <sys/ioctl.h>
00084 # include <sys/termios.h>
00085 #else
00086 # if NUSMV_HAVE_SYS_IOCTL_H
00087 # include <sys/ioctl.h>
00088 # else
00089 # if NUSMV_HAVE_SYS_TERMIOS_H
00090 # include <sys/termios.h>
00091 # endif
00092 # endif
00093 #endif
00094
00095
00096 #if defined NUSMV_HAVE_BSD_SGTTY_H && NUSMV_HAVE_BSD_SGTTY_H
00097 # include <bsd/sgtty.h>
00098 #endif
00099
00100 #if NUSMV_HAVE_SYS_SIGNAL_H
00101 # include <sys/signal.h>
00102 #endif
00103 #if NUSMV_HAVE_SIGNAL_H
00104 # include <signal.h>
00105 #endif
00106
00107
00108
00109
00110
00111
00112
00113 #if NUSMV_HAVE_DIRENT_H
00114 # if NUSMV_HAVE_SYS_TYPES_H
00115 # include <sys/types.h>
00116 # endif
00117 # include <dirent.h>
00118 # define NAMLEN(dirent) strlen((dirent)->d_name)
00119 #else
00120 # define dirent direct
00121 # define NAMLEN(dirent) (dirent)->d_namlen
00122 # if NUSMV_HAVE_SYS_NDIR_H
00123 # include <sys/ndir.h>
00124 # endif
00125 # if NUSMV_HAVE_SYS_DIR_H
00126 # include <sys/dir.h>
00127 # endif
00128 # if NUSMV_HAVE_NDIR_H
00129 # include <ndir.h>
00130 # endif
00131 #endif
00132
00133
00134
00140 #define ENV_CMD_ALIAS_TABLE "__cmd_alias_table__"
00141
00147 #define ENV_CMD_COMMAND_TABLE "__cmd_cmd_table__"
00148
00154 #define ENV_CMD_COMMAND_HISTORY "__cmd_cmd_history__"
00155
00156
00157
00158
00159 typedef struct CmdAliasDescrStruct {
00160 char *name;
00161 int argc;
00162 char **argv;
00163 } CmdAliasDescr_t;
00164
00165 typedef struct CommandDescrStruct {
00166 char *name;
00167 PFI command_fp;
00168 int changes_hmgr;
00169 boolean reentrant;
00170 } CommandDescr_t;
00171
00172
00173
00174
00175
00178
00179
00180
00181
00187 boolean Cmd_CommandDefined(NuSMVEnv_ptr env, const char* name);
00188
00194 CommandDescr_t *Cmd_CommandGet(NuSMVEnv_ptr env, const char* name);
00195
00205 void CmdCommandFree(char * value);
00206
00212 CommandDescr_t * CmdCommandCopy(CommandDescr_t * value);
00213
00229 char * CmdFgetsFilec(NuSMVEnv_ptr env, char * buf, unsigned int size,
00230 FILE * stream, char * prompt);
00231
00256 char * CmdHistorySubstitution(NuSMVEnv_ptr env, char * line, int * changed);
00257
00267 void CmdFreeArgv(int argc, char ** argv);
00268
00278 void CmdAliasFree(char * value);
00279
00282 #endif