html.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. +----------------------------------------------------------------------+
  3. | Copyright (c) The PHP Group |
  4. +----------------------------------------------------------------------+
  5. | This source file is subject to version 3.01 of the PHP license, |
  6. | that is bundled with this package in the file LICENSE, and is |
  7. | available through the world-wide-web at the following url: |
  8. | https://www.php.net/license/3_01.txt |
  9. | If you did not receive a copy of the PHP license and are unable to |
  10. | obtain it through the world-wide-web, please send a note to |
  11. | license@php.net so we can mail you a copy immediately. |
  12. +----------------------------------------------------------------------+
  13. | Author: Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
  14. +----------------------------------------------------------------------+
  15. */
  16. #ifndef HTML_H
  17. #define HTML_H
  18. #define ENT_HTML_QUOTE_NONE 0
  19. #define ENT_HTML_QUOTE_SINGLE 1
  20. #define ENT_HTML_QUOTE_DOUBLE 2
  21. #define ENT_HTML_IGNORE_ERRORS 4
  22. #define ENT_HTML_SUBSTITUTE_ERRORS 8
  23. #define ENT_HTML_DOC_TYPE_MASK (16|32)
  24. #define ENT_HTML_DOC_HTML401 0
  25. #define ENT_HTML_DOC_XML1 16
  26. #define ENT_HTML_DOC_XHTML 32
  27. #define ENT_HTML_DOC_HTML5 (16|32)
  28. /* reserve bit 6 */
  29. #define ENT_HTML_SUBSTITUTE_DISALLOWED_CHARS 128
  30. #define ENT_COMPAT ENT_HTML_QUOTE_DOUBLE
  31. #define ENT_QUOTES (ENT_HTML_QUOTE_DOUBLE | ENT_HTML_QUOTE_SINGLE)
  32. #define ENT_NOQUOTES ENT_HTML_QUOTE_NONE
  33. #define ENT_IGNORE ENT_HTML_IGNORE_ERRORS
  34. #define ENT_SUBSTITUTE ENT_HTML_SUBSTITUTE_ERRORS
  35. #define ENT_HTML401 0
  36. #define ENT_XML1 16
  37. #define ENT_XHTML 32
  38. #define ENT_HTML5 (16|32)
  39. #define ENT_DISALLOWED 128
  40. void register_html_constants(INIT_FUNC_ARGS);
  41. PHPAPI zend_string *php_escape_html_entities(const unsigned char *old, size_t oldlen, int all, int flags, const char *hint_charset);
  42. PHPAPI zend_string *php_escape_html_entities_ex(const unsigned char *old, size_t oldlen, int all, int flags, const char *hint_charset, bool double_encode, bool quiet);
  43. PHPAPI zend_string *php_unescape_html_entities(zend_string *str, int all, int flags, const char *hint_charset);
  44. PHPAPI unsigned int php_next_utf8_char(const unsigned char *str, size_t str_len, size_t *cursor, int *status);
  45. #endif /* HTML_H */