cvs: php4 /ext/standard dl.c dns.c file.c filestat.c flock_compat.c fsock.c fsock.h ftp_fopen_wrapper.c head.c http_fopen_wrapper.c
| From: | Anantha Kesari H Y | Date: | Thu, 05 Sep 2002 14:21:55 +0000 |
| Subject: | cvs: php4 /ext/standard dl.c dns.c file.c filestat.c flock_compat.c fsock.c fsock.h ftp_fopen_wrapper.c head.c http_fopen_wrapper.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-13858@lists.php.net to get a copy of this message | ||
hyanantha Thu Sep 5 10:21:55 2002 EDT
Modified files:
/php4/ext/standard dl.c dns.c file.c filestat.c flock_compat.c
fsock.c fsock.h ftp_fopen_wrapper.c head.c
http_fopen_wrapper.c
Log:
NetWare related additions/modifications
Index: php4/ext/standard/dl.c diff -u php4/ext/standard/dl.c:1.70 php4/ext/standard/dl.c:1.71 --- php4/ext/standard/dl.c:1.70 Fri Aug 23 21:19:27 2002 +++ php4/ext/standard/dl.c Thu Sep 5 10:21:55 2002 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dl.c,v 1.70 2002/08/24 01:19:27 helly Exp $ */ +/* $Id: dl.c,v 1.71 2002/09/05 14:21:55 hyanantha Exp $ */ #include "php.h" #include "dl.h" @@ -26,7 +26,8 @@ #include "ext/standard/info.h" #include "SAPI.h" -#ifndef PHP_WIN32 +/*#ifndef PHP_WIN32*/ +#if !defined(PHP_WIN32) && !defined(NETWARE) #include "build-defs.h" #endif @@ -34,7 +35,8 @@ #include <stdlib.h> #include <stdio.h> -#if HAVE_STRING_H +/*#if HAVE_STRING_H*/ +#ifdef HAVE_STRING_H #include <string.h> #else #include <strings.h> @@ -43,6 +45,13 @@ #include "win32/param.h" #include "win32/winutil.h" #define GET_DL_ERROR() php_win_err() +#elif defined(NETWARE) +#ifdef NEW_LIBC +#include <sys/param.h> +#else +#include "netware/param.h" +#endif +#define GET_DL_ERROR() dlerror() #else #include <sys/param.h> #define GET_DL_ERROR() DL_ERROR() @@ -141,7 +150,7 @@ efree(libpath); - +#ifndef NETWARE get_module = (zend_module_entry *(*)(void)) DL_FETCH_SYMBOL(handle, "get_module"); /* @@ -152,6 +161,23 @@ if (!get_module) get_module = (zend_module_entry *(*)(void)) DL_FETCH_SYMBOL(handle, "_get_module"); +#else + /* NetWare doesn't support two NLMs exporting same symbol */ + { + char symbol_name[64] = "\0"; + int module_name_length = Z_STRLEN_P(file) - 4; /* '.nlm' is 4 characters; knock it off */ + + /* Take the module name (e.g.: 'php_ldap') and append '@get_module' to it */ + strncpy(symbol_name, Z_STRVAL_P(file), module_name_length); + symbol_name[module_name_length] = '\0'; + strcat(symbol_name, "@"); + strcat(symbol_name, "get_module"); + + get_module = (zend_module_entry *(*)(void)) DL_FETCH_SYMBOL(handle, symbol_name); + } + /* NetWare doesn't prepend '_' to symbol names; so the corresponding portion of code is also + not required for NetWare */ +#endif if (!get_module) { DL_UNLOAD(handle); Index: php4/ext/standard/dns.c diff -u php4/ext/standard/dns.c:1.42 php4/ext/standard/dns.c:1.43 --- php4/ext/standard/dns.c:1.42 Thu Aug 29 11:58:33 2002 +++ php4/ext/standard/dns.c Thu Sep 5 10:21:55 2002 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dns.c,v 1.42 2002/08/29 15:58:33 iliaa Exp $ */ +/* $Id: dns.c,v 1.43 2002/09/05 14:21:55 hyanantha Exp $ */ /* {{{ includes */ @@ -42,7 +42,7 @@ #endif #endif #include <winsock.h> -#else +#else /* This holds good for NetWare too, both for Winsock and Berkeley sockets */ #include <netinet/in.h> #if HAVE_ARPA_INET_H #include <arpa/inet.h> @@ -60,6 +60,11 @@ #endif #endif +/* Borrowed from SYS/SOCKET.H */ +#if defined(NETWARE) && defined(USE_WINSOCK) +#define AF_INET 2 /* internetwork: UDP, TCP, etc. */ +#endif + #include "dns.h" /* }}} */ @@ -201,7 +206,7 @@ } /* }}} */ -#if HAVE_RES_SEARCH && !(defined(__BEOS__)||defined(PHP_WIN32)) +#if HAVE_RES_SEARCH && !(defined(__BEOS__)||defined(PHP_WIN32) || defined(NETWARE)) /* {{{ proto int checkdnsrr(string host [, string type]) Check DNS records corresponding to a given Internet host name or IP address */ Index: php4/ext/standard/file.c diff -u php4/ext/standard/file.c:1.250 php4/ext/standard/file.c:1.251 --- php4/ext/standard/file.c:1.250 Mon Aug 26 19:18:59 2002 +++ php4/ext/standard/file.c Thu Sep 5 10:21:55 2002 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: file.c,v 1.250 2002/08/26 23:18:59 helly Exp $ */ +/* $Id: file.c,v 1.251 2002/09/05 14:21:55 hyanantha Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -47,11 +47,19 @@ #define O_RDONLY _O_RDONLY #include "win32/param.h" #include "win32/winutil.h" +#elif defined(NETWARE) && !defined(NEW_LIBC) +/*#include <ws2nlm.h>*/ +#include <sys/socket.h> +#include "netware/param.h" #else #include <sys/param.h> +#if defined(NETWARE) && defined(USE_WINSOCK) +#include <novsock2.h> +#else #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> +#endif #if HAVE_ARPA_INET_H #include <arpa/inet.h> #endif @@ -63,6 +71,8 @@ #if HAVE_PWD_H #ifdef PHP_WIN32 #include "win32/pwd.h" +#elif defined(NETWARE) +#include "netware/pwd.h" #else #include <pwd.h> #endif @@ -2114,7 +2124,7 @@ /* }}} */ -#if (!defined(PHP_WIN32) && !defined(__BEOS__) && HAVE_REALPATH) || defined(ZTS) +#if (!defined(PHP_WIN32) && !defined(__BEOS__) && !defined(NETWARE) && HAVE_REALPATH) || defined(ZTS) /* {{{ proto string realpath(string path) Return the resolved path */ PHP_FUNCTION(realpath) Index: php4/ext/standard/filestat.c diff -u php4/ext/standard/filestat.c:1.102 php4/ext/standard/filestat.c:1.103 --- php4/ext/standard/filestat.c:1.102 Fri Aug 23 21:19:28 2002 +++ php4/ext/standard/filestat.c Thu Sep 5 10:21:55 2002 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: filestat.c,v 1.102 2002/08/24 01:19:28 helly Exp $ */ +/* $Id: filestat.c,v 1.103 2002/09/05 14:21:55 hyanantha Exp $ */ #include "php.h" #include "safe_mode.h" @@ -54,6 +54,8 @@ #if HAVE_PWD_H # ifdef PHP_WIN32 # include "win32/pwd.h" +# elif defined(NETWARE) +# include "netware/pwd.h" # else # include <pwd.h> # endif @@ -335,7 +337,8 @@ Change file group */ PHP_FUNCTION(chgrp) { -#ifndef WINDOWS +/*#ifndef WINDOWS*/ +#if !defined(WINDOWS) && !defined(NETWARE) /* I guess 'chgrp' won't be available on NetWare */ pval **filename, **group; gid_t gid; struct group *gr=NULL; @@ -383,7 +386,8 @@ Change file owner */ PHP_FUNCTION(chown) { -#ifndef WINDOWS +/*#ifndef WINDOWS*/ +#if !defined(WINDOWS) && !defined(NETWARE) /* I guess 'chown' won't be available on NetWare */ pval **filename, **user; int ret; uid_t uid; @@ -472,7 +476,11 @@ { pval **filename, **filetime, **fileatime; int ret; +#if defined(NETWARE) && defined(CLIB_STAT_PATCH) + struct stat_libc sb; +#else struct stat sb; +#endif FILE *file; struct utimbuf newtimebuf; struct utimbuf *newtime = NULL; @@ -546,7 +554,11 @@ { zval *stat_dev, *stat_ino, *stat_mode, *stat_nlink, *stat_uid, *stat_gid, *stat_rdev, *stat_size, *stat_atime, *stat_mtime, *stat_ctime, *stat_blksize, *stat_blocks; +#if defined(NETWARE) && defined(CLIB_STAT_PATCH) + struct stat_libc *stat_sb; +#else struct stat *stat_sb; +#endif int rmask=S_IROTH, wmask=S_IWOTH, xmask=S_IXOTH; /* access rights defaults to other */ char *stat_sb_names[13]={"dev", "ino", "mode", "nlink", "uid", "gid", "rdev", "size", "atime", "mtime", "ctime", "blksize", "blocks"}; @@ -612,6 +624,7 @@ #endif +#ifndef NETWARE if (type >= FS_IS_W && type <= FS_IS_X) { if(BG(sb).st_uid==getuid()) { rmask=S_IRUSR; @@ -641,6 +654,7 @@ } } } +#endif switch (type) { case FS_PERMS: @@ -654,11 +668,23 @@ case FS_GROUP: RETURN_LONG((long)BG(sb).st_gid); case FS_ATIME: - RETURN_LONG((long)BG(sb).st_atime); +#if defined(NETWARE) && defined(NEW_LIBC) + RETURN_LONG((long)(BG(sb).st_atime).tv_nsec); +#else + RETURN_LONG((long)BG(sb).st_atime); +#endif case FS_MTIME: - RETURN_LONG((long)BG(sb).st_mtime); +#if defined(NETWARE) && defined(NEW_LIBC) + RETURN_LONG((long)(BG(sb).st_mtime).tv_nsec); +#else + RETURN_LONG((long)BG(sb).st_mtime); +#endif case FS_CTIME: - RETURN_LONG((long)BG(sb).st_ctime); +#if defined(NETWARE) && defined(NEW_LIBC) + RETURN_LONG((long)(BG(sb).st_ctime).tv_nsec); +#else + RETURN_LONG((long)BG(sb).st_ctime); +#endif case FS_TYPE: #if HAVE_SYMLINK if (S_ISLNK(BG(lsb).st_mode)) { @@ -678,16 +704,25 @@ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown file type (%d)", BG(sb).st_mode&S_IFMT); RETURN_STRING("unknown", 1); case FS_IS_W: +#ifdef NETWARE + RETURN_LONG(0); +#else if (getuid()==0) { RETURN_TRUE; /* root */ } RETURN_BOOL((BG(sb).st_mode & wmask) != 0); case FS_IS_R: +#ifdef NETWARE + RETURN_LONG(0); +#else if (getuid()==0) { RETURN_TRUE; /* root */ } RETURN_BOOL((BG(sb).st_mode&rmask)!=0); case FS_IS_X: +#ifdef NETWARE + RETURN_LONG(0); +#else if (getuid()==0) { xmask = S_IXROOT; /* root */ } @@ -726,9 +761,15 @@ MAKE_LONG_ZVAL_INCREF(stat_rdev, -1); #endif MAKE_LONG_ZVAL_INCREF(stat_size, stat_sb->st_size); +#if defined(NETWARE) && defined(NEW_LIBC) + MAKE_LONG_ZVAL_INCREF(stat_atime, (stat_sb->st_atime).tv_nsec); + MAKE_LONG_ZVAL_INCREF(stat_mtime, (stat_sb->st_mtime).tv_nsec); + MAKE_LONG_ZVAL_INCREF(stat_ctime, (stat_sb->st_ctime).tv_nsec); +#else MAKE_LONG_ZVAL_INCREF(stat_atime, stat_sb->st_atime); MAKE_LONG_ZVAL_INCREF(stat_mtime, stat_sb->st_mtime); MAKE_LONG_ZVAL_INCREF(stat_ctime, stat_sb->st_ctime); +#endif #ifdef HAVE_ST_BLKSIZE MAKE_LONG_ZVAL_INCREF(stat_blksize, stat_sb->st_blksize); #else Index: php4/ext/standard/flock_compat.c diff -u php4/ext/standard/flock_compat.c:1.16 php4/ext/standard/flock_compat.c:1.17 --- php4/ext/standard/flock_compat.c:1.16 Thu Feb 28 03:26:45 2002 +++ php4/ext/standard/flock_compat.c Thu Sep 5 10:21:55 2002 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: flock_compat.c,v 1.16 2002/02/28 08:26:45 sebastian Exp $ */ +/* $Id: flock_compat.c,v 1.17 2002/09/05 14:21:55 hyanantha Exp $ */ #include <php.h> #include <errno.h> @@ -30,6 +30,14 @@ #ifdef PHP_WIN32 #include <windows.h> #include <io.h> +#endif + +#ifdef NETWARE +#ifdef NEW_LIBC +#include <netinet/in.h> +#else +#include <sys/socket.h> +#endif #endif #ifndef HAVE_FLOCK Index: php4/ext/standard/fsock.c diff -u php4/ext/standard/fsock.c:1.101 php4/ext/standard/fsock.c:1.102 --- php4/ext/standard/fsock.c:1.101 Fri Aug 23 21:19:28 2002 +++ php4/ext/standard/fsock.c Thu Sep 5 10:21:55 2002 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: fsock.c,v 1.101 2002/08/24 01:19:28 helly Exp $ */ +/* $Id: fsock.c,v 1.102 2002/09/05 14:21:55 hyanantha Exp $ */ /* converted to PHP Streams and moved much code to main/network.c [wez] */ @@ -47,6 +47,19 @@ #endif #ifdef PHP_WIN32 #include <winsock.h> +#elif defined(NETWARE) +#ifdef NEW_LIBC +#ifdef USE_WINSOCK +#include <novsock2.h> +#else +#include <netinet/in.h> +#include <netdb.h> +/*#include <sys/socket.h>*/ +#include <sys/select.h> +/*#else +#include <sys/socket.h>*/ +#endif +#endif #else #include <netinet/in.h> #include <netdb.h> @@ -54,7 +67,7 @@ #include <arpa/inet.h> #endif #endif -#if defined(PHP_WIN32) || defined(__riscos__) +#if defined(PHP_WIN32) || defined(__riscos__) || defined(NETWARE) #undef AF_UNIX #endif #if defined(AF_UNIX) @@ -88,6 +101,10 @@ #ifdef PHP_WIN32 #define EWOULDBLOCK WSAEWOULDBLOCK +#elif defined(NETWARE) +#ifdef USE_WINSOCK +#define EWOULDBLOCK WSAEWOULDBLOCK +#endif #else #include "build-defs.h" #endif Index: php4/ext/standard/fsock.h diff -u php4/ext/standard/fsock.h:1.42 php4/ext/standard/fsock.h:1.43 --- php4/ext/standard/fsock.h:1.42 Fri Mar 15 16:03:04 2002 +++ php4/ext/standard/fsock.h Thu Sep 5 10:21:55 2002 @@ -18,12 +18,20 @@ +----------------------------------------------------------------------+ */ -/* $Id: fsock.h,v 1.42 2002/03/15 21:03:04 wez Exp $ */ +/* $Id: fsock.h,v 1.43 2002/09/05 14:21:55 hyanantha Exp $ */ /* Synced with php 3.0 revision 1.24 1999-06-18 [ssb] */ #ifndef FSOCK_H #define FSOCK_H + +#ifdef NETWARE +#ifdef NEW_LIBC +#include "sys/timeval.h" +#else +#include "netware/time_nw.h" /* For 'timeval' */ +#endif +#endif #include "file.h" Index: php4/ext/standard/ftp_fopen_wrapper.c diff -u php4/ext/standard/ftp_fopen_wrapper.c:1.26 php4/ext/standard/ftp_fopen_wrapper.c:1.27 --- php4/ext/standard/ftp_fopen_wrapper.c:1.26 Sun Aug 11 10:29:01 2002 +++ php4/ext/standard/ftp_fopen_wrapper.c Thu Sep 5 10:21:55 2002 @@ -17,7 +17,7 @@ | Hartmut Holzgraefe <hholzgra@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: ftp_fopen_wrapper.c,v 1.26 2002/08/11 14:29:01 wez Exp $ */ +/* $Id: ftp_fopen_wrapper.c,v 1.27 2002/09/05 14:21:55 hyanantha Exp $ */ #include "php.h" #include "php_globals.h" @@ -35,6 +35,14 @@ #include <winsock.h> #define O_RDONLY _O_RDONLY #include "win32/param.h" +#elif defined(NETWARE) +/*#include <ws2nlm.h>*/ +/*#include <sys/socket.h>*/ +#ifdef NEW_LIBC +#include <sys/param.h> +#else +#include "netware/param.h" +#endif #else #include <sys/param.h> #endif @@ -48,6 +56,9 @@ #ifdef PHP_WIN32 #include <winsock.h> +#elif defined(NETWARE) && defined(USE_WINSOCK) +/*#include <ws2nlm.h>*/ +#include <novsock2.h> #else #include <netinet/in.h> #include <netdb.h> @@ -56,7 +67,7 @@ #endif #endif -#if defined(PHP_WIN32) || defined(__riscos__) +#if defined(PHP_WIN32) || defined(__riscos__) || defined(NETWARE) #undef AF_UNIX #endif Index: php4/ext/standard/head.c diff -u php4/ext/standard/head.c:1.62 php4/ext/standard/head.c:1.63 --- php4/ext/standard/head.c:1.62 Fri Aug 23 21:19:28 2002 +++ php4/ext/standard/head.c Thu Sep 5 10:21:55 2002 @@ -15,9 +15,14 @@ | Author: Rasmus Lerdorf <rasmus@lerdorf.on.ca> | +----------------------------------------------------------------------+ */ -/* $Id: head.c,v 1.62 2002/08/24 01:19:28 helly Exp $ */ +/* $Id: head.c,v 1.63 2002/09/05 14:21:55 hyanantha Exp $ */ #include <stdio.h> + +#if defined(NETWARE) && !defined(NEW_LIBC) +#include <sys/socket.h> +#endif + #include "php.h" #include "ext/standard/php_standard.h" #include "SAPI.h" Index: php4/ext/standard/http_fopen_wrapper.c diff -u php4/ext/standard/http_fopen_wrapper.c:1.40 php4/ext/standard/http_fopen_wrapper.c:1.41 --- php4/ext/standard/http_fopen_wrapper.c:1.40 Sun Aug 11 14:51:40 2002 +++ php4/ext/standard/http_fopen_wrapper.c Thu Sep 5 10:21:55 2002 @@ -18,7 +18,7 @@ | Wez Furlong <wez@thebrainroom.com> | +----------------------------------------------------------------------+ */ -/* $Id: http_fopen_wrapper.c,v 1.40 2002/08/11 18:51:40 wez Exp $ */ +/* $Id: http_fopen_wrapper.c,v 1.41 2002/09/05 14:21:55 hyanantha Exp $ */ #include "php.h" #include "php_globals.h" @@ -37,6 +37,14 @@ #include <winsock.h> #define O_RDONLY _O_RDONLY #include "win32/param.h" +#elif defined(NETWARE) +/*#include <ws2nlm.h>*/ +/*#include <sys/socket.h>*/ +#ifdef NEW_LIBC +#include <sys/param.h> +#else +#include "netware/param.h" +#endif #else #include <sys/param.h> #endif @@ -50,6 +58,9 @@ #ifdef PHP_WIN32 #include <winsock.h> +#elif defined(NETWARE) && defined(USE_WINSOCK) +/*#include <ws2nlm.h>*/ +#include <novsock2.h> #else #include <netinet/in.h> #include <netdb.h> @@ -58,7 +69,7 @@ #endif #endif -#if defined(PHP_WIN32) || defined(__riscos__) +#if defined(PHP_WIN32) || defined(__riscos__) || defined(NETWARE) #undef AF_UNIX #endif
Index: php4/ext/standard/dl.c diff -u php4/ext/standard/dl.c:1.70 php4/ext/standard/dl.c:1.71 --- php4/ext/standard/dl.c:1.70 Fri Aug 23 21:19:27 2002 +++ php4/ext/standard/dl.c Thu Sep 5 10:21:55 2002 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dl.c,v 1.70 2002/08/24 01:19:27 helly Exp $ */ +/* $Id: dl.c,v 1.71 2002/09/05 14:21:55 hyanantha Exp $ */ #include "php.h" #include "dl.h" @@ -26,7 +26,8 @@ #include "ext/standard/info.h" #include "SAPI.h" -#ifndef PHP_WIN32 +/*#ifndef PHP_WIN32*/ +#if !defined(PHP_WIN32) && !defined(NETWARE) #include "build-defs.h" #endif @@ -34,7 +35,8 @@ #include <stdlib.h> #include <stdio.h> -#if HAVE_STRING_H +/*#if HAVE_STRING_H*/ +#ifdef HAVE_STRING_H #include <string.h> #else #include <strings.h> @@ -43,6 +45,13 @@ #include "win32/param.h" #include "win32/winutil.h" #define GET_DL_ERROR() php_win_err() +#elif defined(NETWARE) +#ifdef NEW_LIBC +#include <sys/param.h> +#else +#include "netware/param.h" +#endif +#define GET_DL_ERROR() dlerror() #else #include <sys/param.h> #define GET_DL_ERROR() DL_ERROR() @@ -141,7 +150,7 @@ efree(libpath); - +#ifndef NETWARE get_module = (zend_module_entry *(*)(void)) DL_FETCH_SYMBOL(handle, "get_module"); /* @@ -152,6 +161,23 @@ if (!get_module) get_module = (zend_module_entry *(*)(void)) DL_FETCH_SYMBOL(handle, "_get_module"); +#else + /* NetWare doesn't support two NLMs exporting same symbol */ + { + char symbol_name[64] = "\0"; + int module_name_length = Z_STRLEN_P(file) - 4; /* '.nlm' is 4 characters; knock it off */ + + /* Take the module name (e.g.: 'php_ldap') and append '@get_module' to it */ + strncpy(symbol_name, Z_STRVAL_P(file), module_name_length); + symbol_name[module_name_length] = '\0'; + strcat(symbol_name, "@"); + strcat(symbol_name, "get_module"); + + get_module = (zend_module_entry *(*)(void)) DL_FETCH_SYMBOL(handle, symbol_name); + } + /* NetWare doesn't prepend '_' to symbol names; so the corresponding portion of code is also + not required for NetWare */ +#endif if (!get_module) { DL_UNLOAD(handle); Index: php4/ext/standard/dns.c diff -u php4/ext/standard/dns.c:1.42 php4/ext/standard/dns.c:1.43 --- php4/ext/standard/dns.c:1.42 Thu Aug 29 11:58:33 2002 +++ php4/ext/standard/dns.c Thu Sep 5 10:21:55 2002 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dns.c,v 1.42 2002/08/29 15:58:33 iliaa Exp $ */ +/* $Id: dns.c,v 1.43 2002/09/05 14:21:55 hyanantha Exp $ */ /* {{{ includes */ @@ -42,7 +42,7 @@ #endif #endif #include <winsock.h> -#else +#else /* This holds good for NetWare too, both for Winsock and Berkeley sockets */ #include <netinet/in.h> #if HAVE_ARPA_INET_H #include <arpa/inet.h> @@ -60,6 +60,11 @@ #endif #endif +/* Borrowed from SYS/SOCKET.H */ +#if defined(NETWARE) && defined(USE_WINSOCK) +#define AF_INET 2 /* internetwork: UDP, TCP, etc. */ +#endif + #include "dns.h" /* }}} */ @@ -201,7 +206,7 @@ } /* }}} */ -#if HAVE_RES_SEARCH && !(defined(__BEOS__)||defined(PHP_WIN32)) +#if HAVE_RES_SEARCH && !(defined(__BEOS__)||defined(PHP_WIN32) || defined(NETWARE)) /* {{{ proto int checkdnsrr(string host [, string type]) Check DNS records corresponding to a given Internet host name or IP address */ Index: php4/ext/standard/file.c diff -u php4/ext/standard/file.c:1.250 php4/ext/standard/file.c:1.251 --- php4/ext/standard/file.c:1.250 Mon Aug 26 19:18:59 2002 +++ php4/ext/standard/file.c Thu Sep 5 10:21:55 2002 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: file.c,v 1.250 2002/08/26 23:18:59 helly Exp $ */ +/* $Id: file.c,v 1.251 2002/09/05 14:21:55 hyanantha Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -47,11 +47,19 @@ #define O_RDONLY _O_RDONLY #include "win32/param.h" #include "win32/winutil.h" +#elif defined(NETWARE) && !defined(NEW_LIBC) +/*#include <ws2nlm.h>*/ +#include <sys/socket.h> +#include "netware/param.h" #else #include <sys/param.h> +#if defined(NETWARE) && defined(USE_WINSOCK) +#include <novsock2.h> +#else #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> +#endif #if HAVE_ARPA_INET_H #include <arpa/inet.h> #endif @@ -63,6 +71,8 @@ #if HAVE_PWD_H #ifdef PHP_WIN32 #include "win32/pwd.h" +#elif defined(NETWARE) +#include "netware/pwd.h" #else #include <pwd.h> #endif @@ -2114,7 +2124,7 @@ /* }}} */ -#if (!defined(PHP_WIN32) && !defined(__BEOS__) && HAVE_REALPATH) || defined(ZTS) +#if (!defined(PHP_WIN32) && !defined(__BEOS__) && !defined(NETWARE) && HAVE_REALPATH) || defined(ZTS) /* {{{ proto string realpath(string path) Return the resolved path */ PHP_FUNCTION(realpath) Index: php4/ext/standard/filestat.c diff -u php4/ext/standard/filestat.c:1.102 php4/ext/standard/filestat.c:1.103 --- php4/ext/standard/filestat.c:1.102 Fri Aug 23 21:19:28 2002 +++ php4/ext/standard/filestat.c Thu Sep 5 10:21:55 2002 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: filestat.c,v 1.102 2002/08/24 01:19:28 helly Exp $ */ +/* $Id: filestat.c,v 1.103 2002/09/05 14:21:55 hyanantha Exp $ */ #include "php.h" #include "safe_mode.h" @@ -54,6 +54,8 @@ #if HAVE_PWD_H # ifdef PHP_WIN32 # include "win32/pwd.h" +# elif defined(NETWARE) +# include "netware/pwd.h" # else # include <pwd.h> # endif @@ -335,7 +337,8 @@ Change file group */ PHP_FUNCTION(chgrp) { -#ifndef WINDOWS +/*#ifndef WINDOWS*/ +#if !defined(WINDOWS) && !defined(NETWARE) /* I guess 'chgrp' won't be available on NetWare */ pval **filename, **group; gid_t gid; struct group *gr=NULL; @@ -383,7 +386,8 @@ Change file owner */ PHP_FUNCTION(chown) { -#ifndef WINDOWS +/*#ifndef WINDOWS*/ +#if !defined(WINDOWS) && !defined(NETWARE) /* I guess 'chown' won't be available on NetWare */ pval **filename, **user; int ret; uid_t uid; @@ -472,7 +476,11 @@ { pval **filename, **filetime, **fileatime; int ret; +#if defined(NETWARE) && defined(CLIB_STAT_PATCH) + struct stat_libc sb; +#else struct stat sb; +#endif FILE *file; struct utimbuf newtimebuf; struct utimbuf *newtime = NULL; @@ -546,7 +554,11 @@ { zval *stat_dev, *stat_ino, *stat_mode, *stat_nlink, *stat_uid, *stat_gid, *stat_rdev, *stat_size, *stat_atime, *stat_mtime, *stat_ctime, *stat_blksize, *stat_blocks; +#if defined(NETWARE) && defined(CLIB_STAT_PATCH) + struct stat_libc *stat_sb; +#else struct stat *stat_sb; +#endif int rmask=S_IROTH, wmask=S_IWOTH, xmask=S_IXOTH; /* access rights defaults to other */ char *stat_sb_names[13]={"dev", "ino", "mode", "nlink", "uid", "gid", "rdev", "size", "atime", "mtime", "ctime", "blksize", "blocks"}; @@ -612,6 +624,7 @@ #endif +#ifndef NETWARE if (type >= FS_IS_W && type <= FS_IS_X) { if(BG(sb).st_uid==getuid()) { rmask=S_IRUSR; @@ -641,6 +654,7 @@ } } } +#endif switch (type) { case FS_PERMS: @@ -654,11 +668,23 @@ case FS_GROUP: RETURN_LONG((long)BG(sb).st_gid); case FS_ATIME: - RETURN_LONG((long)BG(sb).st_atime); +#if defined(NETWARE) && defined(NEW_LIBC) + RETURN_LONG((long)(BG(sb).st_atime).tv_nsec); +#else + RETURN_LONG((long)BG(sb).st_atime); +#endif case FS_MTIME: - RETURN_LONG((long)BG(sb).st_mtime); +#if defined(NETWARE) && defined(NEW_LIBC) + RETURN_LONG((long)(BG(sb).st_mtime).tv_nsec); +#else + RETURN_LONG((long)BG(sb).st_mtime); +#endif case FS_CTIME: - RETURN_LONG((long)BG(sb).st_ctime); +#if defined(NETWARE) && defined(NEW_LIBC) + RETURN_LONG((long)(BG(sb).st_ctime).tv_nsec); +#else + RETURN_LONG((long)BG(sb).st_ctime); +#endif case FS_TYPE: #if HAVE_SYMLINK if (S_ISLNK(BG(lsb).st_mode)) { @@ -678,16 +704,25 @@ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown file type (%d)", BG(sb).st_mode&S_IFMT); RETURN_STRING("unknown", 1); case FS_IS_W: +#ifdef NETWARE + RETURN_LONG(0); +#else if (getuid()==0) { RETURN_TRUE; /* root */ } RETURN_BOOL((BG(sb).st_mode & wmask) != 0); case FS_IS_R: +#ifdef NETWARE + RETURN_LONG(0); +#else if (getuid()==0) { RETURN_TRUE; /* root */ } RETURN_BOOL((BG(sb).st_mode&rmask)!=0); case FS_IS_X: +#ifdef NETWARE + RETURN_LONG(0); +#else if (getuid()==0) { xmask = S_IXROOT; /* root */ } @@ -726,9 +761,15 @@ MAKE_LONG_ZVAL_INCREF(stat_rdev, -1); #endif MAKE_LONG_ZVAL_INCREF(stat_size, stat_sb->st_size); +#if defined(NETWARE) && defined(NEW_LIBC) + MAKE_LONG_ZVAL_INCREF(stat_atime, (stat_sb->st_atime).tv_nsec); + MAKE_LONG_ZVAL_INCREF(stat_mtime, (stat_sb->st_mtime).tv_nsec); + MAKE_LONG_ZVAL_INCREF(stat_ctime, (stat_sb->st_ctime).tv_nsec); +#else MAKE_LONG_ZVAL_INCREF(stat_atime, stat_sb->st_atime); MAKE_LONG_ZVAL_INCREF(stat_mtime, stat_sb->st_mtime); MAKE_LONG_ZVAL_INCREF(stat_ctime, stat_sb->st_ctime); +#endif #ifdef HAVE_ST_BLKSIZE MAKE_LONG_ZVAL_INCREF(stat_blksize, stat_sb->st_blksize); #else Index: php4/ext/standard/flock_compat.c diff -u php4/ext/standard/flock_compat.c:1.16 php4/ext/standard/flock_compat.c:1.17 --- php4/ext/standard/flock_compat.c:1.16 Thu Feb 28 03:26:45 2002 +++ php4/ext/standard/flock_compat.c Thu Sep 5 10:21:55 2002 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: flock_compat.c,v 1.16 2002/02/28 08:26:45 sebastian Exp $ */ +/* $Id: flock_compat.c,v 1.17 2002/09/05 14:21:55 hyanantha Exp $ */ #include <php.h> #include <errno.h> @@ -30,6 +30,14 @@ #ifdef PHP_WIN32 #include <windows.h> #include <io.h> +#endif + +#ifdef NETWARE +#ifdef NEW_LIBC +#include <netinet/in.h> +#else +#include <sys/socket.h> +#endif #endif #ifndef HAVE_FLOCK Index: php4/ext/standard/fsock.c diff -u php4/ext/standard/fsock.c:1.101 php4/ext/standard/fsock.c:1.102 --- php4/ext/standard/fsock.c:1.101 Fri Aug 23 21:19:28 2002 +++ php4/ext/standard/fsock.c Thu Sep 5 10:21:55 2002 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: fsock.c,v 1.101 2002/08/24 01:19:28 helly Exp $ */ +/* $Id: fsock.c,v 1.102 2002/09/05 14:21:55 hyanantha Exp $ */ /* converted to PHP Streams and moved much code to main/network.c [wez] */ @@ -47,6 +47,19 @@ #endif #ifdef PHP_WIN32 #include <winsock.h> +#elif defined(NETWARE) +#ifdef NEW_LIBC +#ifdef USE_WINSOCK +#include <novsock2.h> +#else +#include <netinet/in.h> +#include <netdb.h> +/*#include <sys/socket.h>*/ +#include <sys/select.h> +/*#else +#include <sys/socket.h>*/ +#endif +#endif #else #include <netinet/in.h> #include <netdb.h> @@ -54,7 +67,7 @@ #include <arpa/inet.h> #endif #endif -#if defined(PHP_WIN32) || defined(__riscos__) +#if defined(PHP_WIN32) || defined(__riscos__) || defined(NETWARE) #undef AF_UNIX #endif #if defined(AF_UNIX) @@ -88,6 +101,10 @@ #ifdef PHP_WIN32 #define EWOULDBLOCK WSAEWOULDBLOCK +#elif defined(NETWARE) +#ifdef USE_WINSOCK +#define EWOULDBLOCK WSAEWOULDBLOCK +#endif #else #include "build-defs.h" #endif Index: php4/ext/standard/fsock.h diff -u php4/ext/standard/fsock.h:1.42 php4/ext/standard/fsock.h:1.43 --- php4/ext/standard/fsock.h:1.42 Fri Mar 15 16:03:04 2002 +++ php4/ext/standard/fsock.h Thu Sep 5 10:21:55 2002 @@ -18,12 +18,20 @@ +----------------------------------------------------------------------+ */ -/* $Id: fsock.h,v 1.42 2002/03/15 21:03:04 wez Exp $ */ +/* $Id: fsock.h,v 1.43 2002/09/05 14:21:55 hyanantha Exp $ */ /* Synced with php 3.0 revision 1.24 1999-06-18 [ssb] */ #ifndef FSOCK_H #define FSOCK_H + +#ifdef NETWARE +#ifdef NEW_LIBC +#include "sys/timeval.h" +#else +#include "netware/time_nw.h" /* For 'timeval' */ +#endif +#endif #include "file.h" Index: php4/ext/standard/ftp_fopen_wrapper.c diff -u php4/ext/standard/ftp_fopen_wrapper.c:1.26 php4/ext/standard/ftp_fopen_wrapper.c:1.27 --- php4/ext/standard/ftp_fopen_wrapper.c:1.26 Sun Aug 11 10:29:01 2002 +++ php4/ext/standard/ftp_fopen_wrapper.c Thu Sep 5 10:21:55 2002 @@ -17,7 +17,7 @@ | Hartmut Holzgraefe <hholzgra@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: ftp_fopen_wrapper.c,v 1.26 2002/08/11 14:29:01 wez Exp $ */ +/* $Id: ftp_fopen_wrapper.c,v 1.27 2002/09/05 14:21:55 hyanantha Exp $ */ #include "php.h" #include "php_globals.h" @@ -35,6 +35,14 @@ #include <winsock.h> #define O_RDONLY _O_RDONLY #include "win32/param.h" +#elif defined(NETWARE) +/*#include <ws2nlm.h>*/ +/*#include <sys/socket.h>*/ +#ifdef NEW_LIBC +#include <sys/param.h> +#else +#include "netware/param.h" +#endif #else #include <sys/param.h> #endif @@ -48,6 +56,9 @@ #ifdef PHP_WIN32 #include <winsock.h> +#elif defined(NETWARE) && defined(USE_WINSOCK) +/*#include <ws2nlm.h>*/ +#include <novsock2.h> #else #include <netinet/in.h> #include <netdb.h> @@ -56,7 +67,7 @@ #endif #endif -#if defined(PHP_WIN32) || defined(__riscos__) +#if defined(PHP_WIN32) || defined(__riscos__) || defined(NETWARE) #undef AF_UNIX #endif Index: php4/ext/standard/head.c diff -u php4/ext/standard/head.c:1.62 php4/ext/standard/head.c:1.63 --- php4/ext/standard/head.c:1.62 Fri Aug 23 21:19:28 2002 +++ php4/ext/standard/head.c Thu Sep 5 10:21:55 2002 @@ -15,9 +15,14 @@ | Author: Rasmus Lerdorf <rasmus@lerdorf.on.ca> | +----------------------------------------------------------------------+ */ -/* $Id: head.c,v 1.62 2002/08/24 01:19:28 helly Exp $ */ +/* $Id: head.c,v 1.63 2002/09/05 14:21:55 hyanantha Exp $ */ #include <stdio.h> + +#if defined(NETWARE) && !defined(NEW_LIBC) +#include <sys/socket.h> +#endif + #include "php.h" #include "ext/standard/php_standard.h" #include "SAPI.h" Index: php4/ext/standard/http_fopen_wrapper.c diff -u php4/ext/standard/http_fopen_wrapper.c:1.40 php4/ext/standard/http_fopen_wrapper.c:1.41 --- php4/ext/standard/http_fopen_wrapper.c:1.40 Sun Aug 11 14:51:40 2002 +++ php4/ext/standard/http_fopen_wrapper.c Thu Sep 5 10:21:55 2002 @@ -18,7 +18,7 @@ | Wez Furlong <wez@thebrainroom.com> | +----------------------------------------------------------------------+ */ -/* $Id: http_fopen_wrapper.c,v 1.40 2002/08/11 18:51:40 wez Exp $ */ +/* $Id: http_fopen_wrapper.c,v 1.41 2002/09/05 14:21:55 hyanantha Exp $ */ #include "php.h" #include "php_globals.h" @@ -37,6 +37,14 @@ #include <winsock.h> #define O_RDONLY _O_RDONLY #include "win32/param.h" +#elif defined(NETWARE) +/*#include <ws2nlm.h>*/ +/*#include <sys/socket.h>*/ +#ifdef NEW_LIBC +#include <sys/param.h> +#else +#include "netware/param.h" +#endif #else #include <sys/param.h> #endif @@ -50,6 +58,9 @@ #ifdef PHP_WIN32 #include <winsock.h> +#elif defined(NETWARE) && defined(USE_WINSOCK) +/*#include <ws2nlm.h>*/ +#include <novsock2.h> #else #include <netinet/in.h> #include <netdb.h> @@ -58,7 +69,7 @@ #endif #endif -#if defined(PHP_WIN32) || defined(__riscos__) +#if defined(PHP_WIN32) || defined(__riscos__) || defined(NETWARE) #undef AF_UNIX #endif