From 52d44e3b3c6469a98eb46b2421f2fd039e3daf01 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Fri, 29 Apr 2016 16:34:07 +0200 Subject: [PATCH] - re-organize file hierarchy - years in copyright changed --- src/C/Makefile.am | 3 +- src/Fortran/H5.c | 6 +- src/Fortran/H5Block_model.c | 1 + src/Fortran/H5Part_model.c | 1 + src/Fortran/H5_attribs.c | 3 +- src/Fortran/H5_model.c | 2 +- src/Fortran/h5_private.h | 2 +- src/h5core/Makefile.am | 134 +++++------ src/h5core/{h5_attach.c => h5_attachments.c} | 14 +- src/h5core/h5_attribs.c | 64 +---- src/h5core/h5_attribs_private.h | 50 ---- src/h5core/h5_debug.c | 79 ++++++ src/h5core/h5_errorhandling.c | 73 +----- src/h5core/{h5_openclose.c => h5_file.c} | 42 ++-- src/h5core/h5_init.c | 12 +- src/h5core/h5_model.c | 16 +- src/h5core/h5_private.h | 24 -- src/h5core/h5_syscall.c | 42 ---- src/h5core/h5_syscall_private.h | 28 --- src/h5core/h5b_attribs.c | 19 +- src/h5core/{h5b_readwrite.c => h5b_io.c} | 18 +- src/h5core/h5b_model.c | 18 +- src/h5core/h5t_adjacencies.c | 16 +- src/h5core/{h5t_readwrite.c => h5t_io.c} | 36 +-- src/h5core/h5t_map.c | 16 +- src/h5core/h5t_model.c | 34 +-- src/h5core/h5t_octree.c | 6 +- src/h5core/h5t_retrieve.c | 22 +- src/h5core/h5t_store.c | 63 +++-- src/h5core/h5t_tags.c | 24 +- src/h5core/{h5u_readwrite.c => h5u_io.c} | 16 +- src/h5core/h5u_model.c | 22 +- src/h5core/private/h5.h | 42 ++++ src/h5core/private/h5_attribs.h | 95 ++++++++ .../h5_debug.h} | 6 +- .../h5_errorhandling.h} | 6 +- src/h5core/{ => private}/h5_fcmp.c | 2 +- .../{h5_fcmp_private.h => private/h5_fcmp.h} | 6 +- src/h5core/{ => private}/h5_hdf5.c | 4 +- .../{h5_hdf5_private.h => private/h5_hdf5.h} | 9 +- src/h5core/{ => private}/h5_hsearch.c | 6 +- .../h5_hsearch.h} | 6 +- .../{h5_init_private.h => private/h5_init.h} | 8 +- .../{h5_readwrite.c => private/h5_io.c} | 14 +- .../h5_io.h} | 28 +-- src/h5core/{ => private}/h5_lustre.c | 4 +- .../h5_lustre.h} | 6 +- src/h5core/{ => private}/h5_maps.c | 8 +- .../{h5_maps_private.h => private/h5_maps.h} | 10 +- .../h5_model.h} | 15 +- .../{h5_mpi_private.h => private/h5_mpi.h} | 8 +- src/h5core/{ => private}/h5_qsort.c | 2 +- .../h5_qsort.h} | 6 +- src/h5core/{ => private}/h5_qsort_r.c | 0 .../h5_types.h} | 6 +- src/h5core/{ => private}/h5_va_macros.h | 4 +- .../h5b_io.h} | 6 +- .../h5b_model.h} | 6 +- .../h5b_types.h} | 4 +- .../h5t_access.h} | 8 +- src/h5core/{ => private}/h5t_access_tetm.c | 18 +- src/h5core/{ => private}/h5t_access_trim.c | 16 +- .../h5t_adjacencies.h} | 10 +- .../{ => private}/h5t_adjacencies_tetm.c | 16 +- .../{ => private}/h5t_adjacencies_trim.c | 14 +- src/h5core/{ => private}/h5t_core.c | 10 +- .../h5t_core.h} | 37 +-- src/h5core/{ => private}/h5t_core_tetm.c | 10 +- src/h5core/{ => private}/h5t_core_trim.c | 8 +- .../h5t_errorhandling.h} | 8 +- .../h5t_io.h} | 8 +- .../h5t_io_tetm.c} | 10 +- .../h5t_io_trim.c} | 12 +- .../{h5t_map_private.h => private/h5t_map.h} | 12 +- .../h5t_model.h} | 8 +- src/h5core/{ => private}/h5t_model_tetm.c | 25 +- src/h5core/{ => private}/h5t_model_trim.c | 27 ++- .../h5t_octree.h} | 6 +- src/h5core/{ => private}/h5t_ref_elements.c | 8 +- .../h5t_ref_elements.h} | 6 +- .../h5t_retrieve.h} | 8 +- src/h5core/{ => private}/h5t_retrieve_tetm.c | 18 +- src/h5core/{ => private}/h5t_retrieve_trim.c | 18 +- .../h5t_store.h} | 8 +- src/h5core/{ => private}/h5t_store_tetm.c | 20 +- src/h5core/{ => private}/h5t_store_trim.c | 20 +- .../h5t_tags.h} | 6 +- .../h5t_types.h} | 18 +- .../h5u_errorhandling.h} | 4 +- .../h5u_io.h} | 6 +- .../h5u_types.h} | 6 +- src/include/H5Block_attribs.h | 3 +- src/include/H5Block_io.h | 215 +++++------------ src/include/H5Block_model.h | 131 +++++++++- src/include/H5Fed_adjacency.h | 2 +- src/include/H5Fed_model.h | 2 +- src/include/H5Fed_retrieve.h | 2 +- src/include/H5Fed_store.h | 2 +- src/include/H5Fed_tags.h | 2 +- src/include/H5Part_io.h | 186 +------------- src/include/H5Part_model.h | 188 ++++++++++++++- src/include/H5_attachments.h | 155 ++++++++++++ src/include/H5_debug.h | 3 +- src/include/H5_error.h | 3 +- src/include/H5_file.h | 6 +- src/include/H5_file_attribs.h | 5 +- src/include/H5_model.h | 181 +------------- src/include/H5_step_attribs.h | 5 +- src/include/H5hut.h | 2 +- src/include/h5core/Makefile.am | 7 +- src/include/h5core/h5_attachments.h | 56 +++++ src/include/h5core/h5_debug.h | 227 ++++++++++++++++++ src/include/h5core/h5_errorhandling.h | 222 ----------------- src/include/h5core/{h5.h => h5_file.h} | 62 +---- .../{h5_attribs.h => h5_file_attribs.h} | 30 +-- src/include/h5core/h5_init.h | 40 +++ src/include/h5core/h5_model.h | 47 ++-- src/include/h5core/h5_step_attribs.h | 49 ++++ src/include/h5core/h5_syscall.h | 1 - src/include/h5core/h5_types.h | 1 - src/include/h5core/h5b_attribs.h | 23 +- src/include/h5core/h5b_io.h | 1 + src/include/h5core/h5b_model.h | 44 ++-- src/include/h5core/h5u_io.h | 1 + src/include/h5core/h5u_model.h | 48 ++-- 125 files changed, 1840 insertions(+), 1744 deletions(-) rename src/h5core/{h5_attach.c => h5_attachments.c} (96%) delete mode 100644 src/h5core/h5_attribs_private.h create mode 100644 src/h5core/h5_debug.c rename src/h5core/{h5_openclose.c => h5_file.c} (98%) delete mode 100644 src/h5core/h5_private.h delete mode 100644 src/h5core/h5_syscall.c delete mode 100644 src/h5core/h5_syscall_private.h rename src/h5core/{h5b_readwrite.c => h5b_io.c} (97%) rename src/h5core/{h5t_readwrite.c => h5t_io.c} (99%) rename src/h5core/{h5u_readwrite.c => h5u_io.c} (95%) create mode 100644 src/h5core/private/h5.h create mode 100644 src/h5core/private/h5_attribs.h rename src/h5core/{h5_debug_private.h => private/h5_debug.h} (93%) rename src/h5core/{h5_errorhandling_private.h => private/h5_errorhandling.h} (92%) rename src/h5core/{ => private}/h5_fcmp.c (94%) rename src/h5core/{h5_fcmp_private.h => private/h5_fcmp.h} (77%) rename src/h5core/{ => private}/h5_hdf5.c (99%) rename src/h5core/{h5_hdf5_private.h => private/h5_hdf5.h} (99%) rename src/h5core/{ => private}/h5_hsearch.c (98%) rename src/h5core/{h5_hsearch_private.h => private/h5_hsearch.h} (92%) rename src/h5core/{h5_init_private.h => private/h5_init.h} (74%) rename src/h5core/{h5_readwrite.c => private/h5_io.c} (94%) rename src/h5core/{h5_readwrite_private.h => private/h5_io.h} (58%) rename src/h5core/{ => private}/h5_lustre.c (98%) rename src/h5core/{h5_lustre_private.h => private/h5_lustre.h} (75%) rename src/h5core/{ => private}/h5_maps.c (97%) rename src/h5core/{h5_maps_private.h => private/h5_maps.h} (98%) rename src/h5core/{h5_model_private.h => private/h5_model.h} (92%) rename src/h5core/{h5_mpi_private.h => private/h5_mpi.h} (98%) rename src/h5core/{ => private}/h5_qsort.c (99%) rename src/h5core/{h5_qsort_private.h => private/h5_qsort.h} (83%) rename src/h5core/{ => private}/h5_qsort_r.c (100%) rename src/h5core/{h5_types_private.h => private/h5_types.h} (95%) rename src/h5core/{ => private}/h5_va_macros.h (92%) rename src/h5core/{h5b_readwrite_private.h => private/h5b_io.h} (76%) rename src/h5core/{h5b_model_private.h => private/h5b_model.h} (88%) rename src/h5core/{h5b_types_private.h => private/h5b_types.h} (91%) rename src/h5core/{h5t_access_private.h => private/h5t_access.h} (98%) rename src/h5core/{ => private}/h5t_access_tetm.c (98%) rename src/h5core/{ => private}/h5t_access_trim.c (97%) rename src/h5core/{h5t_adjacencies_private.h => private/h5t_adjacencies.h} (85%) rename src/h5core/{ => private}/h5t_adjacencies_tetm.c (98%) rename src/h5core/{ => private}/h5t_adjacencies_trim.c (98%) rename src/h5core/{ => private}/h5t_core.c (98%) rename src/h5core/{h5t_core_private.h => private/h5t_core.h} (84%) rename src/h5core/{ => private}/h5t_core_tetm.c (98%) rename src/h5core/{ => private}/h5t_core_trim.c (98%) rename src/h5core/{h5t_errorhandling_private.h => private/h5t_errorhandling.h} (90%) rename src/h5core/{h5t_readwrite_private.h => private/h5t_io.h} (95%) rename src/h5core/{h5t_readwrite_tetm.c => private/h5t_io_tetm.c} (96%) rename src/h5core/{h5t_readwrite_trim.c => private/h5t_io_trim.c} (97%) rename src/h5core/{h5t_map_private.h => private/h5t_map.h} (95%) rename src/h5core/{h5t_model_private.h => private/h5t_model.h} (95%) rename src/h5core/{ => private}/h5t_model_tetm.c (93%) rename src/h5core/{ => private}/h5t_model_trim.c (93%) rename src/h5core/{h5t_octree_private.h => private/h5t_octree.h} (97%) rename src/h5core/{ => private}/h5t_ref_elements.c (97%) rename src/h5core/{h5t_ref_elements_private.h => private/h5t_ref_elements.h} (94%) rename src/h5core/{h5t_retrieve_private.h => private/h5t_retrieve.h} (83%) rename src/h5core/{ => private}/h5t_retrieve_tetm.c (73%) rename src/h5core/{ => private}/h5t_retrieve_trim.c (72%) rename src/h5core/{h5t_store_private.h => private/h5t_store.h} (94%) rename src/h5core/{ => private}/h5t_store_tetm.c (97%) rename src/h5core/{ => private}/h5t_store_trim.c (96%) rename src/h5core/{h5t_tags_private.h => private/h5t_tags.h} (95%) rename src/h5core/{h5t_types_private.h => private/h5t_types.h} (96%) rename src/h5core/{h5u_errorhandling_private.h => private/h5u_errorhandling.h} (89%) rename src/h5core/{h5u_readwrite_private.h => private/h5u_io.h} (76%) rename src/h5core/{h5u_types_private.h => private/h5u_types.h} (84%) create mode 100644 src/include/H5_attachments.h create mode 100644 src/include/h5core/h5_attachments.h rename src/include/h5core/{h5.h => h5_file.h} (62%) rename src/include/h5core/{h5_attribs.h => h5_file_attribs.h} (62%) create mode 100644 src/include/h5core/h5_init.h create mode 100644 src/include/h5core/h5_step_attribs.h diff --git a/src/C/Makefile.am b/src/C/Makefile.am index cba6479..964a92c 100644 --- a/src/C/Makefile.am +++ b/src/C/Makefile.am @@ -1,6 +1,5 @@ if ENABLE_C -# Header files that I wish to install in $(prefix)/include include_HEADERS = \ $(top_srcdir)/src/include/H5Block_attribs.h \ $(top_srcdir)/src/include/H5Block_io.h \ @@ -12,6 +11,7 @@ include_HEADERS = \ $(top_srcdir)/src/include/H5Fed_tags.h \ $(top_srcdir)/src/include/H5Part_io.h \ $(top_srcdir)/src/include/H5Part_model.h \ + $(top_srcdir)/src/include/H5_attachments.h \ $(top_srcdir)/src/include/H5_debug.h \ $(top_srcdir)/src/include/H5_error.h \ $(top_srcdir)/src/include/H5_file.h \ @@ -21,7 +21,6 @@ include_HEADERS = \ $(top_srcdir)/src/include/H5_step_attribs.h \ $(top_srcdir)/src/include/H5hut.h -# Listing of all possible headers that I may include EXTRA_HEADERS = endif diff --git a/src/Fortran/H5.c b/src/Fortran/H5.c index 0b5974a..d8a7660 100644 --- a/src/Fortran/H5.c +++ b/src/Fortran/H5.c @@ -9,9 +9,11 @@ #include "h5_private.h" -#include "h5core/h5.h" +#include "h5core/h5_init.h" #include "h5core/h5_debug.h" -#include "h5core/h5_model.h" +#include "h5core/h5_file.h" + +#include #define h5_createprop_file FC_MANGLING( \ h5_createprop_file, \ diff --git a/src/Fortran/H5Block_model.c b/src/Fortran/H5Block_model.c index 1e8ee27..320bfe3 100755 --- a/src/Fortran/H5Block_model.c +++ b/src/Fortran/H5Block_model.c @@ -10,6 +10,7 @@ #include "h5_private.h" #include "h5core/h5_debug.h" #include "h5core/h5b_model.h" +#include "h5core/h5b_io.h" #define h5bl_hasfielddata FC_MANGLING ( \ h5bl_hasfielddata, \ diff --git a/src/Fortran/H5Part_model.c b/src/Fortran/H5Part_model.c index 3e89745..e556a4c 100755 --- a/src/Fortran/H5Part_model.c +++ b/src/Fortran/H5Part_model.c @@ -10,6 +10,7 @@ #include "h5_private.h" #include "h5core/h5_debug.h" #include "h5core/h5u_model.h" +#include "h5core/h5u_io.h" #include "h5core/h5_syscall.h" diff --git a/src/Fortran/H5_attribs.c b/src/Fortran/H5_attribs.c index 3c4fcc8..34984af 100644 --- a/src/Fortran/H5_attribs.c +++ b/src/Fortran/H5_attribs.c @@ -10,7 +10,8 @@ #include "h5_private.h" #include "h5core/h5_debug.h" -#include "h5core/h5_attribs.h" +#include "h5core/h5_file_attribs.h" +#include "h5core/h5_step_attribs.h" /* __ _ _ _ _ _ _ _ diff --git a/src/Fortran/H5_model.c b/src/Fortran/H5_model.c index caaa487..f17f327 100644 --- a/src/Fortran/H5_model.c +++ b/src/Fortran/H5_model.c @@ -9,7 +9,7 @@ #include "h5_private.h" -#include "h5core/h5.h" +#include "h5core/h5_init.h" #include "h5core/h5_debug.h" #include "h5core/h5_model.h" diff --git a/src/Fortran/h5_private.h b/src/Fortran/h5_private.h index 95331b1..9807593 100644 --- a/src/Fortran/h5_private.h +++ b/src/Fortran/h5_private.h @@ -13,7 +13,7 @@ #include #include -#include "h5core/h5.h" +#include "h5core/h5_init.h" #if defined(FC_MANGLING_LOWERCASE_NO_UNDERSCORE) # define FC_MANGLING(a,b) a diff --git a/src/h5core/Makefile.am b/src/h5core/Makefile.am index 7db5297..bab64d2 100644 --- a/src/h5core/Makefile.am +++ b/src/h5core/Makefile.am @@ -1,42 +1,42 @@ +AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir)/src/include @AM_CPPFLAGS@ EXTRA_HEADERS = \ - h5_attribs_private.h \ - h5_debug_private.h \ - h5_errorhandling_private.h \ - h5_fcmp_private.h \ - h5_hdf5_private.h \ - h5_hsearch_private.h \ - h5_init_private.h \ - h5_lustre_private.h \ - h5_maps_private.h \ - h5_model_private.h \ - h5_mpi_private.h \ - h5_private.h \ - h5_qsort_private.h \ - h5_readwrite_private.h \ - h5_syscall_private.h \ - h5_types_private.h \ - h5_va_macros.h \ - h5b_model_private.h \ - h5b_readwrite_private.h \ - h5b_types_private.h \ - h5t_access_private.h \ - h5t_adjacencies_private.h \ - h5t_core_private.h \ - h5t_errorhandling_private.h \ - h5t_map_private.h \ - h5t_model_private.h \ - h5t_octree_private.h \ - h5t_readwrite_private.h \ - h5t_ref_elements_private.h \ - h5t_retrieve_private.h \ - h5t_store_private.h \ - h5t_tags_private.h \ - h5t_types_private.h \ - h5u_readwrite_private.h \ - h5u_types_private.h + private/h5_hdf5.h \ + private/h5_hsearch.h \ + private/h5_init.h \ + private/h5_lustre.h \ + private/h5_maps.h \ + private/h5_model.h \ + private/h5_mpi.h \ + private/h5.h \ + private/h5_qsort.h \ + private/h5_io.h \ + private/h5_types.h \ + private/h5_va_macros.h \ + private/h5b_model.h \ + private/h5b_io.h \ + private/h5b_types.h \ + private/h5t_access.h \ + private/h5t_adjacencies.h \ + private/h5t_core.h \ + private/h5t_errorhandling.h \ + private/h5t_map.h \ + private/h5t_model.h \ + private/h5t_octree.h \ + private/h5t_io.h \ + private/h5t_ref_elements.h \ + private/h5t_retrieve.h \ + private/h5t_store.h \ + private/h5t_tags.h \ + private/h5t_types.h \ + private/h5u_io.h \ + private/h5u_types.h \ + private/h5_attribs.h \ + private/h5_debug.h \ + private/h5_errorhandling.h \ + private/h5_fcmp.h # Extra files that I wish to include in the dist tar ball. EXTRA_DIST = $(EXTRA_HEADERS) @@ -46,53 +46,53 @@ lib_LTLIBRARIES = libH5hut.la # Listing of sources libH5hut_la_SOURCES = \ - h5_attach.c \ + h5_attachments.c \ h5_attribs.c \ + h5_debug.c \ h5_errorhandling.c \ - h5_fcmp.c \ h5_init.c \ - h5_hdf5.c \ - h5_hsearch.c \ - h5_maps.c \ h5_model.c \ - h5_openclose.c \ - h5_qsort.c \ - h5_qsort_r.c \ - h5_readwrite.c \ - h5_syscall.c \ - h5_lustre.c \ - h5u_readwrite.c \ - h5b_readwrite.c \ + h5_file.c \ + h5u_io.c \ + h5b_io.c \ h5u_model.c \ h5b_model.c \ - h5b_attribs.c + h5b_attribs.c \ + private/h5_hdf5.c \ + private/h5_hsearch.c \ + private/h5_maps.c \ + private/h5_fcmp.c \ + private/h5_qsort.c \ + private/h5_qsort_r.c \ + private/h5_io.c \ + private/h5_lustre.c # grid stuff libH5hut_la_SOURCES += \ - h5t_access_tetm.c \ - h5t_access_trim.c \ h5t_adjacencies.c \ - h5t_adjacencies_tetm.c \ - h5t_adjacencies_trim.c \ - h5t_core.c \ - h5t_core_trim.c \ - h5t_core_tetm.c \ h5t_map.c \ h5t_model.c \ - h5t_model_tetm.c \ - h5t_model_trim.c \ h5t_octree.c \ - h5t_readwrite.c \ - h5t_readwrite_trim.c \ - h5t_readwrite_tetm.c \ - h5t_ref_elements.c \ + h5t_io.c \ h5t_retrieve.c \ - h5t_retrieve_tetm.c \ - h5t_retrieve_trim.c \ h5t_store.c \ - h5t_store_tetm.c \ - h5t_store_trim.c \ - h5t_tags.c + h5t_tags.c \ + private/h5t_core.c \ + private/h5t_core_trim.c \ + private/h5t_core_tetm.c \ + private/h5t_access_tetm.c \ + private/h5t_access_trim.c \ + private/h5t_adjacencies_tetm.c \ + private/h5t_adjacencies_trim.c \ + private/h5t_model_tetm.c \ + private/h5t_model_trim.c \ + private/h5t_retrieve_tetm.c \ + private/h5t_retrieve_trim.c \ + private/h5t_io_trim.c \ + private/h5t_io_tetm.c \ + private/h5t_ref_elements.c \ + private/h5t_store_tetm.c \ + private/h5t_store_trim.c libH5hut_la_DEPENDENCIES = $(EXTRA_HEADERS) diff --git a/src/h5core/h5_attach.c b/src/h5core/h5_attachments.c similarity index 96% rename from src/h5core/h5_attach.c rename to src/h5core/h5_attachments.c index 4beb3fb..c4b4961 100644 --- a/src/h5core/h5_attach.c +++ b/src/h5core/h5_attachments.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,14 +7,14 @@ License: see file COPYING in top level of source distribution. */ -#include "h5core/h5.h" -#include "h5_types_private.h" +#include "h5core/h5_init.h" +#include "private/h5_types.h" -#include "h5_errorhandling_private.h" -#include "h5_hdf5_private.h" -#include "h5_model_private.h" +#include "private/h5_errorhandling.h" +#include "private/h5_hdf5.h" +#include "private/h5_model.h" #include "h5core/h5_syscall.h" -#include "h5_va_macros.h" +#include "private/h5_va_macros.h" #include #include diff --git a/src/h5core/h5_attribs.c b/src/h5core/h5_attribs.c index a35ba20..7f78b38 100644 --- a/src/h5core/h5_attribs.c +++ b/src/h5core/h5_attribs.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,64 +7,16 @@ License: see file COPYING in top level of source distribution. */ -#include "h5core/h5.h" -#include "h5_types_private.h" +#include "h5core/h5_init.h" +#include "h5core/h5_debug.h" -#include "h5_private.h" -#include "h5_readwrite_private.h" -#include "h5_hdf5_private.h" +#include "private/h5_types.h" +#include "private/h5.h" +#include "private/h5_io.h" +#include "private/h5_hdf5.h" +#include "private/h5_attribs.h" -static inline h5_err_t -get_attrib_info ( - hid_t attrib_id, - h5_int64_t* attrib_type, /*!< OUT: H5 type of attribute */ - h5_size_t* attrib_nelem /*!< OUT: number of elements */ - ) { - H5_INLINE_FUNC_ENTER (h5_err_t); - hid_t mytype; - TRY (mytype = hdf5_get_attribute_type (attrib_id)); - - H5T_class_t type_class; - TRY (type_class = hdf5_get_class_type (mytype)); - - if (attrib_nelem) { - if (type_class == H5T_STRING) { - *attrib_nelem = H5Tget_size(mytype); - } else { - hid_t space_id; - TRY (space_id = hdf5_get_attribute_dataspace (attrib_id)); - TRY (*attrib_nelem = hdf5_get_npoints_of_dataspace (space_id)); - TRY (hdf5_close_dataspace (space_id)); - } - } - if (attrib_type) { - TRY (*attrib_type = h5priv_normalize_h5_type (mytype)); - } - TRY (hdf5_close_type (mytype)); - TRY (hdf5_close_attribute (attrib_id)); - H5_INLINE_FUNC_RETURN (H5_SUCCESS); -} - -h5_err_t -h5priv_get_attrib_info_by_name ( - const hid_t id, /*!< IN: HDF5 object ID */ - const char* const attrib_name, /*!< IN: name of attribute */ - h5_int64_t* attrib_type, /*!< OUT: H5 type of attribute */ - h5_size_t* attrib_nelem /*!< OUT: number of elements */ - ) { - H5_PRIV_API_ENTER (h5_err_t, - "id=%lld, " - "attrib_name=%s," - "attrib_type=%p, attrib_nelem=%p", - (long long int)id, - attrib_name, - attrib_type, - attrib_nelem); - hid_t attrib_id; - TRY (attrib_id = hdf5_open_attribute (id, attrib_name)); - H5_PRIV_API_RETURN (get_attrib_info (attrib_id, attrib_type, attrib_nelem)); -} h5_err_t h5priv_get_attrib_info_by_idx ( diff --git a/src/h5core/h5_attribs_private.h b/src/h5core/h5_attribs_private.h deleted file mode 100644 index 7f83185..0000000 --- a/src/h5core/h5_attribs_private.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - Copyright (c) 2006-2015, The Regents of the University of California, - through Lawrence Berkeley National Laboratory (subject to receipt of any - required approvals from the U.S. Dept. of Energy) and the Paul Scherrer - Institut (Switzerland). All rights reserved. - - License: see file COPYING in top level of source distribution. -*/ - -#ifndef __H5_ATTRIBS_PRIVATE_H -#define __H5_ATTRIBS_PRIVATE_H - -#include "h5_types_private.h" - -h5_err_t -h5priv_read_attrib ( - const hid_t id, - const char* attrib_name, - const hid_t attrib_type, - void* const attrib_value - ); - -h5_err_t -h5priv_write_attrib ( - const hid_t id, - const char* attrib_name, - const hid_t attrib_type, - const void* attrib_value, - const hsize_t attrib_nelem, - const int overwrite - ); - -h5_err_t -h5priv_get_attrib_info_by_name ( - const hid_t id, - const char* const attrib_name, - h5_int64_t* attrib_type, - h5_size_t* attrib_nelem - ); - -h5_err_t -h5priv_get_attrib_info_by_idx ( - const hid_t id, - const h5_size_t attrib_idx, - char* attrib_name, - const h5_size_t len_attrib_name, - h5_int64_t* attrib_type, - h5_size_t* attrib_nelem - ); -#endif diff --git a/src/h5core/h5_debug.c b/src/h5core/h5_debug.c new file mode 100644 index 0000000..6856d3f --- /dev/null +++ b/src/h5core/h5_debug.c @@ -0,0 +1,79 @@ +/* + Copyright (c) 2006-2016, The Regents of the University of California, + through Lawrence Berkeley National Laboratory (subject to receipt of any + required approvals from the U.S. Dept. of Energy) and the Paul Scherrer + Institut (Switzerland). All rights reserved. + + License: see file COPYING in top level of source distribution. +*/ + +#include "h5core/h5_init.h" +#include "private/h5_init.h" + +h5_int32_t h5_debug_level = H5_VERBOSE_ERROR; +struct call_stack h5_call_stack; + +char *h5_rfmts[] = { + [e_int] "%d", + [e_ssize_t] "%ld", + [e_char_p] "%s", + [e_void_p] "%p", + [e_h5_err_t] "%lld", + [e_h5_int64_t] "%lld", + [e_h5_id_t] "%lld", + [e_h5_ssize_t] "%lld", + [e_h5_errorhandler_t] "%p", + [e_h5_file_p] "%p", + [e_h5_file_t] "0x%08x", + [e_h5_lvl_idx_t] "%d", + [e_h5t_iterator_p] "%p", + [e_h5_loc_id_t] "%ld", + [e_h5_loc_idx_t] "%ld", + [e_hid_t] "%lld", + [e_H5O_type_t] "%ld", + [e_h5_glb_elem_p] "%p", + [e_h5_prop_p] "%p", + [e_h5_prop_t] "0x%08x", + [e_h5_prop_file_p] "%p", + [e_h5_prop_file_t] "0x%08x", + [e_herr_t] "%ld" +}; + +/*! + \ingroup h5_core_errorhandling + + Set debug/verbosity level. On level 0 all output will be supressed (even + error messages). On level 1 error messages, on level 2 warning messages + and on level 3 informational messages will be printed. On level 4 debug + messages will be printed. + + Values less than 0 are equivalent to 0. Values greater than 4 are equivalent + to 4. + + \return \c H5_SUCCESS on success. + \return \c H5_ERR_INVAL if debug level is invalid. + */ +h5_err_t +h5_set_debuglevel ( + const h5_id_t level /*!< debug level */ + ) { + if (level < 0) + h5_debug_level = ((1 << 20) - 1) & ~0x7; + else + h5_debug_level = level; + return H5_SUCCESS; +} + +/*! + \ingroup h5_core_errorhandling + + Get current debug/verbosity level. + + \return current debug level + */ +h5_err_t +h5_get_debuglevel ( + void + ) { + return h5_debug_level; +} diff --git a/src/h5core/h5_errorhandling.c b/src/h5core/h5_errorhandling.c index 802b9f8..36a11b5 100644 --- a/src/h5core/h5_errorhandling.c +++ b/src/h5core/h5_errorhandling.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,39 +7,11 @@ License: see file COPYING in top level of source distribution. */ -#include "h5core/h5.h" -#include "h5_init_private.h" +#include "h5core/h5_init.h" +#include "private/h5_init.h" static h5_errorhandler_t h5_errhandler = h5_report_errorhandler; h5_err_t h5_errno; -h5_int32_t h5_debug_level = H5_VERBOSE_ERROR; -struct call_stack h5_call_stack; - -char *h5_rfmts[] = { - [e_int] "%d", - [e_ssize_t] "%ld", - [e_char_p] "%s", - [e_void_p] "%p", - [e_h5_err_t] "%lld", - [e_h5_int64_t] "%lld", - [e_h5_id_t] "%lld", - [e_h5_ssize_t] "%lld", - [e_h5_errorhandler_t] "%p", - [e_h5_file_p] "%p", - [e_h5_file_t] "0x%08x", - [e_h5_lvl_idx_t] "%d", - [e_h5t_iterator_p] "%p", - [e_h5_loc_id_t] "%ld", - [e_h5_loc_idx_t] "%ld", - [e_hid_t] "%lld", - [e_H5O_type_t] "%ld", - [e_h5_glb_elem_p] "%p", - [e_h5_prop_p] "%p", - [e_h5_prop_t] "0x%08x", - [e_h5_prop_file_p] "%p", - [e_h5_prop_file_t] "0x%08x", - [e_herr_t] "%ld" -}; /*! \ingroup h5_core @@ -59,45 +31,6 @@ const char* const H5_O_MODES[] = { "H5_O_APPENDONLY" }; -/*! - \ingroup h5_core_errorhandling - - Set debug/verbosity level. On level 0 all output will be supressed (even - error messages). On level 1 error messages, on level 2 warning messages - and on level 3 informational messages will be printed. On level 4 debug - messages will be printed. - - Values less than 0 are equivalent to 0. Values greater than 4 are equivalent - to 4. - - \return \c H5_SUCCESS on success. - \return \c H5_ERR_INVAL if debug level is invalid. - */ -h5_err_t -h5_set_debuglevel ( - const h5_id_t level /*!< debug level */ - ) { - if (level < 0) - h5_debug_level = ((1 << 20) - 1) & ~0x7; - else - h5_debug_level = level; - return H5_SUCCESS; -} - -/*! - \ingroup h5_core_errorhandling - - Get current debug/verbosity level. - - \return current debug level - */ -h5_err_t -h5_get_debuglevel ( - void - ) { - return h5_debug_level; -} - /*! \ingroup h5_core_errorhandling diff --git a/src/h5core/h5_openclose.c b/src/h5core/h5_file.c similarity index 98% rename from src/h5core/h5_openclose.c rename to src/h5core/h5_file.c index 0e0f0e5..5c9a53e 100644 --- a/src/h5core/h5_openclose.c +++ b/src/h5core/h5_file.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -11,15 +11,16 @@ #include #include -#include "h5core/h5.h" +#include "h5core/h5_init.h" +#include "h5core/h5_debug.h" -#include "h5_private.h" -#include "h5_hdf5_private.h" +#include "private/h5.h" +#include "private/h5_hdf5.h" -#include "h5_model_private.h" -#include "h5_mpi_private.h" -#include "h5u_readwrite_private.h" -#include "h5b_readwrite_private.h" +#include "private/h5_model.h" +#include "private/h5_mpi.h" +#include "private/h5u_io.h" +#include "private/h5b_io.h" #include "h5core/h5_errorhandling.h" #include "h5core/h5_syscall.h" @@ -49,6 +50,15 @@ h5_check_filehandle ( return H5_SUCCESS; } +hid_t +h5_get_hdf5_file( + const h5_file_t f_ /*!< file handle */ + ) { + h5_file_p f = (h5_file_p)f_; + H5_CORE_API_ENTER (hid_t, "f=%p", f); + H5_CORE_API_RETURN (f->file); +} + /*! Initialize H5Part */ @@ -680,22 +690,6 @@ h5_get_num_procs ( H5_CORE_API_RETURN (f->nprocs); } -/*! - \ingroup h5_core_filehandling - - Provides access to the underlying HDF5 file handle. - - \return Number of steps or error code -*/ -hid_t -h5_get_hdf5_file( - const h5_file_t f_ /*!< file handle */ - ) { - h5_file_p f = (h5_file_p)f_; - H5_CORE_API_ENTER (hid_t, "f=%p", f); - H5_CORE_API_RETURN (f->file); -} - /*! \ingroup h5_core_filehandling diff --git a/src/h5core/h5_init.c b/src/h5core/h5_init.c index bad9934..e964cd0 100644 --- a/src/h5core/h5_init.c +++ b/src/h5core/h5_init.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -14,12 +14,12 @@ #include "config.h" -#include "h5core/h5.h" -#include "h5_hdf5_private.h" +#include "h5core/h5_init.h" +#include "private/h5_hdf5.h" -#include "h5_mpi_private.h" -#include "h5t_types_private.h" -#include "h5t_tags_private.h" +#include "private/h5_mpi.h" +#include "private/h5t_types.h" +#include "private/h5t_tags.h" diff --git a/src/h5core/h5_model.c b/src/h5core/h5_model.c index dc96178..e92df82 100644 --- a/src/h5core/h5_model.c +++ b/src/h5core/h5_model.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -9,13 +9,13 @@ #include -#include "h5core/h5.h" -#include "h5_types_private.h" -#include "h5_hdf5_private.h" -#include "h5_model_private.h" -#include "h5_mpi_private.h" -#include "h5_readwrite_private.h" -#include "h5_va_macros.h" +#include "h5core/h5_init.h" +#include "private/h5_types.h" +#include "private/h5_hdf5.h" +#include "private/h5_model.h" +#include "private/h5_mpi.h" +#include "private/h5_io.h" +#include "private/h5_va_macros.h" h5_err_t h5priv_close_step ( diff --git a/src/h5core/h5_private.h b/src/h5core/h5_private.h deleted file mode 100644 index b5736ac..0000000 --- a/src/h5core/h5_private.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef __H5_PRIVATE_H -#define __H5_PRIVATE_H - -#include "h5_types_private.h" -#include "h5_errorhandling_private.h" - -#define UNUSED_ARGUMENT(x) (void)x - -static inline h5_err_t -check_filehandle ( - const h5_file_p f - ) { - if (f == NULL || f->file < 0 || f->u == NULL || f->b == NULL) { - return h5_error ( - H5_ERR_BADF, - "Called with bad filehandle."); - } - return H5_SUCCESS; -} - -#define CHECK_FILEHANDLE(f) \ - TRY (check_filehandle (f)); - -#endif diff --git a/src/h5core/h5_syscall.c b/src/h5core/h5_syscall.c deleted file mode 100644 index 453de93..0000000 --- a/src/h5core/h5_syscall.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - Copyright (c) 2006-2015, The Regents of the University of California, - through Lawrence Berkeley National Laboratory (subject to receipt of any - required approvals from the U.S. Dept. of Energy) and the Paul Scherrer - Institut (Switzerland). All rights reserved. - - License: see file COPYING in top level of source distribution. -*/ - -#include - -#include "h5core/h5_types.h" -#include "h5core/h5_errorhandling.h" - -void* -h5priv_tsearch ( - const void* key, - void** rootp, - int (*compar)(const void* key1, const void* key2) - ) { - void* ptr = tsearch (key, rootp, compar); - if (ptr == NULL) { - h5_error (H5_ERR_NOMEM, "Out of memory."); - return (void*)(H5_ERR); - } - return ptr; -} - -void* -h5priv_tfind ( - const void* key, - void* const* rootp, - int (*compar)(const void* key1, const void* key2) - ) { - void* ptr = tfind (key, rootp, compar); - if (ptr == NULL) { - return (void*)(H5_ERR); - } - return ptr; -} - - diff --git a/src/h5core/h5_syscall_private.h b/src/h5core/h5_syscall_private.h deleted file mode 100644 index 87ff150..0000000 --- a/src/h5core/h5_syscall_private.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - Copyright (c) 2006-2015, The Regents of the University of California, - through Lawrence Berkeley National Laboratory (subject to receipt of any - required approvals from the U.S. Dept. of Energy) and the Paul Scherrer - Institut (Switzerland). All rights reserved. - - License: see file COPYING in top level of source distribution. -*/ - -#ifndef __H5_SYSCALL_PRIVATE_H -#define __H5_SYSCALL_PRIVATE_H - -#include "h5core/h5_types.h" - -void* -h5priv_tsearch ( - const void* key, - void** rootp, - int (*compar)(const void* key1, const void* key2) - ); - -void* -h5priv_tfind ( - const void* key, - void *const* rootp, - int (*compar)(const void* key1, const void* key2) - ); -#endif diff --git a/src/h5core/h5b_attribs.c b/src/h5core/h5b_attribs.c index 2a1976e..3c4f94b 100644 --- a/src/h5core/h5b_attribs.c +++ b/src/h5core/h5b_attribs.c @@ -1,23 +1,22 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. License: see file COPYING in top level of source distribution. */ -#include "h5core/h5.h" +#include "h5core/h5_init.h" -#include "h5_debug_private.h" -#include "h5_va_macros.h" +#include "private/h5_debug.h" -#include "h5_private.h" -#include "h5_hdf5_private.h" +#include "private/h5.h" +#include "private/h5_hdf5.h" + +#include "private/h5_attribs.h" +#include "private/h5b_types.h" +#include "private/h5b_model.h" -#include "h5_attribs_private.h" -#include "h5_readwrite_private.h" -#include "h5b_types_private.h" -#include "h5b_model_private.h" h5_err_t h5b_write_field_attrib ( const h5_file_t fh, /*!< IN: file handle */ diff --git a/src/h5core/h5b_readwrite.c b/src/h5core/h5b_io.c similarity index 97% rename from src/h5core/h5b_readwrite.c rename to src/h5core/h5b_io.c index d1392b9..3c04833 100644 --- a/src/h5core/h5b_readwrite.c +++ b/src/h5core/h5b_io.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,15 +7,15 @@ License: see file COPYING in top level of source distribution. */ -#include "h5core/h5.h" -#include "h5_types_private.h" -#include "h5_hdf5_private.h" +#include "h5core/h5_init.h" +#include "private/h5_types.h" +#include "private/h5_hdf5.h" -#include "h5_model_private.h" -#include "h5_mpi_private.h" -#include "h5_readwrite_private.h" -#include "h5b_types_private.h" -#include "h5b_model_private.h" +#include "private/h5_model.h" +#include "private/h5_mpi.h" +#include "private/h5_io.h" +#include "private/h5b_types.h" +#include "private/h5b_model.h" #include "h5core/h5_syscall.h" diff --git a/src/h5core/h5b_model.c b/src/h5core/h5b_model.c index 2140275..615e2cf 100644 --- a/src/h5core/h5b_model.c +++ b/src/h5core/h5b_model.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -10,15 +10,17 @@ #include #include -#include "h5_private.h" -#include "h5_hdf5_private.h" - -#include "h5_model_private.h" -#include "h5_mpi_private.h" -#include "h5_readwrite_private.h" -#include "h5b_types_private.h" +#include "h5core/h5_init.h" #include "h5core/h5_syscall.h" +#include "private/h5.h" +#include "private/h5_hdf5.h" + +#include "private/h5_model.h" +#include "private/h5_mpi.h" +#include "private/h5_io.h" +#include "private/h5b_types.h" + #define MIN( x, y ) ( (x) <= (y) ? (x) : (y) ) #define MAX( x, y ) ( (x) >= (y) ? (x) : (y) ) diff --git a/src/h5core/h5t_adjacencies.c b/src/h5core/h5t_adjacencies.c index fe730c1..6c4653b 100644 --- a/src/h5core/h5t_adjacencies.c +++ b/src/h5core/h5t_adjacencies.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,12 +7,14 @@ License: see file COPYING in top level of source distribution. */ -#include "h5core/h5.h" -#include "h5_private.h" -#include "h5t_types_private.h" -#include "h5t_adjacencies_private.h" -#include "h5t_map_private.h" -#include "h5t_core_private.h" +#include "h5core/h5_init.h" +#include "h5core/h5_debug.h" + +#include "private/h5.h" +#include "private/h5t_types.h" +#include "private/h5t_adjacencies.h" +#include "private/h5t_map.h" +#include "private/h5t_core.h" #include diff --git a/src/h5core/h5t_readwrite.c b/src/h5core/h5t_io.c similarity index 99% rename from src/h5core/h5t_readwrite.c rename to src/h5core/h5t_io.c index d555bb5..73c2fa9 100644 --- a/src/h5core/h5t_readwrite.c +++ b/src/h5core/h5t_io.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,8 +7,8 @@ License: see file COPYING in top level of source distribution. */ -#include "h5core/h5.h" -#include "h5_types_private.h" +#include "h5core/h5_init.h" +#include "private/h5_types.h" #include #include // for the use of sleep @@ -17,13 +17,13 @@ #include #endif -#include "h5_attribs_private.h" -#include "h5_hdf5_private.h" +#include "private/h5_attribs.h" +#include "private/h5_hdf5.h" -#include "h5_model_private.h" -#include "h5t_types_private.h" -#include "h5t_access_private.h" -#include "h5t_core_private.h" +#include "private/h5_model.h" +#include "private/h5t_types.h" +#include "private/h5t_access.h" +#include "private/h5t_core.h" #include "h5core/h5t_map.h" int preferred_direction = 0; @@ -37,15 +37,15 @@ int dont_use_parmetis = 0; // 2 distribute geometrically with preferred direction -#include "h5core/h5.h" -#include "h5t_types_private.h" -#include "h5t_model_private.h" -#include "h5t_map_private.h" -#include "h5t_adjacencies_private.h" -#include "h5t_readwrite_private.h" -#include "h5t_store_private.h" -#include "h5t_core_private.h" -#include "h5_mpi_private.h" +#include "h5core/h5_init.h" +#include "private/h5t_types.h" +#include "private/h5t_model.h" +#include "private/h5t_map.h" +#include "private/h5t_adjacencies.h" +#include "private/h5t_io.h" +#include "private/h5t_store.h" +#include "private/h5t_core.h" +#include "private/h5_mpi.h" #include diff --git a/src/h5core/h5t_map.c b/src/h5core/h5t_map.c index 497bd6e..12793ef 100644 --- a/src/h5core/h5t_map.c +++ b/src/h5core/h5t_map.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,15 +7,15 @@ License: see file COPYING in top level of source distribution. */ -#include "h5_fcmp_private.h" -#include "h5_hdf5_private.h" +#include "private/h5_fcmp.h" +#include "private/h5_hdf5.h" -#include "h5t_types_private.h" -#include "h5t_access_private.h" -#include "h5t_map_private.h" +#include "private/h5t_types.h" +#include "private/h5t_access.h" +#include "private/h5t_map.h" #include "h5core/h5t_map.h" -#include "h5t_model_private.h" -#include "h5_mpi_private.h" +#include "private/h5t_model.h" +#include "private/h5_mpi.h" /* Mapping of global to local id's: diff --git a/src/h5core/h5t_model.c b/src/h5core/h5t_model.c index 28df658..557b431 100644 --- a/src/h5core/h5t_model.c +++ b/src/h5core/h5t_model.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,26 +7,28 @@ License: see file COPYING in top level of source distribution. */ -#include "h5core/h5.h" -#include "h5_private.h" -#include "h5_mpi_private.h" -#include "h5_errorhandling_private.h" +#include "h5core/h5_init.h" +#include "h5core/h5_debug.h" -#include "h5_attribs_private.h" -#include "h5_hdf5_private.h" +#include "private/h5.h" +#include "private/h5_mpi.h" +#include "private/h5_errorhandling.h" -#include "h5t_types_private.h" -#include "h5t_errorhandling_private.h" -#include "h5t_model_private.h" -#include "h5t_adjacencies_private.h" -#include "h5t_readwrite_private.h" -#include "h5t_tags_private.h" +#include "private/h5_attribs.h" +#include "private/h5_hdf5.h" -#include "h5_init_private.h" +#include "private/h5t_types.h" +#include "private/h5t_errorhandling.h" +#include "private/h5t_model.h" +#include "private/h5t_adjacencies.h" +#include "private/h5t_io.h" +#include "private/h5t_tags.h" + +#include "private/h5_init.h" #include "h5core/h5_model.h" -#include "h5t_core_private.h" -#include "h5t_store_private.h" +#include "private/h5t_core.h" +#include "private/h5t_store.h" #include #include diff --git a/src/h5core/h5t_octree.c b/src/h5core/h5t_octree.c index 21e11d9..019990b 100644 --- a/src/h5core/h5t_octree.c +++ b/src/h5core/h5t_octree.c @@ -1,5 +1,5 @@ -#include "h5t_octree_private.h" -#include "h5t_core_private.h" +#include "private/h5t_octree.h" +#include "private/h5t_core.h" #ifdef WITH_PARALLEL_H5GRID @@ -7,7 +7,7 @@ #include #include -#include "h5_mpi_private.h" +#include "private/h5_mpi.h" static h5_err_t get_bounding_box_of_octant ( diff --git a/src/h5core/h5t_retrieve.c b/src/h5core/h5t_retrieve.c index 0bb0a7c..6a2d228 100644 --- a/src/h5core/h5t_retrieve.c +++ b/src/h5core/h5t_retrieve.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,16 +7,18 @@ License: see file COPYING in top level of source distribution. */ -#include "h5core/h5.h" -#include "h5_private.h" +#include "h5core/h5_init.h" +#include "h5core/h5_debug.h" -#include "h5t_types_private.h" -#include "h5t_errorhandling_private.h" -#include "h5t_map_private.h" -#include "h5t_model_private.h" -#include "h5t_access_private.h" -#include "h5t_tags_private.h" -#include "h5t_retrieve_private.h" +#include "private/h5.h" + +#include "private/h5t_types.h" +#include "private/h5t_errorhandling.h" +#include "private/h5t_map.h" +#include "private/h5t_model.h" +#include "private/h5t_access.h" +#include "private/h5t_tags.h" +#include "private/h5t_retrieve.h" #include "h5core/h5t_map.h" diff --git a/src/h5core/h5t_store.c b/src/h5core/h5t_store.c index f091df5..5df6248 100644 --- a/src/h5core/h5t_store.c +++ b/src/h5core/h5t_store.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,18 +7,19 @@ License: see file COPYING in top level of source distribution. */ -#include "h5_errorhandling_private.h" -#include "h5t_types_private.h" -#include "h5t_errorhandling_private.h" -#include "h5t_access_private.h" -#include "h5t_core_private.h" -#include "h5t_map_private.h" -#include "h5t_model_private.h" -#include "h5t_store_private.h" -#include "h5t_core_private.h" -#include "h5t_readwrite_private.h" -#include "h5_init_private.h" -#include "h5_mpi_private.h" +#include "private/h5_errorhandling.h" +#include "private/h5t_types.h" +#include "private/h5t_errorhandling.h" +#include "private/h5t_access.h" +#include "private/h5t_core.h" +#include "private/h5t_map.h" +#include "private/h5t_model.h" +#include "private/h5t_store.h" +#include "private/h5t_core.h" +#include "private/h5t_io.h" +#include "private/h5_init.h" +#include "private/h5.h" +#include "private/h5_mpi.h" #include "h5core/h5t_map.h" @@ -415,17 +416,35 @@ h5tpriv_add_level ( m->leaf_level = m->num_leaf_levels++; m->num_loaded_levels = m->num_leaf_levels; - TRY (m->num_glb_vertices = h5_alloc (m->num_glb_vertices, m->num_leaf_levels*sizeof (*m->num_glb_vertices))); - TRY (m->num_loc_vertices = h5_alloc (m->num_loc_vertices, m->num_leaf_levels*sizeof (*m->num_loc_vertices))); + TRY (m->num_glb_vertices = h5_alloc ( + m->num_glb_vertices, + m->num_leaf_levels*sizeof (*m->num_glb_vertices))); + TRY (m->num_loc_vertices = h5_alloc ( + m->num_loc_vertices, + m->num_leaf_levels*sizeof (*m->num_loc_vertices))); - TRY (m->num_b_vtx = h5_alloc (m->num_b_vtx, m->num_leaf_levels*sizeof (*m->num_b_vtx))); - TRY (m->first_b_vtx = h5_alloc (m->first_b_vtx, m->num_leaf_levels*sizeof (*m->first_b_vtx))); + TRY (m->num_b_vtx = h5_alloc ( + m->num_b_vtx, + m->num_leaf_levels*sizeof (*m->num_b_vtx))); + TRY (m->first_b_vtx = h5_alloc ( + m->first_b_vtx, + m->num_leaf_levels*sizeof (*m->first_b_vtx))); - TRY (m->num_glb_elems = h5_alloc (m->num_glb_elems, m->num_leaf_levels*sizeof (*m->num_glb_elems))); - TRY (m->num_glb_leaf_elems = h5_alloc (m->num_glb_leaf_elems, m->num_leaf_levels*sizeof (*m->num_glb_leaf_elems))); - TRY (m->num_interior_elems = h5_alloc (m->num_interior_elems, m->num_leaf_levels*sizeof (*m->num_interior_elems))); - TRY (m->num_interior_leaf_elems = h5_alloc (m->num_interior_leaf_elems, m->num_leaf_levels*sizeof (*m->num_interior_leaf_elems))); - TRY (m->num_ghost_elems = h5_alloc (m->num_ghost_elems, m->num_leaf_levels*sizeof (*m->num_ghost_elems))); + TRY (m->num_glb_elems = h5_alloc ( + m->num_glb_elems, + m->num_leaf_levels*sizeof (*m->num_glb_elems))); + TRY (m->num_glb_leaf_elems = h5_alloc ( + m->num_glb_leaf_elems, + m->num_leaf_levels*sizeof (*m->num_glb_leaf_elems))); + TRY (m->num_interior_elems = h5_alloc ( + m->num_interior_elems, + m->num_leaf_levels*sizeof (*m->num_interior_elems))); + TRY (m->num_interior_leaf_elems = h5_alloc ( + m->num_interior_leaf_elems, + m->num_leaf_levels*sizeof (*m->num_interior_leaf_elems))); + TRY (m->num_ghost_elems = h5_alloc ( + m->num_ghost_elems, + m->num_leaf_levels*sizeof (*m->num_ghost_elems))); m->num_glb_vertices[m->leaf_level] = -1; m->num_loc_vertices[m->leaf_level] = -1; diff --git a/src/h5core/h5t_tags.c b/src/h5core/h5t_tags.c index a36256a..6b02afd 100644 --- a/src/h5core/h5t_tags.c +++ b/src/h5core/h5t_tags.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,23 +7,23 @@ License: see file COPYING in top level of source distribution. */ -#include "h5t_types_private.h" +#include "private/h5t_types.h" #include "h5core/h5t_map.h" -#include "h5core/h5.h" +#include "h5core/h5_init.h" -#include "h5_va_macros.h" +#include "private/h5_va_macros.h" -#include "h5_attribs_private.h" -#include "h5_hdf5_private.h" +#include "private/h5_attribs.h" +#include "private/h5_hdf5.h" -#include "h5_model_private.h" -#include "h5t_access_private.h" -#include "h5t_map_private.h" -#include "h5t_model_private.h" -#include "h5t_tags_private.h" +#include "private/h5_model.h" +#include "private/h5t_access.h" +#include "private/h5t_map.h" +#include "private/h5t_model.h" +#include "private/h5t_tags.h" -#include "h5_init_private.h" +#include "private/h5_init.h" #include diff --git a/src/h5core/h5u_readwrite.c b/src/h5core/h5u_io.c similarity index 95% rename from src/h5core/h5u_readwrite.c rename to src/h5core/h5u_io.c index 3a71b5c..7e56d5d 100644 --- a/src/h5core/h5u_readwrite.c +++ b/src/h5core/h5u_io.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,14 +7,14 @@ License: see file COPYING in top level of source distribution. */ -#include "h5core/h5.h" -#include "h5_types_private.h" -#include "h5_hdf5_private.h" -#include "h5_model_private.h" -#include "h5_readwrite_private.h" -#include "h5u_types_private.h" +#include "h5core/h5_init.h" +#include "private/h5_types.h" +#include "private/h5_hdf5.h" +#include "private/h5_model.h" +#include "private/h5_io.h" +#include "private/h5u_types.h" -#include "h5core/h5.h" +#include "h5core/h5_init.h" #include "h5core/h5_model.h" #include "h5core/h5_syscall.h" diff --git a/src/h5core/h5u_model.c b/src/h5core/h5u_model.c index 39d8661..48ca0e3 100644 --- a/src/h5core/h5u_model.c +++ b/src/h5core/h5u_model.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,15 +7,19 @@ License: see file COPYING in top level of source distribution. */ -#include "h5core/h5.h" -#include "h5_private.h" -#include "h5_hdf5_private.h" - -#include "h5_model_private.h" -#include "h5_mpi_private.h" -#include "h5_readwrite_private.h" -#include "h5u_types_private.h" +#include "h5core/h5_init.h" +#include "h5core/h5_debug.h" #include "h5core/h5u_model.h" +#include "h5core/h5u_io.h" + +#include "private/h5.h" +#include "private/h5_hdf5.h" + +#include "private/h5_model.h" +#include "private/h5_mpi.h" +#include "private/h5_io.h" +#include "private/h5u_types.h" + h5_ssize_t h5u_get_num_points ( diff --git a/src/h5core/private/h5.h b/src/h5core/private/h5.h new file mode 100644 index 0000000..e78b245 --- /dev/null +++ b/src/h5core/private/h5.h @@ -0,0 +1,42 @@ +#ifndef __PRIVATE_H5_H +#define __PRIVATE_H5_H + +#include "private/h5_types.h" +#include "private/h5_debug.h" +#include "private/h5_errorhandling.h" + +#define UNUSED_ARGUMENT(x) (void)x + +static inline h5_err_t +check_filehandle ( + const h5_file_p f + ) { + if (f == NULL || f->file < 0 || f->u == NULL || f->b == NULL) { + return h5_error ( + H5_ERR_BADF, + "Called with bad filehandle."); + } + return H5_SUCCESS; +} + +#define CHECK_FILEHANDLE(f) \ + TRY (check_filehandle (f)); + +#define is_writable(f) (f->props->flags & (H5_O_RDWR | H5_O_WRONLY | H5_O_APPENDONLY)) +#define is_readable(f) (f->props->flags & (H5_O_RDWR | H5_O_RDONLY)) +#define is_readonly(f) (f->props->flags & H5_O_RDONLY) +#define is_appendonly(f) (f->props->flags & H5_O_APPENDONLY) + +#define CHECK_WRITABLE_MODE(f) \ + TRY (is_writable (f) ? H5_SUCCESS : h5_error ( \ + H5_ERR_INVAL, \ + "Attempting to write to read-only file")); + +#define CHECK_TIMEGROUP(f) \ + TRY ((f->step_gid > 0) ? H5_SUCCESS : h5_error ( \ + H5_ERR_INVAL, \ + "Time step is invalid! Have you set the time step?")); + + + +#endif diff --git a/src/h5core/private/h5_attribs.h b/src/h5core/private/h5_attribs.h new file mode 100644 index 0000000..fa3a0ba --- /dev/null +++ b/src/h5core/private/h5_attribs.h @@ -0,0 +1,95 @@ +/* + Copyright (c) 2006-2016, The Regents of the University of California, + through Lawrence Berkeley National Laboratory (subject to receipt of any + required approvals from the U.S. Dept. of Energy) and the Paul Scherrer + Institut (Switzerland). All rights reserved. + + License: see file COPYING in top level of source distribution. +*/ + +#ifndef __PRIVATE_H5_ATTRIBS_H +#define __PRIVATE_H5_ATTRIBS_H + +#include "private/h5_types.h" +#include "private/h5_model.h" +#include "private/h5_hdf5.h" + +h5_err_t +h5priv_read_attrib ( + const hid_t id, + const char* attrib_name, + const hid_t attrib_type, + void* const attrib_value + ); + +h5_err_t +h5priv_write_attrib ( + const hid_t id, + const char* attrib_name, + const hid_t attrib_type, + const void* attrib_value, + const hsize_t attrib_nelem, + const int overwrite + ); + +static inline h5_err_t +get_attrib_info ( + hid_t attrib_id, + h5_int64_t* attrib_type, /*!< OUT: H5 type of attribute */ + h5_size_t* attrib_nelem /*!< OUT: number of elements */ + ) { + H5_INLINE_FUNC_ENTER (h5_err_t); + hid_t mytype; + TRY (mytype = hdf5_get_attribute_type (attrib_id)); + + H5T_class_t type_class; + TRY (type_class = hdf5_get_class_type (mytype)); + + if (attrib_nelem) { + if (type_class == H5T_STRING) { + *attrib_nelem = H5Tget_size(mytype); + } else { + hid_t space_id; + TRY (space_id = hdf5_get_attribute_dataspace (attrib_id)); + TRY (*attrib_nelem = hdf5_get_npoints_of_dataspace (space_id)); + TRY (hdf5_close_dataspace (space_id)); + } + } + if (attrib_type) { + TRY (*attrib_type = h5priv_normalize_h5_type (mytype)); + } + TRY (hdf5_close_type (mytype)); + TRY (hdf5_close_attribute (attrib_id)); + H5_INLINE_FUNC_RETURN (H5_SUCCESS); +} + +static inline h5_err_t +h5priv_get_attrib_info_by_name ( + const hid_t id, /*!< IN: HDF5 object ID */ + const char* const attrib_name, /*!< IN: name of attribute */ + h5_int64_t* attrib_type, /*!< OUT: H5 type of attribute */ + h5_size_t* attrib_nelem /*!< OUT: number of elements */ + ) { + H5_PRIV_API_ENTER (h5_err_t, + "id=%lld, " + "attrib_name=%s," + "attrib_type=%p, attrib_nelem=%p", + (long long int)id, + attrib_name, + attrib_type, + attrib_nelem); + hid_t attrib_id; + TRY (attrib_id = hdf5_open_attribute (id, attrib_name)); + H5_PRIV_API_RETURN (get_attrib_info (attrib_id, attrib_type, attrib_nelem)); +} + +h5_err_t +h5priv_get_attrib_info_by_idx ( + const hid_t id, + const h5_size_t attrib_idx, + char* attrib_name, + const h5_size_t len_attrib_name, + h5_int64_t* attrib_type, + h5_size_t* attrib_nelem + ); +#endif diff --git a/src/h5core/h5_debug_private.h b/src/h5core/private/h5_debug.h similarity index 93% rename from src/h5core/h5_debug_private.h rename to src/h5core/private/h5_debug.h index b2c62ec..6eef834 100644 --- a/src/h5core/h5_debug_private.h +++ b/src/h5core/private/h5_debug.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,8 +7,8 @@ License: see file COPYING in top level of source distribution. */ -#ifndef __H5_DEBUG_PRIVATE_H -#define __H5_DEBUG_PRIVATE_H +#ifndef __PRIVATE_H5_DEBUG_H +#define __PRIVATE_H5_DEBUG_H #include "h5core/h5_debug.h" diff --git a/src/h5core/h5_errorhandling_private.h b/src/h5core/private/h5_errorhandling.h similarity index 92% rename from src/h5core/h5_errorhandling_private.h rename to src/h5core/private/h5_errorhandling.h index 03ea390..ccd8804 100644 --- a/src/h5core/h5_errorhandling_private.h +++ b/src/h5core/private/h5_errorhandling.h @@ -1,8 +1,10 @@ -#ifndef __H5_ERRORHANDLING_PRIVATE_H -#define __H5_ERRORHANDLING_PRIVATE_H +#ifndef __PRIVATE_H5_ERRORHANDLING_H +#define __PRIVATE_H5_ERRORHANDLING_H #include "h5core/h5_errorhandling.h" +extern const char* const H5_O_MODES[]; + #define h5priv_handle_file_mode_error( mode_id ) \ h5_error( \ H5_ERR_BADF, \ diff --git a/src/h5core/h5_fcmp.c b/src/h5core/private/h5_fcmp.c similarity index 94% rename from src/h5core/h5_fcmp.c rename to src/h5core/private/h5_fcmp.c index 27ca210..a732063 100644 --- a/src/h5core/h5_fcmp.c +++ b/src/h5core/private/h5_fcmp.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. diff --git a/src/h5core/h5_fcmp_private.h b/src/h5core/private/h5_fcmp.h similarity index 77% rename from src/h5core/h5_fcmp_private.h rename to src/h5core/private/h5_fcmp.h index 7b301e1..94bfa3d 100644 --- a/src/h5core/h5_fcmp_private.h +++ b/src/h5core/private/h5_fcmp.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,8 +7,8 @@ License: see file COPYING in top level of source distribution. */ -#ifndef __H5_FCMP_H -#define __H5_FCMP_H +#ifndef __PRIVATE_H5_FCMP_H +#define __PRIVATE_H5_FCMP_H #include "h5core/h5_types.h" diff --git a/src/h5core/h5_hdf5.c b/src/h5core/private/h5_hdf5.c similarity index 99% rename from src/h5core/h5_hdf5.c rename to src/h5core/private/h5_hdf5.c index 8b3b91e..8cf63a5 100644 --- a/src/h5core/h5_hdf5.c +++ b/src/h5core/private/h5_hdf5.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -10,7 +10,7 @@ #include #include -#include "h5_hdf5_private.h" +#include "private/h5_hdf5.h" #include "h5core/h5_types.h" #include "h5core/h5_syscall.h" diff --git a/src/h5core/h5_hdf5_private.h b/src/h5core/private/h5_hdf5.h similarity index 99% rename from src/h5core/h5_hdf5_private.h rename to src/h5core/private/h5_hdf5.h index 1c0acbd..cc80ed4 100644 --- a/src/h5core/h5_hdf5_private.h +++ b/src/h5core/private/h5_hdf5.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,14 +7,15 @@ License: see file COPYING in top level of source distribution. */ -#ifndef __H5_HDF5_PRIVATE_H -#define __H5_HDF5_PRIVATE_H +#ifndef __PRIVATE_H5_HDF5_H +#define __PRIVATE_H5_HDF5_H #include #include "h5core/h5_types.h" #include "h5core/h5_errorhandling.h" -#include "h5_debug_private.h" +#include "private/h5_debug.h" +#include "private/h5_va_macros.h" ssize_t hdf5_get_num_groups ( diff --git a/src/h5core/h5_hsearch.c b/src/h5core/private/h5_hsearch.c similarity index 98% rename from src/h5core/h5_hsearch.c rename to src/h5core/private/h5_hsearch.c index ad8c92b..d2d66cd 100644 --- a/src/h5core/h5_hsearch.c +++ b/src/h5core/private/h5_hsearch.c @@ -19,7 +19,7 @@ 02111-1307 USA. */ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -32,8 +32,8 @@ #include #include -#include "h5_debug_private.h" -#include "h5_hsearch_private.h" +#include "private/h5_debug.h" +#include "private/h5_hsearch.h" #include "h5core/h5_types.h" #include "h5core/h5_syscall.h" diff --git a/src/h5core/h5_hsearch_private.h b/src/h5core/private/h5_hsearch.h similarity index 92% rename from src/h5core/h5_hsearch_private.h rename to src/h5core/private/h5_hsearch.h index 06cc8f5..7b9cae5 100644 --- a/src/h5core/h5_hsearch_private.h +++ b/src/h5core/private/h5_hsearch.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,8 +7,8 @@ License: see file COPYING in top level of source distribution. */ -#ifndef __H5_HSEARCH_PRIVATE_H -#define __H5_HSEARCH_PRIVATE_H +#ifndef __PRIVATE_H5_HSEARCH_H +#define __PRIVATE_H5_HSEARCH_H #include "h5core/h5_types.h" diff --git a/src/h5core/h5_init_private.h b/src/h5core/private/h5_init.h similarity index 74% rename from src/h5core/h5_init_private.h rename to src/h5core/private/h5_init.h index edcef3b..e46b9e3 100644 --- a/src/h5core/h5_init_private.h +++ b/src/h5core/private/h5_init.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,11 +7,11 @@ License: see file COPYING in top level of source distribution. */ -#ifndef __H5_INIT_PRIVATE_H -#define __H5_INIT_PRIVATE_H +#ifndef __PRIVATE_H5_INIT_H +#define __PRIVATE_H5_INIT_H #include "h5core/h5_types.h" -#include "h5t_types_private.h" +#include "private/h5t_types.h" #ifdef __cplusplus extern "C" { diff --git a/src/h5core/h5_readwrite.c b/src/h5core/private/h5_io.c similarity index 94% rename from src/h5core/h5_readwrite.c rename to src/h5core/private/h5_io.c index 2459bfd..608a063 100644 --- a/src/h5core/h5_readwrite.c +++ b/src/h5core/private/h5_io.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,13 +7,13 @@ License: see file COPYING in top level of source distribution. */ -#include "h5core/h5.h" -#include "h5_types_private.h" +#include "h5core/h5_init.h" +#include "private/h5_types.h" -#include "h5_errorhandling_private.h" -#include "h5_hdf5_private.h" -#include "h5_model_private.h" -#include "h5_readwrite_private.h" +#include "private/h5_errorhandling.h" +#include "private/h5_hdf5.h" +#include "private/h5_model.h" +#include "private/h5_io.h" /*! Write data to dataset. diff --git a/src/h5core/h5_readwrite_private.h b/src/h5core/private/h5_io.h similarity index 58% rename from src/h5core/h5_readwrite_private.h rename to src/h5core/private/h5_io.h index 587eda1..dbb3007 100644 --- a/src/h5core/h5_readwrite_private.h +++ b/src/h5core/private/h5_io.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,28 +7,11 @@ License: see file COPYING in top level of source distribution. */ -#ifndef __H5_READWRITE_PRIVATE_H -#define __H5_READWRITE_PRIVATE_H +#ifndef __PRIVATE_H5_IO_H +#define __PRIVATE_H5_IO_H #include "h5core/h5_types.h" - -#define is_writable(f) (f->props->flags & (H5_O_RDWR | H5_O_WRONLY | H5_O_APPENDONLY)) -#define is_readable(f) (f->props->flags & (H5_O_RDWR | H5_O_RDONLY)) -#define is_readonly(f) (f->props->flags & H5_O_RDONLY) -#define is_appendonly(f) (f->props->flags & H5_O_APPENDONLY) - -#define CHECK_WRITABLE_MODE(f) \ - TRY (is_writable (f) ? H5_SUCCESS : h5_error ( \ - H5_ERR_INVAL, \ - "Attempting to write to read-only file")); - -#define CHECK_TIMEGROUP(f) \ - TRY ((f->step_gid > 0) ? H5_SUCCESS : h5_error ( \ - H5_ERR_INVAL, \ - "Time step is invalid! Have you set the time step?")); - - /* information about HDF5 dataset */ @@ -73,11 +56,6 @@ h5priv_read_dataset ( hid_t (*)(h5t_mesh_t* const, const hid_t), void* const); -h5_int64_t -h5priv_normalize_h5_type ( - hid_t type - ); - h5_int64_t h5priv_get_dataset_type( const hid_t group_id, diff --git a/src/h5core/h5_lustre.c b/src/h5core/private/h5_lustre.c similarity index 98% rename from src/h5core/h5_lustre.c rename to src/h5core/private/h5_lustre.c index f728179..05c50e3 100644 --- a/src/h5core/h5_lustre.c +++ b/src/h5core/private/h5_lustre.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,7 +7,7 @@ License: see file COPYING in top level of source distribution. */ -#include "h5core/h5.h" +#include "h5core/h5_init.h" #ifdef H5_USE_LUSTRE diff --git a/src/h5core/h5_lustre_private.h b/src/h5core/private/h5_lustre.h similarity index 75% rename from src/h5core/h5_lustre_private.h rename to src/h5core/private/h5_lustre.h index a632705..080f5e0 100644 --- a/src/h5core/h5_lustre_private.h +++ b/src/h5core/private/h5_lustre.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,8 +7,8 @@ License: see file COPYING in top level of source distribution. */ -#ifndef __H5_LUSTRE_PRIVATE_H -#define __H5_LUSTRE_PRIVATE_H +#ifndef __PRIVATE_H5_LUSTRE_H +#define __PRIVATE_H5_LUSTRE_H #include "h5core/h5_types.h" diff --git a/src/h5core/h5_maps.c b/src/h5core/private/h5_maps.c similarity index 97% rename from src/h5core/h5_maps.c rename to src/h5core/private/h5_maps.c index 9d3e56b..f19091e 100644 --- a/src/h5core/h5_maps.c +++ b/src/h5core/private/h5_maps.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,10 +7,10 @@ License: see file COPYING in top level of source distribution. */ -#include "h5core/h5.h" +#include "h5core/h5_init.h" -#include "h5_errorhandling_private.h" -#include "h5_maps_private.h" +#include "private/h5_errorhandling.h" +#include "private/h5_maps.h" /* Allocate new/empty string-list diff --git a/src/h5core/h5_maps_private.h b/src/h5core/private/h5_maps.h similarity index 98% rename from src/h5core/h5_maps_private.h rename to src/h5core/private/h5_maps.h index ab2b26c..51b4efa 100644 --- a/src/h5core/h5_maps_private.h +++ b/src/h5core/private/h5_maps.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,14 +7,14 @@ License: see file COPYING in top level of source distribution. */ -#ifndef __H5_MAPS_PRIVATE_H -#define __H5_MAPS_PRIVATE_H +#ifndef __PRIVATE_H5_MAPS_H +#define __PRIVATE_H5_MAPS_H -#include "h5_types_private.h" +#include "private/h5_types.h" #include "h5core/h5_debug.h" #include "h5core/h5_errorhandling.h" #include "h5core/h5_syscall.h" -#include "h5_debug_private.h" +#include "private/h5_debug.h" typedef struct { size_t size; diff --git a/src/h5core/h5_model_private.h b/src/h5core/private/h5_model.h similarity index 92% rename from src/h5core/h5_model_private.h rename to src/h5core/private/h5_model.h index 39da0bd..6e0ea1e 100644 --- a/src/h5core/h5_model_private.h +++ b/src/h5core/private/h5_model.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,8 +7,8 @@ License: see file COPYING in top level of source distribution. */ -#ifndef __H5_MODEL_PRIVATE_H -#define __H5_MODEL_PRIVATE_H +#ifndef __PRIVATE_H5_MODEL_H +#define __PRIVATE_H5_MODEL_H /* WARNING! Changing these values will alter the data model and introduce @@ -26,8 +26,8 @@ #include "h5core/h5_types.h" #include "h5core/h5_model.h" -#include "h5_private.h" -#include "h5_mpi_private.h" +#include "private/h5.h" +#include "private/h5_mpi.h" #ifdef PARALLEL_IO static inline h5_err_t @@ -113,4 +113,9 @@ h5priv_close_step ( const h5_file_p f ); +h5_int64_t +h5priv_normalize_h5_type ( + hid_t type + ); + #endif diff --git a/src/h5core/h5_mpi_private.h b/src/h5core/private/h5_mpi.h similarity index 98% rename from src/h5core/h5_mpi_private.h rename to src/h5core/private/h5_mpi.h index 2426945..20f5d5d 100644 --- a/src/h5core/h5_mpi_private.h +++ b/src/h5core/private/h5_mpi.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,14 +7,14 @@ License: see file COPYING in top level of source distribution. */ -#ifndef __H5_MPI_PRIVATE_H -#define __H5_MPI_PRIVATE_H +#ifndef __PRIVATE_H5_MPI_H +#define __PRIVATE_H5_MPI_H #ifdef PARALLEL_IO #include "h5core/h5_types.h" #include "h5core/h5_errorhandling.h" -#include "h5_debug_private.h" +#include "private/h5_debug.h" static inline h5_err_t h5priv_mpi_alltoall ( diff --git a/src/h5core/h5_qsort.c b/src/h5core/private/h5_qsort.c similarity index 99% rename from src/h5core/h5_qsort.c rename to src/h5core/private/h5_qsort.c index 965686b..5668e29 100644 --- a/src/h5core/h5_qsort.c +++ b/src/h5core/private/h5_qsort.c @@ -38,7 +38,7 @@ static char sccsid[] = "@(#)qsort.c 8.1 (Berkeley) 6/4/93"; #include -#include "h5_qsort_private.h" +#include "private/h5_qsort.h" #ifdef I_AM_QSORT_R typedef int cmp_t (void *, const void *, const void *); diff --git a/src/h5core/h5_qsort_private.h b/src/h5core/private/h5_qsort.h similarity index 83% rename from src/h5core/h5_qsort_private.h rename to src/h5core/private/h5_qsort.h index 95ca9db..3958723 100644 --- a/src/h5core/h5_qsort_private.h +++ b/src/h5core/private/h5_qsort.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,8 +7,8 @@ License: see file COPYING in top level of source distribution. */ -#ifndef __H5_QSORT_PRIVATE_H -#define __H5_QSORT_PRIVATE_H +#ifndef __PRIVATE_H5_QSORT_H +#define __PRIVATE_H5_QSORT_H #include "h5core/h5_types.h" void diff --git a/src/h5core/h5_qsort_r.c b/src/h5core/private/h5_qsort_r.c similarity index 100% rename from src/h5core/h5_qsort_r.c rename to src/h5core/private/h5_qsort_r.c diff --git a/src/h5core/h5_types_private.h b/src/h5core/private/h5_types.h similarity index 95% rename from src/h5core/h5_types_private.h rename to src/h5core/private/h5_types.h index 594eb69..bf86d0d 100644 --- a/src/h5core/h5_types_private.h +++ b/src/h5core/private/h5_types.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,8 +7,8 @@ License: see file COPYING in top level of source distribution. */ -#ifndef __H5_TYPES_PRIVATE_H -#define __H5_TYPES_PRIVATE_H +#ifndef __PRIVATE_H5_TYPES_H +#define __PRIVATE_H5_TYPES_H #include #include "h5core/h5_types.h" diff --git a/src/h5core/h5_va_macros.h b/src/h5core/private/h5_va_macros.h similarity index 92% rename from src/h5core/h5_va_macros.h rename to src/h5core/private/h5_va_macros.h index 66cd7c7..ff72f0a 100644 --- a/src/h5core/h5_va_macros.h +++ b/src/h5core/private/h5_va_macros.h @@ -1,5 +1,5 @@ -#ifndef __H5_VA_MACROS_H -#define __H5_VA_MACROS_H +#ifndef __PRIVATE_H5_VA_MACROS_H +#define __PRIVATE_H5_VA_MACROS_H #define PP_NARG(...) \ PP_NARG_(__VA_ARGS__,PP_RSEQ_N()) diff --git a/src/h5core/h5b_readwrite_private.h b/src/h5core/private/h5b_io.h similarity index 76% rename from src/h5core/h5b_readwrite_private.h rename to src/h5core/private/h5b_io.h index b950823..5d473c8 100644 --- a/src/h5core/h5b_readwrite_private.h +++ b/src/h5core/private/h5b_io.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,8 +7,8 @@ License: see file COPYING in top level of source distribution. */ -#ifndef __H5B_READWRITE_PRIVATE_H -#define __H5B_READWRITE_PRIVATE_H +#ifndef __PRIVATE_H5B_IO_H +#define __PRIVATE_H5B_IO_H #include "h5core/h5_types.h" diff --git a/src/h5core/h5b_model_private.h b/src/h5core/private/h5b_model.h similarity index 88% rename from src/h5core/h5b_model_private.h rename to src/h5core/private/h5b_model.h index 758a008..0d36054 100644 --- a/src/h5core/h5b_model_private.h +++ b/src/h5core/private/h5b_model.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,8 +7,8 @@ License: see file COPYING in top level of source distribution. */ -#ifndef __H5B_MODEL_PRIVATE_H -#define __H5B_MODEL_PRIVATE_H +#ifndef __PRIVATE_H5B_MODEL_H +#define __PRIVATE_H5B_MODEL_H #include "h5core/h5_types.h" diff --git a/src/h5core/h5b_types_private.h b/src/h5core/private/h5b_types.h similarity index 91% rename from src/h5core/h5b_types_private.h rename to src/h5core/private/h5b_types.h index 837363b..b60a9e0 100644 --- a/src/h5core/h5b_types_private.h +++ b/src/h5core/private/h5b_types.h @@ -1,5 +1,5 @@ -#ifndef __H5B_TYPES_PRIVATE_H -#define __H5B_TYPES_PRIVATE_H +#ifndef __PRIVATE_H5B_TYPES_H +#define __PRIVATE_H5B_TYPES_H struct h5b_partition { h5_int64_t i_start; diff --git a/src/h5core/h5t_access_private.h b/src/h5core/private/h5t_access.h similarity index 98% rename from src/h5core/h5t_access_private.h rename to src/h5core/private/h5t_access.h index 68b80b2..3432607 100644 --- a/src/h5core/h5t_access_private.h +++ b/src/h5core/private/h5t_access.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,11 +7,11 @@ License: see file COPYING in top level of source distribution. */ -#ifndef __H5T_ACCESS_PRIVATE_H -#define __H5T_ACCESS_PRIVATE_H +#ifndef __PRIVATE_H5T_ACCESS_H +#define __PRIVATE_H5T_ACCESS_H #include "h5core/h5_types.h" -#include "h5t_types_private.h" +#include "private/h5t_types.h" struct h5t_access_methods { #if defined(WITH_PARALLEL_H5GRID) diff --git a/src/h5core/h5t_access_tetm.c b/src/h5core/private/h5t_access_tetm.c similarity index 98% rename from src/h5core/h5t_access_tetm.c rename to src/h5core/private/h5t_access_tetm.c index 40419f6..3f792a3 100644 --- a/src/h5core/h5t_access_tetm.c +++ b/src/h5core/private/h5t_access_tetm.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,13 +7,15 @@ License: see file COPYING in top level of source distribution. */ -#include "h5core/h5.h" -#include "h5_private.h" -#include "h5_types_private.h" -#include "h5_init_private.h" -#include "h5t_types_private.h" -#include "h5t_model_private.h" -#include "h5t_access_private.h" +#include "h5core/h5_init.h" +#include "h5core/h5_debug.h" + +#include "private/h5.h" +#include "private/h5_types.h" +#include "private/h5_init.h" +#include "private/h5t_types.h" +#include "private/h5t_model.h" +#include "private/h5t_access.h" /*** op's on local elements ***/ diff --git a/src/h5core/h5t_access_trim.c b/src/h5core/private/h5t_access_trim.c similarity index 97% rename from src/h5core/h5t_access_trim.c rename to src/h5core/private/h5t_access_trim.c index ba27cba..090e347 100644 --- a/src/h5core/h5t_access_trim.c +++ b/src/h5core/private/h5t_access_trim.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,12 +7,14 @@ License: see file COPYING in top level of source distribution. */ -#include "h5core/h5.h" -#include "h5_private.h" -#include "h5_init_private.h" -#include "h5t_types_private.h" -#include "h5t_model_private.h" -#include "h5t_access_private.h" +#include "h5core/h5_init.h" +#include "h5core/h5_debug.h" + +#include "private/h5.h" +#include "private/h5_init.h" +#include "private/h5t_types.h" +#include "private/h5t_model.h" +#include "private/h5t_access.h" #if defined(WITH_PARALLEL_H5GRID) static MPI_Datatype diff --git a/src/h5core/h5t_adjacencies_private.h b/src/h5core/private/h5t_adjacencies.h similarity index 85% rename from src/h5core/h5t_adjacencies_private.h rename to src/h5core/private/h5t_adjacencies.h index 8deecca..e069266 100644 --- a/src/h5core/h5t_adjacencies_private.h +++ b/src/h5core/private/h5t_adjacencies.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,12 +7,12 @@ License: see file COPYING in top level of source distribution. */ -#ifndef __H5T_ADJACENCIES_PRIVATE_H -#define __H5T_ADJACENCIES_PRIVATE_H +#ifndef __PRIVATE_H5T_ADJACENCIES_H +#define __PRIVATE_H5T_ADJACENCIES_H #include "h5core/h5_types.h" -#include "h5t_types_private.h" -#include "h5_debug_private.h" +#include "private/h5t_types.h" +#include "private/h5_debug.h" struct h5t_adjacency_methods { h5_err_t (*get_adjacencies)( diff --git a/src/h5core/h5t_adjacencies_tetm.c b/src/h5core/private/h5t_adjacencies_tetm.c similarity index 98% rename from src/h5core/h5t_adjacencies_tetm.c rename to src/h5core/private/h5t_adjacencies_tetm.c index c1157cf..a59953d 100644 --- a/src/h5core/h5t_adjacencies_tetm.c +++ b/src/h5core/private/h5t_adjacencies_tetm.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,13 +7,13 @@ License: see file COPYING in top level of source distribution. */ -#include "h5_maps_private.h" -#include "h5t_core_private.h" -#include "h5t_types_private.h" -#include "h5t_model_private.h" -#include "h5t_map_private.h" -#include "h5t_access_private.h" -#include "h5t_adjacencies_private.h" +#include "private/h5_maps.h" +#include "private/h5t_core.h" +#include "private/h5t_types.h" +#include "private/h5t_model.h" +#include "private/h5t_map.h" +#include "private/h5t_access.h" +#include "private/h5t_adjacencies.h" #include diff --git a/src/h5core/h5t_adjacencies_trim.c b/src/h5core/private/h5t_adjacencies_trim.c similarity index 98% rename from src/h5core/h5t_adjacencies_trim.c rename to src/h5core/private/h5t_adjacencies_trim.c index 23d1de1..a7545b0 100644 --- a/src/h5core/h5t_adjacencies_trim.c +++ b/src/h5core/private/h5t_adjacencies_trim.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,12 +7,12 @@ License: see file COPYING in top level of source distribution. */ -#include "h5t_types_private.h" -#include "h5t_model_private.h" -#include "h5t_map_private.h" -#include "h5t_access_private.h" -#include "h5t_adjacencies_private.h" -#include "h5t_core_private.h" +#include "private/h5t_types.h" +#include "private/h5t_model.h" +#include "private/h5t_map.h" +#include "private/h5t_access.h" +#include "private/h5t_adjacencies.h" +#include "private/h5t_core.h" #include diff --git a/src/h5core/h5t_core.c b/src/h5core/private/h5t_core.c similarity index 98% rename from src/h5core/h5t_core.c rename to src/h5core/private/h5t_core.c index 661bc02..9af9f15 100644 --- a/src/h5core/h5t_core.c +++ b/src/h5core/private/h5t_core.c @@ -1,12 +1,12 @@ #include -#include "h5t_types_private.h" +#include "private/h5t_types.h" #include "h5core/h5t_map.h" -#include "h5t_map_private.h" -#include "h5t_core_private.h" -#include "h5t_access_private.h" -#include "h5t_errorhandling_private.h" +#include "private/h5t_map.h" +#include "private/h5t_core.h" +#include "private/h5t_access.h" +#include "private/h5t_errorhandling.h" h5_err_t h5tpriv_grow_te_htab ( diff --git a/src/h5core/h5t_core_private.h b/src/h5core/private/h5t_core.h similarity index 84% rename from src/h5core/h5t_core_private.h rename to src/h5core/private/h5t_core.h index ca297b1..b2b7680 100644 --- a/src/h5core/h5t_core_private.h +++ b/src/h5core/private/h5t_core.h @@ -1,5 +1,14 @@ -#ifndef __H5T_CORE_PRIVATE_H -#define __H5T_CORE_PRIVATE_H +/* + Copyright (c) 2006-2016, The Regents of the University of California, + through Lawrence Berkeley National Laboratory (subject to receipt of any + required approvals from the U.S. Dept. of Energy) and the Paul Scherrer + Institut (Switzerland). All rights reserved. + + License: see file COPYING in top level of source distribution. +*/ + +#ifndef __PRIVATE_H5T_CORE_H +#define __PRIVATE_H5T_CORE_H #define MAX_CHUNKS_PER_OCTANT 4 // WARNING there are probably places where the makro isn't used @@ -11,22 +20,22 @@ #define MAX_NUM_ELEMS_TO_REFINE_LOCALLY 2048 // used define instead of having number in code -#include "h5t_tags_private.h" +#include "private/h5t_tags.h" -#include "h5t_types_private.h" +#include "private/h5t_types.h" -#include "h5t_access_private.h" -#include "h5t_adjacencies_private.h" -#include "h5t_map_private.h" -#include "h5t_model_private.h" -#include "h5t_ref_elements_private.h" -#include "h5t_readwrite_private.h" -#include "h5t_retrieve_private.h" -#include "h5t_store_private.h" +#include "private/h5t_access.h" +#include "private/h5t_adjacencies.h" +#include "private/h5t_map.h" +#include "private/h5t_model.h" +#include "private/h5t_ref_elements.h" +#include "private/h5t_io.h" +#include "private/h5t_retrieve.h" +#include "private/h5t_store.h" -#include "h5t_errorhandling_private.h" +#include "private/h5t_errorhandling.h" -#include "h5t_octree_private.h" +#include "private/h5t_octree.h" #include diff --git a/src/h5core/h5t_core_tetm.c b/src/h5core/private/h5t_core_tetm.c similarity index 98% rename from src/h5core/h5t_core_tetm.c rename to src/h5core/private/h5t_core_tetm.c index 0a1eaf8..2df250d 100644 --- a/src/h5core/h5t_core_tetm.c +++ b/src/h5core/private/h5t_core_tetm.c @@ -16,11 +16,11 @@ #include -#include "h5_maps_private.h" -#include "h5t_model_private.h" -#include "h5t_types_private.h" -#include "h5t_core_private.h" -#include "h5t_retrieve_private.h" +#include "private/h5_maps.h" +#include "private/h5t_model.h" +#include "private/h5t_types.h" +#include "private/h5t_core.h" +#include "private/h5t_retrieve.h" #define H5_LOC_ELEM_T h5_loc_tet_t diff --git a/src/h5core/h5t_core_trim.c b/src/h5core/private/h5t_core_trim.c similarity index 98% rename from src/h5core/h5t_core_trim.c rename to src/h5core/private/h5t_core_trim.c index d0264a7..5490b8a 100644 --- a/src/h5core/h5t_core_trim.c +++ b/src/h5core/private/h5t_core_trim.c @@ -15,10 +15,10 @@ #include #include -#include "h5t_types_private.h" -#include "h5t_model_private.h" -#include "h5t_core_private.h" -#include "h5t_core_private.h" +#include "private/h5t_types.h" +#include "private/h5t_model.h" +#include "private/h5t_core.h" +#include "private/h5t_core.h" #define H5_LOC_ELEM_T h5_loc_tri_t diff --git a/src/h5core/h5t_errorhandling_private.h b/src/h5core/private/h5t_errorhandling.h similarity index 90% rename from src/h5core/h5t_errorhandling_private.h rename to src/h5core/private/h5t_errorhandling.h index 1d00892..f84502e 100644 --- a/src/h5core/h5t_errorhandling_private.h +++ b/src/h5core/private/h5t_errorhandling.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,12 +7,12 @@ License: see file COPYING in top level of source distribution. */ -#ifndef __H5T_ERRORHANDLING_PRIVATE_H -#define __H5T_ERRORHANDLING_PRIVATE_H +#ifndef __PRIVATE_H5T_ERRORHANDLING_H +#define __PRIVATE_H5T_ERRORHANDLING_H #include "h5core/h5_types.h" #include "h5core/h5_errorhandling.h" -#include "h5_debug_private.h" +#include "private/h5_debug.h" #define ERR_ELEM_NEXIST "Element with local vertex IDs (%s) doesn't exist!" diff --git a/src/h5core/h5t_readwrite_private.h b/src/h5core/private/h5t_io.h similarity index 95% rename from src/h5core/h5t_readwrite_private.h rename to src/h5core/private/h5t_io.h index 21a9aed..db8406a 100644 --- a/src/h5core/h5t_readwrite_private.h +++ b/src/h5core/private/h5t_io.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,11 +7,11 @@ License: see file COPYING in top level of source distribution. */ -#ifndef __H5T_READWRITE_PRIVATE_H -#define __H5T_READWRITE_PRIVATE_H +#ifndef __PRIVATE_H5T_IO_H +#define __PRIVATE_H5T_IO_H #include "h5core/h5_types.h" -#include "h5t_types_private.h" +#include "private/h5t_types.h" struct h5t_read_methods { h5_err_t (*init_loc_elems_struct)(h5t_mesh_t* const, diff --git a/src/h5core/h5t_readwrite_tetm.c b/src/h5core/private/h5t_io_tetm.c similarity index 96% rename from src/h5core/h5t_readwrite_tetm.c rename to src/h5core/private/h5t_io_tetm.c index 5af6e76..7649f68 100644 --- a/src/h5core/h5t_readwrite_tetm.c +++ b/src/h5core/private/h5t_io_tetm.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,10 +7,10 @@ License: see file COPYING in top level of source distribution. */ -#include "h5t_types_private.h" -#include "h5t_map_private.h" -#include "h5t_model_private.h" -#include "h5t_readwrite_private.h" +#include "private/h5t_types.h" +#include "private/h5t_map.h" +#include "private/h5t_model.h" +#include "private/h5t_io.h" #include "h5core/h5t_map.h" /* diff --git a/src/h5core/h5t_readwrite_trim.c b/src/h5core/private/h5t_io_trim.c similarity index 97% rename from src/h5core/h5t_readwrite_trim.c rename to src/h5core/private/h5t_io_trim.c index e33a071..b24fae0 100644 --- a/src/h5core/h5t_readwrite_trim.c +++ b/src/h5core/private/h5t_io_trim.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,11 +7,11 @@ License: see file COPYING in top level of source distribution. */ -#include "h5t_types_private.h" -#include "h5t_map_private.h" -#include "h5t_model_private.h" -#include "h5t_readwrite_private.h" -#include "h5t_access_private.h" +#include "private/h5t_types.h" +#include "private/h5t_map.h" +#include "private/h5t_model.h" +#include "private/h5t_io.h" +#include "private/h5t_access.h" #include "h5core/h5t_map.h" diff --git a/src/h5core/h5t_map_private.h b/src/h5core/private/h5t_map.h similarity index 95% rename from src/h5core/h5t_map_private.h rename to src/h5core/private/h5t_map.h index 5b2e99c..eb4c31c 100644 --- a/src/h5core/h5t_map_private.h +++ b/src/h5core/private/h5t_map.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,15 +7,15 @@ License: see file COPYING in top level of source distribution. */ -#ifndef __H5T_MAP_PRIVATE_H -#define __H5T_MAP_PRIVATE_H +#ifndef __PRIVATE_H5T_MAP_H +#define __PRIVATE_H5T_MAP_H -#include "h5_types_private.h" +#include "private/h5_types.h" #include "h5core/h5_debug.h" #include "h5core/h5_errorhandling.h" #include "h5core/h5_syscall.h" -#include "h5_debug_private.h" -#include "h5t_model_private.h" +#include "private/h5_debug.h" +#include "private/h5t_model.h" /* Find ID in sorted list diff --git a/src/h5core/h5t_model_private.h b/src/h5core/private/h5t_model.h similarity index 95% rename from src/h5core/h5t_model_private.h rename to src/h5core/private/h5t_model.h index 1b8128b..f5596f7 100644 --- a/src/h5core/h5t_model_private.h +++ b/src/h5core/private/h5t_model.h @@ -1,17 +1,17 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. License: see file COPYING in top level of source distribution. */ -#ifndef __H5T_MODEL_PRIVATE_H -#define __H5T_MODEL_PRIVATE_H +#ifndef __PRIVATE_H5T_MODEL_H +#define __PRIVATE_H5T_MODEL_H #include "h5core/h5_types.h" #include "h5core/h5t_model.h" -#include "h5t_types_private.h" +#include "private/h5t_types.h" #define H5T_CONTAINER_GRPNAME "Topo" #define TETRAHEDRAL_MESHES_GRPNAME "TetMeshes" diff --git a/src/h5core/h5t_model_tetm.c b/src/h5core/private/h5t_model_tetm.c similarity index 93% rename from src/h5core/h5t_model_tetm.c rename to src/h5core/private/h5t_model_tetm.c index 213b7a0..7e1bfe7 100644 --- a/src/h5core/h5t_model_tetm.c +++ b/src/h5core/private/h5t_model_tetm.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,21 +7,22 @@ License: see file COPYING in top level of source distribution. */ -#include "h5t_types_private.h" +#include "private/h5t_types.h" -#include "h5_hdf5_private.h" -#include "h5_va_macros.h" +#include "private/h5_hdf5.h" +#include "private/h5_va_macros.h" -#include "h5t_model_private.h" -#include "h5t_access_private.h" -#include "h5t_adjacencies_private.h" -#include "h5t_readwrite_private.h" -#include "h5t_retrieve_private.h" -#include "h5t_store_private.h" +#include "private/h5t_model.h" +#include "private/h5t_access.h" +#include "private/h5t_adjacencies.h" +#include "private/h5t_io.h" +#include "private/h5t_retrieve.h" +#include "private/h5t_store.h" -#include "h5_init_private.h" -#include "h5t_core_private.h" +#include "private/h5.h" +#include "private/h5_init.h" +#include "private/h5t_core.h" static struct h5t_methods tet_funcs = { &h5tpriv_read_tetm_methods, diff --git a/src/h5core/h5t_model_trim.c b/src/h5core/private/h5t_model_trim.c similarity index 93% rename from src/h5core/h5t_model_trim.c rename to src/h5core/private/h5t_model_trim.c index b774dc1..f5a22ea 100644 --- a/src/h5core/h5t_model_trim.c +++ b/src/h5core/private/h5t_model_trim.c @@ -1,26 +1,27 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. License: see file COPYING in top level of source distribution. */ -#include "h5t_types_private.h" +#include "private/h5t_types.h" -#include "h5_hdf5_private.h" -#include "h5_mpi_private.h" -#include "h5_va_macros.h" +#include "private/h5.h" +#include "private/h5_hdf5.h" +#include "private/h5_mpi.h" +#include "private/h5_va_macros.h" -#include "h5t_model_private.h" -#include "h5t_access_private.h" -#include "h5t_adjacencies_private.h" -#include "h5t_readwrite_private.h" -#include "h5t_retrieve_private.h" -#include "h5t_store_private.h" +#include "private/h5t_model.h" +#include "private/h5t_access.h" +#include "private/h5t_adjacencies.h" +#include "private/h5t_io.h" +#include "private/h5t_retrieve.h" +#include "private/h5t_store.h" -#include "h5_init_private.h" -#include "h5t_core_private.h" +#include "private/h5_init.h" +#include "private/h5t_core.h" static struct h5t_methods tri_funcs = { &h5tpriv_read_trim_methods, diff --git a/src/h5core/h5t_octree_private.h b/src/h5core/private/h5t_octree.h similarity index 97% rename from src/h5core/h5t_octree_private.h rename to src/h5core/private/h5t_octree.h index e096668..9c33bb4 100644 --- a/src/h5core/h5t_octree_private.h +++ b/src/h5core/private/h5t_octree.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,8 +7,8 @@ License: see file COPYING in top level of source distribution. */ -#ifndef __H5T_OCTREE_PRIVATE_H -#define __H5T_OCTREE_PRIVATE_H +#ifndef __PRIVATE_H5T_OCTREE_H +#define __PRIVATE_H5T_OCTREE_H #include "h5core/h5_types.h" diff --git a/src/h5core/h5t_ref_elements.c b/src/h5core/private/h5t_ref_elements.c similarity index 97% rename from src/h5core/h5t_ref_elements.c rename to src/h5core/private/h5t_ref_elements.c index 0b9d058..ad134dd 100644 --- a/src/h5core/h5t_ref_elements.c +++ b/src/h5core/private/h5t_ref_elements.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,9 +7,9 @@ License: see file COPYING in top level of source distribution. */ -#include "h5t_types_private.h" -#include "h5t_model_private.h" -#include "h5t_ref_elements_private.h" +#include "private/h5t_types.h" +#include "private/h5t_model.h" +#include "private/h5t_ref_elements.h" /* information we can retrieve from the reference element: diff --git a/src/h5core/h5t_ref_elements_private.h b/src/h5core/private/h5t_ref_elements.h similarity index 94% rename from src/h5core/h5t_ref_elements_private.h rename to src/h5core/private/h5t_ref_elements.h index 47b02bf..ba1b102 100644 --- a/src/h5core/h5t_ref_elements_private.h +++ b/src/h5core/private/h5t_ref_elements.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,8 +7,8 @@ License: see file COPYING in top level of source distribution. */ -#ifndef __H5T_REF_ELEMENTS_PRIVATE_H -#define __H5T_REF_ELEMENTS_PRIVATE_H +#ifndef __PRIVATE_H5T_REF_ELEMENTS_H +#define __PRIVATE_H5T_REF_ELEMENTS_H #include "h5core/h5_types.h" diff --git a/src/h5core/h5t_retrieve_private.h b/src/h5core/private/h5t_retrieve.h similarity index 83% rename from src/h5core/h5t_retrieve_private.h rename to src/h5core/private/h5t_retrieve.h index 29ae1fb..cc934ee 100644 --- a/src/h5core/h5t_retrieve_private.h +++ b/src/h5core/private/h5t_retrieve.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,11 +7,11 @@ License: see file COPYING in top level of source distribution. */ -#ifndef __H5T_RETRIEVE_PRIVATE_H -#define __H5T_RETRIEVE_PRIVATE_H +#ifndef __PRIVATE_H5T_RETRIEVE_H +#define __PRIVATE_H5T_RETRIEVE_H #include "h5core/h5_types.h" -#include "h5t_types_private.h" +#include "private/h5t_types.h" #include "h5core/h5t_retrieve.h" struct h5t_retrieve_methods { diff --git a/src/h5core/h5t_retrieve_tetm.c b/src/h5core/private/h5t_retrieve_tetm.c similarity index 73% rename from src/h5core/h5t_retrieve_tetm.c rename to src/h5core/private/h5t_retrieve_tetm.c index 65b129c..c6e4a9a 100644 --- a/src/h5core/h5t_retrieve_tetm.c +++ b/src/h5core/private/h5t_retrieve_tetm.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,14 +7,14 @@ License: see file COPYING in top level of source distribution. */ -#include "h5t_types_private.h" -#include "h5t_errorhandling_private.h" -#include "h5t_core_private.h" -#include "h5t_map_private.h" -#include "h5t_model_private.h" -#include "h5t_access_private.h" -#include "h5t_tags_private.h" -#include "h5t_retrieve_private.h" +#include "private/h5t_types.h" +#include "private/h5t_errorhandling.h" +#include "private/h5t_core.h" +#include "private/h5t_map.h" +#include "private/h5t_model.h" +#include "private/h5t_access.h" +#include "private/h5t_tags.h" +#include "private/h5t_retrieve.h" static h5_err_t init_entity_iterator ( diff --git a/src/h5core/h5t_retrieve_trim.c b/src/h5core/private/h5t_retrieve_trim.c similarity index 72% rename from src/h5core/h5t_retrieve_trim.c rename to src/h5core/private/h5t_retrieve_trim.c index e1a5e8a..62bce58 100644 --- a/src/h5core/h5t_retrieve_trim.c +++ b/src/h5core/private/h5t_retrieve_trim.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,14 +7,14 @@ License: see file COPYING in top level of source distribution. */ -#include "h5t_types_private.h" -#include "h5t_errorhandling_private.h" -#include "h5t_core_private.h" -#include "h5t_map_private.h" -#include "h5t_model_private.h" -#include "h5t_access_private.h" -#include "h5t_tags_private.h" -#include "h5t_retrieve_private.h" +#include "private/h5t_types.h" +#include "private/h5t_errorhandling.h" +#include "private/h5t_core.h" +#include "private/h5t_map.h" +#include "private/h5t_model.h" +#include "private/h5t_access.h" +#include "private/h5t_tags.h" +#include "private/h5t_retrieve.h" static h5_err_t init_entity_iterator ( diff --git a/src/h5core/h5t_store_private.h b/src/h5core/private/h5t_store.h similarity index 94% rename from src/h5core/h5t_store_private.h rename to src/h5core/private/h5t_store.h index 9a2c5c0..1634ed6 100644 --- a/src/h5core/h5t_store_private.h +++ b/src/h5core/private/h5t_store.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,11 +7,11 @@ License: see file COPYING in top level of source distribution. */ -#ifndef __H5T_STORE_PRIVATE_H -#define __H5T_STORE_PRIVATE_H +#ifndef __PRIVATE_H5T_STORE_H +#define __PRIVATE_H5T_STORE_H #include "h5core/h5_types.h" -#include "h5t_types_private.h" +#include "private/h5t_types.h" #include "h5core/h5t_store.h" struct h5t_store_methods { diff --git a/src/h5core/h5t_store_tetm.c b/src/h5core/private/h5t_store_tetm.c similarity index 97% rename from src/h5core/h5t_store_tetm.c rename to src/h5core/private/h5t_store_tetm.c index 21d795a..f707a57 100644 --- a/src/h5core/h5t_store_tetm.c +++ b/src/h5core/private/h5t_store_tetm.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,15 +7,15 @@ License: see file COPYING in top level of source distribution. */ -#include "h5t_types_private.h" -#include "h5t_errorhandling_private.h" -#include "h5t_access_private.h" -#include "h5t_adjacencies_private.h" -#include "h5t_core_private.h" -#include "h5t_map_private.h" -#include "h5t_model_private.h" -#include "h5t_readwrite_private.h" -#include "h5t_store_private.h" +#include "private/h5t_types.h" +#include "private/h5t_errorhandling.h" +#include "private/h5t_access.h" +#include "private/h5t_adjacencies.h" +#include "private/h5t_core.h" +#include "private/h5t_map.h" +#include "private/h5t_model.h" +#include "private/h5t_io.h" +#include "private/h5t_store.h" #include "h5core/h5t_map.h" diff --git a/src/h5core/h5t_store_trim.c b/src/h5core/private/h5t_store_trim.c similarity index 96% rename from src/h5core/h5t_store_trim.c rename to src/h5core/private/h5t_store_trim.c index af84a49..94a0075 100644 --- a/src/h5core/h5t_store_trim.c +++ b/src/h5core/private/h5t_store_trim.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,15 +7,15 @@ License: see file COPYING in top level of source distribution. */ -#include "h5t_types_private.h" -#include "h5t_errorhandling_private.h" -#include "h5t_access_private.h" -#include "h5t_adjacencies_private.h" -#include "h5t_core_private.h" -#include "h5t_map_private.h" -#include "h5t_model_private.h" -#include "h5t_readwrite_private.h" -#include "h5t_store_private.h" +#include "private/h5t_types.h" +#include "private/h5t_errorhandling.h" +#include "private/h5t_access.h" +#include "private/h5t_adjacencies.h" +#include "private/h5t_core.h" +#include "private/h5t_map.h" +#include "private/h5t_model.h" +#include "private/h5t_io.h" +#include "private/h5t_store.h" #include "h5core/h5t_map.h" diff --git a/src/h5core/h5t_tags_private.h b/src/h5core/private/h5t_tags.h similarity index 95% rename from src/h5core/h5t_tags_private.h rename to src/h5core/private/h5t_tags.h index c8bcc18..bd152a4 100644 --- a/src/h5core/h5t_tags_private.h +++ b/src/h5core/private/h5t_tags.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,8 +7,8 @@ License: see file COPYING in top level of source distribution. */ -#ifndef __H5T_TAGS_PRIVATE_H -#define __H5T_TAGS_PRIVATE_H +#ifndef __PRIVATE_H5T_TAGS_H +#define __PRIVATE_H5T_TAGS_H #include diff --git a/src/h5core/h5t_types_private.h b/src/h5core/private/h5t_types.h similarity index 96% rename from src/h5core/h5t_types_private.h rename to src/h5core/private/h5t_types.h index fb263da..a9aa46c 100644 --- a/src/h5core/h5t_types_private.h +++ b/src/h5core/private/h5t_types.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,18 +7,18 @@ License: see file COPYING in top level of source distribution. */ -#ifndef __H5T_TYPES_PRIVATE_H -#define __H5T_TYPES_PRIVATE_H +#ifndef __PRIVATE_H5T_TYPES_H +#define __PRIVATE_H5T_TYPES_H #include "h5core/h5_types.h" -#include "h5_types_private.h" -#include "h5_hsearch_private.h" -#include "h5_maps_private.h" +#include "private/h5_types.h" +#include "private/h5_hsearch.h" +#include "private/h5_maps.h" -#include "h5t_ref_elements_private.h" +#include "private/h5t_ref_elements.h" -#include "h5_readwrite_private.h" -#include "h5t_octree_private.h" +#include "private/h5_io.h" +#include "private/h5t_octree.h" typedef struct h5_glb_vertex { diff --git a/src/h5core/h5u_errorhandling_private.h b/src/h5core/private/h5u_errorhandling.h similarity index 89% rename from src/h5core/h5u_errorhandling_private.h rename to src/h5core/private/h5u_errorhandling.h index c51e63a..a1b9129 100644 --- a/src/h5core/h5u_errorhandling_private.h +++ b/src/h5core/private/h5u_errorhandling.h @@ -1,5 +1,5 @@ -#ifndef __H5U_ERRORHANDLING_PRIVATE_H -#define __H5U_ERRORHANDLING_PRIVATE_H +#ifndef __PRIVATE_H5U_ERRORHANDLING_H +#define __PRIVATE_H5U_ERRORHANDLING_H #define HANDLE_H5_SET_VIEW_ERR( f, rc, start, end ) \ h5_error( \ diff --git a/src/h5core/h5u_readwrite_private.h b/src/h5core/private/h5u_io.h similarity index 76% rename from src/h5core/h5u_readwrite_private.h rename to src/h5core/private/h5u_io.h index 9d4426a..a216637 100644 --- a/src/h5core/h5u_readwrite_private.h +++ b/src/h5core/private/h5u_io.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,8 +7,8 @@ License: see file COPYING in top level of source distribution. */ -#ifndef __H5U_READWRITE_PRIVATE_H -#define __H5U_READWRITE_PRIVATE_H +#ifndef __PRIVATE_H5U_IO_H +#define __PRIVATE_H5U_IO_H #include "h5core/h5_types.h" diff --git a/src/h5core/h5u_types_private.h b/src/h5core/private/h5u_types.h similarity index 84% rename from src/h5core/h5u_types_private.h rename to src/h5core/private/h5u_types.h index 5939806..d851885 100644 --- a/src/h5core/h5u_types_private.h +++ b/src/h5core/private/h5u_types.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2006-2015, The Regents of the University of California, + Copyright (c) 2006-2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved. @@ -7,8 +7,8 @@ License: see file COPYING in top level of source distribution. */ -#ifndef __H5U_TYPES_PRIVATE_H -#define __H5U_TYPES_PRIVATE_H +#ifndef __PRIVATE_H5U_TYPES_H +#define __PRIVATE_H5U_TYPES_H #include "h5core/h5_types.h" diff --git a/src/include/H5Block_attribs.h b/src/include/H5Block_attribs.h index 1915161..bcd6b71 100644 --- a/src/include/H5Block_attribs.h +++ b/src/include/H5Block_attribs.h @@ -12,8 +12,7 @@ #include -#include "h5core/h5_types.h" -#include "h5core/h5.h" +#include "h5core/h5_init.h" #include "h5core/h5_debug.h" #include "h5core/h5b_attribs.h" diff --git a/src/include/H5Block_io.h b/src/include/H5Block_io.h index cb818e2..cef9f39 100644 --- a/src/include/H5Block_io.h +++ b/src/include/H5Block_io.h @@ -10,8 +10,7 @@ #ifndef __H5BLOCK_IO_H #define __H5BLOCK_IO_H -#include "h5core/h5_types.h" -#include "h5core/h5.h" +#include "h5core/h5_init.h" #include "h5core/h5_debug.h" #include "h5core/h5b_io.h" @@ -19,136 +18,12 @@ extern "C" { #endif -/* - ! _ _ - ! (_)_ __ __ _ _ _(_)_ __ ___ - ! | | '_ \ / _` | | | | | '__/ _ \ - ! | | | | | (_| | |_| | | | | __/ - ! |_|_| |_|\__, |\__,_|_|_| \___| - ! |_| - ! -*/ - /** \addtogroup h5block_io @{ */ -/** - Query number of fields in current time step. - - \return \c number of fields - \return H5_FAILURE on error -*/ -static inline h5_ssize_t -H5BlockGetNumFields ( - const h5_file_t f ///< [in] file handle. - ) { - H5_API_ENTER (h5_ssize_t, - "f=%p", - (h5_file_p)f); - H5_API_RETURN (h5b_get_num_fields(f)); -} - -/** - Get the name, rank and dimensions of the field specified by the - index \c idx. - - \c elem_rank reports the rank of the elements in the field - (e.g. scalar or vector). - - This function can be used to retrieve all fields bound to the - current time-step by looping from \c 0 to the number of fields - minus one. The number of fields bound to the current time-step - can be queried by calling the function \ref H5BlockGetNumFields. - - \return \c H5_SUCCESS on success - \return \c H5_FAILURE on error -*/ -static inline h5_err_t -H5BlockGetFieldInfo ( - const h5_file_t f, ///< [in] file handle - const h5_size_t idx, ///< [in] index of field - char* name, ///< [out] field name - const h5_size_t len_name, ///< [in] buffer size - h5_size_t* field_rank, ///< [out] field rank - h5_size_t* field_dims, ///< [out] field dimensions - h5_size_t* elem_rank, ///< [out] element rank - h5_int64_t* type ///< [out] datatype - ) { - H5_API_ENTER (h5_err_t, - "f=%p, idx=%llu, " - "name=%p, len_name=%llu, " - "field_rank=%p, field_dims=%p, elem_rank=%p, type=%p", - (h5_file_p)f, (long long unsigned)idx, - name, (long long unsigned)len_name, - field_rank, field_dims, elem_rank, - type); - H5_API_RETURN ( - h5b_get_field_info ( - f, - idx, - name, - len_name, - field_rank, - field_dims, - elem_rank, - type)); -} - -/** - Determines whether a field with a given name exists. - - \return true (value \c >0) if atrribute exists - \return false (\c 0) if attribute does not exist - \return \c H5_FAILURE on error - */ -static inline h5_err_t -H5BlockHasField ( - const h5_file_t f, ///< [in] file handle - const char* name ///< [in] field name - ) { - H5_API_ENTER (h5_err_t, - "f=%p, name='%s'", - (h5_file_p)f, name); - H5_API_RETURN ( - h5b_has_field ( - f, - name)); -} - -/** - Get the rank and dimensions of the field specified by its name. - - \return \c H5_SUCCESS on success - \return \c H5_FAILURE on error - - \see H5BlockGetFieldInfo. -*/ -static inline h5_err_t -H5BlockGetFieldInfoByName ( - const h5_file_t f, ///< [in] file handle - const char* name, ///< [in] field name - h5_size_t* field_rank, ///< [out] field rank - h5_size_t* field_dims, ///< [out] field dimensions - h5_size_t* elem_rank, ///< [out] element rank - h5_int64_t* type ///< [out] datatype - ) { - H5_API_ENTER (h5_err_t, - "f=%p, name='%s', " - "field_rank=%p, field_dims=%p, elem_rank=%p, type=%p", - (h5_file_p)f, name, field_rank, field_dims, elem_rank, type); - H5_API_RETURN ( - h5b_get_field_info_by_name ( - f, - name, - field_rank, - field_dims, - elem_rank, - type)); -} - /* ! _ _ _ ! __ ___ __(_) |_ ___ ___ ___ __ _| | __ _ _ __ @@ -216,7 +91,9 @@ H5Block3dWriteScalarFieldFloat64 ( H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p", (h5_file_p)f, name, buffer); - H5_API_RETURN (h5b_write_scalar_data(f, name, (void*)buffer, H5T_NATIVE_DOUBLE )); + H5_API_RETURN ( + h5b_write_scalar_data ( + f, name, (void*)buffer, H5T_NATIVE_DOUBLE )); } static inline h5_err_t @@ -229,7 +106,9 @@ H5Block3dWriteScalarFieldFloat32 ( H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p", (h5_file_p)f, name, buffer); - H5_API_RETURN (h5b_write_scalar_data(f, name, buffer, H5T_NATIVE_FLOAT )); + H5_API_RETURN ( + h5b_write_scalar_data ( + f, name, buffer, H5T_NATIVE_FLOAT )); } static inline h5_err_t @@ -242,7 +121,9 @@ H5Block3dWriteScalarFieldInt64 ( H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p", (h5_file_p)f, name, buffer); - H5_API_RETURN (h5b_write_scalar_data(f, name, buffer, H5T_NATIVE_INT64 )); + H5_API_RETURN ( + h5b_write_scalar_data ( + f, name, buffer, H5T_NATIVE_INT64 )); } static inline h5_err_t @@ -255,7 +136,9 @@ H5Block3dWriteScalarFieldInt32 ( H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p", (h5_file_p)f, name, buffer); - H5_API_RETURN (h5b_write_scalar_data(f, name, buffer, H5T_NATIVE_INT32 )); + H5_API_RETURN ( + h5b_write_scalar_data ( + f, name, buffer, H5T_NATIVE_INT32 )); } /* @@ -316,7 +199,9 @@ H5Block3dReadScalarFieldFloat64 ( H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p", (h5_file_p)f, name, buffer); - H5_API_RETURN (h5b_read_scalar_data(f, name, (void*)buffer, H5T_NATIVE_DOUBLE)); + H5_API_RETURN ( + h5b_read_scalar_data ( + f, name, (void*)buffer, H5T_NATIVE_DOUBLE)); } static inline h5_err_t @@ -329,7 +214,9 @@ H5Block3dReadScalarFieldFloat32 ( H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p", (h5_file_p)f, name, buffer); - H5_API_RETURN (h5b_read_scalar_data(f, name, buffer, H5T_NATIVE_FLOAT)); + H5_API_RETURN ( + h5b_read_scalar_data ( + f, name, buffer, H5T_NATIVE_FLOAT)); } static inline h5_err_t @@ -342,7 +229,9 @@ H5Block3dReadScalarFieldInt64 ( H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p", (h5_file_p)f, name, buffer); - H5_API_RETURN (h5b_read_scalar_data(f, name, buffer, H5T_NATIVE_INT64)); + H5_API_RETURN ( + h5b_read_scalar_data ( + f, name, buffer, H5T_NATIVE_INT64)); } static inline h5_err_t @@ -355,7 +244,9 @@ H5Block3dReadScalarFieldInt32 ( H5_API_ENTER (h5_err_t, "f=%p, name='%s', buffer=%p", (h5_file_p)f, name, buffer); - H5_API_RETURN (h5b_read_scalar_data(f, name, buffer, H5T_NATIVE_INT32)); + H5_API_RETURN ( + h5b_read_scalar_data ( + f, name, buffer, H5T_NATIVE_INT32)); } /* @@ -438,8 +329,11 @@ H5Block3dWriteVector3dFieldFloat64 ( H5_API_ENTER (h5_err_t, "f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p", (h5_file_p)f, name, x_buf, y_buf, z_buf); - H5_API_RETURN(h5b_write_vector3d_data(f, name, - (void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_DOUBLE)); + H5_API_RETURN ( + h5b_write_vector3d_data( + f, name, + (void*)x_buf, (void*)y_buf, (void*)z_buf, + H5T_NATIVE_DOUBLE)); } static inline h5_err_t @@ -454,8 +348,11 @@ H5Block3dWriteVector3dFieldFloat32 ( H5_API_ENTER (h5_err_t, "f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p", (h5_file_p)f, name, x_buf, y_buf, z_buf); - H5_API_RETURN(h5b_write_vector3d_data(f, name, - x_buf, y_buf, z_buf, H5T_NATIVE_FLOAT)); + H5_API_RETURN( + h5b_write_vector3d_data ( + f, name, + x_buf, y_buf, z_buf, + H5T_NATIVE_FLOAT)); } static inline h5_err_t @@ -470,8 +367,11 @@ H5Block3dWriteVector3dFieldInt64 ( H5_API_ENTER (h5_err_t, "f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p", (h5_file_p)f, name, x_buf, y_buf, z_buf); - H5_API_RETURN (h5b_write_vector3d_data(f, name, - x_buf, y_buf, z_buf, H5T_NATIVE_INT64)); + H5_API_RETURN ( + h5b_write_vector3d_data ( + f, name, + x_buf, y_buf, z_buf, + H5T_NATIVE_INT64)); } static inline h5_err_t @@ -486,8 +386,11 @@ H5Block3dWriteVector3dFieldInt32 ( H5_API_ENTER (h5_err_t, "f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p", (h5_file_p)f, name, x_buf, y_buf, z_buf); - H5_API_RETURN(h5b_write_vector3d_data(f, name, - x_buf, y_buf, z_buf, H5T_NATIVE_INT32)); + H5_API_RETURN ( + h5b_write_vector3d_data( + f, name, + x_buf, y_buf, z_buf, + H5T_NATIVE_INT32)); } /* @@ -564,8 +467,11 @@ H5Block3dReadVector3dFieldFloat64 ( H5_API_ENTER (h5_err_t, "f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p", (h5_file_p)f, name, x_buf, y_buf, z_buf); - H5_API_RETURN(h5b_read_vector3d_data(f, name, - x_buf, y_buf, z_buf, H5T_NATIVE_DOUBLE)); + H5_API_RETURN ( + h5b_read_vector3d_data ( + f, name, + x_buf, y_buf, z_buf, + H5T_NATIVE_DOUBLE)); } static inline h5_err_t @@ -580,8 +486,11 @@ H5Block3dReadVector3dFieldFloat32 ( H5_API_ENTER (h5_err_t, "f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p", (h5_file_p)f, name, x_buf, y_buf, z_buf); - H5_API_RETURN(h5b_read_vector3d_data(f, name, - x_buf, y_buf, z_buf, H5T_NATIVE_FLOAT)); + H5_API_RETURN ( + h5b_read_vector3d_data ( + f, name, + x_buf, y_buf, z_buf, + H5T_NATIVE_FLOAT)); } static inline h5_err_t @@ -596,8 +505,11 @@ H5Block3dReadVector3dFieldInt64 ( H5_API_ENTER (h5_err_t, "f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p", (h5_file_p)f, name, x_buf, y_buf, z_buf); - H5_API_RETURN (h5b_read_vector3d_data(f, name, - x_buf, y_buf, z_buf, H5T_NATIVE_INT64)); + H5_API_RETURN ( + h5b_read_vector3d_data ( + f, name, + x_buf, y_buf, z_buf, + H5T_NATIVE_INT64)); } static inline h5_err_t @@ -612,8 +524,11 @@ H5Block3dReadVector3dFieldInt32 ( H5_API_ENTER (h5_err_t, "f=%p, name='%s', x_buf=%p, y_buf=%p, z_buf=%p", (h5_file_p)f, name, x_buf, y_buf, z_buf); - H5_API_RETURN(h5b_read_vector3d_data(f, name, - x_buf, y_buf, z_buf, H5T_NATIVE_INT32)); + H5_API_RETURN ( + h5b_read_vector3d_data ( + f, name, + x_buf, y_buf, z_buf, + H5T_NATIVE_INT32)); } ///< @} diff --git a/src/include/H5Block_model.h b/src/include/H5Block_model.h index 6e0faef..f656c41 100644 --- a/src/include/H5Block_model.h +++ b/src/include/H5Block_model.h @@ -10,8 +10,7 @@ #ifndef __H5BLOCK_MODEL #define __H5BLOCK_MODEL -#include "h5core/h5_types.h" -#include "h5core/h5.h" +#include "h5core/h5_init.h" #include "h5core/h5_debug.h" #include "h5core/h5b_model.h" @@ -24,7 +23,15 @@ extern "C" { #endif -/********************** defining the layout **********************************/ +/* + ! _ _ + ! (_)_ __ __ _ _ _(_)_ __ ___ + ! | | '_ \ / _` | | | | | '__/ _ \ + ! | | | | | (_| | |_| | | | | __/ + ! |_|_| |_|\__, |\__,_|_|_| \___| + ! |_| + ! +*/ /** Checks whether the current time-step has field data or not. @@ -43,6 +50,124 @@ H5BlockHasFieldData ( H5_API_RETURN (h5b_has_field_data (f)); } + +/** + Query number of fields in current time step. + + \return \c number of fields + \return H5_FAILURE on error +*/ +static inline h5_ssize_t +H5BlockGetNumFields ( + const h5_file_t f ///< [in] file handle. + ) { + H5_API_ENTER (h5_ssize_t, + "f=%p", + (h5_file_p)f); + H5_API_RETURN (h5b_get_num_fields(f)); +} + +/** + Get the name, rank and dimensions of the field specified by the + index \c idx. + + \c elem_rank reports the rank of the elements in the field + (e.g. scalar or vector). + + This function can be used to retrieve all fields bound to the + current time-step by looping from \c 0 to the number of fields + minus one. The number of fields bound to the current time-step + can be queried by calling the function \ref H5BlockGetNumFields. + + \return \c H5_SUCCESS on success + \return \c H5_FAILURE on error +*/ +static inline h5_err_t +H5BlockGetFieldInfo ( + const h5_file_t f, ///< [in] file handle + const h5_size_t idx, ///< [in] index of field + char* name, ///< [out] field name + const h5_size_t len_name, ///< [in] buffer size + h5_size_t* field_rank, ///< [out] field rank + h5_size_t* field_dims, ///< [out] field dimensions + h5_size_t* elem_rank, ///< [out] element rank + h5_int64_t* type ///< [out] datatype + ) { + H5_API_ENTER (h5_err_t, + "f=%p, idx=%llu, " + "name=%p, len_name=%llu, " + "field_rank=%p, field_dims=%p, elem_rank=%p, type=%p", + (h5_file_p)f, (long long unsigned)idx, + name, (long long unsigned)len_name, + field_rank, field_dims, elem_rank, + type); + H5_API_RETURN ( + h5b_get_field_info ( + f, + idx, + name, + len_name, + field_rank, + field_dims, + elem_rank, + type)); +} + +/** + Determines whether a field with a given name exists. + + \return true (value \c >0) if atrribute exists + \return false (\c 0) if attribute does not exist + \return \c H5_FAILURE on error + */ +static inline h5_err_t +H5BlockHasField ( + const h5_file_t f, ///< [in] file handle + const char* name ///< [in] field name + ) { + H5_API_ENTER (h5_err_t, + "f=%p, name='%s'", + (h5_file_p)f, name); + H5_API_RETURN ( + h5b_has_field ( + f, + name)); +} + +/** + Get the rank and dimensions of the field specified by its name. + + \return \c H5_SUCCESS on success + \return \c H5_FAILURE on error + + \see H5BlockGetFieldInfo. +*/ +static inline h5_err_t +H5BlockGetFieldInfoByName ( + const h5_file_t f, ///< [in] file handle + const char* name, ///< [in] field name + h5_size_t* field_rank, ///< [out] field rank + h5_size_t* field_dims, ///< [out] field dimensions + h5_size_t* elem_rank, ///< [out] element rank + h5_int64_t* type ///< [out] datatype + ) { + H5_API_ENTER (h5_err_t, + "f=%p, name='%s', " + "field_rank=%p, field_dims=%p, elem_rank=%p, type=%p", + (h5_file_p)f, name, field_rank, field_dims, + elem_rank, type); + H5_API_RETURN ( + h5b_get_field_info_by_name ( + f, + name, + field_rank, + field_dims, + elem_rank, + type)); +} + +/********************** defining the layout **********************************/ + /** Tests whether a view has been set, either directly with \ref H5Block3dSetView or indirectly with \ref H5Block3dSetGrid. diff --git a/src/include/H5Fed_adjacency.h b/src/include/H5Fed_adjacency.h index 9676cd9..e3c4585 100644 --- a/src/include/H5Fed_adjacency.h +++ b/src/include/H5Fed_adjacency.h @@ -11,7 +11,7 @@ #define __H5FED_ADJACENCY_H #include "h5core/h5_types.h" -#include "h5core/h5.h" +#include "h5core/h5_init.h" #include "h5core/h5_debug.h" #include "h5core/h5t_adjacencies.h" diff --git a/src/include/H5Fed_model.h b/src/include/H5Fed_model.h index db12064..f713e2b 100644 --- a/src/include/H5Fed_model.h +++ b/src/include/H5Fed_model.h @@ -11,7 +11,7 @@ #define __H5FED_MODEL_H #include "h5core/h5_types.h" -#include "h5core/h5.h" +#include "h5core/h5_init.h" #include "h5core/h5_debug.h" #include "h5core/h5t_model.h" diff --git a/src/include/H5Fed_retrieve.h b/src/include/H5Fed_retrieve.h index 87b36ad..49431d3 100644 --- a/src/include/H5Fed_retrieve.h +++ b/src/include/H5Fed_retrieve.h @@ -11,7 +11,7 @@ #define __H5FED_RETRIEVE_H #include "h5core/h5_types.h" -#include "h5core/h5.h" +#include "h5core/h5_init.h" #include "h5core/h5_debug.h" #include "h5core/h5_syscall.h" #include "h5core/h5t_map.h" diff --git a/src/include/H5Fed_store.h b/src/include/H5Fed_store.h index 7b354c4..6edf5b9 100644 --- a/src/include/H5Fed_store.h +++ b/src/include/H5Fed_store.h @@ -11,7 +11,7 @@ #define __H5FED_STORE_H #include "h5core/h5_types.h" -#include "h5core/h5.h" +#include "h5core/h5_init.h" #include "h5core/h5_debug.h" #include "h5core/h5t_store.h" diff --git a/src/include/H5Fed_tags.h b/src/include/H5Fed_tags.h index 14e923f..109dabb 100644 --- a/src/include/H5Fed_tags.h +++ b/src/include/H5Fed_tags.h @@ -11,7 +11,7 @@ #define __H5FED_TAGS_H #include "h5core/h5_types.h" -#include "h5core/h5.h" +#include "h5core/h5_init.h" #include "h5core/h5_debug.h" #include "h5core/h5t_tags.h" diff --git a/src/include/H5Part_io.h b/src/include/H5Part_io.h index 4509606..350d96b 100644 --- a/src/include/H5Part_io.h +++ b/src/include/H5Part_io.h @@ -10,203 +10,19 @@ #ifndef H5PART_IO #define H5PART_IO -#include "h5core/h5_types.h" -#include "h5core/h5.h" +#include "h5core/h5_init.h" #include "h5core/h5_debug.h" #include "h5core/h5u_io.h" -#include "h5core/h5u_model.h" #ifdef __cplusplus extern "C" { #endif -/* - ! _ _ - ! (_)_ __ __ _ _ _(_)_ __ ___ - ! | | '_ \ / _` | | | | | '__/ _ \ - ! | | | | | (_| | |_| | | | | __/ - ! |_|_| |_|\__, |\__,_|_|_| \___| - ! |_| - ! -*/ /** \addtogroup h5part_io @{ */ -/** - Get the number of datasets that are stored at the current step. - - \return number of datasets in current timestep - \return \c H5_FAILURE on error -*/ -static inline h5_ssize_t -H5PartGetNumDatasets ( - const h5_file_t f ///< [in] file handle - ) { - H5_API_ENTER (h5_err_t, - "f=%p", - (h5_file_p)f); - H5_API_RETURN (h5u_get_num_datasets(f)); -} - -/** - Query the name of a dataset given by it's index in the current step. - - If the number of datasets is \c n, the range of \c _index is \c 0 to \c n-1. - - \return \c H5_SUCCESS on success - \return \c H5_FAILURE on error -*/ -static inline h5_err_t -H5PartGetDatasetName ( - const h5_file_t f, ///< [in] file handle - const h5_id_t idx, ///< [in] index of the dataset - char* name, ///< [out] name of dataset - const h5_size_t len ///< [in] size of buffer \c name - ) { - H5_API_ENTER (h5_err_t, - "f=%p, " - "idx=%lld, " - "name='%p', len=%llu, ", - (h5_file_p)f, - (long long)idx, - name, (unsigned long long)len); - H5_API_RETURN (h5u_get_dataset_info(f, idx, name, len, NULL, NULL)); -} - -/** - Gets the name, type and number of elements of a dataset based on its - index in the current timestep. - - Type is one of the following values: - - - \c H5_FLOAT64_T (for \c h5_float64_t) - - \c H5_FLOAT32_T (for \c h5_float32_t) - - \c H5_INT64_T (for \c h5_int64_t) - - \c H5_INT32_T (for \c h5_int32_t) - - \return \c H5_SUCCESS on success - \return \c H5_FAILURE on error - - \see H5PartGetNumDatasets() - \see H5PartGetDatasetInfoByName() -*/ -static inline h5_err_t -H5PartGetDatasetInfo ( - const h5_file_t f, ///< [in] file handle - const h5_id_t idx, ///< [in] index of the dataset - char* name, ///< [out] name of dataset - const h5_size_t len_name, ///< [in] size of buffer \c name - h5_int64_t* type, ///< [out] type of data in dataset - h5_size_t* nelems ///< [out] number of elements - ) { - H5_API_ENTER (h5_int64_t, - "f=%p, " - "idx=%lld, " - "name='%p', len_name=%llu, " - "type=%p, nelems=%p", - (h5_file_p)f, - (long long)idx, - name, (long long unsigned)len_name, - type, nelems); - H5_API_RETURN (h5u_get_dataset_info ( - f, idx, name, len_name, type, nelems)); -} -/** - Determines whether a dataset with given name exists in current step. - - \return true (value \c >0) if step exists - \return false (\c 0) if step does not exist - \return \c H5_FAILURE on error -*/ -static inline h5_err_t -H5PartHasDataset ( - const h5_file_t f, ///< [in] file handle - const char* const name ///< [in] name of dataset - ) { - H5_API_ENTER (h5_int64_t, - "f=%p, name='%s'", - (h5_file_p)f, name); - H5_API_RETURN (h5u_has_dataset (f, name)); -} - -/** - Gets the type and number of elements of a dataset based on its - name in the current timestep. - - Type is one of the following values: - - - \c H5_FLOAT64_T (for \c h5_float64_t) - - \c H5_FLOAT32_T (for \c h5_float32_t) - - \c H5_INT64_T (for \c h5_int64_t) - - \c H5_INT32_T (for \c h5_int32_t) - - \return \c H5_SUCCESS on success - \return \c H5_FAILURE on error - - \see H5PartHasDataset() - \see H5PartGetDatasetInfo() -*/ -static inline h5_err_t -H5PartGetDatasetInfoByName ( - const h5_file_t f, ///< [in] file handle - const char* const name, ///< [in] name of dataset - h5_int64_t* type, ///< [out] type of data in dataset - h5_size_t* nelems ///< [out] number of elements - ) { - H5_API_ENTER (h5_int64_t, - "f=%p, " - "name='%s', " - "type=%p, nelems=%p", - (h5_file_p)f, - name, - type, nelems); - H5_API_RETURN (h5u_get_dataset_info_by_name ( - f, name, type, nelems)); -} - -/** - This function returns the number of particles in this processor's view, - if a view has been set. - - If not, it returns the total number of particles across all processors - from the last \ref H5PartSetNumParticles() call. - - If you have neither set the number of particles - nor set a view, then this returns the total number of - particles in the first data set of the current time step. - Note that H5Part assumes that all data sets within a given time step - have the same number of particles (although the number particles can - vary across time steps). - - If none of these conditions are met, an error is thrown. - - \return number of elements in datasets in current step. - \return \c H5_FAILURE on error. - */ - static inline h5_ssize_t -H5PartGetNumPoints ( - const h5_file_t f ///< [in] file handle. - ) { - H5_API_ENTER (h5_ssize_t, - "f=%p", - (h5_file_p)f); - H5_API_RETURN (h5u_get_num_points (f)); -} - -/** - \see H5PartGetNumPoints() -*/ -static inline h5_ssize_t -H5PartGetNumParticles ( - const h5_file_t f ///< [in] file handle. - ) { - H5_API_ENTER (h5_ssize_t, - "f=%p", - (h5_file_p)f); - H5_API_RETURN (h5u_get_num_points (f)); -} /* ! _ _ diff --git a/src/include/H5Part_model.h b/src/include/H5Part_model.h index c72c8d1..5579af8 100644 --- a/src/include/H5Part_model.h +++ b/src/include/H5Part_model.h @@ -10,8 +10,7 @@ #ifndef H5PART_MODEL #define H5PART_MODEL -#include "h5core/h5_types.h" -#include "h5core/h5.h" +#include "h5core/h5_init.h" #include "h5core/h5_debug.h" #include "h5core/h5u_model.h" @@ -24,6 +23,148 @@ extern "C" { #endif +/* + ! _ _ + ! (_)_ __ __ _ _ _(_)_ __ ___ + ! | | '_ \ / _` | | | | | '__/ _ \ + ! | | | | | (_| | |_| | | | | __/ + ! |_|_| |_|\__, |\__,_|_|_| \___| + ! |_| + ! +*/ + +/** + Get the number of datasets that are stored at the current step. + + \return number of datasets in current timestep + \return \c H5_FAILURE on error +*/ +static inline h5_ssize_t +H5PartGetNumDatasets ( + const h5_file_t f ///< [in] file handle + ) { + H5_API_ENTER (h5_err_t, + "f=%p", + (h5_file_p)f); + H5_API_RETURN (h5u_get_num_datasets(f)); +} + +/** + Query the name of a dataset given by it's index in the current step. + + If the number of datasets is \c n, the range of \c _index is \c 0 to \c n-1. + + \return \c H5_SUCCESS on success + \return \c H5_FAILURE on error +*/ +static inline h5_err_t +H5PartGetDatasetName ( + const h5_file_t f, ///< [in] file handle + const h5_id_t idx, ///< [in] index of the dataset + char* name, ///< [out] name of dataset + const h5_size_t len ///< [in] size of buffer \c name + ) { + H5_API_ENTER (h5_err_t, + "f=%p, " + "idx=%lld, " + "name='%p', len=%llu, ", + (h5_file_p)f, + (long long)idx, + name, (unsigned long long)len); + H5_API_RETURN (h5u_get_dataset_info(f, idx, name, len, NULL, NULL)); +} + +/** + Gets the name, type and number of elements of a dataset based on its + index in the current timestep. + + Type is one of the following values: + + - \c H5_FLOAT64_T (for \c h5_float64_t) + - \c H5_FLOAT32_T (for \c h5_float32_t) + - \c H5_INT64_T (for \c h5_int64_t) + - \c H5_INT32_T (for \c h5_int32_t) + + \return \c H5_SUCCESS on success + \return \c H5_FAILURE on error + + \see H5PartGetNumDatasets() + \see H5PartGetDatasetInfoByName() +*/ +static inline h5_err_t +H5PartGetDatasetInfo ( + const h5_file_t f, ///< [in] file handle + const h5_id_t idx, ///< [in] index of the dataset + char* name, ///< [out] name of dataset + const h5_size_t len_name, ///< [in] size of buffer \c name + h5_int64_t* type, ///< [out] type of data in dataset + h5_size_t* nelems ///< [out] number of elements + ) { + H5_API_ENTER (h5_int64_t, + "f=%p, " + "idx=%lld, " + "name='%p', len_name=%llu, " + "type=%p, nelems=%p", + (h5_file_p)f, + (long long)idx, + name, (long long unsigned)len_name, + type, nelems); + H5_API_RETURN (h5u_get_dataset_info ( + f, idx, name, len_name, type, nelems)); +} +/** + Determines whether a dataset with given name exists in current step. + + \return true (value \c >0) if step exists + \return false (\c 0) if step does not exist + \return \c H5_FAILURE on error +*/ +static inline h5_err_t +H5PartHasDataset ( + const h5_file_t f, ///< [in] file handle + const char* const name ///< [in] name of dataset + ) { + H5_API_ENTER (h5_int64_t, + "f=%p, name='%s'", + (h5_file_p)f, name); + H5_API_RETURN (h5u_has_dataset (f, name)); +} + +/** + Gets the type and number of elements of a dataset based on its + name in the current timestep. + + Type is one of the following values: + + - \c H5_FLOAT64_T (for \c h5_float64_t) + - \c H5_FLOAT32_T (for \c h5_float32_t) + - \c H5_INT64_T (for \c h5_int64_t) + - \c H5_INT32_T (for \c h5_int32_t) + + \return \c H5_SUCCESS on success + \return \c H5_FAILURE on error + + \see H5PartHasDataset() + \see H5PartGetDatasetInfo() +*/ +static inline h5_err_t +H5PartGetDatasetInfoByName ( + const h5_file_t f, ///< [in] file handle + const char* const name, ///< [in] name of dataset + h5_int64_t* type, ///< [out] type of data in dataset + h5_size_t* nelems ///< [out] number of elements + ) { + H5_API_ENTER (h5_int64_t, + "f=%p, " + "name='%s', " + "type=%p, nelems=%p", + (h5_file_p)f, + name, + type, nelems); + H5_API_RETURN (h5u_get_dataset_info_by_name ( + f, name, type, nelems)); +} + /** Set the number of points/particles for the current time-step. After you call this subroutine, all subsequent @@ -77,6 +218,49 @@ H5PartSetNumParticles ( H5_API_RETURN (h5u_set_num_points (f, nparticles, stride)); } +/** + This function returns the number of particles in this processor's view, + if a view has been set. + + If not, it returns the total number of particles across all processors + from the last \ref H5PartSetNumParticles() call. + + If you have neither set the number of particles + nor set a view, then this returns the total number of + particles in the first data set of the current time step. + Note that H5Part assumes that all data sets within a given time step + have the same number of particles (although the number particles can + vary across time steps). + + If none of these conditions are met, an error is thrown. + + \return number of elements in datasets in current step. + \return \c H5_FAILURE on error. + */ + static inline h5_ssize_t +H5PartGetNumPoints ( + const h5_file_t f ///< [in] file handle. + ) { + H5_API_ENTER (h5_ssize_t, + "f=%p", + (h5_file_p)f); + H5_API_RETURN (h5u_get_num_points (f)); +} + +/** + \see H5PartGetNumPoints() +*/ +static inline h5_ssize_t +H5PartGetNumParticles ( + const h5_file_t f ///< [in] file handle. + ) { + H5_API_ENTER (h5_ssize_t, + "f=%p", + (h5_file_p)f); + H5_API_RETURN (h5u_get_num_points (f)); +} + + /** Set the number of particles for the current time-step. After you call this subroutine, all subsequent diff --git a/src/include/H5_attachments.h b/src/include/H5_attachments.h new file mode 100644 index 0000000..2b52746 --- /dev/null +++ b/src/include/H5_attachments.h @@ -0,0 +1,155 @@ +/* + Copyright (c) 2006-2016, The Regents of the University of California, + through Lawrence Berkeley National Laboratory (subject to receipt of any + required approvals from the U.S. Dept. of Energy) and the Paul Scherrer + Institut (Switzerland). All rights reserved. + + License: see file COPYING in top level of source distribution. +*/ + +#ifndef __H5_ATTACHMENTS_H +#define __H5_ATTACHMENTS_H + +#include "h5core/h5_init.h" +#include "h5core/h5_debug.h" +#include "h5core/h5_model.h" +#include "h5core/h5_attachments.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + \addtogroup h5_attach + @{ +*/ + +/** + Return number of attached files. + + \return number of attachments. + \return \c H5_FAILURE on error. +*/ +static inline h5_ssize_t +H5GetNumAttachments ( + const h5_file_t f ///< [in] file handle. + ) { + H5_API_ENTER (h5_ssize_t, + "f=%p", + (h5_file_p)f); + H5_API_RETURN (h5_get_num_attachments (f)); +} + +/** + Get name and size of attachment given by index \c idx. Return the file name + in \c fname and the original size in \c fsize. + + \return \c H5_SUCCESS on success + \return \c H5_FAILURE on error +*/ +static inline h5_err_t +H5GetAttachmentInfoByIdx ( + const h5_file_t f, ///< [in] file handle. + const h5_size_t idx, ///< [in] index of attachment to be queried. + char* const fname, ///< [out] original file name. + h5_size_t len_fname, ///< [in] max length of file name. + h5_size_t* const fsize ///< [out] size of original file. + ) { + H5_API_ENTER (h5_err_t, + "idx=%llu, fname=%p, len_fname=%llu, fsize=%p", + (long long unsigned)idx, + fname, (long long unsigned)len_fname, + fsize); + H5_API_RETURN (h5_get_attachment_info_by_idx ( + f, idx, fname, len_fname, fsize)); +} + +/** + Query whether a particular attachment exists in the file. + + \return true (value \c >0) if attachment exists + \return false (\c 0) if attachment does not exist + \return \c H5_FAILURE on error +*/ +static inline h5_err_t +H5HasAttachment ( + const h5_file_t f, ///< [in] file handle. + const char* const fname ///< [in] original file name. + ) { + H5_API_ENTER (h5_err_t, + "f=%p, name='%s'", + (h5_file_p)f, fname); + H5_API_RETURN (h5_has_attachment (f, fname)); +} + +/** + Get size of attached file with name \c fname. + + \return \c H5_SUCCESS on success + \return \c H5_FAILURE on error +*/ +static inline h5_err_t +H5GetAttachmentInfoByName ( + const h5_file_t f, ///< [in] file handle. + char* const fname, ///< [in] original file name. + h5_size_t* const fsize ///< [out] size of original file. + ) { + H5_API_ENTER (h5_err_t, "fname='%s', fsize=%p", fname, fsize); + H5_API_RETURN (h5_get_attachment_info_by_name ( + f, fname, fsize)); +} + +/** + Attach file \c fname. + + \return \c H5_SUCCESS on success + \return \c H5_FAILURE on error +*/ +static inline h5_err_t +H5AddAttachment ( + const h5_file_t f, ///< [in] file handle. + const char* fname ///< [in] name of file to attach. + ) { + H5_API_ENTER (h5_err_t, "fname='%s'", fname); + H5_API_RETURN (h5_add_attachment (f, fname)); +} + +/** + Get attachment \c fname from H5hut file and write it to disk in + the current working directory. + + \return \c H5_SUCCESS on success + \return \c H5_FAILURE on error +*/ +static inline h5_err_t +H5GetAttachment ( + const h5_file_t f, ///< [in] file handle. + const char* fname ///< [in] name of attachment. + ) { + H5_API_ENTER (h5_err_t, "fname='%s'", fname); + H5_API_RETURN (h5_get_attachment (f, fname)); +} + +/** + Delete attachment \c fname. + + \return \c H5_SUCCESS on success + \return \c H5_FAILURE on error +*/ +static inline h5_err_t +H5DeleteAttachment ( + const h5_file_t f, ///< [in] file handle. + const char* const fname ///< [in] name of attachment. + ) { + H5_API_ENTER (h5_err_t, "fname='%s'", fname); + H5_API_RETURN (h5_delete_attachment (f, fname)); +} +/** + @} +*/ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/include/H5_debug.h b/src/include/H5_debug.h index 397f64f..504fbac 100644 --- a/src/include/H5_debug.h +++ b/src/include/H5_debug.h @@ -10,7 +10,8 @@ #ifndef __H5_DEBUG_H #define __H5_DEBUG_H -#include "h5core/h5_types.h" +#include "h5core/h5_init.h" +#include "h5core/h5_debug.h" /** \addtogroup h5_debug diff --git a/src/include/H5_error.h b/src/include/H5_error.h index 852b7a4..47d13fa 100644 --- a/src/include/H5_error.h +++ b/src/include/H5_error.h @@ -10,8 +10,7 @@ #ifndef __H5_ERROR_H #define __H5_ERROR_H -#include "h5core/h5_types.h" -#include "h5core/h5.h" +#include "h5core/h5_init.h" #include "h5core/h5_debug.h" /** diff --git a/src/include/H5_file.h b/src/include/H5_file.h index 67bc6f6..d1bc1fd 100644 --- a/src/include/H5_file.h +++ b/src/include/H5_file.h @@ -10,9 +10,11 @@ #ifndef __H5_FILE_H #define __H5_FILE_H -#include "h5core/h5_types.h" -#include "h5core/h5.h" +#include "h5core/h5_init.h" #include "h5core/h5_debug.h" +#include "h5core/h5_file.h" + +#include #ifdef __cplusplus extern "C" { diff --git a/src/include/H5_file_attribs.h b/src/include/H5_file_attribs.h index 036b1b5..3bcfe65 100644 --- a/src/include/H5_file_attribs.h +++ b/src/include/H5_file_attribs.h @@ -12,10 +12,9 @@ #include -#include "h5core/h5_types.h" -#include "h5core/h5.h" +#include "h5core/h5_init.h" #include "h5core/h5_debug.h" -#include "h5core/h5_attribs.h" +#include "h5core/h5_file_attribs.h" #ifdef __cplusplus extern "C" { diff --git a/src/include/H5_model.h b/src/include/H5_model.h index 78952ef..f8cd3b8 100644 --- a/src/include/H5_model.h +++ b/src/include/H5_model.h @@ -10,8 +10,7 @@ #ifndef __H5_MODEL_H #define __H5_MODEL_H -#include "h5core/h5_types.h" -#include "h5core/h5.h" +#include "h5core/h5_init.h" #include "h5core/h5_debug.h" #include "h5core/h5_model.h" @@ -97,22 +96,6 @@ H5GetStep ( H5_API_RETURN (h5_get_step (f)); } -/** - Get the number of processors. - - \return Number of processors. - \return \c H5_FAILURE on error. - */ -static inline int -H5GetNumProcs ( - const h5_file_t f ///< [in] file handle. - ) { - H5_API_ENTER (h5_err_t, - "f=%p", - (h5_file_p)f); - H5_API_RETURN (h5_get_num_procs(f)); -} - /** Get the number of time-steps that are currently stored in the file \c f. @@ -152,175 +135,27 @@ H5HasStep ( } /** - Start traversing steps. + Get the number of processors. - \note This function is not yet implemented! - - \return \c H5_SUCCESS on success - \return \c H5_FAILURE on error -*/ -static inline h5_err_t -H5StartTraverseSteps ( + \return Number of processors. + \return \c H5_FAILURE on error. + */ +static inline int +H5GetNumProcs ( const h5_file_t f ///< [in] file handle. ) { H5_API_ENTER (h5_err_t, "f=%p", (h5_file_p)f); - H5_API_RETURN (h5_start_traverse_steps (f)); + H5_API_RETURN (h5_get_num_procs(f)); } -/** - Go to next step. - - \note This function is not yet implemented! - - \return \c H5_SUCCESS on success - \return \c H5_FAILURE on error -*/ -static inline h5_err_t -H5TraverseSteps ( - const h5_file_t f ///< [in] file handle. - ) { - H5_API_ENTER (h5_err_t, - "f=%p", - (h5_file_p)f); - H5_API_RETURN (h5_traverse_steps (f)); -} /** @} */ - -/** - \addtogroup h5_attach - @{ -*/ - -/** - Return number of attached files. - - \return number of attachments. - \return \c H5_FAILURE on error. -*/ -static inline h5_ssize_t -H5GetNumAttachments ( - const h5_file_t f ///< [in] file handle. - ) { - H5_API_ENTER (h5_ssize_t, - "f=%p", - (h5_file_p)f); - H5_API_RETURN (h5_get_num_attachments (f)); -} - -/** - Get name and size of attachment given by index \c idx. Return the file name - in \c fname and the original size in \c fsize. - - \return \c H5_SUCCESS on success - \return \c H5_FAILURE on error -*/ -static inline h5_err_t -H5GetAttachmentInfoByIdx ( - const h5_file_t f, ///< [in] file handle. - const h5_size_t idx, ///< [in] index of attachment to be queried. - char* const fname, ///< [out] original file name. - h5_size_t len_fname, ///< [in] max length of file name. - h5_size_t* const fsize ///< [out] size of original file. - ) { - H5_API_ENTER (h5_err_t, - "idx=%llu, fname=%p, len_fname=%llu, fsize=%p", - (long long unsigned)idx, - fname, (long long unsigned)len_fname, - fsize); - H5_API_RETURN (h5_get_attachment_info_by_idx ( - f, idx, fname, len_fname, fsize)); -} - -/** - Query whether a particular attachment exists in the file. - - \return true (value \c >0) if attachment exists - \return false (\c 0) if attachment does not exist - \return \c H5_FAILURE on error -*/ -static inline h5_err_t -H5HasAttachment ( - const h5_file_t f, ///< [in] file handle. - const char* const fname ///< [in] original file name. - ) { - H5_API_ENTER (h5_err_t, - "f=%p, name='%s'", - (h5_file_p)f, fname); - H5_API_RETURN (h5_has_attachment (f, fname)); -} - -/** - Get size of attached file with name \c fname. - - \return \c H5_SUCCESS on success - \return \c H5_FAILURE on error -*/ -static inline h5_err_t -H5GetAttachmentInfoByName ( - const h5_file_t f, ///< [in] file handle. - char* const fname, ///< [in] original file name. - h5_size_t* const fsize ///< [out] size of original file. - ) { - H5_API_ENTER (h5_err_t, "fname='%s', fsize=%p", fname, fsize); - H5_API_RETURN (h5_get_attachment_info_by_name ( - f, fname, fsize)); -} - -/** - Attach file \c fname. - - \return \c H5_SUCCESS on success - \return \c H5_FAILURE on error -*/ -static inline h5_err_t -H5AddAttachment ( - const h5_file_t f, ///< [in] file handle. - const char* fname ///< [in] name of file to attach. - ) { - H5_API_ENTER (h5_err_t, "fname='%s'", fname); - H5_API_RETURN (h5_add_attachment (f, fname)); -} - -/** - Get attachment \c fname from H5hut file and write it to disk in - the current working directory. - - \return \c H5_SUCCESS on success - \return \c H5_FAILURE on error -*/ -static inline h5_err_t -H5GetAttachment ( - const h5_file_t f, ///< [in] file handle. - const char* fname ///< [in] name of attachment. - ) { - H5_API_ENTER (h5_err_t, "fname='%s'", fname); - H5_API_RETURN (h5_get_attachment (f, fname)); -} - -/** - Delete attachment \c fname. - - \return \c H5_SUCCESS on success - \return \c H5_FAILURE on error -*/ -static inline h5_err_t -H5DeleteAttachment ( - const h5_file_t f, ///< [in] file handle. - const char* const fname ///< [in] name of attachment. - ) { - H5_API_ENTER (h5_err_t, "fname='%s'", fname); - H5_API_RETURN (h5_delete_attachment (f, fname)); -} #ifdef __cplusplus } #endif -///< @} #endif - - diff --git a/src/include/H5_step_attribs.h b/src/include/H5_step_attribs.h index d753f48..57fef67 100644 --- a/src/include/H5_step_attribs.h +++ b/src/include/H5_step_attribs.h @@ -12,10 +12,9 @@ #include -#include "h5core/h5_types.h" -#include "h5core/h5.h" +#include "h5core/h5_init.h" #include "h5core/h5_debug.h" -#include "h5core/h5_attribs.h" +#include "h5core/h5_step_attribs.h" #ifdef __cplusplus extern "C" { diff --git a/src/include/H5hut.h b/src/include/H5hut.h index c0eaed4..6c02c89 100644 --- a/src/include/H5hut.h +++ b/src/include/H5hut.h @@ -14,7 +14,7 @@ #define H5HUT_API_VERSION 2 #endif - +#include "H5_attachments.h" #include "H5_file.h" #include "H5_model.h" #include "H5_file_attribs.h" diff --git a/src/include/h5core/Makefile.am b/src/include/h5core/Makefile.am index f5784fe..a031f4c 100644 --- a/src/include/h5core/Makefile.am +++ b/src/include/h5core/Makefile.am @@ -1,10 +1,13 @@ otherincludedir = $(includedir)/h5core include_HEADERS = \ - h5.h \ - h5_attribs.h \ + h5_attachments.h \ h5_debug.h \ h5_errorhandling.h \ + h5_file.h \ + h5_file_attribs.h \ + h5_step_attribs.h \ + h5_init.h \ h5_model.h \ h5_syscall.h \ h5_types.h \ diff --git a/src/include/h5core/h5_attachments.h b/src/include/h5core/h5_attachments.h new file mode 100644 index 0000000..0f7906b --- /dev/null +++ b/src/include/h5core/h5_attachments.h @@ -0,0 +1,56 @@ +/* + Copyright (c) 2006-2016, The Regents of the University of California, + through Lawrence Berkeley National Laboratory (subject to receipt of any + required approvals from the U.S. Dept. of Energy) and the Paul Scherrer + Institut (Switzerland). All rights reserved. + + License: see file COPYING in top level of source distribution. +*/ + +#ifndef __H5CORE_H5_ATTACHMENTS +#define __H5CORE_H5_ATTACHMENTS + +#include "h5core/h5_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +h5_err_t +h5_add_attachment ( + const h5_file_t, const char* const); + +h5_err_t +h5_has_attachments ( + const h5_file_t); + +h5_err_t +h5_has_attachment ( + const h5_file_t, const char* const); + +h5_ssize_t +h5_get_num_attachments ( + const h5_file_t); + +h5_err_t +h5_get_attachment_info_by_idx ( + const h5_file_t, const h5_size_t, char* const, h5_size_t, h5_size_t* const); + +h5_err_t +h5_get_attachment_info_by_name ( + const h5_file_t, const char* const, h5_size_t* const); + +h5_err_t +h5_get_attachment ( + const h5_file_t, const char* const); + +h5_err_t +h5_delete_attachment ( + const h5_file_t, const char* const); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/include/h5core/h5_debug.h b/src/include/h5core/h5_debug.h index 526b35b..b1eb0f9 100644 --- a/src/include/h5core/h5_debug.h +++ b/src/include/h5core/h5_debug.h @@ -10,6 +10,9 @@ #ifndef __H5CORE_H5_DEBUG_H #define __H5CORE_H5_DEBUG_H +#include +#include + #include "h5core/h5_types.h" #include "h5core/h5_errorhandling.h" @@ -37,6 +40,221 @@ extern "C" { #define H5_DEBUG_ALL (-1 & ~0x3) extern char* h5_rfmts[]; +enum h5_rtypes { + e_int = 0, + e_ssize_t, + e_char_p, + e_void_p, + e_h5_err_t, + e_h5_int64_t, + e_h5_id_t, + e_h5_ssize_t, + e_h5_errorhandler_t, + e_h5_file_p, + e_h5_file_t, + e_h5_lvl_idx_t, + e_h5t_iterator_p, + e_h5_loc_id_t, + e_h5_loc_idx_t, + e_hid_t, + e_H5O_type_t, + e_h5_glb_elem_p, + e_h5_prop_p, + e_h5_prop_t, + e_h5_prop_file_p, + e_h5_prop_file_t, + e_herr_t +}; + +struct call_stack_entry { + char* name; + enum h5_rtypes type; +}; + +struct call_stack { + int level; + struct call_stack_entry entry[1024]; +}; + +extern h5_int32_t h5_debug_level; +extern struct call_stack h5_call_stack; + +static inline void +h5_call_stack_init ( + const char* fname, + enum h5_rtypes type + ) { + h5_call_stack.level = 0; + h5_call_stack.entry[0].name = (char *)fname; + h5_call_stack.entry[0].type = type; +} + +static inline void +h5_call_stack_push ( + const char* fname, + enum h5_rtypes type + ) { + h5_call_stack.entry[h5_call_stack.level].name = (char *)fname; + h5_call_stack.entry[h5_call_stack.level].type = type; + h5_call_stack.level++; +} + +static inline const char* +h5_call_stack_pop ( + void + ) { + return h5_call_stack.entry[--h5_call_stack.level].name; +} + +static inline const char* +h5_call_stack_get_name ( + void + ) { + return h5_call_stack.entry[h5_call_stack.level-1].name; +} + +static inline const char* +h5_get_funcname ( + void + ) { + return h5_call_stack.entry[0].name; +} + +static inline enum h5_rtypes +h5_call_stack_get_type ( + void + ) { + return h5_call_stack.entry[h5_call_stack.level-1].type; +} + +static inline int +h5_call_stack_get_level ( + void + ) { + return h5_call_stack.level; +} + +static inline const char* +h5_call_stack_reset ( + void + ) { + h5_call_stack.level = 0; + return h5_call_stack.entry[0].name; +} + +void +h5priv_vprintf ( + FILE* f, + const char* prefix, + const char* __funcname, + const char* fmt, + va_list ap + ); + +h5_err_t +h5_error ( + const h5_err_t error_no, + const char *fmt, + ... + ) +#ifdef __GNUC__ +__attribute__ ((format (printf, 2, 3))) +#endif +; + +void +h5_verror ( + const char* fmt, + va_list ap + ); + +/*! + \ingroup h5_core_errorhandling + + Print a warning message to \c stderr. + */ + +static inline h5_err_t +h5_warn ( + const char *fmt, + ... + ) +#ifdef __GNUC__ +__attribute__ ((format (printf, 1, 2))) +#endif +; +static inline h5_err_t +h5_warn ( + const char* fmt, + ... + ) { + if (h5_debug_level >= 2) { + va_list ap; + va_start (ap, fmt); + h5priv_vprintf (stderr, "W", h5_get_funcname(), fmt, ap); + va_end (ap); + } + return H5_NOK; +} + +/*! + \ingroup h5_core_errorhandling + + Print an informational message to \c stdout. + */ +static inline void +h5_info ( + const char *fmt, + ... + ) +#ifdef __GNUC__ +__attribute__ ((format (printf, 1, 2))) +#endif +; +static inline void +h5_info ( + const char* fmt, + ... + ) { + if (h5_debug_level >= 3) { + va_list ap; + va_start (ap, fmt); + h5priv_vprintf (stdout, "I", h5_get_funcname(), fmt, ap); + va_end (ap); + } +} + +/*! + \ingroup h5_core_errorhandling + + Print a debug message to \c stdout. + */ +static inline void +h5_debug ( + const char *fmt, + ... + ) +#ifdef __GNUC__ +__attribute__ ((format (printf, 1, 2))) +#endif +; + +static inline void +h5_debug ( + const char *fmt, + ... + ) { + if (h5_debug_level >= 4) { + char prefix[1024]; + snprintf (prefix, sizeof(prefix), "%*s %s", + h5_call_stack_get_level(), "", + h5_call_stack_get_name()); + va_list ap; + va_start (ap, fmt); + h5priv_vprintf (stdout, "D", prefix, fmt, ap); + va_end (ap); + } +} ////////////////////////////////////////////////////////////////////////////// // function enter macro @@ -142,6 +360,15 @@ done: \ goto done; \ } +h5_err_t +h5_set_debuglevel ( + const h5_id_t); + +h5_err_t +h5_get_debuglevel ( + void); + + #ifdef __cplusplus } #endif diff --git a/src/include/h5core/h5_errorhandling.h b/src/include/h5core/h5_errorhandling.h index fe5364b..1533ee3 100644 --- a/src/include/h5core/h5_errorhandling.h +++ b/src/include/h5core/h5_errorhandling.h @@ -48,44 +48,6 @@ extern "C" { /** @}*/ -enum h5_rtypes { - e_int = 0, - e_ssize_t, - e_char_p, - e_void_p, - e_h5_err_t, - e_h5_int64_t, - e_h5_id_t, - e_h5_ssize_t, - e_h5_errorhandler_t, - e_h5_file_p, - e_h5_file_t, - e_h5_lvl_idx_t, - e_h5t_iterator_p, - e_h5_loc_id_t, - e_h5_loc_idx_t, - e_hid_t, - e_H5O_type_t, - e_h5_glb_elem_p, - e_h5_prop_p, - e_h5_prop_t, - e_h5_prop_file_p, - e_h5_prop_file_t, - e_herr_t -}; - -struct call_stack_entry { - char* name; - enum h5_rtypes type; -}; - -struct call_stack { - int level; - struct call_stack_entry entry[1024]; -}; - -extern h5_int32_t h5_debug_level; -extern struct call_stack h5_call_stack; extern h5_err_t h5_errno; #define h5_error_not_implemented() \ @@ -101,14 +63,6 @@ extern h5_err_t h5_errno; __FILE__, __func__, __LINE__) -h5_err_t -h5_set_debuglevel ( - const h5_id_t); - -h5_err_t -h5_get_debuglevel ( - void); - h5_err_t h5_set_errorhandler ( const h5_errorhandler_t); @@ -125,68 +79,6 @@ void h5_set_errno ( const h5_err_t); -static inline void -h5_call_stack_init ( - const char* fname, - enum h5_rtypes type - ) { - h5_call_stack.level = 0; - h5_call_stack.entry[0].name = (char *)fname; - h5_call_stack.entry[0].type = type; -} - -static inline void -h5_call_stack_push ( - const char* fname, - enum h5_rtypes type - ) { - h5_call_stack.entry[h5_call_stack.level].name = (char *)fname; - h5_call_stack.entry[h5_call_stack.level].type = type; - h5_call_stack.level++; -} - -static inline const char* -h5_call_stack_pop ( - void - ) { - return h5_call_stack.entry[--h5_call_stack.level].name; -} - -static inline const char* -h5_call_stack_get_name ( - void - ) { - return h5_call_stack.entry[h5_call_stack.level-1].name; -} - -static inline const char* -h5_get_funcname ( - void - ) { - return h5_call_stack.entry[0].name; -} - -static inline enum h5_rtypes -h5_call_stack_get_type ( - void - ) { - return h5_call_stack.entry[h5_call_stack.level-1].type; -} - -static inline int -h5_call_stack_get_level ( - void - ) { - return h5_call_stack.level; -} - -static inline const char* -h5_call_stack_reset ( - void - ) { - h5_call_stack.level = 0; - return h5_call_stack.entry[0].name; -} h5_err_t h5_report_errorhandler ( @@ -200,120 +92,6 @@ h5_abort_errorhandler ( va_list ap ); -void -h5priv_vprintf ( - FILE* f, - const char* prefix, - const char* __funcname, - const char* fmt, - va_list ap - ); - -h5_err_t -h5_error ( - const h5_err_t error_no, - const char *fmt, - ... - ) -#ifdef __GNUC__ -__attribute__ ((format (printf, 2, 3))) -#endif -; - -void -h5_verror ( - const char* fmt, - va_list ap - ); - -/*! - \ingroup h5_core_errorhandling - - Print a warning message to \c stderr. - */ - -static inline h5_err_t -h5_warn ( - const char *fmt, - ... - ) -#ifdef __GNUC__ -__attribute__ ((format (printf, 1, 2))) -#endif -; -static inline h5_err_t -h5_warn ( - const char* fmt, - ... - ) { - if (h5_debug_level >= 2) { - va_list ap; - va_start (ap, fmt); - h5priv_vprintf (stderr, "W", h5_get_funcname(), fmt, ap); - va_end (ap); - } - return H5_NOK; -} - -/*! - \ingroup h5_core_errorhandling - - Print an informational message to \c stdout. - */ -static inline void -h5_info ( - const char *fmt, - ... - ) -#ifdef __GNUC__ -__attribute__ ((format (printf, 1, 2))) -#endif -; -static inline void -h5_info ( - const char* fmt, - ... - ) { - if (h5_debug_level >= 3) { - va_list ap; - va_start (ap, fmt); - h5priv_vprintf (stdout, "I", h5_get_funcname(), fmt, ap); - va_end (ap); - } -} - -/*! - \ingroup h5_core_errorhandling - - Print a debug message to \c stdout. - */ -static inline void -h5_debug ( - const char *fmt, - ... - ) -#ifdef __GNUC__ -__attribute__ ((format (printf, 1, 2))) -#endif -; - -static inline void -h5_debug ( - const char *fmt, - ... - ) { - if (h5_debug_level >= 4) { - char prefix[1024]; - snprintf (prefix, sizeof(prefix), "%*s %s", - h5_call_stack_get_level(), "", - h5_call_stack_get_name()); - va_list ap; - va_start (ap, fmt); - h5priv_vprintf (stdout, "D", prefix, fmt, ap); - va_end (ap); - } -} - #ifdef __cplusplus } #endif diff --git a/src/include/h5core/h5.h b/src/include/h5core/h5_file.h similarity index 62% rename from src/include/h5core/h5.h rename to src/include/h5core/h5_file.h index 8a857ea..e51c78e 100644 --- a/src/include/h5core/h5.h +++ b/src/include/h5core/h5_file.h @@ -7,36 +7,22 @@ License: see file COPYING in top level of source distribution. */ -#ifndef __H5CORE_H5_H -#define __H5CORE_H5_H +#ifndef __H5CORE_H5_FILE_H +#define __H5CORE_H5_FILE_H + +#if defined(PARALLEL_IO) +#include +#endif -#include "h5core/h5_types.h" #include -// dummy MPI calls for serial code -#if !defined (PARALLEL_IO) -typedef int MPI_Comm; -#define MPI_Init(argc, argv) -#define MPI_Comm_size(comm, nprocs) {(void)comm; *nprocs = 1; } -#define MPI_Comm_rank(comm, myproc) {(void)comm; *myproc = 0; } -#define MPI_Finalize() -#define MPI_COMM_WORLD (0) -#define MPI_COMM_SELF (1) -#endif +#include "h5core/h5_types.h" + #ifdef __cplusplus extern "C" { #endif -extern int h5_initialized; - -h5_err_t -h5_initialize (void); - -hid_t -h5_get_hdf5_file( - const h5_file_t); - h5_prop_t h5_create_prop ( const h5_int64_t); @@ -97,36 +83,8 @@ h5_err_t h5_flush_file ( const h5_file_t); -h5_err_t -h5_set_stepname_fmt ( - const h5_file_t, const char*, const int); - -h5_err_t -h5_get_stepname_fmt ( - const h5_file_t, char* const, const int, int* const); - -int -h5_get_num_procs ( - const h5_file_t); - -h5_ssize_t -h5_get_num_steps ( - const h5_file_t); - -h5_int64_t -h5_has_step ( - const h5_file_t, const h5_int64_t); - -h5_int64_t -h5_get_step ( - const h5_file_t); - -h5_err_t -h5_start_traverse_steps ( - const h5_file_t); - -h5_err_t -h5_traverse_steps ( +hid_t +h5_get_hdf5_file( const h5_file_t); #ifdef __cplusplus diff --git a/src/include/h5core/h5_attribs.h b/src/include/h5core/h5_file_attribs.h similarity index 62% rename from src/include/h5core/h5_attribs.h rename to src/include/h5core/h5_file_attribs.h index ad6568a..729aad8 100644 --- a/src/include/h5core/h5_attribs.h +++ b/src/include/h5core/h5_file_attribs.h @@ -7,10 +7,11 @@ License: see file COPYING in top level of source distribution. */ -#ifndef __H5CORE_H5_ATTRIBS_H -#define __H5CORE_H5_ATTRIBS_H +#ifndef __H5CORE_H5_FILE_ATTRIBS_H +#define __H5CORE_H5_FILE_ATTRIBS_H #include "h5core/h5_types.h" +#include #ifdef __cplusplus extern "C" { @@ -20,52 +21,27 @@ h5_err_t h5_has_file_attrib ( const h5_file_t, const char* const); -h5_err_t -h5_has_step_attrib ( - const h5_file_t, const char* const); - h5_err_t h5_get_file_attrib_info_by_name ( const h5_file_t, const char* const, h5_int64_t* const, h5_size_t*); -h5_err_t -h5_get_step_attrib_info_by_name ( - const h5_file_t, const char* const, h5_int64_t*, h5_size_t*); - h5_ssize_t h5_get_num_file_attribs ( const h5_file_t); -h5_ssize_t -h5_get_num_step_attribs ( - const h5_file_t); - h5_err_t h5_get_file_attrib_info_by_idx ( const h5_file_t, const h5_size_t, char*, const h5_size_t, h5_int64_t* const, h5_size_t*); -h5_err_t -h5_get_step_attrib_info_by_idx ( - const h5_file_t, const h5_size_t, char*, const h5_size_t, h5_int64_t*, - h5_size_t*); - h5_err_t h5_read_file_attrib ( const h5_file_t, const char*, const hid_t, void*); -h5_err_t -h5_read_step_attrib ( - const h5_file_t, const char*, const hid_t, void*); - h5_err_t h5_write_file_attrib ( const h5_file_t, const char*, const hid_t, const void*, const hsize_t); -h5_err_t -h5_write_step_attrib ( - const h5_file_t, const char*, const hid_t, const void*, const hsize_t); - #ifdef __cplusplus } #endif diff --git a/src/include/h5core/h5_init.h b/src/include/h5core/h5_init.h new file mode 100644 index 0000000..2ffa794 --- /dev/null +++ b/src/include/h5core/h5_init.h @@ -0,0 +1,40 @@ +/* + Copyright (c) 2006-2016, The Regents of the University of California, + through Lawrence Berkeley National Laboratory (subject to receipt of any + required approvals from the U.S. Dept. of Energy) and the Paul Scherrer + Institut (Switzerland). All rights reserved. + + License: see file COPYING in top level of source distribution. +*/ + +#ifndef __H5CORE_H5_H +#define __H5CORE_H5_H + +#include "h5core/h5_types.h" + +// dummy MPI calls for serial code +#if !defined (PARALLEL_IO) +typedef int MPI_Comm; +#define MPI_Init(argc, argv) +#define MPI_Comm_size(comm, nprocs) {(void)comm; *nprocs = 1; } +#define MPI_Comm_rank(comm, myproc) {(void)comm; *myproc = 0; } +#define MPI_Finalize() +#define MPI_COMM_WORLD (0) +#define MPI_COMM_SELF (1) +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +extern int h5_initialized; + +h5_err_t +h5_initialize (void); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/include/h5core/h5_model.h b/src/include/h5core/h5_model.h index f938e4a..8efb6e8 100644 --- a/src/include/h5core/h5_model.h +++ b/src/include/h5core/h5_model.h @@ -7,8 +7,8 @@ License: see file COPYING in top level of source distribution. */ -#ifndef __H5CORE_H5_MODEL -#define __H5CORE_H5_MODEL +#ifndef __H5CORE_H5_MODEL_H +#define __H5CORE_H5_MODEL_H #include "h5core/h5_types.h" @@ -18,42 +18,35 @@ extern "C" { #define H5_MAX_NAME_LEN 64 +h5_err_t +h5_set_stepname_fmt ( + const h5_file_t, const char*, const int); + +h5_err_t +h5_get_stepname_fmt ( + const h5_file_t, char* const, const int, int* const); + + h5_int64_t h5_set_step ( const h5_file_t, const h5_int64_t); -h5_err_t -h5_add_attachment ( - const h5_file_t, const char* const); -h5_err_t -h5_has_attachments ( +h5_int64_t +h5_get_step ( const h5_file_t); -h5_err_t -h5_has_attachment ( - const h5_file_t, const char* const); - h5_ssize_t -h5_get_num_attachments ( +h5_get_num_steps ( const h5_file_t); -h5_err_t -h5_get_attachment_info_by_idx ( - const h5_file_t, const h5_size_t, char* const, h5_size_t, h5_size_t* const); - -h5_err_t -h5_get_attachment_info_by_name ( - const h5_file_t, const char* const, h5_size_t* const); - -h5_err_t -h5_get_attachment ( - const h5_file_t, const char* const); - -h5_err_t -h5_delete_attachment ( - const h5_file_t, const char* const); +h5_int64_t +h5_has_step ( + const h5_file_t, const h5_int64_t); +int +h5_get_num_procs ( + const h5_file_t); #ifdef __cplusplus } diff --git a/src/include/h5core/h5_step_attribs.h b/src/include/h5core/h5_step_attribs.h new file mode 100644 index 0000000..1111b88 --- /dev/null +++ b/src/include/h5core/h5_step_attribs.h @@ -0,0 +1,49 @@ +/* + Copyright (c) 2006-2016, The Regents of the University of California, + through Lawrence Berkeley National Laboratory (subject to receipt of any + required approvals from the U.S. Dept. of Energy) and the Paul Scherrer + Institut (Switzerland). All rights reserved. + + License: see file COPYING in top level of source distribution. +*/ + +#ifndef __H5CORE_H5_STEP_ATTRIBS_H +#define __H5CORE_H5_STEP_ATTRIBS_H + +#include "h5core/h5_types.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif + +h5_err_t +h5_has_step_attrib ( + const h5_file_t, const char* const); + +h5_err_t +h5_get_step_attrib_info_by_name ( + const h5_file_t, const char* const, h5_int64_t*, h5_size_t*); + +h5_ssize_t +h5_get_num_step_attribs ( + const h5_file_t f); + +h5_err_t +h5_get_step_attrib_info_by_idx ( + const h5_file_t, const h5_size_t, char*, const h5_size_t, h5_int64_t*, + h5_size_t*); + +h5_err_t +h5_read_step_attrib ( + const h5_file_t, const char*, const hid_t, void*); + +h5_err_t +h5_write_step_attrib ( + const h5_file_t, const char*, const hid_t, const void*, const hsize_t); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/include/h5core/h5_syscall.h b/src/include/h5core/h5_syscall.h index 669eefd..35c12fb 100644 --- a/src/include/h5core/h5_syscall.h +++ b/src/include/h5core/h5_syscall.h @@ -15,7 +15,6 @@ #include "h5core/h5_types.h" #include "h5core/h5_debug.h" -#include "h5core/h5_errorhandling.h" #define MALLOC_WRAPPER_ENTER(type, fmt, ...) \ __FUNC_ENTER(type, H5_DEBUG_MALLOC, fmt, __VA_ARGS__) diff --git a/src/include/h5core/h5_types.h b/src/include/h5core/h5_types.h index db5c6da..bed4d45 100644 --- a/src/include/h5core/h5_types.h +++ b/src/include/h5core/h5_types.h @@ -52,7 +52,6 @@ extern "C" { #define H5_COMPOUND_T H5T_COMPOUND extern const char* H5_VER_STRING; -extern const char* const H5_O_MODES[]; #ifdef WIN32 typedef __int64 int64_t; diff --git a/src/include/h5core/h5b_attribs.h b/src/include/h5core/h5b_attribs.h index ff40183..99c371d 100644 --- a/src/include/h5core/h5b_attribs.h +++ b/src/include/h5core/h5b_attribs.h @@ -11,6 +11,7 @@ #define __H5CORE_H5B_ATTRIBS_H #include "h5core/h5_types.h" +#include /* :TODO: move macros to private include file @@ -25,15 +26,16 @@ extern "C" { #endif -h5_err_t -h5b_write_field_attrib ( +h5_ssize_t +h5b_get_num_field_attribs ( const h5_file_t, - const char*, const char*, const hid_t, const void*, const h5_int64_t); + const char*); h5_err_t -h5b_read_field_attrib ( +h5b_get_field_attrib_info_by_idx ( const h5_file_t, - const char*, const char*, const h5_int64_t, void* const); + const char*, const h5_size_t, char* const, const h5_size_t, + h5_int64_t* const, h5_size_t*); h5_err_t h5b_has_field_attrib ( @@ -49,16 +51,15 @@ h5b_get_field_attrib_info_by_name ( h5_int64_t*, h5_size_t*); -h5_ssize_t -h5b_get_num_field_attribs ( +h5_err_t +h5b_write_field_attrib ( const h5_file_t, - const char*); + const char*, const char*, const hid_t, const void*, const h5_int64_t); h5_err_t -h5b_get_field_attrib_info_by_idx ( +h5b_read_field_attrib ( const h5_file_t, - const char*, const h5_size_t, char* const, const h5_size_t, - h5_int64_t* const, h5_size_t*); + const char*, const char*, const h5_int64_t, void* const); h5_err_t h5b_set_3d_field_coords ( diff --git a/src/include/h5core/h5b_io.h b/src/include/h5core/h5b_io.h index ba560d9..79d2692 100644 --- a/src/include/h5core/h5b_io.h +++ b/src/include/h5core/h5b_io.h @@ -11,6 +11,7 @@ #define __H5CORE_H5B_IO_H #include "h5core/h5_types.h" +#include #ifdef __cplusplus extern "C" { diff --git a/src/include/h5core/h5b_model.h b/src/include/h5core/h5b_model.h index ddb14f8..9ac63d0 100644 --- a/src/include/h5core/h5b_model.h +++ b/src/include/h5core/h5b_model.h @@ -20,6 +20,28 @@ h5_err_t h5b_has_field_data ( const h5_file_t); +h5_ssize_t +h5b_get_num_fields ( + const h5_file_t); + +h5_err_t +h5b_get_field_info ( + const h5_file_t, + const h5_size_t, + char* const, const h5_size_t, + h5_size_t* const, h5_size_t* const, h5_size_t* const, h5_int64_t* const); + +h5_err_t +h5b_has_field ( + const h5_file_t, + const char*); + +h5_err_t +h5b_get_field_info_by_name ( + const h5_file_t, + const char* name, + h5_size_t* const, h5_size_t* const, h5_size_t* const, h5_int64_t* const); + h5_int64_t h5b_3d_has_view ( const h5_file_t f); @@ -78,28 +100,6 @@ h5_err_t h5b_3d_set_halo ( const h5_file_t, const h5_size_t, const h5_size_t, const h5_size_t); -h5_ssize_t -h5b_get_num_fields ( - const h5_file_t); - -h5_err_t -h5b_has_field ( - const h5_file_t, - const char*); - -h5_err_t -h5b_get_field_info_by_name ( - const h5_file_t, - const char* name, - h5_size_t* const, h5_size_t* const, h5_size_t* const, h5_int64_t* const); - -h5_err_t -h5b_get_field_info ( - const h5_file_t, - const h5_size_t, - char* const, const h5_size_t, - h5_size_t* const, h5_size_t* const, h5_size_t* const, h5_int64_t* const); - #ifdef __cplusplus } #endif diff --git a/src/include/h5core/h5u_io.h b/src/include/h5core/h5u_io.h index c083d8a..4366e0e 100644 --- a/src/include/h5core/h5u_io.h +++ b/src/include/h5core/h5u_io.h @@ -11,6 +11,7 @@ #define __H5CORE_H5U_IO_H #include "h5core/h5_types.h" +#include #ifdef __cplusplus extern "C" { diff --git a/src/include/h5core/h5u_model.h b/src/include/h5core/h5u_model.h index a4af277..2ddacbd 100644 --- a/src/include/h5core/h5u_model.h +++ b/src/include/h5core/h5u_model.h @@ -16,6 +16,30 @@ extern "C" { #endif +h5_ssize_t +h5u_get_num_datasets ( + const h5_file_t); + +h5_err_t +h5u_get_dataset_info ( + const h5_file_t, + const h5_id_t, char* const, const h5_size_t, h5_int64_t* const, + h5_size_t* const); + +h5_err_t +h5u_has_dataset ( + const h5_file_t fh, + const char* const name + ); + +h5_err_t +h5u_get_dataset_info_by_name ( + const h5_file_t f, + const char* const dataset_name, + h5_int64_t* const type, + h5_size_t* const nelem + ); + h5_ssize_t h5u_get_num_points ( const h5_file_t); @@ -65,30 +89,6 @@ h5_err_t h5u_set_canonical_view ( const h5_file_t); -h5_ssize_t -h5u_get_num_datasets ( - const h5_file_t); - -h5_err_t -h5u_get_dataset_info ( - const h5_file_t, - const h5_id_t, char* const, const h5_size_t, h5_int64_t* const, - h5_size_t* const); - -h5_err_t -h5u_has_dataset ( - const h5_file_t fh, - const char* const name - ); - -h5_err_t -h5u_get_dataset_info_by_name ( - const h5_file_t f, - const char* const dataset_name, - h5_int64_t* const type, - h5_size_t* const nelem - ); - h5_err_t h5u_set_chunk ( const h5_file_t,