diff options
author | Larry Knox <lrknox@hdfgroup.org> | 2021-10-29 22:10:31 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-29 22:10:31 (GMT) |
commit | 111c7ae9ac2efc29e8b399e6951253af9110b81a (patch) | |
tree | f69fa03253bdab97d7cf3615baff02cd936323f9 /src/H5Bprivate.h | |
parent | db30c2da68ece4a155e9e50c28ec16d6057509b2 (diff) | |
download | hdf5-111c7ae9ac2efc29e8b399e6951253af9110b81a.zip hdf5-111c7ae9ac2efc29e8b399e6951253af9110b81a.tar.gz hdf5-111c7ae9ac2efc29e8b399e6951253af9110b81a.tar.bz2 |
Merge hdf5 1 10 8 (#1154)hdf5-1_10_8
Merge HDF5 1.10.8 release files to 1.10/master
Diffstat (limited to 'src/H5Bprivate.h')
-rw-r--r-- | src/H5Bprivate.h | 135 |
1 files changed, 60 insertions, 75 deletions
diff --git a/src/H5Bprivate.h b/src/H5Bprivate.h index 55bf5b3..265b6c6 100644 --- a/src/H5Bprivate.h +++ b/src/H5Bprivate.h @@ -6,7 +6,7 @@ * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * * the COPYING file, which can be found at the root of the source code * - * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * distribution tree, or in https://www.hdfgroup.org/licenses. * * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -22,14 +22,13 @@ *------------------------------------------------------------------------- */ -#ifndef _H5Bprivate_H -#define _H5Bprivate_H - +#ifndef H5Bprivate_H +#define H5Bprivate_H /* Private headers needed by this file */ -#include "H5private.h" /* Generic Functions */ -#include "H5Fprivate.h" /* File access */ -#include "H5UCprivate.h" /* Reference counted object functions */ +#include "H5private.h" /* Generic Functions */ +#include "H5Fprivate.h" /* File access */ +#include "H5UCprivate.h" /* Reference counted object functions */ /**************************/ /* Library Private Macros */ @@ -42,10 +41,9 @@ * being enabled. */ #ifdef NDEBUG -# undef H5B_DEBUG +#undef H5B_DEBUG #endif - /****************************/ /* Library Private Typedefs */ /****************************/ @@ -55,47 +53,46 @@ * nodes) they use will need to be stored in the file somewhere. -QAK */ typedef enum H5B_subid_t { - H5B_SNODE_ID = 0, /*B-tree is for symbol table nodes */ - H5B_CHUNK_ID = 1, /*B-tree is for chunked dataset storage */ - H5B_NUM_BTREE_ID /* Number of B-tree key IDs (must be last) */ + H5B_SNODE_ID = 0, /*B-tree is for symbol table nodes */ + H5B_CHUNK_ID = 1, /*B-tree is for chunked dataset storage */ + H5B_NUM_BTREE_ID /* Number of B-tree key IDs (must be last) */ } H5B_subid_t; /* Define return values from B-tree insertion callbacks */ typedef enum H5B_ins_t { - H5B_INS_ERROR = -1, /*error return value */ - H5B_INS_NOOP = 0, /*insert made no changes */ - H5B_INS_LEFT = 1, /*insert new node to left of cur node */ - H5B_INS_RIGHT = 2, /*insert new node to right of cur node */ - H5B_INS_CHANGE = 3, /*change child address for cur node */ - H5B_INS_FIRST = 4, /*insert first node in (sub)tree */ - H5B_INS_REMOVE = 5 /*remove current node */ + H5B_INS_ERROR = -1, /*error return value */ + H5B_INS_NOOP = 0, /*insert made no changes */ + H5B_INS_LEFT = 1, /*insert new node to left of cur node */ + H5B_INS_RIGHT = 2, /*insert new node to right of cur node */ + H5B_INS_CHANGE = 3, /*change child address for cur node */ + H5B_INS_FIRST = 4, /*insert first node in (sub)tree */ + H5B_INS_REMOVE = 5 /*remove current node */ } H5B_ins_t; /* Enum for specifying the direction of the critical key in relation to the * child */ typedef enum H5B_dir_t { - H5B_LEFT = 0, /* Critical key is to the left */ - H5B_RIGHT = 1 /* Critical key is to the right */ + H5B_LEFT = 0, /* Critical key is to the left */ + H5B_RIGHT = 1 /* Critical key is to the right */ } H5B_dir_t; /* Define the operator callback function pointer for H5B_iterate() */ -typedef int (*H5B_operator_t)(H5F_t *f, const void *_lt_key, haddr_t addr, - const void *_rt_key, void *_udata); +typedef int (*H5B_operator_t)(H5F_t *f, const void *_lt_key, haddr_t addr, const void *_rt_key, void *_udata); /* Each B-tree has certain information that can be shared across all * the instances of nodes in that B-tree. */ typedef struct H5B_shared_t { - const struct H5B_class_t *type; /* Type of tree */ - unsigned two_k; /* 2*"K" value for tree's nodes */ - size_t sizeof_rkey; /* Size of raw (disk) key */ - size_t sizeof_rnode; /* Size of raw (disk) node */ - size_t sizeof_keys; /* Size of native (memory) key node */ - size_t sizeof_addr; /* Size of file address (in bytes) */ - size_t sizeof_len; /* Size of file lengths (in bytes) */ - uint8_t *page; /* Disk page */ - size_t *nkey; /* Offsets of each native key in native key buffer */ - void *udata; /* 'Local' info for a B-tree */ + const struct H5B_class_t *type; /* Type of tree */ + unsigned two_k; /* 2*"K" value for tree's nodes */ + size_t sizeof_rkey; /* Size of raw (disk) key */ + size_t sizeof_rnode; /* Size of raw (disk) node */ + size_t sizeof_keys; /* Size of native (memory) key node */ + size_t sizeof_addr; /* Size of file address (in bytes) */ + size_t sizeof_len; /* Size of file lengths (in bytes) */ + uint8_t * page; /* Disk page */ + size_t * nkey; /* Offsets of each native key in native key buffer */ + void * udata; /* 'Local' info for a B-tree */ } H5B_shared_t; /* @@ -107,69 +104,57 @@ typedef struct H5B_shared_t { */ typedef struct H5B_class_t { - H5B_subid_t id; /*id as found in file*/ - size_t sizeof_nkey; /*size of native (memory) key*/ - H5UC_t * (*get_shared)(const H5F_t*, const void*); /*shared info for node */ - herr_t (*new_node)(H5F_t*, H5B_ins_t, void*, void*, void*, haddr_t*); - int (*cmp2)(void*, void*, void*); /*compare 2 keys */ - int (*cmp3)(void*, void*, void*); /*compare 3 keys */ - htri_t (*found)(H5F_t*, haddr_t, const void*, void*); + H5B_subid_t id; /*id as found in file*/ + size_t sizeof_nkey; /*size of native (memory) key*/ + H5UC_t *(*get_shared)(const H5F_t *, const void *); /*shared info for node */ + herr_t (*new_node)(H5F_t *, H5B_ins_t, void *, void *, void *, haddr_t *); + int (*cmp2)(void *, void *, void *); /*compare 2 keys */ + int (*cmp3)(void *, void *, void *); /*compare 3 keys */ + htri_t (*found)(H5F_t *, haddr_t, const void *, void *); /* insert new data */ - H5B_ins_t (*insert)(H5F_t*, haddr_t, void*, hbool_t*, void*, void*, - void*, hbool_t*, haddr_t*); + H5B_ins_t (*insert)(H5F_t *, haddr_t, void *, hbool_t *, void *, void *, void *, hbool_t *, haddr_t *); /* min insert uses min leaf, not new(), similarly for max insert */ - hbool_t follow_min; - hbool_t follow_max; + hbool_t follow_min; + hbool_t follow_max; /* The direction of the key that is intrinsically associated with each node */ - H5B_dir_t critical_key; + H5B_dir_t critical_key; /* remove existing data */ - H5B_ins_t (*remove)(H5F_t*, haddr_t, void*, hbool_t*, void*, void*, hbool_t*); + H5B_ins_t (*remove)(H5F_t *, haddr_t, void *, hbool_t *, void *, void *, hbool_t *); /* encode, decode, debug key values */ - herr_t (*decode)(const H5B_shared_t*, const uint8_t*, void*); - herr_t (*encode)(const H5B_shared_t*, uint8_t*, const void*); - herr_t (*debug_key)(FILE*, int, int, const void*, const void*); + herr_t (*decode)(const H5B_shared_t *, const uint8_t *, void *); + herr_t (*encode)(const H5B_shared_t *, uint8_t *, const void *); + herr_t (*debug_key)(FILE *, int, int, const void *, const void *); } H5B_class_t; /* Information about B-tree */ typedef struct H5B_info_t { - hsize_t size; /* Size of B-tree nodes */ - hsize_t num_nodes; /* Number of B-tree nodes */ + hsize_t size; /* Size of B-tree nodes */ + hsize_t num_nodes; /* Number of B-tree nodes */ } H5B_info_t; - - /*****************************/ /* Library-private Variables */ /*****************************/ - /***************************************/ /* Library-private Function Prototypes */ /***************************************/ -H5_DLL herr_t H5B_create(H5F_t *f, const H5B_class_t *type, void *udata, - haddr_t *addr_p/*out*/); -H5_DLL herr_t H5B_find(H5F_t *f, const H5B_class_t *type, haddr_t addr, - void *udata); -H5_DLL herr_t H5B_insert(H5F_t *f, const H5B_class_t *type, haddr_t addr, - void *udata); -H5_DLL herr_t H5B_iterate(H5F_t *f, const H5B_class_t *type, haddr_t addr, - H5B_operator_t op, void *udata); -H5_DLL herr_t H5B_get_info(H5F_t *f, const H5B_class_t *type, haddr_t addr, - H5B_info_t *bt_info, H5B_operator_t op, void *udata); -H5_DLL herr_t H5B_remove(H5F_t *f, const H5B_class_t *type, haddr_t addr, - void *udata); -H5_DLL herr_t H5B_delete(H5F_t *f, const H5B_class_t *type, haddr_t addr, - void *udata); -H5_DLL H5B_shared_t *H5B_shared_new(const H5F_t *f, const H5B_class_t *type, - size_t sizeof_rkey); -H5_DLL herr_t H5B_shared_free(void *_shared); -H5_DLL herr_t H5B_debug(H5F_t *f, haddr_t addr, FILE * stream, - int indent, int fwidth, const H5B_class_t *type, void *udata); +H5_DLL herr_t H5B_create(H5F_t *f, const H5B_class_t *type, void *udata, haddr_t *addr_p /*out*/); +H5_DLL herr_t H5B_find(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata); +H5_DLL herr_t H5B_insert(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata); +H5_DLL herr_t H5B_iterate(H5F_t *f, const H5B_class_t *type, haddr_t addr, H5B_operator_t op, void *udata); +H5_DLL herr_t H5B_get_info(H5F_t *f, const H5B_class_t *type, haddr_t addr, H5B_info_t *bt_info, + H5B_operator_t op, void *udata); +H5_DLL herr_t H5B_remove(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata); +H5_DLL herr_t H5B_delete(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata); +H5_DLL H5B_shared_t *H5B_shared_new(const H5F_t *f, const H5B_class_t *type, size_t sizeof_rkey); +H5_DLL herr_t H5B_shared_free(void *_shared); +H5_DLL herr_t H5B_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5B_class_t *type, + void *udata); H5_DLL htri_t H5B_valid(H5F_t *f, const H5B_class_t *type, haddr_t addr); -#endif /* _H5Bprivate_H */ - +#endif /* H5Bprivate_H */ |