diff options
author | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2008-04-30 19:51:13 (GMT) |
---|---|---|
committer | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2008-04-30 19:51:13 (GMT) |
commit | aec106e324ce20e5efb725c25a6a333c7970127b (patch) | |
tree | 234df369115a46b08037c5f385061cf58823e497 /src/H5private.h | |
parent | 5773fd34bc5adf59b4530d95ac9f0c0585902803 (diff) | |
download | hdf5-aec106e324ce20e5efb725c25a6a333c7970127b.zip hdf5-aec106e324ce20e5efb725c25a6a333c7970127b.tar.gz hdf5-aec106e324ce20e5efb725c25a6a333c7970127b.tar.bz2 |
[svn-r14903] Undoing change committed in r14902.
Diffstat (limited to 'src/H5private.h')
-rw-r--r-- | src/H5private.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/H5private.h b/src/H5private.h index 11f3037..b60c50a 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -638,7 +638,15 @@ 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 HDgeteuid() geteuid() @@ -911,6 +919,42 @@ 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 |