OSFI-C  3.9.2
OpenSF Integration Library
OSFIC.h
1 /*
2  * openSF Integration Libraries (OSFI)
3  * Deimos Space, S.L.U.
4  *
5  * This file is part of OSFI. OSFI is free software; you can redistribute it
6  * and/or modify it under the terms of the 'ESA Software Community Licence Permissive' as
7  * published by the European Space Agency; either version 2.4 of the License,
8  * or (at your option) any later version. You should have received a
9  * copy of the 'ESA Software Community Licence Permissive - v2.4' along with this program
10  * or one can be found at <http://eop-cfi.esa.int/index.php/docs-and-mission-data/licensing-documents>.
11  *
12  * @file
13  * @brief OSFI-C public API header
14  */
15 
16 #ifndef OSFI_C_INTERFACE
17 #define OSFI_C_INTERFACE 1
18 
19 #include <stdbool.h>
20 #include <stdint.h>
21 
22 # define MAX_LENGTH_FILE_NAME 255
23 # define MAX_LENGTH_STRING 255
24 # define MAX_PARAMETER_FIELD_SIZE 255
25 # define MAX_PARAMETER_NAME_SIZE 255
26 # define MAX_PARAMETER_DESC_SIZE 255
27 # define MAX_LOG_SIZE 1000
28 
31 #if __STDC_VERSION__ >= 201112L
32  #define OSFI_NO_RETURN _Noreturn /* In C11: keyword */
33 #else
34  #define OSFI_NO_RETURN /* Below C11: nothing */
35 #endif
36 
40 typedef enum
41 {
42  ParamInteger = 1,
43  ParamDouble,
44  ParamBoolean,
45  ParamString,
46  ParamFile,
47  ParamFolder,
48  ParamTime
49 } ParamType;
50 
54 typedef struct {
55 char *name;
56 char *description;
57 char *value;
58 char *units;
59 int dims[2];
60 char *min;
61 char *max;
62 ParamType type;
64 
65 // EHLog module
66 
71 void osfiLoggerError(const char *format,...);
72 
77 void osfiLoggerWarning(const char *format,...);
78 
83 void osfiLoggerInfo(const char *format,...);
84 
92 void osfiLoggerDebug(const char *format,...);
93 
99 void osfiLoggerProgress(int n, int m);
100 
106 OSFI_NO_RETURN void osfiLoggerFinishExecution(int errorCode);
107 
113 void osfiLoggerQuality(const char *name, const char *value);
114 
120 void osfiLoggerQualityDouble(const char *name, double value);
121 
128 int osfiCLP(int argc, char *argv[]);
129 
137 void osfiCLPGetConfFile(char * fileName, int *length);
138 
144 void osfiCLPGetConfFiles(char *confFiles[], int *noFiles);
145 
151 void osfiCLPGetInputFiles(char *inputFiles[], int *noFiles);
152 
158 void osfiCLPGetOutputFiles(char *outputFiles[], int *noFiles);
159 
160 // ConFM Module
161 
172 int osfiConFMParamReader(const char *fileName, const char *schemaName);
173 
181 bool osfiConFMReadConfigFile(const char *fileName);
182 
184 enum osfi_confm_val_res {
186  OSFI_CONFM_VAL_PASSED = 1,
188  OSFI_CONFM_VAL_INVALID,
190  OSFI_CONFM_VAL_ERRORS,
191 };
192 
197 enum osfi_confm_val_res osfiConFMValidateAgainst(const char* schemaFile);
198 
203 void osfiConFMPrintParameters();
204 
209 typedef struct osfi_timevalue {
210  int16_t year;
211  int8_t month, dom, hour, minute, sec;
212  int32_t nanosec;
214 
221 int osfiTimevalue_cmp(const osfi_timevalue_t *a, const osfi_timevalue_t *b);
222 
228 void osfiConFMGetIntegerValue(int *value, const char *paramName);
229 
235 void osfiConFMGetDoubleValue(double *value, const char *paramName);
236 
242 void osfiConFMGetTimeValue(osfi_timevalue_t *value, const char *paramName);
243 
249 bool osfiConFMGetBoolValue(const char *paramName);
250 
257 void osfiConFMGetFileValue(char *param, int *length, const char *paramName);
258 
265 void osfiConFMGetStringValue(char *param, int *length, const char *paramName);
266 
272 void osfiConFMGetParameter(osfiParameter *param, const char *paramName);
273 
278 void osfiConFMPrintParameter(const char *paramName);
279 
286 void osfiConFMGetVectorDoubleValues(double *doubleList, int *size,
287  const char *paramName);
288 
295 void osfiConFMGetVectorIntegerValues(int *intList, int *size, const char *paramName);
296 
303 void osfiConFMGetVectorTimeValues(osfi_timevalue_t *list, int *size, const char *paramName);
304 
311 void osfiConFMGetVectorStringValues(char *stringList[], int *size, const char *paramName);
312 
319 void osfiConFMGetVectorFileValues(char *fileList[], int *size, const char *paramName);
320 
327 void osfiConFMGetVectorBooleanValues(bool *boolList, int *size, const char *paramName);
328 
335 void osfiConFMGetLeafVectorDoubleValues(double *doubleList, int *size,
336  const char *paramName, int node[], int depth);
337 
344 void osfiConFMGetLeafVectorIntegerValues(int *intList, int *size, const char *paramName, int node[], int depth);
345 
352 void osfiConFMGetLeafVectorTimeValues(osfi_timevalue_t *list, int *size, const char *paramName, int node[], int depth);
353 
360 void osfiConFMGetLeafVectorStringValues(char *stringList[], int *size, const char *paramName, int node[], int depth);
361 
368 void osfiConFMGetLeafVectorFileValues(char *fileList[], int *size, const char *paramName, int node[], int depth);
369 
376 void osfiConFMGetLeafVectorBooleanValues(bool *boolList, int *size, const char *paramName, int node[], int depth);
377 
385 void osfiConFMGetMatrixStringValues(char *stringMatrix[], int *rows, int *columns, const char *paramName);
386 
394 void osfiConFMGetMatrixFileValues(char *fileMatrix[], int *rows, int *columns, const char *paramName);
395 
403 void osfiConFMGetMatrixBooleanValues(bool *booleanMatrix, int *rows, int *columns, const char *paramName);
404 
412 void osfiConFMfileExist(bool *booleanMatrix, int *rows, int *columns, const char *paramName);
413 
421 void osfiConFMGetMatrixDoubleValues(double *doubleMatrix, int *rows,
422  int *columns, const char *paramName);
423 
431 void osfiConFMGetMatrixIntegerValues(int *intMatrix, int *rows, int *columns,
432  const char *paramName);
433 
441 void osfiConFMGetMatrixTimeValues(osfi_timevalue_t *intMatrix, int *rows, int *columns,
442  const char *paramName);
443 
450 void osfiConFMGetDimension(const char *paramName, int index, int *size);
451 
452 void osfiConFMGetNodeDimension(const char *paramName, int node[], int depth, int *size);
453 
454 bool osfiConFMIsLeaf(const char *paramName, int node[], int depth);
460 int osfiConFMGetRows(const char *paramName);
461 
467 int osfiConFMGetColumns(const char *paramName);
468 
474 bool osfiConFMExistParameter(const char *paramName);
475 
477 ParamType osfiConFMGetElementType(const char* paramName);
480 bool osfiConFMIsArray(const char* paramName);
481 
486 int osfiCommonClose();
487 
488 #endif // !defined(OSFI_C_INTERFACE)
osfiParameter
Definition: OSFIC.h:54
osfi_timevalue
Definition: OSFIC.h:209