summaryrefslogtreecommitdiffstats
path: root/src/H5private.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@lbl.gov>2020-11-25 21:16:00 (GMT)
committerGitHub <noreply@github.com>2020-11-25 21:16:00 (GMT)
commit4e23defcdc618aa07a73bb7a2b0ee59e8a37da1b (patch)
treea72e5b1d291d0d1c187fd6dab79c4e56196b906e /src/H5private.h
parentf095373635f6a146fadd9ee7ec0e481f1b4da7ef (diff)
downloadhdf5-4e23defcdc618aa07a73bb7a2b0ee59e8a37da1b.zip
hdf5-4e23defcdc618aa07a73bb7a2b0ee59e8a37da1b.tar.gz
hdf5-4e23defcdc618aa07a73bb7a2b0ee59e8a37da1b.tar.bz2
Update H5TS code to reflect library's coding style (#123)
Diffstat (limited to 'src/H5private.h')
-rw-r--r--src/H5private.h110
1 files changed, 110 insertions, 0 deletions
diff --git a/src/H5private.h b/src/H5private.h
index 38742ed..dba48a6 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -1259,6 +1259,57 @@ typedef off_t h5_stat_size_t;
#ifndef HDprintf
#define HDprintf printf
#endif /* HDprintf */
+#ifndef HDpthread_attr_destroy
+#define HDpthread_attr_destroy(A) pthread_attr_destroy(A)
+#endif /* HDpthread_attr_destroy */
+#ifndef HDpthread_attr_init
+#define HDpthread_attr_init(A) pthread_attr_init(A)
+#endif /* HDpthread_attr_init */
+#ifndef HDpthread_attr_setscope
+#define HDpthread_attr_setscope(A, S) pthread_attr_setscope(A, S)
+#endif /* HDpthread_attr_setscope */
+#ifndef HDpthread_cond_init
+#define HDpthread_cond_init(C, A) pthread_cond_init(C, A)
+#endif /* HDpthread_cond_init */
+#ifndef HDpthread_cond_signal
+#define HDpthread_cond_signal(C) pthread_cond_signal(C)
+#endif /* HDpthread_cond_signal */
+#ifndef HDpthread_cond_wait
+#define HDpthread_cond_wait(C, M) pthread_cond_wait(C, M)
+#endif /* HDpthread_cond_wait */
+#ifndef HDpthread_create
+#define HDpthread_create(R, A, F, U) pthread_create(R, A, F, U)
+#endif /* HDpthread_create */
+#ifndef HDpthread_equal
+#define HDpthread_equal(T1, T2) pthread_equal(T1, T2)
+#endif /* HDpthread_equal */
+#ifndef HDpthread_getspecific
+#define HDpthread_getspecific(K) pthread_getspecific(K)
+#endif /* HDpthread_getspecific */
+#ifndef HDpthread_join
+#define HDpthread_join(T, V) pthread_join(T, V)
+#endif /* HDpthread_join */
+#ifndef HDpthread_key_create
+#define HDpthread_key_create(K, D) pthread_key_create(K, D)
+#endif /* HDpthread_key_create */
+#ifndef HDpthread_mutex_init
+#define HDpthread_mutex_init(M, A) pthread_mutex_init(M, A)
+#endif /* HDpthread_mutex_init */
+#ifndef HDpthread_mutex_lock
+#define HDpthread_mutex_lock(M) pthread_mutex_lock(M)
+#endif /* HDpthread_mutex_lock */
+#ifndef HDpthread_mutex_unlock
+#define HDpthread_mutex_unlock(M) pthread_mutex_unlock(M)
+#endif /* HDpthread_mutex_unlock */
+#ifndef HDpthread_self
+#define HDpthread_self() pthread_self()
+#endif /* HDpthread_self */
+#ifndef HDpthread_setcancelstate
+#define HDpthread_setcancelstate(N, O) pthread_setcancelstate(N, O)
+#endif /* HDpthread_setcancelstate */
+#ifndef HDpthread_setspecific
+#define HDpthread_setspecific(K, V) pthread_setspecific(K, V)
+#endif /* HDpthread_setspecific */
#ifndef HDputc
#define HDputc(C, F) putc(C, F)
#endif /* HDputc*/
@@ -2251,6 +2302,23 @@ H5_DLL herr_t H5CX_pop(void);
FUNC_ENTER_API_INIT(err); \
{
+/*
+ * Use this macro for API functions that shouldn't perform _any_ initialization
+ * of the library or an interface, or push themselves on the function
+ * stack, or perform tracing, etc. This macro _only_ sanity checks the
+ * API name itself. Examples are: H5TSmutex_acquire,
+ *
+ */
+#define FUNC_ENTER_API_NAMECHECK_ONLY \
+ { \
+ { \
+ { \
+ { \
+ { \
+ { \
+ FUNC_ENTER_COMMON_NOERR(H5_IS_API(FUNC)); \
+ {
+
/* Note: this macro only works when there's _no_ interface initialization routine for the module */
#define FUNC_ENTER_NOAPI_INIT(err) \
/* Initialize the package, if appropriate */ \
@@ -2330,6 +2398,17 @@ H5_DLL herr_t H5CX_pop(void);
FUNC_ENTER_COMMON_NOERR(!H5_IS_API(FUNC)); \
if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) {
+/*
+ * Use this macro for non-API functions that shouldn't perform _any_ initialization
+ * of the library or an interface, or push themselves on the function
+ * stack, or perform tracing, etc. This macro _only_ sanity checks the
+ * API name itself. Examples are private routines in the H5TS package.
+ *
+ */
+#define FUNC_ENTER_NOAPI_NAMECHECK_ONLY \
+ { \
+ FUNC_ENTER_COMMON_NOERR(!H5_IS_API(FUNC));
+
/* Use the following two macros as replacements for the FUNC_ENTER_NOAPI
* and FUNC_ENTER_NOAPI_NOINIT macros when the function needs to set
* up a metadata tag. */
@@ -2397,6 +2476,17 @@ H5_DLL herr_t H5CX_pop(void);
FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(FUNC)); \
if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) {
+/*
+ * Use this macro for non-API functions that shouldn't perform _any_ initialization
+ * of the library or an interface, or push themselves on the function
+ * stack, or perform tracing, etc. This macro _only_ sanity checks the
+ * API name itself. Examples are static routines in the H5TS package.
+ *
+ */
+#define FUNC_ENTER_STATIC_NAMECHECK_ONLY \
+ { \
+ FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(FUNC));
+
/* Use the following macro as replacement for the FUNC_ENTER_STATIC
* macro when the function needs to set up a metadata tag. */
#define FUNC_ENTER_STATIC_TAG(tag) \
@@ -2474,6 +2564,18 @@ H5_DLL herr_t H5CX_pop(void);
} \
} /*end scope from beginning of FUNC_ENTER*/
+/* Use this macro to match the FUNC_ENTER_API_NAMECHECK_ONLY macro */
+#define FUNC_LEAVE_API_NAMECHECK_ONLY(ret_value) \
+ ; \
+ } /*end scope from end of FUNC_ENTER*/ \
+ return (ret_value); \
+ } \
+ } \
+ } \
+ } \
+ } \
+ } /*end scope from beginning of FUNC_ENTER*/
+
#define FUNC_LEAVE_NOAPI(ret_value) \
; \
} /*end scope from end of FUNC_ENTER*/ \
@@ -2499,6 +2601,14 @@ H5_DLL herr_t H5CX_pop(void);
return (ret_value); \
} /*end scope from beginning of FUNC_ENTER*/
+/* Use these macros to match the FUNC_ENTER_NOAPI_NAMECHECK_ONLY macro */
+#define FUNC_LEAVE_NOAPI_NAMECHECK_ONLY(ret_value) \
+ return (ret_value); \
+ } /*end scope from beginning of FUNC_ENTER*/
+#define FUNC_LEAVE_NOAPI_VOID_NAMECHECK_ONLY \
+ return; \
+ } /*end scope from beginning of FUNC_ENTER*/
+
/* Use this macro when exiting a function that set up a metadata tag */
#define FUNC_LEAVE_NOAPI_TAG(ret_value) \
; \