xmltok_impl.h 3.3 KB

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