summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>2000-04-15 14:20:01 +0000
committerAndi Gutmans <andi@php.net>2000-04-15 14:20:01 +0000
commit1665cba750539a4245cf600bacdff3f74fe7bbfd (patch)
treedafdf6338d70127846edf9f25cb6955777e7b6de
parent603d5ff5d8e2ecfff40f47f9a1e1be8739cec0db (diff)
downloadphp-git-1665cba750539a4245cf600bacdff3f74fe7bbfd.tar.gz
- Change PHP_ to V_ (directory & file functions)
-rw-r--r--ext/db/db.c2
-rw-r--r--ext/filepro/filepro.c6
-rw-r--r--ext/ftp/php_ftp.c4
-rw-r--r--ext/gd/gd.c14
-rw-r--r--ext/rpc/com/COM.c2
-rw-r--r--main/fopen_wrappers.c20
-rw-r--r--main/main.c2
-rw-r--r--main/php.h20
-rw-r--r--main/php_realpath.c6
-rw-r--r--main/rfc1867.c2
-rw-r--r--main/safe_mode.c2
11 files changed, 40 insertions, 40 deletions
diff --git a/ext/db/db.c b/ext/db/db.c
index bc131aa759..c2f666d44c 100644
--- a/ext/db/db.c
+++ b/ext/db/db.c
@@ -123,7 +123,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) PHP_FOPEN(filename, mode)
+#define DBM_OPEN(filename, mode) V_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 3de10645e4..f08812ed97 100644
--- a/ext/filepro/filepro.c
+++ b/ext/filepro/filepro.c
@@ -210,7 +210,7 @@ PHP_FUNCTION(filepro)
RETURN_FALSE;
}
- if (!(fp = PHP_FOPEN(workbuf, "r"))) {
+ if (!(fp = V_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 = PHP_FOPEN(workbuf, "r"))) {
+ if (!(fp = V_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 = PHP_FOPEN(workbuf, "r"))) {
+ if (!(fp = V_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 d1e0d2e749..390af90887 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 = PHP_FOPEN(arg2->value.str.val, "w")) == NULL) {
+ if ((outfp = V_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 = PHP_FOPEN(arg3->value.str.val, "r")) == NULL) {
+ if ((infp = V_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 fc0b450af6..026af1db6a 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -343,7 +343,7 @@ PHP_FUNCTION(imageloadfont) {
convert_to_string_ex(file);
#ifdef PHP_WIN32
- fp = PHP_FOPEN((*file)->value.str.val, "rb");
+ fp = V_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
@@ -446,7 +446,7 @@ PHP_FUNCTION(imagecreatefrompng)
convert_to_string_ex(file);
fn = (*file)->value.str.val;
#ifdef PHP_WIN32
- fp = PHP_FOPEN((*file)->value.str.val, "rb");
+ fp = V_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
@@ -492,7 +492,7 @@ PHP_FUNCTION(imagepng)
}
if (argc == 2) {
- fp = PHP_FOPEN(fn, "wb");
+ fp = V_FOPEN(fn, "wb");
if (!fp) {
php_error(E_WARNING, "ImagePng: unable to open %s for writing", fn);
RETURN_FALSE;
@@ -554,7 +554,7 @@ PHP_FUNCTION(imagecreatefromgif )
fn = (*file)->value.str.val;
#ifdef PHP_WIN32
- fp = PHP_FOPEN((*file)->value.str.val, "rb");
+ fp = V_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
@@ -603,7 +603,7 @@ PHP_FUNCTION(imagegif)
}
if (argc == 2) {
- fp = PHP_FOPEN(fn, "wb");
+ fp = V_FOPEN(fn, "wb");
if (!fp) {
php_error(E_WARNING, "ImageGif: unable to open %s for writing", fn);
RETURN_FALSE;
@@ -669,7 +669,7 @@ PHP_FUNCTION(imagecreatefromjpeg)
convert_to_string_ex(file);
fn = (*file)->value.str.val;
#ifdef PHP_WIN32
- fp = PHP_FOPEN((*file)->value.str.val, "rb");
+ fp = V_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
@@ -720,7 +720,7 @@ PHP_FUNCTION(imagejpeg)
}
if (argc > 1 && fn && strlen(fn)) {
- fp = PHP_FOPEN(fn, "wb");
+ fp = V_FOPEN(fn, "wb");
if (!fp) {
php_error(E_WARNING, "ImageJpeg: unable to open %s for writing", fn);
RETURN_FALSE;
diff --git a/ext/rpc/com/COM.c b/ext/rpc/com/COM.c
index 06a656516e..37c045ef3a 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=PHP_FOPEN(new_value, "r"))==NULL) {
+ if (!new_value || (typelib_file=V_FOPEN(new_value, "r"))==NULL) {
return FAILURE;
}
diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c
index 8be243993c..bce69d9728 100644
--- a/main/fopen_wrappers.c
+++ b/main/fopen_wrappers.c
@@ -210,7 +210,7 @@ PHPAPI FILE *php_fopen_wrapper(char *path, char *mode, int options, int *issock,
if (php_check_open_basedir(path)) {
return NULL;
}
- fp = PHP_FOPEN(path, mode);
+ fp = V_FOPEN(path, mode);
if (fp && opened_path) {
*opened_path = expand_filepath(path);
}
@@ -292,7 +292,7 @@ PHPAPI FILE *php_fopen_primary_script(void)
SG(request_info).path_translated = NULL;
return NULL;
}
- fp = PHP_FOPEN(fn, "r");
+ fp = V_FOPEN(fn, "r");
/* refuse to open anything that is not a regular file */
if (fp && (0 > fstat(fileno(fp), &st) || !S_ISREG(st.st_mode))) {
@@ -308,7 +308,7 @@ PHPAPI FILE *php_fopen_primary_script(void)
temp = estrdup(fn);
php_dirname(temp, strlen(temp));
if (*temp) {
- PHP_CHDIR(temp);
+ V_CHDIR(temp);
}
efree(temp);
SG(request_info).path_translated = fn;
@@ -341,7 +341,7 @@ PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **
return NULL;
}
if (php_check_open_basedir(filename)) return NULL;
- fp = PHP_FOPEN(filename, mode);
+ fp = V_FOPEN(filename, mode);
if (fp && opened_path) {
*opened_path = expand_filepath(filename);
}
@@ -363,7 +363,7 @@ PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **
return NULL;
}
if (php_check_open_basedir(trypath)) return NULL;
- fp = PHP_FOPEN(trypath, mode);
+ fp = V_FOPEN(trypath, mode);
if (fp && opened_path) {
*opened_path = expand_filepath(trypath);
}
@@ -372,7 +372,7 @@ PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **
if (php_check_open_basedir(filename)) {
return NULL;
}
- fp = PHP_FOPEN(filename, mode);
+ fp = V_FOPEN(filename, mode);
if (fp && opened_path) {
*opened_path = expand_filepath(filename);
}
@@ -386,7 +386,7 @@ PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **
if (php_check_open_basedir(filename)) {
return NULL;
}
- fp = PHP_FOPEN(filename, mode);
+ fp = V_FOPEN(filename, mode);
if (fp && opened_path) {
*opened_path = strdup(filename);
}
@@ -413,7 +413,7 @@ PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **
return NULL;
}
}
- if ((fp = PHP_FOPEN(trypath, mode)) != NULL) {
+ if ((fp = V_FOPEN(trypath, mode)) != NULL) {
if (php_check_open_basedir(trypath)) {
fclose(fp);
efree(pathbuf);
@@ -916,7 +916,7 @@ static FILE *php_fopen_url_wrapper(const char *path, char *mode, int options, in
if (php_check_open_basedir((char *) path)) {
fp = NULL;
} else {
- fp = PHP_FOPEN(path, mode);
+ fp = V_FOPEN(path, mode);
}
}
}
@@ -1010,7 +1010,7 @@ PHPAPI char *expand_filepath(char *filepath)
if (filepath[0] == '.') {
char *cwd = malloc(MAXPATHLEN + 1);
- if (PHP_GETCWD(cwd, MAXPATHLEN)) {
+ if (V_GETCWD(cwd, MAXPATHLEN)) {
char *cwd_end = cwd + strlen(cwd);
if (filepath[1] == '.') { /* parent directory - .. */
diff --git a/main/main.c b/main/main.c
index 9c0eae11ed..1ec9de91f9 100644
--- a/main/main.c
+++ b/main/main.c
@@ -252,7 +252,7 @@ void php_log_err(char *log_message)
return;
}
#endif
- log_file = PHP_FOPEN(PG(error_log), "a");
+ log_file = V_FOPEN(PG(error_log), "a");
if (log_file != NULL) {
time(&error_time);
strftime(error_time_str, 128, "%d-%b-%Y %H:%M:%S", localtime_r(&error_time, &tmbuf));
diff --git a/main/php.h b/main/php.h
index ab47f02162..89968361f1 100644
--- a/main/php.h
+++ b/main/php.h
@@ -289,17 +289,17 @@ PHPAPI int cfg_get_string(char *varname, char **result);
/* Virtual current directory support */
#ifdef VIRTUAL_DIR
-#define PHP_GETCWD(buff, size) virtual_getcwd(buff,size)
-#define PHP_FOPEN(path, mode) virtual_fopen(path, mode)
-#define PHP_CHDIR(path) virtual_chdir(path)
-#define PHP_CHDIR_FILE(path) virtual_chdir_file(path)
-#define PHP_GETWD(buf)
+#define V_GETCWD(buff, size) virtual_getcwd(buff,size)
+#define V_FOPEN(path, mode) virtual_fopen(path, mode)
+#define V_CHDIR(path) virtual_chdir(path)
+#define V_CHDIR_FILE(path) virtual_chdir_file(path)
+#define V_GETWD(buf)
#else
-#define PHP_GETCWD(buff, size) getcwd(buff,size)
-#define PHP_FOPEN(path, mode) fopen(path, mode)
-#define PHP_CHDIR(path) chdir(path)
-#define PHP_CHDIR_FILE(path) chdir_file(path)
-#define PHP_GETWD(buf) getwd(buf)
+#define V_GETCWD(buff, size) getcwd(buff,size)
+#define V_FOPEN(path, mode) fopen(path, mode)
+#define V_CHDIR(path) chdir(path)
+#define V_CHDIR_FILE(path) chdir_file(path)
+#define V_GETWD(buf) getwd(buf)
#endif
#include "zend_constants.h"
diff --git a/main/php_realpath.c b/main/php_realpath.c
index b134b3fce3..d60efa362c 100644
--- a/main/php_realpath.c
+++ b/main/php_realpath.c
@@ -63,7 +63,7 @@ char *php_realpath(char *path, char resolved_path []) {
if ((*workpos == '\\') || (*workpos == '/')) {
/* We start at the root of the current drive */
/* Get the current directory */
- if (PHP_GETCWD(path_construction, MAXPATHLEN-1) == NULL) {
+ if (V_GETCWD(path_construction, MAXPATHLEN-1) == NULL) {
/* Unable to get cwd */
resolved_path[0] = 0;
return NULL;
@@ -79,7 +79,7 @@ char *php_realpath(char *path, char resolved_path []) {
workpos++;
} else {
/* Use the current directory */
- if (PHP_GETCWD(path_construction, MAXPATHLEN-1) == NULL) {
+ if (V_GETCWD(path_construction, MAXPATHLEN-1) == NULL) {
/* Unable to get cwd */
resolved_path[0] = 0;
return NULL;
@@ -94,7 +94,7 @@ char *php_realpath(char *path, char resolved_path []) {
workpos++;
} else {
/* Use the current directory */
- if (PHP_GETCWD(path_construction, MAXPATHLEN-1) == NULL) {
+ if (V_GETCWD(path_construction, MAXPATHLEN-1) == NULL) {
/* Unable to get cwd */
resolved_path[0] = 0;
return NULL;
diff --git a/main/rfc1867.c b/main/rfc1867.c
index 5116f42208..b35fa7a90f 100644
--- a/main/rfc1867.c
+++ b/main/rfc1867.c
@@ -257,7 +257,7 @@ static void php_mime_split(char *buf, int cnt, char *boundary, zval *array_ptr)
} else if ((loc - ptr - 4) <= 0) {
fn = "none";
} else {
- fp = PHP_FOPEN(fn, "wb");
+ fp = V_FOPEN(fn, "wb");
if (!fp) {
php_error(E_WARNING, "File Upload Error - Unable to open temporary file [%s]", fn);
SAFE_RETURN;
diff --git a/main/safe_mode.c b/main/safe_mode.c
index b072552787..ac33ba88db 100644
--- a/main/safe_mode.c
+++ b/main/safe_mode.c
@@ -88,7 +88,7 @@ PHPAPI int php_checkuid(const char *fn, int mode) {
duid = sb.st_uid;
} else {
s = emalloc(MAXPATHLEN+1);
- if (!PHP_GETCWD(s,MAXPATHLEN)) {
+ if (!V_GETCWD(s,MAXPATHLEN)) {
php_error(E_WARNING, "Unable to access current working directory");
return(0);
}