#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <ctype.h>
#include <math.h>
#include <string>
#include <vector>
#include <strstream.h>
#include <signal.h>
#include <setjmp.h>
#include "ipc.h"
#include "cmdparam.h"
Include dependency graph for cmdparam.c:

Go to the source code of this file.
Compounds | |
| union | bound |
| struct | cmdobj_call |
| struct | cmdobj_clear_hooks |
| struct | cmdobj_define_param |
| struct | cmdobj_dotimes |
| struct | cmdobj_exec |
| struct | cmdobj_exec_file |
| struct | cmdobj_for |
| struct | cmdobj_hook |
| struct | cmdobj_if |
| struct | cmdobj_print |
| struct | cmdobj_quit |
| struct | cmdobj_read_args |
| struct | cmdobj_save_params |
| struct | cmdobj_set |
| struct | cmdobj_system |
| struct | CounterHookDefinition |
| struct | CounterHooklist |
| struct | CounterHooklists |
| struct | ParamInterface |
| struct | PrereqList |
| union | ParamInterface::t |
Defines | |
| #define | PARENTPE (0) |
| #define | AMPARENTPE (ipc_my_process()==PARENTPE) |
| #define | PARAM_MAX_NAME_LENGTH 64 |
| #define | PARAM_MAX_ENTRIES 275 |
| #define | CMDDEF_MAX_NUM 64 |
| Maximum number of commands definable. More... | |
| #define | CMDDEF_MAX_NAME_LENGTH 64 |
| Min num of unique chars in command name. More... | |
| #define | CMDDEF_MAX_PREREQS 2 |
| Maximum number of prerequisite commands. More... | |
| #define | CMD_CALL(cmd) (*((cmd).def->function))((cmd).argc, (cmd).argv) |
| #define | HOOKLIST_MAX_NUM 128 |
| Maximum number of hooks per hooklist. More... | |
| #define | HOOKLIST_MAX_NAME_LENGTH 32 |
| #define | HOOKLISTS_MAX_NUM 4 |
| #define | HAS_CURRENT_HOOK(hooklist) ((hooklist).current < (hooklist).num) |
| #define | CURRENT_HOOK(hooklist) ((hooklist).defs[(hooklist).current]) |
| #define | nexthooknum (hooklists.lists[hooklist].num) |
Typedefs | |
| typedef long double | exprtype |
| typedef void (* | signal_handler_type )(int) |
Functions | |
| cmdstat | cmd_call ( int argc, const char *argv[] ) |
| cmdstat | cmd_clear_hooks ( int argc, const char *argv[] ) |
| cmdstat | cmd_define_param ( int argc, const char *argv[] ) |
| cmdstat | cmd_dotimes ( int argc, const char *argv[] ) |
| cmdstat | cmd_exec ( int argc, const char *argv[] ) |
| cmdstat | cmd_exec_file ( int argc, const char *argv[] ) |
| cmdstat | cmd_for ( int argc, const char *argv[] ) |
| cmdstat | cmd_hook ( int argc, const char *argv[] ) |
| cmdstat | cmd_if ( int argc, const char *argv[] ) |
| cmdstat | cmd_print ( int argc, const char *argv[] ) |
| cmdstat | cmd_quit ( int argc, const char *argv[] ) |
| cmdstat | cmd_read_args ( int argc, const char *argv[] ) |
| This is a hack, but should be reasonably safe and clear. More... | |
| cmdstat | cmd_save_params ( int argc, const char *argv[] ) |
| cmdstat | cmd_set ( int argc, const char *argv[] ) |
| Allows control of any parameter in blackboard from command file. More... | |
| cmdstat | cmd_system ( int argc, const char *argv[] ) |
| size_t | cmdparam_identifier_length (const char* str) |
| Returns the length of the prefix of the given string which consists entirely of characters allowed in identifiers (usually parameter and command names). More... | |
| void | ipc_init_hook ( void ) |
| These declarations are placed here rather than in ipc.c so that it will be independent of this file. More... | |
| exprtype | params_apply_op (exprtype lval, string op, exprtype rval) |
| Currently handles single-character operators only. More... | |
| exprtype | params_getnumericval (const char **remaining ) |
| Same as params_getval but works only with numeric types, and always converts them to "exprtype" (long double, if avail, or double, if not) so they can be returned cleanly. More... | |
| const char* | params_getstringval (const char **remaining ) |
| Same as params_getval but converts result to a string, regardless of its original type, and requires parameter instances to be prefixed by a dollar sign (and optionally surrounded by braces). More... | |
| void* | params_getval (int* type, const char **remaining ) |
| Parses the given string to find its value, substituting the current value of a parameter if its name is found, and returning a literal numeric value if that is found instead. More... | |
| exprtype | params_next_term (const char **remaining, string previous_op="") |
| ParamInterface* | params_lookup (const char *name, size_t len) |
| Looks up the given string as a command name up to the given length, returning a pointer to the parameter or NULL if the parameter was not found. More... | |
| string | params_next_op (const char **remaining) |
| exprtype | params_parse_expr (const char **remaining) |
| exprtype | params_read_float (const char* str) |
| Read in a floating point expression. More... | |
| int | cmddef_compare (const void* hook1, const void* hook2) |
| Used by cmddefs_sort to compare elements. More... | |
| void | cmddefs_sort (void) |
| int | cmddefs_get_line_from_file ( void ) |
| CmdDefs_LineGenerator for files. More... | |
| int | command_check_usage (Command* command) |
| cmdstat | command_exec (Command *cmd) |
| Execute the given command, keeping track of failures and time taken. More... | |
| CommandDefinition* | cmddefs_lookup (const char *name) |
| Looks up the given string as a command name, returning a pointer to the command definition or NULL if the command was not found. More... | |
| int | command_parse_line (Command *command, char *string) |
| Parses the given string for a command and fills the given command instance structure if one was found. More... | |
| const char* | command_parse_token (char** remaining) |
| Parse a string for a single token, where a token is anything enclosed in single or double quotes or separated by whitespace; anything between '#' and the end of the string is ignored. More... | |
| void | command_print_to_str ( const Command *cmd, char *str, size_t nchars) |
| Outputs textual representation of command into the given string. More... | |
| void | cmddef_print_usage (FILE *fp, const CommandDefinition* cmddef) |
| Print usage string to a file, making it up if necessary. More... | |
| void | cmddef_print_usage_to_str (const CommandDefinition* cmddef, char *str, size_t nchars) |
| Print usage info to the given string, making it up if necessary. More... | |
| void | cmddefs_activate_prereqs ( void ) |
| void | cmddefs_activate_command_prereq ( const char* name, const char *prereq ) |
| Put the prerequisite info for a command into its definition; takes effect immediately. More... | |
| int | hook_compare (const void* hook1, const void* hook2) |
| Used by hooklists_sort to compare elements; order is used to make sure sort is stable. More... | |
| void | hook_copy ( CounterHookDefinition *source, CounterHookDefinition *dest) |
| Make an identical copy of the first hook into the second. More... | |
| void | hooklists_log (void) |
| Print a list of the currently-defined counter hooks. More... | |
| int | hook_parse_specifier ( CounterHookDefinition *hook, const char **specifier ) |
| Parse the counter specifier for a hook, returning True if successful. More... | |
| void | hook_print_to_str ( CounterHookDefinition *hook, char *hooklistname, char *str, size_t nchars) |
| Print a list of the currently-defined counter hooks. More... | |
| void | hooklists_sort (HooklistNum hooklist) |
| Sort the list of hooks in ascending order of start counter, starting at the current hook so that place is not lost. More... | |
| int | param_check ( const ParamInterface* param, const void * valueptr) |
| Check upper and lower bounds for the given parameter, if there are any. More... | |
| int | param_compare (const void* param1, const void* param2) |
| Used by params_sort to compare elements. More... | |
| const char* | param_pp_boolean (int value) |
| const char* | param_pp_float (float value) |
| const char* | param_pp_int (int value) |
| const char* | param_pp_scalar (const ParamInterface* def, void *value) |
| int | param_print_range (FILE *fp, ParamInterface* param) |
| int | param_print_type (FILE *fp, ParamInterface* param) |
| int | param_print_usage (FILE *fp, ParamInterface* param) |
| int | param_print_value (FILE *fp, ParamInterface* param) |
| void | params_sort (void) |
| Sort the currently-defined parameters by name. More... | |
| void | command_exec_sigint_handler ( int sig ) |
| void | cmdparam_init_hook ( void ) |
| This routine must be called before using parameters or commands, and no commands should be defined after it is called. More... | |
| int | params_define_param (const char *name, int type, int is_constant, void *pointer) |
| Add a parameter to the user interface structure. More... | |
| void | params_add_lower_bound_int (const char *name, int lower_bound) |
| Add lower bounds to an existing parameter in the user interface structure. More... | |
| void | params_add_upper_bound_int (const char *name, int upper_bound) |
| Add upper bound to an existing parameter in the user interface structure. More... | |
| void | params_define_default_expr (const char *name, const char *expr) |
| Add an expression representing a default value. More... | |
| void | params_update_default_value (int idx) |
| If there is an expression available for the default value, and the parameter hasn't been set explicitly, generate a new value for the param by evaluating the expression. More... | |
| void | params_update_default_value (const char* name) |
| Wrapper taking a name instead of an index. More... | |
| void | params_update_all_default_values ( void ) |
| Generate the default value for all params having an expression for it. More... | |
| void | params_define_doc ( const char* name, const char *doc ) |
| Define help string for a parameter. More... | |
| void | params_define_setfn ( const char* name, SetFnWrapper* setfn ) |
| Define function to set a specific parameter. More... | |
| int | params_check_all ( void ) |
| Check upper and lower bounds for each parameter, if defined. More... | |
| int | params_num_total (void) |
| Returns current size of parameter blackboard. More... | |
| int | params_print_to_str ( int number, char *str, size_t nchars) |
| Converts parameter into the given string in a format suitable for cmddefs_exec_str(). More... | |
| void | params_log (void) |
| Prints parameter values to the log file from the parameter blackboard. More... | |
| void | params_print_all (FILE *fp) |
| Prints parameter values to a file from the parameter blackboard. More... | |
| void | params_print_parameters (FILE *fp) |
| Prints values of all non-constant parameters to a file. More... | |
| void | params_print_constants (FILE *fp) |
| Prints constant values to a file. More... | |
| void | params_print_doc_for_index (FILE *fp, int idx) |
| int | params_is_constant (int idx) |
| void | params_print_doc (FILE *fp, const char* name) |
| Print documentation string for a param to a file. More... | |
| void | params_print_constants_doc (FILE *file) |
| void | params_print_parameters_doc (FILE *file) |
| char* | params_completion_generator (char *text, int state) |
| For use with functions like readline(); returns a dynamically-allocated string with the next possible completion for the given partial word. More... | |
| double* | params_lookup_double (const char *name) |
| Looks up the given string as a command name and returns a pointer to the data value, or NULL if the parameter was not found (or is not type double). More... | |
| int | params_op_has_precedence (const string& previous_op, const string& op) |
| double | cmdf (const char* str) |
| Public routine to read an expression of type double. More... | |
| long | cmdi (const char* str) |
| Integer equivalent of cmdf. More... | |
| const char* | cmds (const char* str) |
| Public routine to read an expression of string type. More... | |
| void | cmddefs_define_command ( const char* name, CmdWrapper* function, int minargs, int exec_for_catchups ) |
| Add command to list of known commands. More... | |
| void | cmddefs_define_command_doc ( const char* name, const char *usage, const char *doc ) |
| Define help string for command. More... | |
| void | cmddefs_define_command_prereq ( const char* name, const char *prereq ) |
| Put a prerequisite for a command into a temporary holding area while the other commands are defined; doesn't take effect until activated later. More... | |
| void | cmddefs_declare_prereq_status ( const char * name, cmdstat status ) |
| Ordinary prerequisites are handled automatically, but if a command makes mutually recursive calls to other commands which require it as a prerequisite, the command may call this routine beforehand to declare that its useful work is done, and thus that the prerequisite is satisfied. More... | |
| cmdstat | cmddefs_exec_by_name (const char* name, int argc, const char *argv[] ) |
| cmdstat | cmddefs_exec_str (const char* cmdtxt) |
| Parse and execute the command specified in the given string. More... | |
| int | cmddefs_exec_batch (CmdDefs_LineGenerator fn, const char * description) |
| Reads commands iteratively and executes them in sequence. More... | |
| int | cmddefs_exec_file (const char *filename) |
| Reads commands from a command file and executes them. More... | |
| int | cmddefs_num_total (void) |
| Returns current size of command blackboard. More... | |
| void | cmddefs_print_all (FILE *fp) |
| Print summary of command definitions to a file. More... | |
| void | cmddefs_print_doc_for_index (FILE *fp, int idx) |
| void | cmddefs_print_doc (FILE *fp, const char* name) |
| Print documentation string for a command to a file. More... | |
| void | cmddefs_print_all_doc (FILE *file) |
| char* | cmddefs_completion_generator (char *text, int state) |
| For use with functions like readline(); returns a dynamically-allocated string with the next possible completion for the given partial word. More... | |
| int | hooklists_define_list ( const char * listname, const char * countername ) |
| Defines a new hooklist and returns its number. More... | |
| void | hooklists_run_list (HooklistNum hooklist, int counter, int catchuponly) |
| Run the counter hooks in the given list which specify this counter value. More... | |
| void | hooklists_reset_list (HooklistNum hooklist) |
| Reset current hook of the given list to the beginning. More... | |
| void | hooklists_empty_list (HooklistNum hooklistnum) |
| Remove all the hooks defined in the given list. More... | |
| char* | cmdparam_dupstr (const char *str) |
| Allocate a copy of a string; must be freed when done using it. More... | |
| int | cmdparams_print_doc (FILE *fp, const char* name) |
| Print documentation string for any known object to a file. More... | |
| char* | cmdparams_completion_generator (char *text, int state) |
| Returns possible completion for command (if any) or parameter (if any). More... | |
| int | cmdparam_save_current_state (const char * filename) |
| cmdstat | cmdparam_set ( const char *name, const char *expr ) |
| Set a parameter by name from an expression. More... | |
Variables | |
| CounterHooklists | hooklists |
| Blackboard | blackboard |
| Parameter blackboard. More... | |
| CommandDefinitionBlackboard | command_definitions |
| Command def blackboard. More... | |
| int | cmdparam_warn_unknown = True |
| Whether to warn about unknown params. More... | |
| int | cmdparam_changes_verbose = True |
| Whether to announce param changes. More... | |
| int | commands_succeeded = 0 |
| int | commands_failed = 0 |
| int | command_num_called = 0 |
| int | hook_definition_counter = 0 |
| FILE* | cmddefs_file = NULL |
| char | commandpath [CMD_MAX_LINE_LENGTH] = "../command/ ../../command/ ../samples/" |
| int | cmddefs_exec_file_argc = 0 |
| Arguments for cmd_read_args. More... | |
| const char** | cmddefs_exec_file_argv = NULL |
| char | cmddefs_line_buffer [CMD_MAX_LINE_LENGTH+1+sizeof(int)] |
| PrereqList | prereq_storage |
| const char | cmdparam_help_separator [] = "_______________________________________________________________________________\n" |
| jmp_buf | jmp_env |
This file provides general-purpose handling for PARAMETERS, COMMANDS, and COUNTER HOOKS.
PARAMETERS are global or static variables stored in a container called a blackboard. The blackboard provides a standard interface for defining parameters and setting/viewing their values via interactive displays, command-line arguments, and command prompts. Upper and/or lower bounds can be provided for each parameter to provide automatic error checking.
COMMANDS are a standardized method for executing operations requiring a set of arguments. The commands can come from a string (e.g. read at a command prompt, or from a text entry widget) or from a text file, called a command file. A common command "set" is provided to give a value to the specified parameter(s). Commands may specify a minimum number of arguments required, and may accept a variable number of arguments via an argc,argv mechanism like for shell commands.
COUNTER HOOKS are a way to delay execution of a command until a specified value is reached for a user-specified counter. Any number of separate hooklists can be defined using the command "hook_list", so a program can have different hooks for different stages in processing for a given counter value. Hooks themselves can be defined using the command "hook" to declare the hooklist to which it applies, the counter range and step to which it applies, and the command to be executed. If the counter value has gaps (e.g. if some saved state was restored, and the counter with it), only commands specifically declared to execute during the catchup period are called when the next valid counter value is found.
The code is loosely object-oriented around the following objects:
Fn. prefix Struct name Description ---------- ----------------------------- ------------------------- param_ ParamInterface a parameter definition params_ Blackboard container for paramscmddef_ CommandDefinition a command definition cmddefs_ CommandDefinitionBlackboard container for cmddefs
command_ Command a command instance w/args
hook_ CounterHookDefinition a counter hook hooklist_ CounterHooklist container for hooks hooklists_ CounterHooklists container for hooklists
cmdparam_ (just globals right now) container for all objects
It's just C code, of course, so these distinctions aren't enforced, but it shouldn't be too difficult to translate the structs and global functions into the corresponding C++ classes and member functions, and that would make the code clearer, safer, shorter, and easier to extend and debug.
Definition in file cmdparam.c.
|
|
Definition at line 92 of file cmdparam.c. |
|
|
Min num of unique chars in command name.
Definition at line 141 of file cmdparam.c. |
|
|
Maximum number of commands definable.
Definition at line 139 of file cmdparam.c. |
|
|
Maximum number of prerequisite commands.
Definition at line 143 of file cmdparam.c. |
|
|
Definition at line 172 of file cmdparam.c. |
|
|
Definition at line 206 of file cmdparam.c. |
|
|
Definition at line 205 of file cmdparam.c. |
|
|
Definition at line 203 of file cmdparam.c. |
|
|
Definition at line 191 of file cmdparam.c. |
|
|
Maximum number of hooks per hooklist.
Definition at line 189 of file cmdparam.c. |
|
|
Definition at line 122 of file cmdparam.c. |
|
|
Definition at line 97 of file cmdparam.c. |
|
|
Definition at line 91 of file cmdparam.c. |
|
|
Definition at line 2501 of file cmdparam.c. |
|
|
Definition at line 132 of file cmdparam.c. |
|
|
Definition at line 264 of file cmdparam.c. |
|
|
Definition at line 3190 of file cmdparam.c. |
|
|
Definition at line 3114 of file cmdparam.c. |
|
|
Definition at line 3225 of file cmdparam.c. |
|
|
Definition at line 3267 of file cmdparam.c. |
|
|
Definition at line 3161 of file cmdparam.c. |
|
|
Definition at line 3175 of file cmdparam.c. |
|
|
Definition at line 3282 of file cmdparam.c. |
|
|
Definition at line 2502 of file cmdparam.c. |
|
|
Definition at line 3257 of file cmdparam.c. |
|
|
Definition at line 3296 of file cmdparam.c. |
|
|
Definition at line 3099 of file cmdparam.c. |
|
|
This is a hack, but should be reasonably safe and clear.
Definition at line 3214 of file cmdparam.c. |
|
|
Definition at line 3153 of file cmdparam.c. |
|
|
Allows control of any parameter in blackboard from command file.
Definition at line 3075 of file cmdparam.c. |
|
|
Definition at line 3313 of file cmdparam.c. |
|
|
Used by cmddefs_sort to compare elements.
Definition at line 2287 of file cmdparam.c. |
|
|
Print usage string to a file, making it up if necessary.
Definition at line 2296 of file cmdparam.c. Referenced by cmddefs_print_all(). |
|
|
Print usage info to the given string, making it up if necessary.
Definition at line 2311 of file cmdparam.c. |
|
|
Put the prerequisite info for a command into its definition; takes effect immediately.
Definition at line 1739 of file cmdparam.c. Referenced by cmddefs_declare_prereq_status(). |
|
|
Definition at line 1725 of file cmdparam.c. |
|
|
For use with functions like readline(); returns a dynamically-allocated string with the next possible completion for the given partial word. Free should be called on the string when done with it. Definition at line 2405 of file cmdparam.c. |
|
|
Ordinary prerequisites are handled automatically, but if a command makes mutually recursive calls to other commands which require it as a prerequisite, the command may call this routine beforehand to declare that its useful work is done, and thus that the prerequisite is satisfied. This prevents a vicious circle of attempted prerequisite satisfaction. Definition at line 1717 of file cmdparam.c. |
|
|
Add command to list of known commands.
Definition at line 1643 of file cmdparam.c. |
|
|
Define help string for command.
Definition at line 1668 of file cmdparam.c. |
|
|
Put a prerequisite for a command into a temporary holding area while the other commands are defined; doesn't take effect until activated later.
Definition at line 1692 of file cmdparam.c. |
|
|
Reads commands iteratively and executes them in sequence. The command lines come from cmddefs_line_buffer, which the given function should place a string into once it is called with no arguments on a single PE. The fn should return True ("done") when there is no more input available. Each line may be up to CMD_MAX_LINE_LENGTH total, and may contain up to one command with up to CMD_MAX_ARGUMENTS arguments, up to CMD_MAX_LINE_LENGTH total. The description should be something like "file filename..." or "prompt". Definition at line 2103 of file cmdparam.c. |
|
|
Definition at line 1798 of file cmdparam.c. |
|
|
Reads commands from a command file and executes them.
Definition at line 2203 of file cmdparam.c. |
|
|
Parse and execute the command specified in the given string.
Definition at line 2074 of file cmdparam.c. |
|
|
CmdDefs_LineGenerator for files. Concatenates as long as it keeps finding lines ending in a backslash Definition at line 2181 of file cmdparam.c. |
|
|
Looks up the given string as a command name, returning a pointer to the command definition or NULL if the command was not found.
Definition at line 1777 of file cmdparam.c. |
|
|
Returns current size of command blackboard.
Definition at line 2248 of file cmdparam.c. |
|
|
Print summary of command definitions to a file.
Definition at line 2340 of file cmdparam.c. |
|
|
Definition at line 2386 of file cmdparam.c. |
|
|
Print documentation string for a command to a file.
Definition at line 2369 of file cmdparam.c. |
|
|
Definition at line 2352 of file cmdparam.c. |
|
|
Definition at line 2278 of file cmdparam.c. |
|
|
Public routine to read an expression of type double.
Definition at line 1609 of file cmdparam.c. |
|
|
Integer equivalent of cmdf. Returns type long but warns if can't fit in int. Definition at line 1615 of file cmdparam.c. |
|
|
Allocate a copy of a string; must be freed when done using it.
Definition at line 2863 of file cmdparam.c. |
|
|
Returns the length of the prefix of the given string which consists entirely of characters allowed in identifiers (usually parameter and command names). Uses C-language indentifier rules. Definition at line 2847 of file cmdparam.c. Referenced by params_getstringval(), and params_lookup(). |
|
|
This routine must be called before using parameters or commands, and no commands should be defined after it is called.
Definition at line 350 of file cmdparam.c. Referenced by lissom_init_hooks(). |
|
|
Definition at line 2908 of file cmdparam.c. |
|
|
Set a parameter by name from an expression.
Definition at line 2946 of file cmdparam.c. |
|
|
Returns possible completion for command (if any) or parameter (if any).
Definition at line 2900 of file cmdparam.c. |
|
|
Print documentation string for any known object to a file. Returns True if object was found. Definition at line 2876 of file cmdparam.c. |
|
|
Public routine to read an expression of string type.
Definition at line 1631 of file cmdparam.c. |
|
|
Definition at line 1950 of file cmdparam.c. |
|
|
Execute the given command, keeping track of failures and time taken.
Definition at line 1983 of file cmdparam.c. Referenced by hooklists_run_list(). |
|
|
Definition at line 1970 of file cmdparam.c. |
|
|
Parses the given string for a command and fills the given command instance structure if one was found. The given string is overwritten, as with strtok. Any arguments past CMD_MAX_ARGUMENTS are ignored (but warned about). Returns number of commands successfully processed (0 or 1). Definition at line 1919 of file cmdparam.c. |
|
|
Parse a string for a single token, where a token is anything enclosed in single or double quotes or separated by whitespace; anything between '#' and the end of the string is ignored. The "remaining" pointer is modified to point to the unparsed portion remaining after this token. The string pointed to by remaining is also modified by inserting a null at the end of the token (as in strtok). This solves various memory lifetime problems that would otherwise require using a full C++ class for the command arguments. Handling of the equals sign is an even more egregious hack than the rest of this routine. To compensate for the fact that '=' need not be surrounded by whitespace (and thus inserting delimiters in the fixed-length original string may be impossible), a pointer to a static copy of it is returned when found. (It is effectively treated as if it were always surrounded by whitespace, which prevents constructions like "!=".) The only real solution to this problem would be to require whitespace around '=' (a lousy idea) or to redo this entire routine using C++ strings (an excellent idea). Definition at line 1843 of file cmdparam.c. |
|
|
Outputs textual representation of command into the given string. Useful for printing. Definition at line 2257 of file cmdparam.c. Referenced by command_exec(). |
|
|
Used by hooklists_sort to compare elements; order is used to make sure sort is stable.
Definition at line 2669 of file cmdparam.c. |
|
|
Make an identical copy of the first hook into the second.
Definition at line 2629 of file cmdparam.c. |
|
|
Parse the counter specifier for a hook, returning True if successful.
Definition at line 2588 of file cmdparam.c. |
|
|
Print a list of the currently-defined counter hooks. The format is currently suitable for cmddefs_exec_str() for convenience. Definition at line 2788 of file cmdparam.c. Referenced by hooklists_log(). |
|
|
Defines a new hooklist and returns its number.
Example C usage: Returns the number assigned to this list. Definition at line 2457 of file cmdparam.c. |
|
|
Remove all the hooks defined in the given list.
Definition at line 2764 of file cmdparam.c. |
|
|
Print a list of the currently-defined counter hooks. The format is currently suitable for cmddefs_exec_str() for convenience. Definition at line 2821 of file cmdparam.c. |
|
|
Reset current hook of the given list to the beginning.
Definition at line 2753 of file cmdparam.c. |
|
|
Run the counter hooks in the given list which specify this counter value. Earlier values not yet run are called only if their definition specifies that. This routine should be called at most once for each counter value, from the location where you want hooks from the given list to be called. Definition at line 2690 of file cmdparam.c. |
|
|
Sort the list of hooks in ascending order of start counter, starting at the current hook so that place is not lost.
Definition at line 2657 of file cmdparam.c. |
|
|
These declarations are placed here rather than in ipc.c so that it will be independent of this file.
Definition at line 540 of file cmdparam.c. |
|
|
Check upper and lower bounds for the given parameter, if there are any. Returns the number of errors found. Definition at line 796 of file cmdparam.c. Referenced by cmdparam_set(). |
|
|
Used by params_sort to compare elements.
Definition at line 995 of file cmdparam.c. |
|
|
Definition at line 1042 of file cmdparam.c. |
|
|
Definition at line 1066 of file cmdparam.c. |
|
|
Definition at line 1053 of file cmdparam.c. |
|
|
Definition at line 1079 of file cmdparam.c. |
|
|
Definition at line 1124 of file cmdparam.c. |
|
|
Definition at line 1107 of file cmdparam.c. |
|
|
Definition at line 1156 of file cmdparam.c. |
|
|
Definition at line 1093 of file cmdparam.c. |
|
|
Add lower bounds to an existing parameter in the user interface structure. Only supports integer bounds at present, though it can add them to either integer or float parameters. Definition at line 656 of file cmdparam.c. |
|
|
Add upper bound to an existing parameter in the user interface structure. Only supports integer bounds at present, though it can add them to either integer or float parameters Definition at line 692 of file cmdparam.c. |
|
|
Currently handles single-character operators only.
Definition at line 1481 of file cmdparam.c. |
|
|
Check upper and lower bounds for each parameter, if defined. Returns the number that had errors. Definition at line 918 of file cmdparam.c. |
|
|
For use with functions like readline(); returns a dynamically-allocated string with the next possible completion for the given partial word. Free should be called on the string when done with it. Definition at line 1257 of file cmdparam.c. |
|
|
Add an expression representing a default value. The expression must be allocated in storage that will persist until the last call to params_update_default_value(const char *name) is issued; a string literal will suffice. Definition at line 730 of file cmdparam.c. |
|
|
Define help string for a parameter. The docstring should ordinarily be a string literal to avoid scoping and lifetime problems. Definition at line 878 of file cmdparam.c. |
|
|
Add a parameter to the user interface structure. Returns a true value if the parameter is defined by the end of the call -- 1 if it was defined by this call, 2 if it was already defined Definition at line 602 of file cmdparam.c. |
|
|
Define function to set a specific parameter.
Definition at line 897 of file cmdparam.c. |
|
|
Same as params_getval but works only with numeric types, and always converts them to "exprtype" (long double, if avail, or double, if not) so they can be returned cleanly.
Definition at line 1442 of file cmdparam.c. Referenced by hook_parse_specifier(). |
|
|
Same as params_getval but converts result to a string, regardless of its original type, and requires parameter instances to be prefixed by a dollar sign (and optionally surrounded by braces). It returns a pointer to a static buffer, so the lifetime of the result is only until the next call to this function. Definition at line 1384 of file cmdparam.c. |
|
|
Parses the given string to find its value, substituting the current value of a parameter if its name is found, and returning a literal numeric value if that is found instead. The value is returned as a pointer to an item of type `type'; the actual value can be obtained by casting the pointer to the appropriate type. If it is non-NULL on entry, the `remaining' ptr is set to what's left over in the string, if anything. Definition at line 1333 of file cmdparam.c. |
|
|
Definition at line 1198 of file cmdparam.c. |
|
|
Prints parameter values to the log file from the parameter blackboard.
Definition at line 968 of file cmdparam.c. |
|
|
Looks up the given string as a command name up to the given length, returning a pointer to the parameter or NULL if the parameter was not found.
Definition at line 1305 of file cmdparam.c. Referenced by params_getstringval(). |
|
|
Looks up the given string as a command name and returns a pointer to the data value, or NULL if the parameter was not found (or is not type double).
Definition at line 1288 of file cmdparam.c. |
|
|
Definition at line 1527 of file cmdparam.c. |
|
|
Definition at line 1541 of file cmdparam.c. |
|
|
Returns current size of parameter blackboard.
Definition at line 932 of file cmdparam.c. |
|
|
Definition at line 1519 of file cmdparam.c. |
|
|
Definition at line 1563 of file cmdparam.c. |
|
|
Prints parameter values to a file from the parameter blackboard.
Definition at line 1005 of file cmdparam.c. |
|
|
Prints constant values to a file.
Definition at line 1030 of file cmdparam.c. |
|
|
Definition at line 1223 of file cmdparam.c. |
|
|
Print documentation string for a param to a file.
Definition at line 1206 of file cmdparam.c. |
|
|
Definition at line 1182 of file cmdparam.c. |
|
|
Prints values of all non-constant parameters to a file.
Definition at line 1017 of file cmdparam.c. |
|
|
Definition at line 1237 of file cmdparam.c. |
|
|
Converts parameter into the given string in a format suitable for cmddefs_exec_str().
Definition at line 941 of file cmdparam.c. |
|
|
Read in a floating point expression.
Definition at line 1585 of file cmdparam.c. Referenced by cmdf(). |
|
|
Sort the currently-defined parameters by name.
Definition at line 984 of file cmdparam.c. |
|
|
Generate the default value for all params having an expression for it.
Definition at line 784 of file cmdparam.c. |
|
|
Wrapper taking a name instead of an index.
Definition at line 766 of file cmdparam.c. |
|
|
If there is an expression available for the default value, and the parameter hasn't been set explicitly, generate a new value for the param by evaluating the expression.
Definition at line 753 of file cmdparam.c. |
|
|
Parameter blackboard.
Definition at line 234 of file cmdparam.c. |
|
|
Arguments for cmd_read_args.
Definition at line 252 of file cmdparam.c. |
|
|
Definition at line 253 of file cmdparam.c. |
|
|
Definition at line 248 of file cmdparam.c. |
|
|
Definition at line 255 of file cmdparam.c. |
|
|
Whether to announce param changes.
Definition at line 238 of file cmdparam.c. |
|
|
Definition at line 259 of file cmdparam.c. |
|
|
Whether to warn about unknown params.
Definition at line 237 of file cmdparam.c. |
|
|
Command def blackboard.
Definition at line 235 of file cmdparam.c. |
|
|
Definition at line 242 of file cmdparam.c. |
|
|
Definition at line 249 of file cmdparam.c. |
|
|
Definition at line 241 of file cmdparam.c. |
|
|
Definition at line 240 of file cmdparam.c. |
|
|
Definition at line 245 of file cmdparam.c. |
|
|
Definition at line 232 of file cmdparam.c. |
|
|
Definition at line 265 of file cmdparam.c. |
|
|
Definition at line 257 of file cmdparam.c. |
1.2.1 written by Dimitri van Heesch,
© 1997-2000