Bioplib
Protein Structure C Library
|
Include file for the command parser. More...
Go to the source code of this file.
Data Structures | |
struct | KeyWd |
struct | MKeyWd |
Macros | |
#define | STRING 1 /* Defines used for the MAKEKEY macro */ |
#define | NUMBER 0 |
#define | PARSE_ERRC -1 /* Error return values from parse() */ |
#define | PARSE_ERRP -2 |
#define | PARSE_COMMENT -3 |
#define | MAKEKEY(x, w, v, z) |
#define | MAKEMKEY(x, w, v, mn, mx) |
#define | _PARSE_H_DEPRECATED |
Functions | |
int | blParse (char *comline, int nkeys, KeyWd *keywords, REAL *REALparam, char **strparam) |
int | blMparse (char *comline, int nkeys, MKeyWd *keywords, REAL *REALparam, char **strparam, int *nparams) |
int | blMatch (char *comstring, char *string2, int *nletters) |
int | blGetString (char *command, char *strparam) |
int | blGetParam (char *command, REAL *value, int *nletters) |
Include file for the command parser.
This code is NOT IN THE PUBLIC DOMAIN, but it may be copied according to the conditions laid out in the accompanying file COPYING.DOC.
The code may be modified as required, but any modifications must be documented so that the person responsible can be identified.
The code may not be sold commercially or included as part of a commercial product except as described in the file COPYING.DOC.
Here are defined the MAKEKEY macro, STRING and NUMBER defines, the KeyWd structure and return values for the parser.
Definition in file parse.h.
#define MAKEKEY | ( | x, | |
w, | |||
v, | |||
z | |||
) |
#define MAKEMKEY | ( | x, | |
w, | |||
v, | |||
mn, | |||
mx | |||
) |
int blGetParam | ( | char * | command, |
REAL * | value, | ||
int * | nletters | ||
) |
[in] | *command | A character string |
[out] | *value | Returned float value |
[out] | *nletters | Number of charcters pulled out of the command string |
Extracts the first space-delimited number from the `command' character string.
int blGetString | ( | char * | command, |
char * | strparam | ||
) |
[in] | *command | A character string |
[out] | *strparam | Returned character string |
Returns the first space-delimited group of characters from character string `command'
int blMatch | ( | char * | comstring, |
char * | string2, | ||
int * | nletters | ||
) |
[in] | *comstring | A character string |
[in] | *string2 | A second string |
[out] | *nletters | Number of letters matched |
Matches two strings, but stops the comparison as soon as a space or NULL is found in either string. The returned value indicates which string finished first or 0 if the letters before the space or NULL have a mismatch. The routine calls StringToUpper() on `comstring' before the comparison.
int blMparse | ( | char * | comline, |
int | nkeys, | ||
MKeyWd * | keywords, | ||
REAL * | floatparam, | ||
char ** | strparam, | ||
int * | nparam | ||
) |
[in] | *comline | A command line string to parse |
[in] | nkeys | Number of keywords |
[in] | *keywords | Array of keyword structures |
[out] | *floatparam | Array of returned strings |
[out] | **strparam | Array of pointers to returned strings |
[out] | *nparam | Number of parameters found |
As blParse(), but allows variable number of parameters to each keyword.
[in] | *comline | A command line string to parse |
[in] | nkeys | Number of keywords |
[in] | *keywords | Array of keyword structures |
[out] | *floatparam | Array of returned strings |
[out] | **strparam | Array of pointers to returned strings |
Keyword-based command parser using a fixed number of parameters per command