xref: /freebsd/contrib/expat/lib/xmltok_impl.h (revision cc68614da8232d8baaca0ae0d0dd8f890f06623e)
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
10*cc68614dSXin LI    Copyright (c) 2000      Clark Cooper <coopercc@users.sourceforge.net>
11*cc68614dSXin LI    Copyright (c) 2017-2019 Sebastian Pipping <sebastian@pipping.org>
120a48773fSEric van Gyzen    Licensed under the MIT license:
130a48773fSEric van Gyzen 
140a48773fSEric van Gyzen    Permission is  hereby granted,  free of charge,  to any  person obtaining
150a48773fSEric van Gyzen    a  copy  of  this  software   and  associated  documentation  files  (the
160a48773fSEric van Gyzen    "Software"),  to  deal in  the  Software  without restriction,  including
170a48773fSEric van Gyzen    without  limitation the  rights  to use,  copy,  modify, merge,  publish,
180a48773fSEric van Gyzen    distribute, sublicense, and/or sell copies of the Software, and to permit
190a48773fSEric van Gyzen    persons  to whom  the Software  is  furnished to  do so,  subject to  the
200a48773fSEric van Gyzen    following conditions:
210a48773fSEric van Gyzen 
220a48773fSEric van Gyzen    The above copyright  notice and this permission notice  shall be included
230a48773fSEric van Gyzen    in all copies or substantial portions of the Software.
240a48773fSEric van Gyzen 
250a48773fSEric van Gyzen    THE  SOFTWARE  IS  PROVIDED  "AS  IS",  WITHOUT  WARRANTY  OF  ANY  KIND,
260a48773fSEric van Gyzen    EXPRESS  OR IMPLIED,  INCLUDING  BUT  NOT LIMITED  TO  THE WARRANTIES  OF
270a48773fSEric van Gyzen    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
280a48773fSEric van Gyzen    NO EVENT SHALL THE AUTHORS OR  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
290a48773fSEric van Gyzen    DAMAGES OR  OTHER LIABILITY, WHETHER  IN AN  ACTION OF CONTRACT,  TORT OR
300a48773fSEric van Gyzen    OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
310a48773fSEric van Gyzen    USE OR OTHER DEALINGS IN THE SOFTWARE.
325bb6a25fSPoul-Henning Kamp */
335bb6a25fSPoul-Henning Kamp 
345bb6a25fSPoul-Henning Kamp enum {
356b2c1e49SXin LI   BT_NONXML,   /* e.g. noncharacter-FFFF */
366b2c1e49SXin LI   BT_MALFORM,  /* illegal, with regard to encoding */
376b2c1e49SXin LI   BT_LT,       /* less than = "<" */
386b2c1e49SXin LI   BT_AMP,      /* ampersand = "&" */
396b2c1e49SXin LI   BT_RSQB,     /* right square bracket = "[" */
406b2c1e49SXin LI   BT_LEAD2,    /* lead byte of a 2-byte UTF-8 character */
416b2c1e49SXin LI   BT_LEAD3,    /* lead byte of a 3-byte UTF-8 character */
426b2c1e49SXin LI   BT_LEAD4,    /* lead byte of a 4-byte UTF-8 character */
436b2c1e49SXin LI   BT_TRAIL,    /* trailing unit, e.g. second 16-bit unit of a 4-byte char. */
446b2c1e49SXin LI   BT_CR,       /* carriage return = "\r" */
456b2c1e49SXin LI   BT_LF,       /* line feed = "\n" */
466b2c1e49SXin LI   BT_GT,       /* greater than = ">" */
476b2c1e49SXin LI   BT_QUOT,     /* quotation character = "\"" */
486b2c1e49SXin LI   BT_APOS,     /* aposthrophe = "'" */
496b2c1e49SXin LI   BT_EQUALS,   /* equal sign = "=" */
506b2c1e49SXin LI   BT_QUEST,    /* question mark = "?" */
516b2c1e49SXin LI   BT_EXCL,     /* exclamation mark = "!" */
526b2c1e49SXin LI   BT_SOL,      /* solidus, slash = "/" */
536b2c1e49SXin LI   BT_SEMI,     /* semicolon = ";" */
546b2c1e49SXin LI   BT_NUM,      /* number sign = "#" */
556b2c1e49SXin LI   BT_LSQB,     /* left square bracket = "[" */
566b2c1e49SXin LI   BT_S,        /* white space, e.g. "\t", " "[, "\r"] */
576b2c1e49SXin LI   BT_NMSTRT,   /* non-hex name start letter = "G".."Z" + "g".."z" + "_" */
586b2c1e49SXin LI   BT_COLON,    /* colon = ":" */
596b2c1e49SXin LI   BT_HEX,      /* hex letter = "A".."F" + "a".."f" */
606b2c1e49SXin LI   BT_DIGIT,    /* digit = "0".."9" */
616b2c1e49SXin LI   BT_NAME,     /* dot and middle dot = "." + chr(0xb7) */
626b2c1e49SXin LI   BT_MINUS,    /* minus = "-" */
635bb6a25fSPoul-Henning Kamp   BT_OTHER,    /* known not to be a name or name start character */
645bb6a25fSPoul-Henning Kamp   BT_NONASCII, /* might be a name or name start character */
656b2c1e49SXin LI   BT_PERCNT,   /* percent sign = "%" */
666b2c1e49SXin LI   BT_LPAR,     /* left parenthesis = "(" */
676b2c1e49SXin LI   BT_RPAR,     /* right parenthesis = "(" */
686b2c1e49SXin LI   BT_AST,      /* asterisk = "*" */
696b2c1e49SXin LI   BT_PLUS,     /* plus sign = "+" */
706b2c1e49SXin LI   BT_COMMA,    /* comma = "," */
716b2c1e49SXin LI   BT_VERBAR    /* vertical bar = "|" */
725bb6a25fSPoul-Henning Kamp };
735bb6a25fSPoul-Henning Kamp 
745bb6a25fSPoul-Henning Kamp #include <stddef.h>
75