Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:33

0001 /*
0002 # <<BEGIN-copyright>>
0003 # <<END-copyright>>
0004 */
0005 #ifndef xDataTOM_importXML_private_h_included
0006 #define xDataTOM_importXML_private_h_included
0007 
0008 #include <expat.h>
0009 #include <statusMessageReporting.h>
0010 #include <xDataTOM_private.h>
0011 
0012 #if defined __cplusplus
0013     extern "C" {
0014     namespace GIDI {
0015 #endif
0016 
0017 #ifndef XMLCALL
0018 #define XMLCALL
0019 #endif
0020 
0021 #ifndef XML_Char
0022 #define XML_Char char
0023 #endif
0024 
0025 #ifndef XML_Size
0026 #define XML_Size long
0027 #endif
0028 
0029 typedef struct xDataXMLType_s xDataXMLType;
0030 
0031 enum xDataXML_status { xDataXML_statusParsing = 1, xDataXML_statusCompleted, xDataXML_statusError };
0032 enum xDataXML_errorCodes { xDataXML_errNone, xDataXML_errXML_ParserCreate, xDataXML_errFileError, xDataXML_errXMLParser };
0033 enum xDataXML_itemMode { xDataXML_itemModeEnd = 0, xDataXML_itemModeElement, xDataXML_itemModeText };
0034 enum xDataXML_xDataType { xDataXML_xDataType_Ok, xDataXML_xDataType_ConvertingToData, xDataXML_xDataType_ConvertingToString };
0035 
0036 typedef struct xDataTOM_importXMLTOM_s xDataTOM_importXMLTOM;
0037 typedef struct xDataXML_attribute_s xDataXML_attribute;
0038 typedef struct xDataXML_document_s xDataXML_document;
0039 typedef struct xDataXML_docInfo_s xDataXML_docInfo;
0040 typedef struct xDataXML_attributionList_s xDataXML_attributionList;
0041 typedef struct xDataXML_element_s xDataXML_element;
0042 typedef struct xDataXML_elementList_s xDataXML_elementList;
0043 typedef struct xDataXML_elementListItem_s xDataXML_elementListItem;
0044 typedef struct xDataXML_rootElement_s xDataXML_rootElement;
0045 typedef struct xDataXML_text_s xDataXML_text;
0046 typedef struct xDataXML_smr_s xDataXML_smr;
0047 typedef struct xDataXML_item_s xDataXML_item;
0048 
0049 struct xDataXML_docInfo_s {
0050     size_t line;
0051     size_t column;
0052 };
0053 
0054 struct xDataXML_attribute_s {
0055     char *name;
0056     char *value;
0057 };
0058 
0059 struct xDataXML_attributionList_s {
0060     int number;
0061     size_t size;
0062     xDataXML_attribute *attributes;
0063 };
0064 
0065 struct xDataXML_text_s {
0066     xDataXML_docInfo docInfo;
0067     size_t allocated;
0068     size_t length;
0069     char *text;
0070 };
0071 
0072 typedef int (*xDTXML_toDataFunction)( statusMessageReporting *smr, xDataXMLType *, xDataXML_attributionList *, char const * );
0073 typedef char *(*xDTXML_toStringFunction)( statusMessageReporting *smr, xDataXMLType * );
0074 typedef int (*xDTXML_releaseFunction)( statusMessageReporting *smr, xDataXMLType * );
0075 
0076 struct xDataXML_elementListItem_s {
0077     xDataXML_element *element;
0078     const char *sortString;
0079 };
0080 
0081 struct xDataXML_elementList_s {
0082     int n;
0083     xDataXML_elementListItem *items;
0084 };
0085 
0086 struct xDataXMLType_s {
0087     enum xDataXML_xDataType status;
0088     const char *ID;
0089     xDataXML_element *element;
0090     xDTXML_toDataFunction toData;
0091     xDTXML_toStringFunction toString;
0092     xDTXML_releaseFunction release;
0093     int indexPresent, startPresent, endPresent, lengthPresent;
0094     xDataTOM_Int index, start, end, length;
0095     void *data;
0096 };
0097 
0098 struct xDataXML_rootElement_s {
0099     xDataXML_document *xData_doc;
0100     xDataXML_element *parentElement;
0101     xDataXML_rootElement *parentRoot;
0102     int depth;
0103     int numberOfElements;
0104     xDataXML_element *children;
0105     xDataXML_element *currentChild;
0106 };
0107 
0108 struct xDataXML_element_s {
0109     xDataXML_docInfo docInfo;
0110     int ordinal;                                    /* Counting from 0. */
0111     int index;                                      /* Value from "index" attribute if present or -1 */
0112     int accessed;                                   /* For the convenience of the users, not used internally. */
0113     xDataXML_rootElement *parentRoot;
0114     xDataXML_rootElement childrenRoot;
0115     xDataXML_element *next;
0116     char *name;                                     /* Allocated in xData_parseAddElementToRoot. */
0117     char *fullName;                                 /* Allocated in xData_parseAddElementToRoot. */
0118     xDataXML_attributionList attributes;               /* attributes->abbributes is allocated in xData_parseAddElementToRoot. */
0119     xDataXMLType xDataTypeInfo;
0120     size_t textOffset;
0121     xDataXML_text text;
0122 };
0123 
0124 struct xDataXML_smr_s {
0125     smr_userInterface smrUserInterface;
0126     xDataXML_document *doc;
0127 };
0128 
0129 struct xDataXML_document_s {
0130     enum xDataXML_status status;
0131     enum xDataXML_errorCodes error;
0132     enum XML_Error err;
0133     XML_Size err_line, err_column;
0134     char *fileName;
0135     char *realFileName;
0136     xDataXML_smr smrUserInterface;
0137     statusMessageReporting *smr;
0138     XML_Parser xmlParser;
0139     xDataXML_rootElement root;
0140     xDataXML_rootElement *currentRoot;
0141 };
0142 
0143 struct xDataXML_item_s {
0144     xDataXML_element *parentElement;
0145     xDataXML_element *element;
0146     enum xDataXML_itemMode mode;
0147     size_t textOffset;
0148     size_t textLength;
0149     char *text;
0150 };
0151 
0152 xDataTOM_TOM *xDataXML_importFile( statusMessageReporting *smr, char const *fileName );
0153 xDataXML_document *xDataXML_importFile2( statusMessageReporting *smr, char const *fileName );
0154 void *xDataXML_freeDoc( statusMessageReporting *smr, xDataXML_document *doc );
0155 int xDataXML_parseIsError( xDataXML_document *doc );
0156 xDataXML_element *xDataXML_getDocumentsElement( xDataXML_document *doc );
0157 xDataXML_element *xDataXML_getFirstElement( xDataXML_element *element );
0158 xDataXML_element *xDataXML_getNextElement( xDataXML_element *element );
0159 enum xDataXML_itemMode xDataXML_getFirstItem( xDataXML_element *element, xDataXML_item *item );
0160 enum xDataXML_itemMode xDataXML_getNextItem( xDataXML_item *item );
0161 int xDataXML_isAttributeInList( xDataXML_attributionList *attributes, char const *name );
0162 int xDataXML_isAttributeInElement( xDataXML_element *element, char const *name );
0163 char *xDataXML_getAttributesValue( xDataXML_attributionList *attributes, char const *name );
0164 char const *xDataXML_getAttributesValueInElement( xDataXML_element *element, char const *name );
0165 int xDataXML_attributeListLength( xDataXML_attributionList *attributes );
0166 xDataXML_attribute *xDataXML_attributeByIndex( xDataXML_attributionList *attributes, int index );
0167 int xDataXML_getCommonData( statusMessageReporting *smr, xDataXML_element *element, xDataTOM_Int *index, xDataTOM_Int *start, xDataTOM_Int *end,
0168         xDataTOM_Int *length );
0169 int xDataXML_xDataTypeConvertAttributes( statusMessageReporting *smr, xDataXML_element *element );
0170 xDataTOM_Int xDataXML_convertAttributeTo_xDataTOM_Int( statusMessageReporting *smr, xDataXML_element *element, char const *name, xDataTOM_Int *n, int required );
0171 int xDataXML_convertAttributeToDouble( statusMessageReporting *smr, xDataXML_element *element, char const *name, double *d, int required );
0172 int xDataXML_numberOfElementsByTagName( statusMessageReporting *smr, xDataXML_element *element, char const *tagName );
0173 xDataXML_elementList *xDataXML_getElementsByTagName( statusMessageReporting *smr, xDataXML_element *element, char const *tagName );
0174 xDataXML_element *xDataXML_getOneElementByTagName( statusMessageReporting *smr, xDataXML_element *element, char *name, int required );
0175 void xDataXML_freeElementList( statusMessageReporting *smr, xDataXML_elementList *list );
0176 int xDataXML_is_xDataType( statusMessageReporting *smr, xDataXMLType *xDT, char const * const type, int setMsg );
0177 char const *xDataXML_getFileName( xDataXML_document *doc );
0178 char const *xDataXML_getRealFileName( xDataXML_document *doc );
0179 xDataXML_document *xDataXML_getElementsDocument( xDataXML_element *element );
0180 void *xDataXML_get_smrUserInterfaceFromDocument( xDataXML_document *doc );
0181 void *xDataXML_get_smrUserInterfaceFromElement( xDataXML_element *element );
0182 int xDataXML_stringTo_xDataTOM_Int( statusMessageReporting *smr, void *smrUserInterface, char const *c, xDataTOM_Int *value, char const *endings, char **e );
0183 int xDataXML_stringTo_double( statusMessageReporting *smr, void *smrUserInterface, char const *c, double *value, char const *endings, char **e );
0184 int xDataXML_addToAccessed( statusMessageReporting *smr, xDataXML_element *element, int increment );
0185 int xDataXML_getAccessed( statusMessageReporting *smr, xDataXML_element *element );
0186 void *xDataXML_initializeData( statusMessageReporting *smr, xDataXML_element *XE, xDataTOM_element *TE, char const *ID, size_t size );
0187 
0188 /*
0189 c Stuff in xDataTOM_importXML_axes.c
0190 */
0191 int xDataXML_axesElememtToTOM( statusMessageReporting *smr, xDataXML_element *XE, xDataTOM_axes *axes );
0192 int xDataXML_axesToTOM( statusMessageReporting *smr, xDataXML_element *XE, xDataTOM_axes *axes );
0193 
0194 /*
0195 c Stuff in xDataTOM_importXML_XYs.c
0196 */
0197 int xDataXML_XYsToTOM( statusMessageReporting *smr, xDataXML_element *XE, xDataTOM_element *TE );
0198 int xDataXML_XYsDataToTOM( statusMessageReporting *smr, xDataXML_element *XE, xDataTOM_XYs *XYs, int index, int length, double value, double accuracy,
0199         enum xDataTOM_subAxesType subAxesType, int axesOffest, xDataTOM_axes *axes, xDataTOM_interpolation *interpolation );
0200 int xDataXML_stringToDoubles( statusMessageReporting *smr, xDataXML_element *XE, char const *s, int length, double *d );
0201 
0202 /*
0203 c Stuff in xDataTOM_importXML_regionsXYs.c
0204 */
0205 int xDataXML_regionsXYsToTOM( statusMessageReporting *smr, xDataXML_element *XE, xDataTOM_element *TE );
0206 
0207 /*
0208 c Stuff in xDataTOM_importXML_W_XYs.c
0209 */
0210 int xDataXML_W_XYsToTOM( statusMessageReporting *smr, xDataXML_element *XE, xDataTOM_element *TE );
0211 int xDataXML_W_XYsDataToTOM( statusMessageReporting *smr, xDataXML_element *XE, xDataTOM_W_XYs *W_XYs, int index, double value, xDataTOM_axes *axes,
0212     int axesOffset );
0213 
0214 /*
0215 c Stuff in xDataTOM_importXML_V_W_XYs.c
0216 */
0217 int xDataXML_V_W_XYsToTOM( statusMessageReporting *smr, xDataXML_element *XE, xDataTOM_element *TE );
0218 
0219 /*
0220 c Stuff in xDataTOM_importXML_W_XYs_LegendreSeries.c
0221 */
0222 int xDataXML_W_XYs_LegendreSeriesToTOM( statusMessageReporting *smr, xDataXML_element *XE, xDataTOM_element *TE );
0223 int xDataXML_W_XYs_LegendreSeries_LegendreSeriesToTOM( statusMessageReporting *smr, xDataXML_element *XE, xDataTOM_LegendreSeries *LegendreSeries );
0224 
0225 /*
0226 c Stuff in xDataTOM_importXML_regionsW_XYs_LegendreSeries.c
0227 */
0228 int xDataXML_regionsW_XYs_LegendreSeriesToTOM( statusMessageReporting *smr, xDataXML_element *XE, xDataTOM_element *TE );
0229 
0230 /*
0231 c Stuff in xDataTOM_importXML_V_W_XYs_LegendreSeries.c
0232 */
0233 int xDataXML_V_W_XYs_LegendreSeriesToTOM( statusMessageReporting *smr, xDataXML_element *XE, xDataTOM_element *TE );
0234 
0235 /*
0236 c Stuff in xDataTOM_importXML_polynomial.c
0237 */
0238 int xDataXML_polynomialToTOM( statusMessageReporting *smr, xDataXML_element *XE, xDataTOM_element *TE );
0239 
0240 /*
0241 c Stuff in xDataTOM_importXML_KalbachMann.c
0242 */
0243 int xDataXML_KalbachMannToTOM( statusMessageReporting *smr, xDataXML_element *XE, xDataTOM_element *TE );
0244 
0245 #if defined __cplusplus
0246     }
0247     }
0248 #endif
0249 
0250 #endif              /* End of xDataTOM_importXML_private_h_included. */