diff options
author | Vailin Choi <vchoi@hdfgroup.org> | 2008-04-02 18:29:17 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@hdfgroup.org> | 2008-04-02 18:29:17 (GMT) |
commit | 04c174bde0e54b4432c0502f63b279731dda2559 (patch) | |
tree | 6e1557f6cdfe14ea18907947070beb1b42a57785 /src/H5private.h | |
parent | 977f4a6b8310ecb761b8d3ed7c89ff3e9385f1c2 (diff) | |
download | hdf5-04c174bde0e54b4432c0502f63b279731dda2559.zip hdf5-04c174bde0e54b4432c0502f63b279731dda2559.tar.gz hdf5-04c174bde0e54b4432c0502f63b279731dda2559.tar.bz2 |
[svn-r14789] 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 |