html.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 5 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2016 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. /* $Id$ */
  19. #ifndef HTML_H
  20. #define HTML_H
  21. #define ENT_HTML_QUOTE_NONE 0
  22. #define ENT_HTML_QUOTE_SINGLE 1
  23. #define ENT_HTML_QUOTE_DOUBLE 2
  24. #define ENT_HTML_IGNORE_ERRORS 4
  25. #define ENT_HTML_SUBSTITUTE_ERRORS 8
  26. #define ENT_HTML_DOC_TYPE_MASK (16|32)
  27. #define ENT_HTML_DOC_HTML401 0
  28. #define ENT_HTML_DOC_XML1 16
  29. #define ENT_HTML_DOC_XHTML 32
  30. #define ENT_HTML_DOC_HTML5 (16|32)
  31. /* reserve bit 6 */
  32. #define ENT_HTML_SUBSTITUTE_DISALLOWED_CHARS 128
  33. #define ENT_COMPAT ENT_HTML_QUOTE_DOUBLE
  34. #define ENT_QUOTES (ENT_HTML_QUOTE_DOUBLE | ENT_HTML_QUOTE_SINGLE)
  35. #define ENT_NOQUOTES ENT_HTML_QUOTE_NONE
  36. #define ENT_IGNORE ENT_HTML_IGNORE_ERRORS
  37. #define ENT_SUBSTITUTE ENT_HTML_SUBSTITUTE_ERRORS
  38. #define ENT_HTML401 0
  39. #define ENT_XML1 16
  40. #define ENT_XHTML 32
  41. #define ENT_HTML5 (16|32)
  42. #define ENT_DISALLOWED 128
  43. void register_html_constants(INIT_FUNC_ARGS);
  44. PHP_FUNCTION(htmlspecialchars);
  45. PHP_FUNCTION(htmlentities);
  46. PHP_FUNCTION(htmlspecialchars_decode);
  47. PHP_FUNCTION(html_entity_decode);
  48. PHP_FUNCTION(get_html_translation_table);
  49. PHPAPI char *php_escape_html_entities(unsigned char *old, size_t oldlen, size_t *newlen, int all, int flags, char *hint_charset TSRMLS_DC);
  50. PHPAPI char *php_escape_html_entities_ex(unsigned char *old, size_t oldlen, size_t *newlen, int all, int flags, char *hint_charset, zend_bool double_encode TSRMLS_DC);
  51. PHPAPI char *php_unescape_html_entities(unsigned char *old, size_t oldlen, size_t *newlen, int all, int flags, char *hint_charset TSRMLS_DC);
  52. PHPAPI unsigned int php_next_utf8_char(const unsigned char *str, size_t str_len, size_t *cursor, int *status);
  53. #endif /* HTML_H */