summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt8
-rw-r--r--src/H5.c47
-rw-r--r--src/H5FDcore.c22
-rw-r--r--src/H5FDdirect.c15
-rw-r--r--src/H5FDlog.c24
-rw-r--r--src/H5FDsec2.c22
-rw-r--r--src/H5FDstdio.c15
-rw-r--r--src/H5Lexternal.c2
-rw-r--r--src/H5S.c2
-rw-r--r--src/H5Tconv.c7
-rw-r--r--src/H5private.h56
-rw-r--r--src/H5public.h4
-rw-r--r--src/H5system.c62
13 files changed, 81 insertions, 205 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index ee06669..dc6ba0a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -896,9 +896,15 @@ if (BUILD_SHARED_LIBS)
INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
INTERFACE_COMPILE_DEFINITIONS H5_BUILT_AS_DYNAMIC_LIB=1
)
+ if (HDF5_ENABLE_THREADSAFE)
+ set_property (TARGET ${HDF5_LIBSH_TARGET}
+ APPEND PROPERTY COMPILE_DEFINITIONS
+ "H5_HAVE_THREADSAFE"
+ )
+ endif (HDF5_ENABLE_THREADSAFE)
if (HDF5_ENABLE_DEBUG_APIS)
- set_property (TARGET ${HDF5_LIBSH_TARGET}
+ set_property (TARGET ${HDF5_LIBSH_TARGET}
APPEND PROPERTY COMPILE_DEFINITIONS
"H5Z_DEBUG;H5VM_DEBUG;H5T_DEBUG;H5S_DEBUG;H5P_DEBUG;H5O_DEBUG;H5MM_DEBUG;H5MF_DEBUG;H5I_DEBUG;H5HL_DEBUG;H5HG_DEBUG;H5G_DEBUG;H5F_DEBUG;H5E_DEBUG;H5D_DEBUG;H5B_DEBUG;H5AC_DEBUG"
)
diff --git a/src/H5.c b/src/H5.c
index 3d4512f..2e05819 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -21,17 +21,16 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5ACprivate.h" /* Metadata cache */
-#include "H5Dprivate.h" /* Datasets */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FLprivate.h" /* Free lists */
-#include "H5Lprivate.h" /* Links */
+#include "H5private.h" /* Generic Functions */
+#include "H5ACprivate.h" /* Metadata cache */
+#include "H5Dprivate.h" /* Datasets */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FLprivate.h" /* Free lists */
+#include "H5Lprivate.h" /* Links */
#include "H5MMprivate.h" /* Memory management */
-#include "H5Pprivate.h" /* Property lists */
-#include "H5Tprivate.h" /* Datatypes */
+#include "H5Pprivate.h" /* Property lists */
#include "H5SLprivate.h" /* Skip lists */
-
+#include "H5Tprivate.h" /* Datatypes */
/****************/
/* Local Macros */
@@ -973,6 +972,36 @@ H5free_memory(void *mem)
} /* end H5free_memory() */
+/*-------------------------------------------------------------------------
+ * Function: H5is_library_threadsafe
+ *
+ * Purpose: Checks to see if the library was built with thread-safety
+ * enabled.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5is_library_threadsafe(hbool_t *is_ts)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_API_NOINIT
+ H5TRACE1("e", "*b", is_ts);
+
+ HDassert(is_ts);
+
+#ifdef H5_HAVE_THREADSAFE
+ *is_ts = TRUE;
+#else /* H5_HAVE_THREADSAFE */
+ *is_ts = FALSE;
+#endif /* H5_HAVE_THREADSAFE */
+
+ FUNC_LEAVE_API(ret_value)
+} /* end H5is_library_threadsafe() */
+
+
#if defined(H5_HAVE_THREADSAFE) && defined(H5_BUILT_AS_DYNAMIC_LIB) \
&& defined(H5_HAVE_WIN32_API) && defined(H5_HAVE_WIN_THREADS)
/*-------------------------------------------------------------------------
diff --git a/src/H5FDcore.c b/src/H5FDcore.c
index 32f23fb..e553f6b 100644
--- a/src/H5FDcore.c
+++ b/src/H5FDcore.c
@@ -65,11 +65,7 @@ typedef struct H5FD_core_t {
* identify a file.
*/
dev_t device; /*file device number */
-#ifdef H5_VMS
- ino_t inode[3]; /*file i-node number */
-#else
ino_t inode; /*file i-node number */
-#endif /*H5_VMS*/
#else
/* Files in windows are uniquely identified by the volume serial
* number and the file index (both low and high parts).
@@ -741,14 +737,7 @@ H5FD_core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
file->dwVolumeSerialNumber = fileinfo.dwVolumeSerialNumber;
#else /* H5_HAVE_WIN32_API */
file->device = sb.st_dev;
-#ifdef H5_VMS
- file->inode[0] = sb.st_ino[0];
- file->inode[1] = sb.st_ino[1];
- file->inode[2] = sb.st_ino[2];
-#else
file->inode = sb.st_ino;
-#endif /* H5_VMS */
-
#endif /* H5_HAVE_WIN32_API */
} /* end if */
@@ -981,13 +970,8 @@ H5FD_core_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
if(HDmemcmp(&(f1->device),&(f2->device),sizeof(dev_t))>0) HGOTO_DONE(1)
#endif /* H5_DEV_T_IS_SCALAR */
-#ifndef H5_VMS
if (f1->inode < f2->inode) HGOTO_DONE(-1)
if (f1->inode > f2->inode) HGOTO_DONE(1)
-#else
- if(HDmemcmp(&(f1->inode),&(f2->inode),3*sizeof(ino_t))<0) HGOTO_DONE(-1)
- if(HDmemcmp(&(f1->inode),&(f2->inode),3*sizeof(ino_t))>0) HGOTO_DONE(1)
-#endif /* H5_VMS */
#endif /*H5_HAVE_WIN32_API*/
} /* end if */
@@ -1523,12 +1507,6 @@ H5FD_core_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing)
if(0 == bError)
HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly")
#else /* H5_HAVE_WIN32_API */
-#ifdef H5_VMS
- /* Reset seek offset to the beginning of the file, so that the file isn't
- * re-extended later. This may happen on Open VMS. */
- if(-1 == HDlseek(file->fd, (HDoff_t)0, SEEK_SET))
- HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position")
-#endif /* H5_VMS */
if(-1 == HDftruncate(file->fd, (HDoff_t)new_eof))
HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly")
#endif /* H5_HAVE_WIN32_API */
diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c
index e9fd1ea..f4ee910 100644
--- a/src/H5FDdirect.c
+++ b/src/H5FDdirect.c
@@ -83,11 +83,7 @@ typedef struct H5FD_direct_t {
* identify a file.
*/
dev_t device; /*file device number */
-#ifdef H5_VMS
- ino_t inode[3]; /*file i-node number */
-#else
ino_t inode; /*file i-node number */
-#endif /*H5_VMS*/
#else
/*
* On H5_HAVE_WIN32_API the low-order word of a unique identifier associated with the
@@ -525,13 +521,7 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd
file->fileindexlo = fileinfo.nFileIndexLow;
#else
file->device = sb.st_dev;
-#ifdef H5_VMS
- file->inode[0] = sb.st_ino[0];
- file->inode[1] = sb.st_ino[1];
- file->inode[2] = sb.st_ino[2];
-#else
file->inode = sb.st_ino;
-#endif /*H5_VMS*/
#endif /*H5_HAVE_WIN32_API*/
file->fa.mboundary = fa->mboundary;
file->fa.fbsize = fa->fbsize;
@@ -673,13 +663,8 @@ H5FD_direct_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
if(HDmemcmp(&(f1->device),&(f2->device),sizeof(dev_t))>0) HGOTO_DONE(1)
#endif /* H5_DEV_T_IS_SCALAR */
-#ifndef H5_VMS
if (f1->inode < f2->inode) HGOTO_DONE(-1)
if (f1->inode > f2->inode) HGOTO_DONE(1)
-#else
- if(HDmemcmp(&(f1->inode),&(f2->inode),3*sizeof(ino_t))<0) HGOTO_DONE(-1)
- if(HDmemcmp(&(f1->inode),&(f2->inode),3*sizeof(ino_t))>0) HGOTO_DONE(1)
-#endif /*H5_VMS*/
#endif
diff --git a/src/H5FDlog.c b/src/H5FDlog.c
index d2289fd..e8695c5 100644
--- a/src/H5FDlog.c
+++ b/src/H5FDlog.c
@@ -92,11 +92,7 @@ typedef struct H5FD_log_t {
* Windows code further below.
*/
dev_t device; /* file device number */
-#ifdef H5_VMS
- ino_t inode[3]; /* file i-node number */
-#else
ino_t inode; /* file i-node number */
-#endif /*H5_VMS*/
#else
/* Files in windows are uniquely identified by the volume serial
* number and the file index (both low and high parts).
@@ -587,14 +583,7 @@ H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
file->dwVolumeSerialNumber = fileinfo.dwVolumeSerialNumber;
#else /* H5_HAVE_WIN32_API */
file->device = sb.st_dev;
-#ifdef H5_VMS
- file->inode[0] = sb.st_ino[0];
- file->inode[1] = sb.st_ino[1];
- file->inode[2] = sb.st_ino[2];
-#else
file->inode = sb.st_ino;
-#endif /*H5_VMS*/
-
#endif /* H5_HAVE_WIN32_API */
/* Retain a copy of the name used to open the file, for possible error reporting */
@@ -867,13 +856,8 @@ H5FD_log_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
if(HDmemcmp(&(f1->device),&(f2->device),sizeof(dev_t)) > 0) HGOTO_DONE(1)
#endif /* H5_DEV_T_IS_SCALAR */
-#ifndef H5_VMS
if(f1->inode < f2->inode) HGOTO_DONE(-1)
if(f1->inode > f2->inode) HGOTO_DONE(1)
-#else
- if(HDmemcmp(&(f1->inode), &(f2->inode), 3 * sizeof(ino_t)) < 0) HGOTO_DONE(-1)
- if(HDmemcmp(&(f1->inode), &(f2->inode), 3 * sizeof(ino_t)) > 0) HGOTO_DONE(1)
-#endif /*H5_VMS*/
#endif
@@ -1553,13 +1537,6 @@ H5FD_log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_U
if(0 == bError)
HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly")
#else /* H5_HAVE_WIN32_API */
-#ifdef H5_VMS
- /* Reset seek offset to the beginning of the file, so that the file isn't
- * re-extended later. This may happen on Open VMS. */
- if(-1 == HDlseek(file->fd, (HDoff_t)0, SEEK_SET))
- HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position")
-#endif
-
if(-1 == HDftruncate(file->fd, (HDoff_t)file->eoa))
HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly")
#endif /* H5_HAVE_WIN32_API */
@@ -1579,3 +1556,4 @@ H5FD_log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_U
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_log_truncate() */
+
diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c
index 73dd7a0..10e2a66 100644
--- a/src/H5FDsec2.c
+++ b/src/H5FDsec2.c
@@ -69,11 +69,7 @@ typedef struct H5FD_sec2_t {
* Windows code further below.
*/
dev_t device; /* file device number */
-#ifdef H5_VMS
- ino_t inode[3]; /* file i-node number */
-#else
ino_t inode; /* file i-node number */
-#endif /* H5_VMS */
#else
/* Files in windows are uniquely identified by the volume serial
* number and the file index (both low and high parts).
@@ -374,13 +370,7 @@ H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
file->dwVolumeSerialNumber = fileinfo.dwVolumeSerialNumber;
#else /* H5_HAVE_WIN32_API */
file->device = sb.st_dev;
-#ifdef H5_VMS
- file->inode[0] = sb.st_ino[0];
- file->inode[1] = sb.st_ino[1];
- file->inode[2] = sb.st_ino[2];
-#else /* H5_VMS */
file->inode = sb.st_ino;
-#endif /* H5_VMS */
#endif /* H5_HAVE_WIN32_API */
/* Retain a copy of the name used to open the file, for possible error reporting */
@@ -501,13 +491,8 @@ H5FD_sec2_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
if(HDmemcmp(&(f1->device),&(f2->device),sizeof(dev_t)) < 0) HGOTO_DONE(-1)
if(HDmemcmp(&(f1->device),&(f2->device),sizeof(dev_t)) > 0) HGOTO_DONE(1)
#endif /* H5_DEV_T_IS_SCALAR */
-#ifdef H5_VMS
- if(HDmemcmp(&(f1->inode), &(f2->inode), 3 * sizeof(ino_t)) < 0) HGOTO_DONE(-1)
- if(HDmemcmp(&(f1->inode), &(f2->inode), 3 * sizeof(ino_t)) > 0) HGOTO_DONE(1)
-#else /* H5_VMS */
if(f1->inode < f2->inode) HGOTO_DONE(-1)
if(f1->inode > f2->inode) HGOTO_DONE(1)
-#endif /* H5_VMS */
#endif /* H5_HAVE_WIN32_API */
done:
@@ -901,12 +886,6 @@ H5FD_sec2_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_
if(0 == bError)
HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly")
#else /* H5_HAVE_WIN32_API */
-#ifdef H5_VMS
- /* Reset seek offset to the beginning of the file, so that the file isn't
- * re-extended later. This may happen on Open VMS. */
- if(-1 == HDlseek(file->fd, (HDoff_t)0, SEEK_SET))
- HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position")
-#endif
if(-1 == HDftruncate(file->fd, (HDoff_t)file->eoa))
HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly")
#endif /* H5_HAVE_WIN32_API */
@@ -922,3 +901,4 @@ H5FD_sec2_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_sec2_truncate() */
+
diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c
index 8e7eaf4..65b75a3 100644
--- a/src/H5FDstdio.c
+++ b/src/H5FDstdio.c
@@ -97,11 +97,7 @@ typedef struct H5FD_stdio_t {
* Windows code further below.
*/
dev_t device; /* file device number */
-#ifdef H5_VMS
- ino_t inode[3]; /* file i-node number */
-#else
ino_t inode; /* file i-node number */
-#endif /* H5_VMS */
#else
/* Files in windows are uniquely identified by the volume serial
* number and the file index (both low and high parts).
@@ -450,13 +446,7 @@ H5FD_stdio_open( const char *name, unsigned flags, hid_t fapl_id,
H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_BADFILE, "unable to fstat file", NULL)
} /* end if */
file->device = sb.st_dev;
-#ifdef H5_VMS
- file->inode[0] = sb.st_ino[0];
- file->inode[1] = sb.st_ino[1];
- file->inode[2] = sb.st_ino[2];
-#else /* H5_VMS */
file->inode = sb.st_ino;
-#endif /* H5_VMS */
#endif /* H5_HAVE_WIN32_API */
return (H5FD_t*)file;
@@ -542,13 +532,8 @@ H5FD_stdio_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
if(memcmp(&(f1->device),&(f2->device),sizeof(dev_t)) < 0) return -1;
if(memcmp(&(f1->device),&(f2->device),sizeof(dev_t)) > 0) return 1;
#endif /* H5_DEV_T_IS_SCALAR */
-#ifdef H5_VMS
- if(memcmp(&(f1->inode), &(f2->inode), 3 * sizeof(ino_t)) < 0) return -1;
- if(memcmp(&(f1->inode), &(f2->inode), 3 * sizeof(ino_t)) > 0) return 1;
-#else /* H5_VMS */
if(f1->inode < f2->inode) return -1;
if(f1->inode > f2->inode) return 1;
-#endif /* H5_VMS */
#endif /* H5_HAVE_WIN32_API */
return 0;
diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c
index 78ac6f5..fcd3395 100644
--- a/src/H5Lexternal.c
+++ b/src/H5Lexternal.c
@@ -125,8 +125,6 @@ H5L_getenv_prefix_name(char **env_prefix/*in,out*/)
*
* Programmer: Vailin Choi, April 2, 2008
*
- * Modification: Raymond Lu, 14 Jan. 2009
- * Added support for OpenVMS pathname
--------------------------------------------------------------------------*/
static herr_t
H5L_build_name(char *prefix, char *file_name, char **full_name/*out*/)
diff --git a/src/H5S.c b/src/H5S.c
index 9b37797..efb9d34 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -190,7 +190,7 @@ H5S_create(H5S_class_t type)
FUNC_ENTER_NOAPI(NULL)
/* Create a new dataspace */
- if(NULL == (new_ds = H5FL_MALLOC(H5S_t)))
+ if(NULL == (new_ds = H5FL_CALLOC(H5S_t)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Initialize default dataspace state */
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index b14f6e5..6847e68 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -4255,7 +4255,11 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception")
goto padding;
-#ifndef H5_VMS /*Temporary solution to handle VAX special values*/
+ /* Temporary solution to handle VAX special values.
+ * Note that even though we don't support VAX anymore, we
+ * still need to handle legacy VAX files so this code must
+ * remain in place.
+ */
} else if (H5T__bit_find (s, src.u.f.epos, src.u.f.esize,
H5T_BIT_LSB, FALSE)<0) {
/* NaN */
@@ -4280,7 +4284,6 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception")
goto padding;
-#endif /*H5_VMS*/
}
/*
diff --git a/src/H5private.h b/src/H5private.h
index 9efd145..5e968a0 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -1130,22 +1130,9 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...);
#ifndef HDrealpath
#define HDrealpath(F1,F2) realpath(F1,F2)
#endif /* HDrealloc */
-#ifdef H5_VMS
- #ifdef __cplusplus
- extern "C" {
- #endif /* __cplusplus */
- int HDremove_all(const char * fname);
- #ifdef __cplusplus
- }
- #endif /* __cplusplus */
- #ifndef HDremove
- #define HDremove(S) HDremove_all(S)
- #endif /* HDremove */
-#else /* H5_VMS */
- #ifndef HDremove
- #define HDremove(S) remove(S)
- #endif /* HDremove */
-#endif /*H5_VMS*/
+#ifndef HDremove
+ #define HDremove(S) remove(S)
+#endif /* HDremove */
#ifndef HDrename
#define HDrename(OLD,NEW) rename(OLD,NEW)
#endif /* HDrename */
@@ -1562,19 +1549,7 @@ extern char *strdup(const char *s);
(ptr = slash); \
}
-#elif defined(H5_HAVE_VMS_PATH)
-
-/* OpenVMS pathname: <disk name>$<partition>:[path]<file name>
- * i.g. SYS$SYSUSERS:[LU.HDF5.SRC]H5system.c */
-#define H5_DIR_SEPC ']'
-#define H5_DIR_SEPS "]"
-#define H5_CHECK_DELIMITER(SS) (SS == H5_DIR_SEPC)
-#define H5_CHECK_ABSOLUTE(NAME) (HDstrrchr(NAME, ':') && HDstrrchr(NAME, '['))
-#define H5_CHECK_ABS_DRIVE(NAME) (0)
-#define H5_CHECK_ABS_PATH(NAME) (0)
-#define H5_GET_LAST_DELIMITER(NAME, ptr) ptr = HDstrrchr(NAME, H5_DIR_SEPC);
-
-#else
+#else /* H5_HAVE_WINDOW_PATH */
#define H5_DIR_SEPC '/'
#define H5_DIR_SEPS "/"
@@ -1584,7 +1559,7 @@ extern char *strdup(const char *s);
#define H5_CHECK_ABS_PATH(NAME) (0)
#define H5_GET_LAST_DELIMITER(NAME, ptr) ptr = HDstrrchr(NAME, H5_DIR_SEPC);
-#endif
+#endif /* H5_HAVE_WINDOW_PATH */
#define H5_COLON_SEPC ':'
@@ -1746,9 +1721,24 @@ H5_DLL double H5_trace(const double *calltime, const char *func, const char *typ
*-------------------------------------------------------------------------
*/
-/* `S' is the name of a function which is being tested to check if its */
-/* an API function */
-#define H5_IS_API(S) ('_'!=((const char *)S)[2] && '_'!=((const char *)S)[3] && (!((const char *)S)[4] || '_'!=((const char *)S)[4]))
+/* `S' is the name of a function which is being tested to check if it's
+ * an API function.
+ *
+ * BADNESS:
+ * - Underscore at positions 2 or 3 (0-indexed string). Handles
+ * H5_ and H5X_.
+ * - Underscore at position 4 if position 3 is uppercase or a digit.
+ * Handles H5XY_.
+ */
+#define H5_IS_API(S) (\
+ '_'!=((const char *)S)[2] /* underscore at position 2 */ \
+ && '_'!=((const char *)S)[3] /* underscore at position 3 */ \
+ && !( /* NOT */ \
+ ((const char *)S)[4] /* pos 4 exists */ \
+ && (HDisupper(S[3]) || HDisdigit(S[3])) /* pos 3 dig | uc */ \
+ && '_'==((const char *)S)[4] /* pos 4 underscore */ \
+ )\
+)
/* `S' is the name of a function which is being tested to check if it's */
/* a public API function */
diff --git a/src/H5public.h b/src/H5public.h
index b9b4dd7..8c7da05 100644
--- a/src/H5public.h
+++ b/src/H5public.h
@@ -331,6 +331,7 @@ H5_DLL herr_t H5get_libversion(unsigned *majnum, unsigned *minnum,
unsigned *relnum);
H5_DLL herr_t H5check_version(unsigned majnum, unsigned minnum,
unsigned relnum);
+H5_DLL herr_t H5is_library_threadsafe(hbool_t *is_ts);
H5_DLL herr_t H5free_memory(void *mem);
H5_DLL void *H5allocate_memory(size_t size, hbool_t clear);
H5_DLL void *H5resize_memory(void *mem, size_t size);
@@ -338,5 +339,6 @@ H5_DLL void *H5resize_memory(void *mem, size_t size);
#ifdef __cplusplus
}
#endif
-#endif
+#endif /* _H5public_H */
+
diff --git a/src/H5system.c b/src/H5system.c
index 56db380..e00e5a5 100644
--- a/src/H5system.c
+++ b/src/H5system.c
@@ -582,45 +582,8 @@ void HDsrand(unsigned int seed)
{
g_seed = seed;
}
-#endif
+#endif /* H5_HAVE_RAND_R */
-
-/*-------------------------------------------------------------------------
- * Function: HDremove_all
- *
- * Purpose: Wrapper function for remove on VMS systems
- *
- * This function deletes all versions of a file
- *
- * Return: Success: 0;
- *
- * Failure: -1
- *
- * Programmer: Elena Pourmal
- * March 22, 2006
- *
- *-------------------------------------------------------------------------
- */
-#ifdef H5_VMS
-int
-HDremove_all(const char *fname)
-{
- int ret_value = -1;
- size_t fname_len;
- char *_fname;
-
- fname_len = HDstrlen(fname) + 3; /* to accomodate ";*" and null terminator */
- _fname = (char *)H5MM_malloc(fname_len);
- if(_fname) {
- HDsnprintf(_fname, fname_len, "%s;*", fname);
- /* Do not use HDremove; function becomes recursive (see H5private.h file)*/
- remove(_fname);
- H5MM_xfree(_fname);
- ret_value = 0;
- }
- return ret_value;
-}
-#endif
/*-------------------------------------------------------------------------
* Function: Wgettimeofday
@@ -764,8 +727,6 @@ H5_build_extpath(const char *name, char **extpath/*out*/)
/*
* Unix: name[0] is a "/"
* Windows: name[0-2] is "<drive letter>:\" or "<drive-letter>:/"
- * OpenVMS: <disk name>$<partition>:[path]<file name>
- * i.g. SYS$SYSUSERS:[LU.HDF5.SRC]H5system.c
*/
if(H5_CHECK_ABSOLUTE(name)) {
if(NULL == (full_path = (char *)H5MM_strdup(name)))
@@ -786,7 +747,6 @@ H5_build_extpath(const char *name, char **extpath/*out*/)
* Windows: name[0-1] is "<drive-letter>:"
* Get current working directory on the drive specified in NAME
* Unix: does not apply
- * OpenVMS: does not apply
*/
if(H5_CHECK_ABS_DRIVE(name)) {
drive = name[0] - 'A' + 1;
@@ -797,14 +757,13 @@ H5_build_extpath(const char *name, char **extpath/*out*/)
* Windows: name[0] is a '/' or '\'
* Get current drive
* Unix: does not apply
- * OpenVMS: does not apply
*/
else if(H5_CHECK_ABS_PATH(name) && (0 != (drive = HDgetdrive()))) {
HDsnprintf(cwdpath, MAX_PATH_LEN, "%c:%c", (drive + 'A' - 1), name[0]);
retcwd = cwdpath;
HDstrncpy(new_name, &name[1], name_len);
}
- /* totally relative for Unix, Windows, and OpenVMS: get current working directory */
+ /* totally relative for Unix and Windows: get current working directory */
else {
retcwd = HDgetcwd(cwdpath, MAX_PATH_LEN);
HDstrncpy(new_name, name, name_len);
@@ -823,26 +782,9 @@ H5_build_extpath(const char *name, char **extpath/*out*/)
HGOTO_ERROR(H5E_INTERNAL, H5E_NOSPACE, FAIL, "memory allocation failed")
HDstrncpy(full_path, cwdpath, cwdlen + 1);
-#ifdef H5_VMS
- /* If the file name contains relative path, cut off the beginning bracket. Also cut off the
- * ending bracket of CWDPATH to combine the full path name. i.g.
- * cwdpath = SYS$SYSUSERS:[LU.HDF5.TEST]
- * new_name = [.tmp]extlinks.h5
- * full_path = SYS$SYSUSERS:[LU.HDF5.TEST.tmp]extlinks.h5
- */
- if(new_name[0] == '[') {
- char *tmp = new_name;
-
- full_path[cwdlen - 1] = '\0';
- HDstrncat(full_path, ++tmp, HDstrlen(tmp));
- } /* end if */
- else
- HDstrncat(full_path, new_name, HDstrlen(new_name));
-#else
if(!H5_CHECK_DELIMITER(cwdpath[cwdlen - 1]))
HDstrncat(full_path, H5_DIR_SEPS, HDstrlen(H5_DIR_SEPS));
HDstrncat(full_path, new_name, HDstrlen(new_name));
-#endif
} /* end if */
} /* end else */