00001 /* ---------------------------------------------------- */ 00002 /* Copyright 2006-2010, CERFACS, Toulouse, France. */ 00003 /* Copyright 2006-2010, Centre National de la Recherche Scientifique, Paris, France. */ 00004 /* All rights reserved. Use is subject to OASIS4 license terms. */ 00005 /* ---------------------------------------------------- */ 00006 /* 00007 file sasa_c_xml.h 00008 C header file for sasa 00009 */ 00010 00011 00012 #include <libxml/parser.h> 00013 00014 00015 #define EXIT_SUCCESS 0 00016 #define EXIT_FAILURE 1 00017 #define EXIT_FOUND 2 00018 #define EXIT_NOTFOUND 3 00019 00020 00021 /* 00022 * the resulting document tree if the file was wellformed, NULL otherwise. 00023 */ 00024 extern xmlDocPtr 00025 doc; 00026 00027 00028 /* read the corresponding XML file. 00029 * build a tree in memory 00030 * int sasaOpenXml (const char *filename) 00031 * filename: the name of the XML file (in) 00032 * returns: handle (a positive number) to document tree if document was wellformed, otherwise -1 00033 */ 00034 extern int 00035 sasaOpenXml (const char *filename); 00036 00037 00038 /* free the document and the global variables that may have been allocated 00039 * by the XML parser. 00040 * int sasaCloseXml (int num_doc) 00041 * num_doc: handle to document tree 00042 */ 00043 extern int 00044 sasaCloseXml (int num_doc); 00045 00046 00047 /* - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = */ 00048 00049 extern int 00050 getXmlNodeCount (int num_doc, 00051 const char *nodeName, 00052 int *nodeNumber); 00053 00054 00055 /* - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = */ 00056 00057 00058 extern int 00059 getXmlInfo (int num_doc, 00060 char *xpathSearchString, 00061 char **xpathResultString);