PageRenderTime 25ms CodeModel.GetById 31ms RepoModel.GetById 0ms app.codeStats 0ms

/release/src-rt-6.x.4708/router/php/ext/mbstring/mbstring.h

https://bitbucket.org/oglop/tomato-arm-kille72
C Header | 231 lines | 147 code | 35 blank | 49 comment | 2 complexity | 5e9d19036719c0c76e4172f4cc7fb6e2 MD5 | raw file
Possible License(s): LGPL-2.0, LGPL-3.0, MPL-2.0-no-copyleft-exception, 0BSD, BSD-3-Clause, WTFPL, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, GPL-2.0
  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: Tsukada Takuya <tsukada@fminn.nagano.nagano.jp> |
  16. +----------------------------------------------------------------------+
  17. */
  18. /* $Id$ */
  19. /*
  20. * PHP 4 Multibyte String module "mbstring" (currently only for Japanese)
  21. *
  22. * History:
  23. * 2000.5.19 Release php-4.0RC2_jstring-1.0
  24. * 2001.4.1 Release php4_jstring-1.0.91
  25. * 2001.4.30 Release php4-jstring-1.1 (contribute to The PHP Group)
  26. * 2001.5.1 Renamed from jstring to mbstring (hirokawa@php.net)
  27. */
  28. /*
  29. * PHP3 Internationalization support program.
  30. *
  31. * Copyright (c) 1999,2000 by the PHP3 internationalization team.
  32. * All rights reserved.
  33. *
  34. * See README_PHP3-i18n-ja for more detail.
  35. *
  36. * Authors:
  37. * Hironori Sato <satoh@jpnnet.com>
  38. * Shigeru Kanemoto <sgk@happysize.co.jp>
  39. * Tsukada Takuya <tsukada@fminn.nagano.nagano.jp>
  40. */
  41. #ifndef _MBSTRING_H
  42. #define _MBSTRING_H
  43. #ifdef COMPILE_DL_MBSTRING
  44. #undef HAVE_MBSTRING
  45. #define HAVE_MBSTRING 1
  46. #endif
  47. #include "php_version.h"
  48. #define PHP_MBSTRING_VERSION PHP_VERSION
  49. #ifdef PHP_WIN32
  50. # undef MBSTRING_API
  51. # ifdef MBSTRING_EXPORTS
  52. # define MBSTRING_API __declspec(dllexport)
  53. # elif defined(COMPILE_DL_MBSTRING)
  54. # define MBSTRING_API __declspec(dllimport)
  55. # else
  56. # define MBSTRING_API /* nothing special */
  57. # endif
  58. #elif defined(__GNUC__) && __GNUC__ >= 4
  59. # undef MBSTRING_API
  60. # define MBSTRING_API __attribute__ ((visibility("default")))
  61. #else
  62. # undef MBSTRING_API
  63. # define MBSTRING_API /* nothing special */
  64. #endif
  65. #if HAVE_MBSTRING
  66. #include "libmbfl/mbfl/mbfilter.h"
  67. #include "SAPI.h"
  68. #define PHP_MBSTRING_API 20021024
  69. extern zend_module_entry mbstring_module_entry;
  70. #define mbstring_module_ptr &mbstring_module_entry
  71. PHP_MINIT_FUNCTION(mbstring);
  72. PHP_MSHUTDOWN_FUNCTION(mbstring);
  73. PHP_RINIT_FUNCTION(mbstring);
  74. PHP_RSHUTDOWN_FUNCTION(mbstring);
  75. PHP_MINFO_FUNCTION(mbstring);
  76. /* functions in php_unicode.c */
  77. PHP_FUNCTION(mb_convert_case);
  78. PHP_FUNCTION(mb_strtoupper);
  79. PHP_FUNCTION(mb_strtolower);
  80. /* php function registration */
  81. PHP_FUNCTION(mb_language);
  82. PHP_FUNCTION(mb_internal_encoding);
  83. PHP_FUNCTION(mb_http_input);
  84. PHP_FUNCTION(mb_http_output);
  85. PHP_FUNCTION(mb_detect_order);
  86. PHP_FUNCTION(mb_substitute_character);
  87. PHP_FUNCTION(mb_preferred_mime_name);
  88. PHP_FUNCTION(mb_parse_str);
  89. PHP_FUNCTION(mb_output_handler);
  90. PHP_FUNCTION(mb_strlen);
  91. PHP_FUNCTION(mb_strpos);
  92. PHP_FUNCTION(mb_strrpos);
  93. PHP_FUNCTION(mb_stripos);
  94. PHP_FUNCTION(mb_strripos);
  95. PHP_FUNCTION(mb_strstr);
  96. PHP_FUNCTION(mb_strrchr);
  97. PHP_FUNCTION(mb_stristr);
  98. PHP_FUNCTION(mb_strrichr);
  99. PHP_FUNCTION(mb_substr_count);
  100. PHP_FUNCTION(mb_substr);
  101. PHP_FUNCTION(mb_strcut);
  102. PHP_FUNCTION(mb_strwidth);
  103. PHP_FUNCTION(mb_strimwidth);
  104. PHP_FUNCTION(mb_convert_encoding);
  105. PHP_FUNCTION(mb_detect_encoding);
  106. PHP_FUNCTION(mb_list_encodings);
  107. PHP_FUNCTION(mb_encoding_aliases);
  108. PHP_FUNCTION(mb_convert_kana);
  109. PHP_FUNCTION(mb_encode_mimeheader);
  110. PHP_FUNCTION(mb_decode_mimeheader);
  111. PHP_FUNCTION(mb_convert_variables);
  112. PHP_FUNCTION(mb_encode_numericentity);
  113. PHP_FUNCTION(mb_decode_numericentity);
  114. PHP_FUNCTION(mb_send_mail);
  115. PHP_FUNCTION(mb_get_info);
  116. PHP_FUNCTION(mb_check_encoding);
  117. PHP_FUNCTION(mb_ord);
  118. PHP_FUNCTION(mb_chr);
  119. PHP_FUNCTION(mb_scrub);
  120. MBSTRING_API char *php_mb_safe_strrchr_ex(const char *s, unsigned int c,
  121. size_t nbytes, const mbfl_encoding *enc);
  122. MBSTRING_API char *php_mb_safe_strrchr(const char *s, unsigned int c,
  123. size_t nbytes);
  124. MBSTRING_API char * php_mb_convert_encoding(const char *input, size_t length,
  125. const char *_to_encoding,
  126. const char *_from_encodings,
  127. size_t *output_len);
  128. MBSTRING_API int php_mb_check_encoding_list(const char *encoding_list);
  129. MBSTRING_API size_t php_mb_mbchar_bytes_ex(const char *s, const mbfl_encoding *enc);
  130. MBSTRING_API size_t php_mb_mbchar_bytes(const char *s);
  131. MBSTRING_API int php_mb_encoding_detector_ex(const char *arg_string, int arg_length,
  132. char *arg_list);
  133. MBSTRING_API int php_mb_encoding_converter_ex(char **str, int *len, const char *encoding_to,
  134. const char *encoding_from);
  135. MBSTRING_API int php_mb_stripos(int mode, const char *old_haystack, unsigned int old_haystack_len, const char *old_needle, unsigned int old_needle_len, long offset, const char *from_encoding);
  136. MBSTRING_API int php_mb_check_encoding(const char *input, size_t length, const char *enc);
  137. /* internal use only */
  138. int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint32_t new_value_length);
  139. ZEND_BEGIN_MODULE_GLOBALS(mbstring)
  140. char *internal_encoding_name;
  141. enum mbfl_no_language language;
  142. const mbfl_encoding *internal_encoding;
  143. const mbfl_encoding *current_internal_encoding;
  144. const mbfl_encoding *http_output_encoding;
  145. const mbfl_encoding *current_http_output_encoding;
  146. const mbfl_encoding *http_input_identify;
  147. const mbfl_encoding *http_input_identify_get;
  148. const mbfl_encoding *http_input_identify_post;
  149. const mbfl_encoding *http_input_identify_cookie;
  150. const mbfl_encoding *http_input_identify_string;
  151. const mbfl_encoding **http_input_list;
  152. size_t http_input_list_size;
  153. const mbfl_encoding **detect_order_list;
  154. size_t detect_order_list_size;
  155. const mbfl_encoding **current_detect_order_list;
  156. size_t current_detect_order_list_size;
  157. enum mbfl_no_encoding *default_detect_order_list;
  158. size_t default_detect_order_list_size;
  159. int filter_illegal_mode;
  160. int filter_illegal_substchar;
  161. int current_filter_illegal_mode;
  162. int current_filter_illegal_substchar;
  163. long func_overload;
  164. zend_bool encoding_translation;
  165. long strict_detection;
  166. long illegalchars;
  167. mbfl_buffer_converter *outconv;
  168. void *http_output_conv_mimetypes;
  169. #if HAVE_MBREGEX
  170. struct _zend_mb_regex_globals *mb_regex_globals;
  171. #endif
  172. ZEND_END_MODULE_GLOBALS(mbstring)
  173. #define MB_OVERLOAD_MAIL 1
  174. #define MB_OVERLOAD_STRING 2
  175. #define MB_OVERLOAD_REGEX 4
  176. struct mb_overload_def {
  177. int type;
  178. char *orig_func;
  179. char *ovld_func;
  180. char *save_func;
  181. };
  182. #define MBSTRG(v) ZEND_MODULE_GLOBALS_ACCESSOR(mbstring, v)
  183. #if defined(ZTS) && defined(COMPILE_DL_MBSTRING)
  184. ZEND_TSRMLS_CACHE_EXTERN()
  185. #endif
  186. #else /* HAVE_MBSTRING */
  187. #define mbstring_module_ptr NULL
  188. #endif /* HAVE_MBSTRING */
  189. #define phpext_mbstring_ptr mbstring_module_ptr
  190. #endif /* _MBSTRING_H */
  191. /*
  192. * Local variables:
  193. * tab-width: 4
  194. * c-basic-offset: 4
  195. * End:
  196. */