FLAMCLE/P-API
Command Line Executor/Parser Application Programming Interface
ClpArgument Struct Reference

Table structure for arguments. More...

#include <CLPDEF.h>

Data Fields

int siTyp
 Data type Type of this parameter (CLPTYP_xxxxxx). The type will be displayed in context sensitive help messages (TYPE: type_name). More...
 
const char * pcKyw
 Keyword (Parameter name) Pointer to a null-terminated key word for this parameter (:alpha:[:alnum:|'_']*).
More...
 
const char * pcAli
 Alias (other name for a existing parameter) Pointer to another key word to define an alias (:alpha:[:alnum:|'_']*). More...
 
int siMin
 Minimum amount of entries for this argument (0-optional n-required). More...
 
int siMax
 Maximum amount of entries for this argument (1-scalar n-array (n=0 unlimited array, n>1 limited array)).
More...
 
int siSiz
 Data size If fixed size type (switch, number, float, object, overlay) then size of this type else (string) available size in memory. String type can be defined as FIX with CLPFLG_FIX but this requires a typedef for this string size. For dynamic strings an initial size for the first memory allocation can be defined. More...
 
int siOfs
 Data Offset Offset of an argument in a structure used for address calculation (the offset of(t,m) instruction is used by the macros for it). More...
 
int siOid
 Object identifier Unique integer value representing the argument (object identifier, used in overlays or for switches). More...
 
unsigned int uiFlg
 Control Flag Flag value which can be assigned with CLPFLG_SEL/CON/FIX/CNT/SEN/ELN/TLN/OID/ALI to define different characteristics. More...
 
struct ClpArgumentpsTab
 Table for next level Pointer to another parameter table for CLPTYP_OBJECT and CLPTYP_OVRLAY describing these structures, for CLPTYP_NUMBER, CLPTYP_FLOATN or CLPTYP_STRING to define selections (constant definitions) More...
 
const char * pcDft
 Default value. More...
 
const char * pcMan
 Manual page. More...
 
const char * pcHlp
 Help message. More...
 

Detailed Description

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:

#define CLPINTFMTRED_TABLE\
CLPARGTAB_SKALAR("BIN" , stBin , TsClpIntRedBin , 0, 1, CLPTYP_OBJECT, CLPFLG_NON, INTCNV_FORMAT_BIN , asClpIntRedBin , NULL, MAN_INTRED_BIN, "Integer in binary format (two's complement)")\
CLPARGTAB_SKALAR("BCD" , stBcd , TsClpIntRedBcd , 0, 1, CLPTYP_OBJECT, CLPFLG_NON, INTCNV_FORMAT_BCD , asClpIntRedBcd , NULL, MAN_INTRED_BCD, "Binary coded decimal (BCD) number")\
CLPARGTAB_SKALAR("STR" , stStr , TsClpIntRedStr , 0, 1, CLPTYP_OBJECT, CLPFLG_NON, INTCNV_FORMAT_STR , asClpIntRedStr , NULL, MAN_INTRED_STR, "String representation of an integer")\
CLPARGTAB_SKALAR("ENUM" , stEnum, TsClpIntRedSel , 0, 1, CLPTYP_OBJECT, CLPFLG_NON, INTCNV_FORMAT_ENUM, asClpIntRedEnum, NULL, MAN_INTRED_ENUM,"Maps enumeration to an integer")\
CLPARGTAB_CLS

Then you can use this table to define your structure or union, in our case we create a union:

#define DEFINE_STRUCT
#include "CLPMAC.h"
typedef union ClpIntFmtRed{
CLPINTFMTRED_TABLE
}TuClpIntFmtRed;

And you use the same define to allocate the corresponding CLP table:

#undef DEFINE_STRUCT
#include "CLPMAC.h"
#undef STRUCT_NAME
#define STRUCT_NAME TuClpIntFmtRed
TsClpArgument asClpIntFmtRed[] = {
CLPINTFMTRED_TABLE
};

Field Documentation

◆ siTyp

int ClpArgument::siTyp

Data type Type of this parameter (CLPTYP_xxxxxx). The type will be displayed in context sensitive help messages (TYPE: type_name).

◆ pcKyw

const char* ClpArgument::pcKyw

Keyword (Parameter name) Pointer to a null-terminated key word for this parameter (:alpha:[:alnum:|'_']*).

◆ pcAli

const char* ClpArgument::pcAli

Alias (other name for a existing parameter) Pointer to another key word to define an alias (:alpha:[:alnum:|'_']*).

◆ siMin

int ClpArgument::siMin

Minimum amount of entries for this argument (0-optional n-required).

◆ siMax

int ClpArgument::siMax

Maximum amount of entries for this argument (1-scalar n-array (n=0 unlimited array, n>1 limited array)).

◆ siSiz

int ClpArgument::siSiz

Data size If fixed size type (switch, number, float, object, overlay) then size of this type else (string) available size in memory. String type can be defined as FIX with CLPFLG_FIX but this requires a typedef for this string size. For dynamic strings an initial size for the first memory allocation can be defined.

◆ siOfs

int ClpArgument::siOfs

Data Offset Offset of an argument in a structure used for address calculation (the offset of(t,m) instruction is used by the macros for it).

◆ siOid

int ClpArgument::siOid

Object identifier Unique integer value representing the argument (object identifier, used in overlays or for switches).

◆ uiFlg

unsigned int ClpArgument::uiFlg

Control Flag Flag value which can be assigned with CLPFLG_SEL/CON/FIX/CNT/SEN/ELN/TLN/OID/ALI to define different characteristics.

◆ psTab

struct ClpArgument* ClpArgument::psTab

Table for next level Pointer to another parameter table for CLPTYP_OBJECT and CLPTYP_OVRLAY describing these structures, for CLPTYP_NUMBER, CLPTYP_FLOATN or CLPTYP_STRING to define selections (constant definitions)

◆ pcDft

const char* ClpArgument::pcDft

Default value.

Pointer to a zero-terminated string to define the default values assigned if no argument was defined. If this pointer is NULL or empty ("") then no initialization is done.

  • for switches a number literal or the special keywords ON/OFF can be defined
  • for numbers a number literal or a key word for a constant definition can be defined
  • for floats a floating point number literal or a key word for a constant definition can be defined
  • for strings a string literal or a key word for a constant definition can be defined
  • for objects the special keyword INIT must be defined to initialize the object
  • for overlays the keyword of the assigning object must be defined to initialize the overlay

For arrays of these types a list of the corresponding values (literals or key words) can be defined The default values are displayed in context sensitive help messages (PROPERTY: [value_list]) This value can be override by corresponding environment variable or property definition.

◆ pcMan

const char* ClpArgument::pcMan

Manual page.

Pointer to a zero-terminated string for a detailed description of this argument (in ASCIIDOC format, content behind. DESCRIPTION, mainly simply some paragraphs). Can be a NULL pointer or empty string for constant definition or simple arguments. It is recommended to use a header file with a define for this long string (required for objects and overlays). All occurrences of "&{OWN}" or "&{PGM}" (that all their case variations) are replaced with the current owner or program name, respectively. All other content between "&{" and "}" is ignored (comment). The resulting text is converted on EBCDIC systems).


◆ pcHlp

const char* ClpArgument::pcHlp

Help message.

Pointer to a zero-terminated string for context sensitive help to this argument. Also used as headline in documentation generation. For this only alnum, blank, dot, comma, hyphen and parenthesis are used. At every other separator the headline will be cut, meaning it is possible to have more help information than head line. (converted on EBCDIC systems).


The documentation for this struct was generated from the following file:
CLPMAC.h
Macros for single definition of C struct and argument table for Command Line Parsing.
ClpArgument
Table structure for arguments.
Definition: CLPDEF.h:271