aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/path.h
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2000-09-05 03:16:28 +0000
committerChristopher Faylor <me@cgf.cx>2000-09-05 03:16:28 +0000
commit7e24f1bf3a75f4579cd6b39c87a9f1fb6e79d988 (patch)
treedec7952fa25b5afaaa1fdf9cf7761efb58bb3135 /winsup/cygwin/path.h
parent108952ea1d506272bc197e51cf1c4dd7e3bf96eb (diff)
downloadnewlib-7e24f1bf3a75f4579cd6b39c87a9f1fb6e79d988.zip
newlib-7e24f1bf3a75f4579cd6b39c87a9f1fb6e79d988.tar.gz
newlib-7e24f1bf3a75f4579cd6b39c87a9f1fb6e79d988.tar.bz2
* path.cc (cwd_win32): Eliminate.
(cwd_posix): Eliminate. (cwd_hash): Eliminate. (cwdstuff::init): Rename from cwd_init. (cwdstuff::fixup_after_exec): Rename from cwd_fixup_after_exec. (cwdstuff::get): Rename from get_cwd_inner. (normalize_posix_path): Eliminate cwd argument. Just calculate when necessary. (normalize_win32_path): Ditto. (mount_info::conv_to_win32_path): Eliminate cwd retrieval here. (mount_info::conv_to_posix_path): Ditto. (hash_path_name): Accomodate additional methods in cwdstuff. (get_cwd_win32): Eliminate. (getcwd): Use cwdstuff methods. Properly handle case where buf == NULL and len < 0. (cwdstuff::get_hash): New method. (cwdstuff::get_initial): New method. (cwdstuff::set): New method. (cwdstuff::get): New method. (cwdstuff::copy): New method. * path.h: Move cwdstuff struct here. Add a bunch of stuff to cwdstuff. Make cygcwd an extern. * spawn.cc (spawn_guts): Use copy method to get copies of cwd info to pass to execed process. * dcrt0.cc (dll_crt0_1): Use cygcwd methods for cwd initialization.
Diffstat (limited to 'winsup/cygwin/path.h')
-rw-r--r--winsup/cygwin/path.h26
1 files changed, 21 insertions, 5 deletions
diff --git a/winsup/cygwin/path.h b/winsup/cygwin/path.h
index 3f8025a..9143b41 100644
--- a/winsup/cygwin/path.h
+++ b/winsup/cygwin/path.h
@@ -110,11 +110,6 @@ int __stdcall check_null_empty_path (const char *name);
const char * __stdcall find_exec (const char *name, path_conv& buf, const char *winenv = "PATH=",
int null_if_notfound = 0, const char **known_suffix = NULL);
-void __stdcall cwd_init ();
-char * __stdcall cwd_posix (char *);
-char * __stdcall cwd_win32 (char *);
-DWORD __stdcall cwd_hash ();
-void __stdcall cwd_fixup_after_exec (char *, char *, DWORD);
/* Common macros for checking for invalid path names */
@@ -127,3 +122,24 @@ void __stdcall cwd_fixup_after_exec (char *, char *, DWORD);
})
#define isdrive(s) (isalpha (*(s)) && (s)[1] == ':')
+
+/* cwd cache stuff. */
+
+class muto;
+
+struct cwdstuff
+{
+ char *posix;
+ char *win32;
+ DWORD hash;
+ muto *lock;
+ char *get (char *buf, int need_posix = 1, int with_chroot = 0, unsigned ulen = MAX_PATH);
+ DWORD get_hash ();
+ void init ();
+ void fixup_after_exec (char *win32, char *posix, DWORD hash);
+ bool get_initial ();
+ void copy (char * &posix_cwd, char * &win32_cwd, DWORD hash_cwd);
+ void set (char *win32_cwd);
+};
+
+extern cwdstuff cygcwd;