FLAMCLE/P-API
Command Line Executor/Parser Application Programming Interface
|
The structure and corresponding macros are used to define a entry for argument table. More...
Data Structures | |
struct | ClpArgument |
Table structure for arguments. More... | |
Macros | |
#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} |
#define | CLPARGTAB_SKALAR(kyw, nam, typ, min, max, atyp, flg, oid, tab, dft, man, hlp) { atyp ,(kyw), NULL,(min), 1 ,sizeof(typ), offsetof(STRUCT_NAME,nam),(oid),(flg) ,(tab),(dft),(man),(hlp),0,0.0,NULL,#typ}, |
Defines a scalar (single value) with the command line keyword kyw and the member name nam. More... | |
#define | CLPARGTAB_STRING(kyw, nam, siz, min, max, atyp, flg, oid, tab, dft, man, hlp) { CLPTYP_STRING,(kyw), NULL,(min),(max), (siz), offsetof(STRUCT_NAME,nam),(oid),(flg) ,(tab),(dft),(man),(hlp),0,0.0,NULL,NULL}, |
Defines a string with the command line keyword kyw and the member name nam. More... | |
#define | CLPARGTAB_DYNSTR(kyw, nam, siz, min, max, atyp, flg, oid, tab, dft, man, hlp) { CLPTYP_STRING,(kyw), NULL,(min),(max), (siz), offsetof(STRUCT_NAME,nam),(oid),((flg)|CLPFLG_DYN),(tab),(dft),(man),(hlp),0,0.0,NULL,NULL}, |
Defines a dynamic string with the command line keyword kyw and the member name nam (pointer to alloced memory, must be freed by the using application). More... | |
#define | CLPARGTAB_ARRAY(kyw, nam, typ, min, max, atyp, flg, oid, tab, dft, man, hlp) { atyp ,(kyw), NULL,(min),(max),sizeof(typ), offsetof(STRUCT_NAME,nam),(oid),(flg) ,(tab),(dft),(man),(hlp),0,0.0,NULL,#typ}, |
Defines an array with the command line keyword kyw and the member name nam. More... | |
#define | CLPARGTAB_DYNARY(kyw, nam, typ, min, max, atyp, flg, oid, tab, dft, man, hlp) { atyp ,(kyw), NULL,(min),(max),sizeof(typ), offsetof(STRUCT_NAME,nam),(oid),((flg)|CLPFLG_DYN),(tab),(dft),(man),(hlp),0,0.0,NULL,#typ}, |
Defines an dynamic array with the command line keyword kyw and the member name nam (pointer to alloced memory, must be freed by the using application). More... | |
#define | CLPARGTAB_ALIAS(kyw, ali) { CLPTYP_XALIAS,(kyw),(ali), 0 , 0 , 0 , 0 , 0 , CLPFLG_ALI, NULL, NULL, NULL, NULL,0,0.0,NULL,NULL}, |
Defines an alias name for another argument. More... | |
#define | CLPARGTAB_CLS { CLPTYP_NON , NULL, NULL, 0 , 0 , 0 , 0 , 0 , 0 , NULL, NULL, NULL, NULL,0,0.0,NULL,NULL} |
Will mark the end of an argument table. More... | |
Typedefs | |
typedef struct ClpArgument | TsClpArgument |
Table structure for arguments. More... | |
The structure and corresponding macros are used to define a entry for argument table.
#define CLPCONTAB_OPN | ( | name | ) | TsClpArgument name[] |
Starts a table with constant definitions.
[in] | name | Name of this table |
#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.
[in] | kyw | Pointer to command line keyword kyw. |
[in] | dat | Pointer to target definition in case of reading. |
[in] | man | Pointer to a null-terminated string for a detailed description of this constant (in ASCIIDOC format, content behind .DESCRIPTION, mainly simply some paragraphs) Can be a NULL pointer or empty string to produce a bullet list. It is recommended to use a header file with a define for this long string. |
[in] | hlp | Pointer to a null-terminated string for context sensitive help for this constant (also used as head line or in bullet list in documentation generation). |
#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.
[in] | kyw | Pointer to command line keyword kyw. |
[in] | dat | Pointer to target definition in case of reading. |
[in] | man | Pointer to a null-terminated string for a detailed description of this constant (in ASCIIDOC format, content behind .DESCRIPTION, mainly simply some paragraphs) Can be a NULL pointer or empty string to produce a bullet list. It is recommended to use a header file with a define for this long string. |
[in] | hlp | Pointer to a null-terminated string for context sensitive help for this constant (also used as head line or in bullet list in documentation generation). |
#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.
[in] | kyw | Pointer to command line keyword kyw. |
[in] | dat | Pointer to target definition in case of reading. |
[in] | man | Pointer to a null-terminated string for a detailed description of this constant (in ASCIIDOC format, content behind .DESCRIPTION, mainly simply some paragraphs) Can be a NULL pointer or empty string to produce a bullet list. It is recommended to use a header file with a define for this long string. |
[in] | hlp | Pointer to a null-terminated string for context sensitive help for this constant (also used as head line or in bullet list in documentation generation). |
#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.
[in] | kyw | Pointer to command line keyword kyw. |
[in] | dat | Pointer to target definition in case of reading. |
[in] | man | Pointer to a null-terminated string for a detailed description of this constant (in ASCIIDOC format, content behind .DESCRIPTION, mainly simply some paragraphs) Can be a NULL pointer or empty string to produce a bullet list. It is recommended to use a header file with a define for this long string. |
[in] | hlp | Pointer to a null-terminated string for context sensitive help for this constant (also used as head line or in bullet list in documentation generation). |
#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.
[in] | kyw | Pointer to command line keyword kyw. |
[in] | dat | Pointer to target definition in case of reading. |
[in] | man | Pointer to a null-terminated string for a detailed description of this constant (in ASCIIDOC format, content behind .DESCRIPTION, mainly simply some paragraphs) Can be a NULL pointer or empty string to produce a bullet list. It is recommended to use a header file with a define for this long string. |
[in] | hlp | Pointer to a null-terminated string for context sensitive help for this constant (also used as head line or in bullet list in documentation generation). |
#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.
[in] | kyw | Pointer to command line keyword kyw. |
[in] | dat | Pointer to target definition in case of reading. |
[in] | man | Pointer to a null-terminated string for a detailed description of this constant (in ASCIIDOC format, content behind .DESCRIPTION, mainly simply some paragraphs) Can be a NULL pointer or empty string to produce a bullet list. It is recommended to use a header file with a define for this long string. |
[in] | hlp | Pointer to a null-terminated string for context sensitive help for this constant (also used as head line or in bullet list in documentation generation). |
#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.
[in] | kyw | Pointer to command line keyword kyw. |
[in] | dat | Pointer to target definition in case of reading. |
[in] | siz | Size of the binary value. |
[in] | man | Pointer to a null-terminated string for a detailed description of this constant (in ASCIIDOC format, content behind .DESCRIPTION, mainly simply some paragraphs) Can be a NULL pointer or empty string to produce a bullet list. It is recommended to use a header file with a define for this long string. |
[in] | hlp | Pointer to a null-terminated string for context sensitive help for this constant (also used as head line or in bullet list in documentation generation). |
#define CLPCONTAB_CLS {CLPTYP_NON , NULL,NULL,0,0, 0 ,0,0,CLPFLG_NON ,NULL,NULL, NULL, NULL, 0 , 0.0 ,NULL ,NULL} |
Ends a table with constant definitions
#define CLPARGTAB_SKALAR | ( | kyw, | |
nam, | |||
typ, | |||
min, | |||
max, | |||
atyp, | |||
flg, | |||
oid, | |||
tab, | |||
dft, | |||
man, | |||
hlp | |||
) | { atyp ,(kyw), NULL,(min), 1 ,sizeof(typ), offsetof(STRUCT_NAME,nam),(oid),(flg) ,(tab),(dft),(man),(hlp),0,0.0,NULL,#typ}, |
Defines a scalar (single value) with the command line keyword kyw and the member name nam.
[in] | kyw | Pointer to command line keyword kyw. |
[in] | nam | Pointer to target definition in case of reading. |
[in] | typ | is the C type of the member. |
[in] | min | can be 0 or 1 for a scalar and determines if this argument is optional(0) or required(1). |
[in] | max | is unused for scalar values. |
[in] | atyp | is one of the CLPTYP_* macros. |
[in] | flg | is an OR-ed list of the flag macros CLPFLG_* which define various parsing options. |
[in] | oid | is a unique id value used for this argument. |
[in] | tab | is NULL or a pointer to another argument table describing the object, overlay or selection. |
[in] | dft | is the hard coded default value of the argument if no input is given on the command line. |
[in] | man | is a pointer to the long description of the argument. |
[in] | hlp | is a pointer to the short description of the argument. |
#define CLPARGTAB_STRING | ( | kyw, | |
nam, | |||
siz, | |||
min, | |||
max, | |||
atyp, | |||
flg, | |||
oid, | |||
tab, | |||
dft, | |||
man, | |||
hlp | |||
) | { CLPTYP_STRING,(kyw), NULL,(min),(max), (siz), offsetof(STRUCT_NAME,nam),(oid),(flg) ,(tab),(dft),(man),(hlp),0,0.0,NULL,NULL}, |
Defines a string with the command line keyword kyw and the member name nam.
[in] | kyw | Pointer to command line keyword kyw. |
[in] | nam | Pointer to target definition in case of reading. |
[in] | siz | is the total available length of the string(s). |
[in] | min | can be between 0 and max for a string and determines if this argument is optional(0) or required(min>=1). |
[in] | max | defines the maximum number of strings accepted on the command line. |
[in] | atyp | is unused and fixed to CLPTYP_STRING. |
[in] | flg | is an OR-ed list of the flag macros CLPFLG_* which define various parsing options. |
[in] | oid | is a unique id value used for this argument. |
[in] | tab | is NULL or a pointer to another argument table describing a selection. |
[in] | dft | is the hard coded default value of the argument if no input is given on the command line. |
[in] | man | is a pointer to the long description of the argument. |
[in] | hlp | is a pointer to the short description of the argument. |
#define CLPARGTAB_DYNSTR | ( | kyw, | |
nam, | |||
siz, | |||
min, | |||
max, | |||
atyp, | |||
flg, | |||
oid, | |||
tab, | |||
dft, | |||
man, | |||
hlp | |||
) | { CLPTYP_STRING,(kyw), NULL,(min),(max), (siz), offsetof(STRUCT_NAME,nam),(oid),((flg)|CLPFLG_DYN),(tab),(dft),(man),(hlp),0,0.0,NULL,NULL}, |
Defines a dynamic string with the command line keyword kyw and the member name nam (pointer to alloced memory, must be freed by the using application).
[in] | kyw | Pointer to command line keyword kyw. |
[in] | nam | Pointer to target definition in case of reading. |
[in] | siz | is the total available length of the string(s). |
[in] | atyp | is unused and fixed to CLPTYP_STRING. |
[in] | min | can be between 0 and max for a string and determines if this argument is optional(0) or required(min>=1). |
[in] | max | defines the maximum number of strings accepted on the command line. |
[in] | flg | is an OR-ed list of the flag macros CLPFLG_* which define various parsing options. |
[in] | oid | is a unique id value used for this argument. |
[in] | tab | is NULL or a pointer to another argument table describing a selection. |
[in] | dft | is the hard coded default value of the argument if no input is given on the command line. |
[in] | man | is a pointer to the long description of the argument. |
[in] | hlp | is a pointer to the short description of the argument. |
#define CLPARGTAB_ARRAY | ( | kyw, | |
nam, | |||
typ, | |||
min, | |||
max, | |||
atyp, | |||
flg, | |||
oid, | |||
tab, | |||
dft, | |||
man, | |||
hlp | |||
) | { atyp ,(kyw), NULL,(min),(max),sizeof(typ), offsetof(STRUCT_NAME,nam),(oid),(flg) ,(tab),(dft),(man),(hlp),0,0.0,NULL,#typ}, |
Defines an array with the command line keyword kyw and the member name nam.
[in] | kyw | Pointer to command line keyword kyw. |
[in] | nam | Pointer to target definition in case of reading. |
[in] | typ | is the C type of the member. |
[in] | min | can be between 0 or max and determines if this argument is optional(0) or required(min>=1). |
[in] | max | defines the size of the array. |
[in] | atyp | is one of the CLPTYP_* macros. |
[in] | flg | is an OR-ed list of the flag macros CLPFLG_* which define various parsing options. |
[in] | oid | is a unique id value used for this argument. |
[in] | tab | is NULL or a pointer to another argument table describing the object, overlay or selection. |
[in] | dft | is the hard coded default value of the argument if no input is given on the command line. |
[in] | man | is a pointer to the long description of the argument. |
[in] | hlp | is a pointer to the short description of the argument. |
#define CLPARGTAB_DYNARY | ( | kyw, | |
nam, | |||
typ, | |||
min, | |||
max, | |||
atyp, | |||
flg, | |||
oid, | |||
tab, | |||
dft, | |||
man, | |||
hlp | |||
) | { atyp ,(kyw), NULL,(min),(max),sizeof(typ), offsetof(STRUCT_NAME,nam),(oid),((flg)|CLPFLG_DYN),(tab),(dft),(man),(hlp),0,0.0,NULL,#typ}, |
Defines an dynamic array with the command line keyword kyw and the member name nam (pointer to alloced memory, must be freed by the using application).
[in] | kyw | Pointer to command line keyword kyw. |
[in] | nam | Pointer to target definition in case of reading. |
[in] | typ | is the C type of the member. |
[in] | min | can be between 0 or max and determines if this argument is optional(0) or required(min>=1). |
[in] | max | defines the size of the array. |
[in] | atyp | is one of the CLPTYP_* macros. |
[in] | flg | is an OR-ed list of the flag macros CLPFLG_* which define various parsing options. |
[in] | oid | is a unique id value used for this argument. |
[in] | tab | is NULL or a pointer to another argument table describing the object, overlay or selection. |
[in] | dft | is the hard coded default value of the argument if no input is given on the command line. |
[in] | man | is a pointer to the long description of the argument. |
[in] | hlp | is a pointer to the short description of the argument. |
#define CLPARGTAB_ALIAS | ( | kyw, | |
ali | |||
) | { CLPTYP_XALIAS,(kyw),(ali), 0 , 0 , 0 , 0 , 0 , CLPFLG_ALI, NULL, NULL, NULL, NULL,0,0.0,NULL,NULL}, |
Defines an alias name for another argument.
[in] | kyw | is the keyword accepted on the command line in place of the keyword given in ali. |
[in] | ali | is the alternative keyword accepted on the command line in place of the keyword given in kyw. |
#define CLPARGTAB_CLS { CLPTYP_NON , NULL, NULL, 0 , 0 , 0 , 0 , 0 , 0 , NULL, NULL, NULL, NULL,0,0.0,NULL,NULL} |
Will mark the end of an argument table.
typedef struct ClpArgument TsClpArgument |
Table structure for arguments.
To simplify the definition of the corresponding data structures and argument tables it is recommended to use the CLPARGTAB macros defined in CLPMAC.h or for constant definitions the CLPCONTAB macros below. With the CLPMAC.h you can generate the tables or the corresponding data structures, depending if DEFINE_STRUCT defined or not.
Example:
First you must define the table:
Then you can use this table to define your structure or union, in our case we create a union:
And you use the same define to allocate the corresponding CLP table: