]> granicus.if.org Git - php/commitdiff
- Don't need to extern functions
authorAndi Gutmans <andi@php.net>
Sun, 9 Apr 2000 19:54:50 +0000 (19:54 +0000)
committerAndi Gutmans <andi@php.net>
Sun, 9 Apr 2000 19:54:50 +0000 (19:54 +0000)
- Use virtual_file_ex() in expand_filepath()

main/fopen_wrappers.c
main/fopen_wrappers.h
main/php.h
main/php_virtual_cwd.c
main/php_virtual_cwd.h

index 1d6797997a74dbc66557c58fa718783e6429e966..116985675ea3a34c41834a1fb2dea38866f37df3 100644 (file)
@@ -973,6 +973,28 @@ PHPAPI char *php_strip_url_passwd(char *url)
 }
 
 
+#if 1
+
+PHPAPI char *expand_filepath(char *filepath)
+{
+       cwd_state new_state;
+       char cwd[MAXPATHLEN+1];
+       char *result;
+
+       result = getcwd(cwd, MAXPATHLEN);       
+       if (!result) {
+               cwd[0] = '\0';
+       }
+
+       new_state.cwd = strdup(cwd);
+       new_state.cwd_length = strlen(cwd);
+
+       virtual_file_ex(&new_state, filepath, NULL);
+       return new_state.cwd;
+}
+
+#else
+
 PHPAPI char *expand_filepath(char *filepath)
 {
        char *retval = NULL;
@@ -1013,6 +1035,8 @@ PHPAPI char *expand_filepath(char *filepath)
        return retval;
 }
 
+#endif
+
 /*
  * Local variables:
  * tab-width: 4
index 68beba3e22066df994cb5900834d0909894ca101..8d59e4d79f376d2c48d092624431cd43bc1cc166 100644 (file)
 #define IS_SOCKET              1
 #define BAD_URL                        2
 
-extern PHPAPI FILE *php_fopen_wrapper(char *filename, char *mode, int options, int *issock, int *socketd, char **opened_path);
+PHPAPI FILE *php_fopen_wrapper(char *filename, char *mode, int options, int *issock, int *socketd, char **opened_path);
 
 PHPAPI FILE *php_fopen_primary_script(void);
 
-extern PHPAPI int php_check_open_basedir(char *path);
-extern PHPAPI int php_check_specific_open_basedir(char *basedir, char *path PLS_DC);
+PHPAPI int php_check_open_basedir(char *path);
+PHPAPI int php_check_specific_open_basedir(char *basedir, char *path PLS_DC);
 
-extern PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **opened_path);
+PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **opened_path);
 
-extern PHPAPI int php_is_url(char *path);
-extern PHPAPI char *php_strip_url_passwd(char *path);
+PHPAPI int php_is_url(char *path);
+PHPAPI char *php_strip_url_passwd(char *path);
 
-extern PHPAPI char *expand_filepath(char *filepath);
+PHPAPI char *expand_filepath(char *filepath);
 
 #endif
 /*
index 6aee80c41f0cef04716222377735688beb68e454..c1ab2782329dfa2f885deec68c97289eda388ee5 100644 (file)
@@ -285,10 +285,10 @@ PHPAPI int cfg_get_string(char *varname, char **result);
 #define PUTC_H(c)                                      (php_header_write(&(c), 1), (c))
 
 #define VIRTUAL_DIR
+#include "php_virtual_cwd.h"
 
 /* Virtual current directory support */
 #ifdef VIRTUAL_DIR
-#include "php_virtual_cwd.h"
 #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)
index 9514ab49f2bb74e2a85af63dab8634c941afa431..8dd87dc57eeafeae4dcbff72d5b63cd9e5fb46ab 100644 (file)
@@ -211,7 +211,7 @@ CWD_API char *virtual_getcwd(char *buf, size_t size)
 
 
 /* returns 0 for ok, 1 for error */
-static int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path)
+CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path)
 {
        int path_length = strlen(path);
        char *ptr, *path_copy;
index afe8da00b0b485031e603d3526a0e35c587db11f..252bd74b643cf7f39d344e6c39dc571f8aef9672 100644 (file)
@@ -33,6 +33,7 @@ CWD_API int virtual_chdir(char *path);
 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_file_ex(cwd_state *state, const char *path, verify_path_func verify_path);
 
 ZEND_BEGIN_MODULE_GLOBALS(cwd)
        cwd_state cwd;