From 503bb3bedb847ed99722208da1878ab56f3b5e9d Mon Sep 17 00:00:00 2001 From: Andi Gutmans Date: Thu, 20 Apr 2000 17:40:03 +0000 Subject: [PATCH] - Export strlcat()/strcpy() for Frank. - Windows doesn't have lstat(). --- main/php.h | 4 ++-- main/php_virtual_cwd.c | 4 ++++ main/php_virtual_cwd.h | 2 ++ main/strlcat.c | 2 +- main/strlcpy.c | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/main/php.h b/main/php.h index 97596d16d38..b13a60c6fe9 100644 --- a/main/php.h +++ b/main/php.h @@ -96,11 +96,11 @@ extern unsigned char second_arg_allow_ref[]; #endif #ifndef HAVE_STRLCPY -size_t strlcpy(char *dst, const char *src, size_t siz); +PHPAPI size_t strlcpy(char *dst, const char *src, size_t siz); #endif #ifndef HAVE_STRLCAT -size_t strlcat(char *dst, const char *src, size_t siz); +PHPAPI size_t strlcat(char *dst, const char *src, size_t siz); #endif #ifndef HAVE_STRTOK_R diff --git a/main/php_virtual_cwd.c b/main/php_virtual_cwd.c index a3d98baa21b..fdb7685db3c 100644 --- a/main/php_virtual_cwd.c +++ b/main/php_virtual_cwd.c @@ -400,6 +400,8 @@ CWD_API int virtual_stat(const char *path, struct stat *buf) return retval; } +#ifndef ZEND_WIN32 + CWD_API int virtual_lstat(const char *path, struct stat *buf) { cwd_state new_state; @@ -415,6 +417,8 @@ CWD_API int virtual_lstat(const char *path, struct stat *buf) return retval; } +#endif + #if 0 main(void) diff --git a/main/php_virtual_cwd.h b/main/php_virtual_cwd.h index 406ebf1240f..339c4250aa1 100644 --- a/main/php_virtual_cwd.h +++ b/main/php_virtual_cwd.h @@ -43,7 +43,9 @@ CWD_API int virtual_chdir_file(char *path); CWD_API int virtual_filepath(char *path, char **filepath); CWD_API FILE *virtual_fopen(const char *path, const char *mode); CWD_API int virtual_stat(const char *path, struct stat *buf); +#ifndef ZEND_WIN32 CWD_API int virtual_lstat(const char *path, struct stat *buf); +#endif CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path); ZEND_BEGIN_MODULE_GLOBALS(cwd) diff --git a/main/strlcat.c b/main/strlcat.c index 6b2cc1f679e..fb390dfe911 100644 --- a/main/strlcat.c +++ b/main/strlcat.c @@ -44,7 +44,7 @@ static char *rcsid = "$OpenBSD: strlcat.c,v 1.2 1999/06/17 16:28:58 millert Exp * will be copied. Always NUL terminates (unless siz == 0). * Returns strlen(src); if retval >= siz, truncation occurred. */ -size_t strlcat(dst, src, siz) +PHPAPI size_t strlcat(dst, src, siz) char *dst; const char *src; size_t siz; diff --git a/main/strlcpy.c b/main/strlcpy.c index c34bf0a001f..382d8ba56e7 100644 --- a/main/strlcpy.c +++ b/main/strlcpy.c @@ -43,7 +43,7 @@ static char *rcsid = "$OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp * will be copied. Always NUL terminates (unless siz == 0). * Returns strlen(src); if retval >= siz, truncation occurred. */ -size_t strlcpy(dst, src, siz) +PHPAPI size_t strlcpy(dst, src, siz) char *dst; const char *src; size_t siz;