15bb6a25fSPoul-Henning Kamp /* 20a48773fSEric van Gyzen __ __ _ 30a48773fSEric van Gyzen ___\ \/ /_ __ __ _| |_ 40a48773fSEric van Gyzen / _ \\ /| '_ \ / _` | __| 50a48773fSEric van Gyzen | __// \| |_) | (_| | |_ 60a48773fSEric van Gyzen \___/_/\_\ .__/ \__,_|\__| 70a48773fSEric van Gyzen |_| XML parser 80a48773fSEric van Gyzen 90a48773fSEric van Gyzen Copyright (c) 1997-2000 Thai Open Source Software Center Ltd 100a48773fSEric van Gyzen Copyright (c) 2000-2017 Expat development team 110a48773fSEric van Gyzen Licensed under the MIT license: 120a48773fSEric van Gyzen 130a48773fSEric van Gyzen Permission is hereby granted, free of charge, to any person obtaining 140a48773fSEric van Gyzen a copy of this software and associated documentation files (the 150a48773fSEric van Gyzen "Software"), to deal in the Software without restriction, including 160a48773fSEric van Gyzen without limitation the rights to use, copy, modify, merge, publish, 170a48773fSEric van Gyzen distribute, sublicense, and/or sell copies of the Software, and to permit 180a48773fSEric van Gyzen persons to whom the Software is furnished to do so, subject to the 190a48773fSEric van Gyzen following conditions: 200a48773fSEric van Gyzen 210a48773fSEric van Gyzen The above copyright notice and this permission notice shall be included 220a48773fSEric van Gyzen in all copies or substantial portions of the Software. 230a48773fSEric van Gyzen 240a48773fSEric van Gyzen THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 250a48773fSEric van Gyzen EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 260a48773fSEric van Gyzen MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 270a48773fSEric van Gyzen NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 280a48773fSEric van Gyzen DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 290a48773fSEric van Gyzen OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 300a48773fSEric van Gyzen USE OR OTHER DEALINGS IN THE SOFTWARE. 315bb6a25fSPoul-Henning Kamp */ 325bb6a25fSPoul-Henning Kamp 335bb6a25fSPoul-Henning Kamp enum { 34*6b2c1e49SXin LI BT_NONXML, /* e.g. noncharacter-FFFF */ 35*6b2c1e49SXin LI BT_MALFORM, /* illegal, with regard to encoding */ 36*6b2c1e49SXin LI BT_LT, /* less than = "<" */ 37*6b2c1e49SXin LI BT_AMP, /* ampersand = "&" */ 38*6b2c1e49SXin LI BT_RSQB, /* right square bracket = "[" */ 39*6b2c1e49SXin LI BT_LEAD2, /* lead byte of a 2-byte UTF-8 character */ 40*6b2c1e49SXin LI BT_LEAD3, /* lead byte of a 3-byte UTF-8 character */ 41*6b2c1e49SXin LI BT_LEAD4, /* lead byte of a 4-byte UTF-8 character */ 42*6b2c1e49SXin LI BT_TRAIL, /* trailing unit, e.g. second 16-bit unit of a 4-byte char. */ 43*6b2c1e49SXin LI BT_CR, /* carriage return = "\r" */ 44*6b2c1e49SXin LI BT_LF, /* line feed = "\n" */ 45*6b2c1e49SXin LI BT_GT, /* greater than = ">" */ 46*6b2c1e49SXin LI BT_QUOT, /* quotation character = "\"" */ 47*6b2c1e49SXin LI BT_APOS, /* aposthrophe = "'" */ 48*6b2c1e49SXin LI BT_EQUALS, /* equal sign = "=" */ 49*6b2c1e49SXin LI BT_QUEST, /* question mark = "?" */ 50*6b2c1e49SXin LI BT_EXCL, /* exclamation mark = "!" */ 51*6b2c1e49SXin LI BT_SOL, /* solidus, slash = "/" */ 52*6b2c1e49SXin LI BT_SEMI, /* semicolon = ";" */ 53*6b2c1e49SXin LI BT_NUM, /* number sign = "#" */ 54*6b2c1e49SXin LI BT_LSQB, /* left square bracket = "[" */ 55*6b2c1e49SXin LI BT_S, /* white space, e.g. "\t", " "[, "\r"] */ 56*6b2c1e49SXin LI BT_NMSTRT, /* non-hex name start letter = "G".."Z" + "g".."z" + "_" */ 57*6b2c1e49SXin LI BT_COLON, /* colon = ":" */ 58*6b2c1e49SXin LI BT_HEX, /* hex letter = "A".."F" + "a".."f" */ 59*6b2c1e49SXin LI BT_DIGIT, /* digit = "0".."9" */ 60*6b2c1e49SXin LI BT_NAME, /* dot and middle dot = "." + chr(0xb7) */ 61*6b2c1e49SXin LI BT_MINUS, /* minus = "-" */ 625bb6a25fSPoul-Henning Kamp BT_OTHER, /* known not to be a name or name start character */ 635bb6a25fSPoul-Henning Kamp BT_NONASCII, /* might be a name or name start character */ 64*6b2c1e49SXin LI BT_PERCNT, /* percent sign = "%" */ 65*6b2c1e49SXin LI BT_LPAR, /* left parenthesis = "(" */ 66*6b2c1e49SXin LI BT_RPAR, /* right parenthesis = "(" */ 67*6b2c1e49SXin LI BT_AST, /* asterisk = "*" */ 68*6b2c1e49SXin LI BT_PLUS, /* plus sign = "+" */ 69*6b2c1e49SXin LI BT_COMMA, /* comma = "," */ 70*6b2c1e49SXin LI BT_VERBAR /* vertical bar = "|" */ 715bb6a25fSPoul-Henning Kamp }; 725bb6a25fSPoul-Henning Kamp 735bb6a25fSPoul-Henning Kamp #include <stddef.h> 74