OSFI-C  3.9.3
OpenSF Integration Library
OSFIC.h
Go to the documentation of this file.
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 
17 #ifndef OSFI_C_INTERFACE
18 #define OSFI_C_INTERFACE 1
19 
20 #include <stdbool.h>
21 #include <stdint.h>
22 
23 # define MAX_LENGTH_FILE_NAME 255
24 # define MAX_LENGTH_STRING 255
25 # define MAX_PARAMETER_FIELD_SIZE 255
26 # define MAX_PARAMETER_NAME_SIZE 255
27 # define MAX_PARAMETER_DESC_SIZE 255
28 # define MAX_LOG_SIZE 1000
29 
32 #if __STDC_VERSION__ >= 201112L
33  #define OSFI_NO_RETURN _Noreturn /* In C11: keyword */
34 #else
35  #define OSFI_NO_RETURN /* Below C11: nothing */
36 #endif
37 
41 typedef enum
42 {
66  ParamTime
68 
72 typedef struct {
73  char *name;
74  char *description;
75  char *value;
76  char *units;
77  int dims[2];
78  char *min;
79  char *max;
80  ParamType type;
82 
83 // EHLog module
84 
89 void osfiLoggerError(const char *format,...);
90 
95 void osfiLoggerWarning(const char *format,...);
96 
101 void osfiLoggerInfo(const char *format,...);
102 
110 void osfiLoggerDebug(const char *format,...);
111 
117 void osfiLoggerProgress(int n, int m);
118 
126 
132 void osfiLoggerQuality(const char *name, const char *value);
133 
139 void osfiLoggerQualityDouble(const char *name, double value);
140 
147 int osfiCLP(int argc, char *argv[]);
148 
156 void osfiCLPGetConfFile(char * fileName, int *length);
157 
163 void osfiCLPGetConfFiles(char *confFiles[], int *noFiles);
164 
170 void osfiCLPGetInputFiles(char *inputFiles[], int *noFiles);
171 
177 void osfiCLPGetOutputFiles(char *outputFiles[], int *noFiles);
178 
179 // ConFM Module
180 
191 int osfiConFMParamReader(const char *fileName, const char *schemaName);
192 
200 bool osfiConFMReadConfigFile(const char *fileName);
201 
210 };
211 
216 enum osfi_confm_val_res osfiConFMValidateAgainst(const char* schemaFile);
217 
223 
229 typedef struct osfi_timevalue {
230  int16_t year;
231  int8_t month;
232  int8_t dom;
233  int8_t hour;
234  int8_t minute;
235  int8_t sec;
236  int32_t nanosec;
238 
246 
252 void osfiConFMGetIntegerValue(int *value, const char *paramName);
253 
259 void osfiConFMGetDoubleValue(double *value, const char *paramName);
260 
266 void osfiConFMGetTimeValue(osfi_timevalue_t *value, const char *paramName);
267 
273 bool osfiConFMGetBoolValue(const char *paramName);
274 
281 void osfiConFMGetFileValue(char *param, int *length, const char *paramName);
282 
289 void osfiConFMGetStringValue(char *param, int *length, const char *paramName);
290 
296 void osfiConFMGetParameter(osfiParameter *param, const char *paramName);
297 
302 void osfiConFMPrintParameter(const char *paramName);
303 
310 void osfiConFMGetVectorDoubleValues(double *doubleList, int *size,
311  const char *paramName);
312 
319 void osfiConFMGetVectorIntegerValues(int *intList, int *size, const char *paramName);
320 
327 void osfiConFMGetVectorTimeValues(osfi_timevalue_t *list, int *size, const char *paramName);
328 
335 void osfiConFMGetVectorStringValues(char *stringList[], int *size, const char *paramName);
336 
343 void osfiConFMGetVectorFileValues(char *fileList[], int *size, const char *paramName);
344 
351 void osfiConFMGetVectorBooleanValues(bool *boolList, int *size, const char *paramName);
352 
359 void osfiConFMGetLeafVectorDoubleValues(double *doubleList, int *size,
360  const char *paramName, int node[], int depth);
361 
368 void osfiConFMGetLeafVectorIntegerValues(int *intList, int *size, const char *paramName, int node[], int depth);
369 
376 void osfiConFMGetLeafVectorTimeValues(osfi_timevalue_t *list, int *size, const char *paramName, int node[], int depth);
377 
384 void osfiConFMGetLeafVectorStringValues(char *stringList[], int *size, const char *paramName, int node[], int depth);
385 
392 void osfiConFMGetLeafVectorFileValues(char *fileList[], int *size, const char *paramName, int node[], int depth);
393 
400 void osfiConFMGetLeafVectorBooleanValues(bool *boolList, int *size, const char *paramName, int node[], int depth);
401 
409 void osfiConFMGetMatrixStringValues(char *stringMatrix[], int *rows, int *columns, const char *paramName);
410 
418 void osfiConFMGetMatrixFileValues(char *fileMatrix[], int *rows, int *columns, const char *paramName);
419 
427 void osfiConFMGetMatrixBooleanValues(bool *booleanMatrix, int *rows, int *columns, const char *paramName);
428 
436 void osfiConFMfileExist(bool *booleanMatrix, int *rows, int *columns, const char *paramName);
437 
445 void osfiConFMGetMatrixDoubleValues(double *doubleMatrix, int *rows,
446  int *columns, const char *paramName);
447 
455 void osfiConFMGetMatrixIntegerValues(int *intMatrix, int *rows, int *columns,
456  const char *paramName);
457 
465 void osfiConFMGetMatrixTimeValues(osfi_timevalue_t *intMatrix, int *rows, int *columns,
466  const char *paramName);
467 
474 void osfiConFMGetDimension(const char *paramName, int index, int *size);
475 
476 void osfiConFMGetNodeDimension(const char *paramName, int node[], int depth, int *size);
477 
478 bool osfiConFMIsLeaf(const char *paramName, int node[], int depth);
484 int osfiConFMGetRows(const char *paramName);
485 
491 int osfiConFMGetColumns(const char *paramName);
492 
498 bool osfiConFMExistParameter(const char *paramName);
499 
501 ParamType osfiConFMGetElementType(const char* paramName);
504 bool osfiConFMIsArray(const char* paramName);
505 
511 
512 #endif // !defined(OSFI_C_INTERFACE)
void osfiCLPGetConfFile(char *fileName, int *length)
void osfiLoggerQualityDouble(const char *name, double value)
int osfiConFMGetColumns(const char *paramName)
void osfiConFMGetMatrixDoubleValues(double *doubleMatrix, int *rows, int *columns, const char *paramName)
void osfiConFMGetVectorDoubleValues(double *doubleList, int *size, const char *paramName)
void osfiConFMGetDoubleValue(double *value, const char *paramName)
void osfiConFMGetLeafVectorStringValues(char *stringList[], int *size, const char *paramName, int node[], int depth)
void osfiConFMGetVectorStringValues(char *stringList[], int *size, const char *paramName)
void osfiConFMGetStringValue(char *param, int *length, const char *paramName)
bool osfiConFMReadConfigFile(const char *fileName)
void osfiConFMfileExist(bool *booleanMatrix, int *rows, int *columns, const char *paramName)
void osfiLoggerInfo(const char *format,...)
void osfiConFMGetVectorTimeValues(osfi_timevalue_t *list, int *size, const char *paramName)
void osfiConFMGetIntegerValue(int *value, const char *paramName)
void osfiConFMGetFileValue(char *param, int *length, const char *paramName)
void osfiConFMGetParameter(osfiParameter *param, const char *paramName)
void osfiConFMGetLeafVectorFileValues(char *fileList[], int *size, const char *paramName, int node[], int depth)
ParamType
Definition: OSFIC.h:42
@ ParamDouble
Floating point number, in decimal representation with the range of IEEE754 binary64.
Definition: OSFIC.h:46
@ ParamFile
Definition: OSFIC.h:58
@ ParamInteger
Integral number, with the value range of int32_t.
Definition: OSFIC.h:44
@ ParamBoolean
Truth value. Per the E2E-ICD, only TRUE or FALSE are accepted, capitalized.
Definition: OSFIC.h:48
@ ParamFolder
Path to a folder, with the same rules as ParamFile.
Definition: OSFIC.h:60
@ ParamString
Definition: OSFIC.h:53
@ ParamTime
Definition: OSFIC.h:66
void osfiConFMGetMatrixStringValues(char *stringMatrix[], int *rows, int *columns, const char *paramName)
void osfiCLPGetOutputFiles(char *outputFiles[], int *noFiles)
void osfiLoggerQuality(const char *name, const char *value)
void osfiConFMGetVectorBooleanValues(bool *boolList, int *size, const char *paramName)
void osfiConFMGetLeafVectorTimeValues(osfi_timevalue_t *list, int *size, const char *paramName, int node[], int depth)
void osfiCLPGetConfFiles(char *confFiles[], int *noFiles)
void osfiLoggerError(const char *format,...)
void osfiLoggerFinishExecution(int errorCode)
void osfiConFMGetTimeValue(osfi_timevalue_t *value, const char *paramName)
int osfiConFMGetRows(const char *paramName)
void osfiLoggerProgress(int n, int m)
int osfiTimevalue_cmp(const osfi_timevalue_t *a, const osfi_timevalue_t *b)
struct osfi_timevalue osfi_timevalue_t
void osfiConFMGetMatrixBooleanValues(bool *booleanMatrix, int *rows, int *columns, const char *paramName)
void osfiConFMGetDimension(const char *paramName, int index, int *size)
void osfiConFMGetLeafVectorIntegerValues(int *intList, int *size, const char *paramName, int node[], int depth)
void osfiConFMPrintParameter(const char *paramName)
void osfiLoggerDebug(const char *format,...)
void osfiConFMPrintParameters()
void osfiCLPGetInputFiles(char *inputFiles[], int *noFiles)
void osfiLoggerWarning(const char *format,...)
bool osfiConFMGetBoolValue(const char *paramName)
void osfiConFMGetVectorFileValues(char *fileList[], int *size, const char *paramName)
void osfiConFMGetVectorIntegerValues(int *intList, int *size, const char *paramName)
void osfiConFMGetMatrixTimeValues(osfi_timevalue_t *intMatrix, int *rows, int *columns, const char *paramName)
bool osfiConFMExistParameter(const char *paramName)
bool osfiConFMIsArray(const char *paramName)
void osfiConFMGetMatrixIntegerValues(int *intMatrix, int *rows, int *columns, const char *paramName)
void osfiConFMGetLeafVectorBooleanValues(bool *boolList, int *size, const char *paramName, int node[], int depth)
enum osfi_confm_val_res osfiConFMValidateAgainst(const char *schemaFile)
int osfiConFMParamReader(const char *fileName, const char *schemaName)
void osfiConFMGetLeafVectorDoubleValues(double *doubleList, int *size, const char *paramName, int node[], int depth)
int osfiCLP(int argc, char *argv[])
void osfiConFMGetMatrixFileValues(char *fileMatrix[], int *rows, int *columns, const char *paramName)
#define OSFI_NO_RETURN
Definition: OSFIC.h:35
int osfiCommonClose()
ParamType osfiConFMGetElementType(const char *paramName)
osfi_confm_val_res
Definition: OSFIC.h:203
@ OSFI_CONFM_VAL_PASSED
Definition: OSFIC.h:205
@ OSFI_CONFM_VAL_INVALID
Definition: OSFIC.h:207
@ OSFI_CONFM_VAL_ERRORS
Definition: OSFIC.h:209
Definition: OSFIC.h:72
Definition: OSFIC.h:229
int8_t hour
Hour of day, from 0 to 23.
Definition: OSFIC.h:233
int16_t year
Year number, from 1 to 9999 inclusive.
Definition: OSFIC.h:230
int8_t dom
Day of month, from 1 to the appropriate length according to the year.
Definition: OSFIC.h:232
int32_t nanosec
Fraction of second in ns resolution, from 0 to 999999999.
Definition: OSFIC.h:236
int8_t sec
Second of minute, from 0 to 60 to allow for leap seconds.
Definition: OSFIC.h:235
int8_t month
Month number, from 1 to 12.
Definition: OSFIC.h:231
int8_t minute
Minute of hour, from 0 to 59.
Definition: OSFIC.h:234