diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2020-05-20 17:03:41 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2020-05-20 17:03:41 (GMT) |
commit | 2d43fb8f02956d95fffb9b6d17f54d46aa8671bb (patch) | |
tree | 434aafca9b9f4ddb8191c46936d2f95450e274dd /test/H5srcdir.h | |
parent | fd404f711b8a587a5b5534f268a918115884bd56 (diff) | |
download | hdf5-2d43fb8f02956d95fffb9b6d17f54d46aa8671bb.zip hdf5-2d43fb8f02956d95fffb9b6d17f54d46aa8671bb.tar.gz hdf5-2d43fb8f02956d95fffb9b6d17f54d46aa8671bb.tar.bz2 |
Moved srcdir changes over from develop.
Diffstat (limited to 'test/H5srcdir.h')
-rw-r--r-- | test/H5srcdir.h | 50 |
1 files changed, 9 insertions, 41 deletions
diff --git a/test/H5srcdir.h b/test/H5srcdir.h index 32fe8c9..e8fd665 100644 --- a/test/H5srcdir.h +++ b/test/H5srcdir.h @@ -20,51 +20,19 @@ #ifndef _H5SRCDIR_H #define _H5SRCDIR_H -/* Include the header file with the correct relative path for the srcdir string */ -#include "H5srcdir_str.h" - -/* Buffer to construct path in and return pointer to */ -static char srcdir_path[1024] = ""; - -/* Buffer to construct file in and return pointer to */ -static char srcdir_testpath[1024] = ""; +#ifdef __cplusplus +extern "C" { +#endif /* Just return the srcdir path */ -static const char * -H5_get_srcdir(void) -{ - const char *srcdir = HDgetenv("srcdir"); - - /* Check for using the srcdir from configure time */ - if(NULL == srcdir) - srcdir = config_srcdir; - - /* Build path to all test files */ - if((HDstrlen(srcdir) + 2) < sizeof(srcdir_path)) { - HDsnprintf(srcdir_path, sizeof(srcdir_path), "%s/", srcdir); - return(srcdir_path); - } /* end if */ - else - return(NULL); -} /* end H5_get_srcdir() */ +H5TEST_DLL const char *H5_get_srcdir(void); /* Append the test file name to the srcdir path and return the whole string */ -static const char *H5_get_srcdir_filename(const char *filename) -{ - const char *srcdir = H5_get_srcdir(); +H5TEST_DLL const char *H5_get_srcdir_filename(const char *filename); + +#ifdef __cplusplus +} +#endif - /* Check for error */ - if(NULL == srcdir) - return(NULL); - else { - /* Build path to test file */ - if((HDstrlen(srcdir) + HDstrlen(filename) + 1) < sizeof(srcdir_testpath)) { - HDsnprintf(srcdir_testpath, sizeof(srcdir_testpath), "%s%s", srcdir, filename); - return(srcdir_testpath); - } /* end if */ - else - return(NULL); - } /* end else */ -} /* end H5_get_srcdir_filename() */ #endif /* _H5SRCDIR_H */ |