cppDataPipeline 0.3.0
C++ Implementation of the FAIR Data Pipeline API
Loading...
Searching...
No Matches
fdp.h
1#ifndef __FDP_C_API__
2#define __FDP_C_API__
3
4#ifdef __cplusplus
5
6#include "fdp.hxx"
7
8extern "C" {
9
10#endif
11
20struct FdpDataPipeline;
21typedef struct FdpDataPipeline FdpDataPipeline;
22
29enum FdpError {
30 FDP_ERR_NONE = 0,
31 FDP_ERR_CONFIG_PARSE = 1,
32 FDP_ERR_REST_API_QUERY = 2,
33 FDP_ERR_JSON_PARSE = 3,
34 FDP_ERR_VALIDATION = 4,
35 FDP_ERR_SYNC = 5,
36 FDP_ERR_WRITE = 6,
37 FDP_ERR_TOML = 7,
38 FDP_ERR_OTHER = 8
39};
40typedef enum FdpError FdpError;
41
63FdpError fdp_init(FdpDataPipeline **data_pipeline, const char *config_file_path,
64 const char *script_file_path, const char *token);
65
79FdpError fdp_finalise(FdpDataPipeline **data_pipeline);
80
99FdpError fdp_link_read(FdpDataPipeline *data_pipeline, const char *data_product,
100 char *data_store_path, size_t data_store_path_len);
101
120FdpError fdp_link_write(FdpDataPipeline *data_pipeline,
121 const char *data_product, char *data_store_path, size_t data_store_path_len);
122
130enum FdpLogLevel {
131 FDP_LOG_TRACE = 0,
132 FDP_LOG_DEBUG = 1,
133 FDP_LOG_INFO = 2,
134 FDP_LOG_WARN = 3,
135 FDP_LOG_ERROR = 4,
136 FDP_LOG_CRITICAL = 5,
137 FDP_LOG_OFF = 6
138};
139typedef enum FdpLogLevel FdpLogLevel;
140
146void fdp_set_log_level(FdpLogLevel log_level);
147
153FdpLogLevel fdp_get_log_level();
154
169int fdp_log(FdpLogLevel log_level, const char *msg);
170
171#ifdef __cplusplus
172
173} // close extern "C"
174
175namespace FairDataPipeline {
176
180DataPipeline::sptr from_c_struct(FdpDataPipeline *data_pipeline);
181
191FdpDataPipeline *to_c_struct(DataPipeline::sptr data_pipeline);
192
196void delete_c_struct(FdpDataPipeline *data_pipeline);
197
198} // namespace FairDataPipeline
199
200#endif
201
202#endif // __FDP_C_API__
Definition: fdp_c_api.cxx:17