mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-26 18:35:42 +00:00
More work, get strings working, sort-of...
This commit is contained in:
1 parent
89aea2f103
commit
66845fb6a5
3 files changed
+340
-341
No files matched your search
+7
-7
@@ -803,7 +803,7 @@ PHPAPI long _php_math_basetolong(zval *arg, int base)
|
||||
|
||||
s = Z_STRVAL_P(arg);
|
||||
|
||||
for (i = Z_STRLEN_P(arg); i > 0; i--) {
|
||||
for (i = Z_STRSIZE_P(arg); i > 0; i--) {
|
||||
c = *s++;
|
||||
|
||||
digit = (c >= '0' && c <= '9') ? c - '0'
|
||||
@@ -855,7 +855,7 @@ PHPAPI int _php_math_basetozval(zval *arg, int base, zval *ret)
|
||||
cutoff = LONG_MAX / base;
|
||||
cutlim = LONG_MAX % base;
|
||||
|
||||
for (i = Z_STRLEN_P(arg); i > 0; i--) {
|
||||
for (i = Z_STRSIZE_P(arg); i > 0; i--) {
|
||||
c = *s++;
|
||||
|
||||
/* might not work for EBCDIC */
|
||||
@@ -1098,7 +1098,7 @@ PHPAPI char *_php_math_number_format(double d, int dec, char dec_point, char tho
|
||||
}
|
||||
|
||||
static char *_php_math_number_format_ex_len(double d, int dec, char *dec_point,
|
||||
size_t dec_point_len, char *thousand_sep, size_t thousand_sep_len,
|
||||
zend_str_size_size_t dec_point_len, char *thousand_sep, zend_str_size_size_t thousand_sep_len,
|
||||
int *result_len)
|
||||
{
|
||||
char *tmpbuf = NULL, *resbuf;
|
||||
@@ -1219,7 +1219,7 @@ static char *_php_math_number_format_ex_len(double d, int dec, char *dec_point,
|
||||
}
|
||||
|
||||
PHPAPI char *_php_math_number_format_ex(double d, int dec, char *dec_point,
|
||||
size_t dec_point_len, char *thousand_sep, size_t thousand_sep_len)
|
||||
zend_str_size_size_t dec_point_len, char *thousand_sep, zend_str_size_size_t thousand_sep_len)
|
||||
{
|
||||
return _php_math_number_format_ex_len(d, dec, dec_point, dec_point_len,
|
||||
thousand_sep, thousand_sep_len, NULL);
|
||||
@@ -1234,9 +1234,9 @@ PHP_FUNCTION(number_format)
|
||||
long dec = 0;
|
||||
char *thousand_sep = NULL, *dec_point = NULL;
|
||||
char thousand_sep_chr = ',', dec_point_chr = '.';
|
||||
int thousand_sep_len = 0, dec_point_len = 0;
|
||||
zend_str_size thousand_sep_len = 0, dec_point_len = 0;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d|ls!s!", &num, &dec, &dec_point, &dec_point_len, &thousand_sep, &thousand_sep_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d|lS!S!", &num, &dec, &dec_point, &dec_point_len, &thousand_sep, &thousand_sep_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1261,7 +1261,7 @@ PHP_FUNCTION(number_format)
|
||||
Z_TYPE_P(return_value) = IS_STRING;
|
||||
Z_STRVAL_P(return_value) = _php_math_number_format_ex_len(num, dec,
|
||||
dec_point, dec_point_len, thousand_sep, thousand_sep_len,
|
||||
&Z_STRLEN_P(return_value));
|
||||
&Z_STRSIZE_P(return_value));
|
||||
break;
|
||||
default:
|
||||
WRONG_PARAM_COUNT;
|
||||
|
||||
+22
-22
@@ -112,36 +112,36 @@ PHP_MINIT_FUNCTION(nl_langinfo);
|
||||
strnatcmp_ex(a, strlen(a), b, strlen(b), 0)
|
||||
#define strnatcasecmp(a, b) \
|
||||
strnatcmp_ex(a, strlen(a), b, strlen(b), 1)
|
||||
PHPAPI int strnatcmp_ex(char const *a, size_t a_len, char const *b, size_t b_len, int fold_case);
|
||||
PHPAPI int strnatcmp_ex(char const *a, zend_str_size_size_t a_len, char const *b, zend_str_size_size_t b_len, int fold_case);
|
||||
|
||||
#ifdef HAVE_LOCALECONV
|
||||
PHPAPI struct lconv *localeconv_r(struct lconv *out);
|
||||
#endif
|
||||
|
||||
PHPAPI char *php_strtoupper(char *s, size_t len);
|
||||
PHPAPI char *php_strtolower(char *s, size_t len);
|
||||
PHPAPI char *php_strtr(char *str, int len, char *str_from, char *str_to, int trlen);
|
||||
PHPAPI char *php_addslashes(char *str, int length, int *new_length, int freeit TSRMLS_DC);
|
||||
PHPAPI char *php_addcslashes(const char *str, int length, int *new_length, int freeit, char *what, int wlength TSRMLS_DC);
|
||||
PHPAPI void php_stripslashes(char *str, int *len TSRMLS_DC);
|
||||
PHPAPI void php_stripcslashes(char *str, int *len);
|
||||
PHPAPI void php_basename(const char *s, size_t len, char *suffix, size_t sufflen, char **p_ret, size_t *p_len TSRMLS_DC);
|
||||
PHPAPI size_t php_dirname(char *str, size_t len);
|
||||
PHPAPI char *php_stristr(char *s, char *t, size_t s_len, size_t t_len);
|
||||
PHPAPI char *php_str_to_str_ex(char *haystack, int length, char *needle,
|
||||
int needle_len, char *str, int str_len, int *_new_length, int case_sensitivity, int *replace_count);
|
||||
PHPAPI char *php_str_to_str(char *haystack, int length, char *needle,
|
||||
int needle_len, char *str, int str_len, int *_new_length);
|
||||
PHPAPI char *php_trim(char *c, int len, char *what, int what_len, zval *return_value, int mode TSRMLS_DC);
|
||||
PHPAPI size_t php_strip_tags(char *rbuf, int len, int *state, char *allow, int allow_len);
|
||||
PHPAPI size_t php_strip_tags_ex(char *rbuf, int len, int *stateptr, char *allow, int allow_len, zend_bool allow_tag_spaces);
|
||||
PHPAPI int php_char_to_str_ex(char *str, uint len, char from, char *to, int to_len, zval *result, int case_sensitivity, int *replace_count);
|
||||
PHPAPI int php_char_to_str(char *str, uint len, char from, char *to, int to_len, zval *result);
|
||||
PHPAPI char *php_strtoupper(char *s, zend_str_size_size_t len);
|
||||
PHPAPI char *php_strtolower(char *s, zend_str_size_size_t len);
|
||||
PHPAPI char *php_strtr(char *str, zend_str_size_int len, char *str_from, char *str_to, zend_str_size_int trlen);
|
||||
PHPAPI char *php_addslashes(char *str, zend_str_size_int length, zend_str_size_int *new_length, int freeit TSRMLS_DC);
|
||||
PHPAPI char *php_addcslashes(const char *str, zend_str_size_int length, zend_str_size_int *new_length, int freeit, char *what, zend_str_size_int wlength TSRMLS_DC);
|
||||
PHPAPI void php_stripslashes(char *str, zend_str_size_int *len TSRMLS_DC);
|
||||
PHPAPI void php_stripcslashes(char *str, zend_str_size_int *len);
|
||||
PHPAPI void php_basename(const char *s, zend_str_size_size_t len, char *suffix, zend_str_size_size_t sufflen, char **p_ret, zend_str_size_size_t *p_len TSRMLS_DC);
|
||||
PHPAPI zend_str_size_size_t php_dirname(char *str, zend_str_size_size_t len);
|
||||
PHPAPI char *php_stristr(char *s, char *t, zend_str_size_size_t s_len, zend_str_size_size_t t_len);
|
||||
PHPAPI char *php_str_to_str_ex(char *haystack, zend_str_size_int length, char *needle,
|
||||
zend_str_size_int needle_len, char *str, zend_str_size_int str_len, zend_str_size_int *_new_length, int case_sensitivity, zend_str_size_int *replace_count);
|
||||
PHPAPI char *php_str_to_str(char *haystack, zend_str_size_int length, char *needle,
|
||||
zend_str_size_int needle_len, char *str, zend_str_size_int str_len, zend_str_size_int *_new_length);
|
||||
PHPAPI char *php_trim(char *c, zend_str_size_int len, char *what, zend_str_size_int what_len, zval *return_value, int mode TSRMLS_DC);
|
||||
PHPAPI zend_str_size_size_t php_strip_tags(char *rbuf, zend_str_size_int len, int *state, char *allow, zend_str_size_int allow_len);
|
||||
PHPAPI zend_str_size_size_t php_strip_tags_ex(char *rbuf, zend_str_size_int len, int *stateptr, char *allow, zend_str_size_int allow_len, zend_bool allow_tag_spaces);
|
||||
PHPAPI zend_str_size_int php_char_to_str_ex(char *str, zend_str_size_uint len, char from, char *to, zend_str_size_int to_len, zval *result, int case_sensitivity, zend_str_size_int *replace_count);
|
||||
PHPAPI zend_str_size_int php_char_to_str(char *str, zend_str_size_uint len, char from, char *to, zend_str_size_int to_len, zval *result);
|
||||
PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value TSRMLS_DC);
|
||||
PHPAPI void php_explode(zval *delim, zval *str, zval *return_value, long limit);
|
||||
|
||||
PHPAPI size_t php_strspn(char *s1, char *s2, char *s1_end, char *s2_end);
|
||||
PHPAPI size_t php_strcspn(char *s1, char *s2, char *s1_end, char *s2_end);
|
||||
PHPAPI zend_str_size_size_t php_strspn(char *s1, char *s2, char *s1_end, char *s2_end);
|
||||
PHPAPI zend_str_size_size_t php_strcspn(char *s1, char *s2, char *s1_end, char *s2_end);
|
||||
|
||||
PHPAPI int string_natural_compare_function_ex(zval *result, zval *op1, zval *op2, zend_bool case_insensitive TSRMLS_DC);
|
||||
PHPAPI int string_natural_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
|
||||
|
||||
+311
-312
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user