Back to index

php5  5.3.10
mbstring.h
Go to the documentation of this file.
00001 /*
00002    +----------------------------------------------------------------------+
00003    | PHP Version 5                                                        |
00004    +----------------------------------------------------------------------+
00005    | Copyright (c) 1997-2012 The PHP Group                                |
00006    +----------------------------------------------------------------------+
00007    | This source file is subject to version 3.01 of the PHP license,      |
00008    | that is bundled with this package in the file LICENSE, and is        |
00009    | available through the world-wide-web at the following url:           |
00010    | http://www.php.net/license/3_01.txt                                  |
00011    | If you did not receive a copy of the PHP license and are unable to   |
00012    | obtain it through the world-wide-web, please send a note to          |
00013    | license@php.net so we can mail you a copy immediately.               |
00014    +----------------------------------------------------------------------+
00015    | Author: Tsukada Takuya <tsukada@fminn.nagano.nagano.jp>              |
00016    +----------------------------------------------------------------------+
00017  */
00018 
00019 /* $Id: mbstring.h 321634 2012-01-01 13:15:04Z felipe $ */
00020 
00021 /*
00022  * PHP 4 Multibyte String module "mbstring" (currently only for Japanese)
00023  *
00024  * History:
00025  *   2000.5.19  Release php-4.0RC2_jstring-1.0
00026  *   2001.4.1   Release php4_jstring-1.0.91
00027  *   2001.4.30  Release php4-jstring-1.1 (contribute to The PHP Group)
00028  *   2001.5.1   Renamed from jstring to mbstring (hirokawa@php.net)
00029  */
00030 
00031 /*
00032  * PHP3 Internationalization support program.
00033  *
00034  * Copyright (c) 1999,2000 by the PHP3 internationalization team.
00035  * All rights reserved.
00036  *
00037  * See README_PHP3-i18n-ja for more detail.
00038  *
00039  * Authors:
00040  *    Hironori Sato <satoh@jpnnet.com>
00041  *    Shigeru Kanemoto <sgk@happysize.co.jp>
00042  *    Tsukada Takuya <tsukada@fminn.nagano.nagano.jp>
00043  */
00044 
00045 
00046 #ifndef _MBSTRING_H
00047 #define _MBSTRING_H
00048 
00049 #ifdef COMPILE_DL_MBSTRING
00050 #undef HAVE_MBSTRING
00051 #define HAVE_MBSTRING 1
00052 #endif
00053 
00054 #ifdef PHP_WIN32
00055 #      undef MBSTRING_API
00056 #      ifdef MBSTRING_EXPORTS
00057 #             define MBSTRING_API __declspec(dllexport)
00058 #      elif defined(COMPILE_DL_MBSTRING)
00059 #             define MBSTRING_API __declspec(dllimport)
00060 #      else
00061 #             define MBSTRING_API /* nothing special */
00062 #      endif
00063 #elif defined(__GNUC__) && __GNUC__ >= 4
00064 #      undef MBSTRING_API
00065 #      define MBSTRING_API __attribute__ ((visibility("default")))
00066 #else
00067 #      undef MBSTRING_API
00068 #      define MBSTRING_API /* nothing special */
00069 #endif
00070 
00071 
00072 #if HAVE_MBSTRING
00073 
00074 #include "libmbfl/mbfl/mbfilter.h"
00075 #include "SAPI.h"
00076 
00077 #define PHP_MBSTRING_API 20021024
00078 
00079 extern zend_module_entry mbstring_module_entry;
00080 #define mbstring_module_ptr &mbstring_module_entry
00081 
00082 PHP_MINIT_FUNCTION(mbstring);
00083 PHP_MSHUTDOWN_FUNCTION(mbstring);
00084 PHP_RINIT_FUNCTION(mbstring);
00085 PHP_RSHUTDOWN_FUNCTION(mbstring);
00086 PHP_MINFO_FUNCTION(mbstring);
00087 
00088 /* functions in php_unicode.c */
00089 PHP_FUNCTION(mb_convert_case);
00090 PHP_FUNCTION(mb_strtoupper);
00091 PHP_FUNCTION(mb_strtolower);
00092 
00093 /* php function registration */
00094 PHP_FUNCTION(mb_language);
00095 PHP_FUNCTION(mb_internal_encoding);
00096 PHP_FUNCTION(mb_http_input);
00097 PHP_FUNCTION(mb_http_output);
00098 PHP_FUNCTION(mb_detect_order);
00099 PHP_FUNCTION(mb_substitute_character);
00100 PHP_FUNCTION(mb_preferred_mime_name);
00101 PHP_FUNCTION(mb_parse_str);
00102 PHP_FUNCTION(mb_output_handler);
00103 PHP_FUNCTION(mb_strlen);
00104 PHP_FUNCTION(mb_strpos);
00105 PHP_FUNCTION(mb_strrpos);
00106 PHP_FUNCTION(mb_stripos);
00107 PHP_FUNCTION(mb_strripos);
00108 PHP_FUNCTION(mb_strstr);
00109 PHP_FUNCTION(mb_strrchr);
00110 PHP_FUNCTION(mb_stristr);
00111 PHP_FUNCTION(mb_strrichr);
00112 PHP_FUNCTION(mb_substr_count);
00113 PHP_FUNCTION(mb_substr);
00114 PHP_FUNCTION(mb_strcut);
00115 PHP_FUNCTION(mb_strwidth);
00116 PHP_FUNCTION(mb_strimwidth);
00117 PHP_FUNCTION(mb_convert_encoding);
00118 PHP_FUNCTION(mb_detect_encoding);
00119 PHP_FUNCTION(mb_list_encodings);
00120 PHP_FUNCTION(mb_encoding_aliases);
00121 PHP_FUNCTION(mb_convert_kana);
00122 PHP_FUNCTION(mb_encode_mimeheader);
00123 PHP_FUNCTION(mb_decode_mimeheader);
00124 PHP_FUNCTION(mb_convert_variables);
00125 PHP_FUNCTION(mb_encode_numericentity);
00126 PHP_FUNCTION(mb_decode_numericentity);
00127 PHP_FUNCTION(mb_send_mail);
00128 PHP_FUNCTION(mb_get_info);
00129 PHP_FUNCTION(mb_check_encoding);
00130 
00131 MBSTRING_API int php_mb_encoding_translation(TSRMLS_D);
00132 
00133 MBSTRING_API char *php_mb_safe_strrchr_ex(const char *s, unsigned int c,
00134                                     size_t nbytes, const mbfl_encoding *enc);
00135 MBSTRING_API char *php_mb_safe_strrchr(const char *s, unsigned int c,
00136                                  size_t nbytes TSRMLS_DC);
00137 MBSTRING_API char *php_mb_strrchr(const char *s, char c TSRMLS_DC);
00138 
00139 MBSTRING_API char * php_mb_convert_encoding(const char *input, size_t length,
00140                                       const char *_to_encoding,
00141                                       const char *_from_encodings,
00142                                       size_t *output_len TSRMLS_DC);
00143 
00144 MBSTRING_API int php_mb_check_encoding_list(const char *encoding_list TSRMLS_DC);
00145 
00146 MBSTRING_API size_t php_mb_mbchar_bytes_ex(const char *s, const mbfl_encoding *enc);
00147 MBSTRING_API size_t php_mb_mbchar_bytes(const char *s TSRMLS_DC);
00148 
00149 MBSTRING_API size_t php_mb_gpc_mbchar_bytes(const char *s TSRMLS_DC);
00150 
00151 MBSTRING_API int php_mb_encoding_detector_ex(const char *arg_string, int arg_length, 
00152                                                                               char *arg_list TSRMLS_DC);
00153 
00154 MBSTRING_API int php_mb_encoding_converter_ex(char **str, int *len, const char *encoding_to, 
00155                                                                                const char *encoding_from TSRMLS_DC);
00156 MBSTRING_API int php_mb_gpc_encoding_converter(char **str, int *len, int num, const char *encoding_to, const char *encoding_from TSRMLS_DC);
00157 
00158 MBSTRING_API int php_mb_gpc_encoding_detector(char **arg_string, int *arg_length, int num, char *arg_list TSRMLS_DC);
00159 
00160 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);
00161 
00162 /* internal use only */
00163 int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint new_value_length TSRMLS_DC);
00164 
00165 ZEND_BEGIN_MODULE_GLOBALS(mbstring)
00166        enum mbfl_no_language language;
00167        enum mbfl_no_encoding internal_encoding;
00168        enum mbfl_no_encoding current_internal_encoding;
00169 #ifdef ZEND_MULTIBYTE
00170        enum mbfl_no_encoding *script_encoding_list;
00171        int script_encoding_list_size;
00172 #endif /* ZEND_MULTIBYTE */
00173        enum mbfl_no_encoding http_output_encoding;
00174        enum mbfl_no_encoding current_http_output_encoding;
00175        enum mbfl_no_encoding http_input_identify;
00176        enum mbfl_no_encoding http_input_identify_get;
00177        enum mbfl_no_encoding http_input_identify_post;
00178        enum mbfl_no_encoding http_input_identify_cookie;
00179        enum mbfl_no_encoding http_input_identify_string;
00180        enum mbfl_no_encoding *http_input_list;
00181        int http_input_list_size;
00182        enum mbfl_no_encoding *detect_order_list;
00183        int detect_order_list_size;
00184        enum mbfl_no_encoding *current_detect_order_list;
00185        int current_detect_order_list_size;
00186        enum mbfl_no_encoding *default_detect_order_list;
00187        int default_detect_order_list_size;
00188        int filter_illegal_mode;
00189        int filter_illegal_substchar;
00190        int current_filter_illegal_mode;
00191        int current_filter_illegal_substchar;
00192        long func_overload;
00193        zend_bool encoding_translation;
00194        long strict_detection;
00195        long illegalchars;
00196        mbfl_buffer_converter *outconv;
00197     void *http_output_conv_mimetypes;
00198 #if HAVE_MBREGEX
00199     struct _zend_mb_regex_globals *mb_regex_globals;
00200 #endif
00201 ZEND_END_MODULE_GLOBALS(mbstring)
00202 
00203 #define MB_OVERLOAD_MAIL 1
00204 #define MB_OVERLOAD_STRING 2
00205 #define MB_OVERLOAD_REGEX 4
00206 
00207 struct mb_overload_def {
00208        int type;
00209        char *orig_func;
00210        char *ovld_func;
00211        char *save_func;
00212 };
00213 
00214 #ifdef ZTS
00215 #define MBSTRG(v) TSRMG(mbstring_globals_id, zend_mbstring_globals *, v)
00216 #else
00217 #define MBSTRG(v) (mbstring_globals.v)
00218 #endif
00219 
00220 #else  /* HAVE_MBSTRING */
00221 
00222 #define mbstring_module_ptr NULL
00223 
00224 #endif /* HAVE_MBSTRING */
00225 
00226 #define phpext_mbstring_ptr mbstring_module_ptr
00227 
00228 #endif        /* _MBSTRING_H */
00229 
00230 /*
00231  * Local variables:
00232  * tab-width: 4
00233  * c-basic-offset: 4
00234  * End:
00235  */