Browse Source

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
PHP-5.1
Anantha Kesari H Y 21 years ago
parent
commit
384a96faf6
  1. 2
      ext/standard/file.h
  2. 28
      ext/standard/string.c
  3. 4
      ext/standard/syslog.c

2
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

28
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 */

4
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 */

Loading…
Cancel
Save