OSFI-C  3.10.0
OpenSF Integration Library
CLP.c

Basic usage example for the CLP module, showing how to enumerate the input files.

// Example of usage for OSFI-C API (CLP module)
#include <OSFIC.h>
int main(int argc, char* argv[]) {
// Try to parse E2E-ICD compliant module arguments
osfi_clp_args_t* args = osfiClpParseArgs(argc, argv);
if (!args) { // Error during arguments parsing
osfiLoggerError("Could not parse arguments!");
return 1;
}
// Use the values. All member fields are guaranteed to be non-null, but
// the relevant arrays may contain 0 entries depending in the arguments.
// In this example, just log the paths of all input files.
for (int i = 0; i < args->input->count; ++i) {
osfiLoggerInfo("Input file %d: %s", i, args->input->files[i]);
}
// Cleanup when done
osfiClpFree(args);
return 0;
}
OSFI-C public API header.
osfi_clp_args_t * osfiClpParseArgs(int argc, char *argv[])
Parse the command-line arguments provided to the module.
void osfiClpFree(osfi_clp_args_t *p)
Release a previously allocated result returned by osfiClpParseArgs().
void osfiLoggerInfo(const char *format,...)
void osfiLoggerError(const char *format,...)
Result of parsing CLI arguments, contains the files of each type passed to the module.
Definition: OSFIC.h:139
osfi_clp_files_t * input
Input files, never null.
Definition: OSFIC.h:150
const char * files[]
Path of each file, contains count valid entries and one final NULL entry.
Definition: OSFIC.h:126
int count
Number of valid pointers to strings in files.
Definition: OSFIC.h:124