html.h 2.6 KB

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