[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 |
---|
| 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 | |
---|
| 37 | typedef struct _ymdhms // Durée et date. |
---|
| 38 | { int year, month, day, hour, minute, second; } XDate, XDuration; |
---|
| 39 | |
---|
[132] | 40 | const XHandle NULLHANDLE = { NOTYPE, NULL }; |
---|
| 41 | |
---|
| 42 | #define isNullHandle(hdl) ((hdl).data_type == NOTYPE && (hdl).data_ptr == NULL) |
---|
| 43 | |
---|
[131] | 44 | /* ******************** HANDLE INTERFACE ******************** */ |
---|
[132] | 45 | void xios_handle_create_ (XHandle * _ret, const XDType * const _dtype, XString _id); |
---|
[131] | 46 | void xios_handle_verify_ (XBool * _ret, const XHandle * const _hd); |
---|
| 47 | void xios_handle_getType_(XDType * _ret, const XHandle * const _hd); |
---|
| 48 | |
---|
| 49 | void xios_handle_isType_ (XBool * _ret, const XHandle * const _hd, const XDType * const _dtype); |
---|
[132] | 50 | void xios_handle_isId_ (XBool * _ret, const XHandle * const _hd, const XString * const _id); |
---|
[131] | 51 | void xios_handle_isGroup_ (XBool * _ret, const XHandle * const _hd); |
---|
| 52 | void xios_handle_isElement_(XBool * _ret, const XHandle * const _hd); |
---|
| 53 | |
---|
| 54 | /* ******************** XML INTERFACE *********************** */ |
---|
| 55 | void xios_xml_parse_file_ (XString _filename); |
---|
| 56 | void xios_xml_parse_string_(XString _xmlcontent); |
---|
| 57 | |
---|
| 58 | /* ******************** DATA TREATMENT INTERFACE ************ */ |
---|
[132] | 59 | void xios_dtreatment_new_(XHandle * _dt, const XHandle * const _hd); |
---|
| 60 | void xios_dtreatment_create_files_and_headers_(const XHandle * const _hd, const XFileType * const _ft); |
---|
[131] | 61 | |
---|
| 62 | /* ******************** CALENDAR INTERFACE ****************** */ |
---|
| 63 | |
---|
| 64 | void xios_date_new_(XHandle * _dte, const XDate * const _xdate); |
---|
| 65 | void xios_calendar_setTimeStep_(XHandle * _cal, const XDuration * const _dur); |
---|
| 66 | |
---|
| 67 | /* ******************** CONTEXT INTERFACE ******************* */ |
---|
| 68 | void xios_context_SetCurrent_(const XHandle * const _ctxt); |
---|
| 69 | void xios_context_GetCurrent_(XHandle * _ctxt); |
---|
| 70 | void xios_context_ShowTree_ (void); |
---|
| 71 | |
---|
| 72 | void xios_context_getCalendar_(const XHandle * const _ctxt, XHandle* _cal); |
---|
| 73 | |
---|
| 74 | /* ******************** AXIS INTERFACE ********************** */ |
---|
| 75 | /* ******************** DOMAIN INTERFACE ******************** */ |
---|
| 76 | /* ******************** FIELD INTERFACE ********************* */ |
---|
| 77 | /* ******************** FILE INTERFACE ********************** */ |
---|
| 78 | /* ******************** GRID INTERFACE ********************** */ |
---|
| 79 | /* ******************** GROUP INTERFACE ********************* */ |
---|
| 80 | |
---|
| 81 | #ifdef __cplusplus |
---|
| 82 | } |
---|
| 83 | #endif //__cplusplus |
---|
| 84 | |
---|
| 85 | |
---|
| 86 | #endif //__C_INTERFACE__ |
---|