#include <stdlib.h>
#include <sys/stat.h>
#include <unistd.h>
Data Structures | |
struct | _CLI_Control |
Control structure for run time handling of commands. More... | |
struct | _CLI_File |
Control structure for a file being read by CLI. More... | |
struct | _CLI_KeyDef |
A CLI keyword definition. More... | |
struct | _CLI_KeyList |
A CLI keyword list. More... | |
struct | _CLI_Parm |
A parameter found on the command line. More... | |
struct | _CLI_ParmDef |
A CLI parameter definition. More... | |
struct | _CLI_Qual |
A qualifier found on the command line. More... | |
struct | _CLI_QualDef |
A CLI qualifier definition. More... | |
struct | _CLI_Syntax |
A CLI syntax. More... | |
struct | _CLI_Tokens |
Content of a complete command line. More... | |
struct | _CLI_Valu |
A value found on the command line. More... | |
struct | _CLI_VerbDef |
A CLI verb definition. More... | |
Defines | |
#define | CLI_O_PARMOPT (CLI_O_REQUIRED) |
OR of valid parameter option bits. | |
#define | CLI_O_QUALOPT |
OR of valid qualifier option bits. More... | |
#define | CLI_T_PARMTYPE |
OR of valid parameter type bits. More... | |
#define | CLI_T_QUALTYPE |
OR of valid qualifier type bits. More... | |
#define | CLI_T_VALUTYPE |
OR of valid value type bits. More... | |
#define | CLI_L_KEY 0xff |
Maximum length of a keyword. | |
#define | CLI_L_VERB 0xff |
Maximum length of a verb. | |
#define | CLI_L_QUAL 0xff |
Maximum length of a qualifier. | |
#define | CLI_K_SYNTAX 0xace0 |
Identifies a syntax structure. | |
#define | CLI_K_VERBDEF 0xace1 |
Identifies a verb definition structure. | |
#define | CLI_K_KEYLIST 0xace2 |
Identifies a keyword list structure. | |
#define | CLI_K_CONTROL 0xace3 |
Identifies a CLI control structure. | |
#define | CLI_EMPTY 0x00000101 |
Command line is empty. | |
#define | CLI_OLDQUAL 0x00000103 |
Repeat of existing qualifier. | |
#define | CLI_NEWSNTX 0x00000105 |
Branch to new syntax. | |
#define | CLI_AMBGKEY 0x00000100 |
Key is ambiguous. | |
#define | CLI_AMBGQUAL 0x00000102 |
Qualifier is ambiguous. | |
#define | CLI_AMBGVERB 0x00000104 |
Verb is ambiguous. | |
#define | CLI_BADCPARN 0x00000106 |
Unexpected close parenthesis. | |
#define | CLI_BADCQUAL 0x00000108 |
Bad character in qualifier. | |
#define | CLI_BADCVERB 0x0000010a |
Bad character in verb. | |
#define | CLI_BADOPARN 0x0000010c |
Unexpected open parenthesis. | |
#define | CLI_BADQUOTE 0x0000010e |
Unexpected quotation mark. | |
#define | CLI_BADTYPE 0x00000110 |
Value does not obey type constraints. | |
#define | CLI_FILRCURS 0x00000112 |
File indirection has recursed. | |
#define | CLI_MISSPARM 0x00000114 |
Required parameter missing. | |
#define | CLI_MISSQUAL 0x00000116 |
Required qualifer missing. | |
#define | CLI_NEEDMORE 0x00000118 |
Parsing incomplete. | |
#define | CLI_NOFLOPEN 0x0000011a |
File open failed. | |
#define | CLI_NOFSALOC 0x0000011c |
Cannot allocate CLI file structure. | |
#define | CLI_NOFTALOC 0x0000011e |
Cannot allocate file name. | |
#define | CLI_NOKSALOC 0x00000120 |
Cannot allocate CLI key structure. | |
#define | CLI_NOKTALOC 0x00000122 |
Could not allocate key structure name. | |
#define | CLI_NONEGATE 0x00000124 |
Qualifier cannot be negated. | |
#define | CLI_NOPSALOC 0x00000126 |
Cannot allocate CLI parameter structure. | |
#define | CLI_NOQSALOC 0x00000128 |
Cannot allocate CLI qualifier structure. | |
#define | CLI_NOQTALOC 0x0000012a |
Cannot allocate qualifier name. | |
#define | CLI_NOSCHFIL 0x0000012c |
Cannot find file. | |
#define | CLI_NOTAKEY 0x0000012e |
No such key. | |
#define | CLI_NOTALIST 0x00000130 |
Parameter/qualifier cannot be a list. | |
#define | CLI_NOTAQUAL 0x00000132 |
No such qualifier. | |
#define | CLI_NOTAVERB 0x00000134 |
No such verb. | |
#define | CLI_NOVLQUAL 0x00000136 |
Qualifier never takes a value. | |
#define | CLI_NOVTALOC 0x00000138 |
Cannot allocate CLI verb structure. | |
#define | CLI_UNBALPAR 0x0000013a |
Unbalanced parentheses. | |
#define | CLI_UNBALQUT 0x0000013c |
Unbalanced quotation marks. | |
#define | CLI_VALUQUAL 0x0000013e |
Qualifier requires a value. | |
#define | CLI_XTRAPARM 0x00000140 |
Too many parameters provided. | |
#define | CLI_NOCSALOC 0x00000142 |
Cannot allocate CLI control structure. | |
#define | CLI_NOTLALOC 0x00000144 |
Cannot allocate for original line. | |
Typedefs | |
typedef _CLI_Valu | CLI_Valu |
Typedef for struct _CLI_Valu. | |
typedef _CLI_Parm | CLI_Parm |
Typedef for struct _CLI_Parm. | |
typedef _CLI_Qual | CLI_Qual |
Typedef for struct _CLI_Qual. | |
typedef _CLI_Tokens | CLI_Tokens |
Typedef for struct _CLI_Tokens. | |
typedef _CLI_File | CLI_File |
Typedef for struct _CLI_File. | |
Functions | |
unsigned int | CLI_indirect (CLI_Control *, void *) |
CLI provided callback to deal with file indirection. More... | |
void | CLI_clearFiles (CLI_Control *) |
Clear the CLI open file stack. More... | |
void | CLI_clearTokens (CLI_Tokens *) |
Clear the parsed token tree. More... | |
unsigned int | CLI_parse (const char *, CLI_Control *, void *) |
Parse a command line. More... | |
unsigned int | CLI_squeeze (const char *, char **) |
Squeeze all unnecessary white space from a CLI line. More... | |
void | CLI_report (unsigned int) |
Report a message. More... | |
unsigned int | CLI_parseValue (char *tbeg, char *tend, unsigned short type, CLI_KeyList *keys, CLI_Valu **list) |
Parse a command line value. More... | |
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. |
|
Value: (CLI_O_NEGATE | CLI_O_VALUE | \ CLI_O_NOVALUE | CLI_O_REQUIRED )
|
|
Value: (CLI_T_LIST | CLI_T_INTEGER | \ CLI_T_FLOAT | CLI_T_KEYWORD | \ CLI_T_RESTOFLINE | CLI_T_NEWSNTX )
|
|
Value: (CLI_T_LIST | CLI_T_INTEGER | \ CLI_T_FLOAT | CLI_T_KEYWORD )
|
|
Value: (CLI_T_INTEGER | CLI_T_FLOAT | \ CLI_T_KEYWORD )
|
|
Clear the CLI open file stack.
|
|
Clear the parsed token tree.
|
|
CLI provided callback to deal with file indirection.
|
|
Parse a command line.
|
|
Parse a command line value.
|
|
Report a message.
|
|
Squeeze all unnecessary white space from a CLI line.
|