FLAMCLE/P-API
Command Line Executor/Parser Application Programming Interface
|
Definitions for Command Line Parsing. More...
Go to the source code of this file.
Data Structures | |
struct | ClpError |
Defines a structure with error information. More... | |
struct | ClpArgument |
Table structure for arguments. More... | |
Macros | |
#define | CLP_OK 0 |
Return code for a successful parsing: 0, otherwize > 0. More... | |
#define | CLPERR_LEX -1 |
Lexical error (determined by scanner). More... | |
#define | CLPERR_SYN -2 |
Syntax error (determined by parser). More... | |
#define | CLPERR_SEM -3 |
Semantic error (determined by builder). More... | |
#define | CLPERR_TYP -4 |
Type error (internal error with argument types). More... | |
#define | CLPERR_TAB -5 |
Table error (internal error with argument tables). More... | |
#define | CLPERR_SIZ -6 |
Size error (internal error with argument tables and data structures). More... | |
#define | CLPERR_PAR -7 |
Parameter error (internal error with argument tables and data structures). More... | |
#define | CLPERR_MEM -8 |
Memory error (internal error with argument tables and data structures). More... | |
#define | CLPERR_INT -9 |
Internal error (internal error with argument tables and data structures). More... | |
#define | CLPERR_SYS -10 |
System error (internal error with argument tables and data structures). More... | |
#define | CLPERR_AUT -11 |
Authorization request failed. More... | |
#define | CLPSRC_CMD ":command line:" |
From command line. More... | |
#define | CLPSRC_PRO ":property list:" |
From property list. More... | |
#define | CLPSRC_DEF ":default value:" |
From default value. More... | |
#define | CLPSRC_ENV ":environment variable:" |
From environment variable. More... | |
#define | CLPSRC_PRF ":property file:" |
From property file. More... | |
#define | CLPSRC_CMF ":command file:" |
From command file. More... | |
#define | CLPSRC_PAF ":parameter file:" |
Parameter file. More... | |
#define | CLPSRC_SRF ":string file:" |
String file. More... | |
#define | CLPTYP_NON 0 |
No type - Mark the end of an argument table. More... | |
#define | CLPTYP_SWITCH 1 |
Switch (single keyword representing a number (OID)). More... | |
#define | CLPTYP_NUMBER 2 |
Signed or unsigned integer number (8, 16, 32 or 64 bit). More... | |
#define | CLPTYP_FLOATN 3 |
Floating point number (32 or 64 bit). More... | |
#define | CLPTYP_STRING 4 |
String literal (binary (HEX, ASCII, EBCDIC, CHARS) or null-terminated (default)). More... | |
#define | CLPTYP_OBJECT 5 |
Object (KEYWORD(parameter_list)) can contain arbitrary list of other types. More... | |
#define | CLPTYP_OVRLAY 6 |
Overlay (KEYWORD.KEYWORD...) contains one of its list as in a C union. More... | |
#define | CLPTYP_XALIAS -1 |
For alias definition (used in the corresponding table macro) More... | |
#define | CLPCLS_MTD_ALL 1 |
Complete close, free anything including the dynamic allocated buffers in the CLP structure. More... | |
#define | CLPCLS_MTD_KEP 0 |
Free anything except the allocated memory in CLP structure and keep the handle open to close it later with method ALL. More... | |
#define | CLPCLS_MTD_EXC 2 |
Free anything including the handle except the allocated memory in the CLP structure, the application must free the dynamic allocated buffers in the CLP structure it self. More... | |
#define | CLPPRO_MTD_ALL 0 |
All properties are printed (manual pages added as comment). More... | |
#define | CLPPRO_MTD_SET 1 |
Only defined properties are printed (no manual pages used). More... | |
#define | CLPPRO_MTD_CMT 2 |
All properties are printed, but not defined properties are line comments . More... | |
#define | CLPPRO_MTD_DOC 3 |
All property only parameter are printed as documentation. More... | |
#define | CLPFLG_NON 0x00000000U |
To define no special flags. More... | |
#define | CLPFLG_ALI 0x00000001U |
This parameter is an alias for another argument (set by macros). More... | |
#define | CLPFLG_CON 0x00000002U |
This parameter is a constant definition (no argument, no link, no alias (set by macros)). More... | |
#define | CLPFLG_CMD 0x00000004U |
If set the parameter is only used within the command line (command line only). More... | |
#define | CLPFLG_PRO 0x00000008U |
If set the parameter is only used within the property file (property file only). More... | |
#define | CLPFLG_SEL 0x00000010U |
If set only the predefined constants over the corresponding key words can be selected (useful to define selections). More... | |
#define | CLPFLG_FIX 0x00000020U |
This argument has a fixed length (only useful for strings if a typedef defines a fixed length per element, else set internally). More... | |
#define | CLPFLG_BIN 0x00000040U |
This argument can contain binary data without null termination (length must be known or determined with a link). More... | |
#define | CLPFLG_DMY 0x00000080U |
If set the parameter is not put in the symbol table, meaning it is only a peace of memory in the CLP structure. More... | |
#define | CLPFLG_CNT 0x00000100U |
This link will be filled by the calculated amount of elements (useful for arrays). More... | |
#define | CLPFLG_OID 0x00000200U |
This link will be filled by the object identifier (OID) of the chosen argument (useful for overlays). More... | |
#define | CLPFLG_IND 0x00000400U |
This link will be filled with the index (position) in the CLP string (byte offset of the current key word). More... | |
#define | CLPFLG_HID 0x00000800U |
If set the parameter is not visible, meaning it is a hidden parameter. More... | |
#define | CLPFLG_ELN 0x00001000U |
This link will be filled by the calculated length of an element (fixed types == data size, packed types == data length). More... | |
#define | CLPFLG_SLN 0x00002000U |
This link will be filled by the calculated string length for an element (only for null-terminated strings). More... | |
#define | CLPFLG_TLN 0x00004000U |
This link will be filled by the calculated total length for the argument (sum of all element lengths). More... | |
#define | CLPFLG_DEF 0x00010000U |
This flag enables to use the OID as default for numbers if no value is assigned (only the keyword is used (syntax extension)). More... | |
#define | CLPFLG_CHR 0x00020000U |
This flag will set the default method of interpretation of a binary string to local character string (DEFAULT). More... | |
#define | CLPFLG_ASC 0x00040000U |
This flag will set the default method of interpretation of a binary string to ASCII. More... | |
#define | CLPFLG_EBC 0x00080000U |
This flag will set the default method of interpretation of a binary string to EBCDIC. More... | |
#define | CLPFLG_HEX 0x00100000U |
This flag will set the default method of interpretation of a binary string to hexadecimal. More... | |
#define | CLPFLG_PDF 0x00200000U |
This flag will be set if a property value was defined from outside, it will be FALSE if the property value was hard coded in the tables. More... | |
#define | CLPFLG_TIM 0x00400000U |
This flag mark a number as time value (only used to print out the corressponing time stamp). More... | |
#define | CLPFLG_DYN 0x00800000U |
This flag mark a string or array as dynamic (only a pointer to allocated memory is used and must be freeed by the user). More... | |
#define | CLPFLG_PWD 0x01000000U |
This flag will ensure that the clear value is only put into the data structure but not traced, logged or given away elsewhere. More... | |
#define | CLPFLG_DLM 0x02000000U |
This flag ensures that fix size arrays has a empty (initialized) last element (max-1) as delimiter. Additional you enforce 0xFF at the and of a non fix size string array (size-1). More... | |
#define | CLPFLG_UNS 0x04000000U |
Marks a number as unsigned (prevent negative values). More... | |
#define | CLPFLG_XML 0x08000000U |
Marks zero terminated string as XML path where '(' and ')' are used to replace environment variables. More... | |
#define | CLPFLG_FIL 0x10000000U |
Marks zero terminated string as file and replace additional '~' by HOME and corrects the prefix for different platforms. More... | |
#define | CLPFLG_LAB 0x20000000U |
Marks zero terminated string as label and replace additional '~' by USER, '^' by OWNER and '!' by ENVID . More... | |
#define | CLPFLG_UPP 0x40000000U |
Converts zero terminated strings to upper case. More... | |
#define | CLPFLG_LOW 0x80000000U |
Converts zero terminated strings to lower case. More... | |
#define | CLPCONTAB_OPN(name) TsClpArgument name[] |
Starts a table with constant definitions. More... | |
#define | CLPCONTAB_NUMBER(kyw, dat, man, hlp) {CLPTYP_NUMBER,(kyw),NULL,0,0, 0 ,0,0,CLPFLG_CON ,NULL,NULL,(man),(hlp),(dat), 0.0 ,NULL ,NULL}, |
Defines a number literal with the command line keyword kyw and the value dat. More... | |
#define | CLPCONTAB_FLOATN(kyw, dat, man, hlp) {CLPTYP_FLOATN,(kyw),NULL,0,0, 0 ,0,0,CLPFLG_CON ,NULL,NULL,(man),(hlp), 0 ,(dat),NULL ,NULL}, |
Defines a floating point literal with the command line keyword kyw and the value dat. More... | |
#define | CLPCONTAB_STRING(kyw, dat, man, hlp) {CLPTYP_STRING,(kyw),NULL,0,0, 0 ,0,0,CLPFLG_CON ,NULL,NULL,(man),(hlp), 0 , 0.0 ,(U08*)(dat),NULL}, |
Defines a default string literal with the command line keyword kyw and the value dat. More... | |
#define | CLPCONTAB_HEXSTR(kyw, dat, man, hlp) {CLPTYP_STRING,(kyw),NULL,0,0, 0 ,0,0,CLPFLG_CON|CLPFLG_HEX,NULL,NULL,(man),(hlp), 0 , 0.0 ,(U08*)(dat),NULL}, |
Defines a hexadecimal string literal with the command line keyword kyw and the value dat. More... | |
#define | CLPCONTAB_ASCSTR(kyw, dat, man, hlp) {CLPTYP_STRING,(kyw),NULL,0,0, 0 ,0,0,CLPFLG_CON|CLPFLG_ASC,NULL,NULL,(man),(hlp), 0 , 0.0 ,(U08*)(dat),NULL}, |
Defines a ASCII string literal with the command line keyword kyw and the value dat. More... | |
#define | CLPCONTAB_EBCSTR(kyw, dat, man, hlp) {CLPTYP_STRING,(kyw),NULL,0,0, 0 ,0,0,CLPFLG_CON|CLPFLG_EBC,NULL,NULL,(man),(hlp), 0 , 0.0 ,(U08*)(dat),NULL}, |
Defines a EBCDIC string literal with the command line keyword kyw and the value dat. More... | |
#define | CLPCONTAB_BINARY(kyw, dat, siz, man, hlp) {CLPTYP_STRING,(kyw),NULL,0,0,(siz),0,0,CLPFLG_CON|CLPFLG_BIN,NULL,NULL,(man),(hlp), 0 , 0.0 ,(U08*)(dat),NULL}, |
Defines a binary literal with the command line keyword kyw and the value dat. More... | |
#define | CLPCONTAB_CLS {CLPTYP_NON , NULL,NULL,0,0, 0 ,0,0,CLPFLG_NON ,NULL,NULL, NULL, NULL, 0 , 0.0 ,NULL ,NULL} |
Typedefs | |
typedef struct ClpError | TsClpError |
Defines a structure with error information. More... | |
typedef struct ClpArgument | TsClpArgument |
Table structure for arguments. More... | |
typedef int() | TfF2S(void *pvGbl, void *pvHdl, const char *pcFil, char **ppBuf, int *piBuf, char *pcMsg, const int siMsg) |
Type definition for string to file call back function. More... | |
typedef int() | TfSaf(void *pvGbl, void *pvHdl, const char *pcVal) |
Type definition for resource access check. More... | |
typedef int() | TfClpPrintPage(void *pvHdl, const int siLev, const char *pcHdl, const char *pcPat, const char *pcFil, const char *pcOrg, const char *pcPge) |
Function 'prnHtmlDoc' of library 'libhtmldoc' called if built-in function HTMLDOC used. More... | |
Definitions for Command Line Parsing.
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
If you need professional services or support for this library please contact suppo. rt@f lam.d e