[131] | 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 | |
---|
[132] | 14 | typedef long int XInt; // Integer |
---|
[134] | 15 | typedef bool XBool;// Logical |
---|
| 16 | typedef void *XPtr; // Pointeur C non typé |
---|
[131] | 17 | |
---|
| 18 | typedef enum _datatype |
---|
| 19 | { |
---|
[132] | 20 | NOTYPE = 0, |
---|
[131] | 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 | { |
---|
[132] | 28 | NETCDF4 = 0 |
---|
[131] | 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 | |
---|
[134] | 37 | typedef struct _ymdhms_int |
---|
| 38 | { int year, month, day, hour, minute, second; } XDate; |
---|
[131] | 39 | |
---|
[134] | 40 | typedef struct _ymdhms_double |
---|
| 41 | { double year, month, day, hour, minute, second; } XDuration; |
---|
| 42 | |
---|
[132] | 43 | const XHandle NULLHANDLE = { NOTYPE, NULL }; |
---|
| 44 | |
---|
[134] | 45 | #define isNullHandle(hdl) \ |
---|
| 46 | ((hdl).data_type == NOTYPE && (hdl).data_ptr == NULL) |
---|
[132] | 47 | |
---|
[131] | 48 | /* ******************** HANDLE INTERFACE ******************** */ |
---|
[134] | 49 | void xios_handle_create_ (XHandle * const _ret, const XDType * const _dtype, const XString _id); |
---|
[133] | 50 | |
---|
[131] | 51 | /* ******************** XML INTERFACE *********************** */ |
---|
[134] | 52 | void xios_xml_parse_file_ (const XString _filename); |
---|
| 53 | void xios_xml_parse_string_(const XString _xmlcontent); |
---|
[131] | 54 | |
---|
| 55 | /* ******************** DATA TREATMENT INTERFACE ************ */ |
---|
[134] | 56 | void xios_dtreatment_new_(XHandle * const _dt, const XHandle * const _hd); |
---|
[132] | 57 | void xios_dtreatment_create_files_and_headers_(const XHandle * const _hd, const XFileType * const _ft); |
---|
[131] | 58 | |
---|
[133] | 59 | /* ******************** CONTEXT INTERFACE ******************* */ |
---|
[134] | 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); |
---|
[131] | 64 | |
---|
[134] | 65 | /* ******************** CALENDAR INTERFACE ****************** */ |
---|
| 66 | void xios_calendar_set_timestep_(const XHandle * const _cal, const XDuration * const _dur); |
---|
[131] | 67 | |
---|
| 68 | #ifdef __cplusplus |
---|
| 69 | } |
---|
| 70 | #endif //__cplusplus |
---|
| 71 | |
---|
| 72 | |
---|
| 73 | #endif //__C_INTERFACE__ |
---|