Moriyoshi Koizumi
moriy****@users*****
2002年 10月 7日 (月) 07:00:42 JST
moriyoshi 02/10/07 07:00:42 Modified: ext/mbstring php_mb_function.h Log: added macros for compatibility Revision Changes Path 1.8 +22 -3 php4/ext/mbstring/php_mb_function.h Index: php_mb_function.h =================================================================== RCS file: /cvsroot/php-i18n/php4/ext/mbstring/php_mb_function.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- php_mb_function.h 30 Sep 2002 18:31:06 -0000 1.7 +++ php_mb_function.h 6 Oct 2002 22:00:42 -0000 1.8 @@ -8,6 +8,11 @@ #ifndef PHP_MB_FUNCTION_H #define PHP_MB_FUNCTION_H +typedef struct _php_mb_strtok_t { + char *last; + size_t nbytes_left; +} php_mb_strtok_t; + /* * encoding resolver */ @@ -326,9 +331,23 @@ PHPAPI char * php_mb_convert_kana(const char *string_val, size_t string_len, php_mb_enc *encoding, int mode, size_t *return_len TSRMLS_DC); -PHPAPI int php_mb_mbchar_bytes_ex(const char *s, const php_mb_enc *enc); - -PHPAPI char *php_mb_strtok_r_ex(char *s1, const char *s2, char **last, php_mb_enc *enc); +PHPAPI size_t php_mb_mbchar_bytes_ex(const char *s, const php_mb_enc *enc); +#define php_mb_mbchar_bytes(s) \ + php_mb_mbchar_bytes_ex(s,MBSTRG(internal_encoding_r)) + +PHPAPI char *php_mb_safe_strtok_r_ex(char *s1, size_t nbytes_s1, const char *s2, size_t nbytes_s2, php_mb_strtok_t *tok_d, php_mb_enc *enc); + +#define php_mb_strtok_r_ex(s1,s2,tok_d,enc) \ + php_mb_safe_strtok_r_ex((s1),-1,(s2),-1,(tok_d),(enc)) +#define php_mb_strtok_r(s1,s2,tok_d) \ + php_mb_strtok_r_ex((s1),(s2),(tok_d),MBSTRG(internal_encoding_r)) + +PHPAPI char *php_mb_safe_strrchr_ex(const char *s, unsigned int c, size_t nbytes, php_mb_enc *enc); + +#define php_mb_strrchr_ex(s,c,enc) \ + php_mb_safe_strrchr_ex((s),(c),-1,(enc)) +#define php_mb_strrchr(s,c) \ + php_mb_strrchr_ex((s),(c),MBSTRG(internal_encoding_r)) /* * ZEND_MULTIBYTE support