Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:8165 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86388 invoked by uid 1010); 26 Feb 2004 11:10:12 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 86354 invoked from network); 26 Feb 2004 11:10:12 -0000 Received: from unknown (HELO prv-mail25.provo.novell.com) (137.65.81.121) by pb1.pair.com with SMTP; 26 Feb 2004 11:10:12 -0000 Received: from INET-PRV1-MTA by prv-mail25.provo.novell.com with Novell_GroupWise; Thu, 26 Feb 2004 04:10:11 -0700 Message-ID: X-Mailer: Novell GroupWise Internet Agent 6.5.2 Beta Date: Thu, 26 Feb 2004 04:09:53 -0700 To: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartD0F1A011.0__=" Subject: Improved NetWare diff - 1. From: hyanantha@novell.com ("Ananth Kesari") --=__PartD0F1A011.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, Thanks for your feedback on the last patch I sent to you. I have incorporated them and taken the diff. This looks improved as compared to the last patch that I sent. Please find attached, the NetWare diff (text file) in the unified format taken using the command: cvs diff -uN. When I attached the diff of the whole php5 project, my mails were bouncing. So, I have split it up manually and then sending the diff in two mails. The first part is attached below. Couple of things here: 1. I have a few new files to check-in. They are coming in the diff with ? only, but the contents of those files are not there in the diff file. They are batch files and makefiles. Can I check them in directly or you want to review them also? 2. I have used a little older php5 sources that I checked out earlier. I have sent the diff with that itself since this is only a difference and it contains only the NetWare differences. Hope this is ok. Otherwise, I will have to check out the latest sources, apply the NetWare changes into it again and then send you another diff file. Let me know. Please give me your feedback and let me know if we can check this into the php5 sources. Thanks, Ananth. --=__PartD0F1A011.0__= Content-Type: text/plain; name="netware.diff-1.txt" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="netware.diff-1.txt" ? ext/openssl/openssl.mak ? netware/buildall.bat ? netware/buildbin.bat ? netware/buildinstall.bat ? netware/mod_php-Apache2.conf ? netware/mod_php.conf ? netware/php.ini Index: TSRM/TSRM.c =================================================================== RCS file: /repository/TSRM/TSRM.c,v retrieving revision 1.55 diff -u -r1.55 TSRM.c --- TSRM/TSRM.c 14 Dec 2003 15:41:50 -0000 1.55 +++ TSRM/TSRM.c 26 Feb 2004 10:49:33 -0000 @@ -106,6 +106,18 @@ pth_init(); #elif defined(PTHREADS) pthread_key_create( &tls_key, 0 ); +#ifdef NETWARE + /* Anantha Kesari + * For NetWare we have made it such a way that TSRM is started twice when + * Apache 2 is reloaded. When Apache2 is restarted, TSRM is started only once. + * Due to this, pthread_key_create is called twice. First time when TSRM + * is unloaded, the value associated with the key doesn't get cleared properly + * though the value itself is freed up. So for safety, the pthread_setspecific + * call below clears this value every time the key is created. Without this call, + * Apache 2.0 would crash even when it is loading. + */ + pthread_setspecific(tls_key, 0); +#endif #elif defined(TSRM_ST) st_init(); st_key_create(&tls_key, 0); @@ -294,15 +306,6 @@ int hash_value; tsrm_tls_entry *thread_resources; -#ifdef NETWARE - /* The below if loop is added for NetWare to fix an abend while unloading PHP - * when an Apache unload command is issued on the system console. - * While exiting from PHP, at the end for some reason, this function is called - * with tsrm_tls_table = NULL. When this happened, the server abends when - * tsrm_tls_table is accessed since it is NULL. - */ - if(tsrm_tls_table) { -#endif if (!th_id) { #if defined(PTHREADS) /* Fast path for looking up the resources for the current @@ -365,9 +368,6 @@ * changes to the structure as we read it. */ TSRM_SAFE_RETURN_RSRC(thread_resources->storage, id, thread_resources->count); -#ifdef NETWARE - } /* if(tsrm_tls_table) */ -#endif } @@ -434,13 +434,6 @@ { #ifdef TSRM_WIN32 return GetCurrentThreadId(); -#elif defined(NETWARE) - /* There seems to be some problem with the LibC call: NXThreadGetId(). - * Due to this, the PHPMyAdmin application is abending in PHP calls. - * Used the call, kCurrentThread instead and it works fine. - */ -/* return NXThreadGetId(); */ - return kCurrentThread(); #elif defined(GNUPTH) return pth_self(); #elif defined(PTHREADS) @@ -451,6 +444,20 @@ return PIThread_getCurrent(); #elif defined(TSRM_ST) return st_thread_self(); +#elif defined(NETWARE) +/* Anantha Kesari. 20 Aug 2003. + * + * Apache 1.3 is Clib based and it creats the threads using Clib calls. + * PHP is LibC based and so here also we should use the Clib calls to + * get the ID for these threads. If not, there will be a mismatch in the + * threads created and its usage. This will lead to abend when complex scripts + * are run and also when multiple scripts are run simulataneously. + */ +#ifdef APACHE_2_BUILD + return NXThreadGetId(); +#else + return kCurrentThread(); +#endif #elif defined(BETHREADS) return find_thread(NULL); #endif @@ -461,24 +468,10 @@ TSRM_API MUTEX_T tsrm_mutex_alloc(void) { MUTEX_T mutexp; -#ifdef NETWARE -#ifndef USE_MPK - /* To use the Recursive Mutex Locking of LibC */ - long flags = NX_MUTEX_RECURSIVE; - NXHierarchy_t order = 0; - NX_LOCK_INFO_ALLOC (lockInfo, "PHP-TSRM", 0); -#endif -#endif #ifdef TSRM_WIN32 mutexp = malloc(sizeof(CRITICAL_SECTION)); InitializeCriticalSection(mutexp); -#elif defined(NETWARE) -#ifdef USE_MPK - mutexp = kMutexAlloc((BYTE*)"PHP-TSRM"); -#else - mutexp = NXMutexAlloc(flags, order, &lockInfo); -#endif #elif defined(GNUPTH) mutexp = (MUTEX_T) malloc(sizeof(*mutexp)); pth_mutex_init(mutexp); @@ -491,6 +484,17 @@ mutexp = PIPlatform_allocLocalMutex(); #elif defined(TSRM_ST) mutexp = st_mutex_new(); +#elif defined(NETWARE) +#ifdef USE_MPK + mutexp = kMutexAlloc((BYTE*)"PHP-TSRM"); +#else + /* To use the Recursive Mutex Locking of LibC */ + long flags = NX_MUTEX_RECURSIVE; + NXHierarchy_t order = 0; + NX_LOCK_INFO_ALLOC (lockInfo, "PHP-TSRM", 0); + + mutexp = NXMutexAlloc(flags, order, &lockInfo); +#endif #elif defined(BETHREADS) mutexp = (beos_ben*)malloc(sizeof(beos_ben)); mutexp->ben = 0; @@ -510,12 +514,6 @@ #ifdef TSRM_WIN32 DeleteCriticalSection(mutexp); free(mutexp); -#elif defined(NETWARE) -#ifdef USE_MPK - kMutexFree(mutexp); -#else - NXMutexFree(mutexp); -#endif #elif defined(GNUPTH) free(mutexp); #elif defined(PTHREADS) @@ -527,6 +525,12 @@ PISync_delete(mutexp); #elif defined(TSRM_ST) st_mutex_destroy(mutexp); +#elif defined(NETWARE) +#ifdef USE_MPK + kMutexFree(mutexp); +#else + NXMutexFree(mutexp); +#endif #elif defined(BETHREADS) delete_sem(mutexp->sem); free(mutexp); @@ -545,12 +549,6 @@ #ifdef TSRM_WIN32 EnterCriticalSection(mutexp); return 1; -#elif defined(NETWARE) -#ifdef USE_MPK - return kMutexLock(mutexp); -#else - return NXLock(mutexp); -#endif #elif defined(GNUPTH) return pth_mutex_acquire(mutexp, 0, NULL); #elif defined(PTHREADS) @@ -561,6 +559,12 @@ return PISync_lock(mutexp); #elif defined(TSRM_ST) return st_mutex_lock(mutexp); +#elif defined(NETWARE) +#ifdef USE_MPK + return kMutexLock(mutexp); +#else + return NXLock(mutexp); +#endif #elif defined(BETHREADS) if (atomic_add(&mutexp->ben, 1) != 0) return acquire_sem(mutexp->sem); @@ -576,12 +580,6 @@ #ifdef TSRM_WIN32 LeaveCriticalSection(mutexp); return 1; -#elif defined(NETWARE) -#ifdef USE_MPK - return kMutexUnlock(mutexp); -#else - return NXUnlock(mutexp); -#endif #elif defined(GNUPTH) return pth_mutex_release(mutexp); #elif defined(PTHREADS) @@ -592,6 +590,12 @@ return PISync_unlock(mutexp); #elif defined(TSRM_ST) return st_mutex_unlock(mutexp); +#elif defined(NETWARE) +#ifdef USE_MPK + return kMutexUnlock(mutexp); +#else + return NXUnlock(mutexp); +#endif #elif defined(BETHREADS) if (atomic_add(&mutexp->ben, -1) != 1) return release_sem(mutexp->sem); Index: TSRM/TSRM.h =================================================================== RCS file: /repository/TSRM/TSRM.h,v retrieving revision 1.43 diff -u -r1.43 TSRM.h --- TSRM/TSRM.h 3 Dec 2003 14:26:41 -0000 1.43 +++ TSRM/TSRM.h 26 Feb 2004 10:49:33 -0000 @@ -42,6 +42,12 @@ # endif # include # include +#elif defined(GNUPTH) +# include +#elif defined(PTHREADS) +# include +#elif defined(TSRM_ST) +# include #elif defined(NETWARE) # include #ifdef USE_MPK @@ -49,12 +55,6 @@ #else # include #endif -#elif defined(GNUPTH) -# include -#elif defined(PTHREADS) -# include -#elif defined(TSRM_ST) -# include #elif defined(BETHREADS) #include #include @@ -66,13 +66,6 @@ #ifdef TSRM_WIN32 # define THREAD_T DWORD # define MUTEX_T CRITICAL_SECTION * -#elif defined(NETWARE) -# define THREAD_T NXThreadId_t -#ifdef USE_MPK -# define MUTEX_T MUTEX -#else -# define MUTEX_T NXMutex_t * -#endif #elif defined(GNUPTH) # define THREAD_T pth_t # define MUTEX_T pth_mutex_t * @@ -88,6 +81,13 @@ #elif defined(TSRM_ST) # define THREAD_T st_thread_t # define MUTEX_T st_mutex_t +#elif defined(NETWARE) +# define THREAD_T NXThreadId_t +#ifdef USE_MPK +# define MUTEX_T MUTEX +#else +# define MUTEX_T NXMutex_t * +#endif #elif defined(BETHREADS) # define THREAD_T thread_id typedef struct { Index: TSRM/acconfig.h =================================================================== RCS file: /repository/TSRM/acconfig.h,v retrieving revision 1.3 diff -u -r1.3 acconfig.h --- TSRM/acconfig.h 24 Sep 1999 20:52:46 -0000 1.3 +++ TSRM/acconfig.h 26 Feb 2004 10:49:33 -0000 @@ -1 +1,24 @@ +/* Anantha Kesari. 20 Aug 2003. + * + * Define PTHREADS only for Apache 2 and not for Apache 1.3. + * This is because the former is LibC based and everything works fine in that case. + * The latter is Clib based and so the thread calls will change if we use PTHREADS + * and the server abends if we use PTHREADS in PHP for Apache 1.3. + * + * Explanation: + * + * In the case of Apache 1.3, pthread_self always returns 0 due to mismatch in + * the function calls used to create the treads and getting the IDs for them. + * (Threads are created by Apache 1.3 using Clib calls whereas LibC's PTHREAD call + * is used to get the ID for these threads). + * Now, using this thread specific ID returned by pthread_self, we store some + * thread specific data into different hash tables. When we execute multiple scripts + * simultaneously, since the ID is always 0, one thread reads/writs data from/into + * another thread's data area. + * This causes the server to abend. + */ +#ifdef APACHE_2_BUILD +#define PTHREADS +#else #undef PTHREADS +#endif Index: TSRM/tsrm_virtual_cwd.c =================================================================== RCS file: /repository/TSRM/tsrm_virtual_cwd.c,v retrieving revision 1.60 diff -u -r1.60 tsrm_virtual_cwd.c --- TSRM/tsrm_virtual_cwd.c 8 Jan 2004 08:14:03 -0000 1.60 +++ TSRM/tsrm_virtual_cwd.c 26 Feb 2004 10:49:34 -0000 @@ -42,7 +42,6 @@ #endif #ifdef NETWARE -/*#include "pipe.h"*/ #include "tsrm_nw.h" #endif @@ -100,10 +99,12 @@ (len == 1 && element[0] == '.') #elif defined(NETWARE) -/* NetWare has strtok() (in LibC) and allows both slashes in paths, like Windows -- - but rest of the stuff is like Unix */ -/* strtok() call in LibC is abending when used in a different address space -- hence using - PHP's version itself for now */ +/* NetWare has strtok() (in LibC) and allows both slashes in paths, like Windows. + * But rest of the stuff is like Unix + */ +/* strtok() call in LibC is abending when used in a different address space. + * Hence using PHP's version itself for now + */ /*#define tsrm_strtok_r(a,b,c) strtok((a),(b))*/ #define TOKENIZER_STRING "/\\" @@ -139,18 +140,12 @@ #define CWD_STATE_FREE(s) \ free((s)->cwd); - -static int php_is_dir_ok(const cwd_state *state) + +static int php_is_dir_ok(const cwd_state *state) { -#if !(defined(NETWARE) && defined(CLIB_STAT_PATCH)) struct stat buf; if (stat(state->cwd, &buf) == 0 && S_ISDIR(buf.st_mode)) -#else - struct stat_libc buf; - - if (stat(state->cwd, (struct stat*)(&buf)) == 0 && S_ISDIR(buf.st_mode)) -#endif return (0); return (1); @@ -158,15 +153,9 @@ static int php_is_file_ok(const cwd_state *state) { -#if !(defined(NETWARE) && defined(CLIB_STAT_PATCH)) struct stat buf; if (stat(state->cwd, &buf) == 0 && S_ISREG(buf.st_mode)) -#else - struct stat_libc buf; - - if (stat(state->cwd, (struct stat*)(&buf)) == 0 && S_ISREG(buf.st_mode)) -#endif return (0); return (1); @@ -373,6 +362,9 @@ #ifdef TSRM_WIN32 } else if (IS_SLASH(path_copy[0])) { copy_amount = 2; +#elif defined(NETWARE) + } else if (IS_SLASH(path_copy[0])) { + copy_amount = 4; /* This is the size of the string "sys:" which is 4 */ #endif } @@ -693,7 +685,6 @@ return retval; } -#if !(defined(NETWARE) && defined(CLIB_STAT_PATCH)) CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC) { cwd_state new_state; @@ -707,21 +698,6 @@ CWD_STATE_FREE(&new_state); return retval; } -#else -CWD_API int virtual_stat(const char *path, struct stat_libc *buf TSRMLS_DC) -{ - cwd_state new_state; - int retval; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - virtual_file_ex(&new_state, path, NULL, 1); - - retval = stat(new_state.cwd, (struct stat*)buf); - - CWD_STATE_FREE(&new_state); - return retval; -} -#endif #if !defined(TSRM_WIN32) && !defined(NETWARE) CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC) @@ -811,8 +787,8 @@ #elif defined(NETWARE) -/* On NetWare, the trick of prepending "cd cwd; " doesn't work so we need to perform - a VCWD_CHDIR() and mutex it +/* On NetWare, the trick of prepending "cd cwd;" doesn't work. + * So we need to perform a VCWD_CHDIR() and mutex it. */ CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) { Index: TSRM/tsrm_virtual_cwd.h =================================================================== RCS file: /repository/TSRM/tsrm_virtual_cwd.h,v retrieving revision 1.42 diff -u -r1.42 tsrm_virtual_cwd.h --- TSRM/tsrm_virtual_cwd.h 8 Jan 2004 17:31:46 -0000 1.42 +++ TSRM/tsrm_virtual_cwd.h 26 Feb 2004 10:49:34 -0000 @@ -141,11 +141,7 @@ CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...); CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC); CWD_API int virtual_rename(char *oldname, char *newname TSRMLS_DC); -#if !(defined(NETWARE) && defined(CLIB_STAT_PATCH)) CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC); -#else -CWD_API int virtual_stat(const char *path, struct stat_libc *buf TSRMLS_DC); -#endif #if !defined(TSRM_WIN32) && !defined(NETWARE) CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC); #endif Index: Zend/zend.c =================================================================== RCS file: /repository/ZendEngine2/zend.c,v retrieving revision 1.265 diff -u -r1.265 zend.c --- Zend/zend.c 15 Jan 2004 16:47:32 -0000 1.265 +++ Zend/zend.c 26 Feb 2004 10:49:35 -0000 @@ -401,7 +401,7 @@ static void register_standard_class(TSRMLS_D) { - zend_standard_class_def = malloc(sizeof(zend_class_entry)); + zend_standard_class_def = (zend_class_entry *) malloc(sizeof(zend_class_entry)); zend_standard_class_def->type = ZEND_INTERNAL_CLASS; zend_standard_class_def->name_length = sizeof("stdClass") - 1; Index: Zend/zend.h =================================================================== RCS file: /repository/ZendEngine2/zend.h,v retrieving revision 1.232 diff -u -r1.232 zend.h --- Zend/zend.h 8 Jan 2004 17:31:47 -0000 1.232 +++ Zend/zend.h 26 Feb 2004 10:49:36 -0000 @@ -46,6 +46,7 @@ #elif defined(NETWARE) # include "zend_config.nw.h" # include "acconfig.h" +# define ZEND_PATHS_SEPARATOR ';' #elif defined(__riscos__) # include "zend_config.h" # define ZEND_PATHS_SEPARATOR ';' Index: Zend/zend_API.c =================================================================== RCS file: /repository/ZendEngine2/zend_API.c,v retrieving revision 1.235 diff -u -r1.235 zend_API.c --- Zend/zend_API.c 19 Jan 2004 00:39:29 -0000 1.235 +++ Zend/zend_API.c 26 Feb 2004 10:49:37 -0000 @@ -1382,10 +1382,23 @@ } #if HAVE_LIBDL +#if (!defined (NETWARE) || !defined (APACHE_1_BUILD)) + /* For NetWare: + * Anantha Kesari. 31 July 2003. Unload Apache issue. + * + * When Apache is unloaded, it calls dlclose on all the PHP extensions + * that are loaded in memory. In the case of Apache 1.3, this call is hanging + * and is not unloading the PHP extensions and in turn hangs the system. + * As a work around, this call is bypassed for Apache 1.3 build on NetWare only. + * This means that none of the loaded PHP extensions are unloaded. + * They will have to be manually unloaded before re-loading Apache (1.3) again. + * On Apache 2 build on NetWare and on other platforms, dlclose will be called. + */ if (module->handle) { dlclose(module->handle); } #endif +#endif } @@ -1436,8 +1449,8 @@ static zend_class_entry *do_register_internal_class(zend_class_entry *orig_class_entry, zend_uint ce_flags TSRMLS_DC) { - zend_class_entry *class_entry = malloc(sizeof(zend_class_entry)); - char *lowercase_name = malloc(orig_class_entry->name_length + 1); + zend_class_entry *class_entry = (zend_class_entry *) malloc(sizeof(zend_class_entry)); + char *lowercase_name = (char *) malloc(orig_class_entry->name_length + 1); *class_entry = *orig_class_entry; class_entry->type = ZEND_INTERNAL_CLASS; @@ -1486,7 +1499,7 @@ va_list interface_list; if (class_entry->type & ZEND_INTERNAL_CLASS) { - class_entry->interfaces = realloc(class_entry->interfaces, sizeof(zend_class_entry*) * (class_entry->num_interfaces+num_interfaces)); + class_entry->interfaces = (zend_class_entry **) realloc(class_entry->interfaces, sizeof(zend_class_entry*) * (class_entry->num_interfaces+num_interfaces)); } else { class_entry->interfaces = erealloc(class_entry->interfaces, sizeof(zend_class_entry*) * (class_entry->num_interfaces+num_interfaces)); } @@ -1814,7 +1827,7 @@ zval *property; if (ce->type & ZEND_INTERNAL_CLASS) { - property = malloc(sizeof(zval)); + property = (zval *) malloc(sizeof(zval)); } else { ALLOC_ZVAL(property); } @@ -1827,7 +1840,7 @@ zval *property; if (ce->type & ZEND_INTERNAL_CLASS) { - property = malloc(sizeof(zval)); + property = (zval *) malloc(sizeof(zval)); } else { ALLOC_ZVAL(property); } @@ -1842,7 +1855,7 @@ int len = strlen(value); if (ce->type & ZEND_INTERNAL_CLASS) { - property = malloc(sizeof(zval)); + property = (zval *) malloc(sizeof(zval)); ZVAL_STRINGL(property, zend_strndup(value, len), len, 0); } else { ALLOC_ZVAL(property); Index: Zend/zend_alloc.h =================================================================== RCS file: /repository/ZendEngine2/zend_alloc.h,v retrieving revision 1.49 diff -u -r1.49 zend_alloc.h --- Zend/zend_alloc.h 8 Jan 2004 17:31:47 -0000 1.49 +++ Zend/zend_alloc.h 26 Feb 2004 10:49:37 -0000 @@ -107,14 +107,14 @@ /* Selective persistent/non persistent allocation macros */ #define pemalloc(size, persistent) ((persistent)?malloc(size):emalloc(size)) -#define pefree(ptr, persistent) ((persistent)?free(ptr):efree(ptr)) +#define pefree(ptr, persistent) ((persistent)?(void)free(ptr):efree(ptr)) #define pecalloc(nmemb, size, persistent) ((persistent)?calloc((nmemb), (size)):ecalloc((nmemb), (size))) #define perealloc(ptr, size, persistent) ((persistent)?realloc((ptr), (size)):erealloc((ptr), (size))) #define perealloc_recoverable(ptr, size, persistent) ((persistent)?realloc((ptr), (size)):erealloc_recoverable((ptr), (size))) #define pestrdup(s, persistent) ((persistent)?strdup(s):estrdup(s)) #define pemalloc_rel(size, persistent) ((persistent)?malloc(size):emalloc_rel(size)) -#define pefree_rel(ptr, persistent) ((persistent)?free(ptr):efree_rel(ptr)) +#define pefree_rel(ptr, persistent) ((persistent)?(void)free(ptr):efree_rel(ptr)) #define pecalloc_rel(nmemb, size, persistent) ((persistent)?calloc((nmemb), (size)):ecalloc_rel((nmemb), (size))) #define perealloc_rel(ptr, size, persistent) ((persistent)?realloc((ptr), (size)):erealloc_rel((ptr), (size))) #define perealloc_recoverable_rel(ptr, size, persistent) ((persistent)?realloc((ptr), (size)):erealloc_recoverable_rel((ptr), (size))) Index: Zend/zend_arg_defs.c =================================================================== RCS file: /repository/ZendEngine2/zend_arg_defs.c,v retrieving revision 1.1 diff -u -r1.1 zend_arg_defs.c --- Zend/zend_arg_defs.c 31 Aug 2003 12:38:50 -0000 1.1 +++ Zend/zend_arg_defs.c 26 Feb 2004 10:49:37 -0000 @@ -1,3 +1,4 @@ + ZEND_BEGIN_ARG_INFO(first_arg_force_ref, 0) ZEND_ARG_PASS_INFO(1) ZEND_END_ARG_INFO(); Index: Zend/zend_config.nw.h =================================================================== RCS file: /repository/ZendEngine2/zend_config.nw.h,v retrieving revision 1.5 diff -u -r1.5 zend_config.nw.h --- Zend/zend_config.nw.h 8 Jan 2004 17:31:47 -0000 1.5 +++ Zend/zend_config.nw.h 26 Feb 2004 10:49:37 -0000 @@ -35,6 +35,11 @@ #define HAVE_STRING_H 1 +/* Anantha Kesari 19 Feb 2004 + * To avoid redefinition (of free, alloca etc.) compilation errors in Zend. + */ +#define HAVE_STDLIB_H 1 + #undef HAVE_KILL #define HAVE_GETPID 1 /* #define HAVE_ALLOCA_H 1 */ Index: Zend/zend_execute.c =================================================================== RCS file: /repository/ZendEngine2/zend_execute.c,v retrieving revision 1.584 diff -u -r1.584 zend_execute.c --- Zend/zend_execute.c 19 Jan 2004 12:22:02 -0000 1.584 +++ Zend/zend_execute.c 26 Feb 2004 10:49:41 -0000 @@ -1260,6 +1260,17 @@ } #endif +#ifdef NETWARE + /* K Murugan. 13 Nove 2003 + * Stack limit will be checked while executing the script. + * nw_stack_limit flag will be set by the php_printf function, + * if that is called recursively like a while loop script. + */ + if (EG(nw_stack_limit) || (stackavail() <= 2048)) { + zend_nw_stack_limit(0); + } +#endif + zend_clean_garbage(TSRMLS_C); if (EX(opline)->handler(&execute_data, op_array TSRMLS_CC)) { return; Index: Zend/zend_execute_API.c =================================================================== RCS file: /repository/ZendEngine2/zend_execute_API.c,v retrieving revision 1.251 diff -u -r1.251 zend_execute_API.c --- Zend/zend_execute_API.c 18 Jan 2004 23:47:10 -0000 1.251 +++ Zend/zend_execute_API.c 26 Feb 2004 10:49:41 -0000 @@ -49,6 +49,10 @@ static int timeout_thread_initialized=0; #endif +#ifdef NETWARE +ZEND_API void zend_nw_stack_limit(int dummy); +#endif + #if ZEND_DEBUG static void (*original_sigsegv_handler)(int); @@ -174,10 +178,15 @@ zend_objects_store_init(&EG(objects_store), 1024); EG(full_tables_cleanup) = 0; + #ifdef ZEND_WIN32 EG(timed_out) = 0; #endif +#ifdef NETWARE + EG(nw_stack_limit) = 0; +#endif + EG(exception) = NULL; EG(scope) = NULL; @@ -986,6 +995,16 @@ } +#ifdef NETWARE +/* K Murugan 13 Nov 2003 */ +ZEND_API void zend_nw_stack_limit(int dummy) +{ + TSRMLS_FETCH(); + zend_error(E_ERROR, "Stack limit exceeded"); +} +#endif + + #ifdef ZEND_WIN32 static LRESULT CALLBACK zend_timeout_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { Index: Zend/zend_globals.h =================================================================== RCS file: /repository/ZendEngine2/zend_globals.h,v retrieving revision 1.131 diff -u -r1.131 zend_globals.h --- Zend/zend_globals.h 10 Jan 2004 11:43:42 -0000 1.131 +++ Zend/zend_globals.h 26 Feb 2004 10:49:42 -0000 @@ -203,6 +203,10 @@ zend_bool timed_out; #endif +#ifdef NETWARE + zend_bool nw_stack_limit; +#endif + HashTable regular_list; HashTable persistent_list; Index: Zend/zend_mm.c =================================================================== RCS file: /repository/ZendEngine2/zend_mm.c,v retrieving revision 1.28 diff -u -r1.28 zend_mm.c --- Zend/zend_mm.c 8 Jan 2004 17:31:47 -0000 1.28 +++ Zend/zend_mm.c 26 Feb 2004 10:49:42 -0000 @@ -407,7 +407,7 @@ /* segment size, size of block and size of guard block */ realloc_to_size = ZEND_MM_ALIGNED_SEGMENT_SIZE+true_size+ZEND_MM_ALIGNED_HEADER_SIZE; - segment = realloc(segment, realloc_to_size); + segment = (zend_mm_segment *) realloc(segment, realloc_to_size); if (!segment) { return NULL; } Index: Zend/zend_modules.h =================================================================== RCS file: /repository/ZendEngine2/zend_modules.h,v retrieving revision 1.56 diff -u -r1.56 zend_modules.h --- Zend/zend_modules.h 8 Jan 2004 17:31:48 -0000 1.56 +++ Zend/zend_modules.h 26 Feb 2004 10:49:42 -0000 @@ -23,6 +23,9 @@ #define MODULES_H #include "zend.h" +#ifdef NETWARE +#include "zend_compile.h" +#endif #define INIT_FUNC_ARGS int type, int module_number TSRMLS_DC #define INIT_FUNC_ARGS_PASSTHRU type, module_number TSRMLS_CC Index: Zend/zend_static_allocator.c =================================================================== RCS file: /repository/ZendEngine2/zend_static_allocator.c,v retrieving revision 1.12 diff -u -r1.12 zend_static_allocator.c --- Zend/zend_static_allocator.c 8 Jan 2004 17:31:48 -0000 1.12 +++ Zend/zend_static_allocator.c 26 Feb 2004 10:49:42 -0000 @@ -20,6 +20,11 @@ #include "zend_static_allocator.h" +#ifdef NETWARE +/* Anantha Kesari 7 Jan 2004 */ +#include /* To define NULL */ +#endif + /* Not checking emalloc() and erealloc() return values as they are supposed to bailout */ inline static void block_init(Block *block, zend_uint block_size) Index: ext/ftp/ftp.c =================================================================== RCS file: /repository/php-src/ext/ftp/ftp.c,v retrieving revision 1.98 diff -u -r1.98 ftp.c --- ext/ftp/ftp.c 13 Jan 2004 18:58:23 -0000 1.98 +++ ext/ftp/ftp.c 26 Feb 2004 10:49:46 -0000 @@ -42,13 +42,9 @@ #ifdef USE_WINSOCK /* Modified to use Winsock (NOVSOCK2.H), atleast for now */ #include #else -#ifdef NEW_LIBC #include #include #include -#else -#include -#endif #endif #else #ifdef HAVE_SYS_TYPES_H @@ -77,7 +73,7 @@ #include "ext/standard/fsock.h" /* Additional headers for NetWare */ -#if defined(NETWARE) && defined(NEW_LIBC) && !defined(USE_WINSOCK) +#if defined(NETWARE) && !defined(USE_WINSOCK) #include #endif Index: ext/ftp/php_ftp.c =================================================================== RCS file: /repository/php-src/ext/ftp/php_ftp.c,v retrieving revision 1.99 diff -u -r1.99 php_ftp.c --- ext/ftp/php_ftp.c 8 Jan 2004 08:15:27 -0000 1.99 +++ ext/ftp/php_ftp.c 26 Feb 2004 10:49:47 -0000 @@ -25,14 +25,8 @@ #include "php.h" -#ifdef NETWARE -#ifdef USE_WINSOCK +#if defined(NETWARE) && defined(USE_WINSOCK) #include -#else -#ifndef NEW_LIBC -#include -#endif -#endif #endif #if HAVE_OPENSSL_EXT Index: ext/ldap/ldap.c =================================================================== RCS file: /repository/php-src/ext/ldap/ldap.c,v retrieving revision 1.150 diff -u -r1.150 ldap.c --- ext/ldap/ldap.c 8 Jan 2004 08:15:55 -0000 1.150 +++ ext/ldap/ldap.c 26 Feb 2004 10:49:49 -0000 @@ -30,7 +30,7 @@ #endif /* Additional headers for NetWare */ -#if defined(NETWARE) && (NEW_LIBC) +#ifdef NETWARE #include #include #endif @@ -477,7 +477,14 @@ ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, &link, -1, "ldap link", le_link); +#ifdef NETWARE + /* The function ldap_bind_s has been deprecated on NetWare. If used on NetWare, + * it gives the result, but also displays warning messages. + */ + if ((rc = ldap_simple_bind_s(ld->link, ldap_bind_dn, ldap_bind_pw)) != LDAP_SUCCESS) { +#else if ((rc = ldap_bind_s(ld->link, ldap_bind_dn, ldap_bind_pw, LDAP_AUTH_SIMPLE)) != LDAP_SUCCESS) { +#endif php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to bind to server: %s", ldap_err2string(rc)); RETURN_FALSE; } else { Index: ext/ldap/ldap.mak =================================================================== RCS file: /repository/php-src/ext/ldap/ldap.mak,v retrieving revision 1.4 diff -u -r1.4 ldap.mak --- ext/ldap/ldap.mak 17 Jan 2004 12:59:30 -0000 1.4 +++ ext/ldap/ldap.mak 26 Feb 2004 10:49:49 -0000 @@ -5,7 +5,7 @@ # Module details MODULE_NAME = php_ldap MODULE_DESC = "PHP 5 - LDAP Extension" -VMAJ = 3 +VMAJ = 1 VMIN = 0 VREV = 0 @@ -46,13 +46,14 @@ C_FLAGS += -nostdinc -nosyspath C_FLAGS += -relax_pointers # To remove type-casting errors C_FLAGS += -DNETWARE -DZTS -C_FLAGS += -DNEW_LIBC -C_FLAGS += -DCOMPILE_DL_LDAP -C_FLAGS += -I. -I- -I$(PROJECT_ROOT) -I$(PROJECT_ROOT)/main +C_FLAGS += -DCOMPILE_DL_LDAP=1 + +C_FLAGS += -I. -I$(PROJECT_ROOT) -I$(PROJECT_ROOT)/main C_FLAGS += -I$(PROJECT_ROOT)/ext/standard -I$(PROJECT_ROOT)/netware C_FLAGS += -I$(PROJECT_ROOT)/zend -I$(PROJECT_ROOT)/tsrm -C_FLAGS += -I$(SDK_DIR)/include -I$(MWCIncludes) +C_FLAGS += -I- -I$(SDK_DIR)/include -I$(MWCIncludes) C_FLAGS += -I$(LDAP_DIR)/inc +C_FLAGS += -I$(SDK_DIR)/include/winsock C_FLAGS += -I$(WINSOCK_DIR)/include/nlm -I$(WINSOCK_DIR)/include ifndef STACK_SIZE @@ -62,12 +63,12 @@ # Extra stuff based on debug / release builds ifeq '$(BUILD)' 'debug' SYM_FILE = $(FINAL_DIR)\$(MODULE_NAME).sym - C_FLAGS += -inline smart -sym on -sym codeview4 -opt off -opt intrinsics -sym internal -DDEBUGGING -DDKFBPON + C_FLAGS += -inline smart -sym on -sym codeview4 -opt off -opt intrinsics -sym internal -DDEBUGGING -DDKFBPON C_FLAGS += -exc cw -DZEND_DEBUG=1 LD_FLAGS += -sym on -sym codeview4 -osym $(SYM_FILE) export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtld.lib else - C_FLAGS += -opt speed -inline on -inline smart -inline auto -sym off + C_FLAGS += -opt all -inline on -inline smart -inline auto -sym off C_FLAGS += -opt intrinsics C_FLAGS += -opt level=4 -DZEND_DEBUG=0 LD_FLAGS += -sym off @@ -76,12 +77,12 @@ # Dependencies MODULE = LibC \ - ldapsdk \ + lldapsdk \ phplib IMPORT = @$(SDK_DIR)/imports/libc.imp \ @$(SDK_DIR)/imports/ws2nlm.imp \ @$(MPK_DIR)/import/mpkOrg.imp \ - @$(LDAP_DIR)/lib/nlm/Ldapsdk.imp \ + @$(LDAP_DIR)/imports/lldapsdk.imp \ @$(PROJECT_ROOT)/netware/phplib.imp EXPORT = ($(MODULE_NAME)) get_module API = OutputToScreen Index: ext/mysql/mysql.mak =================================================================== RCS file: /repository/php-src/ext/mysql/mysql.mak,v retrieving revision 1.4 diff -u -r1.4 mysql.mak --- ext/mysql/mysql.mak 6 Jan 2003 09:05:59 -0000 1.4 +++ ext/mysql/mysql.mak 26 Feb 2004 10:49:51 -0000 @@ -4,8 +4,8 @@ # Module details MODULE_NAME = phpmysql -MODULE_DESC = "PHP 4.3 - MySQL Extension" -VMAJ = 3 +MODULE_DESC = "PHP 5 - MySQL Extension" +VMAJ = 1 VMIN = 0 VREV = 0 @@ -13,7 +13,11 @@ include $(PROJECT_ROOT)/netware/common.mif # MYSQL stuff -MYSQL_DIR = P:/APPS/script/sw/mysql +ifdef MYSQL_VER + MYSQL_DIR = P:/APPS/script/sw/mysql-$(MYSQL_VER) +else + MYSQL_DIR = P:/APPS/script/sw/mysql +endif # Build type defaults to 'release' ifndef BUILD @@ -33,7 +37,11 @@ SRC_DIR = $(dir $(CPP_SRC) $(C_SRC)) # Library files -LIBRARY = $(MYSQL_DIR)/lib/libmysqlclient.lib +ifdef MYSQL_VER + LIBRARY = +else + LIBRARY = $(MYSQL_DIR)/lib/libmysqlclient.lib +endif # Destination directories and files OBJ_DIR = $(BUILD) @@ -47,14 +55,19 @@ endif # Compile flags -C_FLAGS = -c -maxerrors 25 -msgstyle gcc -wchar_t on -bool on -processor Pentium +C_FLAGS += -c -maxerrors 25 -msgstyle gcc -wchar_t on -bool on -processor Pentium C_FLAGS += -nostdinc -nosyspath C_FLAGS += -relax_pointers # To remove type-casting errors -C_FLAGS += -DNETWARE -DZTS -DNEW_LIBC -DUSE_OLD_FUNCTIONS -DCOMPILE_DL_MYSQL=1 -C_FLAGS += -I. -I- -I$(PROJECT_ROOT) -I$(PROJECT_ROOT)/main +C_FLAGS += -DNETWARE -DZTS -DUSE_OLD_FUNCTIONS -DCOMPILE_DL_MYSQL=1 + +ifdef MYSQL_VER + C_FLAGS += -D__NETWARE__ # This define is required for MySQL 4.1 +endif + +C_FLAGS += -I. -I$(PROJECT_ROOT) -I$(PROJECT_ROOT)/main C_FLAGS += -I$(PROJECT_ROOT)/ext/standard -I$(PROJECT_ROOT)/netware C_FLAGS += -I$(PROJECT_ROOT)/zend -I$(PROJECT_ROOT)/tsrm -C_FLAGS += -I$(SDK_DIR)/include -I$(MWCIncludes) +C_FLAGS += -I- -I$(SDK_DIR)/include -I$(MWCIncludes) C_FLAGS += -I$(MYSQL_DIR)/include C_FLAGS += -I$(WINSOCK_DIR)/include/nlm -I$(WINSOCK_DIR)/include @@ -67,7 +80,7 @@ LD_FLAGS += -sym on -sym codeview4 -osym $(SYM_FILE) export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtld.lib else - C_FLAGS += -opt speed -inline on -inline smart -inline auto -sym off -opt intrinsics + C_FLAGS += -opt all -inline on -inline smart -inline auto -sym off -opt intrinsics C_FLAGS += -opt level=4 -DZEND_DEBUG=0 LD_FLAGS += -sym off export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtl.lib @@ -75,15 +88,30 @@ # Dependencies -MODULE = LibC \ - phplib -IMPORT = @$(SDK_DIR)/imports/libc.imp \ - @$(SDK_DIR)/imports/ws2nlm.imp \ - @$(MPK_DIR)/import/mpkOrg.imp \ - @$(PROJECT_ROOT)/netware/phplib.imp +ifdef MYSQL_VER + MODULE = LibC \ + phplib \ + libmysql +else + MODULE = LibC \ + phplib +endif +ifdef MYSQL_VER + IMPORT = @$(SDK_DIR)/imports/libc.imp \ + @$(SDK_DIR)/imports/ws2nlm.imp \ + @$(MPK_DIR)/import/mpkOrg.imp \ + @$(PROJECT_ROOT)/netware/phplib.imp \ + @$(MYSQL_DIR)/lib/libmysql.imp +else + IMPORT = @$(SDK_DIR)/imports/libc.imp \ + @$(SDK_DIR)/imports/ws2nlm.imp \ + @$(MPK_DIR)/import/mpkOrg.imp \ + @$(PROJECT_ROOT)/netware/phplib.imp +endif EXPORT = ($(MODULE_NAME)) get_module API = OutputToScreen + # Virtual paths vpath %.cpp . vpath %.c . ..\..\netware @@ -139,7 +167,11 @@ @echo Linking $@... @echo $(LD_FLAGS) -commandfile $(basename $@).def > $(basename $@).link +ifdef MYSQL_VER + @echo $(OBJECTS) >> $(basename $@).link +else @echo $(LIBRARY) $(OBJECTS) >> $(basename $@).link +endif @$(LINK) @$(basename $@).link @@ -159,7 +191,11 @@ .PHONY: cleanbin cleanbin: @echo Deleting binary files... +ifdef MYSQL_VER + -@del "$(FINAL_DIR)\$(MODULE_NAME)$(MYSQL_VER).nlm" +else -@del "$(FINAL_DIR)\$(MODULE_NAME).nlm" +endif @echo Deleting MAP, DEF files, etc.... -@del "$(FINAL_DIR)\$(MODULE_NAME).map" -@del "$(FINAL_DIR)\$(MODULE_NAME).def" Index: ext/openssl/openssl.c =================================================================== RCS file: /repository/php-src/ext/openssl/openssl.c,v retrieving revision 1.87 diff -u -r1.87 openssl.c --- ext/openssl/openssl.c 8 Jan 2004 08:16:39 -0000 1.87 +++ ext/openssl/openssl.c 26 Feb 2004 10:49:53 -0000 @@ -77,6 +77,10 @@ PHP_OPENSSL_CIPHER_DEFAULT = PHP_OPENSSL_CIPHER_RC2_40 }; +#ifdef NETWARE +#define timezone _timezone /* timezone is called _timezone in LibC */ +#endif + /* {{{ openssl_functions[] */ function_entry openssl_functions[] = { @@ -135,7 +139,11 @@ "openssl", openssl_functions, PHP_MINIT(openssl), +#ifdef NETWARE + PHP_MSHUTDOWN(openssl), +#else NULL, +#endif NULL, NULL, PHP_MINFO(openssl), @@ -660,6 +668,9 @@ PHP_MSHUTDOWN_FUNCTION(openssl) { EVP_cleanup(); +#ifdef NETWARE + ERR_free_strings(); /* cleanup */ +#endif php_unregister_url_stream_wrapper("https" TSRMLS_CC); php_unregister_url_stream_wrapper("ftps" TSRMLS_CC); @@ -1666,6 +1677,9 @@ if (we_made_the_key) { /* and a resource for the private key */ ZVAL_RESOURCE(out_pkey, zend_list_insert(req.priv_key, le_key)); +#ifdef NETWARE + req.priv_key = NULL; /* make sure the cleanup code doesn't zap it! */ +#endif } else if (key_resource != -1) { req.priv_key = NULL; /* make sure the cleanup code doesn't zap it! */ } @@ -2939,6 +2953,18 @@ eksl = safe_emalloc(nkeys, sizeof(*eksl), 0); eks = safe_emalloc(nkeys, sizeof(*eks), 0); key_resources = safe_emalloc(nkeys, sizeof(long), 0); +#ifdef NETWARE + /* Initialising the elements to NULL before memory allocation can be done into them. + * This is done for this scenario: + * If php_openssl_evp_from_zval call done below fails, then no memory is allocated + * for these elements. Then the subsequent freeing of these in the clean_exit: section + * towards the end will abend. + */ + for(i=0; ifd, LOCK_EX); #ifdef F_SETFD +#ifdef NETWARE + /* Anantha Kesari 26 February 2004 + * On NetWare, fcntl as implemented in LibC returns a positive integer + * value when it is successful. Otherwise, it returns -1 and sets errno + * accordingly. So, changing the logic for NetWare. + */ + if (fcntl(data->fd, F_SETFD, 1) == -1) { +#else if (fcntl(data->fd, F_SETFD, 1)) { +#endif php_error_docref(NULL TSRMLS_CC, E_WARNING, "fcntl(%d, F_SETFD, 1) failed: %s (%d)", data->fd, strerror(errno), errno); } #endif @@ -215,7 +224,11 @@ buf[dirname_len + entry_len + 1] = '\0'; /* check whether its last access was more than maxlifet ago */ if (VCWD_STAT(buf, &sbuf) == 0 && +#ifdef NETWARE + (now - sbuf.st_mtime.tv_sec) > maxlifetime) { +#else (now - sbuf.st_mtime) > maxlifetime) { +#endif VCWD_UNLINK(buf); nrdels++; } Index: ext/session/session.c =================================================================== RCS file: /repository/php-src/ext/session/session.c,v retrieving revision 1.382 diff -u -r1.382 session.c --- ext/session/session.c 9 Jan 2004 15:30:07 -0000 1.382 +++ ext/session/session.c 26 Feb 2004 10:49:55 -0000 @@ -855,7 +855,11 @@ #define LAST_MODIFIED "Last-Modified: " memcpy(buf, LAST_MODIFIED, sizeof(LAST_MODIFIED) - 1); +#ifdef NETWARE + strcpy_gmt(buf + sizeof(LAST_MODIFIED) - 1, &(sb.st_mtime.tv_sec)); +#else strcpy_gmt(buf + sizeof(LAST_MODIFIED) - 1, &sb.st_mtime); +#endif ADD_HEADER(buf); } } Index: ext/snmp/snmp.c =================================================================== RCS file: /repository/php-src/ext/snmp/snmp.c,v retrieving revision 1.90 diff -u -r1.90 snmp.c --- ext/snmp/snmp.c 8 Jan 2004 08:17:26 -0000 1.90 +++ ext/snmp/snmp.c 26 Feb 2004 10:49:57 -0000 @@ -40,19 +40,13 @@ #include "win32/time.h" #elif defined(NETWARE) #ifdef USE_WINSOCK -/*#include */ #include #else #include #endif #include -/*#include */ -#ifdef NEW_LIBC #include #else -#include "netware/time_nw.h" -#endif -#else #include #include #include Index: ext/standard/basic_functions.c =================================================================== RCS file: /repository/php-src/ext/standard/basic_functions.c,v retrieving revision 1.653 diff -u -r1.653 basic_functions.c --- ext/standard/basic_functions.c 19 Jan 2004 19:01:17 -0000 1.653 +++ ext/standard/basic_functions.c 26 Feb 2004 10:50:00 -0000 @@ -50,14 +50,9 @@ #ifndef NETWARE #include #else -/*#include "netware/env.h"*/ /* Temporary */ -#ifdef NEW_LIBC /* Same headers hold good for Winsock and Berkeley sockets */ +/* Same headers hold good for Winsock and Berkeley sockets */ #include -/*#include */ #include -#else -#include -#endif #endif #if HAVE_ARPA_INET_H Index: ext/standard/datetime.c =================================================================== RCS file: /repository/php-src/ext/standard/datetime.c,v retrieving revision 1.113 diff -u -r1.113 datetime.c --- ext/standard/datetime.c 8 Jan 2004 08:17:30 -0000 1.113 +++ ext/standard/datetime.c 26 Feb 2004 10:50:00 -0000 @@ -52,7 +52,7 @@ }; #if !defined(HAVE_TM_ZONE) && !defined(_TIMEZONE) && !defined(HAVE_DECLARED_TIMEZONE) -#if defined(NETWARE) && defined(NEW_LIBC) +#ifdef NETWARE #define timezone _timezone /* timezone is called '_timezone' in new version of LibC */ #endif extern time_t timezone; Index: ext/standard/dl.c =================================================================== RCS file: /repository/php-src/ext/standard/dl.c,v retrieving revision 1.86 diff -u -r1.86 dl.c --- ext/standard/dl.c 8 Jan 2004 08:17:31 -0000 1.86 +++ ext/standard/dl.c 26 Feb 2004 10:50:01 -0000 @@ -40,11 +40,7 @@ #include "win32/winutil.h" #define GET_DL_ERROR() php_win_err() #elif defined(NETWARE) -#ifdef NEW_LIBC #include -#else -#include "netware/param.h" -#endif #define GET_DL_ERROR() dlerror() #else #include @@ -173,8 +169,9 @@ 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 */ + /* NetWare doesn't prepend '_' to symbol names. So the corresponding portion of code is also + * not required for NetWare + */ #endif if (!get_module) { Index: ext/standard/exec.c =================================================================== RCS file: /repository/php-src/ext/standard/exec.c,v retrieving revision 1.109 diff -u -r1.109 exec.c --- ext/standard/exec.c 21 Jan 2004 16:57:13 -0000 1.109 +++ ext/standard/exec.c 26 Feb 2004 10:50:01 -0000 @@ -69,6 +69,29 @@ void (*sig_handler)(); #endif +#ifdef NETWARE + /* Anantha Kesari 16 July 2003 + * + * 1. system() and exec() functions were abending when unitialised / + * NULL value was passed to them like: + * system($notdefindedvar); OR exec($notdefindedvar); + * + * 2. system() and exec() functions were not returning proper error when + * empty string was passed to them like: + * system(""); OR exec(""); + * + * These are fixed below. + */ + if(!cmd) { + php_error(E_WARNING, "Uninitialised / NULL value passed to system() or exec() function"); + return -1; + } + if(*cmd==NULL) { + php_error(E_WARNING, "Empty string passed to system() or exec() function"); + return -1; + } +#endif + if (PG(safe_mode)) { if ((c = strchr(cmd, ' '))) { *c = '\0'; Index: ext/standard/file.c =================================================================== RCS file: /repository/php-src/ext/standard/file.c,v retrieving revision 1.378 diff -u -r1.378 file.c --- ext/standard/file.c 19 Jan 2004 18:40:39 -0000 1.378 +++ ext/standard/file.c 26 Feb 2004 10:50:03 -0000 @@ -47,24 +47,26 @@ #define O_RDONLY _O_RDONLY #include "win32/param.h" #include "win32/winutil.h" -#elif defined(NETWARE) && !defined(NEW_LIBC) -/*#include */ -#include -#include "netware/param.h" -#else +#elif defined(NETWARE) #include #include -#if defined(NETWARE) && defined(USE_WINSOCK) +#ifdef USE_WINSOCK #include #else #include #include #include #endif +#else /* NETWARE */ +#include +#include +#include +#include +#include +#endif #if HAVE_ARPA_INET_H #include #endif -#endif #include "ext/standard/head.h" #include "safe_mode.h" #include "php_string.h" @@ -1518,7 +1520,7 @@ MAKE_LONG_ZVAL_INCREF(stat_rdev, -1); #endif MAKE_LONG_ZVAL_INCREF(stat_size, stat_ssb.sb.st_size); -#if defined(NETWARE) && defined(CLIB_STAT_PATCH) +#ifdef NETWARE MAKE_LONG_ZVAL_INCREF(stat_atime, stat_ssb.sb.st_atime.tv_sec); MAKE_LONG_ZVAL_INCREF(stat_mtime, stat_ssb.sb.st_mtime.tv_sec); MAKE_LONG_ZVAL_INCREF(stat_ctime, stat_ssb.sb.st_ctime.tv_sec); Index: ext/standard/filestat.c =================================================================== RCS file: /repository/php-src/ext/standard/filestat.c,v retrieving revision 1.130 diff -u -r1.130 filestat.c --- ext/standard/filestat.c 8 Jan 2004 08:17:31 -0000 1.130 +++ ext/standard/filestat.c 26 Feb 2004 10:50:03 -0000 @@ -323,7 +323,7 @@ Change file group */ PHP_FUNCTION(chgrp) { -#if !defined(WINDOWS) && !defined(NETWARE) /* I guess 'chgrp' won't be available on NetWare */ +#if !defined(WINDOWS) && !defined(NETWARE) /* 'chgrp' is not available on NetWare */ pval **filename, **group; gid_t gid; struct group *gr=NULL; @@ -371,7 +371,7 @@ Change file owner */ PHP_FUNCTION(chown) { -#if !defined(WINDOWS) && !defined(NETWARE) /* I guess 'chown' won't be available on NetWare */ +#if !defined(WINDOWS) && !defined(NETWARE) /* 'chown' is not available on NetWare */ pval **filename, **user; int ret; uid_t uid; @@ -460,11 +460,7 @@ { 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,11 +542,7 @@ { 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 php_stream_statbuf ssb; int flags = 0, 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", @@ -633,30 +625,26 @@ case FS_INODE: RETURN_LONG((long)ssb.sb.st_ino); case FS_SIZE: -#if defined(NETWARE) && defined(NEW_LIBC) - RETURN_LONG((long)(stat_sb->st_size)); -#else RETURN_LONG((long)ssb.sb.st_size); -#endif case FS_OWNER: RETURN_LONG((long)ssb.sb.st_uid); case FS_GROUP: RETURN_LONG((long)ssb.sb.st_gid); case FS_ATIME: -#if defined(NETWARE) && defined(NEW_LIBC) - RETURN_LONG((long)((stat_sb->st_atime).tv_sec)); +#ifdef NETWARE + RETURN_LONG((long)ssb.sb.st_atime.tv_sec); #else RETURN_LONG((long)ssb.sb.st_atime); #endif case FS_MTIME: -#if defined(NETWARE) && defined(NEW_LIBC) - RETURN_LONG((long)((stat_sb->st_mtime).tv_sec)); +#ifdef NETWARE + RETURN_LONG((long)ssb.sb.st_mtime.tv_sec); #else RETURN_LONG((long)ssb.sb.st_mtime); #endif case FS_CTIME: -#if defined(NETWARE) && defined(NEW_LIBC) - RETURN_LONG((long)((stat_sb->st_ctime).tv_sec)); +#ifdef NETWARE + RETURN_LONG((long)ssb.sb.st_ctime.tv_sec); #else RETURN_LONG((long)ssb.sb.st_ctime); #endif @@ -707,7 +695,7 @@ MAKE_LONG_ZVAL_INCREF(stat_rdev, -1); #endif MAKE_LONG_ZVAL_INCREF(stat_size, stat_sb->st_size); -#if defined(NETWARE) && defined(NEW_LIBC) +#ifdef NETWARE MAKE_LONG_ZVAL_INCREF(stat_atime, (stat_sb->st_atime).tv_sec); MAKE_LONG_ZVAL_INCREF(stat_mtime, (stat_sb->st_mtime).tv_sec); MAKE_LONG_ZVAL_INCREF(stat_ctime, (stat_sb->st_ctime).tv_sec); Index: ext/standard/flock_compat.c =================================================================== RCS file: /repository/php-src/ext/standard/flock_compat.c,v retrieving revision 1.27 diff -u -r1.27 flock_compat.c --- ext/standard/flock_compat.c 8 Jan 2004 08:17:31 -0000 1.27 +++ ext/standard/flock_compat.c 26 Feb 2004 10:50:04 -0000 @@ -33,11 +33,7 @@ #endif #ifdef NETWARE -#ifdef NEW_LIBC #include -#else -#include -#endif #endif #ifndef HAVE_FLOCK Index: ext/standard/fsock.h =================================================================== RCS file: /repository/php-src/ext/standard/fsock.h,v retrieving revision 1.47 diff -u -r1.47 fsock.h --- ext/standard/fsock.h 8 Jan 2004 17:32:51 -0000 1.47 +++ ext/standard/fsock.h 26 Feb 2004 10:50:04 -0000 @@ -26,11 +26,7 @@ #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: ext/standard/ftp_fopen_wrapper.c =================================================================== RCS file: /repository/php-src/ext/standard/ftp_fopen_wrapper.c,v retrieving revision 1.71 diff -u -r1.71 ftp_fopen_wrapper.c --- ext/standard/ftp_fopen_wrapper.c 8 Jan 2004 08:17:32 -0000 1.71 +++ ext/standard/ftp_fopen_wrapper.c 26 Feb 2004 10:50:04 -0000 @@ -36,14 +36,8 @@ #define O_RDONLY _O_RDONLY #include "win32/param.h" #elif defined(NETWARE) -/*#include */ -/*#include */ -#ifdef NEW_LIBC #include #else -#include "netware/param.h" -#endif -#else #include #endif @@ -57,7 +51,6 @@ #ifdef PHP_WIN32 #include #elif defined(NETWARE) && defined(USE_WINSOCK) -/*#include */ #include #else #include @@ -764,9 +757,15 @@ ssb->sb.st_dev = 0; ssb->sb.st_uid = 0; ssb->sb.st_gid = 0; +#ifdef NETWARE + ssb->sb.st_atime.tv_sec = -1; + ssb->sb.st_mtime.tv_sec = -1; + ssb->sb.st_ctime.tv_sec = -1; +#else ssb->sb.st_atime = -1; ssb->sb.st_mtime = -1; ssb->sb.st_ctime = -1; +#endif ssb->sb.st_nlink = 1; ssb->sb.st_rdev = -1; #ifdef HAVE_ST_BLKSIZE Index: ext/standard/head.c =================================================================== RCS file: /repository/php-src/ext/standard/head.c,v retrieving revision 1.74 diff -u -r1.74 head.c --- ext/standard/head.c 8 Jan 2004 08:17:32 -0000 1.74 +++ ext/standard/head.c 26 Feb 2004 10:50:05 -0000 @@ -19,10 +19,6 @@ #include -#if defined(NETWARE) && !defined(NEW_LIBC) -#include -#endif - #include "php.h" #include "ext/standard/php_standard.h" #include "SAPI.h" Index: ext/standard/http_fopen_wrapper.c =================================================================== RCS file: /repository/php-src/ext/standard/http_fopen_wrapper.c,v retrieving revision 1.80 diff -u -r1.80 http_fopen_wrapper.c --- ext/standard/http_fopen_wrapper.c 8 Jan 2004 08:17:32 -0000 1.80 +++ ext/standard/http_fopen_wrapper.c 26 Feb 2004 10:50:05 -0000 @@ -38,14 +38,8 @@ #define O_RDONLY _O_RDONLY #include "win32/param.h" #elif defined(NETWARE) -/*#include */ -/*#include */ -#ifdef NEW_LIBC #include #else -#include "netware/param.h" -#endif -#else #include #endif @@ -59,7 +53,6 @@ #ifdef PHP_WIN32 #include #elif defined(NETWARE) && defined(USE_WINSOCK) -/*#include */ #include #else #include Index: ext/standard/image.c =================================================================== RCS file: /repository/php-src/ext/standard/image.c,v retrieving revision 1.98 diff -u -r1.98 image.c --- ext/standard/image.c 8 Jan 2004 08:17:32 -0000 1.98 +++ ext/standard/image.c 26 Feb 2004 10:50:06 -0000 @@ -21,9 +21,6 @@ #include "php.h" #include -#if defined(NETWARE) && !defined(NEW_LIBC) -#include -#endif #if HAVE_FCNTL_H #include #endif Index: ext/standard/lcg.c =================================================================== RCS file: /repository/php-src/ext/standard/lcg.c,v retrieving revision 1.38 diff -u -r1.38 lcg.c --- ext/standard/lcg.c 8 Jan 2004 08:17:33 -0000 1.38 +++ ext/standard/lcg.c 26 Feb 2004 10:50:07 -0000 @@ -28,12 +28,8 @@ #ifdef PHP_WIN32 #include "win32/time.h" #elif defined(NETWARE) -#ifdef NEW_LIBC #include #else -#include "netware/time_nw.h" -#endif -#else #include #endif Index: ext/standard/link.c =================================================================== RCS file: /repository/php-src/ext/standard/link.c,v retrieving revision 1.48 diff -u -r1.48 link.c --- ext/standard/link.c 8 Jan 2004 08:17:33 -0000 1.48 +++ ext/standard/link.c 26 Feb 2004 10:50:07 -0000 @@ -83,11 +83,7 @@ PHP_FUNCTION(linkinfo) { zval **filename; -#if defined(NETWARE) && defined(CLIB_STAT_PATCH) - struct stat_libc sb; -#else struct stat sb; -#endif int ret; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { Index: ext/standard/microtime.c =================================================================== RCS file: /repository/php-src/ext/standard/microtime.c,v retrieving revision 1.44 diff -u -r1.44 microtime.c --- ext/standard/microtime.c 8 Jan 2004 08:17:33 -0000 1.44 +++ ext/standard/microtime.c 26 Feb 2004 10:50:07 -0000 @@ -26,11 +26,8 @@ #ifdef PHP_WIN32 #include "win32/time.h" #elif defined(NETWARE) -#ifdef NEW_LIBC #include -#else -#include "netware/time_nw.h" -#endif +#include #else #include #endif Index: ext/standard/pack.c =================================================================== RCS file: /repository/php-src/ext/standard/pack.c,v retrieving revision 1.51 diff -u -r1.51 pack.c --- ext/standard/pack.c 8 Jan 2004 08:17:33 -0000 1.51 +++ ext/standard/pack.c 26 Feb 2004 10:50:07 -0000 @@ -30,17 +30,12 @@ #include "win32/param.h" #elif defined(NETWARE) #ifdef USE_WINSOCK -/*#include */ #include #else #include #endif -#ifdef NEW_LIBC #include #else -#include "netware/param.h" -#endif -#else #include #endif #include "ext/standard/head.h" Index: ext/standard/pageinfo.c =================================================================== RCS file: /repository/php-src/ext/standard/pageinfo.c,v retrieving revision 1.37 diff -u -r1.37 pageinfo.c --- ext/standard/pageinfo.c 8 Jan 2004 08:17:33 -0000 1.37 +++ ext/standard/pageinfo.c 26 Feb 2004 10:50:08 -0000 @@ -64,11 +64,7 @@ */ PHPAPI void php_statpage(TSRMLS_D) { -#if defined(NETWARE) && defined(CLIB_STAT_PATCH) - struct stat_libc *pstat; -#else struct stat *pstat; -#endif pstat = sapi_get_stat(TSRMLS_C); @@ -77,8 +73,8 @@ BG(page_uid) = pstat->st_uid; BG(page_gid) = pstat->st_gid; BG(page_inode) = pstat->st_ino; -#if defined(NETWARE) && defined(NEW_LIBC) - BG(page_mtime) = (pstat->st_mtime).tv_nsec; +#ifdef NETWARE + BG(page_mtime) = (pstat->st_mtime).tv_sec; #else BG(page_mtime) = pstat->st_mtime; #endif Index: ext/standard/rand.c =================================================================== RCS file: /repository/php-src/ext/standard/rand.c,v retrieving revision 1.68 diff -u -r1.68 rand.c --- ext/standard/rand.c 19 Jan 2004 03:14:58 -0000 1.68 +++ ext/standard/rand.c 26 Feb 2004 10:50:08 -0000 @@ -24,10 +24,6 @@ #include -#if defined(NETWARE) && !defined(NEW_LIBC) /* For getpid() used below */ -#include "netware/pwd.h" -#endif - #include "php.h" #include "php_math.h" #include "php_rand.h" Index: ext/standard/streamsfuncs.c =================================================================== RCS file: /repository/php-src/ext/standard/streamsfuncs.c,v retrieving revision 1.32 diff -u -r1.32 streamsfuncs.c --- ext/standard/streamsfuncs.c 8 Jan 2004 08:17:34 -0000 1.32 +++ ext/standard/streamsfuncs.c 26 Feb 2004 10:50:09 -0000 @@ -31,6 +31,11 @@ #include "php_network.h" #include "php_string.h" +/* Additional headers for NetWare */ +#if defined(NETWARE) && !defined(USE_WINSOCK) +#include +#endif + #ifndef PHP_WIN32 #define php_select(m, r, w, e, t) select(m, r, w, e, t) #else Index: ext/xml/xml.mak =================================================================== RCS file: /repository/php-src/ext/xml/xml.mak,v retrieving revision 1.3 diff -u -r1.3 xml.mak --- ext/xml/xml.mak 17 Jan 2004 12:59:55 -0000 1.3 +++ ext/xml/xml.mak 26 Feb 2004 10:50:10 -0000 @@ -5,7 +5,7 @@ # Module details MODULE_NAME = php_xml MODULE_DESC = "PHP 5 - XML Extension" -VMAJ = 3 +VMAJ = 1 VMIN = 0 VREV = 0 @@ -17,7 +17,8 @@ .SUFFIXES: .nlm .lib .obj .cpp .c .msg .mlc .mdb .xdc .d # Source files -C_SRC = xml.c \ +C_SRC = compat.c \ + xml.c \ start.c CPP_SRC_NODIR = $(notdir $(CPP_SRC)) @@ -46,12 +47,12 @@ C_FLAGS += -nostdinc -nosyspath C_FLAGS += -relax_pointers # To remove type-casting errors C_FLAGS += -DNETWARE -DZTS -C_FLAGS += -DNEW_LIBC C_FLAGS += -DCOMPILE_DL_XML -DHAVE_LIBEXPAT=1 -C_FLAGS += -I. -I- -I$(PROJECT_ROOT) -I$(PROJECT_ROOT)/main + +C_FLAGS += -I. -I$(PROJECT_ROOT) -I$(PROJECT_ROOT)/main C_FLAGS += -I$(PROJECT_ROOT)/ext/standard -I$(PROJECT_ROOT)/netware C_FLAGS += -I$(PROJECT_ROOT)/zend -I$(PROJECT_ROOT)/tsrm -C_FLAGS += -I$(SDK_DIR)/include -I$(MWCIncludes) +C_FLAGS += -I- -I$(SDK_DIR)/include -I$(MWCIncludes) C_FLAGS += -I$(EXPAT_DIR)/include ifndef STACK_SIZE @@ -61,12 +62,12 @@ # Extra stuff based on debug / release builds ifeq '$(BUILD)' 'debug' SYM_FILE = $(FINAL_DIR)\$(MODULE_NAME).sym - C_FLAGS += -inline smart -sym on -sym codeview4 -opt off -opt intrinsics -sym internal -DDEBUGGING -DDKFBPON + C_FLAGS += -inline smart -sym on -sym codeview4 -opt off -opt intrinsics -sym internal -DDEBUGGING -DDKFBPON C_FLAGS += -exc cw -DZEND_DEBUG=1 LD_FLAGS += -sym on -sym codeview4 -osym $(SYM_FILE) export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtld.lib else - C_FLAGS += -opt speed -inline on -inline smart -inline auto -sym off + C_FLAGS += -opt all -inline on -inline smart -inline auto -sym off C_FLAGS += -opt intrinsics C_FLAGS += -opt level=4 -DZEND_DEBUG=0 LD_FLAGS += -sym off Index: main/config.nw.h =================================================================== RCS file: /repository/php-src/main/config.nw.h,v retrieving revision 1.6 diff -u -r1.6 config.nw.h --- main/config.nw.h 8 Jan 2004 17:33:04 -0000 1.6 +++ main/config.nw.h 26 Feb 2004 10:50:12 -0000 @@ -25,17 +25,18 @@ #define PHP_SIGCHILD 0 /* dns functions found in resolv.lib */ -#define HAVE_LIBBIND 1 +/*#define HAVE_LIBBIND 1*/ +#undef HAVE_LIBBIND /* This is Win32 stuff and so commented for NetWare */ #define HAVE_GETSERVBYNAME 1 #define HAVE_GETSERVBYPORT 1 #define HAVE_GETPROTOBYNAME 1 #define HAVE_GETPROTOBYNUMBER 1 -/* set to enable bcmath */ +/* set to enable BCMATH */ #define HAVE_BCMATH 1 -/* set to enable mysql */ +/* set to enable MySQL */ #define HAVE_MYSQL 1 /* set to enable FTP support */ @@ -44,6 +45,9 @@ /* set to enable SNMP */ /*#define HAVE_SNMP 1*/ +/* set to enable OpenSSL */ +/*#define HAVE_OPENSSL_EXT 1*/ + /* defines for PostgreSQL extension */ #define HAVE_PGSQL 1 #define PHP_PGSQL_PRIVATE 1 @@ -52,12 +56,15 @@ #define HAVE_PQCMDTUPLES 1 #define HAVE_PQOIDVALUE 1 +/* set to enable FTP support */ +#define HAVE_FTP 1 + /* set to enable bundled PCRE library */ #define HAVE_BUNDLED_PCRE 1 /* set to enable bundled expat library */ -/* #define HAVE_LIBEXPAT 1 */ /* For now */ -#define HAVE_WDDX 0 +/*#define HAVE_LIBEXPAT 1*/ /* Commented for now */ +#define HAVE_WDDX 0 /* Instead of 1 */ /* set to enable the crypt command */ /* #define HAVE_CRYPT 1 */ @@ -73,6 +80,9 @@ #define STDOUT_FILENO 1 #define STDERR_FILENO 2 +/* set to enable XML support */ +#define HAVE_XML 1 + /* ---------------------------------------------------------------- The following are defaults for run-time configuration ---------------------------------------------------------------*/ @@ -98,7 +108,7 @@ /* ---------------------------------------------------------------- The following may or may not be (or need to be) ported to the - windows environment. + NetWare environment. ---------------------------------------------------------------*/ /* Define if you have the link function. */ @@ -146,20 +156,22 @@ #undef HAVE_FLOCK /* Define if you have alloca, as a function or macro. */ -/* Though we have alloca(), this seems to be causing some problem with the stack pointer -- hence not using it */ +/* Though we have alloca(), this seems to be causing some problem with the stack pointer + * -- hence not using it + */ /* #define HAVE_ALLOCA 1 */ /* Define if you have */ -#undef HAVE_SYS_TIME_H +#define HAVE_SYS_TIME_H 1 /* Define if you have */ #define HAVE_SIGNAL_H 1 /* Define if your struct stat has st_blksize. */ -#define HAVE_ST_BLKSIZE +#define HAVE_ST_BLKSIZE 1 /* Define if your struct stat has st_blocks. */ -#define HAVE_ST_BLOCKS +#define HAVE_ST_BLOCKS 1 /* Define if your struct stat has st_rdev. */ #define HAVE_ST_RDEV 1 @@ -197,7 +209,7 @@ #define HAVE_REGCOMP 1 /* Define if you have the setlocale function. */ -/* #define HAVE_SETLOCALE 1 */ /* LibC doesn't seem to be supporting fully -- hence commenting for now */ +#define HAVE_SETLOCALE 1 #define HAVE_LOCALECONV 1 @@ -279,9 +291,9 @@ /* Defined since unsetenv function is defined in LibC. * This is used to destroy env values in the function php_putenv_destructor. - * If we do not use unsetenv, then the environment variables are directlt manipulated. - * This will then result in LibC not being able to do the maintenance - * that is required for NetWare. + * If we do not use unsetenv, then the environment variables are directlt + * manipulated. This will then result in LibC not being able to do + * the maintenance that is required for NetWare. */ #define HAVE_UNSETENV 1 @@ -295,7 +307,11 @@ /* This is the default configuration file to read */ #define CONFIGURATION_FILE_PATH "php.ini" +#ifdef APACHE_2_BUILD +#define APACHE_MODULE_DIR "sys:/apache2/modules" +#else #define APACHE_MODULE_DIR "sys:/apache/modules" +#endif #define PHP_BINDIR "sys:/php" #define PHP_LIBDIR PHP_BINDIR #define PHP_DATADIR PHP_BINDIR @@ -304,10 +320,10 @@ #define PHP_CONFIG_FILE_PATH "sys:/php" #define PEAR_INSTALLDIR "sys:/php/pear" -#define PHP_CONFIG_FILE_SCAN_DIR NULL +#define PHP_CONFIG_FILE_SCAN_DIR "" /* Abends if NULL is used instead of "" */ #define PHP_EXTENSION_DIR "sys:/php/ext" -#define PHP_INCLUDE_PATH NULL +#define PHP_INCLUDE_PATH ".;sys:/php/includes" /* Put the actual value instead of NULL */ #define PHP_PREFIX "sys:/php" #define PHP_SHLIB_SUFFIX "nlm" Index: main/fopen_wrappers.c =================================================================== RCS file: /repository/php-src/main/fopen_wrappers.c,v retrieving revision 1.168 diff -u -r1.168 fopen_wrappers.c --- main/fopen_wrappers.c 8 Jan 2004 08:17:53 -0000 1.168 +++ main/fopen_wrappers.c 26 Feb 2004 10:50:13 -0000 @@ -36,14 +36,8 @@ #define O_RDONLY _O_RDONLY #include "win32/param.h" #elif defined(NETWARE) -/*#include */ -/*#include */ -#ifdef NEW_LIBC #include #else -#include "netware/param.h" -#endif -#else #include #endif @@ -75,7 +69,6 @@ #ifdef PHP_WIN32 #include #elif defined(NETWARE) && defined(USE_WINSOCK) -/*#include */ #include #else #include Index: main/main.c =================================================================== RCS file: /repository/php-src/main/main.c,v retrieving revision 1.585 diff -u -r1.585 main.c --- main/main.c 8 Jan 2004 08:17:53 -0000 1.585 +++ main/main.c 26 Feb 2004 10:50:14 -0000 @@ -32,14 +32,7 @@ #include "win32/signal.h" #include #elif defined(NETWARE) -#ifdef NEW_LIBC #include -#else -#include "netware/time_nw.h" -#endif -/*#include "netware/signal_nw.h"*/ -/*#include "netware/env.h"*/ /* Temporary */ -/*#include */ #ifdef USE_WINSOCK #include #endif @@ -394,6 +387,16 @@ int size; TSRMLS_FETCH(); +#ifdef NETWARE + /* KMurugan 13 Nov 2003 + * While calling the php_printf function recursively, the stack_limit + * flag will be set, if stack is about to be overflowed. + * The cut off used is 2048 bytes on the stack + */ + if (stackavail() <= 2048) { + EG(nw_stack_limit)=1; + } +#endif va_start(args, format); size = vspprintf(&buffer, 0, format, args); if (buffer) { Index: main/mergesort.c =================================================================== RCS file: /repository/php-src/main/mergesort.c,v retrieving revision 1.14 diff -u -r1.14 mergesort.c --- main/mergesort.c 19 Feb 2003 08:40:18 -0000 1.14 +++ main/mergesort.c 26 Feb 2004 10:50:15 -0000 @@ -66,11 +66,6 @@ #include /* Includes definition for u_char */ #endif -#if defined(NETWARE) && !defined(NEW_LIBC) -/*#include */ -#include -#endif - static void setup(u_char *list1, u_char *list2, size_t n, size_t size, int (*cmp)(const void *, const void * TSRMLS_DC) TSRMLS_DC); static void insertionsort(u_char *a, size_t n, size_t size, int (*cmp)(const void *, const void * TSRMLS_DC) TSRMLS_DC); Index: main/network.c =================================================================== RCS file: /repository/php-src/main/network.c,v retrieving revision 1.108 diff -u -r1.108 network.c --- main/network.c 8 Jan 2004 08:17:53 -0000 1.108 +++ main/network.c 26 Feb 2004 10:50:15 -0000 @@ -29,13 +29,9 @@ #define O_RDONLY _O_RDONLY #include "win32/param.h" #elif defined(NETWARE) -#ifdef NEW_LIBC #include #include #else -#include "netware/time_nw.h" -#endif -#else #include #endif @@ -57,15 +53,12 @@ #if defined(NETWARE) #ifdef USE_WINSOCK -/*#include */ #include #else /* New headers for socket stuff */ -#ifdef NEW_LIBC #include #include #include -#endif #include #endif #elif !defined(PHP_WIN32) @@ -587,7 +580,7 @@ switch (sa->sa_family) { case AF_INET: /* generally not thread safe, but it *is* thread safe under win32 */ - buf = inet_ntoa(((struct sockaddr_in*)sa)->sin_addr); + buf = (char *)inet_ntoa(((struct sockaddr_in*)sa)->sin_addr); if (buf) { *textaddrlen = strlen(buf); *textaddr = estrndup(buf, *textaddrlen); Index: main/php.h =================================================================== RCS file: /repository/php-src/main/php.h,v retrieving revision 1.203 diff -u -r1.203 php.h --- main/php.h 12 Jan 2004 00:19:40 -0000 1.203 +++ main/php.h 26 Feb 2004 10:50:16 -0000 @@ -70,9 +70,9 @@ #ifdef NETWARE /* For php_get_uname() function */ #define PHP_UNAME "NetWare" -/* - * This is obtained using uname(2) on Unix and assigned in the case of Windows; - * we'll do it this way at least for now. + +/* The below is obtained using uname(2) on Unix and assigned in the case + * of Windows. On NetWare, we'll do it this way at least for now. */ #define PHP_OS PHP_UNAME #endif @@ -208,11 +208,7 @@ #include "win32/pwd.h" #include "win32/param.h" #elif defined(NETWARE) -#ifdef NEW_LIBC #include -#else -#include "NetWare/param.h" -#endif #include "NetWare/pwd.h" # else #include @@ -260,18 +256,8 @@ /* global variables */ extern pval *data; #if !defined(PHP_WIN32) -#ifdef NETWARE -#ifdef NEW_LIBC #define php_sleep sleep -#else /* NEW_LIBC */ -#define php_sleep delay /* sleep() and usleep() are not available */ -#define usleep delay -#endif /* NEW_LIBC */ -extern char **environ; -#else /* NETWARE */ extern char **environ; -#define php_sleep sleep -#endif /* NETWARE */ #endif /* !defined(PHP_WIN32) */ #ifdef PHP_PWRITE_64 Index: main/php_open_temporary_file.c =================================================================== RCS file: /repository/php-src/main/php_open_temporary_file.c,v retrieving revision 1.29 diff -u -r1.29 php_open_temporary_file.c --- main/php_open_temporary_file.c 8 Jan 2004 08:17:54 -0000 1.29 +++ main/php_open_temporary_file.c 26 Feb 2004 10:50:16 -0000 @@ -31,16 +31,11 @@ #include "win32/winutil.h" #elif defined(NETWARE) #ifdef USE_WINSOCK -/*#include */ #include #else #include #endif -#ifdef NEW_LIBC #include -#else -#include "netware/param.h" -#endif #include "netware/mktemp.h" #else #include Index: main/php_scandir.c =================================================================== RCS file: /repository/php-src/main/php_scandir.c,v retrieving revision 1.9 diff -u -r1.9 php_scandir.c --- main/php_scandir.c 8 Jan 2004 08:17:54 -0000 1.9 +++ main/php_scandir.c 26 Feb 2004 10:50:16 -0000 @@ -21,6 +21,8 @@ #ifdef PHP_WIN32 #include "config.w32.h" +#elif NETWARE +#include "config.nw.h" #else #include "php_config.h" #endif @@ -42,7 +44,9 @@ #endif #include +#ifndef NETWARE #include +#endif #endif /* HAVE_SCANDIR */ Index: main/php_scandir.h =================================================================== RCS file: /repository/php-src/main/php_scandir.h,v retrieving revision 1.8 diff -u -r1.8 php_scandir.h --- main/php_scandir.h 8 Jan 2004 17:33:04 -0000 1.8 +++ main/php_scandir.h 26 Feb 2004 10:50:16 -0000 @@ -31,6 +31,8 @@ #ifdef PHP_WIN32 #include "config.w32.h" #include "win32/readdir.h" +#elif NETWARE +#include "config.nw.h" #else #include "php_config.h" #endif Index: main/php_streams.h =================================================================== RCS file: /repository/php-src/main/php_streams.h,v retrieving revision 1.91 diff -u -r1.91 php_streams.h --- main/php_streams.h 8 Jan 2004 17:33:04 -0000 1.91 +++ main/php_streams.h 26 Feb 2004 10:50:17 -0000 @@ -101,11 +101,7 @@ #include "streams/php_stream_filter_api.h" typedef struct _php_stream_statbuf { -#if defined(NETWARE) && defined(CLIB_STAT_PATCH) - struct stat_libc sb; /* regular info */ -#else struct stat sb; /* regular info */ -#endif /* extended info to go here some day: content-type etc. etc. */ } php_stream_statbuf; Index: main/reentrancy.c =================================================================== RCS file: /repository/php-src/main/reentrancy.c,v retrieving revision 1.40 diff -u -r1.40 reentrancy.c --- main/reentrancy.c 8 Jan 2004 08:17:54 -0000 1.40 +++ main/reentrancy.c 26 Feb 2004 10:50:17 -0000 @@ -29,11 +29,6 @@ #include "win32/readdir.h" #endif -#if defined(NETWARE) && !(NEW_LIBC) -/*#include */ -#include -#endif - #include "php_reentrancy.h" #include "ext/standard/php_rand.h" /* for PHP_RAND_MAX */ @@ -121,10 +116,10 @@ #endif #if defined(NETWARE) -/* - Re-entrant versions of functions seem to be better for loading NLMs in different address space. - Since we have them now in LibC, we might as well make use of them. -*/ +/* Re-entrant versions of functions seem to be better for loading NLMs + * in different address space. Since we have them now in LibC, we might + * as well make use of them. + */ #define HAVE_LOCALTIME_R 1 #define HAVE_CTIME_R 1 Index: main/safe_mode.c =================================================================== RCS file: /repository/php-src/main/safe_mode.c,v retrieving revision 1.58 diff -u -r1.58 safe_mode.c --- main/safe_mode.c 8 Jan 2004 08:17:54 -0000 1.58 +++ main/safe_mode.c 26 Feb 2004 10:50:18 -0000 @@ -187,7 +187,11 @@ } PHPAPI int php_checkuid(const char *filename, char *fopen_mode, int mode) { +#ifdef NETWARE /* uid is not implemented for NetWare */ + return 1; /* For NetWare, always return TRUE or Valid */ +#else /* NETWARE */ return php_checkuid_ex(filename, fopen_mode, mode, 0); +#endif } PHPAPI char *php_get_current_user() Index: main/streams/php_stream_transport.h =================================================================== RCS file: /repository/php-src/main/streams/php_stream_transport.h,v retrieving revision 1.8 diff -u -r1.8 php_stream_transport.h --- main/streams/php_stream_transport.h 8 Jan 2004 17:33:06 -0000 1.8 +++ main/streams/php_stream_transport.h 26 Feb 2004 10:50:18 -0000 @@ -18,9 +18,25 @@ /* $Id: php_stream_transport.h,v 1.8 2004/01/08 17:33:06 sniper Exp $ */ +#if (!defined NETWARE) || (!defined APACHE_2_BUILD) +/* Excluding the below lines for NetWare when Apache2filter is being built. + * But the same is included for building Apache1.3 on NetWare and for other + * platforms. + * This is done to avoid compilation errors while compiling Apache2filter. + * This happens since apache_config.c file includes this header file and + * the path to Winsock headers are given there since Apache 2.0 headers + * look for them. Including the below would thus clash with the already + * defined Winsock headers. + */ +#ifndef COMPILE_DL_LDAP +/* Excluding the below when LDAP is being built. This is to avoid clash + * with Winsock headers that the LDAP extension defines and uses. + */ #if HAVE_SYS_SOCKET_H # include #endif +#endif +#endif typedef php_stream *(php_stream_transport_factory_func)(const char *proto, long protolen, char *resourcename, long resourcenamelen, Index: main/streams/userspace.c =================================================================== RCS file: /repository/php-src/main/streams/userspace.c,v retrieving revision 1.19 diff -u -r1.19 userspace.c --- main/streams/userspace.c 21 Jan 2004 10:17:12 -0000 1.19 +++ main/streams/userspace.c 26 Feb 2004 10:50:19 -0000 @@ -707,7 +707,7 @@ STAT_PROP_ENTRY(rdev); #endif STAT_PROP_ENTRY(size); -#if defined(NETWARE) && defined(CLIB_STAT_PATCH) +#ifdef NETWARE STAT_PROP_ENTRY_EX(atime, atime.tv_sec); STAT_PROP_ENTRY_EX(mtime, mtime.tv_sec); STAT_PROP_ENTRY_EX(ctime, ctime.tv_sec); Index: main/streams/xp_socket.c =================================================================== RCS file: /repository/php-src/main/streams/xp_socket.c,v retrieving revision 1.21 diff -u -r1.21 xp_socket.c --- main/streams/xp_socket.c 8 Jan 2004 08:17:59 -0000 1.21 +++ main/streams/xp_socket.c 26 Feb 2004 10:50:20 -0000 @@ -31,6 +31,11 @@ #include #endif +/* Additional headers for NetWare */ +#if defined(NETWARE) && !defined(USE_WINSOCK) +#include +#endif + php_stream_ops php_stream_generic_socket_ops; PHPAPI php_stream_ops php_stream_socket_ops; php_stream_ops php_stream_udp_socket_ops; --=__PartD0F1A011.0__=--