From 1e81efaeb24265bec7dfb95f1d5fefe701015644 Mon Sep 17 00:00:00 2001 From: Magmus Date: Sun, 30 Jun 2013 18:06:39 -0700 Subject: Rename asm-xml.h.h to asm-xml.h --- core/XML_Parser/asm-xml.h | 162 ++++++++++++++++++++++++++++++++++++++++++++ core/XML_Parser/asm-xml.h.h | 162 -------------------------------------------- 2 files changed, 162 insertions(+), 162 deletions(-) create mode 100644 core/XML_Parser/asm-xml.h delete mode 100644 core/XML_Parser/asm-xml.h.h (limited to 'core') diff --git a/core/XML_Parser/asm-xml.h b/core/XML_Parser/asm-xml.h new file mode 100644 index 00000000..38dcb639 --- /dev/null +++ b/core/XML_Parser/asm-xml.h @@ -0,0 +1,162 @@ +/**************************************************************************** +* * +* asm-xml.h * +* * +* Copyright (C) 2007-08 Marc Kerbiquet * +* * +****************************************************************************/ + +#ifdef WIN32 + #define ACC __cdecl +#else + #define ACC +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +//----------------------------------------------------------------------------- +// Error Codes +//----------------------------------------------------------------------------- +#define RC_OK 0 // everything is ok +#define RC_MEMORY 1 // out of memory + +#define RC_EMPTY_NAME 10 // name empty or not defined +#define RC_ATTR_DEFINED 11 // attribute already defined +#define RC_ELEM_DEFINED 12 // element already defined +#define RC_SCHEMA_EMPTY 13 // schema does not contains a document +#define RC_DOCUMENT_DEFINED 14 // schema contains more than one document +#define RC_UNDEFINED_CLASS 15 // can't find collection in reference +#define RC_UNDEFINED_GROUP 16 // can't find a group in include +#define RC_INVALID_ID 17 // id is not a valid number +#define RC_INVALID_IGNORE 18 // ignore is not 'yes' or 'no' + +#define RC_INVALID_ENTITY_REFERENCE 20 // must be amp, quot, lt, gt, or apos +#define RC_UNEXPECTED_END 21 // found last char too early +#define RC_INVALID_CHAR 22 // wrong char +#define RC_OVERFLOW 23 // number to big in char reference +#define RC_NO_START_TAG 24 // xml does not start with a tag +#define RC_TAG_MISMATCH 25 // invalid close tag +#define RC_INVALID_TAG 26 // invalid root element +#define RC_INVALID_ATTRIBUTE 27 // unknown attribute +#define RC_INVALID_PI 28 // invalid processing instruction ( has been defined in schema; + // use ax_getElement() to retrieve it. + const char* limit ; // the end of the value +}; + +struct AXElement +{ + int id ; // the class of the element + AXElement* nextSibling ; // the next sibling element + AXElement* firstChild ; // the first child element + AXElement* lastChild ; // the last child element + AXAttribute reserved ; // do not use + AXAttribute attributes[1] ; // the array of attributes - there is + // no bound checking in C +}; + +struct AXParseContext +{ + void* base ; + void* limit ; + void* chunks ; + int chunkSize ; + int errorCode ; + const char* source ; + const char* current ; + int line ; + int column ; + AXElement* root ; + AXAttribute version ; + AXAttribute encoding ; + int strict ; + int reserved1 ; + AXElement reserved2 ; +}; + +//----------------------------------------------------------------------------- +// Functions +//----------------------------------------------------------------------------- + +extern +void ACC ax_initialize (void* mallocFun, + void* freeFun); +extern +int ACC ax_initializeParser (AXParseContext* context, + unsigned int chunkSize); +extern +int ACC ax_releaseParser (AXParseContext* context); +extern +AXElement* ACC ax_parse (AXParseContext* context, + const char* source, + AXElementClass* type, + int strict); +extern +int ACC ax_initializeClassParser (AXClassContext* context); +extern +int ACC ax_releaseClassParser (AXClassContext* context); +extern +AXElementClass* ACC ax_classFromElement (AXElement* e, + AXClassContext* context); +extern +AXElementClass* ACC ax_classFromString (const char* source, + AXClassContext* context); + +#define ax_getElement(element, index) ((AXElement*)element->attributes[index].begin) +#define ax_getAttribute(element, index) (&element->attributes[index]) + + +#ifdef __cplusplus +} +#endif diff --git a/core/XML_Parser/asm-xml.h.h b/core/XML_Parser/asm-xml.h.h deleted file mode 100644 index 38dcb639..00000000 --- a/core/XML_Parser/asm-xml.h.h +++ /dev/null @@ -1,162 +0,0 @@ -/**************************************************************************** -* * -* asm-xml.h * -* * -* Copyright (C) 2007-08 Marc Kerbiquet * -* * -****************************************************************************/ - -#ifdef WIN32 - #define ACC __cdecl -#else - #define ACC -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -//----------------------------------------------------------------------------- -// Error Codes -//----------------------------------------------------------------------------- -#define RC_OK 0 // everything is ok -#define RC_MEMORY 1 // out of memory - -#define RC_EMPTY_NAME 10 // name empty or not defined -#define RC_ATTR_DEFINED 11 // attribute already defined -#define RC_ELEM_DEFINED 12 // element already defined -#define RC_SCHEMA_EMPTY 13 // schema does not contains a document -#define RC_DOCUMENT_DEFINED 14 // schema contains more than one document -#define RC_UNDEFINED_CLASS 15 // can't find collection in reference -#define RC_UNDEFINED_GROUP 16 // can't find a group in include -#define RC_INVALID_ID 17 // id is not a valid number -#define RC_INVALID_IGNORE 18 // ignore is not 'yes' or 'no' - -#define RC_INVALID_ENTITY_REFERENCE 20 // must be amp, quot, lt, gt, or apos -#define RC_UNEXPECTED_END 21 // found last char too early -#define RC_INVALID_CHAR 22 // wrong char -#define RC_OVERFLOW 23 // number to big in char reference -#define RC_NO_START_TAG 24 // xml does not start with a tag -#define RC_TAG_MISMATCH 25 // invalid close tag -#define RC_INVALID_TAG 26 // invalid root element -#define RC_INVALID_ATTRIBUTE 27 // unknown attribute -#define RC_INVALID_PI 28 // invalid processing instruction ( has been defined in schema; - // use ax_getElement() to retrieve it. - const char* limit ; // the end of the value -}; - -struct AXElement -{ - int id ; // the class of the element - AXElement* nextSibling ; // the next sibling element - AXElement* firstChild ; // the first child element - AXElement* lastChild ; // the last child element - AXAttribute reserved ; // do not use - AXAttribute attributes[1] ; // the array of attributes - there is - // no bound checking in C -}; - -struct AXParseContext -{ - void* base ; - void* limit ; - void* chunks ; - int chunkSize ; - int errorCode ; - const char* source ; - const char* current ; - int line ; - int column ; - AXElement* root ; - AXAttribute version ; - AXAttribute encoding ; - int strict ; - int reserved1 ; - AXElement reserved2 ; -}; - -//----------------------------------------------------------------------------- -// Functions -//----------------------------------------------------------------------------- - -extern -void ACC ax_initialize (void* mallocFun, - void* freeFun); -extern -int ACC ax_initializeParser (AXParseContext* context, - unsigned int chunkSize); -extern -int ACC ax_releaseParser (AXParseContext* context); -extern -AXElement* ACC ax_parse (AXParseContext* context, - const char* source, - AXElementClass* type, - int strict); -extern -int ACC ax_initializeClassParser (AXClassContext* context); -extern -int ACC ax_releaseClassParser (AXClassContext* context); -extern -AXElementClass* ACC ax_classFromElement (AXElement* e, - AXClassContext* context); -extern -AXElementClass* ACC ax_classFromString (const char* source, - AXClassContext* context); - -#define ax_getElement(element, index) ((AXElement*)element->attributes[index].begin) -#define ax_getAttribute(element, index) (&element->attributes[index]) - - -#ifdef __cplusplus -} -#endif -- cgit v1.2.3