void
CmdAliasFree(
char * value
)
- optional
- Side Effects required
- See Also
optional
- Defined in
cmdMisc.c
void
CmdCloseFile(
FILE* file
)
- optional
- Side Effects required
- See Also
optional
- Defined in
cmdMisc.c
void
CmdClosePipe(
FILE* file
)
- optional
- Side Effects required
- See Also
optional
- Defined in
cmdMisc.c
CommandDescr_t *
CmdCommandCopy(
CommandDescr_t * value
)
- Copies value.
- Defined in
cmdCmd.c
void
CmdCommandFree(
char * value
)
- optional
- Side Effects required
- See Also
optional
- Defined in
cmdCmd.c
char*
CmdFgetsFilec(
char* buf,
int size,
FILE* stream,
char* prompt
)
- Input is read from `stream' and returned in `buf'. Up to
`size' bytes will be placed into `buf'. If `stream' is not stdin, is
equivalent to calling fgets(buf, size, stream).
`prompt' is the prompt you want to appear at the beginning of the line. The
caller does not have to print the prompt string before calling this routine.
The prompt has to be reprinted if the user hits ^D.
The file completion routines are derived from the source code for csh, which
is copyrighted by the Regents of the University of California.
- Defined in
cmdFile.c
char*
CmdFgetsFilec(
char* buf,
int size,
FILE* stream,
char* prompt
)
- optional
- Side Effects required
- See Also
optional
- Defined in
cmdFile.c
void
CmdFreeArgv(
int argc,
char ** argv
)
- optional
- Side Effects required
- See Also
optional
- Defined in
cmdMisc.c
char *
CmdHistorySubstitution(
char * line,
int * changed
)
- Simple history substitution routine. Not, repeat NOT, the
complete csh history substitution mechanism.
In the following ^ is the SUBST character and ! is the HIST character.
Deals with:
!! last command
!stuff last command that began with "stuff"
!* all but 0'th argument of last command
!$ last argument of last command
!:n n'th argument of last command
!n repeat the n'th command
!-n repeat n'th previous command
^old^new replace "old" w/ "new" in previous command
Trailing spaces are significant. Removes all initial spaces.
Returns `line' if no changes were made. Returns pointer to a static buffer
if any changes were made. Sets `changed' to 1 if a history substitution
took place, o/w set to 0. Returns NULL if error occurred.
- Defined in
cmdFile.c
FILE*
CmdOpenFile(
const char* filename
)
- optional
- Side Effects required
- See Also
optional
- Defined in
cmdMisc.c
FILE*
CmdOpenPipe(
int useMore
)
- Returns NULL if an error occurs
- Side Effects required
- See Also
optional
- Defined in
cmdMisc.c
void
Cmd_CommandAdd(
char* name,
PFI funcFp,
int changes,
boolean reentrant
)
- Adds a command to the command table. If name already defines
an existing command, its definition is replaced. FuncFp is a function
pointer to code of the form:
int
CommandTest(argc, argv)
int argc;
char **argv;
{
return 0;
}
argv[0] will generally
be the command name, and argv[1] ... argv[argc-1] are the arguments for the
command. util_getopt() can be used to parse the arguments, but
util_getopt_reset() must be used before calling util_getopt(). The command
function should return 0 for normal operation, 1 for any error. The changes
flag is used to automatically save the hmgr before executing the command (in
order to support undo).
The flag reentrant is true if the command execution can be interrupted without
leaving the internal status inconsistent.
- Defined in
cmdCmd.c
boolean
Cmd_CommandDefined(
const char* name
)
- True iff a command named 'name' is defined.
- Defined in
cmdCmd.c
int
Cmd_CommandExecute(
char* command
)
- Executes a command line. This is the top-level of the command
interpreter, and supports multiple commands (separated by ;), alias
substitution, etc. For many simple operations, Cmd_CommandExecute() is the
easiest way to accomplish a given task. For example, to set a variable, use
the code: Cmd_CommandExecute("set color blue").
- Defined in
cmdCmd.c
boolean
Cmd_CommandRemove(
const char* name
)
- Returns true if command was found and removed,
false if not found
- Defined in
cmdCmd.c
void
Cmd_End(
)
- Ends the command package. Tables are freed.
- See Also
Cmd_Init
- Defined in
cmdMisc.c
FILE *
Cmd_FileOpen(
char * fileName,
char * mode,
char ** realFileName_p,
int silent
)
- Opens the file with the given mode (see fopen()). Tilde
expansion (~user/ or ~/) is performed on the fileName, and "-" is allowed as
a synonym for stdin (or stdout, depending on the mode). If the file cannot
be opened, a message is reported using perror(); the silent flag, if true,
suppresses this error action. In either case, A NULL file pointer is
returned if any error occurs. The fileName (after tilde expansion) is
returned in the pointer realFileName, if realFileName is non-empty. This
is a pointer which should be free'd when you are done with it.
- Defined in
cmdFile.c
void
Cmd_Init(
)
- Initializes the command package.
- Side Effects Commands are added to the command table.
- See Also
Cmd_End
- Defined in
cmdMisc.c
int
Cmd_SecureCommandExecute(
char* command
)
- This version is securly callable from scripting languages.
Do not call Cmd_CommandExecute directly from a scripting language, otherwise
the script execution could be aborted without any warning.
- Defined in
cmdCmd.c
static int
CommandAlias(
int argc,
char ** argv
)
- Implements the alias command.
- See Also
unalias
- Defined in
cmdMisc.c
static int
CommandEcho(
int argc,
char ** argv
)
- Implements the echo command.
- Defined in
cmdMisc.c
static int
CommandHelp(
int argc,
char ** argv
)
- Implements the help command.
- Defined in
cmdMisc.c
static int
CommandHistory(
int argc,
char ** argv
)
- Implements the history command.
- See Also
set
- Defined in
cmdMisc.c
static int
CommandMemoryProfile(
int argc,
char ** argv
)
- Implements the _memory_profile command.
- Defined in
cmdMisc.c
static int
CommandQuit(
int argc,
char ** argv
)
- A return value of -1 indicates a quick quit, -2 return frees
the memory, -4 an instant quit
- Defined in
cmdMisc.c
static int
CommandShowHelp(
int argc,
char ** argv
)
- Implements the _show_help command.
- Defined in
cmdMisc.c
static int
CommandSource(
int argc,
char ** argv
)
- Implements the source command.
- See Also
history
- Defined in
cmdMisc.c
static int
CommandTime(
int argc,
char ** argv
)
- Implements the time command.
- Defined in
cmdMisc.c
static int
CommandUnalias(
int argc,
char ** argv
)
- Implements the unalias command.
- See Also
alias
- Defined in
cmdMisc.c
static int
CommandUsage(
int argc,
char ** argv
)
- Implements the usage command.
- Defined in
cmdMisc.c
static int
CommandWhich(
int argc,
char ** argv
)
- Implements the which command.
- See Also
set
- Defined in
cmdMisc.c
static void
FlushBuffers(
int sigtype
)
- This function is the signal handler for the SIGUSR1
signal. Whenever that signal is received, this function is executed and the
output channels of NuSMV are flushed.
- See Also
Cmd_Init
- Defined in
cmdMisc.c
static int
apply_alias(
int * argcp,
char *** argvp,
int * loop
)
- Applies alias. If perform a history substitution in expanding
an alias, remove all the orginal trailing arguments. For example:
> alias t rl !:1
> t lion.blif would otherwise expand to rl lion.blif lion.blif
- See Also
optional
- Defined in
cmdCmd.c
static void
arm_signal_andler(
)
- Enable signal trapping depending on the interactive/batch
mode.
- See Also
com_dispatch
- Defined in
cmdCmd.c
static char *
bad_event(
int n
)
- optional
- Side Effects required
- See Also
optional
- Defined in
cmdFile.c
static int
check_shell_escape(
char* p,
int* status
)
- optional
- Side Effects required
- See Also
optional
- Defined in
cmdCmd.c
static int
cmp(
char ** s1,
char ** s2
)
- optional
- Side Effects required
- See Also
optional
- Defined in
cmdFile.c
static int
com_dispatch(
int argc,
char ** argv
)
- optional
- Side Effects required
- See Also
optional
- Defined in
cmdCmd.c
static char *
command_alias_help(
char * command
)
- optional
- Side Effects required
- See Also
optional
- Defined in
cmdMisc.c
static char **
command_completion(
const char * text,
int start,
int end
)
- We use the regular NuSMV command completion function for the
first word on the line, and filename completion for the rest.
- Side Effects none
- See Also
CmdCompletion_Generator
- Defined in
cmdMisc.c
static void
disarm_signal_andler(
)
- Enable signal trapping depending on the interactive/batch
mode.
- See Also
com_dispatch
- Defined in
cmdCmd.c
static char *
do_subst(
char * dest,
char * new
)
- optional
- Side Effects required
- See Also
optional
- Defined in
cmdFile.c
static char *
getarg(
char * line,
int num
)
- optional
- Side Effects required
- See Also
optional
- Defined in
cmdFile.c
static int
getnum(
char ** linep
)
- optional
- Side Effects required
- See Also
optional
- Defined in
cmdFile.c
static int
match(
char * newmatch,
char * lastmatch,
char * actual
)
- optional
- Side Effects required
- See Also
optional
- Defined in
cmdFile.c
static void
print_alias(
char * value
)
- optional
- Side Effects required
- See Also
optional
- Defined in
cmdMisc.c
static void
print_prompt(
char* prompt
)
- optional
- Side Effects required
- See Also
optional
- Defined in
cmdFile.c
static char *
removeWhiteSpaces(
char * string
)
- Removes tabs and spaces from the beginning and end of string.
- Defined in
cmdFile.c
static void
sigterm(
int sig
)
- Signal handler.
- See Also
com_dispatch
- Defined in
cmdCmd.c
static char *
split_line(
char * command,
int * argc,
char *** argv
)
- optional
- Side Effects required
- See Also
optional
- Defined in
cmdCmd.c
static char *
variableInterpolationRecur(
char * str
)
- Recursive procedure that expands the interpolation variables.
This procedure is designed to handle multiple occurrences of variables
in a string and recursive definitions. If the expanded variable has another
variable, then the procedure is called recursively. The existence of a
variable is identified by the $ sign in the string. But since this may be
an environment variable too, the variable is untouched if not found in
this table. A sophisticated check can be made to see if this variable
exists in the environment, but it is NOT done here. Therefore, detection
of bogus values cannot be done. The procedure steps through the string
to see if any variables are present. If a termination character (one of
:, /) is found after the '$', then the variable
is identified and looked up in the flag table. If the returned string again
has a dollar, then the procedure is called recursively. If not, the returned
value replaces the variable and the stepping through continues. If the
variable is not found, then it might be an environment variable.So the
procedure leaves the variable there.
- Side Effects required
- See Also
optional
- Defined in
cmdCmd.c
static void
variableInterpolation(
int argc,
char ** argv
)
- Allows interpolation of variables. Here it is implemented by
allowing variables to be referred to with the prefix of '$'. The variables
are set using the "set" command. So for example, the following can be done
NuSMV> set foo bar
NuSMV> echo $foo
bar
The last line "bar" will the output produced by NuSMV.
The following can also be done:
NuSMV> set foo $foo:foobar
NuSMV> echo $foobar
bar:foobar
The last line will be the output produced by NuSMV.
These variables can
be used in recursive definitions. The following termination characters are
recognized for the variables \n, \0, ' ', \t, :, ;, #, /.
Although the set command allows the usage of the some of the
above termination characters between quotes,
the variable interpolation procedure has the restriction
that the two characters ':' and '/' may not be used with quotes.
A variable with spaces in it may be used only if it is enclosed
within quotes.
- Side Effects required
- See Also
optional
- Defined in
cmdCmd.c
(
)
- Based on the partial input and the list of installed commands
generates the possible completions.
- Side Effects none
- See Also
Cmd_Completion
- Defined in
cmdMisc.c
(
)
- Returned value does not belong to caller.
- Defined in
cmdCmd.c