/Library/php53/include/php/ext/mbstring/mbstring.h

http://github.com/jyr/MNPP · C++ Header · 235 lines · 150 code · 36 blank · 49 comment · 1 complexity · 1ca0652cb76243459512a60ebe46edab MD5 · raw file

  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 5 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2011 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: mbstring.h 306939 2011-01-01 02:19:59Z felipe $ */
  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. #ifdef PHP_WIN32
  48. # undef MBSTRING_API
  49. # ifdef MBSTRING_EXPORTS
  50. # define MBSTRING_API __declspec(dllexport)
  51. # elif defined(COMPILE_DL_MBSTRING)
  52. # define MBSTRING_API __declspec(dllimport)
  53. # else
  54. # define MBSTRING_API /* nothing special */
  55. # endif
  56. #elif defined(__GNUC__) && __GNUC__ >= 4
  57. # undef MBSTRING_API
  58. # define MBSTRING_API __attribute__ ((visibility("default")))
  59. #else
  60. # undef MBSTRING_API
  61. # define MBSTRING_API /* nothing special */
  62. #endif
  63. #if HAVE_MBSTRING
  64. #include "libmbfl/mbfl/mbfilter.h"
  65. #include "SAPI.h"
  66. #define PHP_MBSTRING_API 20021024
  67. extern zend_module_entry mbstring_module_entry;
  68. #define mbstring_module_ptr &mbstring_module_entry
  69. PHP_MINIT_FUNCTION(mbstring);
  70. PHP_MSHUTDOWN_FUNCTION(mbstring);
  71. PHP_RINIT_FUNCTION(mbstring);
  72. PHP_RSHUTDOWN_FUNCTION(mbstring);
  73. PHP_MINFO_FUNCTION(mbstring);
  74. /* functions in php_unicode.c */
  75. PHP_FUNCTION(mb_convert_case);
  76. PHP_FUNCTION(mb_strtoupper);
  77. PHP_FUNCTION(mb_strtolower);
  78. /* php function registration */
  79. PHP_FUNCTION(mb_language);
  80. PHP_FUNCTION(mb_internal_encoding);
  81. PHP_FUNCTION(mb_http_input);
  82. PHP_FUNCTION(mb_http_output);
  83. PHP_FUNCTION(mb_detect_order);
  84. PHP_FUNCTION(mb_substitute_character);
  85. PHP_FUNCTION(mb_preferred_mime_name);
  86. PHP_FUNCTION(mb_parse_str);
  87. PHP_FUNCTION(mb_output_handler);
  88. PHP_FUNCTION(mb_strlen);
  89. PHP_FUNCTION(mb_strpos);
  90. PHP_FUNCTION(mb_strrpos);
  91. PHP_FUNCTION(mb_stripos);
  92. PHP_FUNCTION(mb_strripos);
  93. PHP_FUNCTION(mb_strstr);
  94. PHP_FUNCTION(mb_strrchr);
  95. PHP_FUNCTION(mb_stristr);
  96. PHP_FUNCTION(mb_strrichr);
  97. PHP_FUNCTION(mb_substr_count);
  98. PHP_FUNCTION(mb_substr);
  99. PHP_FUNCTION(mb_strcut);
  100. PHP_FUNCTION(mb_strwidth);
  101. PHP_FUNCTION(mb_strimwidth);
  102. PHP_FUNCTION(mb_convert_encoding);
  103. PHP_FUNCTION(mb_detect_encoding);
  104. PHP_FUNCTION(mb_list_encodings);
  105. PHP_FUNCTION(mb_encoding_aliases);
  106. PHP_FUNCTION(mb_convert_kana);
  107. PHP_FUNCTION(mb_encode_mimeheader);
  108. PHP_FUNCTION(mb_decode_mimeheader);
  109. PHP_FUNCTION(mb_convert_variables);
  110. PHP_FUNCTION(mb_encode_numericentity);
  111. PHP_FUNCTION(mb_decode_numericentity);
  112. PHP_FUNCTION(mb_send_mail);
  113. PHP_FUNCTION(mb_get_info);
  114. PHP_FUNCTION(mb_check_encoding);
  115. MBSTRING_API int php_mb_encoding_translation(TSRMLS_D);
  116. MBSTRING_API char *php_mb_safe_strrchr_ex(const char *s, unsigned int c,
  117. size_t nbytes, const mbfl_encoding *enc);
  118. MBSTRING_API char *php_mb_safe_strrchr(const char *s, unsigned int c,
  119. size_t nbytes TSRMLS_DC);
  120. MBSTRING_API char *php_mb_strrchr(const char *s, char c TSRMLS_DC);
  121. MBSTRING_API char * php_mb_convert_encoding(const char *input, size_t length,
  122. const char *_to_encoding,
  123. const char *_from_encodings,
  124. size_t *output_len TSRMLS_DC);
  125. MBSTRING_API int php_mb_check_encoding_list(const char *encoding_list TSRMLS_DC);
  126. MBSTRING_API size_t php_mb_mbchar_bytes_ex(const char *s, const mbfl_encoding *enc);
  127. MBSTRING_API size_t php_mb_mbchar_bytes(const char *s TSRMLS_DC);
  128. MBSTRING_API size_t php_mb_gpc_mbchar_bytes(const char *s TSRMLS_DC);
  129. MBSTRING_API int php_mb_encoding_detector_ex(const char *arg_string, int arg_length,
  130. char *arg_list TSRMLS_DC);
  131. MBSTRING_API int php_mb_encoding_converter_ex(char **str, int *len, const char *encoding_to,
  132. const char *encoding_from TSRMLS_DC);
  133. MBSTRING_API int php_mb_gpc_encoding_converter(char **str, int *len, int num, const char *encoding_to, const char *encoding_from TSRMLS_DC);
  134. MBSTRING_API int php_mb_gpc_encoding_detector(char **arg_string, int *arg_length, int num, char *arg_list TSRMLS_DC);
  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 TSRMLS_DC);
  136. /* internal use only */
  137. int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint new_value_length TSRMLS_DC);
  138. ZEND_BEGIN_MODULE_GLOBALS(mbstring)
  139. enum mbfl_no_language language;
  140. enum mbfl_no_encoding internal_encoding;
  141. enum mbfl_no_encoding current_internal_encoding;
  142. #ifdef ZEND_MULTIBYTE
  143. enum mbfl_no_encoding *script_encoding_list;
  144. int script_encoding_list_size;
  145. #endif /* ZEND_MULTIBYTE */
  146. enum mbfl_no_encoding http_output_encoding;
  147. enum mbfl_no_encoding current_http_output_encoding;
  148. enum mbfl_no_encoding http_input_identify;
  149. enum mbfl_no_encoding http_input_identify_get;
  150. enum mbfl_no_encoding http_input_identify_post;
  151. enum mbfl_no_encoding http_input_identify_cookie;
  152. enum mbfl_no_encoding http_input_identify_string;
  153. enum mbfl_no_encoding *http_input_list;
  154. int http_input_list_size;
  155. enum mbfl_no_encoding *detect_order_list;
  156. int detect_order_list_size;
  157. enum mbfl_no_encoding *current_detect_order_list;
  158. int current_detect_order_list_size;
  159. enum mbfl_no_encoding *default_detect_order_list;
  160. int default_detect_order_list_size;
  161. int filter_illegal_mode;
  162. int filter_illegal_substchar;
  163. int current_filter_illegal_mode;
  164. int current_filter_illegal_substchar;
  165. long func_overload;
  166. zend_bool encoding_translation;
  167. long strict_detection;
  168. long illegalchars;
  169. mbfl_buffer_converter *outconv;
  170. void *http_output_conv_mimetypes;
  171. #if HAVE_MBREGEX
  172. struct _zend_mb_regex_globals *mb_regex_globals;
  173. #endif
  174. ZEND_END_MODULE_GLOBALS(mbstring)
  175. #define MB_OVERLOAD_MAIL 1
  176. #define MB_OVERLOAD_STRING 2
  177. #define MB_OVERLOAD_REGEX 4
  178. struct mb_overload_def {
  179. int type;
  180. char *orig_func;
  181. char *ovld_func;
  182. char *save_func;
  183. };
  184. #ifdef ZTS
  185. #define MBSTRG(v) TSRMG(mbstring_globals_id, zend_mbstring_globals *, v)
  186. #else
  187. #define MBSTRG(v) (mbstring_globals.v)
  188. #endif
  189. #else /* HAVE_MBSTRING */
  190. #define mbstring_module_ptr NULL
  191. #endif /* HAVE_MBSTRING */
  192. #define phpext_mbstring_ptr mbstring_module_ptr
  193. #endif /* _MBSTRING_H */
  194. /*
  195. * Local variables:
  196. * tab-width: 4
  197. * c-basic-offset: 4
  198. * End:
  199. */