diff options
author | Anantha Kesari H Y <hyanantha@php.net> | 2005-07-15 12:35:12 +0000 |
---|---|---|
committer | Anantha Kesari H Y <hyanantha@php.net> | 2005-07-15 12:35:12 +0000 |
commit | 384a96faf60cc8f60233172f1f26d9d680ddf930 (patch) | |
tree | bd323088c893649e053b90b872850f791d1a4089 | |
parent | cdd43e622d88599bb351cc9b4b8495fde8c79918 (diff) | |
download | php-git-384a96faf60cc8f60233172f1f26d9d680ddf930.tar.gz |
ext/standard/file.h NetWare LibC has fnmatch and realpath implemented.
ext/standard/syslog.c Except LOG_SYSLOG other syslog macros are supported by NetWare LibC.
ext/standard/string.c NetWare fix for dirname
-- Kamesh
-rw-r--r-- | ext/standard/file.h | 2 | ||||
-rw-r--r-- | ext/standard/string.c | 28 | ||||
-rw-r--r-- | ext/standard/syslog.c | 4 |
3 files changed, 32 insertions, 2 deletions
diff --git a/ext/standard/file.h b/ext/standard/file.h index 3f76cbf211..a1fa0c6b5c 100644 --- a/ext/standard/file.h +++ b/ext/standard/file.h @@ -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 diff --git a/ext/standard/string.c b/ext/standard/string.c index 10e9f8dbcf..e5164d5bfb 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -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 */ diff --git a/ext/standard/syslog.c b/ext/standard/syslog.c index 9710ea4d60..9af2efee2c 100644 --- a/ext/standard/syslog.c +++ b/ext/standard/syslog.c @@ -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 */ |