]> granicus.if.org Git - php/commitdiff
ext/standard/basic_functions.c
authorAnantha Kesari H Y <hyanantha@php.net>
Tue, 26 Jul 2005 09:32:58 +0000 (09:32 +0000)
committerAnantha Kesari H Y <hyanantha@php.net>
Tue, 26 Jul 2005 09:32:58 +0000 (09:32 +0000)
Removed Redundant inclusion headers for NetWare. NetWare LibC SDK has netdb.h.

ext/standard/file.c
NetWare LibC sys/types.h does not include sys/select.h implicitly as it is the case with Linux LibC. So including explicitly.
NetWare LibC SDK has pwd.h
NetWare specific stat structure issues.

ext/standard/filestat.c
NetWare LibC SDK has pwd.h
removing redundant CLIB_STAT_PATCH and NEW_LIBC checks

ext/standard/fsock.c
Removed the redundant NEW_LIBC checks

ext/standard/mail.c
netware/pipe.h not needed to be included anymore for NetWare
Removed the netware/sysexits.h and defined the 2 relevant macros inside the NetWare section

ext/standard/pack.c
NetWare LibC SDK has pwd.h

ext/standard/pageinfo.c
NetWare LibC SDK has pwd.h.
Removing redunant NEW_LIBC checks.

ext/standard/rand.c
NetWare LibC SDK has pwd.h.

ext/standard/ftp_fopen_wrapper.c
Removing redundant inclusion of headers. NetWare LibC SDK has sys/param.h

ext/standard/http_fopen_wrapper.c
Removing redundant inclusion of headers. NetWare LibC SDK has sys/param.h

--Kamesh

ext/standard/basic_functions.c
ext/standard/file.c
ext/standard/filestat.c
ext/standard/fsock.c
ext/standard/ftp_fopen_wrapper.c
ext/standard/http_fopen_wrapper.c
ext/standard/mail.c
ext/standard/pack.c
ext/standard/pageinfo.c
ext/standard/rand.c

index c995c1a8faf6b52282320ca83c413b8cb349f4ea..c0568a4f5920b838839a289ba29f21117c1a84cf 100644 (file)
 #include <time.h>
 #include <stdio.h>
 
-#ifndef NETWARE
 #include <netdb.h>
-#else
-/*#include "netware/env.h"*/    /* Temporary */
-#ifdef NEW_LIBC /* Same headers hold good for Winsock and Berkeley sockets */
-#include <netinet/in.h>
-/*#include <arpa/inet.h>*/
-#include <netdb.h>
-#else
-#include <sys/socket.h>
-#endif
-#endif
 
 #if HAVE_ARPA_INET_H
 # include <arpa/inet.h>
index 4e1e17c3c5d47d0b52f40eeec5302c6f935cab73..24a029d31fd0c89390c6856c969ef57921f15354 100644 (file)
 #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 HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
 #if defined(NETWARE) && defined(USE_WINSOCK)
 #include <novsock2.h>
 #else
@@ -73,8 +72,6 @@
 #if HAVE_PWD_H
 #ifdef PHP_WIN32
 #include "win32/pwd.h"
-#elif defined(NETWARE)
-#include "netware/pwd.h"
 #else
 #include <pwd.h>
 #endif
@@ -2061,9 +2058,15 @@ PHP_NAMED_FUNCTION(php_if_fstat)
        MAKE_LONG_ZVAL_INCREF(stat_rdev, -1);
 #endif
        MAKE_LONG_ZVAL_INCREF(stat_size, stat_ssb.sb.st_size);
+#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);
+#else
        MAKE_LONG_ZVAL_INCREF(stat_atime, stat_ssb.sb.st_atime);
        MAKE_LONG_ZVAL_INCREF(stat_mtime, stat_ssb.sb.st_mtime);
        MAKE_LONG_ZVAL_INCREF(stat_ctime, stat_ssb.sb.st_ctime);
+#endif
 #ifdef HAVE_ST_BLKSIZE
        MAKE_LONG_ZVAL_INCREF(stat_blksize, stat_ssb.sb.st_blksize);
 #else
index 8a6041c66033795cdecea0dc397fe7db3caab633..6a11053de7dc819b2ab4a5bf8f0834f82e4521db 100644 (file)
@@ -58,8 +58,6 @@
 #if HAVE_PWD_H
 # ifdef PHP_WIN32
 #  include "win32/pwd.h"
-# elif defined(NETWARE)
-#  include "netware/pwd.h"
 # else
 #  include <pwd.h>
 # endif
@@ -330,8 +328,12 @@ PHP_FUNCTION(disk_free_space)
        }
 #elif (defined(HAVE_SYS_STATFS_H) || defined(HAVE_SYS_MOUNT_H)) && defined(HAVE_STATFS)
        if (statfs(Z_STRVAL_PP(path), &buf)) RETURN_FALSE;
+#ifdef NETWARE
+        bytesfree = (((double)buf.f_bsize) * ((double)buf.f_bfree));
+#else
        bytesfree = (((double)buf.f_bsize) * ((double)buf.f_bavail));
 #endif
+#endif
 #endif /* WINDOWS */
 
        RETURN_DOUBLE(bytesfree);
@@ -479,11 +481,7 @@ PHP_FUNCTION(touch)
 {
        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;
@@ -560,11 +558,7 @@ static void php_stat(const char *filename, php_stat_len filename_length, int typ
 {
        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"};
@@ -683,19 +677,19 @@ static void php_stat(const char *filename, php_stat_len filename_length, int typ
        case FS_GROUP:
                RETURN_LONG((long)BG(sb).st_gid);
        case FS_ATIME:
-#if defined(NETWARE) && defined(NEW_LIBC)
+#ifdef NETWARE
                RETURN_LONG((long)(BG(sb).st_atime).tv_nsec);
 #else
                RETURN_LONG((long)BG(sb).st_atime);
 #endif
        case FS_MTIME:
-#if defined(NETWARE) && defined(NEW_LIBC)
+#ifdef NETWARE
                RETURN_LONG((long)(BG(sb).st_mtime).tv_nsec);
 #else
        RETURN_LONG((long)BG(sb).st_mtime);
 #endif
        case FS_CTIME:
-#if defined(NETWARE) && defined(NEW_LIBC)
+#ifdef NETWARE
                RETURN_LONG((long)(BG(sb).st_ctime).tv_nsec);
 #else
                RETURN_LONG((long)BG(sb).st_ctime);
@@ -774,7 +768,7 @@ static void php_stat(const char *filename, php_stat_len filename_length, int typ
                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_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);
index 72d8d453bee3007f01512db8e5a464b746b4a617..7bb8cd36e2ff77a48baf1aeae48f178a20dd0ef7 100644 (file)
 #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>
index d2267d3e9f6ecd3cc534dd9d5b109a092f53782a..c8594342545671affff8cca5ac446ce7d0c290cd 100644 (file)
 #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
@@ -57,7 +49,6 @@
 #ifdef PHP_WIN32
 #include <winsock.h>
 #elif defined(NETWARE) && defined(USE_WINSOCK)
-/*#include <ws2nlm.h>*/
 #include <novsock2.h>
 #else
 #include <netinet/in.h>
index c67688d300e902753bef4f34a6fdd7be6878317a..67d45cf554d776f4a233fab72b78c6abab4a73a1 100644 (file)
 #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
@@ -61,7 +53,6 @@
 #ifdef PHP_WIN32
 #include <winsock.h>
 #elif defined(NETWARE) && defined(USE_WINSOCK)
-/*#include <ws2nlm.h>*/
 #include <novsock2.h>
 #else
 #include <netinet/in.h>
index cab90301a5ee3eeecb01300f9f728e4c3673af62..03a787223cb34af8204325a9f0cae89d6b62ad27 100644 (file)
@@ -42,8 +42,8 @@
 #endif
 
 #ifdef NETWARE
-#include "netware/pipe.h"    /* For popen(), pclose() */
-#include "netware/sysexits.h"   /* For exit status codes like EX_OK */
+#define EX_OK           0       /* successful termination */
+#define EX_TEMPFAIL     75      /* temp failure; user is invited to retry */
 #endif
 
 #define SKIP_LONG_HEADER_SEP(str, pos)                                                                         \
index a34bb643c43913ca25a387aae05e24d4034e3525..3aeb2d2bee1a978c060f317935f0f33ae145ead5 100644 (file)
@@ -47,8 +47,6 @@
 #if HAVE_PWD_H
 #ifdef PHP_WIN32
 #include "win32/pwd.h"
-#elif defined(NETWARE)
-#include "netware/pwd.h"
 #else
 #include <pwd.h>
 #endif
index 43e7b338fbc5772a52e3b41ebf022f37cce2944f..7c83323741b4239e8fec0650f7bb5f5b720c72d5 100644 (file)
 #if HAVE_PWD_H
 #ifdef PHP_WIN32
 #include "win32/pwd.h"
-#elif defined(NETWARE)
-#ifdef ZTS
-extern int basic_globals_id;
-#endif
-#include "netware/pwd.h"
 #else
 #include <pwd.h>
 #endif
@@ -77,7 +72,7 @@ PHPAPI void php_statpage(TSRMLS_D)
                        BG(page_uid)   = pstat->st_uid;
                        BG(page_gid)   = pstat->st_gid;
                        BG(page_inode) = pstat->st_ino;
-#if defined(NETWARE) && defined(NEW_LIBC)
+#ifdef NETWARE
                        BG(page_mtime) = (pstat->st_mtime).tv_nsec;
 #else
                        BG(page_mtime) = pstat->st_mtime;
index 686d64d2639756af0fa93266eaef5f17b2d698e7..6e73833a208495373269494256c6ba6cc3e92a80 100644 (file)
 # include <windows.h>
 #endif
 
-#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"