From f90fe17424199aa8614857ebcaf5aac142ac8092 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Tue, 12 Nov 2013 00:24:52 +0100 Subject: define platform dependent zend_off_t --- ext/standard/php_fopen_wrapper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/standard/php_fopen_wrapper.c') diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index 0adb1e0529..31fc21b80e 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -65,7 +65,7 @@ php_stream_ops php_stream_output_ops = { typedef struct php_stream_input { /* {{{ */ php_stream **body_ptr; - off_t position; + zend_off_t position; } php_stream_input_t; /* }}} */ @@ -118,7 +118,7 @@ static int php_stream_input_flush(php_stream *stream TSRMLS_DC) /* {{{ */ } /* }}} */ -static int php_stream_input_seek(php_stream *stream, off_t offset, int whence, off_t *newoffset TSRMLS_DC) /* {{{ */ +static int php_stream_input_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset TSRMLS_DC) /* {{{ */ { php_stream_input_t *input = stream->abstract; -- cgit v1.2.1 From 15bb12b269ddb0751c2e9b232dd0b5dd5999bdad Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Wed, 13 Nov 2013 12:39:12 +0100 Subject: fixed "struct stat" usage in main, cli and ext/standard --- ext/standard/php_fopen_wrapper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/standard/php_fopen_wrapper.c') diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index 31fc21b80e..0b4b7fca39 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -379,9 +379,9 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa #if defined(S_IFSOCK) && !defined(WIN32) && !defined(__BEOS__) do { - struct stat st; + php_stat_t st; memset(&st, 0, sizeof(st)); - if (fstat(fd, &st) == 0 && (st.st_mode & S_IFMT) == S_IFSOCK) { + if (php_fstat(fd, &st) == 0 && (st.st_mode & S_IFMT) == S_IFSOCK) { stream = php_stream_sock_open_from_socket(fd, NULL); if (stream) { stream->ops = &php_stream_socket_ops; -- cgit v1.2.1 From a218f8f3a4c7d1532c595b4040f0a230c9786039 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 25 Nov 2013 00:43:05 +0100 Subject: ZEND_INT_FMT and some more for ext/standard --- ext/standard/php_fopen_wrapper.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'ext/standard/php_fopen_wrapper.c') diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index 0b4b7fca39..b58640deec 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -178,7 +178,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa int mode_rw = 0; php_stream * stream = NULL; char *p, *token, *pathdup; - long max_memory; + php_int_t max_memory; FILE *file = NULL; if (!strncasecmp(path, "php://", 6)) { @@ -190,7 +190,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa max_memory = PHP_STREAM_MAX_MEM; if (!strncasecmp(path, "/maxmemory:", 11)) { path += 11; - max_memory = strtol(path, NULL, 10); + max_memory = ZEND_STRTOL(path, NULL, 10); if (max_memory < 0) { php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Max memory must be >= 0"); return NULL; @@ -285,7 +285,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa } else if (!strncasecmp(path, "fd/", 3)) { const char *start; char *end; - long fildes_ori; + php_int_t fildes_ori; int dtablesize; if (strcmp(sapi_module.name, "cli")) { @@ -303,7 +303,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa } start = &path[3]; - fildes_ori = strtol(start, &end, 10); + fildes_ori = ZEND_STRTOL(start, &end, 10); if (end == start || *end != '\0') { php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "php://fd/ stream must be specified in the form php://fd/"); @@ -325,7 +325,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa fd = dup(fildes_ori); if (fd == -1) { php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, - "Error duping file descriptor %ld; possibly it doesn't exist: " + "Error duping file descriptor " ZEND_INT_FMT "; possibly it doesn't exist: " "[%d]: %s", fildes_ori, errno, strerror(errno)); return NULL; } -- cgit v1.2.1 From d5c924750b97aa034e8223f4c7b8005844512548 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Sun, 9 Feb 2014 10:55:52 +0100 Subject: replace *_STRTOL with STRTOI, etc. --- ext/standard/php_fopen_wrapper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/standard/php_fopen_wrapper.c') diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index 9d46435580..583ccdc232 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -190,7 +190,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa max_memory = PHP_STREAM_MAX_MEM; if (!strncasecmp(path, "/maxmemory:", 11)) { path += 11; - max_memory = ZEND_STRTOL(path, NULL, 10); + max_memory = ZEND_STRTOI(path, NULL, 10); if (max_memory < 0) { php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Max memory must be >= 0"); return NULL; @@ -303,7 +303,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa } start = &path[3]; - fildes_ori = ZEND_STRTOL(start, &end, 10); + fildes_ori = ZEND_STRTOI(start, &end, 10); if (end == start || *end != '\0') { php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "php://fd/ stream must be specified in the form php://fd/"); -- cgit v1.2.1 From b8324e6d635450562ecb253af38f22105e19e460 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 18 Aug 2014 16:50:54 +0200 Subject: further fixes to ext/standard --- ext/standard/php_fopen_wrapper.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'ext/standard/php_fopen_wrapper.c') diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index 9628c0d69d..bf4a62ff2b 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -65,7 +65,7 @@ php_stream_ops php_stream_output_ops = { typedef struct php_stream_input { /* {{{ */ php_stream *body; - off_t position; + zend_off_t position; } php_stream_input_t; /* }}} */ @@ -118,7 +118,7 @@ static int php_stream_input_flush(php_stream *stream TSRMLS_DC) /* {{{ */ } /* }}} */ -static int php_stream_input_seek(php_stream *stream, off_t offset, int whence, off_t *newoffset TSRMLS_DC) /* {{{ */ +static int php_stream_input_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset TSRMLS_DC) /* {{{ */ { php_stream_input_t *input = stream->abstract; @@ -178,7 +178,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa int mode_rw = 0; php_stream * stream = NULL; char *p, *token, *pathdup; - long max_memory; + php_int_t max_memory; FILE *file = NULL; if (!strncasecmp(path, "php://", 6)) { @@ -190,7 +190,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa max_memory = PHP_STREAM_MAX_MEM; if (!strncasecmp(path, "/maxmemory:", 11)) { path += 11; - max_memory = strtol(path, NULL, 10); + max_memory = ZEND_STRTOI(path, NULL, 10); if (max_memory < 0) { php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Max memory must be >= 0"); return NULL; @@ -286,7 +286,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa } else if (!strncasecmp(path, "fd/", 3)) { const char *start; char *end; - long fildes_ori; + php_int_t fildes_ori; int dtablesize; if (strcmp(sapi_module.name, "cli")) { @@ -304,7 +304,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa } start = &path[3]; - fildes_ori = strtol(start, &end, 10); + fildes_ori = ZEND_STRTOI(start, &end, 10); if (end == start || *end != '\0') { php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "php://fd/ stream must be specified in the form php://fd/"); @@ -326,7 +326,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa fd = dup(fildes_ori); if (fd == -1) { php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, - "Error duping file descriptor %ld; possibly it doesn't exist: " + "Error duping file descriptor " ZEND_INT_FMT "; possibly it doesn't exist: " "[%d]: %s", fildes_ori, errno, strerror(errno)); return NULL; } @@ -380,9 +380,9 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa #if defined(S_IFSOCK) && !defined(WIN32) && !defined(__BEOS__) do { - struct stat st; + php_stat_t st; memset(&st, 0, sizeof(st)); - if (fstat(fd, &st) == 0 && (st.st_mode & S_IFMT) == S_IFSOCK) { + if (php_fstat(fd, &st) == 0 && (st.st_mode & S_IFMT) == S_IFSOCK) { stream = php_stream_sock_open_from_socket(fd, NULL); if (stream) { stream->ops = &php_stream_socket_ops; -- cgit v1.2.1 From c3e3c98ec666812daaaca896cf5ef758a8a6df14 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 25 Aug 2014 19:24:55 +0200 Subject: master renames phase 1 --- ext/standard/php_fopen_wrapper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/standard/php_fopen_wrapper.c') diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index bf4a62ff2b..5280a4f014 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -178,7 +178,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa int mode_rw = 0; php_stream * stream = NULL; char *p, *token, *pathdup; - php_int_t max_memory; + zend_long max_memory; FILE *file = NULL; if (!strncasecmp(path, "php://", 6)) { @@ -286,7 +286,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa } else if (!strncasecmp(path, "fd/", 3)) { const char *start; char *end; - php_int_t fildes_ori; + zend_long fildes_ori; int dtablesize; if (strcmp(sapi_module.name, "cli")) { -- cgit v1.2.1 From 4d997f63d98c663b2d9acccd3655572652f61c7d Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 25 Aug 2014 20:22:49 +0200 Subject: master renames phase 3 --- ext/standard/php_fopen_wrapper.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ext/standard/php_fopen_wrapper.c') diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index 5280a4f014..7b52494688 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -190,7 +190,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa max_memory = PHP_STREAM_MAX_MEM; if (!strncasecmp(path, "/maxmemory:", 11)) { path += 11; - max_memory = ZEND_STRTOI(path, NULL, 10); + max_memory = ZEND_STRTOL(path, NULL, 10); if (max_memory < 0) { php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Max memory must be >= 0"); return NULL; @@ -304,7 +304,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa } start = &path[3]; - fildes_ori = ZEND_STRTOI(start, &end, 10); + fildes_ori = ZEND_STRTOL(start, &end, 10); if (end == start || *end != '\0') { php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "php://fd/ stream must be specified in the form php://fd/"); @@ -326,7 +326,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa fd = dup(fildes_ori); if (fd == -1) { php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, - "Error duping file descriptor " ZEND_INT_FMT "; possibly it doesn't exist: " + "Error duping file descriptor " ZEND_LONG_FMT "; possibly it doesn't exist: " "[%d]: %s", fildes_ori, errno, strerror(errno)); return NULL; } @@ -380,7 +380,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa #if defined(S_IFSOCK) && !defined(WIN32) && !defined(__BEOS__) do { - php_stat_t st; + zend_stat_t st; memset(&st, 0, sizeof(st)); if (php_fstat(fd, &st) == 0 && (st.st_mode & S_IFMT) == S_IFSOCK) { stream = php_stream_sock_open_from_socket(fd, NULL); -- cgit v1.2.1 From 455741fce3c4f4392deb97775cba7a39f6490271 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 25 Aug 2014 20:57:25 +0200 Subject: master renames phase 4 --- ext/standard/php_fopen_wrapper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/standard/php_fopen_wrapper.c') diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index 7b52494688..3859e5b9a4 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -382,7 +382,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa do { zend_stat_t st; memset(&st, 0, sizeof(st)); - if (php_fstat(fd, &st) == 0 && (st.st_mode & S_IFMT) == S_IFSOCK) { + if (zend_fstat(fd, &st) == 0 && (st.st_mode & S_IFMT) == S_IFSOCK) { stream = php_stream_sock_open_from_socket(fd, NULL); if (stream) { stream->ops = &php_stream_socket_ops; -- cgit v1.2.1