cvs: php4 /ext/ftp php_ftp.c /ext/standard file.c fsock.c html.c /main php_network.h

From: Date: Sat, 16 Mar 2002 02:33:01 +0000
Subject: cvs: php4 /ext/ftp php_ftp.c /ext/standard file.c fsock.c html.c /main php_network.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-10202@lists.php.net to get a copy of this message
wez Fri Mar 15 21:33:01 2002 EDT Modified files: /php4/ext/ftp php_ftp.c /php4/ext/standard file.c fsock.c html.c /php4/main php_network.h Log: This should help with some build problems/warnings under win32. Someone still needs to add the streams.c file to the MSVC project/workspace though (there are so many that I don't really know what I am doing :-). Index: php4/ext/ftp/php_ftp.c diff -u php4/ext/ftp/php_ftp.c:1.54 php4/ext/ftp/php_ftp.c:1.55 --- php4/ext/ftp/php_ftp.c:1.54 Fri Mar 15 16:02:58 2002 +++ php4/ext/ftp/php_ftp.c Fri Mar 15 21:32:59 2002 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_ftp.c,v 1.54 2002/03/15 21:02:58 wez Exp $ */ +/* $Id: php_ftp.c,v 1.55 2002/03/16 02:32:59 wez Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -480,7 +480,7 @@ RETURN_FALSE; } - outstream = php_stream_fopen(local, "wb", NULL TSRMLS_C); + outstream = php_stream_fopen(local, "wb", NULL TSRMLS_CC); if (outstream == NULL) { php_stream_close(tmpstream); @@ -547,7 +547,7 @@ ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); XTYPE(xtype, mode); - instream = php_stream_fopen(local, "rb", NULL TSRMLS_C); + instream = php_stream_fopen(local, "rb", NULL TSRMLS_CC); if (instream == NULL) { RETURN_FALSE; Index: php4/ext/standard/file.c diff -u php4/ext/standard/file.c:1.207 php4/ext/standard/file.c:1.208 --- php4/ext/standard/file.c:1.207 Fri Mar 15 20:34:52 2002 +++ php4/ext/standard/file.c Fri Mar 15 21:32:59 2002 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: file.c,v 1.207 2002/03/16 01:34:52 wez Exp $ */ +/* $Id: file.c,v 1.208 2002/03/16 02:32:59 wez Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -1284,7 +1284,9 @@ size_t bcount = 0; int ready = 0; char buf[8192]; +#ifdef HAVE_MMAP int fd; +#endif #ifdef HAVE_MMAP if (!php_stream_is(stream, PHP_STREAM_IS_SOCKET) Index: php4/ext/standard/fsock.c diff -u php4/ext/standard/fsock.c:1.86 php4/ext/standard/fsock.c:1.87 --- php4/ext/standard/fsock.c:1.86 Fri Mar 15 20:34:52 2002 +++ php4/ext/standard/fsock.c Fri Mar 15 21:33:00 2002 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: fsock.c,v 1.86 2002/03/16 01:34:52 wez Exp $ */ +/* $Id: fsock.c,v 1.87 2002/03/16 02:33:00 wez Exp $ */ /* converted to PHP Streams and moved much code to main/network.c [wez] */ @@ -193,7 +193,7 @@ } else #endif - stream = php_stream_sock_open_host(host, port, socktype, timeout, persistent); + stream = php_stream_sock_open_host(host, port, socktype, (int)timeout, persistent); #if HAVE_OPENSSL_EXT if (stream) { Index: php4/ext/standard/html.c diff -u php4/ext/standard/html.c:1.43 php4/ext/standard/html.c:1.44 --- php4/ext/standard/html.c:1.43 Fri Mar 15 20:34:52 2002 +++ php4/ext/standard/html.c Fri Mar 15 21:33:00 2002 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: html.c,v 1.43 2002/03/16 01:34:52 wez Exp $ */ +/* $Id: html.c,v 1.44 2002/03/16 02:33:00 wez Exp $ */ #include "php.h" #include "reg.h" @@ -408,11 +408,10 @@ */ PHPAPI char *php_unescape_html_entities(unsigned char *old, int oldlen, int *newlen, int all, int quote_style, char *hint_charset) { - int i, maxlen, len, retlen; + int retlen; int j, k; char *replaced, *ret; enum entity_charset charset = determine_charset(hint_charset); - int matches_map; unsigned char replacement[15]; ret = estrdup(old); @@ -457,7 +456,7 @@ if (basic_entities[j].flags && (quote_style & basic_entities[j].flags) == 0) continue; - replacement[0] = basic_entities[j].charcode; + replacement[0] = (unsigned char)basic_entities[j].charcode; replacement[1] = '\0'; replaced = php_str_to_str(ret, retlen, basic_entities[j].entity, basic_entities[j].entitylen, replacement, 1, &retlen); @@ -674,7 +673,7 @@ if (basic_entities[j].flags && (quote_style & basic_entities[j].flags) == 0) continue; - ind[0] = basic_entities[j].charcode; + ind[0] = (unsigned char)basic_entities[j].charcode; add_assoc_string(return_value, ind, basic_entities[j].entity, 1); } break; Index: php4/main/php_network.h diff -u php4/main/php_network.h:1.14 php4/main/php_network.h:1.15 --- php4/main/php_network.h:1.14 Fri Mar 15 20:58:13 2002 +++ php4/main/php_network.h Fri Mar 15 21:33:00 2002 @@ -15,7 +15,7 @@ | Author: Stig Venaas <venaas@uninett.no> | +----------------------------------------------------------------------+ */ -/* $Id: php_network.h,v 1.14 2002/03/16 01:58:13 wez Exp $ */ +/* $Id: php_network.h,v 1.15 2002/03/16 02:33:00 wez Exp $ */ #ifndef _PHP_NETWORK_H #define _PHP_NETWORK_H @@ -37,6 +37,11 @@ #define shutdown(s,n) /* nothing */ #endif +#ifdef PHP_WIN32 +#define EWOULDBLOCK WSAEWOULDBLOCK +# define fsync _commit +# define ftruncate(a, b) chsize(a, b) +#endif /* defined(PHP_WIN32) */ #ifdef HAVE_NETINET_IN_H # include <netinet/in.h> @@ -52,6 +57,10 @@ #if HAVE_OPENSSL_EXT #include <openssl/ssl.h> +#endif + +#ifdef HAVE_STDDEF_H +#include <stddef.h> #endif #ifdef HAVE_SOCKADDR_STORAGE

« previous php.cvs (#10202) next »