Doxygen Documentation

Main Index

Package Index

Package:

CLI

Version:

V0-0-5

Marked:

(not marked)

Constituent:

cli

Tag:

linux-gcc


Interface   Compound List   File List   Compound Members   File Members  

CLI_parse.c File Reference

Parses the input line according to the provided syntax. More...

#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "CLI/CLI_pubdefs.h"
#include "CLI_prvdefs.h"

Typedefs

typedef enum _CLI_Mode CLI_Mode
 Typedef for enum _CLI_Mode.


Enumerations

enum  _CLI_Mode {
  CLI_MD_VERB,
  CLI_MD_QUAL,
  CLI_MD_PVAL,
  CLI_MD_QVAL
}
 Parsing mode. More...


Functions

unsigned int CLI_saveVerb (char *, char *, CLI_Control *, CLI_VerbDef **)
 Validate and save a verb.

unsigned int CLI_saveQual (char *, char *, CLI_VerbDef *, CLI_Qual *, CLI_Qual **, CLI_QualDef **)
 Validate and save a qualifier.

unsigned int CLI_savePval (char *, char *, CLI_ParmDef *, CLI_Parm **)
 Validate and save a parameter value.

unsigned int CLI_saveQval (char *, char *, CLI_Qual *, CLI_QualDef *)
 Validate and save a qualifier value.

unsigned int CLI_saveRest (char *, CLI_Parm **)
 Save the rest of the line as a single parameter.

unsigned int CLI_dispatch (CLI_Control *, void *)
 Dispatch a CLI command.

unsigned int CLI_parse (const char *ilin, CLI_Control *ctl, void *user)
 Parse a command line.


Detailed Description

Parses the input line according to the provided syntax.

CVS $Id: CLI_parse.c,v 1.4 2003/12/12 06:13:49 apw Exp $
Author:
A.P.Waite - apw@slac.stanford.edu
CLI_parse.c parses the input line according to the provided syntax.

Enumeration Type Documentation

enum _CLI_Mode
 

Parsing mode.

Enumeration values:
CLI_MD_QUAL  Verb
CLI_MD_PVAL  Qualifier
CLI_MD_QVAL  Qualifier value


Function Documentation

unsigned int CLI_dispatch CLI_Control ctl,
void *  user
[static]
 

Dispatch a CLI command.

Parameters:
ctl CLI control structure
user (Opaque) pointer to user parameter(s)
Returns:
Status code
Dispatch a CLI command for execution.

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_savePval char *  tbeg,
char *  tend,
CLI_ParmDef pdef,
CLI_Parm **  plst
[static]
 

Validate and save a parameter value.

Parameters:
tbeg First character
tend (One past) the last character
pdef Parameter definition
plst Where to link the new parameter structure (if successful)
Returns:
Status code

unsigned int CLI_saveQual char *  tbeg,
char *  tend,
CLI_VerbDef vdef,
CLI_Qual qhed,
CLI_Qual **  qret,
CLI_QualDef **  qdef
[static]
 

Validate and save a qualifier.

Parameters:
tbeg First character
tend (One past) the last character
vdef Primary verb (for looking up qualifiers)
qhed Head of already parsed qualifier list
qret Qualifier token pointer (returned)
qdef Qualifier definition pointer (returned)
Returns:
Status code

unsigned int CLI_saveQval char *  tbeg,
char *  tend,
CLI_Qual qual,
CLI_QualDef qdef
[static]
 

Validate and save a qualifier value.

Parameters:
tbeg First character
tend (One past) the last character
qual Qualifier structure which stores the value(s)
qdef Qualifier definition
Returns:
Status code

unsigned int CLI_saveRest char *  tbeg,
CLI_Parm **  plst
[static]
 

Save the rest of the line as a single parameter.

Parameters:
tbeg First character
plst Where to link the new parameter structure (if successful)
Returns:
Status code

unsigned int CLI_saveVerb char *  tbeg,
char *  tend,
CLI_Control ctl,
CLI_VerbDef **  vdef
[static]
 

Validate and save a verb.

Parameters:
tbeg First character
tend (One past) the last character
ctl CLI control structure (contains the syntax)
vdef Verb definition (returned)
Returns:
Status code


Generated on Thu Dec 11 22:17:31 2003 by doxygen 1.3.3