diff options
author | Andi Gutmans <andi@php.net> | 2000-03-30 22:56:34 +0000 |
---|---|---|
committer | Andi Gutmans <andi@php.net> | 2000-03-30 22:56:34 +0000 |
commit | 9c3d6304dd7fe870278a7ad8688e40a9645f609c (patch) | |
tree | c1ac0b30f40abbb832d9ae2eadc492079a7f8d7e /ext | |
parent | 9df7df3293302198a29b1657682dba49ce02aa6b (diff) | |
download | php-git-9c3d6304dd7fe870278a7ad8688e40a9645f609c.tar.gz |
- Hopefully got most of them. We also need a chdir_file function like
for Apache.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/db/db.c | 2 | ||||
-rw-r--r-- | ext/filepro/filepro.c | 6 | ||||
-rw-r--r-- | ext/ftp/php_ftp.c | 4 | ||||
-rw-r--r-- | ext/gd/gd.c | 22 | ||||
-rw-r--r-- | ext/posix/posix.c | 2 | ||||
-rw-r--r-- | ext/rpc/com/COM.c | 2 | ||||
-rw-r--r-- | ext/standard/dir.c | 6 | ||||
-rw-r--r-- | ext/standard/filestat.c | 2 | ||||
-rw-r--r-- | ext/standard/image.c | 2 | ||||
-rw-r--r-- | ext/standard/iptc.c | 2 |
10 files changed, 25 insertions, 25 deletions
diff --git a/ext/db/db.c b/ext/db/db.c index ab1412d086..8d7fc7cb5c 100644 --- a/ext/db/db.c +++ b/ext/db/db.c @@ -122,7 +122,7 @@ static int php_dbm_key_exists(DBM *dbf, datum key_datum) { #define DBM_CREATE_MODE "a+b" #define DBM_NEW_MODE "w+b" #define DBM_DEFAULT_MODE "r" -#define DBM_OPEN(filename, mode) fopen(filename, mode) +#define DBM_OPEN(filename, mode) PHP_FOPEN(filename, mode) #define DBM_CLOSE(dbf) fclose(dbf) #define DBM_STORE(dbf, key, value, mode) flatfile_store(dbf, key, value, mode) #define DBM_FETCH(dbf, key) flatfile_fetch(dbf, key) diff --git a/ext/filepro/filepro.c b/ext/filepro/filepro.c index e8d2dfc7cf..3de10645e4 100644 --- a/ext/filepro/filepro.c +++ b/ext/filepro/filepro.c @@ -210,7 +210,7 @@ PHP_FUNCTION(filepro) RETURN_FALSE; } - if (!(fp = fopen(workbuf, "r"))) { + if (!(fp = PHP_FOPEN(workbuf, "r"))) { php_error(E_WARNING, "filePro: cannot open map: [%d] %s", errno, strerror(errno)); RETURN_FALSE; @@ -306,7 +306,7 @@ PHP_FUNCTION(filepro_rowcount) RETURN_FALSE; } - if (!(fp = fopen(workbuf, "r"))) { + if (!(fp = PHP_FOPEN(workbuf, "r"))) { php_error(E_WARNING, "filePro: cannot open key: [%d] %s", errno, strerror(errno)); RETURN_FALSE; @@ -516,7 +516,7 @@ PHP_FUNCTION(filepro_retrieve) RETURN_FALSE; } - if (!(fp = fopen(workbuf, "r"))) { + if (!(fp = PHP_FOPEN(workbuf, "r"))) { php_error(E_WARNING, "filePro: cannot open key: [%d] %s", errno, strerror(errno)); fclose(fp); diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c index 70859376e3..d1e0d2e749 100644 --- a/ext/ftp/php_ftp.c +++ b/ext/ftp/php_ftp.c @@ -550,7 +550,7 @@ PHP_FUNCTION(ftp_get) RETURN_FALSE; } - if ((outfp = fopen(arg2->value.str.val, "w")) == NULL) { + if ((outfp = PHP_FOPEN(arg2->value.str.val, "w")) == NULL) { fclose(tmpfp); php_error(E_WARNING, "error opening %s", arg2->value.str.val); RETURN_FALSE; @@ -634,7 +634,7 @@ PHP_FUNCTION(ftp_put) convert_to_string(arg3); XTYPE(xtype, arg4); - if ((infp = fopen(arg3->value.str.val, "r")) == NULL) { + if ((infp = PHP_FOPEN(arg3->value.str.val, "r")) == NULL) { php_error(E_WARNING, "error opening %s", arg3->value.str.val); RETURN_FALSE; } diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 57f1c57b63..50ffb70b5e 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -331,8 +331,8 @@ PHP_FUNCTION(imageloadfont) { convert_to_string_ex(file); -#if WIN32|WINNT - fp = fopen((*file)->value.str.val, "rb"); +#ifdef PHP_WIN32 + fp = PHP_FOPEN((*file)->value.str.val, "rb"); #else fp = php_fopen_wrapper((*file)->value.str.val, "r", IGNORE_PATH|IGNORE_URL_WIN, &issock, &socketd, NULL); #endif @@ -434,8 +434,8 @@ PHP_FUNCTION(imagecreatefrompng) } convert_to_string_ex(file); fn = (*file)->value.str.val; -#if WIN32|WINNT - fp = fopen((*file)->value.str.val, "rb"); +#ifdef PHP_WIN32 + fp = PHP_FOPEN((*file)->value.str.val, "rb"); #else fp = php_fopen_wrapper((*file)->value.str.val, "r", IGNORE_PATH|IGNORE_URL_WIN, &issock, &socketd, NULL); #endif @@ -481,7 +481,7 @@ PHP_FUNCTION(imagepng) } if (argc == 2) { - fp = fopen(fn, "wb"); + fp = PHP_FOPEN(fn, "wb"); if (!fp) { php_error(E_WARNING, "ImagePng: unable to open %s for writing", fn); RETURN_FALSE; @@ -542,8 +542,8 @@ PHP_FUNCTION(imagecreatefromgif ) fn = (*file)->value.str.val; -#if WIN32|WINNT - fp = fopen((*file)->value.str.val, "rb"); +#ifdef PHP_WIN32 + fp = PHP_FOPEN((*file)->value.str.val, "rb"); #else fp = php_fopen_wrapper((*file)->value.str.val, "r", IGNORE_PATH|IGNORE_URL_WIN, &issock, &socketd, NULL); #endif @@ -592,7 +592,7 @@ PHP_FUNCTION(imagegif) } if (argc == 2) { - fp = fopen(fn, "wb"); + fp = PHP_FOPEN(fn, "wb"); if (!fp) { php_error(E_WARNING, "ImageGif: unable to open %s for writing", fn); RETURN_FALSE; @@ -657,8 +657,8 @@ PHP_FUNCTION(imagecreatefromjpeg) } convert_to_string_ex(file); fn = (*file)->value.str.val; -#if WIN32|WINNT - fp = fopen((*file)->value.str.val, "rb"); +#ifdef PHP_WIN32 + fp = PHP_FOPEN((*file)->value.str.val, "rb"); #else fp = php_fopen_wrapper((*file)->value.str.val, "r", IGNORE_PATH|IGNORE_URL_WIN, &issock, &socketd, NULL); #endif @@ -709,7 +709,7 @@ PHP_FUNCTION(imagejpeg) } if (argc > 1 && fn && strlen(fn)) { - fp = fopen(fn, "wb"); + fp = PHP_FOPEN(fn, "wb"); if (!fp) { php_error(E_WARNING, "ImageJpeg: unable to open %s for writing", fn); RETURN_FALSE; diff --git a/ext/posix/posix.c b/ext/posix/posix.c index 5d8e2c38c1..38a9e12e63 100644 --- a/ext/posix/posix.c +++ b/ext/posix/posix.c @@ -568,7 +568,7 @@ PHP_FUNCTION(posix_getcwd) char buffer[MAXPATHLEN]; char *p; - p = getcwd(buffer, MAXPATHLEN); + p = PHP_GETCWD(buffer, MAXPATHLEN); if (!p) { php_error(E_WARNING, "posix_getcwd() failed with '%s'", strerror(errno)); diff --git a/ext/rpc/com/COM.c b/ext/rpc/com/COM.c index 8d64ffcbc3..8be37e64bc 100644 --- a/ext/rpc/com/COM.c +++ b/ext/rpc/com/COM.c @@ -161,7 +161,7 @@ static PHP_INI_MH(OnTypelibFileChange) #endif - if (!new_value || (typelib_file=fopen(new_value, "r"))==NULL) { + if (!new_value || (typelib_file=PHP_FOPEN(new_value, "r"))==NULL) { return FAILURE; } diff --git a/ext/standard/dir.c b/ext/standard/dir.c index e71697e859..03535b1148 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -210,7 +210,7 @@ PHP_FUNCTION(chdir) } convert_to_string_ex(arg); - ret = chdir((*arg)->value.str.val); + ret = PHP_CHDIR((*arg)->value.str.val); if (ret < 0) { php_error(E_WARNING, "ChDir: %s (errno %d)", strerror(errno), errno); @@ -234,9 +234,9 @@ PHP_FUNCTION(getcwd) } #if HAVE_GETCWD - ret = getcwd(path,MAXPATHLEN-1); + ret = PHP_GETCWD(path,MAXPATHLEN-1); #elif HAVE_GETWD - ret = getwd(path); + ret = PHP_GETWD(path); /* * #warning is not ANSI C * #else diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index 1542f27501..61959f32d2 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -387,7 +387,7 @@ PHP_FUNCTION(touch) /* create the file if it doesn't exist already */ ret = stat((*filename)->value.str.val, &sb); if (ret == -1) { - file = fopen((*filename)->value.str.val, "w"); + file = PHP_FOPEN((*filename)->value.str.val, "w"); if (file == NULL) { php_error(E_WARNING, "unable to create file %s because %s", (*filename)->value.str.val, strerror(errno)); if (newtime) efree(newtime); diff --git a/ext/standard/image.c b/ext/standard/image.c index 021a142acc..30930c253d 100644 --- a/ext/standard/image.c +++ b/ext/standard/image.c @@ -338,7 +338,7 @@ PHP_FUNCTION(getimagesize) /* Check open_basedir */ if (php_check_open_basedir((*arg1)->value.str.val)) return; - if ((fp = fopen((*arg1)->value.str.val,"rb")) == 0) { + if ((fp = PHP_FOPEN((*arg1)->value.str.val,"rb")) == 0) { php_error(E_WARNING, "Unable to open %s", (*arg1)->value.str.val); return; } diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c index a1365e25f2..619f95f5dc 100644 --- a/ext/standard/iptc.c +++ b/ext/standard/iptc.c @@ -198,7 +198,7 @@ PHP_FUNCTION(iptcembed) if (php_check_open_basedir((*jpeg_file)->value.str.val)) RETURN_FALSE; - if ((fp = fopen((*jpeg_file)->value.str.val,"rb")) == 0) { + if ((fp = PHP_FOPEN((*jpeg_file)->value.str.val,"rb")) == 0) { php_error(E_WARNING, "Unable to open %s", (*jpeg_file)->value.str.val); RETURN_FALSE; } |