Tsukada
ttsuk****@users*****
2002年 5月 26日 (日) 15:13:25 JST
ttsukada 02/05/26 15:13:25 Modified: ext/mbstring php_mb_function.h Log: change the type of string length to size_t Revision Changes Path 1.5 +33 -33 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.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- php_mb_function.h 25 May 2002 16:18:37 -0000 1.4 +++ php_mb_function.h 26 May 2002 06:13:25 -0000 1.5 @@ -52,24 +52,24 @@ * encoding converter */ PHPAPI char * -_php_mb_convert_encoding(const char *string_val, int string_len, php_mb_enc *to, php_mb_enc *from, int *return_len TSRMLS_DC); +_php_mb_convert_encoding(const char *string_val, size_t string_len, php_mb_enc *to, php_mb_enc *from, size_t *return_len TSRMLS_DC); PHPAPI char * -_php_mb_det_conv_encoding(const char *input, size_t length, const char *_to_encoding, const char *_from_encodings, size_t *output_len TSRMLS_DC); +_php_mb_det_conv_encoding(const char *string_val, size_t string_len, const char *_to_encoding, const char *_from_encodings, size_t *return_len TSRMLS_DC); PHPAPI php_mb_buf * -_php_mb_convert_to_wchar(const char *string_val, int string_len, php_mb_enc *from TSRMLS_DC); +_php_mb_convert_to_wchar(const char *string_val, size_t string_len, php_mb_enc *from TSRMLS_DC); PHPAPI char * -_php_mb_convert_wchar_to_encoding(php_mb_buf *buffer, php_mb_enc *to, int *return_len TSRMLS_DC); +_php_mb_convert_wchar_to_encoding(php_mb_buf *buffer, php_mb_enc *to, size_t *return_len TSRMLS_DC); #define php_mb_convert_cstring_to_internal(string, return_len) \ _php_mb_convert_encoding(string, strlen(string), MBSTRG(internal_encoding_r), MBSTRG(cstring_encoding), return_len TSRMLS_CC) #define php_mb_convert_internal_to_cstring(string, return_len) \ _php_mb_convert_encoding(string, strlen(string), MBSTRG(cstring_encoding), MBSTRG(internal_encoding_r), return_len TSRMLS_CC) -#define php_mb_convert_encoding(input, length, to, from, output_len) \ - _php_mb_det_conv_encoding(input, length, to, from, output_len TSRMLS_CC) +#define php_mb_convert_encoding(string_val, string_len, to, from, return_len) \ + _php_mb_det_conv_encoding(string_val, string_len, to, from, return_len TSRMLS_CC) #define php_mb_convert_to_wchar(string_val, string_len, from) \ _php_mb_convert_to_wchar(string_val, string_len, from TSRMLS_CC) @@ -98,7 +98,7 @@ }; PHPAPI php_mb_bufconv * -php_mb_bufconv_create(php_mb_enc *to, php_mb_enc *from, int initsz TSRMLS_DC); +php_mb_bufconv_create(php_mb_enc *to, php_mb_enc *from, size_t initsz TSRMLS_DC); PHPAPI void php_mb_bufconv_free(php_mb_bufconv *convd TSRMLS_DC); @@ -110,20 +110,20 @@ php_mb_bufconv_clear(php_mb_bufconv *convd TSRMLS_DC); PHPAPI int -php_mb_bufconv_feed(php_mb_bufconv *convd, const char *value, int length TSRMLS_DC); +php_mb_bufconv_feed(php_mb_bufconv *convd, const char *value, size_t length TSRMLS_DC); PHPAPI int php_mb_bufconv_flush(php_mb_bufconv *convd TSRMLS_DC); PHPAPI void -php_mb_bufconv_extract(php_mb_bufconv *convd, char **value, int *length TSRMLS_DC); +php_mb_bufconv_extract(php_mb_bufconv *convd, char **value, size_t *length TSRMLS_DC); /* * detect encoding */ PHPAPI php_mb_enc * -php_mb_detect_encoding(const char *string_val, int string_len, php_mb_enc **list, int listsize TSRMLS_DC); +php_mb_detect_encoding(const char *string_val, size_t string_len, php_mb_enc **list, int listsize TSRMLS_DC); /* @@ -146,7 +146,7 @@ php_mb_detector_reset(php_mb_detector *identd TSRMLS_DC); PHPAPI int -php_mb_detector_feed(php_mb_detector *identd, const char *value, int length TSRMLS_DC); +php_mb_detector_feed(php_mb_detector *identd, const char *value, size_t length TSRMLS_DC); PHPAPI int php_mb_detector_lastcount(php_mb_detector *identd TSRMLS_DC); @@ -158,8 +158,8 @@ /* * strlen */ -PHPAPI int -_php_mb_strlen(const char *string_val, int string_len, php_mb_enc *encoding TSRMLS_DC); +PHPAPI size_t +_php_mb_strlen(const char *string_val, size_t string_len, php_mb_enc *encoding TSRMLS_DC); #define php_mb_strlen(string) _php_mb_strlen(string, strlen(string), MBSTRG(internal_encoding_r) TSRMLS_CC) #define php_mb_strlen_ex(string, encoding) _php_mb_strlen(Z_STRVAL_PP(string), Z_STRLEN_PP(string), encoding TSRMLS_CC) @@ -167,8 +167,8 @@ /* * strpos */ -PHPAPI int -_php_mb_strpos(const char *haystack, int haystack_len, const char *needle, int needle_len, php_mb_enc *encoding, int offset, int reverse TSRMLS_DC); +PHPAPI size_t +_php_mb_strpos(const char *haystack, size_t haystack_len, const char *needle, size_t needle_len, php_mb_enc *encoding, size_t offset, int reverse TSRMLS_DC); #define php_mb_strpos(haystack, needle, offset) \ _php_mb_strpos(haystack, strlen(haystack), needle, strlen(needle), MBSTRG(internal_encoding_r), offset, 0 TSRMLS_CC) @@ -184,13 +184,13 @@ * replace */ PHPAPI char * -_php_mb_replace(const char *search, int search_len, const char *replace, int replace_len, const char *subject, int subject_len, php_mb_enc *encoding, int *return_len TSRMLS_DC); +_php_mb_replace(const char *search, size_t search_len, const char *replace, size_t replace_len, const char *subject, size_t subject_len, php_mb_enc *encoding, size_t *return_len TSRMLS_DC); /* * substr */ PHPAPI char * -_php_mb_substr(const char *string_val, int string_len, php_mb_enc *encoding, int start, int count, int *return_len TSRMLS_DC); +_php_mb_substr(const char *string_val, size_t string_len, php_mb_enc *encoding, size_t start, size_t count, size_t *return_len TSRMLS_DC); #define php_mb_substr(string, start, count, return_len) \ _php_mb_substr(string, strlen(string), MBSTRG(internal_encoding_r), start, count, return_len TSRMLS_CC) @@ -201,7 +201,7 @@ * strcut */ PHPAPI char * -_php_mb_strcut(const char *string_val, int string_len, php_mb_enc *encoding, int start, int size, int *return_len TSRMLS_DC); +_php_mb_strcut(const char *string_val, size_t string_len, php_mb_enc *encoding, size_t start, size_t size, size_t *return_len TSRMLS_DC); #define php_mb_strcut(string, start, size, return_len) \ _php_mb_strcut(string, strlen(string), MBSTRG(internal_encoding_r), start, size, return_len TSRMLS_CC) @@ -211,8 +211,8 @@ /* * strwidth */ -PHPAPI int -_php_mb_strwidth(const char *string_val, int string_len, php_mb_enc *encoding TSRMLS_DC); +PHPAPI size_t +_php_mb_strwidth(const char *string_val, size_t string_len, php_mb_enc *encoding TSRMLS_DC); #define php_mb_strwidth(string) _php_mb_strwidth(string, strlen(string), MBSTRG(internal_encoding_r) TSRMLS_CC) #define php_mb_strwidth_ex(string, encoding) _php_mb_strwidth(Z_STRVAL_PP(string), Z_STRLEN_PP(string), encoding TSRMLS_CC) @@ -221,7 +221,7 @@ * strimwidth */ PHPAPI char * -_php_mb_strimwidth(const char *string_val, int string_len, const char *marker_val, int marker_len, php_mb_enc *encoding, int start, int width, int *return_len TSRMLS_DC); +_php_mb_strimwidth(const char *string_val, size_t string_len, const char *marker_val, size_t marker_len, php_mb_enc *encoding, size_t start, size_t width, size_t *return_len TSRMLS_DC); /* @@ -240,8 +240,8 @@ php_mb_str *strlwsp; int status1; int status2; - int linehead; - int firstindent; + size_t linehead; + size_t firstindent; }; @@ -252,10 +252,10 @@ _php_mb_mime_header_encoder_free(php_mb_mime_header_encoder *encoder TSRMLS_DC); PHPAPI char * -_php_mb_mime_header_encoder_result(php_mb_mime_header_encoder *encoder, int *return_len TSRMLS_DC); +_php_mb_mime_header_encoder_result(php_mb_mime_header_encoder *encoder, size_t *return_len TSRMLS_DC); PHPAPI char * -_php_mb_mime_header_encode(const char *string_val, int string_len, php_mb_enc *string_enc, php_mb_enc *charset, php_mb_enc *transfer, const char *linefeed, int indent, int *return_len TSRMLS_DC); +_php_mb_mime_header_encode(const char *string_val, size_t string_len, php_mb_enc *string_enc, php_mb_enc *charset, php_mb_enc *transfer, const char *linefeed, size_t indent, size_t *return_len TSRMLS_DC); #define php_mb_mime_header_encoder_create() \ _php_mb_mime_header_encoder_create( \ @@ -298,10 +298,10 @@ _php_mb_mime_header_decoder_free(php_mb_mime_header_decoder *decoder TSRMLS_DC); PHPAPI char * -_php_mb_mime_header_decoder_result(php_mb_mime_header_decoder *decoder, int *return_len TSRMLS_DC); +_php_mb_mime_header_decoder_result(php_mb_mime_header_decoder *decoder, size_t *return_len TSRMLS_DC); PHPAPI char * -_php_mb_mime_header_decode(const char *string_val, int string_len, php_mb_enc *output_enc, int *return_len TSRMLS_DC); +_php_mb_mime_header_decode(const char *string_val, size_t string_len, php_mb_enc *output_enc, size_t *return_len TSRMLS_DC); #define php_mb_mime_header_decoder_create(output_enc) _php_mb_mime_header_decoder_create(output_enc TSRMLS_CC) #define php_mb_mime_header_decoder_free(decoder) _php_mb_mime_header_decoder_free(decoder TSRMLS_CC) @@ -314,7 +314,7 @@ * convert HTML numeric entity */ PHPAPI char * -_php_mb_html_numeric_entity(const char *string_val, int string_len, php_mb_enc *encoding, int *convmap, int mapsize, int type, int *return_len TSRMLS_DC); +_php_mb_html_numeric_entity(const char *string_val, size_t string_len, php_mb_enc *encoding, int *convmap, int mapsize, int type, size_t *return_len TSRMLS_DC); #define php_mb_html_numeric_entity_ex(string, encoding, convmap, mapsize, type, return_len) \ _php_mb_html_numeric_entity(Z_STRVAL_PP(string), Z_STRLEN_PP(string), encoding, convmap, mapsize, type, return_len TSRMLS_CC) @@ -324,7 +324,7 @@ * convert of harfwidth and fullwidth for Japanese */ PHPAPI char * -php_mb_convert_kana(const char *string_val, int string_len, php_mb_enc *encoding, int mode, int *return_len TSRMLS_DC); +php_mb_convert_kana(const char *string_val, size_t string_len, php_mb_enc *encoding, int mode, size_t *return_len TSRMLS_DC); /* @@ -332,11 +332,11 @@ */ #ifdef ZEND_MULTIBYTE PHPAPI int php_mbstring_set_zend_encoding(TSRMLS_D); -char* php_mbstring_encoding_detector(char *string, int length, char *list TSRMLS_DC); -int php_mbstring_encoding_converter(char **to, int *to_length, char *from, - int from_length, const char *encoding_to, const char *encoding_from +char* php_mbstring_encoding_detector(char *string, size_t length, char *list TSRMLS_DC); +int php_mbstring_encoding_converter(char **to, size_t *to_length, char *from, + size_t from_length, const char *encoding_to, const char *encoding_from TSRMLS_DC); -int php_mbstring_oddlen(char *string, int length, const char *encoding TSRMLS_DC); +int php_mbstring_oddlen(char *string, size_t length, const char *encoding TSRMLS_DC); #endif /* ZEND_MULTIBYTE */ #endif /* PHP_MB_FUNCTION_H */