| 
									
										
										
										
											2018-09-21 08:39:36 +02:00
										 |  |  | /*
 | 
					
						
							|  |  |  |                             __  __            _ | 
					
						
							|  |  |  |                          ___\ \/ /_ __   __ _| |_ | 
					
						
							|  |  |  |                         / _ \\  /| '_ \ / _` | __| | 
					
						
							|  |  |  |                        |  __//  \| |_) | (_| | |_
 | 
					
						
							|  |  |  |                         \___/_/\_\ .__/ \__,_|\__| | 
					
						
							|  |  |  |                                  |_| XML parser | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |    Copyright (c) 1997-2000 Thai Open Source Software Center Ltd | 
					
						
							|  |  |  |    Copyright (c) 2000-2017 Expat development team | 
					
						
							|  |  |  |    Licensed under the MIT license: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |    Permission is  hereby granted,  free of charge,  to any  person obtaining | 
					
						
							|  |  |  |    a  copy  of  this  software   and  associated  documentation  files  (the | 
					
						
							|  |  |  |    "Software"),  to  deal in  the  Software  without restriction,  including | 
					
						
							|  |  |  |    without  limitation the  rights  to use,  copy,  modify, merge,  publish, | 
					
						
							|  |  |  |    distribute, sublicense, and/or sell copies of the Software, and to permit | 
					
						
							|  |  |  |    persons  to whom  the Software  is  furnished to  do so,  subject to  the | 
					
						
							|  |  |  |    following conditions: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |    The above copyright  notice and this permission notice  shall be included | 
					
						
							|  |  |  |    in all copies or substantial portions of the Software. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |    THE  SOFTWARE  IS  PROVIDED  "AS  IS",  WITHOUT  WARRANTY  OF  ANY  KIND, | 
					
						
							|  |  |  |    EXPRESS  OR IMPLIED,  INCLUDING  BUT  NOT LIMITED  TO  THE WARRANTIES  OF | 
					
						
							|  |  |  |    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN | 
					
						
							|  |  |  |    NO EVENT SHALL THE AUTHORS OR  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, | 
					
						
							|  |  |  |    DAMAGES OR  OTHER LIABILITY, WHETHER  IN AN  ACTION OF CONTRACT,  TORT OR | 
					
						
							|  |  |  |    OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE | 
					
						
							|  |  |  |    USE OR OTHER DEALINGS IN THE SOFTWARE. | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  | */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef XmlTok_INCLUDED
 | 
					
						
							|  |  |  | #define XmlTok_INCLUDED 1
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifdef __cplusplus
 | 
					
						
							|  |  |  | extern "C" { | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* The following token may be returned by XmlContentTok */ | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | #define XML_TOK_TRAILING_RSQB                                                  \
 | 
					
						
							|  |  |  |   -5 /* ] or ]] at the end of the scan; might be                               \
 | 
					
						
							|  |  |  |         start of illegal ]]> sequence */ | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  | /* The following tokens may be returned by both XmlPrologTok and
 | 
					
						
							|  |  |  |    XmlContentTok. | 
					
						
							|  |  |  | */ | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | #define XML_TOK_NONE -4 /* The string to be scanned is empty */
 | 
					
						
							|  |  |  | #define XML_TOK_TRAILING_CR                                                    \
 | 
					
						
							|  |  |  |   -3                            /* A CR at the end of the scan;                \
 | 
					
						
							|  |  |  |                                    might be part of CRLF sequence */ | 
					
						
							|  |  |  | #define XML_TOK_PARTIAL_CHAR -2 /* only part of a multibyte sequence */
 | 
					
						
							|  |  |  | #define XML_TOK_PARTIAL -1      /* only part of a token */
 | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  | #define XML_TOK_INVALID 0
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* The following tokens are returned by XmlContentTok; some are also
 | 
					
						
							|  |  |  |    returned by XmlAttributeValueTok, XmlEntityTok, XmlCdataSectionTok. | 
					
						
							|  |  |  | */ | 
					
						
							|  |  |  | #define XML_TOK_START_TAG_WITH_ATTS 1
 | 
					
						
							|  |  |  | #define XML_TOK_START_TAG_NO_ATTS 2
 | 
					
						
							|  |  |  | #define XML_TOK_EMPTY_ELEMENT_WITH_ATTS 3 /* empty element tag <e/> */
 | 
					
						
							|  |  |  | #define XML_TOK_EMPTY_ELEMENT_NO_ATTS 4
 | 
					
						
							|  |  |  | #define XML_TOK_END_TAG 5
 | 
					
						
							|  |  |  | #define XML_TOK_DATA_CHARS 6
 | 
					
						
							|  |  |  | #define XML_TOK_DATA_NEWLINE 7
 | 
					
						
							|  |  |  | #define XML_TOK_CDATA_SECT_OPEN 8
 | 
					
						
							|  |  |  | #define XML_TOK_ENTITY_REF 9
 | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | #define XML_TOK_CHAR_REF 10 /* numeric character reference */
 | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | /* The following tokens may be returned by both XmlPrologTok and
 | 
					
						
							|  |  |  |    XmlContentTok. | 
					
						
							|  |  |  | */ | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | #define XML_TOK_PI 11       /* processing instruction */
 | 
					
						
							|  |  |  | #define XML_TOK_XML_DECL 12 /* XML decl or text decl */
 | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  | #define XML_TOK_COMMENT 13
 | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | #define XML_TOK_BOM 14 /* Byte order mark */
 | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | /* The following tokens are returned only by XmlPrologTok */ | 
					
						
							|  |  |  | #define XML_TOK_PROLOG_S 15
 | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | #define XML_TOK_DECL_OPEN 16  /* <!foo */
 | 
					
						
							|  |  |  | #define XML_TOK_DECL_CLOSE 17 /* > */
 | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  | #define XML_TOK_NAME 18
 | 
					
						
							|  |  |  | #define XML_TOK_NMTOKEN 19
 | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | #define XML_TOK_POUND_NAME 20 /* #name */
 | 
					
						
							|  |  |  | #define XML_TOK_OR 21         /* | */
 | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  | #define XML_TOK_PERCENT 22
 | 
					
						
							|  |  |  | #define XML_TOK_OPEN_PAREN 23
 | 
					
						
							|  |  |  | #define XML_TOK_CLOSE_PAREN 24
 | 
					
						
							|  |  |  | #define XML_TOK_OPEN_BRACKET 25
 | 
					
						
							|  |  |  | #define XML_TOK_CLOSE_BRACKET 26
 | 
					
						
							|  |  |  | #define XML_TOK_LITERAL 27
 | 
					
						
							|  |  |  | #define XML_TOK_PARAM_ENTITY_REF 28
 | 
					
						
							|  |  |  | #define XML_TOK_INSTANCE_START 29
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* The following occur only in element type declarations */ | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | #define XML_TOK_NAME_QUESTION 30        /* name? */
 | 
					
						
							|  |  |  | #define XML_TOK_NAME_ASTERISK 31        /* name* */
 | 
					
						
							|  |  |  | #define XML_TOK_NAME_PLUS 32            /* name+ */
 | 
					
						
							|  |  |  | #define XML_TOK_COND_SECT_OPEN 33       /* <![ */
 | 
					
						
							|  |  |  | #define XML_TOK_COND_SECT_CLOSE 34      /* ]]> */
 | 
					
						
							|  |  |  | #define XML_TOK_CLOSE_PAREN_QUESTION 35 /* )? */
 | 
					
						
							|  |  |  | #define XML_TOK_CLOSE_PAREN_ASTERISK 36 /* )* */
 | 
					
						
							|  |  |  | #define XML_TOK_CLOSE_PAREN_PLUS 37     /* )+ */
 | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  | #define XML_TOK_COMMA 38
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* The following token is returned only by XmlAttributeValueTok */ | 
					
						
							|  |  |  | #define XML_TOK_ATTRIBUTE_VALUE_S 39
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* The following token is returned only by XmlCdataSectionTok */ | 
					
						
							|  |  |  | #define XML_TOK_CDATA_SECT_CLOSE 40
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* With namespace processing this is returned by XmlPrologTok for a
 | 
					
						
							|  |  |  |    name with a colon. | 
					
						
							|  |  |  | */ | 
					
						
							|  |  |  | #define XML_TOK_PREFIXED_NAME 41
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifdef XML_DTD
 | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | #  define XML_TOK_IGNORE_SECT 42
 | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  | #endif /* XML_DTD */
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifdef XML_DTD
 | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | #  define XML_N_STATES 4
 | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  | #else /* not XML_DTD */
 | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | #  define XML_N_STATES 3
 | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  | #endif /* not XML_DTD */
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define XML_PROLOG_STATE 0
 | 
					
						
							|  |  |  | #define XML_CONTENT_STATE 1
 | 
					
						
							|  |  |  | #define XML_CDATA_SECTION_STATE 2
 | 
					
						
							|  |  |  | #ifdef XML_DTD
 | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | #  define XML_IGNORE_SECTION_STATE 3
 | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  | #endif /* XML_DTD */
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define XML_N_LITERAL_TYPES 2
 | 
					
						
							|  |  |  | #define XML_ATTRIBUTE_VALUE_LITERAL 0
 | 
					
						
							|  |  |  | #define XML_ENTITY_VALUE_LITERAL 1
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* The size of the buffer passed to XmlUtf8Encode must be at least this. */ | 
					
						
							|  |  |  | #define XML_UTF8_ENCODE_MAX 4
 | 
					
						
							|  |  |  | /* The size of the buffer passed to XmlUtf16Encode must be at least this. */ | 
					
						
							|  |  |  | #define XML_UTF16_ENCODE_MAX 2
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | typedef struct position { | 
					
						
							|  |  |  |   /* first line and first column are 0 not 1 */ | 
					
						
							|  |  |  |   XML_Size lineNumber; | 
					
						
							|  |  |  |   XML_Size columnNumber; | 
					
						
							|  |  |  | } POSITION; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | typedef struct { | 
					
						
							|  |  |  |   const char *name; | 
					
						
							|  |  |  |   const char *valuePtr; | 
					
						
							|  |  |  |   const char *valueEnd; | 
					
						
							|  |  |  |   char normalized; | 
					
						
							|  |  |  | } ATTRIBUTE; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct encoding; | 
					
						
							|  |  |  | typedef struct encoding ENCODING; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | typedef int(PTRCALL *SCANNER)(const ENCODING *, const char *, const char *, | 
					
						
							|  |  |  |                               const char **); | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | enum XML_Convert_Result { | 
					
						
							|  |  |  |   XML_CONVERT_COMPLETED = 0, | 
					
						
							|  |  |  |   XML_CONVERT_INPUT_INCOMPLETE = 1, | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  |   XML_CONVERT_OUTPUT_EXHAUSTED | 
					
						
							|  |  |  |   = 2 /* and therefore potentially input remaining as well */ | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct encoding { | 
					
						
							|  |  |  |   SCANNER scanners[XML_N_STATES]; | 
					
						
							|  |  |  |   SCANNER literalScanners[XML_N_LITERAL_TYPES]; | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  |   int(PTRCALL *nameMatchesAscii)(const ENCODING *, const char *, const char *, | 
					
						
							|  |  |  |                                  const char *); | 
					
						
							|  |  |  |   int(PTRFASTCALL *nameLength)(const ENCODING *, const char *); | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  |   const char *(PTRFASTCALL *skipS)(const ENCODING *, const char *); | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  |   int(PTRCALL *getAtts)(const ENCODING *enc, const char *ptr, int attsMax, | 
					
						
							|  |  |  |                         ATTRIBUTE *atts); | 
					
						
							|  |  |  |   int(PTRFASTCALL *charRefNumber)(const ENCODING *enc, const char *ptr); | 
					
						
							|  |  |  |   int(PTRCALL *predefinedEntityName)(const ENCODING *, const char *, | 
					
						
							|  |  |  |                                      const char *); | 
					
						
							|  |  |  |   void(PTRCALL *updatePosition)(const ENCODING *, const char *ptr, | 
					
						
							|  |  |  |                                 const char *end, POSITION *); | 
					
						
							|  |  |  |   int(PTRCALL *isPublicId)(const ENCODING *enc, const char *ptr, | 
					
						
							|  |  |  |                            const char *end, const char **badPtr); | 
					
						
							|  |  |  |   enum XML_Convert_Result(PTRCALL *utf8Convert)(const ENCODING *enc, | 
					
						
							|  |  |  |                                                 const char **fromP, | 
					
						
							|  |  |  |                                                 const char *fromLim, char **toP, | 
					
						
							|  |  |  |                                                 const char *toLim); | 
					
						
							|  |  |  |   enum XML_Convert_Result(PTRCALL *utf16Convert)(const ENCODING *enc, | 
					
						
							|  |  |  |                                                  const char **fromP, | 
					
						
							|  |  |  |                                                  const char *fromLim, | 
					
						
							|  |  |  |                                                  unsigned short **toP, | 
					
						
							|  |  |  |                                                  const unsigned short *toLim); | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  |   int minBytesPerChar; | 
					
						
							|  |  |  |   char isUtf8; | 
					
						
							|  |  |  |   char isUtf16; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* Scan the string starting at ptr until the end of the next complete
 | 
					
						
							|  |  |  |    token, but do not scan past eptr.  Return an integer giving the | 
					
						
							|  |  |  |    type of token. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |    Return XML_TOK_NONE when ptr == eptr; nextTokPtr will not be set. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |    Return XML_TOK_PARTIAL when the string does not contain a complete | 
					
						
							|  |  |  |    token; nextTokPtr will not be set. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |    Return XML_TOK_INVALID when the string does not start a valid | 
					
						
							|  |  |  |    token; nextTokPtr will be set to point to the character which made | 
					
						
							|  |  |  |    the token invalid. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |    Otherwise the string starts with a valid token; nextTokPtr will be | 
					
						
							|  |  |  |    set to point to the character following the end of that token. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |    Each data character counts as a single token, but adjacent data | 
					
						
							|  |  |  |    characters may be returned together.  Similarly for characters in | 
					
						
							|  |  |  |    the prolog outside literals, comments and processing instructions. | 
					
						
							|  |  |  | */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | #define XmlTok(enc, state, ptr, end, nextTokPtr)                               \
 | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  |   (((enc)->scanners[state])(enc, ptr, end, nextTokPtr)) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | #define XmlPrologTok(enc, ptr, end, nextTokPtr)                                \
 | 
					
						
							|  |  |  |   XmlTok(enc, XML_PROLOG_STATE, ptr, end, nextTokPtr) | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | #define XmlContentTok(enc, ptr, end, nextTokPtr)                               \
 | 
					
						
							|  |  |  |   XmlTok(enc, XML_CONTENT_STATE, ptr, end, nextTokPtr) | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | #define XmlCdataSectionTok(enc, ptr, end, nextTokPtr)                          \
 | 
					
						
							|  |  |  |   XmlTok(enc, XML_CDATA_SECTION_STATE, ptr, end, nextTokPtr) | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | #ifdef XML_DTD
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | #  define XmlIgnoreSectionTok(enc, ptr, end, nextTokPtr)                       \
 | 
					
						
							|  |  |  |     XmlTok(enc, XML_IGNORE_SECTION_STATE, ptr, end, nextTokPtr) | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | #endif /* XML_DTD */
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* This is used for performing a 2nd-level tokenization on the content
 | 
					
						
							|  |  |  |    of a literal that has already been returned by XmlTok. | 
					
						
							|  |  |  | */ | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | #define XmlLiteralTok(enc, literalType, ptr, end, nextTokPtr)                  \
 | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  |   (((enc)->literalScanners[literalType])(enc, ptr, end, nextTokPtr)) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | #define XmlAttributeValueTok(enc, ptr, end, nextTokPtr)                        \
 | 
					
						
							|  |  |  |   XmlLiteralTok(enc, XML_ATTRIBUTE_VALUE_LITERAL, ptr, end, nextTokPtr) | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | #define XmlEntityValueTok(enc, ptr, end, nextTokPtr)                           \
 | 
					
						
							|  |  |  |   XmlLiteralTok(enc, XML_ENTITY_VALUE_LITERAL, ptr, end, nextTokPtr) | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | #define XmlNameMatchesAscii(enc, ptr1, end1, ptr2)                             \
 | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  |   (((enc)->nameMatchesAscii)(enc, ptr1, end1, ptr2)) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | #define XmlNameLength(enc, ptr) (((enc)->nameLength)(enc, ptr))
 | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | #define XmlSkipS(enc, ptr) (((enc)->skipS)(enc, ptr))
 | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | #define XmlGetAttributes(enc, ptr, attsMax, atts)                              \
 | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  |   (((enc)->getAtts)(enc, ptr, attsMax, atts)) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | #define XmlCharRefNumber(enc, ptr) (((enc)->charRefNumber)(enc, ptr))
 | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | #define XmlPredefinedEntityName(enc, ptr, end)                                 \
 | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  |   (((enc)->predefinedEntityName)(enc, ptr, end)) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | #define XmlUpdatePosition(enc, ptr, end, pos)                                  \
 | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  |   (((enc)->updatePosition)(enc, ptr, end, pos)) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | #define XmlIsPublicId(enc, ptr, end, badPtr)                                   \
 | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  |   (((enc)->isPublicId)(enc, ptr, end, badPtr)) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | #define XmlUtf8Convert(enc, fromP, fromLim, toP, toLim)                        \
 | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  |   (((enc)->utf8Convert)(enc, fromP, fromLim, toP, toLim)) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | #define XmlUtf16Convert(enc, fromP, fromLim, toP, toLim)                       \
 | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  |   (((enc)->utf16Convert)(enc, fromP, fromLim, toP, toLim)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | typedef struct { | 
					
						
							|  |  |  |   ENCODING initEnc; | 
					
						
							|  |  |  |   const ENCODING **encPtr; | 
					
						
							|  |  |  | } INIT_ENCODING; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | int XmlParseXmlDecl(int isGeneralTextEntity, const ENCODING *enc, | 
					
						
							|  |  |  |                     const char *ptr, const char *end, const char **badPtr, | 
					
						
							|  |  |  |                     const char **versionPtr, const char **versionEndPtr, | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  |                     const char **encodingNamePtr, | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  |                     const ENCODING **namedEncodingPtr, int *standalonePtr); | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | int XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name); | 
					
						
							|  |  |  | const ENCODING *XmlGetUtf8InternalEncoding(void); | 
					
						
							|  |  |  | const ENCODING *XmlGetUtf16InternalEncoding(void); | 
					
						
							|  |  |  | int FASTCALL XmlUtf8Encode(int charNumber, char *buf); | 
					
						
							|  |  |  | int FASTCALL XmlUtf16Encode(int charNumber, unsigned short *buf); | 
					
						
							|  |  |  | int XmlSizeOfUnknownEncoding(void); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | typedef int(XMLCALL *CONVERTER)(void *userData, const char *p); | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | ENCODING *XmlInitUnknownEncoding(void *mem, int *table, CONVERTER convert, | 
					
						
							|  |  |  |                                  void *userData); | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | int XmlParseXmlDeclNS(int isGeneralTextEntity, const ENCODING *enc, | 
					
						
							|  |  |  |                       const char *ptr, const char *end, const char **badPtr, | 
					
						
							|  |  |  |                       const char **versionPtr, const char **versionEndPtr, | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  |                       const char **encodingNamePtr, | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  |                       const ENCODING **namedEncodingPtr, int *standalonePtr); | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | int XmlInitEncodingNS(INIT_ENCODING *, const ENCODING **, const char *name); | 
					
						
							|  |  |  | const ENCODING *XmlGetUtf8InternalEncodingNS(void); | 
					
						
							|  |  |  | const ENCODING *XmlGetUtf16InternalEncodingNS(void); | 
					
						
							| 
									
										
										
										
											2020-01-20 22:07:04 +02:00
										 |  |  | ENCODING *XmlInitUnknownEncodingNS(void *mem, int *table, CONVERTER convert, | 
					
						
							|  |  |  |                                    void *userData); | 
					
						
							| 
									
										
										
										
											2016-10-06 14:21:30 +03:00
										 |  |  | #ifdef __cplusplus
 | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif /* not XmlTok_INCLUDED */
 |