From 9ee2e288661cdd71d1000fed6d00a2150048de76 Mon Sep 17 00:00:00 2001 From: Serhii Sakhno Date: Wed, 25 Feb 2015 20:38:29 +0000 Subject: [PATCH] header for library xml git-svn-id: svn://kolibrios.org@5473 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/lib/lib.obj/xml.h | 126 +++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 programs/cmm/lib/lib.obj/xml.h diff --git a/programs/cmm/lib/lib.obj/xml.h b/programs/cmm/lib/lib.obj/xml.h new file mode 100644 index 0000000000..2b98596988 --- /dev/null +++ b/programs/cmm/lib/lib.obj/xml.h @@ -0,0 +1,126 @@ +dword XML = #aXML_lib; +char aXML_lib[] = "/sys/lib/xml.obj"; + +dword XML_lib_init = #aXMLlib_init; + +dword initializeParser = #aInitializeParser; +dword releaseParser = #aReleaseParser; +dword parse = #aParse; +dword initializeClassParser = #aInitializeClassParser; +dword releaseCkassParser = #aReleaseClassParser; +dword classFromElement = #aClassFromElement; +dword classFromString = #aClassFromString; + +$DD 2 dup 0 + +char aXMLlib_init [] = "lib_init"; +char aInitializeParser[] = "ax_initializeParser"; +char aReleaseParser[] = "ax_releaseParser"; +char aParse[] = "ax_parse"; +char aInitializeClassParser[] = "ax_initializeClassParser"; +char aReleaseClassParser[] = "ax_releaseClassParser"; +char aClassFromElement[] = "ax_classFromElement"; +char aClassFromString[] = "ax_classFromString"; + +//----------------------------------------------------------------------------- +// 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. + dword limit; // (const char*) the end of the value +}; + +struct AXElement +{ + dword id; // (int) the class of the element + dword nextSibling; // (AXElement*) the next sibling element + dword firstChild; // (AXElement*) the first child element + dword lastChild; // (AXElement*) the last child element + AXAttribute reserved; // (AXAttribute) do not use + AXAttribute attributes; // (AXAttribute[]) the array of attributes +}; + +struct AXParseContext +{ + dword base; // (void*) + dword limit; // (void*) + dword chunks; // (void*) + dword chunkSize; // (int) + dword errorCode; // (int) + dword source; // (const char*) + dword current; // (const char*) + dword line; // (int) + dword column; // (int) + dword root; // (AXElement*) + AXAttribute version; // (AXAttribute) + AXAttribute encoding; // (AXAttribute) + dword strict; // (int) + dword reserved1; // (int) + AXElement reserved2; // (AXElement) +}; \ No newline at end of file