OSFI-C
3.10.0
OpenSF Integration Library
|
Utilities to parse command line arguments compliant to the E2E-ICD module interface. More...
Modules | |
Legacy API | |
Deprecated prior version of the CLP functionality. | |
Data Structures | |
struct | osfi_clp_files |
List of files of a specific type, allocated by osfiClpParseArgs(). More... | |
struct | osfi_clp_args |
Result of parsing CLI arguments, contains the files of each type passed to the module. More... | |
Typedefs | |
typedef struct osfi_clp_files | osfi_clp_files_t |
List of files of a specific type, allocated by osfiClpParseArgs(). More... | |
typedef struct osfi_clp_args | osfi_clp_args_t |
Result of parsing CLI arguments, contains the files of each type passed to the module. More... | |
Functions | |
osfi_clp_args_t * | osfiClpParseArgs (int argc, char *argv[]) |
Parse the command-line arguments provided to the module. More... | |
void | osfiClpFree (osfi_clp_args_t *p) |
Release a previously allocated result returned by osfiClpParseArgs(). More... | |
Utilities to parse command line arguments compliant to the E2E-ICD module interface.
CLP parses the command line arguments of a module, generating lists of tokens grouped as:
The command line must follow one of the following formats (flag or positional). In particular, if any flagged option (-
/--
) appears, passing positional arguments is an error.
In either form, file names must be valid OS-dependant file locations. Per the E2E-ICD, the configuration, input and output file names can be either a full-path name or a relative path name. Relative path names are interpreted by the module as relative to the current working directory. In particular, no reference is made to the possible E2E_HOME variable.
If the "local" or "global" options are provided multiple times, only the last value specified is kept for each of the flags.
Note that since the comma character is used as a separator inside the positional arguments, it cannot be part of a file name in this mode, even if it would be a legal path value.
typedef struct osfi_clp_args osfi_clp_args_t |
Result of parsing CLI arguments, contains the files of each type passed to the module.
On a successful return from osfiClpParseArgs(), all members will point to a valid (non-null) substructure. However, depending on the actual arguments, some of them may contain 0 entries e.g. if no input files exist then input
is allocated but input->count==0
.
typedef struct osfi_clp_files osfi_clp_files_t |
List of files of a specific type, allocated by osfiClpParseArgs().
This object is allocated by OSFI and should not be freed directly by caller code.
void osfiClpFree | ( | osfi_clp_args_t * | p | ) |
Release a previously allocated result returned by osfiClpParseArgs().
p | Object to free. May be a null pointer, in which case the call does nothing. |
osfi_clp_args_t* osfiClpParseArgs | ( | int | argc, |
char * | argv[] | ||
) |
Parse the command-line arguments provided to the module.
argc | number of arguments, as would be passed to main |
argv | argument values, as would be passed to main |