MISR Toolkit  1.5.1
H5Opkg.h
Go to the documentation of this file.
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 COPYING file, which can be found at the root of the source code *
9  * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
10  * If you do not have access to either file, you may request a copy from *
11  * help@hdfgroup.org. *
12  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
13 
14 #ifndef H5O_PACKAGE
15 #error "Do not include this file outside the H5O package!"
16 #endif
17 
18 #ifndef _H5Opkg_H
19 #define _H5Opkg_H
20 
21 /* Get package's private header */
22 #include "H5Oprivate.h" /* Object headers */
23 
24 /* Other private headers needed by this file */
25 #include "H5ACprivate.h" /* Metadata cache */
26 #include "H5FLprivate.h" /* Free Lists */
27 
28 /* Object header macros */
29 #define H5O_NMESGS 8 /*initial number of messages */
30 #define H5O_NCHUNKS 2 /*initial number of chunks */
31 #define H5O_MIN_SIZE 22 /* Min. obj header data size (must be big enough for a message prefix and a continuation message) */
32 #define H5O_MSG_TYPES 25 /* # of types of messages */
33 #define H5O_MAX_CRT_ORDER_IDX 65535 /* Max. creation order index value */
34 
35 /* Versions of object header structure */
36 
37 /* Initial version of the object header format */
38 #define H5O_VERSION_1 1
39 
40 /* Revised version - leaves out reserved bytes and alignment padding, and adds
41  * magic number as prefix and checksum as suffix for all chunks.
42  */
43 #define H5O_VERSION_2 2
44 
45 /* The latest version of the format. Look through the 'flush'
46  * and 'size' callback for places to change when updating this. */
47 #define H5O_VERSION_LATEST H5O_VERSION_2
48 
49 /*
50  * Align messages on 8-byte boundaries because we would like to copy the
51  * object header chunks directly into memory and operate on them there, even
52  * on 64-bit architectures. This allows us to reduce the number of disk I/O
53  * requests with a minimum amount of mem-to-mem copies.
54  *
55  * Note: We no longer attempt to do this. - QAK, 10/16/06
56  */
57 #define H5O_ALIGN_OLD(X) (8 * (((X) + 7) / 8))
58 #define H5O_ALIGN_VERS(V, X) \
59  (((V) == H5O_VERSION_1) ? \
60  H5O_ALIGN_OLD(X) \
61  : \
62  (X) \
63  )
64 #define H5O_ALIGN_OH(O, X) \
65  H5O_ALIGN_VERS((O)->version, X)
66 #define H5O_ALIGN_F(F, X) \
67  H5O_ALIGN_VERS((H5F_USE_LATEST_FORMAT(F) ? H5O_VERSION_LATEST : H5O_VERSION_1), X)
68 
69 /* Size of checksum (on disk) */
70 #define H5O_SIZEOF_CHKSUM 4
71 
72 /* ========= Object Creation properties ============ */
73 /* Default values for some of the object creation properties */
74 /* NOTE: The H5O_CRT_ATTR_MAX_COMPACT_DEF & H5O_CRT_ATTR_MIN_DENSE_DEF values
75  * are "built into" the file format, make certain existing files with
76  * default attribute phase change storage are handled correctly if they
77  * are changed.
78  */
79 #define H5O_CRT_ATTR_MAX_COMPACT_DEF 8
80 #define H5O_CRT_ATTR_MIN_DENSE_DEF 6
81 #define H5O_CRT_OHDR_FLAGS_DEF H5O_HDR_STORE_TIMES
82 
83 /* Object header status flag definitions */
84 #define H5O_HDR_CHUNK0_1 0x00 /* Use 1-byte value for chunk #0 size */
85 #define H5O_HDR_CHUNK0_2 0x01 /* Use 2-byte value for chunk #0 size */
86 #define H5O_HDR_CHUNK0_4 0x02 /* Use 4-byte value for chunk #0 size */
87 #define H5O_HDR_CHUNK0_8 0x03 /* Use 8-byte value for chunk #0 size */
88 
89 /*
90  * Size of object header prefix.
91  */
92 #define H5O_SIZEOF_HDR(O) \
93  (((O)->version == H5O_VERSION_1) \
94  ? \
95  H5O_ALIGN_OLD(1 + /*version number */ \
96  1 + /*reserved */ \
97  2 + /*number of messages */ \
98  4 + /*reference count */ \
99  4) /*chunk data size */ \
100  : \
101  (H5_SIZEOF_MAGIC + /*magic number */ \
102  1 + /*version number */ \
103  1 + /*flags */ \
104  (((O)->flags & H5O_HDR_STORE_TIMES) ? ( \
105  4 + /*access time */ \
106  4 + /*modification time */ \
107  4 + /*change time */ \
108  4 /*birth time */ \
109  ) : 0) + \
110  (((O)->flags & H5O_HDR_ATTR_STORE_PHASE_CHANGE) ? ( \
111  2 + /*max compact attributes */ \
112  2 /*min dense attributes */ \
113  ) : 0) + \
114  (1 << ((O)->flags & H5O_HDR_CHUNK0_SIZE)) + /*chunk 0 data size */ \
115  H5O_SIZEOF_CHKSUM) /*checksum size */ \
116  )
117 
118 /*
119  * Size of object header message prefix
120  */
121 #define H5O_SIZEOF_MSGHDR_VERS(V,C) \
122  (((V) == H5O_VERSION_1) \
123  ? \
124  H5O_ALIGN_OLD(2 + /*message type */ \
125  2 + /*sizeof message data */ \
126  1 + /*flags */ \
127  3) /*reserved */ \
128  : \
129  (1 + /*message type */ \
130  2 + /*sizeof message data */ \
131  1 + /*flags */ \
132  ((C) ? ( \
133  2 /*creation index */ \
134  ) : 0)) \
135  )
136 #define H5O_SIZEOF_MSGHDR_OH(O) \
137  H5O_SIZEOF_MSGHDR_VERS((O)->version, (O)->flags & H5O_HDR_ATTR_CRT_ORDER_TRACKED)
138 #define H5O_SIZEOF_MSGHDR_F(F, C) \
139  H5O_SIZEOF_MSGHDR_VERS((H5F_USE_LATEST_FORMAT(F) || H5F_STORE_MSG_CRT_IDX(F)) ? H5O_VERSION_LATEST : H5O_VERSION_1, (C))
140 
141 /*
142  * Size of chunk "header" for each chunk
143  */
144 #define H5O_SIZEOF_CHKHDR_VERS(V) \
145  (((V) == H5O_VERSION_1) \
146  ? \
147  0 + /*no magic # */ \
148  0 /*no checksum */ \
149  : \
150  H5_SIZEOF_MAGIC + /*magic # */ \
151  H5O_SIZEOF_CHKSUM /*checksum */ \
152  )
153 #define H5O_SIZEOF_CHKHDR_OH(O) \
154  H5O_SIZEOF_CHKHDR_VERS((O)->version)
155 
156 /*
157  * Size of checksum for each chunk
158  */
159 #define H5O_SIZEOF_CHKSUM_VERS(V) \
160  (((V) == H5O_VERSION_1) \
161  ? \
162  0 /*no checksum */ \
163  : \
164  H5O_SIZEOF_CHKSUM /*checksum */ \
165  )
166 #define H5O_SIZEOF_CHKSUM_OH(O) \
167  H5O_SIZEOF_CHKSUM_VERS((O)->version)
168 
169 /* Input/output flags for decode functions */
170 #define H5O_DECODEIO_NOCHANGE 0x01u /* IN: do not modify values */
171 #define H5O_DECODEIO_DIRTY 0x02u /* OUT: message has been changed */
172 
173 /* Macro to incremend ndecode_dirtied (only if we are debugging) */
174 #ifndef NDEBUG
175 #define INCR_NDECODE_DIRTIED(OH) (OH)->ndecode_dirtied++;
176 #else /* NDEBUG */
177 #define INCR_NDECODE_DIRTIED(OH) ;
178 #endif /* NDEBUG */
179 
180 /* Load native information for a message, if it's not already present */
181 /* (Only works for messages with decode callback) */
182 #define H5O_LOAD_NATIVE(F, DXPL, IOF, OH, MSG, ERR) \
183  if(NULL == (MSG)->native) { \
184  const H5O_msg_class_t *msg_type = (MSG)->type; \
185  unsigned ioflags = (IOF); \
186  \
187  /* Decode the message */ \
188  HDassert(msg_type->decode); \
189  if(NULL == ((MSG)->native = (msg_type->decode)((F), (DXPL), (OH), (MSG)->flags, &ioflags, (MSG)->raw_size, (MSG)->raw))) \
190  HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, ERR, "unable to decode message") \
191  \
192  /* Mark the message dirty if it was changed by decoding */ \
193  if((ioflags & H5O_DECODEIO_DIRTY) && (H5F_get_intent((F)) & H5F_ACC_RDWR)) { \
194  (MSG)->dirty = TRUE; \
195  /* Increment the count of messages dirtied by decoding, but */ \
196  /* only ifndef NDEBUG */ \
197  INCR_NDECODE_DIRTIED(OH) \
198  } \
199  \
200  /* Set the message's "shared info", if it's shareable */ \
201  if((MSG)->flags & H5O_MSG_FLAG_SHAREABLE) { \
202  HDassert(msg_type->share_flags & H5O_SHARE_IS_SHARABLE); \
203  H5O_UPDATE_SHARED((H5O_shared_t *)(MSG)->native, H5O_SHARE_TYPE_HERE, (F), msg_type->id, (MSG)->crt_idx, (OH)->chunk[0].addr) \
204  } /* end if */ \
205  \
206  /* Set the message's "creation index", if it has one */ \
207  if(msg_type->set_crt_index) { \
208  /* Set the creation index for the message */ \
209  if((msg_type->set_crt_index)((MSG)->native, (MSG)->crt_idx) < 0) \
210  HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, ERR, "unable to set creation index") \
211  } /* end if */ \
212  } /* end if */
213 
214 /* Flags for a message class's "sharability" */
215 #define H5O_SHARE_IS_SHARABLE 0x01
216 #define H5O_SHARE_IN_OHDR 0x02
217 
218 
219 /* The "message class" type */
221  unsigned id; /*message type ID on disk */
222  const char *name; /*for debugging */
223  size_t native_size; /*size of native message */
224  unsigned share_flags; /* Message sharing settings */
225  void *(*decode)(H5F_t *, hid_t, H5O_t *, unsigned, unsigned *, size_t, const uint8_t *);
226  herr_t (*encode)(H5F_t *, hbool_t, uint8_t *, const void *);
227  void *(*copy)(const void *, void *); /*copy native value */
228  size_t (*raw_size)(const H5F_t *, hbool_t, const void *);/*sizeof encoded message */
229  herr_t (*reset)(void *); /*free nested data structs */
230  herr_t (*free)(void *); /*free main data struct */
231  herr_t (*del)(H5F_t *, hid_t, H5O_t *, void *); /* Delete space in file referenced by this message */
232  herr_t (*link)(H5F_t *, hid_t, H5O_t *, void *); /* Increment any links in file reference by this message */
233  herr_t (*set_share)(void*, const H5O_shared_t*); /* Set shared information */
234  htri_t (*can_share)(const void *); /* Is message allowed to be shared? */
235  herr_t (*pre_copy_file)(H5F_t *, const void *, hbool_t *, const H5O_copy_t *, void *); /*"pre copy" action when copying native value to file */
236  void *(*copy_file)(H5F_t *, void *, H5F_t *, hbool_t *, unsigned *, H5O_copy_t *, void *, hid_t); /*copy native value to file */
237  herr_t (*post_copy_file)(const H5O_loc_t *, const void *, H5O_loc_t *, void *, unsigned *, hid_t, H5O_copy_t *); /*"post copy" action when copying native value to file */
238  herr_t (*get_crt_index)(const void *, H5O_msg_crt_idx_t *); /* Get message's creation index */
239  herr_t (*set_crt_index)(void *, H5O_msg_crt_idx_t); /* Set message's creation index */
240  herr_t (*debug)(H5F_t*, hid_t, const void*, FILE*, int, int);
241 };
242 
243 struct H5O_mesg_t {
244  const H5O_msg_class_t *type; /*type of message */
245  hbool_t dirty; /*raw out of date wrt native */
246  hbool_t locked; /*message is locked into chunk */
247  uint8_t flags; /*message flags */
248  H5O_msg_crt_idx_t crt_idx; /*message creation index */
249  unsigned chunkno; /*chunk number for this mesg */
250  void *native; /*native format message */
251  uint8_t *raw; /*ptr to raw data */
252  size_t raw_size; /*size with alignment */
253 };
254 
255 typedef struct H5O_chunk_t {
256  haddr_t addr; /*chunk file address */
257  size_t size; /*chunk size */
258  size_t gap; /*space at end of chunk too small for null message */
259  uint8_t *image; /*image of file */
260 } H5O_chunk_t;
261 
262 struct H5O_t {
263  H5AC_info_t cache_info; /* Information for metadata cache functions, _must_ be */
264  /* first field in structure */
265 
266  /* File-specific information (not stored) */
267  size_t sizeof_size; /* Size of file sizes */
268  size_t sizeof_addr; /* Size of file addresses */
269 
270  /* Debugging information (not stored) */
271 #ifdef H5O_ENABLE_BAD_MESG_COUNT
272  hbool_t store_bad_mesg_count; /* Flag to indicate that a bad message count should be stored */
273  /* (This is to simulate a bug in earlier
274  * versions of the library)
275  */
276 #endif /* H5O_ENABLE_BAD_MESG_COUNT */
277 #ifndef NDEBUG
278  size_t ndecode_dirtied; /* Number of messages dirtied by decoding */
279 #endif /* NDEBUG */
280 
281  /* Chunk management information (not stored) */
282  size_t rc; /* Reference count of [continuation] chunks using this structure */
283  size_t chunk0_size; /* Size of serialized first chunk */
284  hbool_t mesgs_modified; /* Whether any messages were modified when the object header was deserialized */
285  hbool_t prefix_modified; /* Whether prefix was modified when the object header was deserialized */
286 
287  /* Object information (stored) */
288  hbool_t has_refcount_msg; /* Whether the object has a ref. count message */
289  unsigned nlink; /*link count */
290  uint8_t version; /*version number */
291  uint8_t flags; /*flags */
292 
293  /* Time information (stored, for versions > 1 & H5O_HDR_STORE_TIMES flag set) */
294  time_t atime; /*access time */
295  time_t mtime; /*modification time */
296  time_t ctime; /*change time */
297  time_t btime; /*birth time */
298 
299  /* Attribute information (stored, for versions > 1) */
300  unsigned max_compact; /* Maximum # of compact attributes */
301  unsigned min_dense; /* Minimum # of "dense" attributes */
302 
303  /* Message management (stored, encoded in chunks) */
304  size_t nmesgs; /*number of messages */
305  size_t alloc_nmesgs; /*number of message slots */
306  H5O_mesg_t *mesg; /*array of messages */
307  size_t link_msgs_seen; /* # of link messages seen when loading header */
308  size_t attr_msgs_seen; /* # of attribute messages seen when loading header */
309 
310  /* Chunk management (not stored) */
311  size_t nchunks; /*number of chunks */
312  size_t alloc_nchunks; /*chunks allocated */
313  H5O_chunk_t *chunk; /*array of chunks */
314 };
315 
316 /* Class for types of objects in file */
317 typedef struct H5O_obj_class_t {
318  H5O_type_t type; /*object type on disk */
319  const char *name; /*for debugging */
320  void *(*get_copy_file_udata)(void); /*retrieve user data for 'copy file' operation */
321  void (*free_copy_file_udata)(void *); /*free user data for 'copy file' operation */
322  htri_t (*isa)(H5O_t *); /*if a header matches an object class */
323  hid_t (*open)(const H5G_loc_t *, hid_t, hid_t, hbool_t ); /*open an object of this class */
324  void *(*create)(H5F_t *, void *, H5G_loc_t *, hid_t ); /*create an object of this class */
325  H5O_loc_t *(*get_oloc)(hid_t ); /*get the object header location for an object */
326  herr_t (*bh_info)(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info); /*get the index & heap info for an object */
327  herr_t (*flush)(H5G_loc_t *loc, hid_t dxpl_id); /*flush an opened object of this class */
329 
330 /* Node in skip list to map addresses from one file to another during object header copy */
331 typedef struct H5O_addr_map_t {
332  H5_obj_t src_obj_pos; /* Location of source object */
333  haddr_t dst_addr; /* Address of object in destination file */
334  hbool_t is_locked; /* Indicate that the destination object is locked currently */
335  hsize_t inc_ref_count; /* Number of deferred increments to reference count */
336  const H5O_obj_class_t *obj_class; /* Object class */
337  void *udata; /* Object class copy file udata */
339 
340 /* Stack of continuation messages to interpret */
341 typedef struct H5O_cont_msgs_t {
342  size_t nmsgs; /* Number of continuation messages found so far */
343  size_t alloc_nmsgs; /* Continuation messages allocated */
344  H5O_cont_t *msgs; /* Array of continuation messages */
346 
347 /* Common callback information for loading object header prefix from disk */
348 typedef struct H5O_common_cache_ud_t {
349  H5F_t *f; /* Pointer to file for object header/chunk */
350  hid_t dxpl_id; /* DXPL for operation */
351  unsigned file_intent; /* Read/write intent for file */
352  unsigned merged_null_msgs; /* Number of null messages merged together */
353  hbool_t mesgs_modified; /* Whether any messages were modified when the object header was deserialized */
354  H5O_cont_msgs_t *cont_msg_info; /* Pointer to continuation messages to work on */
355  haddr_t addr; /* Address of the prefix or chunk */
357 
358 /* Callback information for loading object header prefix from disk */
359 typedef struct H5O_cache_ud_t {
360  hbool_t made_attempt; /* Whether the deserialize routine was already attempted */
361  unsigned v1_pfx_nmesgs; /* Number of messages from v1 prefix header */
362  H5O_common_cache_ud_t common; /* Common object header cache callback info */
364 
365 /* Structure representing each chunk in the cache */
366 typedef struct H5O_chunk_proxy_t {
367  H5AC_info_t cache_info; /* Information for metadata cache functions, _must_ be */
368  /* first field in structure */
369 
370  H5O_t *oh; /* Object header for this chunk */
371  unsigned chunkno; /* Chunk number for this chunk */
373 
374 /* Callback information for loading object header chunk from disk */
375 typedef struct H5O_chk_cache_ud_t {
376  hbool_t decoding; /* Whether the object header is being decoded */
377  H5O_t *oh; /* Object header for this chunk */
378  unsigned chunkno; /* Index of chunk being brought in (for re-loads) */
379  size_t size; /* Size of chunk in the file */
380  H5O_common_cache_ud_t common; /* Common object header cache callback info */
382 
383 
384 /* H5O object header inherits cache-like properties from H5AC */
385 H5_DLLVAR const H5AC_class_t H5AC_OHDR[1];
386 
387 /* H5O object header chunk inherits cache-like properties from H5AC */
388 H5_DLLVAR const H5AC_class_t H5AC_OHDR_CHK[1];
389 
390 /* Header message ID to class mapping */
392 
393 /* Declare external the free list for H5O_t's */
395 
396 /* Declare external the free list for H5O_mesg_t sequences */
398 
399 /* Declare external the free list for H5O_chunk_t sequences */
401 
402 /* Declare external the free list for chunk_image blocks */
403 H5FL_BLK_EXTERN(chunk_image);
404 
405 /*
406  * Object header messages
407  */
408 
409 /* Null Message. (0x0000) */
411 
412 /* Simple Dataspace Message. (0x0001) */
414 
415 /* Link Information Message. (0x0002) */
417 
418 /* Datatype Message. (0x0003) */
420 
421 /* Old Fill Value Message. (0x0004) */
423 
424 /* New Fill Value Message. (0x0005) */
425 /*
426  * The new fill value message is fill value plus
427  * space allocation time and fill value writing time and whether fill
428  * value is defined.
429  */
431 
432 /* Link Message. (0x0006) */
434 
435 /* External File List Message. (0x0007) */
437 
438 /* Data Layout Message. (0x0008) */
440 
441 #ifdef H5O_ENABLE_BOGUS
442 /* "Bogus valid" Message. (0x0009) */
443 /* "Bogus invalid" Message. (0x00018) */
444 /*
445  * Used for debugging - should never be found in valid HDF5 file.
446  */
447 H5_DLLVAR const H5O_msg_class_t H5O_MSG_BOGUS_VALID[1];
448 H5_DLLVAR const H5O_msg_class_t H5O_MSG_BOGUS_INVALID[1];
449 #endif /* H5O_ENABLE_BOGUS */
450 
451 /* Group Information Message. (0x000a) */
453 
454 /* Filter pipeline message. (0x000b) */
456 
457 /* Attribute Message. (0x000c) */
459 
460 /* Object name message. (0x000d) */
462 
463 /* Modification Time Message. (0x000e) */
464 /*
465  * The message is just a `time_t'.
466  * (See also the "new" modification time message)
467  */
469 
470 /* Shared Message information message (0x000f)
471  * A message for the superblock extension, holding information about
472  * the file-wide shared message "SOHM" table
473  */
475 
476 /* Object Header Continuation Message. (0x0010) */
478 
479 /* Symbol Table Message. (0x0011) */
481 
482 /* New Modification Time Message. (0x0012) */
483 /*
484  * The message is just a `time_t'.
485  */
487 
488 /* v1 B-tree 'K' value message (0x0013)
489  * A message for the superblock extension, holding information about
490  * the file-wide v1 B-tree 'K' values.
491  */
493 
494 /* Driver info message (0x0014)
495  * A message for the superblock extension, holding information about
496  * the file driver settings
497  */
499 
500 /* Attribute Information Message. (0x0015) */
502 
503 /* Reference Count Message. (0x0016) */
505 
506 /* Placeholder for unknown message. (0x0017) */
508 
509 
510 /*
511  * Object header "object" types
512  */
513 
514 /* Group Object. (H5O_TYPE_GROUP - 0) */
516 
517 /* Dataset Object. (H5O_TYPE_DATASET - 1) */
519 
520 /* Datatype Object. (H5O_TYPE_NAMED_DATATYPE - 2) */
522 
523 
524 /* Package-local function prototypes */
527 H5_DLL hid_t H5O_open_by_loc(const H5G_loc_t *obj_loc, hid_t lapl_id, hid_t dxpl_id, hbool_t app_ref);
528 H5_DLL herr_t H5O_delete_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_mesg_t *mesg);
529 H5_DLL const H5O_obj_class_t * H5O_obj_class(const H5O_loc_t *loc, hid_t dxpl_id);
530 H5_DLL int H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, hbool_t *deleted);
534 
535 /* Object header message routines */
536 H5_DLL herr_t H5O_msg_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
537  const H5O_msg_class_t *type, unsigned *mesg_flags, void *mesg,
538  size_t *mesg_idx);
540  const H5O_msg_class_t *type, unsigned mesg_flags, unsigned update_flags,
541  void *mesg);
543  const H5O_msg_class_t *type, unsigned mesg_flags, unsigned update_flags,
544  void *mesg);
545 H5_DLL void *H5O_msg_free_real(const H5O_msg_class_t *type, void *mesg);
547 H5_DLL unsigned H5O_msg_count_real(const H5O_t *oh, const H5O_msg_class_t *type);
549  int sequence, H5O_operator_t op, void *op_data, hbool_t adj_link, hid_t dxpl_id);
550 H5_DLL void *H5O_msg_copy_file(const H5O_msg_class_t *type, H5F_t *file_src,
551  void *mesg_src, H5F_t *file_dst, hbool_t *recompute_size,
552  unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id);
554  const H5O_mesg_operator_t *op, void *op_data, hid_t dxpl_id);
555 
556 /* Object header chunk routines */
557 H5_DLL herr_t H5O_chunk_add(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx);
559  unsigned idx);
561  H5O_chunk_proxy_t *chk_proxy, hbool_t chk_dirtied);
562 H5_DLL herr_t H5O_chunk_update_idx(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx);
564 H5_DLL herr_t H5O_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx);
565 
566 /* Collect storage info for btree and heap */
567 H5_DLL herr_t H5O_attr_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
568  H5_ih_info_t *bh_info);
569 
570 /* Object header allocation routines */
571 H5_DLL herr_t H5O_alloc_msgs(H5O_t *oh, size_t min_alloc);
572 H5_DLL herr_t H5O_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
573  const H5O_msg_class_t *type, const void *mesg, size_t *mesg_idx);
575 H5_DLL herr_t H5O_release_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
576  H5O_mesg_t *mesg, hbool_t adj_link);
577 
578 /* Shared object operators */
579 H5_DLL void * H5O_shared_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
580  unsigned *ioflags, const uint8_t *buf, const H5O_msg_class_t *type);
581 H5_DLL herr_t H5O_shared_encode(const H5F_t *f, uint8_t *buf/*out*/, const H5O_shared_t *sh_mesg);
582 H5_DLL size_t H5O_shared_size(const H5F_t *f, const H5O_shared_t *sh_mesg);
583 H5_DLL herr_t H5O_shared_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
584  const H5O_msg_class_t *mesg_type, H5O_shared_t *sh_mesg);
585 H5_DLL herr_t H5O_shared_link(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
586  const H5O_msg_class_t *mesg_type, H5O_shared_t *sh_mesg);
587 H5_DLL herr_t H5O_shared_copy_file(H5F_t *file_src, H5F_t *file_dst,
588  const H5O_msg_class_t *mesg_type, const void *_native_src, void *_native_dst,
589  hbool_t *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info,
590  void *udata, hid_t dxpl_id);
592  const H5O_msg_class_t *mesg_type, const H5O_shared_t *shared_src,
593  H5O_shared_t *shared_dst, unsigned *mesg_flags, hid_t dxpl_id,
594  H5O_copy_t *cpy_info);
595 H5_DLL herr_t H5O_shared_debug(const H5O_shared_t *mesg, FILE *stream,
596  int indent, int fwidth);
597 
598 /* Attribute message operators */
599 H5_DLL herr_t H5O_attr_reset(void *_mesg);
600 H5_DLL herr_t H5O_attr_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg);
601 H5_DLL herr_t H5O_attr_link(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg);
603  hsize_t *nattrs);
604 
605 
606 /* These functions operate on object locations */
607 H5_DLL H5O_loc_t *H5O_get_loc(hid_t id);
608 
609 /* Testing functions */
610 #ifdef H5O_TESTING
611 H5_DLL htri_t H5O_is_attr_empty_test(hid_t oid);
612 H5_DLL htri_t H5O_is_attr_dense_test(hid_t oid);
613 H5_DLL herr_t H5O_num_attrs_test(hid_t oid, hsize_t *nattrs);
614 H5_DLL herr_t H5O_attr_dense_info_test(hid_t oid, hsize_t *name_count, hsize_t *corder_count);
615 H5_DLL herr_t H5O_check_msg_marked_test(hid_t oid, hbool_t flag_val);
616 H5_DLL herr_t H5O_expunge_chunks_test(const H5O_loc_t *oloc, hid_t dxpl_id);
617 H5_DLL herr_t H5O_get_rc(const H5O_loc_t *oloc, hid_t dxpl_id, unsigned *rc);
618 #endif /* H5O_TESTING */
619 
620 /* Object header debugging routines */
621 #ifdef H5O_DEBUG
622 H5_DLL herr_t H5O_assert(const H5O_t *oh);
623 #endif /* H5O_DEBUG */
624 H5_DLL herr_t H5O_debug_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, haddr_t addr, FILE *stream, int indent, int fwidth);
625 
626 #endif /* _H5Opkg_H */
627 
H5AC_info_t cache_info
Definition: H5Opkg.h:367
H5_DLL herr_t H5O_alloc_msgs(H5O_t *oh, size_t min_alloc)
H5_DLL herr_t H5O_shared_link(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, const H5O_msg_class_t *mesg_type, H5O_shared_t *sh_mesg)
H5_DLLVAR const H5O_msg_class_t H5O_MSG_AINFO[1]
Definition: H5Opkg.h:501
htri_t(* can_share)(const void *)
Definition: H5Opkg.h:234
H5O_mesg_t * mesg
Definition: H5Opkg.h:306
H5_DLL void * H5O_msg_free_real(const H5O_msg_class_t *type, void *mesg)
herr_t(* set_crt_index)(void *, H5O_msg_crt_idx_t)
Definition: H5Opkg.h:239
haddr_t dst_addr
Definition: H5Opkg.h:333
size_t alloc_nchunks
Definition: H5Opkg.h:312
H5_DLL int H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, hbool_t *deleted)
herr_t(* post_copy_file)(const H5O_loc_t *, const void *, H5O_loc_t *, void *, unsigned *, hid_t, H5O_copy_t *)
Definition: H5Opkg.h:237
H5_DLLVAR const H5AC_class_t H5AC_OHDR_CHK[1]
Definition: H5Opkg.h:388
#define H5O_MSG_TYPES
Definition: H5Opkg.h:32
size_t ndecode_dirtied
Definition: H5Opkg.h:278
H5_DLL herr_t H5O_msg_free_mesg(H5O_mesg_t *mesg)
H5_DLL herr_t H5O_delete_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_mesg_t *mesg)
unsigned int hbool_t
Definition: H5public.h:142
size_t size
Definition: H5Opkg.h:257
time_t atime
Definition: H5Opkg.h:294
const char * name
Definition: H5Opkg.h:222
H5O_msg_crt_idx_t crt_idx
Definition: H5Opkg.h:248
HDFFCLIBAPI intf * idx
struct H5O_chunk_t H5O_chunk_t
size_t alloc_nmsgs
Definition: H5Opkg.h:343
H5_DLL H5O_loc_t * H5O_get_loc(hid_t id)
herr_t(* free)(void *)
Definition: H5Opkg.h:230
struct H5O_obj_class_t H5O_obj_class_t
H5_DLL herr_t H5O_attr_reset(void *_mesg)
H5_DLLVAR const H5O_msg_class_t H5O_MSG_DTYPE[1]
Definition: H5Opkg.h:419
herr_t(* link)(H5F_t *, hid_t, H5O_t *, void *)
Definition: H5Opkg.h:232
size_t attr_msgs_seen
Definition: H5Opkg.h:308
struct H5O_addr_map_t H5O_addr_map_t
H5_DLLVAR const H5O_msg_class_t H5O_MSG_BTREEK[1]
Definition: H5Opkg.h:492
H5_DLLVAR const H5O_msg_class_t H5O_MSG_GINFO[1]
Definition: H5Opkg.h:452
void * native
Definition: H5Opkg.h:250
#define H5_DLL
Definition: H5api_adpt.h:256
herr_t(* del)(H5F_t *, hid_t, H5O_t *, void *)
Definition: H5Opkg.h:231
size_t alloc_nmesgs
Definition: H5Opkg.h:305
hbool_t locked
Definition: H5Opkg.h:246
H5_DLLVAR const H5O_obj_class_t H5O_OBJ_DATASET[1]
Definition: H5Opkg.h:518
H5O_cont_t * msgs
Definition: H5Opkg.h:344
struct H5O_chunk_proxy_t H5O_chunk_proxy_t
H5_DLLVAR const H5O_msg_class_t H5O_MSG_ATTR[1]
Definition: H5Opkg.h:458
size_t link_msgs_seen
Definition: H5Opkg.h:307
int herr_t
Definition: H5public.h:124
H5O_chunk_t * chunk
Definition: H5Opkg.h:313
H5_DLL herr_t H5O_chunk_resize(H5O_t *oh, H5O_chunk_proxy_t *chk_proxy)
H5_DLL hid_t H5O_open_by_loc(const H5G_loc_t *obj_loc, hid_t lapl_id, hid_t dxpl_id, hbool_t app_ref)
H5_DLL herr_t H5O_release_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_mesg_t *mesg, hbool_t adj_link)
unsigned long long hsize_t
Definition: H5public.h:169
hbool_t has_refcount_msg
Definition: H5Opkg.h:288
H5_DLL herr_t H5O_msg_flush(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg)
H5_DLL void * H5O_shared_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned *ioflags, const uint8_t *buf, const H5O_msg_class_t *type)
H5_DLLVAR const H5O_msg_class_t H5O_MSG_LAYOUT[1]
Definition: H5Opkg.h:439
time_t btime
Definition: H5Opkg.h:297
H5O_type_t
Definition: H5Opublic.h:81
H5_DLLVAR const H5AC_class_t H5AC_OHDR[1]
Definition: H5Opkg.h:385
H5_DLL herr_t H5O_attr_link(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg)
H5_DLL herr_t H5O_msg_remove_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, int sequence, H5O_operator_t op, void *op_data, hbool_t adj_link, hid_t dxpl_id)
struct H5O_common_cache_ud_t H5O_common_cache_ud_t
size_t nchunks
Definition: H5Opkg.h:311
hbool_t made_attempt
Definition: H5Opkg.h:360
H5_DLL const H5O_obj_class_t * H5O_obj_class(const H5O_loc_t *loc, hid_t dxpl_id)
herr_t(* reset)(void *)
Definition: H5Opkg.h:229
unsigned id
Definition: H5Opkg.h:221
H5_DLLVAR const H5O_msg_class_t H5O_MSG_PLINE[1]
Definition: H5Opkg.h:455
size_t native_size
Definition: H5Opkg.h:223
H5_DLL void * H5O_msg_copy_file(const H5O_msg_class_t *type, H5F_t *file_src, void *mesg_src, H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id)
uint8_t flags
Definition: H5Opkg.h:247
H5O_type_t type
Definition: H5Opkg.h:318
size_t gap
Definition: H5Opkg.h:258
H5_DLL herr_t H5O_inc_rc(H5O_t *oh)
H5_DLL herr_t H5O_attr_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg)
H5_DLL herr_t H5O_debug_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, haddr_t addr, FILE *stream, int indent, int fwidth)
size_t rc
Definition: H5Opkg.h:282
H5_DLLVAR const H5O_msg_class_t *const H5O_msg_class_g[H5O_MSG_TYPES]
Definition: H5Opkg.h:391
uint64_t haddr_t
Definition: H5public.h:182
H5_DLL herr_t H5O_chunk_update_idx(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx)
H5FL_SEQ_EXTERN(H5O_mesg_t)
size_t chunk0_size
Definition: H5Opkg.h:283
const H5O_msg_class_t * type
Definition: H5Opkg.h:244
haddr_t addr
Definition: H5Opkg.h:256
herr_t(* get_crt_index)(const void *, H5O_msg_crt_idx_t *)
Definition: H5Opkg.h:238
unsigned nlink
Definition: H5Opkg.h:289
H5_DLL herr_t H5O_chunk_unprotect(H5F_t *f, hid_t dxpl_id, H5O_chunk_proxy_t *chk_proxy, hbool_t chk_dirtied)
H5_DLLVAR const H5O_msg_class_t H5O_MSG_DRVINFO[1]
Definition: H5Opkg.h:498
struct H5O_chk_cache_ud_t H5O_chk_cache_ud_t
H5_DLLVAR const H5O_msg_class_t H5O_MSG_FILL_NEW[1]
Definition: H5Opkg.h:430
H5O_common_cache_ud_t common
Definition: H5Opkg.h:362
Definition: H5Opkg.h:262
time_t mtime
Definition: H5Opkg.h:295
H5_DLL size_t H5O_shared_size(const H5F_t *f, const H5O_shared_t *sh_mesg)
H5_DLL herr_t H5O_shared_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, const H5O_msg_class_t *mesg_type, H5O_shared_t *sh_mesg)
H5_DLLVAR const H5O_msg_class_t H5O_MSG_EFL[1]
Definition: H5Opkg.h:436
size_t raw_size
Definition: H5Opkg.h:252
H5AC_info_t cache_info
Definition: H5Opkg.h:263
H5_DLL herr_t H5O_msg_append_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, unsigned mesg_flags, unsigned update_flags, void *mesg)
uint8_t version
Definition: H5Opkg.h:290
H5_DLLVAR const H5O_msg_class_t H5O_MSG_NAME[1]
Definition: H5Opkg.h:461
const H5O_obj_class_t * obj_class
Definition: H5Opkg.h:336
H5_DLL herr_t H5O_shared_copy_file(H5F_t *file_src, H5F_t *file_dst, const H5O_msg_class_t *mesg_type, const void *_native_src, void *_native_dst, hbool_t *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id)
H5_DLL herr_t H5O_chunk_add(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx)
int hid_t
Definition: H5Ipublic.h:54
herr_t(* encode)(H5F_t *, hbool_t, uint8_t *, const void *)
Definition: H5Opkg.h:226
H5_DLL herr_t H5O_flush_msgs(H5F_t *f, H5O_t *oh)
H5_DLLVAR const H5O_msg_class_t H5O_MSG_MTIME[1]
Definition: H5Opkg.h:468
unsigned chunkno
Definition: H5Opkg.h:371
herr_t(* pre_copy_file)(H5F_t *, const void *, hbool_t *, const H5O_copy_t *, void *)
Definition: H5Opkg.h:235
H5_DLLVAR const H5O_obj_class_t H5O_OBJ_GROUP[1]
Definition: H5Opkg.h:515
H5_DLL herr_t H5O_dec_rc(H5O_t *oh)
H5_DLLVAR const H5O_msg_class_t H5O_MSG_FILL[1]
Definition: H5Opkg.h:422
struct H5O_cont_msgs_t H5O_cont_msgs_t
size_t(* raw_size)(const H5F_t *, hbool_t, const void *)
Definition: H5Opkg.h:228
H5_DLL herr_t H5O_shared_post_copy_file(H5F_t *f, const H5O_msg_class_t *mesg_type, const H5O_shared_t *shared_src, H5O_shared_t *shared_dst, unsigned *mesg_flags, hid_t dxpl_id, H5O_copy_t *cpy_info)
herr_t(* set_share)(void *, const H5O_shared_t *)
Definition: H5Opkg.h:233
H5_DLL herr_t H5O_shared_debug(const H5O_shared_t *mesg, FILE *stream, int indent, int fwidth)
uint8_t flags
Definition: H5Opkg.h:291
uint32_t H5O_msg_crt_idx_t
Definition: H5Opublic.h:127
uint8_t * raw
Definition: H5Opkg.h:251
H5_DLL herr_t H5O_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, const void *mesg, size_t *mesg_idx)
H5_DLLVAR const H5O_msg_class_t H5O_MSG_NULL[1]
Definition: H5Opkg.h:410
H5_DLL H5O_chunk_proxy_t * H5O_chunk_protect(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx)
unsigned max_compact
Definition: H5Opkg.h:300
H5_DLL herr_t H5O_shared_encode(const H5F_t *f, uint8_t *buf, const H5O_shared_t *sh_mesg)
H5FL_BLK_EXTERN(chunk_image)
hbool_t decoding
Definition: H5Opkg.h:376
H5_DLLVAR const H5O_msg_class_t H5O_MSG_UNKNOWN[1]
Definition: H5Opkg.h:507
H5_DLLVAR const H5O_msg_class_t H5O_MSG_LINK[1]
Definition: H5Opkg.h:433
uint8_t * image
Definition: H5Opkg.h:259
H5_DLLVAR const H5O_msg_class_t H5O_MSG_SDSPACE[1]
Definition: H5Opkg.h:413
H5_DLL herr_t H5O_attr_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info)
H5O_t * oh
Definition: H5Opkg.h:370
struct H5O_cache_ud_t H5O_cache_ud_t
H5_DLL herr_t H5O_msg_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, unsigned *mesg_flags, void *mesg, size_t *mesg_idx)
H5_DLLVAR const H5O_msg_class_t H5O_MSG_SHMESG[1]
Definition: H5Opkg.h:474
unsigned merged_null_msgs
Definition: H5Opkg.h:352
hbool_t dirty
Definition: H5Opkg.h:245
unsigned min_dense
Definition: H5Opkg.h:301
H5_DLL herr_t H5O_msg_write_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, unsigned mesg_flags, unsigned update_flags, void *mesg)
HDFFCLIBAPI intf intf intf * type
H5_DLL unsigned H5O_msg_count_real(const H5O_t *oh, const H5O_msg_class_t *type)
size_t nmesgs
Definition: H5Opkg.h:304
unsigned chunkno
Definition: H5Opkg.h:378
void * udata
Definition: H5Opkg.h:337
#define H5_DLLVAR
Definition: H5api_adpt.h:257
H5FL_EXTERN(H5O_t)
hbool_t mesgs_modified
Definition: H5Opkg.h:353
const char * name
Definition: H5Opkg.h:319
H5_DLLVAR const H5O_msg_class_t H5O_MSG_MTIME_NEW[1]
Definition: H5Opkg.h:486
unsigned chunkno
Definition: H5Opkg.h:249
herr_t(* bh_info)(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info)
Definition: H5Opkg.h:326
hsize_t inc_ref_count
Definition: H5Opkg.h:335
H5O_cont_msgs_t * cont_msg_info
Definition: H5Opkg.h:354
time_t ctime
Definition: H5Opkg.h:296
H5_DLLVAR const H5O_obj_class_t H5O_OBJ_DATATYPE[1]
Definition: H5Opkg.h:521
H5_DLLVAR const H5O_msg_class_t H5O_MSG_CONT[1]
Definition: H5Opkg.h:477
hbool_t prefix_modified
Definition: H5Opkg.h:285
H5_DLLVAR const H5O_msg_class_t H5O_MSG_REFCOUNT[1]
Definition: H5Opkg.h:504
hbool_t mesgs_modified
Definition: H5Opkg.h:284
H5_DLL herr_t H5O_attr_count_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hsize_t *nattrs)
hbool_t is_locked
Definition: H5Opkg.h:334
H5_DLLVAR const H5O_msg_class_t H5O_MSG_LINFO[1]
Definition: H5Opkg.h:416
int htri_t
Definition: H5public.h:143
H5_DLLVAR const H5O_msg_class_t H5O_MSG_STAB[1]
Definition: H5Opkg.h:480
H5O_common_cache_ud_t common
Definition: H5Opkg.h:380
size_t sizeof_addr
Definition: H5Opkg.h:268
unsigned share_flags
Definition: H5Opkg.h:224
H5_obj_t src_obj_pos
Definition: H5Opkg.h:332
herr_t(* debug)(H5F_t *, hid_t, const void *, FILE *, int, int)
Definition: H5Opkg.h:240
unsigned v1_pfx_nmesgs
Definition: H5Opkg.h:361
size_t nmsgs
Definition: H5Opkg.h:342
H5_DLL herr_t H5O_free(H5O_t *oh)
HDFFCLIBAPI intf * buf
H5_DLL herr_t H5O_msg_iterate_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, const H5O_mesg_operator_t *op, void *op_data, hid_t dxpl_id)
H5_DLL herr_t H5O_condense_header(H5F_t *f, H5O_t *oh, hid_t dxpl_id)
H5_DLL herr_t H5O_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx)
unsigned file_intent
Definition: H5Opkg.h:351
Definition: H5Fpkg.h:255
size_t sizeof_size
Definition: H5Opkg.h:267

MISR Toolkit - Copyright © 2005 - 2020 Jet Propulsion Laboratory
Generated on Fri Jun 19 2020 22:49:52