Browse Source

fixes for types to ext/standard with types ... some stuff is broken now

pull/407/head
Anatol Belski 13 years ago
parent
commit
a95f8dbac2
  1. 2
      Zend/zend_highlight.c
  2. 2
      Zend/zend_highlight.h
  3. 2
      ext/standard/dir.c
  4. 2
      ext/standard/dl.c
  5. 9
      ext/standard/file.c
  6. 2
      ext/standard/file.h
  7. 66
      ext/standard/formatted_print.c
  8. 7
      ext/standard/ftp_fopen_wrapper.c
  9. 6
      ext/standard/head.c
  10. 2
      ext/standard/head.h
  11. 9
      ext/standard/http.c
  12. 10
      ext/standard/http_fopen_wrapper.c
  13. 12
      ext/standard/info.c
  14. 2
      ext/standard/mail.c
  15. 14
      ext/standard/math.c
  16. 2
      ext/standard/md5.c
  17. 25
      ext/standard/pack.c
  18. 4
      ext/standard/password.c
  19. 6
      ext/standard/php_http.h
  20. 120
      ext/standard/url_scanner_ex.c
  21. 2
      ext/standard/url_scanner_ex.h
  22. 8
      ext/standard/url_scanner_ex.re
  23. 6
      ext/standard/versioning.c
  24. 2
      main/SAPI.h
  25. 5
      main/spprintf.c

2
Zend/zend_highlight.c

@ -54,7 +54,7 @@ ZEND_API void zend_html_putc(char c)
}
ZEND_API void zend_html_puts(const char *s, uint len TSRMLS_DC)
ZEND_API void zend_html_puts(const char *s, zend_str_size_uint len TSRMLS_DC)
{
const unsigned char *ptr = (const unsigned char*)s, *end = ptr + len;
unsigned char *filtered;

2
Zend/zend_highlight.h

@ -44,7 +44,7 @@ ZEND_API void zend_strip(TSRMLS_D);
ZEND_API int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini TSRMLS_DC);
ZEND_API int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name TSRMLS_DC);
ZEND_API void zend_html_putc(char c);
ZEND_API void zend_html_puts(const char *s, uint len TSRMLS_DC);
ZEND_API void zend_html_puts(const char *s, zend_str_size_uint len TSRMLS_DC);
END_EXTERN_C()
extern zend_syntax_highlighter_ini syntax_highlighter_ini;

2
ext/standard/dir.c

@ -424,7 +424,7 @@ PHP_NAMED_FUNCTION(php_if_readdir)
Find pathnames matching a pattern */
PHP_FUNCTION(glob)
{
int cwd_skip = 0;
zend_str_size_int cwd_skip = 0;
#ifdef ZTS
char cwd[MAXPATHLEN];
char work_pattern[MAXPATHLEN];

2
ext/standard/dl.c

@ -129,7 +129,7 @@ PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC)
}
libpath = estrdup(filename);
} else if (extension_dir && extension_dir[0]) {
int extension_dir_len = strlen(extension_dir);
zend_str_size_int extension_dir_len = strlen(extension_dir);
if (IS_SLASH(extension_dir[extension_dir_len-1])) {
spprintf(&libpath, 0, "%s%s", extension_dir, filename); /* SAFE */

9
ext/standard/file.c

@ -1169,7 +1169,7 @@ PHPAPI PHP_FUNCTION(fwrite)
zval *arg1;
char *arg2;
zend_str_size arg2len;
int ret;
zend_str_size_int ret;
zend_str_size num_bytes;
long arg3 = 0;
char *buffer = NULL;
@ -1810,7 +1810,7 @@ PHP_FUNCTION(fputcsv)
const char escape_char = '\\';
php_stream *stream;
zval *fp = NULL, *fields = NULL;
int ret;
zend_str_size_int ret;
char *delimiter_str = NULL, *enclosure_str = NULL;
zend_str_size delimiter_str_len = 0, enclosure_str_len = 0;
@ -1852,9 +1852,10 @@ PHP_FUNCTION(fputcsv)
/* }}} */
/* {{{ PHPAPI int php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, char escape_char TSRMLS_DC) */
PHPAPI int php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, char escape_char TSRMLS_DC)
PHPAPI zend_str_size_int php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, char escape_char TSRMLS_DC)
{
int count, i = 0, ret;
int count, i = 0;
zend_str_size_int ret;
zval **field_tmp = NULL, field;
smart_str csvline = {0};
HashPosition pos;

2
ext/standard/file.h

@ -80,7 +80,7 @@ PHPAPI int php_copy_file_ctx(char *src, char *dest, int src_chk, php_stream_cont
PHPAPI int php_mkdir_ex(char *dir, long mode, int options TSRMLS_DC);
PHPAPI int php_mkdir(char *dir, long mode TSRMLS_DC);
PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char escape_char, size_t buf_len, char *buf, zval *return_value TSRMLS_DC);
PHPAPI int php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, char escape_char TSRMLS_DC);
PHPAPI zend_str_size_int php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, char escape_char TSRMLS_DC);
#define META_DEF_BUFSIZE 8192

66
ext/standard/formatted_print.c

@ -52,7 +52,7 @@ static char HEXCHARS[] = "0123456789ABCDEF";
/* php_spintf_appendchar() {{{ */
inline static void
php_sprintf_appendchar(char **buffer, int *pos, int *size, char add TSRMLS_DC)
php_sprintf_appendchar(char **buffer, zend_str_size_int *pos, zend_str_size_int *size, char add TSRMLS_DC)
{
if ((*pos + 1) >= *size) {
*size <<= 1;
@ -66,22 +66,18 @@ php_sprintf_appendchar(char **buffer, int *pos, int *size, char add TSRMLS_DC)
/* php_spintf_appendstring() {{{ */
inline static void
php_sprintf_appendstring(char **buffer, int *pos, int *size, char *add,
int min_width, int max_width, char padding,
int alignment, int len, int neg, int expprec, int always_sign)
php_sprintf_appendstring(char **buffer, zend_str_size_int *pos, zend_str_size_int *size, char *add,
zend_str_size_int min_width, zend_str_size_int max_width, char padding,
zend_str_size_int alignment, zend_str_size_int len, int neg, int expprec, int always_sign)
{
register int npad;
int req_size;
int copy_len;
int m_width;
register zend_str_size_int npad;
zend_str_size_int req_size;
zend_str_size_int copy_len;
zend_str_size_int m_width;
copy_len = (expprec ? MIN(max_width, len) : len);
npad = min_width - copy_len;
npad = (min_width >= copy_len) ? (min_width - copy_len) : 0;
if (npad < 0) {
npad = 0;
}
PRINTF_DEBUG(("sprintf: appendstring(%x, %d, %d, \"%s\", %d, '%c', %d)\n",
*buffer, *pos, *size, add, min_width, padding, alignment));
m_width = MAX(min_width, copy_len);
@ -126,8 +122,8 @@ php_sprintf_appendstring(char **buffer, int *pos, int *size, char *add,
/* php_spintf_appendint() {{{ */
inline static void
php_sprintf_appendint(char **buffer, int *pos, int *size, long number,
int width, char padding, int alignment,
php_sprintf_appendint(char **buffer, zend_str_size_int *pos, zend_str_size_int *size, long number,
zend_str_size_int width, char padding, zend_str_size_int alignment,
int always_sign)
{
char numbuf[NUM_BUF_SIZE];
@ -170,9 +166,9 @@ php_sprintf_appendint(char **buffer, int *pos, int *size, long number,
/* php_spintf_appenduint() {{{ */
inline static void
php_sprintf_appenduint(char **buffer, int *pos, int *size,
php_sprintf_appenduint(char **buffer, zend_str_size_int *pos, zend_str_size_int *size,
unsigned long number,
int width, char padding, int alignment)
zend_str_size_int width, char padding, zend_str_size_int alignment)
{
char numbuf[NUM_BUF_SIZE];
register unsigned long magn, nmagn;
@ -202,17 +198,18 @@ php_sprintf_appenduint(char **buffer, int *pos, int *size,
/* php_spintf_appenddouble() {{{ */
inline static void
php_sprintf_appenddouble(char **buffer, int *pos,
int *size, double number,
int width, char padding,
int alignment, int precision,
php_sprintf_appenddouble(char **buffer, zend_str_size_int *pos,
zend_str_size_int *size, double number,
zend_str_size_int width, char padding,
zend_str_size_int alignment, int precision,
int adjust, char fmt,
int always_sign
TSRMLS_DC)
{
char num_buf[NUM_BUF_SIZE];
char *s = NULL;
int s_len = 0, is_negative = 0;
zend_str_size_int s_len = 0;
int is_negative = 0;
#ifdef HAVE_LOCALE_H
struct lconv *lconv;
#endif
@ -293,8 +290,8 @@ php_sprintf_appenddouble(char **buffer, int *pos,
/* php_spintf_appendd2n() {{{ */
inline static void
php_sprintf_append2n(char **buffer, int *pos, int *size, long number,
int width, char padding, int alignment, int n,
php_sprintf_append2n(char **buffer, zend_str_size_int *pos, zend_str_size_int *size, long number,
zend_str_size_int width, char padding, zend_str_size_int alignment, int n,
char *chartable, int expprec)
{
char numbuf[NUM_BUF_SIZE];
@ -324,11 +321,11 @@ php_sprintf_append2n(char **buffer, int *pos, int *size, long number,
/* php_spintf_getnumber() {{{ */
inline static int
php_sprintf_getnumber(char *buffer, int *pos)
php_sprintf_getnumber(char *buffer, zend_str_size_int *pos)
{
char *endptr;
register long num = strtol(&buffer[*pos], &endptr, 10);
register int i = 0;
register zend_str_size_int i = 0;
if (endptr != NULL) {
i = (endptr - &buffer[*pos]);
@ -369,10 +366,11 @@ php_sprintf_getnumber(char *buffer, int *pos)
*
*/
static char *
php_formatted_print(int ht, int *len, int use_array, int format_offset TSRMLS_DC)
php_formatted_print(int ht, zend_str_size_int *len, int use_array, int format_offset TSRMLS_DC)
{
zval ***args, **z_format;
int argc, size = 240, inpos = 0, outpos = 0, temppos;
int argc;
zend_str_size_int size = 240, inpos = 0, outpos = 0, temppos;
int alignment, currarg, adjusting, argnum, width, precision;
char *format, *result, padding;
int always_sign;
@ -666,7 +664,7 @@ php_formatted_print(int ht, int *len, int use_array, int format_offset TSRMLS_DC
PHP_FUNCTION(user_sprintf)
{
char *result;
int len;
zend_str_size_int len;
if ((result=php_formatted_print(ht, &len, 0, 0 TSRMLS_CC))==NULL) {
RETURN_FALSE;
@ -680,7 +678,7 @@ PHP_FUNCTION(user_sprintf)
PHP_FUNCTION(vsprintf)
{
char *result;
int len;
zend_str_size_int len;
if ((result=php_formatted_print(ht, &len, 1, 0 TSRMLS_CC))==NULL) {
RETURN_FALSE;
@ -694,7 +692,7 @@ PHP_FUNCTION(vsprintf)
PHP_FUNCTION(user_printf)
{
char *result;
int len, rlen;
zend_str_size_int len, rlen;
if ((result=php_formatted_print(ht, &len, 0, 0 TSRMLS_CC))==NULL) {
RETURN_FALSE;
@ -710,7 +708,7 @@ PHP_FUNCTION(user_printf)
PHP_FUNCTION(vprintf)
{
char *result;
int len, rlen;
zend_str_size_int len, rlen;
if ((result=php_formatted_print(ht, &len, 1, 0 TSRMLS_CC))==NULL) {
RETURN_FALSE;
@ -728,7 +726,7 @@ PHP_FUNCTION(fprintf)
php_stream *stream;
zval *arg1;
char *result;
int len;
zend_str_size_int len;
if (ZEND_NUM_ARGS() < 2) {
WRONG_PARAM_COUNT;
@ -759,7 +757,7 @@ PHP_FUNCTION(vfprintf)
php_stream *stream;
zval *arg1;
char *result;
int len;
zend_str_size_int len;
if (ZEND_NUM_ARGS() != 3) {
WRONG_PARAM_COUNT;

7
ext/standard/ftp_fopen_wrapper.c

@ -135,10 +135,11 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, char *path
{
php_stream *stream = NULL, *reuseid = NULL;
php_url *resource = NULL;
int result, use_ssl, use_ssl_on_data = 0, tmp_len;
int result, use_ssl, use_ssl_on_data = 0;
zend_str_size_int tmp_len;
char tmp_line[512];
char *transport;
int transport_len;
zend_str_size_int transport_len;
resource = php_url_parse(path);
if (resource == NULL || resource->path == NULL) {
@ -425,7 +426,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, char *path, ch
int allow_overwrite = 0;
int read_write = 0;
char *transport;
int transport_len;
zend_str_size_int transport_len;
tmp_line[0] = '\0';

6
ext/standard/head.c

@ -73,10 +73,10 @@ PHPAPI int php_header(TSRMLS_D)
}
PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, time_t expires, char *path, int path_len, char *domain, int domain_len, int secure, int url_encode, int httponly TSRMLS_DC)
PHPAPI int php_setcookie(char *name, zend_str_size_int name_len, char *value, zend_str_size_int value_len, time_t expires, char *path, zend_str_size_int path_len, char *domain, zend_str_size_int domain_len, int secure, int url_encode, int httponly TSRMLS_DC)
{
char *cookie, *encoded_value = NULL;
int len=sizeof("Set-Cookie: ");
zend_str_size_int len=sizeof("Set-Cookie: ");
char *dt;
sapi_header_line ctr = {0};
int result;
@ -93,7 +93,7 @@ PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, t
len += name_len;
if (value && url_encode) {
int encoded_value_len;
zend_str_size_int encoded_value_len;
encoded_value = php_url_encode(value, value_len, &encoded_value_len);
len += encoded_value_len;

2
ext/standard/head.h

@ -31,6 +31,6 @@ PHP_FUNCTION(headers_list);
PHP_FUNCTION(http_response_code);
PHPAPI int php_header(TSRMLS_D);
PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, time_t expires, char *path, int path_len, char *domain, int domain_len, int secure, int url_encode, int httponly TSRMLS_DC);
PHPAPI int php_setcookie(char *name, zend_str_size_int name_len, char *value, zend_str_size_int value_len, time_t expires, char *path, zend_str_size_int path_len, char *domain, zend_str_size_int domain_len, int secure, int url_encode, int httponly TSRMLS_DC);
#endif

9
ext/standard/http.c

@ -26,14 +26,15 @@
/* {{{ php_url_encode_hash */
PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr,
const char *num_prefix, int num_prefix_len,
const char *key_prefix, int key_prefix_len,
const char *key_suffix, int key_suffix_len,
const char *num_prefix, zend_str_size_int num_prefix_len,
const char *key_prefix, zend_str_size_int key_prefix_len,
const char *key_suffix, zend_str_size_int key_suffix_len,
zval *type, char *arg_sep, int enc_type TSRMLS_DC)
{
char *key = NULL;
char *ekey, *newprefix, *p;
int arg_sep_len, ekey_len, key_type, newprefix_len;
zend_str_size_int arg_sep_len, ekey_len, newprefix_len;
int key_type;
zend_str_size_uint key_len;
ulong idx;
zval **zdata = NULL, *copyzval;

10
ext/standard/http_fopen_wrapper.c

@ -94,7 +94,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
char *tmp = NULL;
char *ua_str = NULL;
zval **ua_zval = NULL, **tmpzval = NULL;
int scratch_len = 0;
zend_str_size_int scratch_len = 0;
int body = 0;
char location[HTTP_HEADER_BLOCK_SIZE];
zval *response_header = NULL;
@ -104,9 +104,9 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
size_t chunk_size = 0, file_size = 0;
int eol_detect = 0;
char *transport_string, *errstr = NULL;
int transport_len, have_header = 0, request_fulluri = 0, ignore_errors = 0;
zend_str_size_int transport_len, have_header = 0, request_fulluri = 0, ignore_errors = 0;
char *protocol_version = NULL;
int protocol_version_len = 3; /* Default: "1.0" */
zend_str_size_int protocol_version_len = 3; /* Default: "1.0" */
struct timeval timeout;
char *user_headers = NULL;
int header_init = ((flags & HTTP_WRAPPER_HEADER_INIT) != 0);
@ -426,13 +426,13 @@ finish:
char *s;
if (!header_init) { /* Remove post headers for redirects */
int l = strlen(tmp);
zend_str_size_int l = strlen(tmp);
char *s2, *tmp_c = estrdup(tmp);
php_strtolower(tmp_c, l);
if ((s = strstr(tmp_c, "content-length:"))) {
if ((s2 = memchr(s, '\n', tmp_c + l - s))) {
int b = tmp_c + l - 1 - s2;
zend_str_size_int b = tmp_c + l - 1 - s2;
memmove(tmp, tmp + (s2 + 1 - tmp_c), b);
memmove(tmp_c, s2 + 1, b);

12
ext/standard/info.c

@ -61,10 +61,10 @@ PHPAPI extern char *php_ini_opened_path;
PHPAPI extern char *php_ini_scanned_path;
PHPAPI extern char *php_ini_scanned_files;
static int php_info_print_html_esc(const char *str, int len) /* {{{ */
static zend_str_size_int php_info_print_html_esc(const char *str, zend_str_size_int len) /* {{{ */
{
size_t new_len;
int written;
zend_str_size_int written;
char *new_str;
TSRMLS_FETCH();
@ -75,10 +75,10 @@ static int php_info_print_html_esc(const char *str, int len) /* {{{ */
}
/* }}} */
static int php_info_printf(const char *fmt, ...) /* {{{ */
static zend_str_size_int php_info_printf(const char *fmt, ...) /* {{{ */
{
char *buf;
int len, written;
zend_str_size_int len, written;
va_list argv;
TSRMLS_FETCH();
@ -92,7 +92,7 @@ static int php_info_printf(const char *fmt, ...) /* {{{ */
}
/* }}} */
static int php_info_print(const char *str) /* {{{ */
static zend_str_size_int php_info_print(const char *str) /* {{{ */
{
TSRMLS_FETCH();
return php_output_write(str, strlen(str) TSRMLS_CC);
@ -991,7 +991,7 @@ PHPAPI void php_info_print_hr(void) /* {{{ */
PHPAPI void php_info_print_table_colspan_header(int num_cols, char *header) /* {{{ */
{
int spaces;
zend_str_size_int spaces;
if (!sapi_module.phpinfo_as_text) {
php_info_printf("<tr class=\"h\"><th colspan=\"%d\">%s</th></tr>\n", num_cols, header );

2
ext/standard/mail.c

@ -250,7 +250,7 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char
if (mail_log && *mail_log) {
char *tmp, *date_str;
time_t curtime;
int l;
zend_str_size_int l;
time(&curtime);
date_str = php_format_date("d-M-Y H:i:s e", 13, curtime, 1 TSRMLS_CC);

14
ext/standard/math.c

@ -794,7 +794,7 @@ PHP_FUNCTION(rad2deg)
PHPAPI long _php_math_basetolong(zval *arg, int base)
{
long num = 0, digit, onum;
int i;
zend_str_size_int i;
char c, *s;
if (Z_TYPE_P(arg) != IS_STRING || base < 2 || base > 36) {
@ -840,7 +840,7 @@ PHPAPI int _php_math_basetozval(zval *arg, int base, zval *ret)
{
long num = 0;
double fnum = 0;
int i;
zend_str_size_int i;
int mode = 0;
char c, *s;
long cutoff;
@ -1099,13 +1099,13 @@ 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,
zend_str_size_size_t dec_point_len, char *thousand_sep, zend_str_size_size_t thousand_sep_len,
int *result_len)
zend_str_size_int *result_len)
{
char *tmpbuf = NULL, *resbuf;
char *s, *t; /* source, target */
char *dp;
int integral;
int tmplen, reslen=0;
zend_str_size_int integral;
zend_str_size_int tmplen, reslen=0;
int count=0;
int is_negative=0;
@ -1171,8 +1171,8 @@ static char *_php_math_number_format_ex_len(double d, int dec, char *dec_point,
* Take care, as the sprintf implementation may return less places than
* we requested due to internal buffer limitations */
if (dec) {
int declen = dp ? s - dp : 0;
int topad = dec > declen ? dec - declen : 0;
zend_str_size_int declen = dp ? s - dp : 0;
zend_str_size_int topad = dec > declen ? dec - declen : 0;
/* pad with '0's */
while (topad--) {

2
ext/standard/md5.c

@ -82,7 +82,7 @@ PHP_NAMED_FUNCTION(php_if_md5_file)
unsigned char buf[1024];
unsigned char digest[16];
PHP_MD5_CTX context;
int n;
zend_str_size_int n;
php_stream *stream;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "P|b", &arg, &arg_len, &raw_output) == FAILURE) {

25
ext/standard/pack.c

@ -84,7 +84,7 @@ static int little_endian_long_map[4];
/* {{{ php_pack
*/
static void php_pack(zval **val, int size, int *map, char *output)
static void php_pack(zval **val, zend_str_size_int size, int *map, char *output)
{
int i;
char *v;
@ -109,7 +109,7 @@ PHP_FUNCTION(pack)
int num_args, i;
int currentarg;
char *format;
int formatlen;
zend_str_size_int formatlen;
char *formatcodes;
int *formatargs;
int formatcount = 0;
@ -496,7 +496,7 @@ PHP_FUNCTION(pack)
/* {{{ php_unpack
*/
static long php_unpack(char *data, int size, int issigned, int *map)
static long php_unpack(char *data, zend_str_size_int size, int issigned, int *map)
{
long result;
char *cresult = (char *) &result;
@ -529,10 +529,11 @@ static long php_unpack(char *data, int size, int issigned, int *map)
PHP_FUNCTION(unpack)
{
char *format, *input, *formatarg, *inputarg;
int formatlen, formatarg_len, inputarg_len;
int formatlen;
zend_str_size_int formatarg_len, inputarg_len;
int inputpos, inputlen, i;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &formatarg, &formatarg_len,
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &formatarg, &formatarg_len,
&inputarg, &inputarg_len) == FAILURE) {
return;
}
@ -550,8 +551,8 @@ PHP_FUNCTION(unpack)
char c;
int arg = 1, argb;
char *name;
int namelen;
int size=0;
zend_str_size_int namelen;
zend_str_size_int size=0;
/* Handle format arguments if any */
if (formatlen > 0) {
@ -676,7 +677,7 @@ PHP_FUNCTION(unpack)
switch ((int) type) {
case 'a': {
/* a will not strip any trailing whitespace or null padding */
int len = inputlen - inputpos; /* Remaining string */
zend_str_size_int len = inputlen - inputpos; /* Remaining string */
/* If size was given take minimum of len and size */
if ((size >= 0) && (len > size)) {
@ -691,7 +692,7 @@ PHP_FUNCTION(unpack)
case 'A': {
/* A will strip any trailing whitespace */
char padn = '\0'; char pads = ' '; char padt = '\t'; char padc = '\r'; char padl = '\n';
int len = inputlen - inputpos; /* Remaining string */
zend_str_size_int len = inputlen - inputpos; /* Remaining string */
/* If size was given take minimum of len and size */
if ((size >= 0) && (len > size)) {
@ -718,7 +719,7 @@ PHP_FUNCTION(unpack)
case 'Z': {
/* Z will strip everything after the first null character */
char pad = '\0';
int s,
zend_str_size_int s,
len = inputlen - inputpos; /* Remaining string */
/* If size was given take minimum of len and size */
@ -742,11 +743,11 @@ PHP_FUNCTION(unpack)
case 'h':
case 'H': {
int len = (inputlen - inputpos) * 2; /* Remaining */
zend_str_size_int len = (inputlen - inputpos) * 2; /* Remaining */
int nibbleshift = (type == 'h') ? 0 : 4;
int first = 1;
char *buf;
int ipos, opos;
zend_str_size_int ipos, opos;
/* If size was given take minimum of len and size */
if (size >= 0 && len > (size * 2)) {

4
ext/standard/password.c

@ -87,7 +87,7 @@ static zend_bool php_password_salt_to64(const char *str, const size_t str_len, c
if ((int) str_len < 0) {
return FAILURE;
}
buffer = php_base64_encode((unsigned char*) str, (int) str_len, (int*) &ret_len);
buffer = php_base64_encode((unsigned char*) str, str_len, &ret_len);
if (ret_len < out_len) {
/* Too short of an encoded string generated */
efree(buffer);
@ -354,7 +354,7 @@ PHP_FUNCTION(password_hash)
if (options && zend_symtable_find(options, "salt", 5, (void**) &option_buffer) == SUCCESS) {
char *buffer;
int buffer_len_int = 0;
zend_str_size_int buffer_len_int = 0;
size_t buffer_len;
switch (Z_TYPE_PP(option_buffer)) {
case IS_STRING:

6
ext/standard/php_http.h

@ -25,9 +25,9 @@
#include "php_smart_str.h"
PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr,
const char *num_prefix, int num_prefix_len,
const char *key_prefix, int key_prefix_len,
const char *key_suffix, int key_suffix_len,
const char *num_prefix, zend_str_size_int num_prefix_len,
const char *key_prefix, zend_str_size_int key_prefix_len,
const char *key_suffix, zend_str_size_int key_suffix_len,
zval *type, char *arg_sep, int enc_type TSRMLS_DC);
#define php_url_encode_hash(ht, formstr) php_url_encode_hash_ex((ht), (formstr), NULL, 0, NULL, 0, NULL, 0, NULL TSRMLS_CC)

120
ext/standard/url_scanner_ex.c

@ -1,5 +1,5 @@
/* Generated by re2c 0.13.5 */
#line 1 "ext/standard/url_scanner_ex.re"
#line 1 "url_scanner_ex.re"
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
@ -74,7 +74,7 @@ static PHP_INI_MH(OnUpdateTags)
val = strchr(key, '=');
if (val) {
char *q;
int keylen;
zend_str_size_int keylen;
*val++ = '\0';
for (q = key; *q; q++)
@ -95,7 +95,7 @@ PHP_INI_BEGIN()
STD_PHP_INI_ENTRY("url_rewriter.tags", "a=href,area=href,frame=src,form=,fieldset=", PHP_INI_ALL, OnUpdateTags, url_adapt_state_ex, php_basic_globals, basic_globals)
PHP_INI_END()
#line 102 "ext/standard/url_scanner_ex.re"
#line 102 "url_scanner_ex.re"
#define YYFILL(n) goto done
@ -114,7 +114,7 @@ static inline void append_modified_url(smart_str *url, smart_str *dest, smart_st
scan:
#line 118 "ext/standard/url_scanner_ex.c"
#line 118 "url_scanner_ex.c"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
@ -160,19 +160,19 @@ scan:
if (yych <= '9') goto yy6;
if (yych >= ';') goto yy4;
++YYCURSOR;
#line 120 "ext/standard/url_scanner_ex.re"
#line 120 "url_scanner_ex.re"
{ smart_str_append(dest, url); return; }
#line 166 "ext/standard/url_scanner_ex.c"
#line 166 "url_scanner_ex.c"
yy4:
++YYCURSOR;
#line 121 "ext/standard/url_scanner_ex.re"
#line 121 "url_scanner_ex.re"
{ sep = separator; goto scan; }
#line 171 "ext/standard/url_scanner_ex.c"
#line 171 "url_scanner_ex.c"
yy6:
++YYCURSOR;
#line 122 "ext/standard/url_scanner_ex.re"
#line 122 "url_scanner_ex.re"
{ bash = p - 1; goto done; }
#line 176 "ext/standard/url_scanner_ex.c"
#line 176 "url_scanner_ex.c"
yy8:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
@ -180,11 +180,11 @@ yy8:
if (yybm[0+yych] & 128) {
goto yy8;
}
#line 123 "ext/standard/url_scanner_ex.re"
#line 123 "url_scanner_ex.re"
{ goto scan; }
#line 186 "ext/standard/url_scanner_ex.c"
#line 186 "url_scanner_ex.c"
}
#line 124 "ext/standard/url_scanner_ex.re"
#line 124 "url_scanner_ex.re"
done:
@ -364,7 +364,7 @@ state_plain_begin:
state_plain:
start = YYCURSOR;
#line 368 "ext/standard/url_scanner_ex.c"
#line 368 "url_scanner_ex.c"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
@ -407,9 +407,9 @@ state_plain:
goto yy15;
}
++YYCURSOR;
#line 303 "ext/standard/url_scanner_ex.re"
#line 303 "url_scanner_ex.re"
{ passthru(STD_ARGS); STATE = STATE_TAG; goto state_tag; }
#line 413 "ext/standard/url_scanner_ex.c"
#line 413 "url_scanner_ex.c"
yy15:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
@ -417,17 +417,17 @@ yy15:
if (yybm[0+yych] & 128) {
goto yy15;
}
#line 304 "ext/standard/url_scanner_ex.re"
#line 304 "url_scanner_ex.re"
{ passthru(STD_ARGS); goto state_plain; }
#line 423 "ext/standard/url_scanner_ex.c"
#line 423 "url_scanner_ex.c"
}
#line 305 "ext/standard/url_scanner_ex.re"
#line 305 "url_scanner_ex.re"
state_tag:
start = YYCURSOR;
#line 431 "ext/standard/url_scanner_ex.c"
#line 431 "url_scanner_ex.c"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
@ -478,14 +478,14 @@ yy20:
yych = *YYCURSOR;
goto yy25;
yy21:
#line 310 "ext/standard/url_scanner_ex.re"
#line 310 "url_scanner_ex.re"
{ handle_tag(STD_ARGS); /* Sets STATE */; passthru(STD_ARGS); if (STATE == STATE_PLAIN) goto state_plain; else goto state_next_arg; }
#line 484 "ext/standard/url_scanner_ex.c"
#line 484 "url_scanner_ex.c"
yy22:
++YYCURSOR;
#line 311 "ext/standard/url_scanner_ex.re"
#line 311 "url_scanner_ex.re"
{ passthru(STD_ARGS); goto state_plain_begin; }
#line 489 "ext/standard/url_scanner_ex.c"
#line 489 "url_scanner_ex.c"
yy24:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
@ -496,7 +496,7 @@ yy25:
}
goto yy21;
}
#line 312 "ext/standard/url_scanner_ex.re"
#line 312 "url_scanner_ex.re"
state_next_arg_begin:
@ -505,7 +505,7 @@ state_next_arg_begin:
state_next_arg:
start = YYCURSOR;
#line 509 "ext/standard/url_scanner_ex.c"
#line 509 "url_scanner_ex.c"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
@ -570,28 +570,28 @@ yy28:
++YYCURSOR;
if ((yych = *YYCURSOR) == '>') goto yy39;
yy29:
#line 323 "ext/standard/url_scanner_ex.re"
#line 323 "url_scanner_ex.re"
{ passthru(STD_ARGS); goto state_plain_begin; }
#line 576 "ext/standard/url_scanner_ex.c"
#line 576 "url_scanner_ex.c"
yy30:
++YYCURSOR;
yy31:
#line 320 "ext/standard/url_scanner_ex.re"
#line 320 "url_scanner_ex.re"
{ passthru(STD_ARGS); handle_form(STD_ARGS); goto state_plain_begin; }
#line 582 "ext/standard/url_scanner_ex.c"
#line 582 "url_scanner_ex.c"
yy32:
++YYCURSOR;
yych = *YYCURSOR;
goto yy38;
yy33:
#line 321 "ext/standard/url_scanner_ex.re"
#line 321 "url_scanner_ex.re"
{ passthru(STD_ARGS); goto state_next_arg; }
#line 590 "ext/standard/url_scanner_ex.c"
#line 590 "url_scanner_ex.c"
yy34:
++YYCURSOR;
#line 322 "ext/standard/url_scanner_ex.re"
#line 322 "url_scanner_ex.re"
{ --YYCURSOR; STATE = STATE_ARG; goto state_arg; }
#line 595 "ext/standard/url_scanner_ex.c"
#line 595 "url_scanner_ex.c"
yy36:
yych = *++YYCURSOR;
goto yy29;
@ -609,13 +609,13 @@ yy39:
yych = *YYCURSOR;
goto yy31;
}
#line 324 "ext/standard/url_scanner_ex.re"
#line 324 "url_scanner_ex.re"
state_arg:
start = YYCURSOR;
#line 619 "ext/standard/url_scanner_ex.c"
#line 619 "url_scanner_ex.c"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
@ -663,14 +663,14 @@ yy42:
yych = *YYCURSOR;
goto yy47;
yy43:
#line 329 "ext/standard/url_scanner_ex.re"
#line 329 "url_scanner_ex.re"
{ passthru(STD_ARGS); handle_arg(STD_ARGS); STATE = STATE_BEFORE_VAL; goto state_before_val; }
#line 669 "ext/standard/url_scanner_ex.c"
#line 669 "url_scanner_ex.c"
yy44:
++YYCURSOR;
#line 330 "ext/standard/url_scanner_ex.re"
#line 330 "url_scanner_ex.re"
{ passthru(STD_ARGS); STATE = STATE_NEXT_ARG; goto state_next_arg; }
#line 674 "ext/standard/url_scanner_ex.c"
#line 674 "url_scanner_ex.c"
yy46:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
@ -681,13 +681,13 @@ yy47:
}
goto yy43;
}
#line 331 "ext/standard/url_scanner_ex.re"
#line 331 "url_scanner_ex.re"
state_before_val:
start = YYCURSOR;
#line 691 "ext/standard/url_scanner_ex.c"
#line 691 "url_scanner_ex.c"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
@ -734,17 +734,17 @@ yy50:
if (yych == ' ') goto yy57;
if (yych == '=') goto yy55;
yy51:
#line 337 "ext/standard/url_scanner_ex.re"
#line 337 "url_scanner_ex.re"
{ --YYCURSOR; goto state_next_arg_begin; }
#line 740 "ext/standard/url_scanner_ex.c"
#line 740 "url_scanner_ex.c"
yy52:
++YYCURSOR;
yych = *YYCURSOR;
goto yy56;
yy53:
#line 336 "ext/standard/url_scanner_ex.re"
#line 336 "url_scanner_ex.re"
{ passthru(STD_ARGS); STATE = STATE_VAL; goto state_val; }
#line 748 "ext/standard/url_scanner_ex.c"
#line 748 "url_scanner_ex.c"
yy54:
yych = *++YYCURSOR;
goto yy51;
@ -766,14 +766,14 @@ yy57:
YYCURSOR = YYMARKER;
goto yy51;
}
#line 338 "ext/standard/url_scanner_ex.re"
#line 338 "url_scanner_ex.re"
state_val:
start = YYCURSOR;
#line 777 "ext/standard/url_scanner_ex.c"
#line 777 "url_scanner_ex.c"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
@ -834,9 +834,9 @@ state_val:
yych = *(YYMARKER = ++YYCURSOR);
if (yych != '>') goto yy76;
yy63:
#line 347 "ext/standard/url_scanner_ex.re"
#line 347 "url_scanner_ex.re"
{ passthru(STD_ARGS); goto state_next_arg_begin; }
#line 840 "ext/standard/url_scanner_ex.c"
#line 840 "url_scanner_ex.c"
yy64:
yych = *(YYMARKER = ++YYCURSOR);
if (yych == '>') goto yy63;
@ -846,9 +846,9 @@ yy65:
yych = *YYCURSOR;
goto yy69;
yy66:
#line 346 "ext/standard/url_scanner_ex.re"
#line 346 "url_scanner_ex.re"
{ handle_val(STD_ARGS, 0, ' '); goto state_next_arg_begin; }
#line 852 "ext/standard/url_scanner_ex.c"
#line 852 "url_scanner_ex.c"
yy67:
yych = *++YYCURSOR;
goto yy63;
@ -875,9 +875,9 @@ yy72:
goto yy63;
yy73:
++YYCURSOR;
#line 345 "ext/standard/url_scanner_ex.re"
#line 345 "url_scanner_ex.re"
{ handle_val(STD_ARGS, 1, '\''); goto state_next_arg_begin; }
#line 881 "ext/standard/url_scanner_ex.c"
#line 881 "url_scanner_ex.c"
yy75:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
@ -888,11 +888,11 @@ yy76:
}
if (yych >= '>') goto yy72;
++YYCURSOR;
#line 344 "ext/standard/url_scanner_ex.re"
#line 344 "url_scanner_ex.re"
{ handle_val(STD_ARGS, 1, '"'); goto state_next_arg_begin; }
#line 894 "ext/standard/url_scanner_ex.c"
#line 894 "url_scanner_ex.c"
}
#line 348 "ext/standard/url_scanner_ex.re"
#line 348 "url_scanner_ex.re"
stop:
@ -978,7 +978,7 @@ static int php_url_scanner_ex_deactivate(TSRMLS_D)
return SUCCESS;
}
static void php_url_scanner_output_handler(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC)
static void php_url_scanner_output_handler(char *output, zend_str_size_uint output_len, char **handled_output, zend_str_size_uint *handled_output_len, int mode TSRMLS_DC)
{
size_t len;
@ -1009,10 +1009,10 @@ static void php_url_scanner_output_handler(char *output, uint output_len, char *
}
}
PHPAPI int php_url_scanner_add_var(char *name, int name_len, char *value, int value_len, int urlencode TSRMLS_DC)
PHPAPI int php_url_scanner_add_var(char *name, zend_str_size_int name_len, char *value, zend_str_size_int value_len, int urlencode TSRMLS_DC)
{
char *encoded;
int encoded_len;
zend_str_size_int encoded_len;
smart_str val;
if (! BG(url_adapt_state_ex).active) {

2
ext/standard/url_scanner_ex.h

@ -28,7 +28,7 @@ PHP_RINIT_FUNCTION(url_scanner_ex);
PHP_RSHUTDOWN_FUNCTION(url_scanner_ex);
PHPAPI char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen TSRMLS_DC);
PHPAPI int php_url_scanner_add_var(char *name, int name_len, char *value, int value_len, int urlencode TSRMLS_DC);
PHPAPI int php_url_scanner_add_var(char *name, zend_str_size_int name_len, char *value, zend_str_size_int value_len, int urlencode TSRMLS_DC);
PHPAPI int php_url_scanner_reset_vars(TSRMLS_D);
#include "php_smart_str_public.h"

8
ext/standard/url_scanner_ex.re

@ -72,7 +72,7 @@ static PHP_INI_MH(OnUpdateTags)
val = strchr(key, '=');
if (val) {
char *q;
int keylen;
zend_str_size_int keylen;
*val++ = '\0';
for (q = key; *q; q++)
@ -430,7 +430,7 @@ static int php_url_scanner_ex_deactivate(TSRMLS_D)
return SUCCESS;
}
static void php_url_scanner_output_handler(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC)
static void php_url_scanner_output_handler(char *output, zend_str_size_uint output_len, char **handled_output, zend_str_size_uint *handled_output_len, int mode TSRMLS_DC)
{
size_t len;
@ -461,10 +461,10 @@ static void php_url_scanner_output_handler(char *output, uint output_len, char *
}
}
PHPAPI int php_url_scanner_add_var(char *name, int name_len, char *value, int value_len, int urlencode TSRMLS_DC)
PHPAPI int php_url_scanner_add_var(char *name, zend_str_size_int name_len, char *value, zend_str_size_int value_len, int urlencode TSRMLS_DC)
{
char *encoded;
int encoded_len;
zend_str_size_int encoded_len;
smart_str val;
if (! BG(url_adapt_state_ex).active) {

6
ext/standard/versioning.c

@ -33,7 +33,7 @@
PHPAPI char *
php_canonicalize_version(const char *version)
{
int len = strlen(version);
zend_str_size_int len = strlen(version);
char *buf = safe_emalloc(len, 2, 1), *q, lp, lq;
const char *p;
@ -211,11 +211,11 @@ php_version_compare(const char *orig_ver1, const char *orig_ver2)
PHP_FUNCTION(version_compare)
{
char *v1, *v2, *op = NULL;
int v1_len, v2_len, op_len = 0;
zend_str_size_int v1_len, v2_len, op_len = 0;
int compare, argc;
argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(argc TSRMLS_CC, "ss|s", &v1, &v1_len, &v2,
if (zend_parse_parameters(argc TSRMLS_CC, "SS|S", &v1, &v1_len, &v2,
&v2_len, &op, &op_len) == FAILURE) {
return;
}

2
main/SAPI.h

@ -165,7 +165,7 @@ END_EXTERN_C()
typedef struct {
char *line; /* If you allocated this, you need to free it yourself */
uint line_len;
zend_str_size_uint line_len;
long response_code; /* long due to zend_parse_parameters compatibility */
} sapi_header_line;

5
main/spprintf.c

@ -198,7 +198,8 @@ static size_t strnlen(const char *s, size_t maxlen) {
static void xbuf_format_converter(smart_str *xbuf, const char *fmt, va_list ap) /* {{{ */
{
char *s = NULL;
int s_len, free_zcopy;
zend_str_size_int s_len;
int free_zcopy;
zval *zvp, zcopy;
int min_width = 0;
@ -811,7 +812,7 @@ PHPAPI zend_str_size_int vspprintf(char **pbuf, zend_str_size_size_t max_len, co
PHPAPI zend_str_size_int spprintf(char **pbuf, size_t max_len, const char *format, ...) /* {{{ */
{
int cc;
zend_str_size_int cc;
va_list ap;
va_start(ap, format);

Loading…
Cancel
Save