/*1__ __ _2___\ \/ /_ __ __ _| |_3/ _ \\ /| '_ \ / _` | __|4| __// \| |_) | (_| | |_5\___/_/\_\ .__/ \__,_|\__|6|_| XML parser78Copyright (c) 1997-2000 Thai Open Source Software Center Ltd9Copyright (c) 2000 Clark Cooper <[email protected]>10Copyright (c) 2017-2019 Sebastian Pipping <[email protected]>11Licensed under the MIT license:1213Permission is hereby granted, free of charge, to any person obtaining14a copy of this software and associated documentation files (the15"Software"), to deal in the Software without restriction, including16without limitation the rights to use, copy, modify, merge, publish,17distribute, sublicense, and/or sell copies of the Software, and to permit18persons to whom the Software is furnished to do so, subject to the19following conditions:2021The above copyright notice and this permission notice shall be included22in all copies or substantial portions of the Software.2324THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,25EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF26MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN27NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,28DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR29OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE30USE OR OTHER DEALINGS IN THE SOFTWARE.31*/3233enum {34BT_NONXML, /* e.g. noncharacter-FFFF */35BT_MALFORM, /* illegal, with regard to encoding */36BT_LT, /* less than = "<" */37BT_AMP, /* ampersand = "&" */38BT_RSQB, /* right square bracket = "[" */39BT_LEAD2, /* lead byte of a 2-byte UTF-8 character */40BT_LEAD3, /* lead byte of a 3-byte UTF-8 character */41BT_LEAD4, /* lead byte of a 4-byte UTF-8 character */42BT_TRAIL, /* trailing unit, e.g. second 16-bit unit of a 4-byte char. */43BT_CR, /* carriage return = "\r" */44BT_LF, /* line feed = "\n" */45BT_GT, /* greater than = ">" */46BT_QUOT, /* quotation character = "\"" */47BT_APOS, /* apostrophe = "'" */48BT_EQUALS, /* equal sign = "=" */49BT_QUEST, /* question mark = "?" */50BT_EXCL, /* exclamation mark = "!" */51BT_SOL, /* solidus, slash = "/" */52BT_SEMI, /* semicolon = ";" */53BT_NUM, /* number sign = "#" */54BT_LSQB, /* left square bracket = "[" */55BT_S, /* white space, e.g. "\t", " "[, "\r"] */56BT_NMSTRT, /* non-hex name start letter = "G".."Z" + "g".."z" + "_" */57BT_COLON, /* colon = ":" */58BT_HEX, /* hex letter = "A".."F" + "a".."f" */59BT_DIGIT, /* digit = "0".."9" */60BT_NAME, /* dot and middle dot = "." + chr(0xb7) */61BT_MINUS, /* minus = "-" */62BT_OTHER, /* known not to be a name or name start character */63BT_NONASCII, /* might be a name or name start character */64BT_PERCNT, /* percent sign = "%" */65BT_LPAR, /* left parenthesis = "(" */66BT_RPAR, /* right parenthesis = "(" */67BT_AST, /* asterisk = "*" */68BT_PLUS, /* plus sign = "+" */69BT_COMMA, /* comma = "," */70BT_VERBAR /* vertical bar = "|" */71};7273#include <stddef.h>747576