Tsukada
ttsuk****@users*****
2002年 5月 23日 (木) 05:15:39 JST
ttsukada 02/05/23 05:15:39 Modified: ext/mbstring string.c Log: MBFL update Revision Changes Path 1.3 +15 -15 php4/ext/mbstring/string.c Index: string.c =================================================================== RCS file: /cvsroot/php-i18n/php4/ext/mbstring/string.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- string.c 21 May 2002 20:37:26 -0000 1.2 +++ string.c 22 May 2002 20:15:39 -0000 1.3 @@ -7,7 +7,6 @@ #include "php.h" #include "php_mb.h" -#include "php_mb_str.h" PHPAPI php_mb_str * @@ -21,7 +20,8 @@ string = emalloc(sizeof(php_mb_str)); } if (string != NULL) { - string->encoding = MBG(internal_encoding_r); + PHP_MB_STR_TSRMLS_SET(string); + string->encoding = MBSTRG(internal_encoding_r); string->value = NULL; string->length = 0; string->size = 0; @@ -35,7 +35,7 @@ string->memory_type_self = PHP_MB_MEMORY_TYPE_DALLOC; } } else { - MBG(last_errno) = PHP_MB_ERR_NO_MEMORY; + MBSTRG(last_errno) = PHP_MB_ERR_NO_MEMORY; } return string; @@ -96,14 +96,14 @@ unsigned char *tmp; if (size < 0) { - MBG(last_errno) = PHP_MB_ERR_ILLEGAL_ARGUMENT; + MBSTRG(last_errno) = PHP_MB_ERR_ILLEGAL_ARGUMENT; return FAILURE; } if (string->size >= size) { return SUCCESS; } if (string->memory_type_value == PHP_MB_MEMORY_TYPE_CONST) { - MBG(last_errno) = PHP_MB_ERR_STRING_OVER_FLOW; + MBSTRG(last_errno) = PHP_MB_ERR_STRING_OVER_FLOW; return FAILURE; } @@ -114,7 +114,7 @@ tmp = erealloc(string->value, size*sizeof(unsigned char)); } if (tmp == NULL) { - MBG(last_errno) = PHP_MB_ERR_NO_MEMORY; + MBSTRG(last_errno) = PHP_MB_ERR_NO_MEMORY; return FAILURE; } string->size = size; @@ -140,7 +140,7 @@ if ((string->length + len) > string->size) { /* reallocate buffer */ if (string->memory_type_value == PHP_MB_MEMORY_TYPE_CONST) { - MBG(last_errno) = PHP_MB_ERR_STRING_OVER_FLOW; + MBSTRG(last_errno) = PHP_MB_ERR_STRING_OVER_FLOW; if (string->value != NULL) { string->value[string->size - 1] = '\0'; } @@ -154,7 +154,7 @@ p = erealloc(string->value, n*sizeof(unsigned char)); } if (p == NULL) { - MBG(last_errno) = PHP_MB_ERR_NO_MEMORY; + MBSTRG(last_errno) = PHP_MB_ERR_NO_MEMORY; if (string->value != NULL) { string->value[string->size - 1] = '\0'; } @@ -177,7 +177,7 @@ _php_mb_str_append_cstr(php_mb_str *string, const char *src, int length TSRMLS_DC) { if (length < 0) { - MBG(last_errno) = PHP_MB_ERR_ILLEGAL_ARGUMENT; + MBSTRG(last_errno) = PHP_MB_ERR_ILLEGAL_ARGUMENT; return FAILURE; } @@ -187,7 +187,7 @@ unsigned char *tmp; if (string->memory_type_value == PHP_MB_MEMORY_TYPE_CONST) { - MBG(last_errno) = PHP_MB_ERR_STRING_OVER_FLOW; + MBSTRG(last_errno) = PHP_MB_ERR_STRING_OVER_FLOW; return FAILURE; } newsize = string->length + length + PHP_MB_STR_ALLOC_SIZE; @@ -198,7 +198,7 @@ tmp = erealloc(string->value, newsize*sizeof(unsigned char)); } if (tmp == NULL) { - MBG(last_errno) = PHP_MB_ERR_NO_MEMORY; + MBSTRG(last_errno) = PHP_MB_ERR_NO_MEMORY; return FAILURE; } string->size = newsize; @@ -220,7 +220,7 @@ unsigned char *tmp; if (dst->memory_type_value == PHP_MB_MEMORY_TYPE_CONST) { - MBG(last_errno) = PHP_MB_ERR_STRING_OVER_FLOW; + MBSTRG(last_errno) = PHP_MB_ERR_STRING_OVER_FLOW; return FAILURE; } newsize = dst->length + src->length + PHP_MB_STR_ALLOC_SIZE; @@ -231,7 +231,7 @@ tmp = erealloc(dst->value, newsize*sizeof(unsigned char)); } if (tmp == NULL) { - MBG(last_errno) = PHP_MB_ERR_NO_MEMORY; + MBSTRG(last_errno) = PHP_MB_ERR_NO_MEMORY; return FAILURE; } dst->size = newsize; @@ -291,7 +291,7 @@ PHP_MB_STR_TSRMLS_FETCH(string); if (string->memory_type_value == PHP_MB_MEMORY_TYPE_CONST) { - MBG(last_errno) = PHP_MB_ERR_STRING_OVER_FLOW; + MBSTRG(last_errno) = PHP_MB_ERR_STRING_OVER_FLOW; return -1; } newsize = string->size + string->realloc; @@ -302,7 +302,7 @@ tmp = erealloc(string->value, newsize*sizeof(unsigned char)); } if (tmp == NULL) { - MBG(last_errno) = PHP_MB_ERR_NO_MEMORY; + MBSTRG(last_errno) = PHP_MB_ERR_NO_MEMORY; return -1; } string->size = newsize;