Main Page   Interface   Data Structures   File List   Data Fields   Globals  

CLI_prvdefs.h File Reference

Private include file for the CLI package. More...

#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_SyntaxCLI_syntaxList
 Root of a list of all CLI syntaxes.

CLI_KeyListCLI_keyListList
 Root of a list of all keyword lists.


Detailed Description

Private include file for the CLI package.


Define Documentation

#define CLI_O_QUALOPT
 

Value:

OR of valid qualifier option bits.

#define CLI_T_PARMTYPE
 

Value:

OR of valid parameter type bits.

#define CLI_T_QUALTYPE
 

Value:

OR of valid qualifier type bits.

#define CLI_T_VALUTYPE
 

Value:

OR of valid value type bits.


Function Documentation

void CLI_clearFiles CLI_Control   ctl
 

Clear the CLI open file stack.

Parameters:
ctl  CLI control block

void CLI_clearTokens CLI_Tokens   tokens
 

Clear the parsed token tree.

Parameters:
tokens  Token structure at head of token tree
CLI_clearTokens clears the parsed token tree.

unsigned int CLI_indirect CLI_Control   ctl,
void *    user
 

CLI provided callback to deal with file indirection.

Parameters:
ctl  (Opaque) pointer to CLI control structure
user  User parameter (ignored)
Return values:
CLI_SUCCESS  File found and opened
CLI_NOSCHFIL  File could not be found
CLI_FILRCURS  File indirection has recursed

unsigned int CLI_parse const char *    ilin,
CLI_Control   ctl,
void *    user
 

Parse a command line.

Parameters:
ilin  Input line to parse
ctl  CLI control structure
user  (Opaque) pointer to user parameter(s)
Returns:
Status code
CLI_parse parses a line of text (the command line) using the syntax defined in ctl->syntax and if the line makes sense, dispatches it to the user defined callback routine.

unsigned int CLI_parseValue char *    tbeg,
char *    tend,
unsigned short    type,
CLI_KeyList   keys,
CLI_Valu **    list
 

Parse a command line value.

Parameters:
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
Returns:
Status code

void CLI_report unsigned    int
 

Report a message.

Parameters:
status  Message to report

unsigned int CLI_squeeze const char *    ilin,
char **    olin
 

Squeeze all unnecessary white space from a CLI line.

Parameters:
ilin  Input line
olin  Output line
Returns:
Status code


Generated on Tue Nov 5 12:16:24 2002 by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002