diff options
author | Vailin Choi <vchoi@hdfgroup.org> | 2008-04-02 19:33:08 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@hdfgroup.org> | 2008-04-02 19:33:08 (GMT) |
commit | cff7516ca7fe980f53037886b8a1faa181d6daec (patch) | |
tree | 1176ec7e168a3dd28b0616dec64b719d63ce22d6 /src/H5private.h | |
parent | d8dfc1fb3f07df5e58e9da6f5e54304e6e2009a9 (diff) | |
download | hdf5-cff7516ca7fe980f53037886b8a1faa181d6daec.zip hdf5-cff7516ca7fe980f53037886b8a1faa181d6daec.tar.gz hdf5-cff7516ca7fe980f53037886b8a1faa181d6daec.tar.bz2 |
[svn-r14791] Add handling for external link:
1. src/H5F.c, src/H5system.c: formulate path for mainfile
2. src/H5Lexternal.c: add search for target file
3. configure.in: add H5_HAVE_WINDOW_PATH
4. test/links.c: add tests for external link
Diffstat (limited to 'src/H5private.h')
-rw-r--r-- | src/H5private.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/H5private.h b/src/H5private.h index 11f3037..734290d 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -638,9 +638,19 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); #define HDfwrite(M,Z,N,F) fwrite(M,Z,N,F) #define HDgetc(F) getc(F) #define HDgetchar() getchar() +#ifdef _WIN32 +#define HDgetcwd(S,Z) _getcwd(S,Z) +#define HDgetdcwd(D,S,Z) _getdcwd(D,S,Z) +#define HDgetdrive() _getdrive() +#else #define HDgetcwd(S,Z) getcwd(S,Z) +#define HDgetdcwd(D,S,Z) getcwd(S,Z) +#define HDgetdrive() 0 +#endif #define HDgetegid() getegid() #define HDgetenv(S) getenv(S) +#define HDsetenv(S,V,O) setenv(S,V,O) +#define HDunsetenv(S) unsetenv(S) #define HDgeteuid() geteuid() #define HDgetgid() getgid() #define HDgetgrgid(G) getgrgid(G) @@ -911,6 +921,43 @@ extern char *strdup(const char *s); #endif /* _WIN32 */ +#ifdef H5_HAVE_WINDOW_PATH + +/* directory delimiter for Windows: slash and backslash are acceptable on Windows */ +#define DIR_SLASH_SEPC '/' +#define DIR_SEPC '\\' +#define DIR_SEPS "\\" +#define CHECK_DELIMITER(SS) ((SS == DIR_SEPC)||(SS == DIR_SLASH_SEPC)) +#define CHECK_ABSOLUTE(NAME) (((isalpha(NAME[0])) && (NAME[1] == ':') && CHECK_DELIMITER(NAME[2])) +#define CHECK_ABS_DRIVE(NAME) ((isalpha(NAME[0])) && (NAME[1] == ':')) +#define CHECK_ABS_PATH(NAME) (CHECK_DELIMITER(NAME[0])) + +#define GET_LAST_DELIMITER(NAME, ptr) { \ + char *slash, *backslash; \ + slash = strrchr(NAME, DIR_SLASH_SEPC); \ + backslash = strrchr(NAME, DIR_SEPC); \ + if (backslash > slash) \ + (ptr = backslash); \ + else \ + (ptr = slash); \ +} + + +#else + +#define DIR_SEPC '/' +#define DIR_SEPS "/" +#define CHECK_DELIMITER(SS) (SS == DIR_SEPC) +#define CHECK_ABSOLUTE(NAME) (CHECK_DELIMITER(*NAME)) +#define CHECK_ABS_DRIVE(NAME) (0) +#define CHECK_ABS_PATH(NAME) (0) +#define GET_LAST_DELIMITER(NAME, ptr) ptr = strrchr(NAME, DIR_SEPC); + +#endif + +#define COLON_SEPC ':' +H5_DLL herr_t H5_build_extpath(const char *, char **/*out*/); + /* * These macros check whether debugging has been requested for a certain |