]> granicus.if.org Git - php/commitdiff
ext/standard/file.h NetWare LibC has fnmatch and realpath implemented.
authorAnantha Kesari H Y <hyanantha@php.net>
Fri, 15 Jul 2005 12:35:12 +0000 (12:35 +0000)
committerAnantha Kesari H Y <hyanantha@php.net>
Fri, 15 Jul 2005 12:35:12 +0000 (12:35 +0000)
ext/standard/syslog.c Except LOG_SYSLOG other syslog macros are supported by NetWare LibC.
ext/standard/string.c NetWare fix for dirname
-- Kamesh

ext/standard/file.h
ext/standard/string.c
ext/standard/syslog.c

index 3f76cbf21175238475c11f550d52f7accaf7ab76..a1fa0c6b5ca387b996b66c5de97542dca0d86a4e 100644 (file)
@@ -60,7 +60,7 @@ PHP_FUNCTION(get_meta_tags);
 PHP_FUNCTION(flock);
 PHP_FUNCTION(fd_set);
 PHP_FUNCTION(fd_isset);
-#if (!defined(__BEOS__) && !defined(NETWARE) && HAVE_REALPATH) || defined(ZTS)
+#if (!defined(__BEOS__) && HAVE_REALPATH) || defined(ZTS)
 PHP_FUNCTION(realpath);
 PHP_FUNCTION(fnmatch);
 #endif
index 10e9f8dbcf3ac32cee5a3f4006cc31b8bd566d2c..e5164d5bfb6adb2d303e675db2cba5d9c29a2976 100644 (file)
@@ -1225,6 +1225,22 @@ PHPAPI size_t php_dirname(char *path, size_t len)
                        return len;
                }
        }
+#elif defined(NETWARE)
+       /*
+        * Find the first occurence of : from the left 
+        * move the path pointer to the position just after :
+        * increment the len_adjust to the length of path till colon character(inclusive)
+        * If there is no character beyond : simple return len
+        */
+       char *colonpos = NULL;
+       colonpos = strchr(path, ':');
+       if(colonpos != NULL) {
+               len_adjust = ((colonpos - path) + 1);
+               path += len_adjust;
+               if(len_adjust == len) {
+               return len;
+               }
+       }
 #endif
 
        if (len == 0) {
@@ -1249,9 +1265,21 @@ PHPAPI size_t php_dirname(char *path, size_t len)
        }
        if (end < path) {
                /* No slash found, therefore return '.' */
+#ifdef NETWARE
+               if(len_adjust == 0) {
+                       path[0] = '.';
+                       path[1] = '\0';
+                       return 1; //only one character
+               } 
+               else {
+                       path[0] = '\0';
+                       return len_adjust;
+               }
+#else
                path[0] = '.';
                path[1] = '\0';
                return 1 + len_adjust;
+#endif
        }
 
        /* Strip slashes which came before the file name */
index 9710ea4d60228526e276e9d90097bad3dbe5d489..9af2efee2c01d9f05ae13253e348e7bc843d2ae8 100644 (file)
@@ -75,7 +75,7 @@ PHP_MINIT_FUNCTION(syslog)
        /* AIX doesn't have LOG_AUTHPRIV */
        REGISTER_LONG_CONSTANT("LOG_AUTHPRIV", LOG_AUTHPRIV, CONST_CS | CONST_PERSISTENT);
 #endif
-#if !defined(PHP_WIN32) && !defined(NETWARE)
+#ifndef PHP_WIN32
        REGISTER_LONG_CONSTANT("LOG_LOCAL0", LOG_LOCAL0, CONST_CS | CONST_PERSISTENT);
        REGISTER_LONG_CONSTANT("LOG_LOCAL1", LOG_LOCAL1, CONST_CS | CONST_PERSISTENT);
        REGISTER_LONG_CONSTANT("LOG_LOCAL2", LOG_LOCAL2, CONST_CS | CONST_PERSISTENT);
@@ -144,7 +144,9 @@ static void start_syslog(TSRMLS_D)
        SET_VAR_LONG("LOG_MAIL", LOG_MAIL); /* log to email */
        SET_VAR_LONG("LOG_DAEMON", LOG_DAEMON); /* other system daemons */
        SET_VAR_LONG("LOG_AUTH", LOG_AUTH);
+#ifndef NETWARE
        SET_VAR_LONG("LOG_SYSLOG", LOG_SYSLOG);
+#endif
        SET_VAR_LONG("LOG_LPR", LOG_LPR);
 #ifdef LOG_NEWS
        /* No LOG_NEWS on HP-UX */