1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  * Copyright by The HDF Group.                                               *
3  * Copyright by the Board of Trustees of the University of Illinois.         *
4  * All rights reserved.                                                      *
5  *                                                                           *
6  * This file is part of HDF5.  The full HDF5 copyright notice, including     *
7  * terms governing use, modification, and redistribution, is contained in    *
8  * the files COPYING and Copyright.html.  COPYING can be found at the root   *
9  * of the source code distribution tree; Copyright.html can be found at the  *
10  * root level of an installed copy of the electronic HDF5 document set and   *
11  * is linked from the top-level documents page.  It can also be found at     *
12  * http://hdfgroup.org/HDF5/doc/Copyright.html.  If you do not have          *
13  * access to either file, you may request a copy from help@hdfgroup.org.     *
14  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /*
17  * Programmer:	Quincey Koziol <koziol@ncsa.uiuc.edu>
18  *		Friday, February 24, 2006
19  *
20  * Purpose:	This file contains declarations which are visible only within
21  *		the H5HF package.  Source files outside the H5HF package should
22  *		include H5HFprivate.h instead.
23  */
24 #ifndef H5HF_PACKAGE
25 #error "Do not include this file outside the H5HF package!"
26 #endif
27 
28 #ifndef _H5HFpkg_H
29 #define _H5HFpkg_H
30 
31 /* Get package's private header */
32 #include "H5HFprivate.h"
33 
34 /* Other private headers needed by this file */
35 #include "H5ACprivate.h"	/* Metadata cache			*/
36 #include "H5B2private.h"	/* v2 B-trees				*/
37 #include "H5FLprivate.h"	/* Free Lists                           */
38 #include "H5FSprivate.h"	/* Free space manager			*/
39 #include "H5SLprivate.h"	/* Skip lists				*/
40 
41 /**************************/
42 /* Package Private Macros */
43 /**************************/
44 
45 /* Size of checksum information (on disk) */
46 #define H5HF_SIZEOF_CHKSUM      4
47 
48 /* "Standard" size of prefix information for fractal heap metadata */
49 #define H5HF_METADATA_PREFIX_SIZE(c) (                                        \
50     H5_SIZEOF_MAGIC   /* Signature */                                         \
51     + 1 /* Version */                                                         \
52     + ((c) ? H5HF_SIZEOF_CHKSUM : 0) /* Metadata checksum */                  \
53     )
54 
55 /* Size of doubling-table information */
56 #define H5HF_DTABLE_INFO_SIZE(h) (                                            \
57     2   /* Width of table (i.e. # of columns) */                              \
58     + (h)->sizeof_size /* Starting block size */                              \
59     + (h)->sizeof_size /* Maximum direct block size */                        \
60     + 2 /* Max. size of heap (log2 of actual value - i.e. the # of bits) */   \
61     + 2 /* Starting # of rows in root indirect block */                       \
62     + (h)->sizeof_addr /* File address of table managed */                    \
63     + 2 /* Current # of rows in root indirect block */                        \
64     )
65 
66 /* Flags for status byte */
67 #define H5HF_HDR_FLAGS_HUGE_ID_WRAPPED 0x01     /* "huge" object IDs have wrapped */
68 #define H5HF_HDR_FLAGS_CHECKSUM_DBLOCKS 0x02    /* checksum direct blocks */
69 
70 /* Size of the fractal heap header on disk */
71 /* (this is the fixed-len portion, the variable-len I/O filter information
72  *      follows this information, if there are I/O filters for the heap)
73  */
74 #define H5HF_HEADER_SIZE(h)     (                                             \
75     /* General metadata fields */                                             \
76     H5HF_METADATA_PREFIX_SIZE(TRUE)                                           \
77                                                                               \
78     /* Fractal Heap Header specific fields */                                 \
79                                                                               \
80     /* General heap information */                                            \
81     + 2 /* Heap ID len */                                                     \
82     + 2 /* I/O filters' encoded len */                                        \
83     + 1 /* Status flags */                                                    \
84                                                                               \
85     /* "Huge" object fields */                                                \
86     + 4 /* Max. size of "managed" object */                                   \
87     + (h)->sizeof_size /* Next ID for "huge" object */                        \
88     + (h)->sizeof_addr /* File address of "huge" object tracker B-tree  */    \
89                                                                               \
90     /* "Managed" object free space fields */                                  \
91     + (h)->sizeof_size /* Total man. free space */                            \
92     + (h)->sizeof_addr /* File address of free section header */              \
93                                                                               \
94     /* Statistics fields */                                                   \
95     + (h)->sizeof_size /* Size of man. space in heap */                       \
96     + (h)->sizeof_size /* Size of man. space iterator offset in heap */       \
97     + (h)->sizeof_size /* Size of alloacted man. space in heap */             \
98     + (h)->sizeof_size /* Number of man. objects in heap */                   \
99     + (h)->sizeof_size /* Size of huge space in heap */                       \
100     + (h)->sizeof_size /* Number of huge objects in heap */                   \
101     + (h)->sizeof_size /* Size of tiny space in heap */                       \
102     + (h)->sizeof_size /* Number of tiny objects in heap */                   \
103                                                                               \
104     /* "Managed" object doubling table info */                                \
105     + H5HF_DTABLE_INFO_SIZE(h) /* Size of managed obj. doubling-table info */ \
106     )
107 
108 /* Size of overhead for a direct block */
109 #define H5HF_MAN_ABS_DIRECT_OVERHEAD(h) (                                     \
110     /* General metadata fields */                                             \
111     H5HF_METADATA_PREFIX_SIZE(h->checksum_dblocks)                            \
112                                                                               \
113     /* Fractal heap managed, absolutely mapped direct block specific fields */ \
114     + (h)->sizeof_addr          /* File address of heap owning the block */   \
115     + (h)->heap_off_size        /* Offset of the block in the heap */         \
116     )
117 
118 /* Size of managed indirect block entry for a child direct block */
119 #define H5HF_MAN_INDIRECT_CHILD_DIR_ENTRY_SIZE(h) (                           \
120     ((h)->filter_len > 0 ?                                                    \
121         ((h)->sizeof_addr + (h)->sizeof_size + 4) : /* Size of entries for filtered direct blocks */ \
122         (h)->sizeof_addr)             /* Size of entries for un-filtered direct blocks */ \
123     )
124 
125 /* Size of managed indirect block */
126 #define H5HF_MAN_INDIRECT_SIZE(h, r) (                                        \
127     /* General metadata fields */                                             \
128     H5HF_METADATA_PREFIX_SIZE(TRUE)                                           \
129                                                                               \
130     /* Fractal heap managed, absolutely mapped indirect block specific fields */ \
131     + (h)->sizeof_addr          /* File address of heap owning the block */   \
132     + (h)->heap_off_size        /* Offset of the block in the heap */         \
133     + (MIN(r, (h)->man_dtable.max_direct_rows) * (h)->man_dtable.cparam.width * H5HF_MAN_INDIRECT_CHILD_DIR_ENTRY_SIZE(h)) /* Size of entries for direct blocks */ \
134     + (((r > (h)->man_dtable.max_direct_rows) ? (r - (h)->man_dtable.max_direct_rows) : 0)  * (h)->man_dtable.cparam.width * (h)->sizeof_addr) /* Size of entries for indirect blocks */ \
135     )
136 
137 /* Compute the # of bytes required to store an offset into a given buffer size */
138 #define H5HF_SIZEOF_OFFSET_BITS(b)   (((b) + 7) / 8)
139 #define H5HF_SIZEOF_OFFSET_LEN(l)   H5HF_SIZEOF_OFFSET_BITS(H5VM_log2_of2((unsigned)(l)))
140 
141 /* Heap ID bit flags */
142 /* Heap ID version (2 bits: 6-7) */
143 #define H5HF_ID_VERS_CURR       0x00    /* Current version of ID format */
144 #define H5HF_ID_VERS_MASK       0xC0    /* Mask for getting the ID version from flags */
145 /* Heap ID type (2 bits: 4-5) */
146 #define H5HF_ID_TYPE_MAN        0x00    /* "Managed" object - stored in fractal heap blocks */
147 #define H5HF_ID_TYPE_HUGE       0x10    /* "Huge" object - stored in file directly */
148 #define H5HF_ID_TYPE_TINY       0x20    /* "Tiny" object - stored in heap ID directly */
149 #define H5HF_ID_TYPE_RESERVED   0x30    /* "?" object - reserved for future use */
150 #define H5HF_ID_TYPE_MASK       0x30    /* Mask for getting the ID type from flags */
151 /* Heap ID bits 0-3 reserved for future use */
152 
153 /* Encode a "managed" heap ID */
154 #define H5HF_MAN_ID_ENCODE(i, h, o, l)                                        \
155     *(i) = H5HF_ID_VERS_CURR | H5HF_ID_TYPE_MAN;                              \
156     (i)++;                                                                    \
157     UINT64ENCODE_VAR((i), (o), (h)->heap_off_size);                           \
158     UINT64ENCODE_VAR((i), (l), (h)->heap_len_size)
159 
160 /* Decode a "managed" heap ID */
161 #define H5HF_MAN_ID_DECODE(i, h, f, o, l)                                     \
162     f = *(uint8_t *)i++;                                                      \
163     UINT64DECODE_VAR((i), (o), (h)->heap_off_size);                           \
164     UINT64DECODE_VAR((i), (l), (h)->heap_len_size)
165 
166 /* Free space section types for fractal heap */
167 /* (values stored in free space data structures in file) */
168 #define H5HF_FSPACE_SECT_SINGLE         0       /* Section is a range of actual bytes in a direct block */
169 #define H5HF_FSPACE_SECT_FIRST_ROW      1       /* Section is first range of blocks in an indirect block row */
170 #define H5HF_FSPACE_SECT_NORMAL_ROW     2       /* Section is a range of blocks in an indirect block row */
171 #define H5HF_FSPACE_SECT_INDIRECT       3       /* Section is a span of blocks in an indirect block */
172 
173 /* Flags for 'op' operations */
174 #define H5HF_OP_MODIFY          0x0001          /* Operation will modify object */
175 #define H5HF_OP_FLAGS           (H5HF_OP_MODIFY)        /* Bit-wise OR of all op flags */
176 
177 /* Flags for 'root_iblock_flags' field in header */
178 #define H5HF_ROOT_IBLOCK_PINNED         0x01
179 #define H5HF_ROOT_IBLOCK_PROTECTED      0x02
180 
181 
182 /****************************/
183 /* Package Private Typedefs */
184 /****************************/
185 
186 /* Doubling-table info */
187 typedef struct H5HF_dtable_t {
188     /* Immutable, pre-set information for table */
189     H5HF_dtable_cparam_t    cparam;     /* Creation parameters for table */
190 
191     /* Derived information (stored, varies during lifetime of table) */
192     haddr_t     table_addr;     /* Address of first block for table */
193                                 /* Undefined if no space allocated for table */
194     unsigned    curr_root_rows; /* Current number of rows in the root indirect block */
195                                 /* 0 indicates that the TABLE_ADDR field points
196                                  * to direct block (of START_BLOCK_SIZE) instead
197                                  * of indirect root block.
198                                  */
199 
200     /* Computed information (not stored) */
201     unsigned    max_root_rows;      /* Maximum # of rows in root indirect block */
202     unsigned    max_direct_rows;    /* Maximum # of direct rows in any indirect block */
203     unsigned    start_bits;         /* # of bits for starting block size (i.e. log2(start_block_size)) */
204     unsigned    max_direct_bits;    /* # of bits for max. direct block size (i.e. log2(max_direct_size)) */
205     unsigned    max_dir_blk_off_size;   /* Max. size of offsets in direct blocks */
206     unsigned    first_row_bits;     /* # of bits in address of first row */
207     hsize_t     num_id_first_row;   /* Number of IDs in first row of table */
208     hsize_t     *row_block_size;    /* Block size per row of indirect block */
209     hsize_t     *row_block_off;     /* Cumulative offset per row of indirect block */
210     hsize_t     *row_tot_dblock_free;   /* Total free space in dblocks for this row */
211                                     /* (For indirect block rows, it's the total
212                                      * free space in all direct blocks referenced
213                                      * from the indirect block)
214                                      */
215     size_t      *row_max_dblock_free;   /* Max. free space in dblocks for this row */
216                                     /* (For indirect block rows, it's the maximum
217                                      * free space in a direct block referenced
218                                      * from the indirect block)
219                                      */
220 } H5HF_dtable_t;
221 
222 /* Fractal heap free list info (forward decl - defined in H5HFflist.c) */
223 typedef struct H5HF_freelist_t H5HF_freelist_t;
224 
225 /* Forward decl indirect block info */
226 typedef struct H5HF_indirect_t H5HF_indirect_t;
227 
228 /* Fractal heap block location */
229 typedef struct H5HF_block_loc_t {
230     /* Necessary table fields */
231     unsigned    row;            /* Row of block in doubling table             */
232     unsigned    col;            /* Column of block in doubling table          */
233 
234     /* Derived/computed/cached table fields */
235     unsigned    entry;          /* Entry of block in doubling table           */
236 
237     /* Infrastructure */
238     H5HF_indirect_t *context;   /* Pointer to the indirect block containing the block */
239     struct H5HF_block_loc_t *up;  /* Pointer to next level up in the stack of levels */
240 } H5HF_block_loc_t;
241 
242 /* Fractal heap block iterator info */
243 typedef struct H5HF_block_iter_t {
244     hbool_t ready;              /* Set if iterator is finished initializing   */
245     H5HF_block_loc_t *curr;     /* Pointer to the current level information for iterator */
246 } H5HF_block_iter_t;
247 
248 /* Fractal heap free space section info */
249 typedef struct H5HF_free_section_t {
250     H5FS_section_info_t sect_info;              /* Free space section information (must be first in struct) */
251     union {
252         struct {
253             H5HF_indirect_t *parent;            /* Indirect block parent for free section's direct block */
254             unsigned par_entry;                 /* Entry of free section's direct block in parent indirect block */
255         } single;
256         struct {
257             struct H5HF_free_section_t *under;  /* Pointer to indirect block underlying row section */
258             unsigned    row;                    /* Row for range of blocks */
259             unsigned    col;                    /* Column for range of blocks */
260             unsigned    num_entries;            /* Number of entries covered */
261 
262             /* Fields that aren't stored */
263             hbool_t     checked_out;            /* Flag to indicate that a row section is temporarily out of the free space manager */
264         } row;
265         struct {
266             /* Holds either a pointer to an indirect block (if its "live") or
267              *  the block offset of it's indirect block (if its "serialized")
268              *  (This allows the indirect block that the section is within to
269              *          be compared with other sections, whether it's serialized
270              *          or not)
271              */
272             union {
273                 H5HF_indirect_t *iblock;        /* Indirect block for free section */
274                 hsize_t iblock_off;             /* Indirect block offset in "heap space" */
275             } u;
276             unsigned    row;                    /* Row for range of blocks */
277             unsigned    col;                    /* Column for range of blocks */
278             unsigned    num_entries;            /* Number of entries covered */
279 
280             /* Fields that aren't stored */
281             struct H5HF_free_section_t *parent; /* Pointer to "parent" indirect section */
282             unsigned    par_entry;              /* Entry within parent indirect section */
283             hsize_t     span_size;              /* Size of space tracked, in "heap space" */
284             unsigned    iblock_entries;         /* Number of entries in indirect block where section is located */
285             unsigned    rc;                     /* Reference count of outstanding row & child indirect sections */
286             unsigned    dir_nrows;              /* Number of direct rows in section */
287             struct H5HF_free_section_t **dir_rows;  /* Array of pointers to outstanding row sections */
288             unsigned    indir_nents;            /* Number of indirect entries in section */
289             struct H5HF_free_section_t **indir_ents; /* Array of pointers to outstanding child indirect sections */
290         } indirect;
291     } u;
292 } H5HF_free_section_t;
293 
294 /* The fractal heap header information */
295 /* (Each fractal heap header has certain information that is shared across all
296  * the instances of blocks in that fractal heap)
297  */
298 typedef struct H5HF_hdr_t {
299     /* Information for H5AC cache functions, _must_ be first field in structure */
300     H5AC_info_t cache_info;
301 
302     /* General header information (stored in header) */
303     unsigned    id_len;         /* Size of heap IDs (in bytes) */
304     unsigned    filter_len;     /* Size of I/O filter information (in bytes) */
305 
306     /* Flags for heap settings (stored in status byte in header) */
307     hbool_t     debug_objs;     /* Is the heap storing objects in 'debug' format */
308     hbool_t     write_once;     /* Is heap being written in "write once" mode? */
309     hbool_t     huge_ids_wrapped; /* Have "huge" object IDs wrapped around? */
310     hbool_t     checksum_dblocks; /* Should the direct blocks in the heap be checksummed? */
311 
312     /* Doubling table information (partially stored in header) */
313     /* (Partially set by user, partially derived/updated internally) */
314     H5HF_dtable_t man_dtable;   /* Doubling-table info for managed objects */
315 
316     /* Free space information for managed objects (stored in header) */
317     hsize_t     total_man_free; /* Total amount of free space in managed blocks */
318     haddr_t     fs_addr;        /* Address of free space header on disk */
319 
320     /* "Huge" object support (stored in header) */
321     uint32_t    max_man_size;   /* Max. size of object to manage in doubling table */
322     hsize_t     huge_next_id;   /* Next ID to use for indirectly tracked 'huge' object */
323     haddr_t     huge_bt2_addr;  /* Address of v2 B-tree for tracking "huge" object info */
324 
325     /* I/O filter support (stored in header, if any are used) */
326     H5O_pline_t pline;          /* I/O filter pipeline for heap objects */
327     size_t      pline_root_direct_size;    /* Size of filtered root direct block */
328     unsigned    pline_root_direct_filter_mask; /* I/O filter mask for filtered root direct block */
329 
330     /* Statistics for heap (stored in header) */
331     hsize_t     man_size;       /* Total amount of 'managed' space in heap */
332     hsize_t     man_alloc_size; /* Total amount of allocated 'managed' space in heap */
333     hsize_t     man_iter_off;   /* Offset of iterator in 'managed' heap space */
334     hsize_t     man_nobjs;      /* Number of 'managed' objects in heap */
335     hsize_t     huge_size;      /* Total size of 'huge' objects in heap */
336     hsize_t     huge_nobjs;     /* Number of 'huge' objects in heap */
337     hsize_t     tiny_size;      /* Total size of 'tiny' objects in heap */
338     hsize_t     tiny_nobjs;     /* Number of 'tiny' objects in heap */
339 
340     /* Cached/computed values (not stored in header) */
341     size_t      rc;             /* Reference count of heap's components using heap header */
342     haddr_t     heap_addr;      /* Address of heap header in the file */
343     size_t      heap_size;      /* Size of heap header in the file */
344     H5AC_protect_t mode;        /* Access mode for heap */
345     H5F_t      *f;              /* Pointer to file for heap */
346     size_t      file_rc;        /* Reference count of files using heap header */
347     hbool_t     pending_delete; /* Heap is pending deletion */
348     uint8_t     sizeof_size;    /* Size of file sizes */
349     uint8_t     sizeof_addr;    /* Size of file addresses */
350     struct H5HF_indirect_t *root_iblock;    /* Pointer to root indirect block */
351     unsigned    root_iblock_flags;      /* Flags to indicate whether root indirect block is pinned/protected */
352     H5FS_t      *fspace;        /* Free space list for objects in heap */
353     H5HF_block_iter_t next_block;   /* Block iterator for searching for next block with space */
354     H5B2_t      *huge_bt2;      /* v2 B-tree handle for huge objects */
355     hsize_t     huge_max_id;    /* Max. 'huge' heap ID before rolling 'huge' heap IDs over */
356     uint8_t     huge_id_size;   /* Size of 'huge' heap IDs (in bytes) */
357     hbool_t     huge_ids_direct; /* Flag to indicate that 'huge' object's offset & length are stored directly in heap ID */
358     size_t      tiny_max_len;   /* Max. size of tiny objects for this heap */
359     hbool_t     tiny_len_extended; /* Flag to indicate that 'tiny' object's length is stored in extended form (i.e. w/extra byte) */
360     uint8_t     heap_off_size;  /* Size of heap offsets (in bytes) */
361     uint8_t     heap_len_size;  /* Size of heap ID lengths (in bytes) */
362     hbool_t     checked_filters; /* TRUE if pipeline passes can_apply checks */
363 } H5HF_hdr_t;
364 
365 /* Common indirect block doubling table entry */
366 /* (common between entries pointing to direct & indirect child blocks) */
367 typedef struct H5HF_indirect_ent_t {
368     haddr_t     addr;           /* Direct block's address                     */
369 } H5HF_indirect_ent_t;
370 
371 /* Extern indirect block doubling table entry for compressed direct blocks */
372 /* (only exists for indirect blocks in heaps that have I/O filters) */
373 typedef struct H5HF_indirect_filt_ent_t {
374     size_t     size;            /* Size of child direct block, after passing though I/O filters */
375     unsigned	filter_mask;	/* Excluded filters for child direct block */
376 } H5HF_indirect_filt_ent_t;
377 
378 /* Fractal heap indirect block */
379 struct H5HF_indirect_t {
380     /* Information for H5AC cache functions, _must_ be first field in structure */
381     H5AC_info_t cache_info;
382 
383     /* Internal heap information (not stored) */
384     size_t      rc;             /* Reference count of objects using this block */
385     H5HF_hdr_t	*hdr;	        /* Shared heap header info	              */
386     struct H5HF_indirect_t *parent;	/* Shared parent indirect block info  */
387     unsigned    par_entry;      /* Entry in parent's table                    */
388     haddr_t     addr;           /* Address of this indirect block on disk     */
389     size_t      size;           /* Size of indirect block on disk             */
390     unsigned    nrows;          /* Total # of rows in indirect block          */
391     unsigned    max_rows;       /* Max. # of rows in indirect block           */
392     unsigned    nchildren;      /* Number of child blocks                     */
393     unsigned    max_child;      /* Max. offset used in child entries          */
394     struct H5HF_indirect_t **child_iblocks; /* Array of pointers to pinned child indirect blocks */
395 
396     /* Stored values */
397     hsize_t     block_off;      /* Offset of the block within the heap's address space */
398     H5HF_indirect_ent_t *ents;  /* Pointer to block entry table               */
399     H5HF_indirect_filt_ent_t *filt_ents;    /* Pointer to filtered information for direct blocks */
400 };
401 
402 /* A fractal heap direct block */
403 typedef struct H5HF_direct_t {
404     /* Information for H5AC cache functions, _must_ be first field in structure */
405     H5AC_info_t cache_info;
406 
407     /* Internal heap information */
408     H5HF_hdr_t	*hdr;	        /* Shared heap header info	              */
409     H5HF_indirect_t *parent;	/* Shared parent indirect block info          */
410     unsigned    par_entry;      /* Entry in parent's table                    */
411     size_t      size;           /* Size of direct block                       */
412     hsize_t     file_size;      /* Size of direct block in file (only valid when block's space is being freed) */
413     unsigned    blk_off_size;   /* Size of offsets in the block               */
414     uint8_t     *blk;           /* Pointer to buffer containing block data    */
415 
416     /* Stored values */
417     hsize_t     block_off;      /* Offset of the block within the heap's address space */
418 } H5HF_direct_t;
419 
420 /* Fractal heap */
421 struct H5HF_t {
422     H5HF_hdr_t  *hdr;           /* Pointer to internal fractal heap header info */
423     H5F_t      *f;              /* Pointer to file for heap */
424 };
425 
426 /* Fractal heap "parent info" (for loading a block) */
427 typedef struct H5HF_parent_t {
428     H5HF_hdr_t *hdr;                /* Pointer to heap header info */
429     H5HF_indirect_t *iblock;    /* Pointer to parent indirect block */
430     unsigned entry;             /* Location of block in parent's entry table */
431 } H5HF_parent_t;
432 
433 /* Typedef for indirectly accessed 'huge' object's records in the v2 B-tree */
434 typedef struct H5HF_huge_bt2_indir_rec_t {
435     haddr_t addr;       /* Address of the object in the file */
436     hsize_t len;        /* Length of the object in the file */
437     hsize_t id;         /* ID used for object (not used for 'huge' objects directly accessed) */
438 } H5HF_huge_bt2_indir_rec_t;
439 
440 /* Typedef for indirectly accessed, filtered 'huge' object's records in the v2 B-tree */
441 typedef struct H5HF_huge_bt2_filt_indir_rec_t {
442     haddr_t addr;       /* Address of the filtered object in the file */
443     hsize_t len;        /* Length of the filtered object in the file */
444     unsigned filter_mask;   /* I/O pipeline filter mask for filtered object in the file */
445     hsize_t obj_size;   /* Size of the de-filtered object in memory */
446     hsize_t id;         /* ID used for object (not used for 'huge' objects directly accessed) */
447 } H5HF_huge_bt2_filt_indir_rec_t;
448 
449 /* Typedef for directly accessed 'huge' object's records in the v2 B-tree */
450 typedef struct H5HF_huge_bt2_dir_rec_t {
451     haddr_t addr;       /* Address of the object in the file */
452     hsize_t len;        /* Length of the object in the file */
453 } H5HF_huge_bt2_dir_rec_t;
454 
455 /* Typedef for directly accessed, filtered 'huge' object's records in the v2 B-tree */
456 typedef struct H5HF_huge_bt2_filt_dir_rec_t {
457     haddr_t addr;       /* Address of the filtered object in the file */
458     hsize_t len;        /* Length of the filtered object in the file */
459     unsigned filter_mask;   /* I/O pipeline filter mask for filtered object in the file */
460     hsize_t obj_size;   /* Size of the de-filtered object in memory */
461 } H5HF_huge_bt2_filt_dir_rec_t;
462 
463 /* User data for free space section 'add' callback */
464 typedef struct {
465     H5HF_hdr_t *hdr;            /* Fractal heap header */
466     hid_t dxpl_id;              /* DXPL ID for operation */
467 } H5HF_sect_add_ud_t;
468 
469 /* User data for v2 B-tree 'remove' callback on 'huge' objects */
470 typedef struct {
471     H5HF_hdr_t *hdr;            /* Fractal heap header (in) */
472     hid_t dxpl_id;              /* DXPL ID for operation (in) */
473     hsize_t obj_len;            /* Length of object removed (out) */
474 } H5HF_huge_remove_ud_t;
475 
476 /* User data for fractal heap header cache client callback */
477 typedef struct H5HF_hdr_cache_ud_t {
478     H5F_t *f;                   /* File pointer */
479     hid_t dxpl_id;              /* DXPL ID for operation (in) */
480 } H5HF_hdr_cache_ud_t;
481 
482 /* User data for fractal heap indirect block cache client callbacks */
483 typedef struct H5HF_iblock_cache_ud_t {
484     H5HF_parent_t * par_info;   /* Parent info */
485     H5F_t * f;                  /* File pointer */
486     const unsigned *nrows;      /* Number of rows */
487 } H5HF_iblock_cache_ud_t;
488 
489 /* User data for fractal heap direct block cache client callbacks */
490 typedef struct H5HF_dblock_cache_ud_t {
491     H5HF_parent_t par_info;     /* Parent info */
492     H5F_t * f;                  /* File pointer */
493     size_t odi_size;		/* On disk image size of the direct block.
494 				 * Note that there is no necessary relation
495 				 * between this value, and the actual
496 				 * direct block size, as conpression may
497 				 * reduce the size of the on disk image,
498 				 * and check sums may increase it.
499 				 */
500     size_t dblock_size;		/* size of the direct block, which bears
501 				 * no necessary relation to the block
502 				 * odi_size -- the size of the on disk
503 				 * image of the block.  Note that the
504 				 * metadata cache is only interested
505 				 * in the odi_size, and thus it is this
506 				 * value that is passed to the cache in
507 				 * calls to it.
508 				 */
509     unsigned filter_mask;	/* Excluded filters for direct block */
510 } H5HF_dblock_cache_ud_t;
511 
512 
513 /*****************************/
514 /* Package Private Variables */
515 /*****************************/
516 
517 /* H5HF header inherits cache-like properties from H5AC */
518 H5_DLLVAR const H5AC_class_t H5AC_FHEAP_HDR[1];
519 
520 /* H5HF indirect block inherits cache-like properties from H5AC */
521 H5_DLLVAR const H5AC_class_t H5AC_FHEAP_IBLOCK[1];
522 
523 /* H5HF direct block inherits cache-like properties from H5AC */
524 H5_DLLVAR const H5AC_class_t H5AC_FHEAP_DBLOCK[1];
525 
526 /* The v2 B-tree class for tracking indirectly accessed 'huge' objects */
527 H5_DLLVAR const H5B2_class_t H5HF_HUGE_BT2_INDIR[1];
528 
529 /* The v2 B-tree class for tracking indirectly accessed filtered 'huge' objects */
530 H5_DLLVAR const H5B2_class_t H5HF_HUGE_BT2_FILT_INDIR[1];
531 
532 /* The v2 B-tree class for tracking directly accessed 'huge' objects */
533 H5_DLLVAR const H5B2_class_t H5HF_HUGE_BT2_DIR[1];
534 
535 /* The v2 B-tree class for tracking directly accessed filtered 'huge' objects */
536 H5_DLLVAR const H5B2_class_t H5HF_HUGE_BT2_FILT_DIR[1];
537 
538 /* H5HF single section inherits serializable properties from H5FS_section_class_t */
539 H5_DLLVAR H5FS_section_class_t H5HF_FSPACE_SECT_CLS_SINGLE[1];
540 
541 /* H5HF 'first' row section inherits serializable properties from H5FS_section_class_t */
542 H5_DLLVAR H5FS_section_class_t H5HF_FSPACE_SECT_CLS_FIRST_ROW[1];
543 
544 /* H5HF 'normal' row section inherits serializable properties from H5FS_section_class_t */
545 H5_DLLVAR H5FS_section_class_t H5HF_FSPACE_SECT_CLS_NORMAL_ROW[1];
546 
547 /* H5HF indirect section inherits serializable properties from H5FS_section_class_t */
548 H5_DLLVAR H5FS_section_class_t H5HF_FSPACE_SECT_CLS_INDIRECT[1];
549 
550 /* Declare a free list to manage the H5HF_indirect_t struct */
551 H5FL_EXTERN(H5HF_indirect_t);
552 
553 /* Declare a free list to manage the H5HF_indirect_ent_t sequence information */
554 H5FL_SEQ_EXTERN(H5HF_indirect_ent_t);
555 
556 /* Declare a free list to manage the H5HF_indirect_filt_ent_t sequence information */
557 H5FL_SEQ_EXTERN(H5HF_indirect_filt_ent_t);
558 
559 /* Declare a free list to manage the H5HF_indirect_t * sequence information */
560 typedef H5HF_indirect_t *H5HF_indirect_ptr_t;
561 H5FL_SEQ_EXTERN(H5HF_indirect_ptr_t);
562 
563 /* Declare a free list to manage the H5HF_direct_t struct */
564 H5FL_EXTERN(H5HF_direct_t);
565 
566 /* Declare a free list to manage heap direct block data to/from disk */
567 H5FL_BLK_EXTERN(direct_block);
568 
569 
570 /******************************/
571 /* Package Private Prototypes */
572 /******************************/
573 
574 /* Doubling table routines */
575 H5_DLL herr_t H5HF_dtable_init(H5HF_dtable_t *dtable);
576 H5_DLL herr_t H5HF_dtable_dest(H5HF_dtable_t *dtable);
577 H5_DLL herr_t H5HF_dtable_lookup(const H5HF_dtable_t *dtable, hsize_t off,
578     unsigned *row, unsigned *col);
579 H5_DLL unsigned H5HF_dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size);
580 H5_DLL unsigned H5HF_dtable_size_to_rows(const H5HF_dtable_t *dtable, hsize_t size);
581 H5_DLL hsize_t H5HF_dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row,
582     unsigned start_col, unsigned num_entries);
583 
584 /* Heap header routines */
585 H5_DLL H5HF_hdr_t * H5HF_hdr_alloc(H5F_t *f);
586 H5_DLL haddr_t H5HF_hdr_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam);
587 H5_DLL H5HF_hdr_t *H5HF_hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr,
588     H5AC_protect_t rw);
589 H5_DLL herr_t H5HF_hdr_finish_init_phase1(H5HF_hdr_t *hdr);
590 H5_DLL herr_t H5HF_hdr_finish_init_phase2(H5HF_hdr_t *hdr);
591 H5_DLL herr_t H5HF_hdr_finish_init(H5HF_hdr_t *hdr);
592 H5_DLL herr_t H5HF_hdr_incr(H5HF_hdr_t *hdr);
593 H5_DLL herr_t H5HF_hdr_decr(H5HF_hdr_t *hdr);
594 H5_DLL herr_t H5HF_hdr_fuse_incr(H5HF_hdr_t *hdr);
595 H5_DLL size_t H5HF_hdr_fuse_decr(H5HF_hdr_t *hdr);
596 H5_DLL herr_t H5HF_hdr_dirty(H5HF_hdr_t *hdr);
597 H5_DLL herr_t H5HF_hdr_adj_free(H5HF_hdr_t *hdr, ssize_t amt);
598 H5_DLL herr_t H5HF_hdr_adjust_heap(H5HF_hdr_t *hdr, hsize_t new_size, hssize_t extra_free);
599 H5_DLL herr_t H5HF_hdr_inc_alloc(H5HF_hdr_t *hdr, size_t alloc_size);
600 H5_DLL herr_t H5HF_hdr_start_iter(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, hsize_t curr_off, unsigned curr_entry);
601 H5_DLL herr_t H5HF_hdr_skip_blocks(H5HF_hdr_t *hdr, hid_t dxpl_id,
602     H5HF_indirect_t *iblock, unsigned start_entry, unsigned nentries);
603 H5_DLL herr_t H5HF_hdr_update_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_size);
604 H5_DLL herr_t H5HF_hdr_inc_iter(H5HF_hdr_t *hdr, hsize_t adv_size, unsigned nentries);
605 H5_DLL herr_t H5HF_hdr_reverse_iter(H5HF_hdr_t *hdr, hid_t dxpl_id,
606     haddr_t dblock_addr);
607 H5_DLL herr_t H5HF_hdr_reset_iter(H5HF_hdr_t *hdr, hsize_t curr_off);
608 H5_DLL herr_t H5HF_hdr_empty(H5HF_hdr_t *hdr);
609 H5_DLL herr_t H5HF_hdr_free(H5HF_hdr_t *hdr);
610 H5_DLL herr_t H5HF_hdr_delete(H5HF_hdr_t *hdr, hid_t dxpl_id);
611 H5_DLL herr_t H5HF_hdr_dest(H5HF_hdr_t *hdr);
612 
613 /* Indirect block routines */
614 H5_DLL herr_t H5HF_iblock_incr(H5HF_indirect_t *iblock);
615 H5_DLL herr_t H5HF_iblock_decr(H5HF_indirect_t *iblock);
616 H5_DLL herr_t H5HF_iblock_dirty(H5HF_indirect_t *iblock);
617 H5_DLL herr_t H5HF_man_iblock_root_create(H5HF_hdr_t *hdr, hid_t dxpl_id,
618     size_t min_dblock_size);
619 H5_DLL herr_t H5HF_man_iblock_root_double(H5HF_hdr_t *hdr, hid_t dxpl_id,
620     size_t min_dblock_size);
621 H5_DLL herr_t H5HF_man_iblock_alloc_row(H5HF_hdr_t *hdr, hid_t dxpl_id,
622     H5HF_free_section_t **sec_node);
623 H5_DLL herr_t H5HF_man_iblock_create(H5HF_hdr_t *hdr, hid_t dxpl_id,
624     H5HF_indirect_t *par_iblock, unsigned par_entry, unsigned nrows,
625     unsigned max_rows, haddr_t *addr_p);
626 H5_DLL H5HF_indirect_t *H5HF_man_iblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id,
627     haddr_t iblock_addr, unsigned iblock_nrows,
628     H5HF_indirect_t *par_iblock, unsigned par_entry, hbool_t must_protect,
629     H5AC_protect_t rw, hbool_t *did_protect);
630 H5_DLL herr_t H5HF_man_iblock_unprotect(H5HF_indirect_t *iblock, hid_t dxpl_id,
631     unsigned cache_flags, hbool_t did_protect);
632 H5_DLL herr_t H5HF_man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry,
633     haddr_t dblock_addr);
634 H5_DLL herr_t H5HF_man_iblock_detach(H5HF_indirect_t *iblock, hid_t dxpl_id, unsigned entry);
635 H5_DLL herr_t H5HF_man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry,
636     haddr_t *child_addr);
637 H5_DLL herr_t H5HF_man_iblock_delete(H5HF_hdr_t *hdr, hid_t dxpl_id,
638     haddr_t iblock_addr, unsigned iblock_nrows, H5HF_indirect_t *par_iblock,
639     unsigned par_entry);
640 H5_DLL herr_t H5HF_man_iblock_size(H5F_t *f, hid_t dxpl_id, H5HF_hdr_t *hdr,
641     haddr_t iblock_addr, unsigned nrows, H5HF_indirect_t *par_iblock, unsigned par_entry, hsize_t *heap_size/*out*/);
642 H5_DLL herr_t H5HF_man_iblock_dest(H5HF_indirect_t *iblock);
643 
644 /* Direct block routines */
645 H5_DLL herr_t H5HF_man_dblock_new(H5HF_hdr_t *fh, hid_t dxpl_id, size_t request,
646     H5HF_free_section_t **ret_sec_node);
647 H5_DLL herr_t H5HF_man_dblock_create(hid_t dxpl_id, H5HF_hdr_t *hdr,
648     H5HF_indirect_t *par_iblock, unsigned par_entry, haddr_t *addr_p,
649     H5HF_free_section_t **ret_sec_node);
650 H5_DLL herr_t H5HF_man_dblock_destroy(H5HF_hdr_t *hdr, hid_t dxpl_id,
651     H5HF_direct_t *dblock, haddr_t dblock_addr);
652 H5_DLL H5HF_direct_t *H5HF_man_dblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id,
653     haddr_t dblock_addr, size_t dblock_size,
654     H5HF_indirect_t *par_iblock, unsigned par_entry,
655     H5AC_protect_t rw);
656 H5_DLL herr_t H5HF_man_dblock_locate(H5HF_hdr_t *hdr, hid_t dxpl_id,
657     hsize_t obj_off, H5HF_indirect_t **par_iblock,
658     unsigned *par_entry, hbool_t *par_did_protect, H5AC_protect_t rw);
659 H5_DLL herr_t H5HF_man_dblock_delete(H5F_t *f, hid_t dxpl_id, haddr_t dblock_addr,
660     hsize_t dblock_size);
661 H5_DLL herr_t H5HF_man_dblock_dest(H5HF_direct_t *dblock);
662 
663 /* Managed object routines */
664 H5_DLL herr_t H5HF_man_insert(H5HF_hdr_t *fh, hid_t dxpl_id, size_t obj_size,
665     const void *obj, void *id);
666 H5_DLL herr_t H5HF_man_read(H5HF_hdr_t *fh, hid_t dxpl_id, const uint8_t *id,
667     void *obj);
668 H5_DLL herr_t H5HF_man_write(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id,
669     const void *obj);
670 H5_DLL herr_t H5HF_man_op(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id,
671     H5HF_operator_t op, void *op_data);
672 H5_DLL herr_t H5HF_man_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id);
673 
674 /* 'Huge' object routines */
675 H5_DLL herr_t H5HF_huge_init(H5HF_hdr_t *hdr);
676 H5_DLL herr_t H5HF_huge_insert(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t obj_size,
677     void *obj, void *id);
678 H5_DLL herr_t H5HF_huge_get_obj_len(H5HF_hdr_t *hdr, hid_t dxpl_id,
679     const uint8_t *id, size_t *obj_len_p);
680 H5_DLL herr_t H5HF_huge_read(H5HF_hdr_t *fh, hid_t dxpl_id, const uint8_t *id,
681     void *obj);
682 H5_DLL herr_t H5HF_huge_write(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id,
683     const void *obj);
684 H5_DLL herr_t H5HF_huge_op(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id,
685     H5HF_operator_t op, void *op_data);
686 H5_DLL herr_t H5HF_huge_remove(H5HF_hdr_t *fh, hid_t dxpl_id, const uint8_t *id);
687 H5_DLL herr_t H5HF_huge_term(H5HF_hdr_t *hdr, hid_t dxpl_id);
688 H5_DLL herr_t H5HF_huge_delete(H5HF_hdr_t *hdr, hid_t dxpl_id);
689 
690 /* 'Huge' object v2 B-tree function callbacks */
691 H5_DLL herr_t H5HF_huge_bt2_indir_found(const void *nrecord, void *op_data);
692 H5_DLL herr_t H5HF_huge_bt2_indir_remove(const void *nrecord, void *op_data);
693 H5_DLL herr_t H5HF_huge_bt2_filt_indir_found(const void *nrecord, void *op_data);
694 H5_DLL herr_t H5HF_huge_bt2_filt_indir_remove(const void *nrecord, void *op_data);
695 H5_DLL herr_t H5HF_huge_bt2_dir_remove(const void *nrecord, void *op_data);
696 H5_DLL herr_t H5HF_huge_bt2_filt_dir_found(const void *nrecord, void *op_data);
697 H5_DLL herr_t H5HF_huge_bt2_filt_dir_remove(const void *nrecord, void *op_data);
698 
699 /* 'Tiny' object routines */
700 H5_DLL herr_t H5HF_tiny_init(H5HF_hdr_t *hdr);
701 H5_DLL herr_t H5HF_tiny_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj,
702     void *id);
703 H5_DLL herr_t H5HF_tiny_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id,
704     size_t *obj_len_p);
705 H5_DLL herr_t H5HF_tiny_read(H5HF_hdr_t *fh, const uint8_t *id, void *obj);
706 H5_DLL herr_t H5HF_tiny_op(H5HF_hdr_t *hdr, const uint8_t *id,
707     H5HF_operator_t op, void *op_data);
708 H5_DLL herr_t H5HF_tiny_remove(H5HF_hdr_t *fh, const uint8_t *id);
709 
710 /* Debugging routines for dumping file structures */
711 H5_DLL void H5HF_hdr_print(const H5HF_hdr_t *hdr, hid_t dxpl_id,
712 	hbool_t dump_internal, FILE *stream, int indent, int fwidth);
713 H5_DLL herr_t H5HF_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr,
714     FILE *stream, int indent, int fwidth);
715 H5_DLL herr_t H5HF_dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr,
716     FILE *stream, int indent, int fwidth, haddr_t hdr_addr, size_t nrec);
717 H5_DLL void H5HF_iblock_print(const H5HF_indirect_t *iblock, hbool_t dump_internal,
718     FILE *stream, int indent, int fwidth);
719 H5_DLL herr_t H5HF_iblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr,
720     FILE *stream, int indent, int fwidth, haddr_t hdr_addr, unsigned nrows);
721 
722 /* Block iteration routines */
723 H5_DLL herr_t H5HF_man_iter_init(H5HF_block_iter_t *biter);
724 H5_DLL herr_t H5HF_man_iter_start_offset(H5HF_hdr_t *hdr, hid_t dxpl_id,
725     H5HF_block_iter_t *biter, hsize_t offset);
726 H5_DLL herr_t H5HF_man_iter_start_entry(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter,
727     H5HF_indirect_t *iblock, unsigned start_entry);
728 H5_DLL herr_t H5HF_man_iter_set_entry(const H5HF_hdr_t *hdr,
729     H5HF_block_iter_t *biter, unsigned entry);
730 H5_DLL herr_t H5HF_man_iter_next(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter,
731     unsigned nentries);
732 H5_DLL herr_t H5HF_man_iter_up(H5HF_block_iter_t *biter);
733 H5_DLL herr_t H5HF_man_iter_down(H5HF_block_iter_t *biter, H5HF_indirect_t *iblock);
734 H5_DLL herr_t H5HF_man_iter_reset(H5HF_block_iter_t *biter);
735 H5_DLL herr_t H5HF_man_iter_curr(H5HF_block_iter_t *biter, unsigned *row, unsigned *col,
736     unsigned *entry, H5HF_indirect_t **block);
737 H5_DLL herr_t H5HF_man_iter_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter,
738     hsize_t *offset);
739 H5_DLL hbool_t H5HF_man_iter_ready(H5HF_block_iter_t *biter);
740 
741 /* Free space manipulation routines */
742 H5_DLL herr_t H5HF_space_start(H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t may_create);
743 H5_DLL herr_t H5HF_space_add(H5HF_hdr_t *hdr, hid_t dxpl_id,
744     H5HF_free_section_t *node, unsigned flags);
745 H5_DLL htri_t H5HF_space_find(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t request,
746     H5HF_free_section_t **node);
747 H5_DLL herr_t H5HF_space_revert_root(const H5HF_hdr_t *hdr, hid_t dxpl_id);
748 H5_DLL herr_t H5HF_space_create_root(const H5HF_hdr_t *hdr, hid_t dxpl_id,
749     H5HF_indirect_t *root_iblock);
750 H5_DLL herr_t H5HF_space_size(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t *fs_size);
751 H5_DLL herr_t H5HF_space_remove(H5HF_hdr_t *hdr, hid_t dxpl_id,
752     H5HF_free_section_t *node);
753 H5_DLL herr_t H5HF_space_close(H5HF_hdr_t *hdr, hid_t dxpl_id);
754 H5_DLL herr_t H5HF_space_delete(H5HF_hdr_t *hdr, hid_t dxpl_id);
755 H5_DLL herr_t H5HF_space_sect_change_class(H5HF_hdr_t *hdr, hid_t dxpl_id,
756     H5HF_free_section_t *sect, unsigned new_class);
757 
758 /* Free space section routines */
759 H5_DLL H5HF_free_section_t *H5HF_sect_single_new(hsize_t sect_off,
760     size_t sect_size, H5HF_indirect_t *parent, unsigned par_entry);
761 H5_DLL herr_t H5HF_sect_single_revive(H5HF_hdr_t *hdr, hid_t dxpl_id,
762     H5HF_free_section_t *sect);
763 H5_DLL herr_t H5HF_sect_single_dblock_info(H5HF_hdr_t *hdr, hid_t dxpl_id,
764     H5HF_free_section_t *sect, haddr_t *dblock_addr, size_t *dblock_size);
765 H5_DLL herr_t H5HF_sect_single_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id,
766     H5HF_free_section_t *sect, size_t amt);
767 H5_DLL herr_t H5HF_sect_row_revive(H5HF_hdr_t *hdr, hid_t dxpl_id,
768     H5HF_free_section_t *sect);
769 H5_DLL herr_t H5HF_sect_row_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id,
770     H5HF_free_section_t *sect, unsigned *entry_p);
771 H5_DLL H5HF_indirect_t *H5HF_sect_row_get_iblock(H5HF_free_section_t *sect);
772 H5_DLL herr_t H5HF_sect_indirect_add(H5HF_hdr_t *hdr, hid_t dxpl_id,
773     H5HF_indirect_t *iblock, unsigned start_entry, unsigned nentries);
774 H5_DLL herr_t H5HF_sect_single_free(H5FS_section_info_t *sect);
775 
776 /* Internal operator callbacks */
777 H5_DLL herr_t H5HF_op_read(const void *obj, size_t obj_len, void *op_data);
778 H5_DLL herr_t H5HF_op_write(const void *obj, size_t obj_len, void *op_data);
779 
780 /* Testing routines */
781 #ifdef H5HF_TESTING
782 H5_DLL herr_t H5HF_get_cparam_test(const H5HF_t *fh, H5HF_create_t *cparam);
783 H5_DLL int H5HF_cmp_cparam_test(const H5HF_create_t *cparam1, const H5HF_create_t *cparam2);
784 H5_DLL unsigned H5HF_get_max_root_rows(const H5HF_t *fh);
785 H5_DLL unsigned H5HF_get_dtable_width_test(const H5HF_t *fh);
786 H5_DLL unsigned H5HF_get_dtable_max_drows_test(const H5HF_t *fh);
787 H5_DLL unsigned H5HF_get_iblock_max_drows_test(const H5HF_t *fh, unsigned pos);
788 H5_DLL hsize_t H5HF_get_dblock_size_test(const H5HF_t *fh, unsigned row);
789 H5_DLL hsize_t H5HF_get_dblock_free_test(const H5HF_t *fh, unsigned row);
790 H5_DLL herr_t H5HF_get_id_off_test(const H5HF_t *fh, const void *id, hsize_t *obj_off);
791 H5_DLL herr_t H5HF_get_id_type_test(const void *id, unsigned char *obj_type);
792 H5_DLL herr_t H5HF_get_tiny_info_test(const H5HF_t *fh, size_t *max_len,
793     hbool_t *len_extended);
794 H5_DLL herr_t H5HF_get_huge_info_test(const H5HF_t *fh, hsize_t *next_id,
795     hbool_t *ids_direct);
796 #endif /* H5HF_TESTING */
797 
798 #endif /* _H5HFpkg_H */
799 
800