summaryrefslogtreecommitdiff
path: root/main/php_virtual_cwd.h
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>2000-04-01 17:02:32 +0000
committerAndi Gutmans <andi@php.net>2000-04-01 17:02:32 +0000
commit8a4805c8310c9f5a2d53da4b1c71bc75c58c60a3 (patch)
tree324e2c09c7876c78b14e78b641345f63136b4451 /main/php_virtual_cwd.h
parentfc8c923bb2eab69de58f2264fee1c551b36e8247 (diff)
downloadphp-git-8a4805c8310c9f5a2d53da4b1c71bc75c58c60a3.tar.gz
- Intermediate commit
Diffstat (limited to 'main/php_virtual_cwd.h')
-rw-r--r--main/php_virtual_cwd.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/main/php_virtual_cwd.h b/main/php_virtual_cwd.h
new file mode 100644
index 0000000000..dfc04e74aa
--- /dev/null
+++ b/main/php_virtual_cwd.h
@@ -0,0 +1,40 @@
+#ifndef VIRTUAL_CWD_H
+#define VIRTUAL_CWD_H
+
+typedef struct _cwd_state {
+ char *cwd;
+ int cwd_length;
+} cwd_state;
+
+typedef int (*verify_path_func)(const cwd_state *);
+
+void virtual_cwd_init();
+char *virtual_getcwd_ex(int *length);
+char *virtual_getcwd(char *buf, size_t size);
+int virtual_chdir(char *path);
+int virtual_filepath(char *path, char **filepath);
+FILE *virtual_fopen(char *path, const char *mode);
+
+typedef struct _cwd_globals_struct {
+ cwd_state cwd;
+} cwd_globals_struct;
+
+#ifdef ZTS
+# define CWDLS_D cwd_globals_struct *cwd_globals
+# define CWDLS_DC , CWDLS_D
+# define CWDLS_C cwd_globals
+# define CWDLS_CC , CWDLS_C
+# define CWDG(v) (cwd_globals->v)
+# define CWDLS_FETCH() cwd_globals_struct *cwd_globals = ts_resource(cwd_globals_id)
+CWD_API extern int cwd_globals_id;
+#else
+# define CWDLS_D void
+# define CWDLS_DC
+# define CWDLS_C
+# define CWDLS_CC
+# define CWDG(v) (cwd_globals.v)
+# define CWDLS_FETCH()
+extern CWD_API cwd_globals_struct cwd_globals;
+#endif
+
+#endif /* VIRTUAL_CWD_H */