1 | #ifndef __C_INTERFACE__ |
---|
2 | #define __C_INTERFACE__ |
---|
3 | |
---|
4 | #include "xmlio.hpp" |
---|
5 | |
---|
6 | using namespace XMLIOSERVER; |
---|
7 | using namespace XMLIOSERVER::XML; |
---|
8 | |
---|
9 | #ifdef __cplusplus |
---|
10 | extern"C" |
---|
11 | { |
---|
12 | #endif //__cplusplus |
---|
13 | |
---|
14 | typedef long int XInt; // Integer |
---|
15 | typedef bool XBool;// Logical |
---|
16 | typedef void *XPtr; // Pointeur C non typé |
---|
17 | |
---|
18 | typedef enum _datatype |
---|
19 | { |
---|
20 | NOTYPE = 0, |
---|
21 | DTREATMENT, DATE, CALENDAR, ECONTEXT, |
---|
22 | EAXIS, EDOMAIN, EFIELD, EFILE, EGRID, |
---|
23 | GAXIS, GDOMAIN, GFIELD, GFILE, GGRID |
---|
24 | } XDType; |
---|
25 | |
---|
26 | typedef enum _filetype |
---|
27 | { |
---|
28 | NETCDF4 = 0 |
---|
29 | } XFileType; |
---|
30 | |
---|
31 | typedef struct _handle // Référence C à une objet de la bibliothÚque. |
---|
32 | { XDType data_type; XPtr data_ptr; } XHandle; |
---|
33 | |
---|
34 | typedef struct _string // Chaîne de caractÚres. |
---|
35 | { char * str; int len; } XString; |
---|
36 | |
---|
37 | typedef struct _ymdhms_int |
---|
38 | { int year, month, day, hour, minute, second; } XDate; |
---|
39 | |
---|
40 | typedef struct _ymdhms_double |
---|
41 | { double year, month, day, hour, minute, second; } XDuration; |
---|
42 | |
---|
43 | const XHandle NULLHANDLE = { NOTYPE, NULL }; |
---|
44 | |
---|
45 | #define isNullHandle(hdl) \ |
---|
46 | ((hdl).data_type == NOTYPE && (hdl).data_ptr == NULL) |
---|
47 | |
---|
48 | /* ******************** HANDLE INTERFACE ******************** */ |
---|
49 | void xios_handle_create_ (XHandle * const _ret, const XDType * const _dtype, const XString _id); |
---|
50 | |
---|
51 | /* ******************** XML INTERFACE *********************** */ |
---|
52 | void xios_xml_parse_file_ (const XString _filename); |
---|
53 | void xios_xml_parse_string_(const XString _xmlcontent); |
---|
54 | |
---|
55 | /* ******************** DATA TREATMENT INTERFACE ************ */ |
---|
56 | void xios_dtreatment_new_(XHandle * const _dt, const XHandle * const _hd); |
---|
57 | void xios_dtreatment_create_files_and_headers_(const XHandle * const _hd, const XFileType * const _ft); |
---|
58 | |
---|
59 | /* ******************** CONTEXT INTERFACE ******************* */ |
---|
60 | void xios_context_set_current_ (const XHandle * const _ctxt, const bool * const _wswap); |
---|
61 | void xios_context_get_current_ (XHandle * _ctxt); |
---|
62 | void xios_context_get_calendar_(const XHandle * const _ctxt, XHandle * _cal); |
---|
63 | /// void xios_context_ShowTree_ (void); |
---|
64 | |
---|
65 | /* ******************** CALENDAR INTERFACE ****************** */ |
---|
66 | void xios_calendar_set_timestep_(const XHandle * const _cal, const XDuration * const _dur); |
---|
67 | |
---|
68 | #ifdef __cplusplus |
---|
69 | } |
---|
70 | #endif //__cplusplus |
---|
71 | |
---|
72 | |
---|
73 | #endif //__C_INTERFACE__ |
---|