* Rui Hirokawa <rui_hirokawa@ybb.ne.jp>
*/
-
+/* {{{ includes */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#if HAVE_MBREGEX
#include "mbregex.h"
#endif
+/* }}} */
#ifdef ZTS
MUTEX_T mbregex_locale_mutex = NULL;
#endif
+/* {{{ php_mbstr_default_identify_list[] */
#if defined(HAVE_MBSTR_JA)
static const enum mbfl_no_encoding php_mbstr_default_identify_list[] = {
mbfl_no_encoding_ascii,
};
#endif
-
#if defined(HAVE_MBSTR_CN) & !defined(HAVE_MBSTR_JA)
static const enum mbfl_no_encoding php_mbstr_default_identify_list[] = {
mbfl_no_encoding_ascii,
#endif
static const int php_mbstr_default_identify_list_size = sizeof(php_mbstr_default_identify_list)/sizeof(enum mbfl_no_encoding);
+/* }}} */
static const unsigned char third_and_rest_force_ref[] = { 3, BYREF_NONE, BYREF_NONE, BYREF_FORCE_REST };
static const unsigned char second_args_force_ref[] = { 2, BYREF_NONE, BYREF_FORCE };
static const unsigned char third_argument_force_ref[] = { 3, BYREF_NONE, BYREF_NONE, BYREF_FORCE };
#endif
+/* {{{ sapi_post_entry mbstr_post_entries[] */
static sapi_post_entry mbstr_post_entries[] = {
{ DEFAULT_POST_CONTENT_TYPE, sizeof(DEFAULT_POST_CONTENT_TYPE)-1, sapi_read_standard_form_data, php_mbstr_post_handler },
{ MULTIPART_CONTENT_TYPE, sizeof(MULTIPART_CONTENT_TYPE)-1, NULL, rfc1867_post_handler },
{ NULL, 0, NULL, NULL }
};
+/* }}} */
+/* {{{ sapi_post_entry php_post_entries[] */
static sapi_post_entry php_post_entries[] = {
{ DEFAULT_POST_CONTENT_TYPE, sizeof(DEFAULT_POST_CONTENT_TYPE)-1, sapi_read_standard_form_data, php_std_post_handler },
{ MULTIPART_CONTENT_TYPE, sizeof(MULTIPART_CONTENT_TYPE)-1, NULL, rfc1867_post_handler },
{ NULL, 0, NULL, NULL }
};
+/* }}} */
+/* {{{ mb_overload_def mb_ovld[] */
static const struct mb_overload_def mb_ovld[] = {
{MB_OVERLOAD_MAIL, "mail", "mb_send_mail", "mb_orig_mail"},
{MB_OVERLOAD_STRING, "strlen", "mb_strlen", "mb_orig_strlen"},
#endif
{0, NULL, NULL, NULL}
};
+/* }}} */
#if HAVE_MBREGEX
struct def_mbctype_tbl {
};
#endif
+/* {{{ function_entry mbstring_functions[] */
function_entry mbstring_functions[] = {
PHP_FE(mb_convert_case, NULL)
PHP_FE(mb_strtoupper, NULL)
#endif
{ NULL, NULL, NULL }
};
+/* }}} */
+/* {{{ zend_module_entry mbstring_module_entry */
zend_module_entry mbstring_module_entry = {
STANDARD_MODULE_HEADER,
"mbstring",
NO_VERSION_YET,
STANDARD_MODULE_PROPERTIES
};
+/* }}} */
ZEND_DECLARE_MODULE_GLOBALS(mbstring)
ZEND_GET_MODULE(mbstring)
#endif
-
-/* Return 0 if input contains any illegal encoding, otherwise 1.
+/* {{{ static int php_mb_parse_encoding_list()
+ * Return 0 if input contains any illegal encoding, otherwise 1.
* Even if any illegal encoding is detected the result may contain a list
* of parsed encodings.
*/
return ret;
}
+/* }}} */
-/* {{{ php_mb_check_encoding_list */
+/* {{{ PHPAPI php_mb_check_encoding_list */
PHPAPI int php_mb_check_encoding_list(const char *encoding_list TSRMLS_DC) {
return php_mb_parse_encoding_list(encoding_list, strlen(encoding_list), NULL, NULL, 0);
}
/* }}} */
-/* Return 0 if input contains any illegal encoding, otherwise 1.
+/* {{{ php_mb_parse_encoding_array
+ * Return 0 if input contains any illegal encoding, otherwise 1.
* Even if any illegal encoding is detected the result may contain a list
* of parsed encodings.
*/
return ret;
}
+/* }}} */
#if HAVE_MBREGEX
+/* {{{ php_mbregex_free_cache */
static void
php_mbregex_free_cache(mb_regex_t *pre)
{
mbre_free_pattern(pre);
}
-
+/* }}} */
#endif
-/* php.ini directive handler */
+/* {{{ php.ini directive handler */
static PHP_INI_MH(OnUpdate_mbstring_language)
{
enum mbfl_no_language no_language;
}
return SUCCESS;
}
+/* }}} */
+/* {{{ static PHP_INI_MH(OnUpdate_mbstring_detect_order) */
static PHP_INI_MH(OnUpdate_mbstring_detect_order)
{
int *list, size;
return SUCCESS;
}
+/* }}} */
+/* {{{ static PHP_INI_MH(OnUpdate_mbstring_http_input) */
static PHP_INI_MH(OnUpdate_mbstring_http_input)
{
int *list, size;
return SUCCESS;
}
+/* }}} */
-
+/* {{{ static PHP_INI_MH(OnUpdate_mbstring_http_output) */
static PHP_INI_MH(OnUpdate_mbstring_http_output)
{
enum mbfl_no_encoding no_encoding;
return SUCCESS;
}
+/* }}} */
+/* {{{ static PHP_INI_MH(OnUpdate_mbstring_internal_encoding) */
static PHP_INI_MH(OnUpdate_mbstring_internal_encoding)
{
enum mbfl_no_encoding no_encoding;
return SUCCESS;
}
+/* }}} */
+/* {{{ ZEND_MULTIBYTE stuff */
#ifdef ZEND_MULTIBYTE
static PHP_INI_MH(OnUpdate_mbstring_script_encoding)
{
return SUCCESS;
}
#endif /* ZEND_MULTIBYTE */
+/* }}} */
+/* {{{ static PHP_INI_MH(OnUpdate_mbstring_substitute_character) */
static PHP_INI_MH(OnUpdate_mbstring_substitute_character)
{
if (new_value != NULL) {
return SUCCESS;
}
+/* }}} */
+/* {{{ static PHP_INI_MH(OnUpdate_mbstring_encoding_translation) */
static PHP_INI_MH(OnUpdate_mbstring_encoding_translation)
{
if (new_value == NULL) {
return SUCCESS;
}
+/* }}} */
-/* php.ini directive registration */
+/* {{{ php.ini directive registration */
PHP_INI_BEGIN()
PHP_INI_ENTRY("mbstring.language", NULL, PHP_INI_SYSTEM | PHP_INI_PERDIR, OnUpdate_mbstring_language)
PHP_INI_ENTRY("mbstring.detect_order", NULL, PHP_INI_ALL, OnUpdate_mbstring_detect_order)
PHP_INI_SYSTEM | PHP_INI_PERDIR, OnUpdate_mbstring_encoding_translation,
encoding_translation, zend_mbstring_globals, mbstring_globals)
PHP_INI_END()
+/* }}} */
-
-/* module global initialize handler */
+/* {{{ module global initialize handler */
static void
php_mb_init_globals(zend_mbstring_globals *pglobals TSRMLS_DC)
{
MBSTRG(search_regs) = (struct mbre_registers*)0;
#endif
}
+/* }}} */
+/* {{{ static void mbstring_globals_dtor() */
static void
mbstring_globals_dtor(zend_mbstring_globals *pglobals TSRMLS_DC)
{
zend_hash_destroy(&MBSTRG(ht_rc));
#endif
}
+/* }}} */
+/* {{{ PHP_MINIT_FUNCTION(mbstring) */
PHP_MINIT_FUNCTION(mbstring)
{
#ifdef ZTS
#endif
return SUCCESS;
}
+/* }}} */
-
+/* {{{ PHP_MSHUTDOWN_FUNCTION(mbstring) */
PHP_MSHUTDOWN_FUNCTION(mbstring)
{
UNREGISTER_INI_ENTRIES();
return SUCCESS;
}
+/* }}} */
-
+/* {{{ PHP_RINIT_FUNCTION(mbstring) */
PHP_RINIT_FUNCTION(mbstring)
{
int n, *list=NULL, *entry;
return SUCCESS;
}
+/* }}} */
-
+/* {{{ PHP_RSHUTDOWN_FUNCTION(mbstring) */
PHP_RSHUTDOWN_FUNCTION(mbstring)
{
const struct mb_overload_def *p;
return SUCCESS;
}
+/* }}} */
-
+/* {{{ PHP_MINFO_FUNCTION(mbstring) */
PHP_MINFO_FUNCTION(mbstring)
{
php_info_print_table_start();
DISPLAY_INI_ENTRIES();
}
-
+/* }}} */
/* {{{ proto string mb_language([string language])
}
/* }}} */
+/* {{{ static void php_mbstr_encoding_handler() */
static void
php_mbstr_encoding_handler(zval *arg, char *res, char *separator TSRMLS_DC)
{
}
}
+/* }}} */
+/* {{{ SAPI_POST_HANDLER_FUNC(php_mbstr_post_handler) */
SAPI_POST_HANDLER_FUNC(php_mbstr_post_handler)
{
MBSTRG(http_input_identify_post) = mbfl_no_encoding_invalid;
MBSTRG(http_input_identify_post) = MBSTRG(http_input_identify);
}
}
-
+/* }}} */
#define IS_SJIS1(c) ((((c)>=0x81 && (c)<=0x9f) || ((c)>=0xe0 && (c)<=0xf5)) ? 1 : 0)
#define IS_SJIS2(c) ((((c)>=0x40 && (c)<=0x7e) || ((c)>=0x80 && (c)<=0xfc)) ? 1 : 0)
+/* {{{ char *mbstr_strrchr() */
char *mbstr_strrchr(const char *s, char c TSRMLS_DC){
unsigned char *p = (unsigned char *)s, *last = NULL;
while(*p++) {
}
return last;
}
+/* }}} */
+/* {{{ PHPAPI int php_mb_is_mb_leadbyte() */
PHPAPI int php_mb_is_mb_leadbyte(const char *s TSRMLS_DC){
unsigned char *p = (unsigned char *)s;
if (MBSTRG(current_language) == mbfl_no_language_japanese
}
return 0;
}
+/* }}} */
-/* http input processing */
+/* {{{ SAPI_API SAPI_TREAT_DATA_FUNC(mbstr_treat_data)
+ * http input processing */
SAPI_API SAPI_TREAT_DATA_FUNC(mbstr_treat_data)
{
char *res = NULL, *separator=NULL;
efree(res);
}
}
+/* }}} */
/* {{{ proto bool mb_parse_str(string encoded_string [, array result])
Parses GET/POST/COOKIE data and sets global variables */
/* }}} */
-/* HTML numeric entity */
+/* {{{ HTML numeric entity */
+/* {{{ static void php_mbstr_numericentity_exec() */
static void
php_mbstr_numericentity_exec(INTERNAL_FUNCTION_PARAMETERS, int type)
{
}
efree((void *)convmap);
}
+/* }}} */
/* {{{ proto string mb_encode_numericentity(string string, array convmap [, string encoding])
Converts specified characters to HTML numeric entities */
}
/* }}} */
+/* }}} */
-
-#if HAVE_SENDMAIL
/* {{{ proto int mb_send_mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]])
- Sends an email message with MIME scheme */
+ * Sends an email message with MIME scheme
+ */
+#if HAVE_SENDMAIL
PHP_FUNCTION(mb_send_mail)
{
int argc, n;
}
mbfl_memory_device_clear(&device TSRMLS_CC);
}
-/* }}} */
#else /* HAVE_SENDMAIL */
#endif /* HAVE_SENDMAIL */
+/* }}} */
+
/* {{{ proto string mb_get_info([string type])
Returns the current settings of mbstring */
PHP_FUNCTION(mb_get_info)
}
/* }}} */
+/* {{{ PHPAPI int php_mb_encoding_translation() */
PHPAPI int php_mb_encoding_translation(TSRMLS_D)
{
return MBSTRG(encoding_translation);
}
+/* }}} */
#ifdef ZEND_MULTIBYTE
+/* {{{ PHPAPI int php_mb_set_zend_encoding() */
PHPAPI int php_mb_set_zend_encoding(TSRMLS_D)
{
/* 'd better use mbfl_memory_device? */
return 0;
}
+/* }}} */
-/*
- * mb_detect_encoding (interface for Zend Engine)
+/* {{{ char *php_mb_encoding_detector()
+ * Interface for Zend Engine
*/
char* php_mb_encoding_detector(const char *arg_string, int arg_length, char *arg_list TSRMLS_DC)
{
return NULL;
}
}
+/* }}} */
-
-/*
- * mb_convert_encoding (interface for Zend Engine)
- */
+/* {{{ int php_mb_encoding_converter() */
int php_mb_encoding_converter(char **to, int *to_length, const char *from,
int from_length, const char *encoding_to, const char *encoding_from
TSRMLS_DC)
return ret ? 0 : -1;
}
+/* }}} */
-
-/*
+/* {{{ int php_mb_oddlen()
* returns number of odd (e.g. appears only first byte of multibyte
* character) chars
*/
return mbfl_oddlen(&mb_string);
}
-
+/* }}} */
#endif /* ZEND_MULTIBYTE */
#endif /* HAVE_MBSTRING */
* tab-width: 4
* c-basic-offset: 4
* End:
+ * vim600: fdm=marker
+ * vim: noet sw=4 ts=4
*/