source: XMLIO_V2/dev/dev_rv/src/XMLIO/c_interface.hpp @ 133

Last change on this file since 133 was 133, checked in by hozdoba, 14 years ago
File size: 2.9 KB
Line 
1#ifndef __C_INTERFACE__
2#define __C_INTERFACE__
3
4#include "xmlio.hpp"
5
6using namespace XMLIOSERVER;
7using namespace XMLIOSERVER::XML;
8
9#ifdef __cplusplus
10extern"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 // Durée et date.
38   { int year, month, day, hour, minute, second; } XDate, XDuration;
39
40   const XHandle NULLHANDLE = { NOTYPE, NULL };
41
42#define isNullHandle(hdl) ((hdl).data_type == NOTYPE && (hdl).data_ptr == NULL)
43
44   /* ******************** HANDLE INTERFACE ******************** */
45   void xios_handle_create_ (XHandle * _ret, const XDType * const _dtype, XString _id);
46
47   /*
48   void xios_handle_verify_ (XBool   * _ret, const XHandle * const _hd);
49   void xios_handle_getType_(XDType  * _ret, const XHandle * const _hd);
50
51   void xios_handle_isType_   (XBool * _ret, const XHandle * const _hd, const XDType  * const _dtype);
52   void xios_handle_isId_     (XBool * _ret, const XHandle * const _hd, const XString * const _id);
53   void xios_handle_isGroup_  (XBool * _ret, const XHandle * const _hd);
54   void xios_handle_isElement_(XBool * _ret, const XHandle * const _hd);
55   */
56
57   /* ******************** XML INTERFACE *********************** */
58   void xios_xml_parse_file_  (XString _filename);
59   void xios_xml_parse_string_(XString _xmlcontent);
60
61   /* ******************** DATA TREATMENT INTERFACE ************ */
62   void xios_dtreatment_new_(XHandle * _dt, const XHandle * const _hd);
63   void xios_dtreatment_create_files_and_headers_(const XHandle * const _hd, const XFileType * const _ft);
64
65   /* ******************** CONTEXT INTERFACE ******************* */
66   void xios_context_set_current_(const XHandle * const _ctxt, const bool * const _wswap);
67
68
69   /*
70   void xios_context_GetCurrent_(XHandle * _ctxt);
71   void xios_context_ShowTree_  (void);
72
73   void xios_context_getCalendar_(const XHandle * const _ctxt, XHandle* _cal);
74   */
75
76   /* ******************** AXIS INTERFACE ********************** */
77   /* ******************** DOMAIN INTERFACE ******************** */
78   /* ******************** FIELD INTERFACE ********************* */
79   /* ******************** FILE INTERFACE ********************** */
80   /* ******************** GRID INTERFACE ********************** */
81   /* ******************** GROUP INTERFACE ********************* */
82
83#ifdef __cplusplus
84}
85#endif //__cplusplus
86
87
88#endif //__C_INTERFACE__
Note: See TracBrowser for help on using the repository browser.