GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> CLI / V0-1-2 > cli / rhel6-64
#include <stdlib.h>
#include <sys/stat.h>
#include <unistd.h>
Classes | |
struct | _CLI_KeyDef |
A CLI keyword definition. More... | |
struct | _CLI_KeyList |
A CLI keyword list. More... | |
struct | _CLI_ParmDef |
A CLI parameter definition. More... | |
struct | _CLI_QualDef |
A CLI qualifier definition. More... | |
struct | _CLI_VerbDef |
A CLI verb definition. More... | |
struct | _CLI_Syntax |
A CLI syntax. More... | |
struct | _CLI_Valu |
A value found on the command line. More... | |
struct | _CLI_Parm |
A parameter found on the command line. More... | |
struct | _CLI_Qual |
A qualifier found on the command line. More... | |
struct | _CLI_Tokens |
Content of a complete command line. More... | |
struct | _CLI_File |
struct | _CLI_Control |
Defines | |
#define | CLI_O_PARMOPT (CLI_O_REQUIRED) |
#define | CLI_O_QUALOPT |
#define | CLI_T_PARMTYPE |
#define | CLI_T_QUALTYPE |
#define | CLI_T_VALUTYPE |
#define | CLI_L_KEY (0xff) |
#define | CLI_L_VERB (0xff) |
#define | CLI_L_QUAL (0xff) |
#define | CLI_K_SYNTAX (0xace0) |
#define | CLI_K_VERBDEF (0xace1) |
#define | CLI_K_KEYLIST (0xace2) |
#define | CLI_K_CONTROL (0xace3) |
Typedefs | |
typedef struct _CLI_Valu | CLI_Valu |
Typedef for struct _CLI_Valu. | |
typedef struct _CLI_Parm | CLI_Parm |
Typedef for struct _CLI_Parm. | |
typedef struct _CLI_Qual | CLI_Qual |
Typedef for struct _CLI_Qual. | |
typedef struct _CLI_Tokens | CLI_Tokens |
Typedef for struct _CLI_Tokens. | |
typedef struct _CLI_File | CLI_File |
Typedef for struct _CLI_File. | |
Functions | |
unsigned int | CLI_indirect (CLI_Control *ctl, void *user) |
CLI provided callback to deal with file indirection. | |
void | CLI_clearFiles (CLI_Control *ctl) |
Clear the CLI open file stack. | |
void | CLI_clearTokens (CLI_Tokens *tokens) |
Clear all the tokens from the token tree. | |
void | CLI_dumpKeyList (CLI_KeyList *list) |
Dump a list of keywords. | |
void | CLI_dumpParse (CLI_Control *ctl) |
Dump the results of a parse. | |
unsigned int | CLI_dumpSyntax (CLI_Control *ctl, void *user) |
Dump out the syntax definitions. | |
unsigned int | CLI_parse (const char *ilin, CLI_Control *ctl, void *user) |
Parse a command line with the given syntax. | |
unsigned int | CLI_squeeze (const char *ilin, char **olin) |
Squeeze all unnecessary white space from a CLI line. | |
unsigned int | CLI_parseValue (char *tbeg, char *tend, unsigned short type, CLI_KeyList *keys, CLI_Valu **list) |
Parse a command line value. | |
Variables | |
CLI_Syntax * | CLI_syntaxList |
Root of a list of all CLI syntaxes. | |
CLI_KeyList * | CLI_keyListList |
Root of a list of all keyword lists. |
CVS $Id: CLI_prvdefs.h,v 1.5 2009/08/12 00:25:46 apw Exp $
#define CLI_O_QUALOPT |
Value:
(CLI_O_NEGATE | CLI_O_VALUE | \ CLI_O_NOVALUE | CLI_O_REQUIRED )
#define CLI_T_PARMTYPE |
Value:
(CLI_T_LIST | CLI_T_INTEGER | \ CLI_T_FLOAT | CLI_T_KEYWORD | \ CLI_T_RESTOFLINE | CLI_T_NEWSNTX | \ CLI_T_TIMESTAMP )
#define CLI_T_QUALTYPE |
Value:
(CLI_T_LIST | CLI_T_INTEGER | \ CLI_T_FLOAT | CLI_T_KEYWORD | \ CLI_T_TIMESTAMP )
#define CLI_T_VALUTYPE |
Value:
(CLI_T_INTEGER | CLI_T_FLOAT | \ CLI_T_KEYWORD | CLI_T_TIMESTAMP )
void CLI_clearFiles | ( | CLI_Control * | ctl | ) |
Clear the CLI open file stack.
ctl | CLI control block |
References _CLI_File::fd, _CLI_Control::file, _CLI_File::line, _CLI_File::name, and _CLI_File::next.
Referenced by CLI_command(), and CLI_getFile().
void CLI_clearTokens | ( | CLI_Tokens * | tokens | ) |
Clear all the tokens from the token tree.
tokens | Token structure at head of token tree |
References _CLI_Tokens::line, _CLI_Qual::list, _CLI_Parm::list, _CLI_Qual::next, _CLI_Valu::next, _CLI_Parm::next, _CLI_Tokens::parm, _CLI_Tokens::qual, _CLI_Qual::text, _CLI_Valu::text, and _CLI_Tokens::verb.
Referenced by CLI_command(), and CLI_parse().
void CLI_dumpKeyList | ( | CLI_KeyList * | list | ) |
Dump a list of keywords.
list | (Opaque) pointer to keyword list |
References _CLI_KeyList::id, _CLI_KeyList::key, _CLI_KeyList::name, _CLI_KeyDef::next, and _CLI_KeyDef::text.
void CLI_dumpParse | ( | CLI_Control * | ctl | ) |
Dump the results of a parse.
ctl | (Opaque) pointer to CLI control structure. |
References _CLI_Qual::flag, _CLI_Control::id, _CLI_Qual::list, _CLI_Parm::list, _CLI_Qual::next, _CLI_Valu::next, _CLI_Parm::next, _CLI_Tokens::parm, _CLI_Tokens::qual, _CLI_Qual::text, _CLI_Valu::text, _CLI_Control::tokens, and _CLI_Tokens::verb.
unsigned int CLI_dumpSyntax | ( | CLI_Control * | ctl, | |
void * | user | |||
) |
Dump out the syntax definitions.
Dump a command syntax (either a named syntax, or all known syntaxes).
References dumpSyntax(), and _CLI_Control::syntax.
Referenced by CLI_createSyntax().
unsigned int CLI_indirect | ( | CLI_Control * | ctl, | |
void * | user | |||
) |
CLI provided callback to deal with file indirection.
ctl | (Opaque) pointer to CLI control structure | |
user | User parameter (ignored) |
CLI_SUCCESS | File found and opened | |
CLI_NOSCHFIL | File could not be found | |
CLI_FILRCURS | File indirection has recursed |
References CLI_getValue(), _CLI_File::fd, _CLI_Control::file, _CLI_File::frst, _CLI_File::last, _CLI_File::line, _CLI_File::name, _CLI_File::next, _CLI_File::st_dev, _CLI_File::st_ino, and _CLI_File::stat.
Referenced by CLI_createSyntax().
unsigned int CLI_parse | ( | const char * | ilin, | |
CLI_Control * | ctl, | |||
void * | user | |||
) |
Parse a command line with the given syntax.
ilin | Input line to parse | |
ctl | CLI control structure | |
user | (Opaque) pointer to user parameter(s) |
References CLI_clearTokens(), CLI_command(), CLI_MD_PVAL, CLI_MD_QUAL, CLI_MD_QVAL, CLI_present(), CLI_squeeze(), dispatch(), _CLI_Tokens::line, _CLI_QualDef::next, _CLI_ParmDef::next, _CLI_Qual::next, _CLI_QualDef::opts, _CLI_VerbDef::parm, _CLI_Tokens::parm, _CLI_VerbDef::preq, _CLI_VerbDef::qual, _CLI_Tokens::qual, savePval(), saveQual(), saveQval(), saveRest(), saveVerb(), _CLI_ParmDef::sork, _CLI_QualDef::text, _CLI_Control::tokens, and _CLI_ParmDef::type.
Referenced by CLI_command().
unsigned int CLI_parseValue | ( | char * | tbeg, | |
char * | tend, | |||
unsigned short | type, | |||
CLI_KeyList * | keys, | |||
CLI_Valu ** | list | |||
) |
Parse a command line value.
tbeg | First character | |
tend | (One past) the last character | |
type | Type constraints on value(s) | |
keys | Keyword list (if needed) | |
list | Location where the value list should be saved |
CLI_BADPAREN | Unexpected/unbalanced parentheses | |
CLI_BADQUOTE | Unexpected/unbalanced quotation marks | |
CLI_KEYAMBG | Keyword is ambiguous | |
CLI_KEYUND | Value is not a valid keyword | |
CLI_NOTALLOC | Memory allocation failure | |
CLI_SUCCESS | Success | |
CLI_VALEND | Unexpected end of value | |
CLI_VALLIST | Unexpected list of values | |
CLI_VALNTFLT | Value is not a floating point number | |
CLI_VALNTINT | Value is not an integer |
References clearValueList(), and saveValue().
Referenced by savePval(), and saveQval().
unsigned int CLI_squeeze | ( | const char * | ilin, | |
char ** | olin | |||
) |
Squeeze all unnecessary white space from a CLI line.
ilin | Input line | |
olin | Output line |
Referenced by CLI_parse().