From 46c5b059f1a7c434bff7b04f56f74de84a41edd2 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Sat, 20 Oct 2018 13:06:37 -0700 Subject: Split H5VLnative.h into public and private files and updated --- MANIFEST | 1 + src/CMakeLists.txt | 1 + src/H5Aint.c | 2 +- src/H5Dint.c | 2 +- src/H5Dvirtual.c | 2 +- src/H5Fint.c | 3 +-- src/H5Gint.c | 2 +- src/H5Gtraverse.c | 2 +- src/H5L.c | 2 +- src/H5Lexternal.c | 2 +- src/H5Oint.c | 2 +- src/H5Pfapl.c | 2 +- src/H5VLnative.c | 2 +- src/H5VLnative.h | 8 -------- src/H5VLnative_private.h | 40 ++++++++++++++++++++++++++++++++++++++++ src/hdf5.h | 3 +++ test/vol.c | 2 +- 17 files changed, 57 insertions(+), 21 deletions(-) create mode 100644 src/H5VLnative_private.h diff --git a/MANIFEST b/MANIFEST index 2ca6110..a7df90c 100644 --- a/MANIFEST +++ b/MANIFEST @@ -893,6 +893,7 @@ ./src/H5VLmodule.h ./src/H5VLnative.c ./src/H5VLnative.h +./src/H5VLnative_private.h ./src/H5VLpkg.h ./src/H5VLprivate.h ./src/H5VLpublic.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5104019..f82b8de 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -835,6 +835,7 @@ set (H5_PRIVATE_HEADERS ${HDF5_SRC_DIR}/H5STprivate.h ${HDF5_SRC_DIR}/H5Tprivate.h ${HDF5_SRC_DIR}/H5TSprivate.h + ${HDF5_SRC_DIR}/H5VLnative_private.h ${HDF5_SRC_DIR}/H5VLprivate.h ${HDF5_SRC_DIR}/H5VMprivate.h ${HDF5_SRC_DIR}/H5WBprivate.h diff --git a/src/H5Aint.c b/src/H5Aint.c index 80a3e98..ca5cb80 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -43,7 +43,7 @@ #include "H5Opkg.h" /* Object headers */ #include "H5SMprivate.h" /* Shared Object Header Messages */ #include "H5VLprivate.h" /* Virtual Object Layer */ -#include "H5VLnative.h" /* Native VOL driver */ +#include "H5VLnative_private.h" /* Native VOL driver */ /****************/ diff --git a/src/H5Dint.c b/src/H5Dint.c index 3436105..253d005 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -31,7 +31,7 @@ #include "H5Lprivate.h" /* Links */ #include "H5MMprivate.h" /* Memory management */ #include "H5VLprivate.h" /* Virtual Object Layer */ -#include "H5VLnative.h" /* Native VOL driver */ +#include "H5VLnative_private.h" /* Native VOL driver */ /****************/ diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index 77047e9..c7c1eec 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -58,7 +58,7 @@ #include "H5Oprivate.h" /* Object headers */ #include "H5Pprivate.h" /* Property Lists */ #include "H5Sprivate.h" /* Dataspaces */ -#include "H5VLnative.h" /* Native VOL driver */ +#include "H5VLnative_private.h" /* Native VOL driver */ #include "H5VLprivate.h" /* Virtual Object Layer */ /****************/ diff --git a/src/H5Fint.c b/src/H5Fint.c index 6a57ca5..1a0c8b9 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -38,8 +38,7 @@ #include "H5SMprivate.h" /* Shared Object Header Messages */ #include "H5Tprivate.h" /* Datatypes */ #include "H5VLprivate.h" /* VOL drivers */ - -#include "H5VLnative.h" /* Native VOL driver */ +#include "H5VLnative_private.h" /* Native VOL driver */ /****************/ diff --git a/src/H5Gint.c b/src/H5Gint.c index 88ef82b..26c582e 100644 --- a/src/H5Gint.c +++ b/src/H5Gint.c @@ -39,7 +39,7 @@ #include "H5Iprivate.h" /* IDs */ #include "H5Lprivate.h" /* Links */ #include "H5MMprivate.h" /* Memory management */ -#include "H5VLnative.h" /* Virtual Object Layer (native) */ +#include "H5VLnative_private.h" /* Native VOL driver */ /****************/ diff --git a/src/H5Gtraverse.c b/src/H5Gtraverse.c index a103f53..8fefcd8 100644 --- a/src/H5Gtraverse.c +++ b/src/H5Gtraverse.c @@ -43,7 +43,7 @@ #include "H5MMprivate.h" /* Memory management */ #include "H5Ppublic.h" /* Property Lists */ #include "H5WBprivate.h" /* Wrapped Buffers */ -#include "H5VLnative.h" /* Virtual Object Layer (native) */ +#include "H5VLnative_private.h" /* Native VOL driver */ /****************/ diff --git a/src/H5L.c b/src/H5L.c index 0beafba..5142c82 100644 --- a/src/H5L.c +++ b/src/H5L.c @@ -34,7 +34,7 @@ #include "H5Oprivate.h" /* File objects */ #include "H5Pprivate.h" /* Property lists */ #include "H5VLprivate.h" /* Virtual Object Layer */ -#include "H5VLnative.h" /* Virtual Object Layer (native) */ +#include "H5VLnative_private.h" /* Native VOL driver */ /****************/ diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c index d9cc7a3..34c96a8 100644 --- a/src/H5Lexternal.c +++ b/src/H5Lexternal.c @@ -34,7 +34,7 @@ #include "H5Opublic.h" /* File objects */ #include "H5Pprivate.h" /* Property lists */ #include "H5VLprivate.h" /* Virtual Object Layer */ -#include "H5VLnative.h" /* Native VOL Driver */ +#include "H5VLnative_private.h" /* Native VOL driver */ /****************/ diff --git a/src/H5Oint.c b/src/H5Oint.c index c569226..30fe127 100644 --- a/src/H5Oint.c +++ b/src/H5Oint.c @@ -43,7 +43,7 @@ #endif /* H5O_ENABLE_BOGUS */ #include "H5Opkg.h" /* Object headers */ #include "H5VLprivate.h" /* Virtual Object Layer */ -#include "H5VLnative.h" /* Virtual Object Layer (native) */ +#include "H5VLnative_private.h" /* Native VOL driver */ /****************/ diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 0340b67..a50c5ee 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -49,7 +49,7 @@ #endif /* Includes needed to set the default VOL driver */ -#include "H5VLnative.h" /* Native HDF5 file VOL driver */ +#include "H5VLnative_private.h" /* Native VOL driver */ /****************/ diff --git a/src/H5VLnative.c b/src/H5VLnative.c index acd56cd..e71e08e 100644 --- a/src/H5VLnative.c +++ b/src/H5VLnative.c @@ -41,7 +41,7 @@ #include "H5SMprivate.h" /* Shared Object Header Messages */ #include "H5Tpkg.h" /* Datatypes */ #include "H5VLprivate.h" /* VOL drivers */ -#include "H5VLnative.h" /* Native VOL driver */ +#include "H5VLnative_private.h" /* Native VOL driver */ /* * The VOL driver identification number. diff --git a/src/H5VLnative.h b/src/H5VLnative.h index 19b9ff9..832c758 100644 --- a/src/H5VLnative.h +++ b/src/H5VLnative.h @@ -17,9 +17,6 @@ #ifndef _H5VLnative_H #define _H5VLnative_H -/* Initializer function for native VOL driver */ -#define H5VL_NATIVE (H5VL_native_init()) - /* Characteristics of the native VOL driver */ #define H5VL_NATIVE_NAME "native" #define H5VL_NATIVE_VALUE H5_VOL_NATIVE /* enum value */ @@ -30,12 +27,7 @@ extern "C" { #endif -/* XXX (VOL_MERGE): Poor separation of public and private functionality here */ H5_DLL herr_t H5Pset_fapl_native(hid_t fapl_id); -H5_DLL hid_t H5VL_native_get_driver_id(void); -H5_DLL hid_t H5VL_native_init(void); -H5_DLL hid_t H5VL_native_register(H5I_type_t type, const void *obj, hbool_t app_ref); -H5_DLL herr_t H5VL_native_unregister(hid_t obj_id); #ifdef __cplusplus } diff --git a/src/H5VLnative_private.h b/src/H5VLnative_private.h new file mode 100644 index 0000000..79a6e1c --- /dev/null +++ b/src/H5VLnative_private.h @@ -0,0 +1,40 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Purpose: The private header file for the native VOL driver. + */ + +#ifndef _H5VLnative_private_H +#define _H5VLnative_private_H + +/* Include driver's public header */ +#include "H5VLnative.h" + +/* Initializer function for native VOL driver */ +#define H5VL_NATIVE (H5VL_native_init()) + + +#ifdef __cplusplus +extern "C" { +#endif + +H5_DLL hid_t H5VL_native_get_driver_id(void); +H5_DLL hid_t H5VL_native_init(void); +H5_DLL hid_t H5VL_native_register(H5I_type_t type, const void *obj, hbool_t app_ref); +H5_DLL herr_t H5VL_native_unregister(hid_t obj_id); + +#ifdef __cplusplus +} +#endif + +#endif /* _H5VLnative_private_H */ diff --git a/src/hdf5.h b/src/hdf5.h index fbeae83..f19abd9 100644 --- a/src/hdf5.h +++ b/src/hdf5.h @@ -52,4 +52,7 @@ #include "H5FDwindows.h" /* Win32 I/O */ #endif +/* Virtual object layer drivers */ +#include "H5VLnative.h" /* Native VOL driver */ + #endif diff --git a/test/vol.c b/test/vol.c index ad65a62..0ef84c5 100644 --- a/test/vol.c +++ b/test/vol.c @@ -19,7 +19,7 @@ */ #include "h5test.h" -#include "H5VLnative.h" +#include "H5VLnative_private.h" #define NATIVE_VOL_TEST_FILENAME "native_vol_test" -- cgit v0.12 From b33a2e7dfe76a2947c12462adb40c88af9c92e75 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Sun, 21 Oct 2018 10:08:26 -0700 Subject: Fixed warnings in the VOL example and run it from the script. --- examples/h5_vol_external_log_native.c | 16 ++++++++-------- examples/run-c-ex.sh.in | 4 +++- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/examples/h5_vol_external_log_native.c b/examples/h5_vol_external_log_native.c index a25be6d..d6e44db 100644 --- a/examples/h5_vol_external_log_native.c +++ b/examples/h5_vol_external_log_native.c @@ -131,7 +131,7 @@ visit_cb(hid_t oid, const char *name, if(H5Iget_type(oid) == H5I_GROUP) { len = H5VLget_driver_name(oid, n, 50); - printf ("Visiting GROUP VOL name = %s %d\n", n, len); + printf ("Visiting GROUP VOL name = %s %zd\n", n, len); } if(H5Iget_type(oid) == H5I_DATASET) printf("visiting dataset\n"); @@ -184,29 +184,29 @@ int main(int argc, char **argv) { file_id = H5Fcreate(file_name, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl); len = H5VLget_driver_name(file_id, name, 25); - printf ("FILE VOL name = %s %d\n", name, len); + printf ("FILE VOL name = %s %zd\n", name, len); group_id = H5Gcreate2(file_id, group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); len = H5VLget_driver_name(group_id, name, 50); - printf ("GROUP VOL name = %s %d\n", name, len); + printf ("GROUP VOL name = %s %zd\n", name, len); int_id = H5Tcopy(H5T_NATIVE_INT); H5Tcommit2(file_id, "int", int_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); len = H5VLget_driver_name(int_id, name, 50); - printf ("DT COMMIT name = %s %d\n", name, len); + printf ("DT COMMIT name = %s %zd\n", name, len); H5Tclose(int_id); int_id = H5Topen2(file_id, "int", H5P_DEFAULT); len = H5VLget_driver_name(int_id, name, 50); - printf ("DT OPEN name = %s %d\n", name, len); + printf ("DT OPEN name = %s %zd\n", name, len); H5Tclose(int_id); int_id = H5Oopen(file_id,"int",H5P_DEFAULT); len = H5VLget_driver_name(int_id, name, 50); - printf ("DT OOPEN name = %s %d\n", name, len); + printf ("DT OOPEN name = %s %zd\n", name, len); len = H5Fget_name(file_id, name, 50); - printf("name = %d %s\n", len, name); + printf("name = %zd %s\n", len, name); data = malloc (sizeof(int)*nelem); for(i=0;i