]> granicus.if.org Git - php/commitdiff
@BeOS patch from svanegmond@bang.dhs.org modified somewhat by Rasmus
authorRasmus Lerdorf <rasmus@php.net>
Sun, 21 Jan 2001 17:29:15 +0000 (17:29 +0000)
committerRasmus Lerdorf <rasmus@php.net>
Sun, 21 Jan 2001 17:29:15 +0000 (17:29 +0000)
BeOS patch from svanegmond@bang.dhs.org modified somewhat by Rasmus

15 files changed:
TSRM/tsrm_virtual_cwd.c
configure.in
ext/mysql/libmysql/libmysql.c
ext/standard/basic_functions.c
ext/standard/dns.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/syslog.c
main/fopen_wrappers.c
main/network.c
main/php_open_temporary_file.c

index 7dca55fa642296f92038c72602e4eaea5d08c9b2..5301adf9d49df8d504ab0d01fcd41bebcc93d4d6 100644 (file)
 #include <io.h>
 #endif
 
+#ifdef __BEOS__
+#define realpath(x,y) strcpy(y,x)
+#endif
+
 #define VIRTUAL_CWD_DEBUG 0
 
 #ifdef ZTS
index 0beb52f94bb4fe33f080c007247be0cf4f837696..b791c8821112bee5777623dab37848566405c58a 100644 (file)
@@ -106,6 +106,8 @@ case "$host_alias" in
     CPPFLAGS="$CPPFLAGS -traditional-cpp";;
 *bsdi*)
     BSD_MAKEFILE=yes;;
+*beos*)
+       LIBS="$LIBS -lbe -lroot"
 esac
 
 AM_PROG_CC_STDC
@@ -294,6 +296,7 @@ stdarg.h \
 stdlib.h \
 string.h \
 syslog.h \
+sysexits.h \
 sys/file.h \
 sys/mman.h \
 sys/resource.h \
@@ -301,6 +304,7 @@ sys/select.h \
 sys/socket.h \
 sys/statfs.h \
 sys/statvfs.h \
+sys/sysexits.h \
 sys/time.h \
 sys/types.h \
 sys/varargs.h \
@@ -360,6 +364,8 @@ gai_strerror \
 gcvt \
 getlogin \
 gethostbyaddr \
+getprotobyname \
+getprotobynumber \
 getrusage \
 gettimeofday \
 gmtime_r \
index ebee8b6e109ba2e8cf405e8a4fe954522c163cfd..a5ba1406a4e1f80aa4fcb7b23f62b179c26ab183 100644 (file)
@@ -25,7 +25,9 @@ This file is public domain and comes with NO WARRANTY of any kind */
 #if !defined(MSDOS) && !defined(__WIN__)
 #include <sys/socket.h>
 #include <netinet/in.h>
+#ifdef HAVE_ARPA_INET_H
 #include <arpa/inet.h>
+#endif
 #include <netdb.h>
 #ifdef HAVE_SELECT_H
 #  include <select.h>
index 05b14f1f5573c38a6606786346e88bf5278769d9..609f7f5697ce0993023e6d9891b5c13111b43511 100644 (file)
@@ -34,7 +34,9 @@
 #include <time.h>
 #include <stdio.h>
 #include <netdb.h>
+#if HAVE_ARPA_INET_H
 #include <arpa/inet.h>
+#endif
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
@@ -233,13 +235,19 @@ function_entry basic_functions[] = {
        PHP_FE(mt_srand,                                                                NULL)
        PHP_FE(mt_getrandmax,                                                   NULL)
        PHP_FE(getservbyname, NULL)
+#if HAVE_GETSERVBYPORT
        PHP_FE(getservbyport, NULL)
+#endif
+#if HAVE_GETPROTOBYNAME
        PHP_FE(getprotobyname, NULL)
+#endif
+#if HAVE_GETPROTOBYNUMBER
        PHP_FE(getprotobynumber, NULL)
+#endif
        PHP_FE(gethostbyaddr,                                                   NULL)
        PHP_FE(gethostbyname,                                                   NULL)
        PHP_FE(gethostbynamel,                                                  NULL)
-#if !defined(PHP_WIN32)||HAVE_BINDLIB
+#if HAVE_BINDLIB && !(defined(__BEOS__)||defined(PHP_WIN32))
        PHP_FE(checkdnsrr,                                                              NULL)
        PHP_FE(getmxrr,                                                                 second_and_third_args_force_ref)
 #else
@@ -429,7 +437,7 @@ function_entry basic_functions[] = {
        PHP_FALIAS(socket_set_timeout, warn_not_available,      NULL)
 #endif
        PHP_FE(socket_get_status,       NULL)
-#if !defined(PHP_WIN32) || defined(ZTS)
+#if (!defined(PHP_WIN32) && !defined(__BEOS__)) || defined(ZTS)
        PHP_FE(realpath,                        NULL)
 #else
        PHP_FALIAS(realpath,            warn_not_available,             NULL)
@@ -2196,6 +2204,7 @@ PHP_FUNCTION(getservbyname)
 
 /* {{{ proto string getservbyport(int port, string protocol)
    Returns service name associated with port. Protocol must be "tcp" or "udp". */
+#if HAVE_GETSERVBYPORT
 PHP_FUNCTION(getservbyport)
 {
        pval **port,**proto;
@@ -2214,11 +2223,13 @@ PHP_FUNCTION(getservbyport)
 
        RETURN_STRING(serv->s_name,1);
 }
+#endif
 /* }}} */
 
 
 /* {{{ proto int getprotobyname(string name)
    Returns protocol number associated with name as per /etc/protocols */
+#if HAVE_GETPROTOBYNAME
 PHP_FUNCTION(getprotobyname)
 {
        pval **name;
@@ -2240,11 +2251,13 @@ PHP_FUNCTION(getprotobyname)
 
        RETURN_LONG(ent->p_proto);
 }
+#endif
 /* }}} */
 
 
 /* {{{ proto string getprotobynumber(int proto)
    Returns protocol name associated with protocol number proto */
+#if HAVE_GETPROTOBYNUMBER
 PHP_FUNCTION(getprotobynumber)
 {
        pval **proto;
@@ -2263,6 +2276,7 @@ PHP_FUNCTION(getprotobynumber)
 
        RETURN_STRING(ent->p_name,1);
 }
+#endif
 /* }}} */
 
 
index 2787e87f4c932051c5bca495a70718f38d365092..d370ce6fa8b704b5d65e71c12973d975d9861cf0 100644 (file)
 #define WINNT 1
 #endif
 /* located in www.php.net/extra/bindlib.zip */
+#if HAVE_ARPA_INET_H
 #include "arpa/inet.h"
+#endif
 #include "netdb.h"
+#if HAVE_ARPA_NAMESERV_H
 #include "arpa/nameser.h"
+#endif
+#if HAVE_RESOLV_H
 #include "resolv.h"
 #endif
+#endif
 #include <winsock.h>
 #else
 #include <netinet/in.h>
@@ -155,7 +161,7 @@ char *php_gethostbyname(char *name)
        return estrdup(inet_ntoa(in));
 }
 
-#if !defined(PHP_WIN32)||HAVE_BINDLIB
+#if HAVE_BINDLIB && !(defined(__BEOS__)||defined(PHP_WIN32))
 
 /* {{{ proto int checkdnsrr(string host [, string type])
    Check DNS records corresponding to a given Internet host name or IP address */
index 284f1384f1098a339c943b13fae1dd7e934eb20c..544c531f94b410d7871e38dc77ce73c672aeb268 100644 (file)
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <netdb.h>
+#if HAVE_ARPA_INET_H
 #include <arpa/inet.h>
 #endif
+#endif
 #include "ext/standard/head.h"
 #include "safe_mode.h"
 #include "php_string.h"
@@ -1947,7 +1949,7 @@ PHP_FUNCTION(fgetcsv) {
 /* }}} */
 
 
-#if !defined(PHP_WIN32) || defined(ZTS)
+#if (!defined(PHP_WIN32) && !defined(__BEOS__)) || defined(ZTS)
 /* {{{ proto string realpath(string path)
    Return the resolved path */
 PHP_FUNCTION(realpath)
index 0e499630734dd2815015c9b6015c95bc30edc6ae..f35a186f903cdb5fcd6c0704528f8c2c36b83884 100644 (file)
@@ -551,7 +551,7 @@ static void php_stat(const char *filename, int type, pval *return_value)
                case S_IFDIR: RETURN_STRING("dir",1);
                case S_IFBLK: RETURN_STRING("block",1);
                case S_IFREG: RETURN_STRING("file",1);
-#ifndef ZEND_WIN32
+#if !defined(ZEND_WIN32)&&!defined(__BEOS__)
                case S_IFSOCK: RETURN_STRING("socket",1);
 #endif
                }
index 60679fe541c0eb1458694ac1268177cfa73bfd79..6f46f5360883bc2c1d702bac52705c4847b2e305 100644 (file)
 #else
 #include <netinet/in.h>
 #include <netdb.h>
+#if HAVE_ARPA_INET_H
 #include <arpa/inet.h>
 #endif
+#endif
 #ifdef PHP_WIN32
 #undef AF_UNIX
 #endif
@@ -136,7 +138,8 @@ PHPAPI int connect_nonb(int sockfd,
                                                struct timeval *timeout)
 {
 /* probably won't work on Win32, someone else might try it (read: fix it ;) */
-#if !defined(PHP_WIN32) && (defined(O_NONBLOCK) || defined(O_NDELAY))
+
+#if (!defined(__BEOS__) && !defined(PHP_WIN32)) && (defined(O_NONBLOCK) || defined(O_NDELAY))
 
 #ifndef O_NONBLOCK
 #define O_NONBLOCK O_NDELAY
index bdda60b67a21b2ec6ce83c3c2cde6e71fb47c741..ff65dafd3941cc15b2799882c0f677ea0a687130 100644 (file)
 #else
 #include <netinet/in.h>
 #include <netdb.h>
+#if HAVE_ARPA_INET_H
 #include <arpa/inet.h>
 #endif
+#endif
 
 #ifdef PHP_WIN32
 #undef AF_UNIX
index 1d540408a9d622d33802c73a68ca2c7fe36f7c79..d16338c84bee069c47042886aa755f3f8af9634e 100644 (file)
 #else
 #include <netinet/in.h>
 #include <netdb.h>
+#if HAVE_ARPA_INET_H
 #include <arpa/inet.h>
 #endif
+#endif
 
 #ifdef PHP_WIN32
 #undef AF_UNIX
index d4cb79d2fc60963fb5fc5800e41906af00e8537f..a7f3007849b8e6cf690a731fb96d9b23543f6325 100644 (file)
 #include "ext/standard/info.h"
 #if !defined(PHP_WIN32)
 #include "build-defs.h"
+#if HAVE_SYSEXITS_H
 #include <sysexits.h>
 #endif
+#if HAVE_SYS_SYSEXITS_H
+#include <sys/sysexits.h>
+#endif
+#endif
 #include "php_mail.h"
 #include "php_ini.h"
 
index 1e7bfe15d52b8fd1e51be33602dc81a5659ab8c5..ef7f1a483ff66a4e1c6ec36fa73a20e91e60ff65 100644 (file)
@@ -86,7 +86,9 @@ PHP_MINIT_FUNCTION(syslog)
        REGISTER_LONG_CONSTANT("LOG_CONS", LOG_CONS, CONST_CS | CONST_PERSISTENT);
        REGISTER_LONG_CONSTANT("LOG_ODELAY", LOG_ODELAY, CONST_CS | CONST_PERSISTENT);
        REGISTER_LONG_CONSTANT("LOG_NDELAY", LOG_NDELAY, CONST_CS | CONST_PERSISTENT);
+#ifdef LOG_NOWAIT
        REGISTER_LONG_CONSTANT("LOG_NOWAIT", LOG_NOWAIT, CONST_CS | CONST_PERSISTENT);
+#endif
 #ifdef LOG_PERROR
        /* AIX doesn't have LOG_PERROR */
        REGISTER_LONG_CONSTANT("LOG_PERROR", LOG_PERROR, CONST_CS | CONST_PERSISTENT); /*log to stderr*/
@@ -173,7 +175,10 @@ static void start_syslog(BLS_D)
        SET_VAR_LONG("LOG_CONS", LOG_CONS);
        SET_VAR_LONG("LOG_ODELAY", LOG_ODELAY);
        SET_VAR_LONG("LOG_NDELAY", LOG_NDELAY);
+#ifdef LOG_NOWAIT
+       /* BeOS doesn't have LOG_NOWAIT */
        SET_VAR_LONG("LOG_NOWAIT", LOG_NOWAIT);
+#endif
 #ifdef LOG_PERROR
        /* AIX doesn't have LOG_PERROR */
        SET_VAR_LONG("LOG_PERROR", LOG_PERROR); /*log to stderr*/
index ec8a623021d53a75311551afccd84b8e6062e19d..19c6e287fb62e7dbc846b1031f40dadae8989f78 100644 (file)
 #else
 #include <netinet/in.h>
 #include <netdb.h>
+#if HAVE_ARPA_INET_H
 #include <arpa/inet.h>
 #endif
+#endif
 
 #ifdef PHP_WIN32
 #undef AF_UNIX
index e5754f937810f2c8a7b42283c08ecb947e4860ea..8b614e54ed00fd7ad7757a98bc0215cb86d71538 100644 (file)
@@ -36,7 +36,9 @@
 #ifndef PHP_WIN32
 #include <netinet/in.h>
 #include <netdb.h>
+#if HAVE_ARPA_INET_H
 #include <arpa/inet.h>
+#endif
 #else
 int             inet_aton(const char *, struct in_addr *);
 #endif
index 64f9cd8c9b3e81263f713a82db1d0cad7a43b0e8..f4ff9f82718ec42d9ae910929642d91c2ff89343 100644 (file)
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <netdb.h>
+#if HAVE_ARPA_INET_H
 #include <arpa/inet.h>
 #endif
+#endif
 #ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif
 #include <sys/file.h>
 #endif
 
+#if !defined(P_tmpdir)
+#define P_tmpdir ""
+#endif
+
 /* {{{ php_open_temporary_file */
 
 /* Loosely based on a tempnam() implementation by UCLA */