H5Oprivate.h

00001 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00002  * Copyright by The HDF Group.                                               *
00003  * Copyright by the Board of Trustees of the University of Illinois.         *
00004  * All rights reserved.                                                      *
00005  *                                                                           *
00006  * This file is part of HDF5.  The full HDF5 copyright notice, including     *
00007  * terms governing use, modification, and redistribution, is contained in    *
00008  * the files COPYING and Copyright.html.  COPYING can be found at the root   *
00009  * of the source code distribution tree; Copyright.html can be found at the  *
00010  * root level of an installed copy of the electronic HDF5 document set and   *
00011  * is linked from the top-level documents page.  It can also be found at     *
00012  * http://hdfgroup.org/HDF5/doc/Copyright.html.  If you do not have          *
00013  * access to either file, you may request a copy from help@hdfgroup.org.     *
00014  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
00015 
00016 /*-------------------------------------------------------------------------
00017  *
00018  * Created:             H5Oprivate.h
00019  *                      Aug  5 1997
00020  *                      Robb Matzke <matzke@llnl.gov>
00021  *
00022  * Purpose:             Object header private include file.
00023  *
00024  * Modifications:
00025  *
00026  *-------------------------------------------------------------------------
00027  */
00028 #ifndef _H5Oprivate_H
00029 #define _H5Oprivate_H
00030 
00031 /* Include the public header file for this API */
00032 #include "H5Opublic.h"          /* Object header functions              */
00033 
00034 /* Public headers needed by this file */
00035 #include "H5Dpublic.h"          /* Dataset functions                    */
00036 #include "H5Lpublic.h"          /* Link functions                       */
00037 #include "H5Spublic.h"          /* Dataspace functions                  */
00038 
00039 /* Private headers needed by this file */
00040 #include "H5Fprivate.h"         /* File access                          */
00041 #include "H5SLprivate.h"        /* Skip lists                           */
00042 #include "H5Tprivate.h"         /* Datatype functions                   */
00043 #include "H5Zprivate.h"         /* I/O pipeline filters                 */
00044 
00045 /* Forward references of package typedefs */
00046 typedef struct H5O_msg_class_t H5O_msg_class_t;
00047 typedef struct H5O_mesg_t H5O_mesg_t;
00048 typedef struct H5O_t H5O_t;
00049 
00050 /* Values used to create the shared message & attribute heaps */
00051 /* (Note that these parameters have been tuned so that the resulting heap ID
00052  *      is exactly 8 bytes.  This is an efficient size as it can be stored
00053  *      directly in an 8 byte integer in memory, think carefully before changing it.
00054  *      -QAK)
00055  */
00056 #define H5O_FHEAP_MAN_WIDTH                     4
00057 #define H5O_FHEAP_MAN_START_BLOCK_SIZE          1024
00058 #define H5O_FHEAP_MAN_MAX_DIRECT_SIZE           (64 * 1024)
00059 #define H5O_FHEAP_MAN_MAX_INDEX                 40
00060 #define H5O_FHEAP_MAN_START_ROOT_ROWS           1
00061 #define H5O_FHEAP_CHECKSUM_DBLOCKS              TRUE
00062 #define H5O_FHEAP_MAX_MAN_SIZE                  (4 * 1024)
00063 #define H5O_FHEAP_ID_LEN                        8
00064 
00065 /* Object header macros */
00066 #define H5O_MESG_MAX_SIZE       65536   /*max obj header message size        */
00067 #define H5O_ALL         (-1)            /* Operate on all messages of type   */
00068 #define H5O_FIRST       (-2)            /* Operate on first message of type  */
00069 
00070 /* Flags needed when encoding messages */
00071 #define H5O_MSG_FLAG_CONSTANT   0x01u
00072 #define H5O_MSG_FLAG_SHARED     0x02u
00073 #define H5O_MSG_FLAG_DONTSHARE  0x04u
00074 #define H5O_MSG_FLAG_FAIL_IF_UNKNOWN 0x08u
00075 #define H5O_MSG_FLAG_MARK_IF_UNKNOWN 0x10u
00076 #define H5O_MSG_FLAG_WAS_UNKNOWN 0x20u
00077 #define H5O_MSG_FLAG_SHAREABLE  0x40u
00078 #define H5O_MSG_FLAG_BITS       (H5O_MSG_FLAG_CONSTANT|H5O_MSG_FLAG_SHARED|H5O_MSG_FLAG_DONTSHARE|H5O_MSG_FLAG_FAIL_IF_UNKNOWN|H5O_MSG_FLAG_MARK_IF_UNKNOWN|H5O_MSG_FLAG_WAS_UNKNOWN|H5O_MSG_FLAG_SHAREABLE)
00079 
00080 /* Flags for updating messages */
00081 #define H5O_UPDATE_TIME         0x01u
00082 #define H5O_UPDATE_FORCE        0x02u   /* Force updating the message */
00083 
00084 /* Hash value constants */
00085 #define H5O_HASH_SIZE 32
00086 
00087 /* ========= Object Creation properties ============ */
00088 #define H5O_CRT_ATTR_MAX_COMPACT_NAME   "max compact attr"      /* Max. # of attributes to store compactly */
00089 #define H5O_CRT_ATTR_MIN_DENSE_NAME     "min dense attr"        /* Min. # of attributes to store densely */
00090 #define H5O_CRT_OHDR_FLAGS_NAME         "object header flags"   /* Object header flags */
00091 #ifdef H5O_ENABLE_BOGUS
00092 #define H5O_BOGUS_MSG_FLAGS_NAME        "bogus msg flags"       /* Flags for 'bogus' message */
00093 #define H5O_BOGUS_MSG_FLAGS_SIZE        sizeof(uint8_t)
00094 #endif /* H5O_ENABLE_BOGUS */
00095 #ifdef H5O_ENABLE_BAD_MESG_COUNT
00096 #define H5O_BAD_MESG_COUNT_NAME         "bad message count"       /* Flag setting bad message count */
00097 #define H5O_BAD_MESG_COUNT_SIZE         sizeof(hbool_t)
00098 #endif /* H5O_ENABLE_BAD_MESG_COUNT */
00099 
00100 /* ========= Object Copy properties ============ */
00101 #define H5O_CPY_OPTION_NAME             "copy object"           /* Copy options */
00102 
00103 /* If the module using this macro is allowed access to the private variables, access them directly */
00104 #ifdef H5O_PACKAGE
00105 #define H5O_OH_GET_ADDR(O)    ((O)->chunk[0].addr)
00106 #else /* H5O_PACKAGE */
00107 #define H5O_OH_GET_ADDR(O)    (H5O_get_oh_addr(O))
00108 #endif /* H5O_PACKAGE */
00109 
00110 /* Set the fields in a shared message structure */
00111 #define H5O_UPDATE_SHARED(SH_MESG, SH_TYPE, F, MSG_TYPE, CRT_IDX, OH_ADDR)    \
00112     (SH_MESG)->type = (SH_TYPE);                                              \
00113     (SH_MESG)->file = (F);                                                    \
00114     (SH_MESG)->msg_type_id = (MSG_TYPE);                                      \
00115     (SH_MESG)->u.loc.index = (CRT_IDX);                                       \
00116     (SH_MESG)->u.loc.oh_addr = (OH_ADDR);
00117 
00118 
00119 /* Fractal heap ID type for shared message & attribute heap IDs. */
00120 typedef uint64_t H5O_fheap_id_t;
00121 
00122 /* The object location information for an object */
00123 typedef struct H5O_loc_t {
00124     H5F_t       *file;          /* File that object header is located within */
00125     haddr_t     addr;           /* File address of object header */
00126     hbool_t     holding_file;   /* True if this object header has incremented
00127                                  * its file's count of open objects. */
00128 } H5O_loc_t;
00129 
00130 /* Settings/flags for copying an object */
00131 typedef struct H5O_copy_t {
00132     hbool_t copy_shallow;               /* Flag to perform shallow hierarchy copy */
00133     hbool_t expand_soft_link;           /* Flag to expand soft links */
00134     hbool_t expand_ext_link;            /* Flag to expand external links */
00135     hbool_t expand_ref;                 /* Flag to expand object references */
00136     hbool_t copy_without_attr;          /* Flag to not copy attributes */
00137     hbool_t preserve_null;              /* Flag to not delete NULL messages */
00138     int     curr_depth;                 /* Current depth in hierarchy copied */
00139     int     max_depth;                  /* Maximum depth in hierarchy to copy */
00140     H5SL_t  *map_list;                  /* Skip list to hold address mappings */
00141     H5O_t   *oh_dst;                    /* The destination object header */
00142 } H5O_copy_t;
00143 
00144 /* Header message IDs */
00145 #define H5O_NULL_ID     0x0000          /* Null Message.  */
00146 #define H5O_SDSPACE_ID  0x0001          /* Dataspace Message. */
00147 #define H5O_LINFO_ID    0x0002          /* Link info Message. */
00148 #define H5O_DTYPE_ID    0x0003          /* Datatype Message.  */
00149 #define H5O_FILL_ID     0x0004          /* Fill Value Message. (Old)  */
00150 #define H5O_FILL_NEW_ID 0x0005          /* Fill Value Message. (New)  */
00151 #define H5O_LINK_ID     0x0006          /* Link Message. */
00152 #define H5O_EFL_ID      0x0007          /* External File List Message  */
00153 #define H5O_LAYOUT_ID   0x0008          /* Data Storage Layout Message.  */
00154 #define H5O_BOGUS_ID    0x0009          /* "Bogus" Message.  */
00155 #define H5O_GINFO_ID    0x000a          /* Group info Message.  */
00156 #define H5O_PLINE_ID    0x000b          /* Filter pipeline message.  */
00157 #define H5O_ATTR_ID     0x000c          /* Attribute Message.  */
00158 #define H5O_NAME_ID     0x000d          /* Object name message.  */
00159 #define H5O_MTIME_ID    0x000e          /* Modification time message. (Old)  */
00160 #define H5O_SHMESG_ID   0x000f          /* Shared message "SOHM" table. */
00161 #define H5O_CONT_ID     0x0010          /* Object header continuation message.  */
00162 #define H5O_STAB_ID     0x0011          /* Symbol table message.  */
00163 #define H5O_MTIME_NEW_ID 0x0012         /* Modification time message. (New)  */
00164 #define H5O_BTREEK_ID   0x0013          /* v1 B-tree 'K' values message.  */
00165 #define H5O_DRVINFO_ID  0x0014          /* Driver info message.  */
00166 #define H5O_AINFO_ID    0x0015          /* Attribute info message.  */
00167 #define H5O_REFCOUNT_ID 0x0016          /* Reference count message.  */
00168 #define H5O_UNKNOWN_ID  0x0017          /* Placeholder message ID for unknown message.  */
00169                                         /* (this should never exist in a file) */
00170 
00171 
00172 /* Shared object message types.
00173  * Shared objects can be committed, in which case the shared message contains
00174  * the location of the object header that holds the message, or shared in the
00175  * heap, in which case the shared message holds their heap ID.
00176  */
00177 #define H5O_SHARE_TYPE_UNSHARED     0           /* Message is not shared */
00178 #define H5O_SHARE_TYPE_SOHM         1           /* Message is stored in SOHM heap */
00179 #define H5O_SHARE_TYPE_COMMITTED    2           /* Message is stored in another object header */
00180 #define H5O_SHARE_TYPE_HERE         3           /* Message is stored in this object header, but is sharable */
00181 
00182 /* Detect messages that aren't stored in message's object header */
00183 #define H5O_IS_STORED_SHARED(T) ((((T) == H5O_SHARE_TYPE_SOHM) || ((T) == H5O_SHARE_TYPE_COMMITTED)) ? TRUE : FALSE)
00184 
00185 /* Detect shared messages that are "tracked" in some other location */
00186 #define H5O_IS_TRACKED_SHARED(T) ((T) > 0)
00187 
00188 
00189 /* Specify the object header address and index needed
00190  *      to locate a message in another object header.
00191  */
00192 typedef struct H5O_mesg_loc_t {
00193     H5O_msg_crt_idx_t index;            /* index within object header   */
00194     haddr_t oh_addr;                    /* address of object header    */
00195 } H5O_mesg_loc_t;
00196 
00197 
00198 /*
00199  * Shared object header message info.
00200  *
00201  * (This structure is used in other messages that can be shared and will
00202  * include a H5O_shared_t struct as the first field in their "native" type)
00203  */
00204 typedef struct H5O_shared_t {
00205     unsigned type;                      /* Type describing how message is shared */
00206     H5F_t *file;                        /* File that message is located within */
00207     unsigned msg_type_id;               /* Message's type ID */
00208     union {
00209         H5O_mesg_loc_t  loc;            /* Object location info              */
00210         H5O_fheap_id_t  heap_id;        /* ID within the SOHM heap           */
00211     } u;
00212 } H5O_shared_t;
00213 
00214 
00215 /*
00216  * Link Info Message.
00217  * (Contains dynamic information about links in a group)
00218  * (Data structure in memory)
00219  * (if the fields in this struct are changed, remember to change the default
00220  *      link info structure in src/H5Gprivate.h - QAK)
00221  * (if the fields in this struct are changed, also look at the code that
00222  *      creates intermediate groups in src/H5Gtraverse.c - QAK)
00223  * (The "max. creation order" field is signed so that we might have an easy
00224  *      way to add links to the front of the creation ordering (with negative
00225  *      values) as well as the end of the creation ordering - QAK)
00226  */
00227 typedef struct H5O_linfo_t {
00228     /* Creation order info */
00229     hbool_t     track_corder;           /* Are creation order values tracked on links? */
00230     hbool_t     index_corder;           /* Are creation order values indexed on links? */
00231     int64_t     max_corder;             /* Current max. creation order value for group */
00232     haddr_t     corder_bt2_addr;        /* Address of v2 B-tree for indexing creation order values of links */
00233 
00234     /* Storage management info */
00235     hsize_t     nlinks;                 /* Number of links in the group      */
00236     haddr_t     fheap_addr;             /* Address of fractal heap for storing "dense" links */
00237     haddr_t     name_bt2_addr;          /* Address of v2 B-tree for indexing names of links */
00238 } H5O_linfo_t;
00239 
00240 /* Initial version of the "old" fill value information */
00241 /* (It doesn't look like this value was ever used in the file -QAK) */
00242 #define H5O_FILL_VERSION_1      1
00243 /* Revised version of the "new" fill value information */
00244 #define H5O_FILL_VERSION_2      2
00245 /* Version of the "new" fill value information with smaller default format */
00246 #define H5O_FILL_VERSION_3      3
00247 
00248 /* The latest version of the format.  Look through the 'encode', 'decode'
00249  *      and 'size' callback for places to change when updating this. */
00250 #define H5O_FILL_VERSION_LATEST H5O_FILL_VERSION_3
00251 
00252 /*
00253  * Fill Value Message.
00254  * (Data structure in memory for both "old" and "new" fill value messages)
00255  *
00256  * The fill value message is fill value plus space allocation time, fill value
00257  * writing time, whether fill value is defined, and the location of the
00258  * message if it's shared.
00259  */
00260 
00261 typedef struct H5O_fill_t {
00262     H5O_shared_t        sh_loc;         /* Shared message info (must be first) */
00263 
00264     unsigned            version;        /* Encoding version number           */
00265     H5T_t               *type;          /*type. Null implies same as dataset */
00266     ssize_t             size;           /*number of bytes in the fill value  */
00267     void                *buf;           /*the fill value                     */
00268     H5D_alloc_time_t    alloc_time;     /* time to allocate space            */
00269     H5D_fill_time_t     fill_time;      /* time to write fill value          */
00270     hbool_t             fill_defined;   /* whether fill value is defined     */
00271 } H5O_fill_t;
00272 
00273 /*
00274  * Link message.
00275  * (Data structure in memory)
00276  */
00277 typedef struct H5O_link_hard_t {
00278     haddr_t     addr;                   /* Object header address */
00279 } H5O_link_hard_t;
00280 
00281 typedef struct H5O_link_soft_t {
00282     char        *name;                  /* Destination name */
00283 } H5O_link_soft_t;
00284 
00285 typedef struct H5O_link_ud_t {
00286     void        *udata;                 /* Opaque data supplied by the user */
00287     size_t       size;                  /* Size of udata */
00288 } H5O_link_ud_t;
00289 
00290 typedef struct H5O_link_t {
00291     H5L_type_t  type;                   /* Type of link */
00292     hbool_t     corder_valid;           /* Creation order for link is valid (not stored) */
00293     int64_t     corder;                 /* Creation order for link (stored if it's valid) */
00294     H5T_cset_t  cset;                   /* Character set of link name   */
00295     char        *name;                  /* Link name */
00296     union {
00297         H5O_link_hard_t hard;           /* Information for hard links */
00298         H5O_link_soft_t soft;           /* Information for soft links */
00299         H5O_link_ud_t ud;               /* Information for user-defined links */
00300     } u;
00301 } H5O_link_t;
00302 
00303 /*
00304  * External File List Message
00305  * (Data structure in memory)
00306  */
00307 #define H5O_EFL_ALLOC           16      /*number of slots to alloc at once   */
00308 #define H5O_EFL_UNLIMITED       H5F_UNLIMITED /*max possible file size       */
00309 
00310 typedef struct H5O_efl_entry_t {
00311     size_t      name_offset;            /*offset of name within heap         */
00312     char        *name;                  /*malloc'd name                      */
00313     off_t       offset;                 /*offset of data within file         */
00314     hsize_t     size;                   /*size allocated within file         */
00315 } H5O_efl_entry_t;
00316 
00317 typedef struct H5O_efl_t {
00318     haddr_t     heap_addr;              /*address of name heap               */
00319     size_t      nalloc;                 /*number of slots allocated          */
00320     size_t      nused;                  /*number of slots used               */
00321     H5O_efl_entry_t *slot;              /*array of external file entries     */
00322 } H5O_efl_t;
00323 
00324 /*
00325  * Data Layout Message.
00326  * (Data structure in file)
00327  */
00328 #define H5O_LAYOUT_NDIMS        (H5S_MAX_RANK+1)
00329 
00330 /* Initial version of the layout information.  Used when space is allocated */
00331 #define H5O_LAYOUT_VERSION_1    1
00332 
00333 /* This version added support for delaying allocation */
00334 #define H5O_LAYOUT_VERSION_2    2
00335 
00336 /* This version is revised to store just the information needed for each
00337  *      storage type, and to straighten out problems with contiguous layout's
00338  *      sizes (was encoding them as 4-byte values when they were really n-byte
00339  *      values (where n usually is 8)).
00340  */
00341 #define H5O_LAYOUT_VERSION_3    3
00342 
00343 
00344 /* Forward declaration of structs used below */
00345 struct H5D_layout_ops_t;                /* Defined in H5Dpkg.h               */
00346 struct H5D_chunk_ops_t;                 /* Defined in H5Dpkg.h               */
00347 
00348 typedef struct H5O_layout_contig_t {
00349     haddr_t     addr;                   /* File address of data              */
00350     hsize_t     size;                   /* Size of data in bytes             */
00351 } H5O_layout_contig_t;
00352 
00353 typedef struct H5O_layout_chunk_btree_t {
00354     haddr_t     addr;                   /* File address of B-tree            */
00355     H5RC_t     *shared;                 /* Ref-counted shared info for B-tree nodes */
00356 } H5O_layout_chunk_btree_t;
00357 
00358 typedef struct H5O_layout_chunk_t {
00359     H5D_chunk_index_t idx_type;         /* Type of chunk index               */
00360     unsigned    ndims;                  /* Num dimensions in chunk           */
00361     uint32_t    dim[H5O_LAYOUT_NDIMS];  /* Size of chunk in elements         */
00362     uint32_t    size;                   /* Size of chunk in bytes            */
00363     const struct H5D_chunk_ops_t *ops;  /* Pointer to chunked layout operations */
00364     union {
00365         H5O_layout_chunk_btree_t btree; /* Information for v1 B-tree index   */
00366     } u;
00367 } H5O_layout_chunk_t;
00368 
00369 typedef struct H5O_layout_compact_t {
00370     hbool_t     dirty;                  /* Dirty flag for compact dataset    */
00371     size_t      size;                   /* Size of buffer in bytes           */
00372     void        *buf;                   /* Buffer for compact dataset        */
00373 } H5O_layout_compact_t;
00374 
00375 typedef struct H5O_layout_t {
00376     H5D_layout_t type;                  /* Type of layout                    */
00377     unsigned version;                   /* Version of message                */
00378     const struct H5D_layout_ops_t *ops; /* Pointer to data layout I/O operations */
00379     union {
00380         H5O_layout_contig_t contig;     /* Information for contiguous layout */
00381         H5O_layout_chunk_t chunk;       /* Information for chunked layout    */
00382         H5O_layout_compact_t compact;   /* Information for compact layout    */
00383     } u;
00384 } H5O_layout_t;
00385 
00386 /* Enable reading/writing "bogus" messages */
00387 /* #define H5O_ENABLE_BOGUS */
00388 
00389 #ifdef H5O_ENABLE_BOGUS
00390 /*
00391  * "Bogus" Message.
00392  * (Data structure in memory)
00393  */
00394 #define H5O_BOGUS_VALUE         0xdeadbeef
00395 typedef struct H5O_bogus_t {
00396     unsigned u;                         /* Hold the bogus info */
00397 } H5O_bogus_t;
00398 #endif /* H5O_ENABLE_BOGUS */
00399 
00400 /*
00401  * Group info message.
00402  * (Contains constant information about a group)
00403  * (Data structure in memory)
00404  * (if the fields in this struct are changed, remember to change the default
00405  *      group info structure in src/H5Gprivate.h - QAK)
00406  */
00407 typedef struct H5O_ginfo_t {
00408     /* "Old" format group info (not stored) */
00409     uint32_t    lheap_size_hint;        /* Local heap size hint              */
00410 
00411     /* "New" format group info (stored) */
00412 
00413     /* (storage management info) */
00414     hbool_t     store_link_phase_change;/* Whether to store the link phase change values */
00415     uint16_t    max_compact;            /* Maximum # of compact links        */
00416     uint16_t    min_dense;              /* Minimum # of "dense" links        */
00417 
00418     /* (initial object header size info) */
00419     hbool_t     store_est_entry_info;   /* Whether to store the est. entry values */
00420     uint16_t    est_num_entries;        /* Estimated # of entries in group   */
00421     uint16_t    est_name_len;           /* Estimated length of entry name    */
00422 } H5O_ginfo_t;
00423 
00424 /*
00425  * Filter pipeline message.
00426  * (Data structure in memory)
00427  */
00428 typedef struct H5O_pline_t {
00429     H5O_shared_t        sh_loc;         /* Shared message info (must be first) */
00430 
00431     unsigned    version;                /* Encoding version number */
00432     size_t      nalloc;                 /*num elements in `filter' array     */
00433     size_t      nused;                  /*num filters defined                */
00434     H5Z_filter_info_t *filter;          /*array of filters                   */
00435 } H5O_pline_t;
00436 
00437 /*
00438  * Object name message.
00439  * (Data structure in memory)
00440  */
00441 
00442 typedef struct H5O_name_t {
00443     char        *s;                     /*ptr to malloc'd memory             */
00444 } H5O_name_t;
00445 
00446 /*
00447  * Shared message table message
00448  * Information about file-wide shared message table, stored in superblock
00449  * extension
00450  * (Data structure in memory)
00451  */
00452 typedef struct H5O_shmesg_table_t {
00453     haddr_t             addr;           /*file address of SOHM table */
00454     unsigned            version;        /*SOHM table version number */
00455     unsigned            nindexes;       /*number of indexes in the table */
00456 } H5O_shmesg_table_t;
00457 
00458 /*
00459  * Object header continuation message.
00460  * (Data structure in memory)
00461  */
00462 
00463 typedef struct H5O_cont_t {
00464     haddr_t     addr;                   /*address of continuation block      */
00465     size_t      size;                   /*size of continuation block         */
00466 
00467     /* the following field(s) do not appear on disk */
00468     unsigned    chunkno;                /*chunk this mesg refers to          */
00469 } H5O_cont_t;
00470 
00471 /*
00472  * Symbol table message.
00473  * (Data structure in memory)
00474  */
00475 typedef struct H5O_stab_t {
00476     haddr_t     btree_addr;             /*address of B-tree                  */
00477     haddr_t     heap_addr;              /*address of name heap               */
00478 } H5O_stab_t;
00479 
00480 /*
00481  * v1 B-tree 'K' value message
00482  * Information about file-wide non-default v1 B-tree 'K' values, stored in
00483  * superblock extension
00484  * (Data structure in memory)
00485  */
00486 typedef struct H5O_btreek_t {
00487     unsigned        btree_k[H5B_NUM_BTREE_ID];  /* B-tree internal node 'K' values */
00488     unsigned        sym_leaf_k;                 /* Symbol table leaf node's 'K' value */
00489 } H5O_btreek_t;
00490 
00491 /*
00492  * Driver info message
00493  * Information about driver info, stored in superblock extension
00494  * (Data structure in memory)
00495  */
00496 typedef struct H5O_drvinfo_t {
00497     char                name[9];                /* Driver name */
00498     size_t              len;                    /* Length of encoded buffer */
00499     uint8_t            *buf;                    /* Buffer for encoded info */
00500 } H5O_drvinfo_t;
00501 
00502 /*
00503  * Attribute Info Message.
00504  * (Contains dynamic information about attributes on an object)
00505  * (Data structure in memory)
00506  */
00507 typedef struct H5O_ainfo_t {
00508     /* Creation order info */
00509     hbool_t     track_corder;           /* Are creation order values tracked on attributes? */
00510     hbool_t     index_corder;           /* Are creation order values indexed on attributes? */
00511     H5O_msg_crt_idx_t max_crt_idx;      /* Maximum attribute creation index used */
00512     haddr_t     corder_bt2_addr;        /* Address of v2 B-tree for indexing creation order values of "dense" attributes */
00513 
00514     /* Storage management info */
00515     hsize_t     nattrs;                 /* Number of attributes on the object */
00516     haddr_t     fheap_addr;             /* Address of fractal heap for storing "dense" attributes */
00517     haddr_t     name_bt2_addr;          /* Address of v2 B-tree for indexing names of "dense" attributes */
00518 } H5O_ainfo_t;
00519 
00520 /*
00521  * Reference Count Message.
00522  * (Data structure in memory)
00523  */
00524 typedef uint32_t H5O_refcount_t;        /* Contains # of links to object, if >1 */
00525 
00526 /*
00527  * "Unknown" Message.
00528  * (Data structure in memory)
00529  */
00530 typedef unsigned H5O_unknown_t;         /* Original message type ID */
00531 
00532 
00533 /* Typedef for "application" iteration operations */
00534 typedef herr_t (*H5O_operator_t)(const void *mesg/*in*/, unsigned idx,
00535     void *operator_data/*in,out*/);
00536 
00537 /* Typedef for "internal library" iteration operations */
00538 typedef herr_t (*H5O_lib_operator_t)(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/,
00539     unsigned sequence, hbool_t *oh_modified/*out*/, void *operator_data/*in,out*/);
00540 
00541 /* Some syntactic sugar to make the compiler happy with two different kinds of iterator callbacks */
00542 typedef struct {
00543     enum {
00544         H5O_MESG_OP_APP,            /* Application callback */
00545         H5O_MESG_OP_LIB             /* Library internal callback */
00546     } op_type;
00547     union {
00548         H5O_operator_t app_op;      /* Application callback for each message */
00549         H5O_lib_operator_t lib_op;  /* Library internal callback for each message */
00550     } u;
00551 } H5O_mesg_operator_t;
00552 
00553 
00554 /* Typedef for abstract object creation */
00555 typedef struct {
00556     H5O_type_t obj_type;        /* Type of object to create */
00557     void *crt_info;             /* Information for object creation callback */
00558     void *new_obj;              /* Pointer to new object created */
00559 } H5O_obj_create_t;
00560 
00561 /* Forward declarations for prototype arguments */
00562 struct H5P_genplist_t;
00563 
00564 /* Object header routines */
00565 H5_DLL herr_t H5O_init(void);
00566 H5_DLL herr_t H5O_create(H5F_t *f, hid_t dxpl_id, size_t size_hint,
00567     hid_t ocpl_id, H5O_loc_t *loc/*out*/);
00568 H5_DLL herr_t H5O_open(H5O_loc_t *loc);
00569 H5_DLL herr_t H5O_close(H5O_loc_t *loc);
00570 H5_DLL int H5O_link(const H5O_loc_t *loc, int adjust, hid_t dxpl_id);
00571 H5_DLL int H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, unsigned *oh_flags);
00572 H5_DLL H5O_t *H5O_protect(H5O_loc_t *loc, hid_t dxpl_id);
00573 H5_DLL herr_t H5O_unprotect(H5O_loc_t *loc, H5O_t *oh);
00574 H5_DLL herr_t H5O_touch(H5O_loc_t *loc, hbool_t force, hid_t dxpl_id);
00575 H5_DLL herr_t H5O_touch_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
00576     hbool_t force);
00577 #ifdef H5O_ENABLE_BOGUS
00578 H5_DLL herr_t H5O_bogus_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned mesg_flags);
00579 #endif /* H5O_ENABLE_BOGUS */
00580 H5_DLL herr_t H5O_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr);
00581 H5_DLL herr_t H5O_get_info(H5O_loc_t *oloc, hid_t dxpl_id, hbool_t want_ih_info,
00582     H5O_info_t *oinfo);
00583 H5_DLL herr_t H5O_obj_type(const H5O_loc_t *loc, H5O_type_t *obj_type, hid_t dxpl_id);
00584 H5_DLL herr_t H5O_get_create_plist(const H5O_loc_t *loc, hid_t dxpl_id, struct H5P_genplist_t *oc_plist);
00585 H5_DLL hid_t H5O_open_name(H5G_loc_t *loc, const char *name, hid_t lapl_id, hbool_t app_ref);
00586 H5_DLL herr_t H5O_get_nlinks(const H5O_loc_t *loc, hid_t dxpl_id, hsize_t *nlinks);
00587 H5_DLL void *H5O_obj_create(H5F_t *f, H5O_type_t obj_type, void *crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id);
00588 H5_DLL haddr_t H5O_get_oh_addr(const H5O_t *oh);
00589 H5_DLL herr_t H5O_get_rc_and_type(const H5O_loc_t *oloc, hid_t dxpl_id, unsigned *rc, H5O_type_t *otype);
00590 
00591 /* Object header message routines */
00592 H5_DLL herr_t H5O_msg_create(const H5O_loc_t *loc, unsigned type_id, unsigned mesg_flags,
00593     unsigned update_flags, void *mesg, hid_t dxpl_id);
00594 H5_DLL herr_t H5O_msg_append_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned type_id,
00595     unsigned mesg_flags, unsigned update_flags, void *mesg);
00596 H5_DLL herr_t H5O_msg_write(const H5O_loc_t *loc, unsigned type_id,
00597     unsigned mesg_flags, unsigned update_flags, void *mesg, hid_t dxpl_id);
00598 H5_DLL herr_t H5O_msg_write_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
00599     unsigned type_id, unsigned mesg_flags, unsigned update_flags, void *mesg);
00600 H5_DLL void *H5O_msg_read(const H5O_loc_t *loc, unsigned type_id, void *mesg,
00601     hid_t dxpl_id);
00602 H5_DLL void *H5O_msg_read_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned type_id,
00603     void *mesg);
00604 H5_DLL herr_t H5O_msg_reset(unsigned type_id, void *native);
00605 H5_DLL void *H5O_msg_free(unsigned type_id, void *mesg);
00606 H5_DLL void *H5O_msg_copy(unsigned type_id, const void *mesg, void *dst);
00607 H5_DLL int H5O_msg_count(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id);
00608 H5_DLL htri_t H5O_msg_exists(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id);
00609 H5_DLL htri_t H5O_msg_exists_oh(const H5O_t *oh, unsigned type_id);
00610 H5_DLL herr_t H5O_msg_remove(const H5O_loc_t *loc, unsigned type_id, int sequence,
00611     hbool_t adj_link, hid_t dxpl_id);
00612 H5_DLL herr_t H5O_msg_remove_op(const H5O_loc_t *loc, unsigned type_id, int sequence,
00613     H5O_operator_t op, void *op_data, hbool_t adj_link, hid_t dxpl_id);
00614 H5_DLL herr_t H5O_msg_iterate(const H5O_loc_t *loc, unsigned type_id,
00615     const H5O_mesg_operator_t *op, void *op_data, hid_t dxpl_id);
00616 H5_DLL size_t H5O_msg_raw_size(const H5F_t *f, unsigned type_id,
00617     hbool_t disable_shared, const void *mesg);
00618 H5_DLL size_t H5O_msg_size_f(const H5F_t *f, hid_t ocpl_id, unsigned type_id,
00619     const void *mesg, size_t extra_raw);
00620 H5_DLL size_t H5O_msg_size_oh(const H5F_t *f, const H5O_t *oh, unsigned type_id,
00621     const void *mesg, size_t extra_raw);
00622 H5_DLL htri_t H5O_msg_is_shared(unsigned type_id, const void *mesg);
00623 H5_DLL htri_t H5O_msg_can_share(unsigned type_id, const void *mesg);
00624 H5_DLL htri_t H5O_msg_can_share_in_ohdr(unsigned type_id);
00625 H5_DLL herr_t H5O_msg_set_share(unsigned type_id, const H5O_shared_t *share,
00626     void *mesg);
00627 H5_DLL herr_t H5O_msg_reset_share(unsigned type_id, void *mesg);
00628 H5_DLL herr_t H5O_msg_get_crt_index(unsigned type_id, const void *mesg,
00629     H5O_msg_crt_idx_t *crt_idx);
00630 H5_DLL herr_t H5O_msg_encode(H5F_t *f, unsigned type_id, hbool_t disable_shared,
00631     unsigned char *buf, const void *obj);
00632 H5_DLL void* H5O_msg_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
00633     unsigned type_id, const unsigned char *buf);
00634 H5_DLL herr_t H5O_msg_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
00635     unsigned type_id, void *mesg);
00636 
00637 /* Object copying routines */
00638 H5_DLL herr_t H5O_copy_header_map(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */,
00639     hid_t dxpl_id, H5O_copy_t *cpy_info, hbool_t inc_depth);
00640 H5_DLL herr_t H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id,
00641     H5F_t *file_dst, void *_dst_ref, size_t ref_count, H5R_type_t ref_type,
00642     H5O_copy_t *cpy_info);
00643 
00644 /* Debugging routines */
00645 H5_DLL herr_t H5O_debug_id(unsigned type_id, H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, int indent, int fwidth);
00646 H5_DLL herr_t H5O_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent,
00647                          int fwidth);
00648 
00649 /* These functions operate on object locations */
00650 H5_DLL herr_t H5O_loc_reset(H5O_loc_t *loc);
00651 H5_DLL herr_t H5O_loc_copy(H5O_loc_t *dst, const H5O_loc_t *src, H5_copy_depth_t depth);
00652 H5_DLL herr_t H5O_loc_hold_file(H5O_loc_t *loc);
00653 H5_DLL herr_t H5O_loc_free(H5O_loc_t *loc);
00654 
00655 /* Layout operators */
00656 H5_DLL size_t H5O_layout_meta_size(const H5F_t *f, const void *_mesg);
00657 
00658 /* EFL operators */
00659 H5_DLL hsize_t H5O_efl_total_size(H5O_efl_t *efl);
00660 
00661 /* Fill value operators */
00662 H5_DLL herr_t H5O_fill_reset_dyn(H5O_fill_t *fill);
00663 H5_DLL herr_t H5O_fill_convert(H5O_fill_t *fill, H5T_t *type, hbool_t *fill_changed, hid_t dxpl_id);
00664 H5_DLL herr_t H5O_fill_set_latest_version(H5O_fill_t *fill);
00665 
00666 /* Link operators */
00667 H5_DLL herr_t H5O_link_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
00668     void *_mesg);
00669 
00670 /* Shared message operators */
00671 H5_DLL herr_t H5O_set_shared(H5O_shared_t *dst, const H5O_shared_t *src);
00672 
00673 #endif /* _H5Oprivate_H */
00674