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