H5Opkg.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 #ifndef H5O_PACKAGE
00017 #error "Do not include this file outside the H5O package!"
00018 #endif
00019 
00020 #ifndef _H5Opkg_H
00021 #define _H5Opkg_H
00022 
00023 /* Get package's private header */
00024 #include "H5Oprivate.h"         /* Object headers                       */
00025 
00026 /* Other private headers needed by this file */
00027 #include "H5ACprivate.h"        /* Metadata cache                       */
00028 
00029 /* Object header macros */
00030 #define H5O_NMESGS      8               /*initial number of messages         */
00031 #define H5O_NCHUNKS     2               /*initial number of chunks           */
00032 #define H5O_MIN_SIZE    22              /* Min. obj header data size (must be big enough for a message prefix and a continuation message) */
00033 #define H5O_MSG_TYPES   24              /* # of types of messages            */
00034 #define H5O_MAX_CRT_ORDER_IDX 65535     /* Max. creation order index value   */
00035 
00036 /* Versions of object header structure */
00037 
00038 /* Initial version of the object header format */
00039 #define H5O_VERSION_1           1
00040 
00041 /* Revised version - leaves out reserved bytes and alignment padding, and adds
00042  *      magic number as prefix and checksum as suffix for all chunks.
00043  */
00044 #define H5O_VERSION_2           2
00045 
00046 /* The latest version of the format.  Look through the 'flush'
00047  *      and 'size' callback for places to change when updating this. */
00048 #define H5O_VERSION_LATEST      H5O_VERSION_2
00049 
00050 /*
00051  * Align messages on 8-byte boundaries because we would like to copy the
00052  * object header chunks directly into memory and operate on them there, even
00053  * on 64-bit architectures.  This allows us to reduce the number of disk I/O
00054  * requests with a minimum amount of mem-to-mem copies.
00055  *
00056  * Note: We no longer attempt to do this. - QAK, 10/16/06
00057  */
00058 #define H5O_ALIGN_OLD(X)        (8 * (((X) + 7) / 8))
00059 #define H5O_ALIGN_VERS(V, X)                                                  \
00060     (((V) == H5O_VERSION_1) ?                                                 \
00061                 H5O_ALIGN_OLD(X)                                              \
00062         :                                                                     \
00063                 (X)                                                           \
00064     )
00065 #define H5O_ALIGN_OH(O, X)                                                    \
00066      H5O_ALIGN_VERS((O)->version, X)
00067 #define H5O_ALIGN_F(F, X)                                                     \
00068      H5O_ALIGN_VERS((H5F_USE_LATEST_FORMAT(F) ? H5O_VERSION_LATEST : H5O_VERSION_1), X)
00069 
00070 /* Size of checksum (on disk) */
00071 #define H5O_SIZEOF_CHKSUM               4
00072 
00073 /* ========= Object Creation properties ============ */
00074 /* Default values for some of the object creation properties */
00075 /* NOTE: The H5O_CRT_ATTR_MAX_COMPACT_DEF & H5O_CRT_ATTR_MIN_DENSE_DEF values
00076  *      are "built into" the file format, make certain existing files with
00077  *      default attribute phase change storage are handled correctly if they
00078  *      are changed.
00079  */
00080 #define H5O_CRT_ATTR_MAX_COMPACT_DEF    8
00081 #define H5O_CRT_ATTR_MIN_DENSE_DEF      6
00082 #define H5O_CRT_OHDR_FLAGS_DEF          H5O_HDR_STORE_TIMES
00083 
00084 /* Object header status flag definitions */
00085 #define H5O_HDR_CHUNK0_1                0x00    /* Use 1-byte value for chunk #0 size */
00086 #define H5O_HDR_CHUNK0_2                0x01    /* Use 2-byte value for chunk #0 size */
00087 #define H5O_HDR_CHUNK0_4                0x02    /* Use 4-byte value for chunk #0 size */
00088 #define H5O_HDR_CHUNK0_8                0x03    /* Use 8-byte value for chunk #0 size */
00089 
00090 /*
00091  * Size of object header prefix.
00092  */
00093 #define H5O_SIZEOF_HDR(O)                                                     \
00094     (((O)->version == H5O_VERSION_1)                                          \
00095         ?                                                                     \
00096             H5O_ALIGN_OLD(1 +   /*version number        */                    \
00097                 1 +             /*reserved              */                    \
00098                 2 +             /*number of messages    */                    \
00099                 4 +             /*reference count       */                    \
00100                 4)              /*chunk data size       */                    \
00101         :                                                                     \
00102             (H5_SIZEOF_MAGIC +  /*magic number          */                    \
00103                 1 +             /*version number        */                    \
00104                 1 +             /*flags                 */                    \
00105                 (((O)->flags & H5O_HDR_STORE_TIMES) ? (                       \
00106                   4 +           /*access time           */                    \
00107                   4 +           /*modification time     */                    \
00108                   4 +           /*change time           */                    \
00109                   4             /*birth time            */                    \
00110                 ) : 0) +                                                      \
00111                 (((O)->flags & H5O_HDR_ATTR_STORE_PHASE_CHANGE) ? (           \
00112                   2 +           /*max compact attributes */                   \
00113                   2             /*min dense attributes  */                    \
00114                 ) : 0) +                                                      \
00115                 (1 << ((O)->flags & H5O_HDR_CHUNK0_SIZE)) + /*chunk 0 data size */ \
00116                 H5O_SIZEOF_CHKSUM) /*checksum size      */                    \
00117     )
00118 
00119 /*
00120  * Size of object header message prefix
00121  */
00122 #define H5O_SIZEOF_MSGHDR_VERS(V,C)                                           \
00123     (((V) == H5O_VERSION_1)                                                   \
00124         ?                                                                     \
00125             H5O_ALIGN_OLD(2 +   /*message type          */                    \
00126                 2 +             /*sizeof message data   */                    \
00127                 1 +             /*flags                 */                    \
00128                 3)              /*reserved              */                    \
00129         :                                                                     \
00130             (1 +                /*message type          */                    \
00131                 2 +             /*sizeof message data   */                    \
00132                 1 +             /*flags                 */                    \
00133                 ((C) ? (                                                      \
00134                   2             /*creation index        */                    \
00135                 ) : 0))                                                       \
00136     )
00137 #define H5O_SIZEOF_MSGHDR_OH(O)                                               \
00138     H5O_SIZEOF_MSGHDR_VERS((O)->version, (O)->flags & H5O_HDR_ATTR_CRT_ORDER_TRACKED)
00139 #define H5O_SIZEOF_MSGHDR_F(F, C)                                                     \
00140     H5O_SIZEOF_MSGHDR_VERS((H5F_USE_LATEST_FORMAT(F) || H5F_STORE_MSG_CRT_IDX(F)) ? H5O_VERSION_LATEST : H5O_VERSION_1, (C))
00141 
00142 /*
00143  * Size of chunk "header" for each chunk
00144  */
00145 #define H5O_SIZEOF_CHKHDR_VERS(V)                                             \
00146     (((V) == H5O_VERSION_1)                                                   \
00147         ?                                                                     \
00148             0 +         /*no magic #  */                                      \
00149                 0       /*no checksum */                                      \
00150         :                                                                     \
00151             H5_SIZEOF_MAGIC +           /*magic #  */                         \
00152                 H5O_SIZEOF_CHKSUM       /*checksum */                         \
00153     )
00154 #define H5O_SIZEOF_CHKHDR_OH(O)                                               \
00155     H5O_SIZEOF_CHKHDR_VERS((O)->version)
00156 
00157 /*
00158  * Size of checksum for each chunk
00159  */
00160 #define H5O_SIZEOF_CHKSUM_VERS(V)                                             \
00161     (((V) == H5O_VERSION_1)                                                   \
00162         ?                                                                     \
00163             0           /*no checksum */                                      \
00164         :                                                                     \
00165             H5O_SIZEOF_CHKSUM           /*checksum */                         \
00166     )
00167 #define H5O_SIZEOF_CHKSUM_OH(O)                                               \
00168     H5O_SIZEOF_CHKSUM_VERS((O)->version)
00169 
00170 /* Input/output flags for decode functions */
00171 #define H5O_DECODEIO_NOCHANGE           0x01u   /* IN: do not modify values */
00172 #define H5O_DECODEIO_DIRTY              0x02u   /* OUT: message has been changed */
00173 
00174 /* Macro to incremend ndecode_dirtied (only if we are debugging) */
00175 #ifndef NDEBUG
00176 #define INCR_NDECODE_DIRTIED(OH) (OH)->ndecode_dirtied++;
00177 #else /* NDEBUG */
00178 #define INCR_NDECODE_DIRTIED(OH) ;
00179 #endif /* NDEBUG */
00180 
00181 /* Load native information for a message, if it's not already present */
00182 /* (Only works for messages with decode callback) */
00183 #define H5O_LOAD_NATIVE(F, DXPL, IOF, OH, MSG, ERR)                           \
00184     if(NULL == (MSG)->native) {                                               \
00185         const H5O_msg_class_t   *msg_type = (MSG)->type;                      \
00186         unsigned                ioflags = (IOF);                              \
00187                                                                               \
00188         /* Decode the message */                                              \
00189         HDassert(msg_type->decode);                                           \
00190         if(NULL == ((MSG)->native = (msg_type->decode)((F), (DXPL), (OH), (MSG)->flags, &ioflags, (MSG)->raw))) \
00191             HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, ERR, "unable to decode message") \
00192                                                                               \
00193         /* Mark the message dirty if it was changed by decoding */            \
00194         if((ioflags & H5O_DECODEIO_DIRTY) && (H5F_get_intent((F)) & H5F_ACC_RDWR)) { \
00195             (MSG)->dirty = TRUE;                                              \
00196             /* Increment the count of messages dirtied by decoding, but */    \
00197             /* only ifndef NDEBUG */                                          \
00198             INCR_NDECODE_DIRTIED(OH)                                          \
00199         }                                                                     \
00200                                                                               \
00201         /* Set the message's "shared info", if it's shareable */              \
00202         if((MSG)->flags & H5O_MSG_FLAG_SHAREABLE) {                           \
00203             H5O_UPDATE_SHARED((H5O_shared_t *)(MSG)->native, H5O_SHARE_TYPE_HERE, (F), msg_type->id, (MSG)->crt_idx, (OH)->chunk[0].addr) \
00204         } /* end if */                                                        \
00205                                                                               \
00206         /* Set the message's "creation index", if it has one */               \
00207         if(msg_type->set_crt_index) {                                         \
00208             /* Set the creation index for the message */                      \
00209             if((msg_type->set_crt_index)((MSG)->native, (MSG)->crt_idx) < 0)  \
00210                 HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, ERR, "unable to set creation index") \
00211         } /* end if */                                                        \
00212     } /* end if */
00213 
00214 /* Flags for a message class's "sharability" */
00215 #define H5O_SHARE_IS_SHARABLE   0x01
00216 #define H5O_SHARE_IN_OHDR       0x02
00217 
00218 
00219 /* The "message class" type */
00220 struct H5O_msg_class_t {
00221     unsigned    id;                             /*message type ID on disk   */
00222     const char  *name;                          /*for debugging             */
00223     size_t      native_size;                    /*size of native message    */
00224     unsigned    share_flags;                    /* Message sharing settings */
00225     void        *(*decode)(H5F_t*, hid_t, H5O_t *, unsigned, unsigned *, const uint8_t *);
00226     herr_t      (*encode)(H5F_t*, hbool_t, uint8_t*, const void *);
00227     void        *(*copy)(const void *, void *); /*copy native value         */
00228     size_t      (*raw_size)(const H5F_t *, hbool_t, const void *);/*sizeof encoded message      */
00229     herr_t      (*reset)(void *);               /*free nested data structs  */
00230     herr_t      (*free)(void *);                /*free main data struct  */
00231     herr_t      (*del)(H5F_t *, hid_t, H5O_t *, void *);    /* Delete space in file referenced by this message */
00232     herr_t      (*link)(H5F_t *, hid_t, H5O_t *, void *);   /* Increment any links in file reference by this message */
00233     herr_t      (*set_share)(void*, const H5O_shared_t*);   /* Set shared information */
00234     htri_t      (*can_share)(const void *);     /* Is message allowed to be shared? */
00235     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 */
00236     void        *(*copy_file)(H5F_t *, void *, H5F_t *, hbool_t *, H5O_copy_t *, void *, hid_t); /*copy native value to file */
00237     herr_t      (*post_copy_file)(const H5O_loc_t *, const void *, H5O_loc_t *, void *, hid_t, H5O_copy_t *); /*"post copy" action when copying native value to file */
00238     herr_t      (*get_crt_index)(const void *, H5O_msg_crt_idx_t *);    /* Get message's creation index */
00239     herr_t      (*set_crt_index)(void *, H5O_msg_crt_idx_t);    /* Set message's creation index */
00240     herr_t      (*debug)(H5F_t*, hid_t, const void*, FILE*, int, int);
00241 };
00242 
00243 struct H5O_mesg_t {
00244     const H5O_msg_class_t       *type;  /*type of message                    */
00245     hbool_t             dirty;          /*raw out of date wrt native         */
00246     uint8_t             flags;          /*message flags                      */
00247     H5O_msg_crt_idx_t   crt_idx;        /*message creation index             */
00248     unsigned            chunkno;        /*chunk number for this mesg         */
00249     void                *native;        /*native format message              */
00250     uint8_t             *raw;           /*ptr to raw data                    */
00251     size_t              raw_size;       /*size with alignment                */
00252 };
00253 
00254 typedef struct H5O_chunk_t {
00255     hbool_t     dirty;                  /*dirty flag                         */
00256     haddr_t     addr;                   /*chunk file address                 */
00257     size_t      size;                   /*chunk size                         */
00258     size_t      gap;                    /*space at end of chunk too small for null message */
00259     uint8_t     *image;                 /*image of file                      */
00260 } H5O_chunk_t;
00261 
00262 struct H5O_t {
00263     H5AC_info_t cache_info; /* Information for H5AC cache functions, _must_ be */
00264                             /* first field in structure */
00265 
00266     /* File-specific information (not stored) */
00267     size_t      sizeof_size;            /* Size of file sizes                */
00268     size_t      sizeof_addr;            /* Size of file addresses            */
00269 #ifdef H5O_ENABLE_BAD_MESG_COUNT
00270     hbool_t     store_bad_mesg_count;   /* Flag to indicate that a bad message count should be stored */
00271                                         /* (This is to simulate a bug in earlier
00272                                          *      versions of the library)
00273                                          */
00274 #endif /* H5O_ENABLE_BAD_MESG_COUNT */
00275 #ifndef NDEBUG
00276     size_t      ndecode_dirtied;        /* Number of messages dirtied by decoding */
00277 #endif /* NDEBUG */
00278 
00279     /* Object information (stored) */
00280     hbool_t     has_refcount_msg;       /* Whether the object has a ref. count message */
00281     unsigned    nlink;                  /*link count                         */
00282     uint8_t     version;                /*version number                     */
00283     uint8_t     flags;                  /*flags                              */
00284 
00285     /* Time information (stored, for versions > 1 & H5O_HDR_STORE_TIMES flag set) */
00286     time_t      atime;                  /*access time                        */
00287     time_t      mtime;                  /*modification time                  */
00288     time_t      ctime;                  /*change time                        */
00289     time_t      btime;                  /*birth time                         */
00290 
00291     /* Attribute information (stored, for versions > 1) */
00292     unsigned    max_compact;            /* Maximum # of compact attributes   */
00293     unsigned    min_dense;              /* Minimum # of "dense" attributes   */
00294 
00295     /* Message management (stored, encoded in chunks) */
00296     size_t      nmesgs;                 /*number of messages                 */
00297     size_t      alloc_nmesgs;           /*number of message slots            */
00298     H5O_mesg_t  *mesg;                  /*array of messages                  */
00299     size_t      link_msgs_seen;         /* # of link messages seen when loading header */
00300     size_t      attr_msgs_seen;         /* # of attribute messages seen when loading header */
00301 
00302     /* Chunk management (not stored) */
00303     size_t      nchunks;                /*number of chunks                   */
00304     size_t      alloc_nchunks;          /*chunks allocated                   */
00305     H5O_chunk_t *chunk;                 /*array of chunks                    */
00306 };
00307 
00308 /* Callback information for copying dataset */
00309 typedef struct H5D_copy_file_ud_t {
00310     struct H5S_extent_t *src_space_extent;     /* Copy of dataspace extent for dataset */
00311     H5T_t *src_dtype;                   /* Copy of datatype for dataset */
00312     H5O_pline_t *src_pline;             /* Copy of filter pipeline for dataet */
00313 } H5D_copy_file_ud_t;
00314 
00315 /* Class for types of objects in file */
00316 typedef struct H5O_obj_class_t {
00317     H5O_type_t  type;                           /*object type on disk        */
00318     const char  *name;                          /*for debugging              */
00319     void       *(*get_copy_file_udata)(void);   /*retrieve user data for 'copy file' operation */
00320     void        (*free_copy_file_udata)(void *); /*free user data for 'copy file' operation */
00321     htri_t      (*isa)(H5O_t *);                /*if a header matches an object class */
00322     hid_t       (*open)(const H5G_loc_t *, hid_t, hid_t, hbool_t );     /*open an object of this class */
00323     void        *(*create)(H5F_t *, void *, H5G_loc_t *, hid_t );       /*create an object of this class */
00324     H5O_loc_t   *(*get_oloc)(hid_t );           /*get the object header location for an object */
00325 } H5O_obj_class_t;
00326 
00327 /* Node in skip list to map addresses from one file to another during object header copy */
00328 typedef struct H5O_addr_map_t {
00329     haddr_t     src_addr;               /* Address of object in source file */
00330     haddr_t     dst_addr;               /* Address of object in destination file */
00331     hbool_t     is_locked;              /* Indicate that the destination object is locked currently */
00332     hsize_t     inc_ref_count;          /* Number of deferred increments to reference count */
00333 } H5O_addr_map_t;
00334 
00335 
00336 /* H5O inherits cache-like properties from H5AC */
00337 H5_DLLVAR const H5AC_class_t H5AC_OHDR[1];
00338 
00339 /* Header message ID to class mapping */
00340 H5_DLLVAR const H5O_msg_class_t *const H5O_msg_class_g[H5O_MSG_TYPES];
00341 
00342 /* Header object ID to class mapping */
00343 H5_DLLVAR const H5O_obj_class_t *const H5O_obj_class_g[3];
00344 
00345 /* Declare external the free list for H5O_t's */
00346 H5FL_EXTERN(H5O_t);
00347 
00348 /* Declare external the free list for H5O_mesg_t sequences */
00349 H5FL_SEQ_EXTERN(H5O_mesg_t);
00350 
00351 /* Declare external the free list for H5O_chunk_t sequences */
00352 H5FL_SEQ_EXTERN(H5O_chunk_t);
00353 
00354 /* Declare external the free list for chunk_image blocks */
00355 H5FL_BLK_EXTERN(chunk_image);
00356 
00357 /*
00358  * Object header messages
00359  */
00360 
00361 /* Null Message. (0x0000) */
00362 H5_DLLVAR const H5O_msg_class_t H5O_MSG_NULL[1];
00363 
00364 /* Simple Dataspace Message. (0x0001) */
00365 H5_DLLVAR const H5O_msg_class_t H5O_MSG_SDSPACE[1];
00366 
00367 /* Link Information Message. (0x0002) */
00368 H5_DLLVAR const H5O_msg_class_t H5O_MSG_LINFO[1];
00369 
00370 /* Datatype Message. (0x0003) */
00371 H5_DLLVAR const H5O_msg_class_t H5O_MSG_DTYPE[1];
00372 
00373 /* Old Fill Value Message. (0x0004) */
00374 H5_DLLVAR const H5O_msg_class_t H5O_MSG_FILL[1];
00375 
00376 /* New Fill Value Message. (0x0005) */
00377 /*
00378  * The new fill value message is fill value plus
00379  * space allocation time and fill value writing time and whether fill
00380  * value is defined.
00381  */
00382 H5_DLLVAR const H5O_msg_class_t H5O_MSG_FILL_NEW[1];
00383 
00384 /* Link Message. (0x0006) */
00385 H5_DLLVAR const H5O_msg_class_t H5O_MSG_LINK[1];
00386 
00387 /* External File List Message. (0x0007) */
00388 H5_DLLVAR const H5O_msg_class_t H5O_MSG_EFL[1];
00389 
00390 /* Data Layout Message. (0x0008) */
00391 H5_DLLVAR const H5O_msg_class_t H5O_MSG_LAYOUT[1];
00392 
00393 #ifdef H5O_ENABLE_BOGUS
00394 /* "Bogus" Message. (0x0009) */
00395 /*
00396  * Used for debugging - should never be found in valid HDF5 file.
00397  */
00398 H5_DLLVAR const H5O_msg_class_t H5O_MSG_BOGUS[1];
00399 #endif /* H5O_ENABLE_BOGUS */
00400 
00401 /* Group Information Message. (0x000a) */
00402 H5_DLLVAR const H5O_msg_class_t H5O_MSG_GINFO[1];
00403 
00404 /* Filter pipeline message. (0x000b) */
00405 H5_DLLVAR const H5O_msg_class_t H5O_MSG_PLINE[1];
00406 
00407 /* Attribute Message. (0x000c) */
00408 H5_DLLVAR const H5O_msg_class_t H5O_MSG_ATTR[1];
00409 
00410 /* Object name message. (0x000d) */
00411 H5_DLLVAR const H5O_msg_class_t H5O_MSG_NAME[1];
00412 
00413 /* Modification Time Message. (0x000e) */
00414 /*
00415  * The message is just a `time_t'.
00416  * (See also the "new" modification time message)
00417  */
00418 H5_DLLVAR const H5O_msg_class_t H5O_MSG_MTIME[1];
00419 
00420 /* Shared Message information message (0x000f)
00421  * A message for the superblock extension, holding information about
00422  * the file-wide shared message "SOHM" table
00423  */
00424 H5_DLLVAR const H5O_msg_class_t H5O_MSG_SHMESG[1];
00425 
00426 /* Object Header Continuation Message. (0x0010) */
00427 H5_DLLVAR const H5O_msg_class_t H5O_MSG_CONT[1];
00428 
00429 /* Symbol Table Message. (0x0011) */
00430 H5_DLLVAR const H5O_msg_class_t H5O_MSG_STAB[1];
00431 
00432 /* New Modification Time Message. (0x0012) */
00433 /*
00434  * The message is just a `time_t'.
00435  */
00436 H5_DLLVAR const H5O_msg_class_t H5O_MSG_MTIME_NEW[1];
00437 
00438 /* v1 B-tree 'K' value message (0x0013)
00439  * A message for the superblock extension, holding information about
00440  * the file-wide v1 B-tree 'K' values.
00441  */
00442 H5_DLLVAR const H5O_msg_class_t H5O_MSG_BTREEK[1];
00443 
00444 /* Driver info message (0x0014)
00445  * A message for the superblock extension, holding information about
00446  * the file driver settings
00447  */
00448 H5_DLLVAR const H5O_msg_class_t H5O_MSG_DRVINFO[1];
00449 
00450 /* Attribute Information Message. (0x0015) */
00451 H5_DLLVAR const H5O_msg_class_t H5O_MSG_AINFO[1];
00452 
00453 /* Reference Count Message. (0x0016) */
00454 H5_DLLVAR const H5O_msg_class_t H5O_MSG_REFCOUNT[1];
00455 
00456 /* Placeholder for unknown message. (0x0017) */
00457 H5_DLLVAR const H5O_msg_class_t H5O_MSG_UNKNOWN[1];
00458 
00459 
00460 /*
00461  * Object header "object" types
00462  */
00463 
00464 /* Group Object. (H5O_TYPE_GROUP - 0) */
00465 H5_DLLVAR const H5O_obj_class_t H5O_OBJ_GROUP[1];
00466 
00467 /* Dataset Object. (H5O_TYPE_DATASET - 1) */
00468 H5_DLLVAR const H5O_obj_class_t H5O_OBJ_DATASET[1];
00469 
00470 /* Datatype Object. (H5O_TYPE_NAMED_DATATYPE - 2) */
00471 H5_DLLVAR const H5O_obj_class_t H5O_OBJ_DATATYPE[1];
00472 
00473 
00474 /* Package-local function prototypes */
00475 H5_DLL herr_t H5O_msg_flush(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg);
00476 H5_DLL herr_t H5O_flush_msgs(H5F_t *f, H5O_t *oh);
00477 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);
00478 H5_DLL herr_t H5O_delete_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_mesg_t *mesg);
00479 H5_DLL const H5O_obj_class_t *H5O_obj_class_real(H5O_t *oh);
00480 
00481 /* Object header message routines */
00482 H5_DLL unsigned H5O_msg_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
00483     const H5O_msg_class_t *type, unsigned *mesg_flags, void *mesg);
00484 H5_DLL herr_t H5O_msg_append_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
00485     const H5O_msg_class_t *type, unsigned mesg_flags, unsigned update_flags,
00486     void *mesg);
00487 H5_DLL herr_t H5O_msg_write_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
00488     const H5O_msg_class_t *type, unsigned mesg_flags, unsigned update_flags,
00489     void *mesg);
00490 H5_DLL void *H5O_msg_free_real(const H5O_msg_class_t *type, void *mesg);
00491 H5_DLL herr_t H5O_msg_free_mesg(H5O_mesg_t *mesg);
00492 H5_DLL unsigned H5O_msg_count_real(const H5O_t *oh, const H5O_msg_class_t *type);
00493 H5_DLL herr_t H5O_msg_remove_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type,
00494     int sequence, H5O_operator_t op, void *op_data, hbool_t adj_link, hid_t dxpl_id);
00495 H5_DLL void *H5O_msg_copy_file(const H5O_msg_class_t *type, H5F_t *file_src,
00496     void *mesg_src, H5F_t *file_dst, hbool_t *recompute_size,
00497     H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id);
00498 H5_DLL herr_t H5O_msg_iterate_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type,
00499     const H5O_mesg_operator_t *op, void *op_data, hid_t dxpl_id);
00500 
00501 /* Collect storage info for btree and heap */
00502 H5_DLL herr_t H5O_group_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
00503     H5_ih_info_t *bh_info);
00504 H5_DLL herr_t H5O_dset_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
00505     H5_ih_info_t *bh_info);
00506 H5_DLL herr_t H5O_attr_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
00507     H5_ih_info_t *bh_info);
00508 
00509 /* Object header allocation routines */
00510 H5_DLL herr_t H5O_alloc_msgs(H5O_t *oh, size_t min_alloc);
00511 H5_DLL unsigned H5O_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
00512     const H5O_msg_class_t *type, const void *mesg);
00513 H5_DLL herr_t H5O_condense_header(H5F_t *f, H5O_t *oh, hid_t dxpl_id);
00514 H5_DLL herr_t H5O_release_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
00515     H5O_mesg_t *mesg, hbool_t adj_link);
00516 
00517 /* Shared object operators */
00518 H5_DLL void * H5O_shared_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
00519     unsigned *ioflags, const uint8_t *buf, const H5O_msg_class_t *type);
00520 H5_DLL herr_t H5O_shared_encode(const H5F_t *f, uint8_t *buf/*out*/, const H5O_shared_t *sh_mesg);
00521 H5_DLL size_t H5O_shared_size(const H5F_t *f, const H5O_shared_t *sh_mesg);
00522 H5_DLL herr_t H5O_shared_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
00523     const H5O_msg_class_t *mesg_type, H5O_shared_t *sh_mesg);
00524 H5_DLL herr_t H5O_shared_link(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
00525     const H5O_msg_class_t *mesg_type, H5O_shared_t *sh_mesg);
00526 H5_DLL herr_t H5O_shared_copy_file(H5F_t *file_src, H5F_t *file_dst,
00527     const H5O_msg_class_t *mesg_type, const void *_native_src, void *_native_dst,
00528     hbool_t *recompute_size, H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id);
00529 H5_DLL herr_t H5O_shared_post_copy_file (H5F_t *f, hid_t dxpl_id, H5O_t *oh, void *mesg);
00530 H5_DLL herr_t H5O_shared_debug(const H5O_shared_t *mesg, FILE *stream,
00531     int indent, int fwidth);
00532 
00533 /* Attribute message operators */
00534 H5_DLL herr_t H5O_attr_reset(void *_mesg);
00535 H5_DLL herr_t H5O_attr_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg);
00536 H5_DLL herr_t H5O_attr_link(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg);
00537 H5_DLL herr_t H5O_attr_count_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
00538     hsize_t *nattrs);
00539 
00540 
00541 /* These functions operate on object locations */
00542 H5_DLL H5O_loc_t *H5O_get_loc(hid_t id);
00543 
00544 /* Useful metadata cache callbacks */
00545 H5_DLL herr_t H5O_dest(H5F_t *f, H5O_t *oh);
00546 
00547 /* Testing functions */
00548 #ifdef H5O_TESTING
00549 H5_DLL htri_t H5O_is_attr_empty_test(hid_t oid);
00550 H5_DLL htri_t H5O_is_attr_dense_test(hid_t oid);
00551 H5_DLL herr_t H5O_num_attrs_test(hid_t oid, hsize_t *nattrs);
00552 H5_DLL herr_t H5O_attr_dense_info_test(hid_t oid, hsize_t *name_count, hsize_t *corder_count);
00553 H5_DLL herr_t H5O_check_msg_marked_test(hid_t oid, hbool_t flag_val);
00554 #endif /* H5O_TESTING */
00555 
00556 /* Object header debugging routines */
00557 #ifdef H5O_DEBUG
00558 H5_DLL herr_t H5O_assert(const H5O_t *oh);
00559 #endif /* H5O_DEBUG */
00560 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);
00561 
00562 #endif /* _H5Opkg_H */
00563