enum XML_Size_ABI get_XML_Size_ABI (void) { static bool tested; static enum XML_Size_ABI abi; if (!tested) { if (XML_ExpatVersionInfo () .major >= 2) /* expat >= 2.0 -> XML_Size is 'int64_t' or 'long'. */ { const XML_Feature *features; abi = is_long; for (features = XML_GetFeatureList (); features->name != NULL; features++) if (strcmp (features->name, "XML_LARGE_SIZE") == 0) { abi = is_int64_t; break; } } else /* expat < 2.0 -> XML_Size is 'int'. */ abi = is_int; tested = true; } return abi; }
void XmlParser::GetExpatVersion( int* _pMajor, int* _pMinor, int* _pMicro ) { XML_Expat_Version v = XML_ExpatVersionInfo(); if (_pMajor) *_pMajor = v.major; if (_pMinor) *_pMinor = v.minor; if (_pMicro) *_pMicro = v.micro; }
OMXMLReader* OMXMLReader::create(OMRawStorage* xmlStream) { TRACE("OMXMLReader::create"); XML_Expat_Version version = XML_ExpatVersionInfo(); if (version.major > 1 || (version.major == 1 && version.minor > 95) || (version.major == 1 && version.minor == 95 && version.micro >= 8)) { return new OMXMLReaderExpat(xmlStream); } else { fprintf(stderr, "Error: Require Expat version >= 1.95.8\n"); throw OMException("Require Expat version >= 1.95.8"); } }
XML_Expat_Version _Expat_XML_ExpatVersionInfo(struct ExpatIFace * Self) { return XML_ExpatVersionInfo(); }
void bmx_expat_XML_ExpatVersionInfo(int * major, int * minor, int * micro) { XML_Expat_Version v = XML_ExpatVersionInfo(); *major = v.major; *minor = v.minor; *micro = v.micro; }
int main () { XML_Expat_Version v; v = XML_ExpatVersionInfo(); printf("Using libexpat v%d.%d.%d\n", v.major, v.minor, v.micro); return 0; }