H5Gpkg.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  * Programmer: Robb Matzke <matzke@llnl.gov>
00018  *             Thursday, September 18, 1997
00019  *
00020  * Purpose:     This file contains declarations which are visible
00021  *              only within the H5G package. Source files outside the
00022  *              H5G package should include H5Gprivate.h instead.
00023  */
00024 #ifndef H5G_PACKAGE
00025 #error "Do not include this file outside the H5G package!"
00026 #endif
00027 
00028 #ifndef _H5Gpkg_H
00029 #define _H5Gpkg_H
00030 
00031 /* Get package's private header */
00032 #include "H5Gprivate.h"
00033 
00034 /* Other private headers needed by this file */
00035 #include "H5ACprivate.h"        /* Metadata cache                       */
00036 #include "H5B2private.h"        /* v2 B-trees                           */
00037 #include "H5HFprivate.h"        /* Fractal heaps                        */
00038 #include "H5HLprivate.h"        /* Local Heaps                          */
00039 #include "H5Oprivate.h"         /* Object headers                       */
00040 #include "H5SLprivate.h"        /* Skip lists                           */
00041 
00042 /**************************/
00043 /* Package Private Macros */
00044 /**************************/
00045 
00046 /* Standard length of fractal heap ID for link */
00047 #define H5G_DENSE_FHEAP_ID_LEN  7
00048 
00049 /*
00050  * During name lookups (see H5G_traverse()) we sometimes want information about
00051  * a symbolic link or a mount point.  The normal operation is to follow the
00052  * symbolic link or mount point and return information about its target.
00053  */
00054 #define H5G_TARGET_NORMAL       0x0000
00055 #define H5G_TARGET_SLINK        0x0001
00056 #define H5G_TARGET_MOUNT        0x0002
00057 #define H5G_TARGET_UDLINK       0x0004
00058 #define H5G_CRT_INTMD_GROUP     0x0008
00059 
00060 /****************************/
00061 /* Package Private Typedefs */
00062 /****************************/
00063 
00064 /*
00065  * Various types of object header information can be cached in a symbol
00066  * table entry (it's normal home is the object header to which the entry
00067  * points).  This datatype determines what (if anything) is cached in the
00068  * symbol table entry.
00069  */
00070 typedef enum H5G_cache_type_t {
00071     H5G_CACHED_ERROR    = -1,   /*force enum to be signed                    */
00072     H5G_NOTHING_CACHED  = 0,    /*nothing is cached, must be 0               */
00073     H5G_CACHED_STAB     = 1,    /*symbol table, `stab'                       */
00074     H5G_CACHED_SLINK    = 2,    /*symbolic link                              */
00075 
00076     H5G_NCACHED                 /*THIS MUST BE LAST                          */
00077 } H5G_cache_type_t;
00078 
00079 /*
00080  * A symbol table entry caches these parameters from object header
00081  * messages...  The values are entered into the symbol table when an object
00082  * header is created (by hand) and are extracted from the symbol table with a
00083  * callback function registered in H5O_init_interface().  Be sure to update
00084  * H5G_ent_decode(), H5G_ent_encode(), and H5G_ent_debug() as well.
00085  */
00086 typedef union H5G_cache_t {
00087     struct {
00088         haddr_t btree_addr;             /*file address of symbol table B-tree*/
00089         haddr_t heap_addr;              /*file address of stab name heap     */
00090     } stab;
00091 
00092     struct {
00093         size_t  lval_offset;            /*link value offset                  */
00094     } slink;
00095 } H5G_cache_t;
00096 
00097 /*
00098  * A symbol table entry.  The two important fields are `name_off' and
00099  * `header'.  The remaining fields are used for caching information that
00100  * also appears in the object header to which this symbol table entry
00101  * points.
00102  */
00103 struct H5G_entry_t {
00104     hbool_t     dirty;                  /*entry out-of-date?                 */
00105     H5G_cache_type_t type;              /*type of information cached         */
00106     H5G_cache_t cache;                  /*cached data from object header     */
00107     size_t      name_off;               /*offset of name within name heap    */
00108     haddr_t     header;                 /*file address of object header      */
00109     H5F_t       *file;                  /*file to which this obj hdr belongs */
00110 };
00111 
00112 /*
00113  * A symbol table node is a collection of symbol table entries.  It can
00114  * be thought of as the lowest level of the B-link tree that points to
00115  * a collection of symbol table entries that belong to a specific symbol
00116  * table or group.
00117  */
00118 typedef struct H5G_node_t {
00119     H5AC_info_t cache_info; /* Information for H5AC cache functions, _must_ be */
00120                             /* first field in structure */
00121     unsigned nsyms;                     /*number of symbols                  */
00122     H5G_entry_t *entry;                 /*array of symbol table entries      */
00123 } H5G_node_t;
00124 
00125 /*
00126  * Shared information for all open group objects
00127  */
00128 struct H5G_shared_t {
00129     int fo_count;                   /* open file object count */
00130     hbool_t mounted;                /* Group is mount point */
00131 };
00132 
00133 /*
00134  * A group handle passed around through layers of the library within and
00135  * above the H5G layer.
00136  */
00137 struct H5G_t {
00138     H5G_shared_t *shared;               /* Shared file object data */
00139     H5O_loc_t oloc;                     /* Object location for group */
00140     H5G_name_t path;                    /* Group hierarchy path   */
00141 };
00142 
00143 /* Link iteration operator for internal library callbacks */
00144 typedef herr_t (*H5G_lib_iterate_t)(const H5O_link_t *lnk, void *op_data);
00145 
00146 /* Describe kind of callback to make for each link */
00147 typedef struct {
00148     enum {
00149 #ifndef H5_NO_DEPRECATED_SYMBOLS
00150         H5G_LINK_OP_OLD,                /* "Old" application callback */
00151 #endif /* H5_NO_DEPRECATED_SYMBOLS */
00152         H5G_LINK_OP_NEW                 /* "New" application callback */
00153     } op_type;
00154     union {
00155 #ifndef H5_NO_DEPRECATED_SYMBOLS
00156         H5G_iterate_t op_old;           /* "Old" application callback for each link */
00157 #endif /* H5_NO_DEPRECATED_SYMBOLS */
00158         H5L_iterate_t op_new;           /* "New" application callback for each link */
00159     } op_func;
00160 } H5G_link_iterate_t;
00161 
00162 /* Data structure to hold table of links for a group */
00163 typedef struct {
00164     size_t      nlinks;         /* # of links in table */
00165     H5O_link_t *lnks;           /* Pointer to array of links */
00166 } H5G_link_table_t;
00167 
00168 /*
00169  * Common data exchange structure for symbol table nodes.  This structure is
00170  * passed through the B-link tree layer to the methods for the objects
00171  * to which the B-link tree points.
00172  *
00173  * It's also used for B-tree iterators which require no additional info.
00174  *
00175  */
00176 typedef struct H5G_bt_common_t {
00177     /* downward */
00178     const char  *name;                  /*points to temporary memory         */
00179     H5HL_t *heap;                       /*symbol table heap                  */
00180 } H5G_bt_common_t;
00181 
00182 /*
00183  * Data exchange structure for symbol table nodes.  This structure is
00184  * passed through the B-link tree layer to the insert method for entries.
00185  */
00186 typedef struct H5G_bt_ins_t {
00187     /* downward */
00188     H5G_bt_common_t common;          /* Common info for B-tree user data (must be first) */
00189     const H5O_link_t *lnk;              /* Link to insert into table         */
00190 } H5G_bt_ins_t;
00191 
00192 /*
00193  * Data exchange structure for symbol table nodes.  This structure is
00194  * passed through the B-link tree layer to the remove method for entries.
00195  */
00196 typedef struct H5G_bt_rm_t {
00197     /* downward */
00198     H5G_bt_common_t common;          /* Common info for B-tree user data (must be first) */
00199     H5RS_str_t *grp_full_path_r;        /* Full path of group where link is removed */
00200 } H5G_bt_rm_t;
00201 
00202 /* Typedef for B-tree 'find' operation */
00203 typedef herr_t (*H5G_bt_find_op_t)(const H5G_entry_t *ent/*in*/, void *operator_data/*in,out*/);
00204 
00205 /*
00206  * Data exchange structure for symbol table nodes.  This structure is
00207  * passed through the B-link tree layer to the 'find' method for entries.
00208  */
00209 typedef struct H5G_bt_lkp_t {
00210     /* downward */
00211     H5G_bt_common_t common;          /* Common info for B-tree user data (must be first) */
00212     H5G_bt_find_op_t op;                /* Operator to call when correct entry is found */
00213     void *op_data;                      /* Data to pass to operator */
00214 
00215     /* upward */
00216 } H5G_bt_lkp_t;
00217 
00218 /*
00219  * Data exchange structure to pass through the B-tree layer for the
00220  * H5B_iterate function.
00221  */
00222 typedef struct H5G_bt_it_it_t {
00223     /* downward */
00224     H5HL_t      *heap;          /*symbol table heap                          */
00225     hsize_t     skip;           /*initial entries to skip                    */
00226     H5G_lib_iterate_t op;       /*iteration operator                         */
00227     void        *op_data;       /*user-defined operator data                 */
00228 
00229     /* upward */
00230     hsize_t     *final_ent;     /*final entry looked at                      */
00231 } H5G_bt_it_it_t;
00232 
00233 /* Data passed through B-tree iteration for copying copy symbol table content */
00234 typedef struct H5G_bt_it_cpy_t {
00235     const H5O_loc_t *src_oloc;  /* Source object location */
00236     haddr_t     src_heap_addr;  /* Heap address of the source symbol table  */
00237     H5F_t       *dst_file;      /* File of destination group */
00238     H5O_stab_t  *dst_stab;      /* Symbol table message for destination group */
00239     H5O_copy_t  *cpy_info;      /* Information for copy operation */
00240 } H5G_bt_it_cpy_t;
00241 
00242 /* Common information for "by index" lookups in symbol tables */
00243 typedef struct H5G_bt_it_idx_common_t {
00244     /* downward */
00245     H5F_t       *f;             /* Pointer to file that symbol table is in */
00246     hsize_t     idx;            /* Index of group member to be queried */
00247     hsize_t     num_objs;       /* The number of objects having been traversed */
00248     H5G_bt_find_op_t op;        /* Operator to call when correct entry is found */
00249 } H5G_bt_it_idx_common_t;
00250 
00251 /* Data passed through B-tree iteration for building a table of the links */
00252 typedef struct H5G_bt_it_bt_t {
00253     /* downward */
00254     size_t alloc_nlinks;        /* Number of links allocated in table */
00255     H5HL_t      *heap;          /*symbol table heap                          */
00256 
00257     /* upward */
00258     H5G_link_table_t *ltable;   /* Link table to add information to */
00259 } H5G_bt_it_bt_t;
00260 
00261 /* Typedefs for "new format" groups */
00262 /* (fractal heap & v2 B-tree info) */
00263 
00264 /* Typedef for native 'name' field index records in the v2 B-tree */
00265 /* (Keep 'id' field first so generic record handling in callbacks works) */
00266 typedef struct H5G_dense_bt2_name_rec_t {
00267     uint8_t id[H5G_DENSE_FHEAP_ID_LEN]; /* Heap ID for link */
00268     uint32_t hash;                      /* Hash of 'name' field value */
00269 } H5G_dense_bt2_name_rec_t;
00270 
00271 /* Typedef for native 'creation order' field index records in the v2 B-tree */
00272 /* (Keep 'id' field first so generic record handling in callbacks works) */
00273 typedef struct H5G_dense_bt2_corder_rec_t {
00274     uint8_t id[H5G_DENSE_FHEAP_ID_LEN]; /* Heap ID for link */
00275     int64_t corder;                     /* 'creation order' field value */
00276 } H5G_dense_bt2_corder_rec_t;
00277 
00278 /*
00279  * Common data exchange structure for dense link storage.  This structure is
00280  * passed through the v2 B-tree layer to the methods for the objects
00281  * to which the v2 B-tree points.
00282  */
00283 typedef struct H5G_bt2_ud_common_t {
00284     /* downward */
00285     H5F_t       *f;                     /* Pointer to file that fractal heap is in */
00286     hid_t       dxpl_id;                /* DXPL for operation                */
00287     H5HF_t      *fheap;                 /* Fractal heap handle               */
00288     const char  *name;                  /* Name of link to compare           */
00289     uint32_t    name_hash;              /* Hash of name of link to compare   */
00290     int64_t     corder;                 /* Creation order value of link to compare   */
00291     H5B2_found_t found_op;              /* Callback when correct link is found */
00292     void        *found_op_data;         /* Callback data when correct link is found */
00293 } H5G_bt2_ud_common_t;
00294 
00295 /*
00296  * Data exchange structure for dense link storage.  This structure is
00297  * passed through the v2 B-tree layer when inserting links.
00298  */
00299 typedef struct H5G_bt2_ud_ins_t {
00300     /* downward */
00301     H5G_bt2_ud_common_t common;         /* Common info for B-tree user data (must be first) */
00302     uint8_t id[H5G_DENSE_FHEAP_ID_LEN]; /* Heap ID of link to insert         */
00303 } H5G_bt2_ud_ins_t;
00304 
00305 /* Typedef for path traversal operations */
00306 /* grp_loc is the location of the group in which the targeted object is located.
00307  * name is the last component of the object's name
00308  * lnk is the link between the group and the object
00309  * obj_loc is the target of the traversal (or NULL if the object doesn't exist)
00310  * operator_data is whatever udata was supplied when H5G_traverse was called
00311  * own_loc should be set to H5G_OWN_OBJ_LOC if this callback takes ownership of obj_loc,
00312  * H5G_OWN_GRP_LOC if it takes ownership of grp_loc, and H5G_OWN_NONE if obj_loc and
00313  * grp_loc need to be deleted.
00314  */
00315 typedef herr_t (*H5G_traverse_t)(H5G_loc_t *grp_loc/*in*/, const char *name,
00316     const H5O_link_t *lnk/*in*/, H5G_loc_t *obj_loc/*out*/, void *operator_data/*in,out*/,
00317     H5G_own_loc_t *own_loc/*out*/);
00318 
00319 /* Typedef for group creation operation */
00320 typedef struct {
00321     hid_t gcpl_id;              /* Group creation property list */
00322 } H5G_obj_create_t;
00323 
00324 
00325 /*****************************/
00326 /* Package Private Variables */
00327 /*****************************/
00328 
00329 /*
00330  * This is the class identifier to give to the B-tree functions.
00331  */
00332 H5_DLLVAR H5B_class_t H5B_SNODE[1];
00333 
00334 /* The cache subclass */
00335 H5_DLLVAR const H5AC_class_t H5AC_SNODE[1];
00336 
00337 /* The v2 B-tree class for indexing 'name' field on links */
00338 H5_DLLVAR const H5B2_class_t H5G_BT2_NAME[1];
00339 
00340 /* The v2 B-tree class for indexing 'creation order' field on links */
00341 H5_DLLVAR const H5B2_class_t H5G_BT2_CORDER[1];
00342 
00343 /* Free list for managing H5G_t structs */
00344 H5FL_EXTERN(H5G_t);
00345 
00346 /* Free list for managing H5G_shared_t structs */
00347 H5FL_EXTERN(H5G_shared_t);
00348 
00349 /******************************/
00350 /* Package Private Prototypes */
00351 /******************************/
00352 
00353 /*
00354  * General group routines
00355  */
00356 H5_DLL H5G_t *H5G_create(H5F_t *file, hid_t gcpl_id, hid_t dxpl_id);
00357 H5_DLL H5G_t *H5G_create_named(const H5G_loc_t *loc, const char *name,
00358     hid_t lcpl_id, hid_t gcpl_id, hid_t gapl_id, hid_t dxpl_id);
00359 H5_DLL H5G_t *H5G_open_name(const H5G_loc_t *loc, const char *name,
00360     hid_t gapl_id, hid_t dxpl_id);
00361 H5_DLL herr_t H5G_iterate(hid_t loc_id, const char *group_name,
00362     H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk,
00363     const H5G_link_iterate_t *lnk_op, void *op_data, hid_t lapl_id, hid_t dxpl_id);
00364 
00365 /*
00366  * Group hierarchy traversal routines
00367  */
00368 H5_DLL herr_t H5G_traverse_term_interface(void);
00369 H5_DLL herr_t H5G_traverse_special(const H5G_loc_t *grp_loc,
00370     const H5O_link_t *lnk, unsigned target, size_t *nlinks, hbool_t last_comp,
00371     H5G_loc_t *obj_loc, hid_t lapl_id, hid_t dxpl_id);
00372 H5_DLL herr_t H5G_traverse(const H5G_loc_t *loc, const char *name,
00373     unsigned target, H5G_traverse_t op, void *op_data, hid_t lapl_id,
00374     hid_t dxpl_id);
00375 
00376 /*
00377  * Utility functions
00378  */
00379 H5_DLL herr_t H5G_init(void);
00380 H5_DLL char *H5G_normalize(const char *name);
00381 H5_DLL const char *H5G_component(const char *name, size_t *size_p);
00382 
00383 /*
00384  * Functions that understand symbol tables but not names.  The
00385  * functions that understand names are exported to the rest of
00386  * the library and appear in H5Gprivate.h.
00387  */
00388 H5_DLL herr_t H5G_stab_create(H5O_loc_t *grp_oloc, hid_t dxpl_id,
00389     const H5O_ginfo_t *ginfo, H5O_stab_t *stab);
00390 H5_DLL herr_t H5G_stab_create_components(H5F_t *f, H5O_stab_t *stab, size_t size_hint, hid_t dxpl_id);
00391 H5_DLL herr_t H5G_stab_insert(const H5O_loc_t *grp_oloc, const char *name,
00392     H5O_link_t *obj_lnk, hid_t dxpl_id);
00393 H5_DLL herr_t H5G_stab_insert_real(H5F_t *f, H5O_stab_t *stab, const char *name,
00394     H5O_link_t *obj_lnk, hid_t dxpl_id);
00395 H5_DLL herr_t H5G_stab_delete(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab);
00396 H5_DLL herr_t H5G_stab_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, H5_iter_order_t order,
00397     hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, void *op_data);
00398 H5_DLL herr_t H5G_stab_count(struct H5O_loc_t *oloc, hsize_t *num_objs, hid_t dxpl_id);
00399 H5_DLL herr_t H5G_stab_bh_size(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab,
00400     H5_ih_info_t *bh_info);
00401 H5_DLL ssize_t H5G_stab_get_name_by_idx(H5O_loc_t *oloc, H5_iter_order_t order,
00402     hsize_t n, char* name, size_t size, hid_t dxpl_id);
00403 H5_DLL herr_t H5G_stab_remove(H5O_loc_t *oloc, hid_t dxpl_id,
00404     H5RS_str_t *grp_full_path_r, const char *name);
00405 H5_DLL herr_t H5G_stab_remove_by_idx(H5O_loc_t *oloc, hid_t dxpl_id,
00406     H5RS_str_t *grp_full_path_r, H5_iter_order_t order, hsize_t n);
00407 H5_DLL herr_t H5G_stab_lookup(H5O_loc_t *grp_oloc, const char *name,
00408     H5O_link_t *lnk, hid_t dxpl_id);
00409 H5_DLL herr_t H5G_stab_lookup_by_idx(H5O_loc_t *grp_oloc, H5_iter_order_t order,
00410     hsize_t n, H5O_link_t *lnk, hid_t dxpl_id);
00411 #ifndef H5_STRICT_FORMAT_CHECKS
00412 H5_DLL herr_t H5G_stab_valid(H5O_loc_t *grp_oloc, hid_t dxpl_id,
00413     H5O_stab_t *alt_stab);
00414 #endif /* H5_STRICT_FORMAT_CHECKS */
00415 #ifndef H5_NO_DEPRECATED_SYMBOLS
00416 H5_DLL H5G_obj_t H5G_stab_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx,
00417     hid_t dxpl_id);
00418 #endif /* H5_NO_DEPRECATED_SYMBOLS */
00419 
00420 
00421 /*
00422  * Functions that understand symbol table entries.
00423  */
00424 H5_DLL herr_t H5G_ent_copy(H5G_entry_t *dst, const H5G_entry_t *src,
00425             H5_copy_depth_t depth);
00426 H5_DLL herr_t H5G_ent_reset(H5G_entry_t *ent);
00427 H5_DLL herr_t H5G_ent_decode_vec(H5F_t *f, const uint8_t **pp,
00428                                   H5G_entry_t *ent, unsigned n);
00429 H5_DLL herr_t H5G_ent_encode_vec(H5F_t *f, uint8_t **pp,
00430                                   const H5G_entry_t *ent, unsigned n);
00431 H5_DLL herr_t H5G_ent_convert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap,
00432     const char *name, const H5O_link_t *lnk, H5G_entry_t *ent);
00433 H5_DLL herr_t H5G_ent_debug(H5F_t *f, const H5G_entry_t *ent,
00434     FILE * stream, int indent, int fwidth, H5HL_t *heap);
00435 
00436 /* Functions that understand symbol table nodes */
00437 H5_DLL herr_t H5G_node_init(H5F_t *f);
00438 H5_DLL size_t H5G_node_size_real(const H5F_t *f);
00439 H5_DLL int H5G_node_iterate(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr,
00440                      const void *_rt_key, void *_udata);
00441 H5_DLL int H5G_node_sumup(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr,
00442                      const void *_rt_key, void *_udata);
00443 H5_DLL int H5G_node_by_idx(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr,
00444                      const void *_rt_key, void *_udata);
00445 H5_DLL int H5G_node_copy(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr,
00446                      const void *_rt_key, void *_udata);
00447 H5_DLL int H5G_node_build_table(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr,
00448                      const void *_rt_key, void *_udata);
00449 H5_DLL herr_t H5G_node_iterate_size(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr,
00450                      const void *_rt_key, void *_udata);
00451 
00452 /* Functions that understand links in groups */
00453 H5_DLL int H5G_link_cmp_name_inc(const void *lnk1, const void *lnk2);
00454 H5_DLL int H5G_link_cmp_name_dec(const void *lnk1, const void *lnk2);
00455 H5_DLL int H5G_link_cmp_corder_inc(const void *lnk1, const void *lnk2);
00456 H5_DLL int H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2);
00457 H5_DLL herr_t H5G_ent_to_link(H5F_t *f, H5O_link_t *lnk, const H5HL_t *heap,
00458     const H5G_entry_t *ent, const char *name);
00459 H5_DLL herr_t H5G_ent_to_info(H5F_t *f, H5L_info_t *info, const H5HL_t *heap,
00460     const H5G_entry_t *ent);
00461 H5_DLL herr_t H5G_link_to_info(const H5O_link_t *lnk, H5L_info_t *linfo);
00462 H5_DLL herr_t H5G_link_to_loc(const H5G_loc_t *grp_loc, const H5O_link_t *lnk,
00463     H5G_loc_t *obj_loc);
00464 H5_DLL herr_t H5G_link_copy_file(H5F_t *dst_file, hid_t dxpl_id,
00465     const H5O_link_t *_src_lnk, const H5O_loc_t *src_oloc, H5O_link_t *dst_lnk,
00466     H5O_copy_t *cpy_info);
00467 H5_DLL herr_t H5G_link_sort_table(H5G_link_table_t *ltable, H5_index_t idx_type,
00468     H5_iter_order_t order);
00469 H5_DLL herr_t H5G_link_iterate_table(const H5G_link_table_t *ltable,
00470     hsize_t skip, hsize_t *last_lnk, const H5G_lib_iterate_t op, void *op_data);
00471 H5_DLL herr_t H5G_link_release_table(H5G_link_table_t *ltable);
00472 H5_DLL herr_t H5G_link_name_replace(H5F_t *file, hid_t dxpl_id,
00473     H5RS_str_t *grp_full_path_r, const H5O_link_t *lnk);
00474 
00475 /* Functions that understand "compact" link storage */
00476 H5_DLL herr_t H5G_compact_insert(const H5O_loc_t *grp_oloc, H5O_link_t *obj_lnk,
00477     hid_t dxpl_id);
00478 H5_DLL ssize_t H5G_compact_get_name_by_idx(H5O_loc_t *oloc, hid_t dxpl_id,
00479     const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order,
00480     hsize_t idx, char *name, size_t size);
00481 H5_DLL herr_t H5G_compact_remove(const H5O_loc_t *oloc, hid_t dxpl_id,
00482     H5RS_str_t *grp_full_path_r, const char *name);
00483 H5_DLL herr_t H5G_compact_remove_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id,
00484     const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_r, H5_index_t idx_type,
00485     H5_iter_order_t order, hsize_t n);
00486 H5_DLL herr_t H5G_compact_iterate(const H5O_loc_t *oloc, hid_t dxpl_id,
00487     const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order,
00488     hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, void *op_data);
00489 H5_DLL htri_t H5G_compact_lookup(H5O_loc_t *grp_oloc, const char *name,
00490     H5O_link_t *lnk, hid_t dxpl_id);
00491 H5_DLL herr_t H5G_compact_lookup_by_idx(H5O_loc_t *oloc, hid_t dxpl_id,
00492     const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order,
00493     hsize_t n, H5O_link_t *lnk);
00494 #ifndef H5_NO_DEPRECATED_SYMBOLS
00495 H5_DLL H5G_obj_t H5G_compact_get_type_by_idx(H5O_loc_t *oloc, hid_t dxpl_id,
00496     const H5O_linfo_t *linfo, hsize_t idx);
00497 #endif /* H5_NO_DEPRECATED_SYMBOLS */
00498 
00499 /* Functions that understand "dense" link storage */
00500 H5_DLL herr_t H5G_dense_build_table(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo,
00501     H5_index_t idx_type, H5_iter_order_t order, H5G_link_table_t *ltable);
00502 H5_DLL herr_t H5G_dense_create(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo);
00503 H5_DLL herr_t H5G_dense_insert(H5F_t *f, hid_t dxpl_id,
00504     const H5O_linfo_t *linfo, const H5O_link_t *lnk);
00505 H5_DLL htri_t H5G_dense_lookup(H5F_t *f, hid_t dxpl_id,
00506     const H5O_linfo_t *linfo, const char *name, H5O_link_t *lnk);
00507 H5_DLL herr_t H5G_dense_lookup_by_idx(H5F_t *f, hid_t dxpl_id,
00508     const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order,
00509     hsize_t n, H5O_link_t *lnk);
00510 H5_DLL herr_t H5G_dense_iterate(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo,
00511     H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk,
00512     H5G_lib_iterate_t op, void *op_data);
00513 H5_DLL ssize_t H5G_dense_get_name_by_idx(H5F_t  *f, hid_t dxpl_id,
00514     H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t n,
00515     char *name, size_t size);
00516 H5_DLL herr_t H5G_dense_remove(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo,
00517     H5RS_str_t *grp_full_path_r, const char *name);
00518 H5_DLL herr_t H5G_dense_remove_by_idx(H5F_t *f, hid_t dxpl_id,
00519     const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_r, H5_index_t idx_type,
00520     H5_iter_order_t order, hsize_t n);
00521 H5_DLL herr_t H5G_dense_delete(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo,
00522     hbool_t adj_link);
00523 #ifndef H5_NO_DEPRECATED_SYMBOLS
00524 H5_DLL H5G_obj_t H5G_dense_get_type_by_idx(H5F_t  *f, hid_t dxpl_id,
00525     H5O_linfo_t *linfo, hsize_t idx);
00526 #endif /* H5_NO_DEPRECATED_SYMBOLS */
00527 
00528 /* Functions that understand group objects */
00529 H5_DLL herr_t H5G_obj_create(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo,
00530     const H5O_linfo_t *linfo, hid_t gcpl_id, H5O_loc_t *oloc/*out*/);
00531 H5_DLL htri_t H5G_obj_get_linfo(const H5O_loc_t *grp_oloc, H5O_linfo_t *linfo,
00532     hid_t dxpl_id);
00533 H5_DLL herr_t H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name,
00534     H5O_link_t *obj_lnk, hbool_t adj_link, hid_t dxpl_id);
00535 H5_DLL herr_t H5G_obj_iterate(const H5O_loc_t *grp_oloc,
00536     H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk,
00537     H5G_lib_iterate_t op, void *op_data, hid_t dxpl_id);
00538 H5_DLL herr_t H5G_obj_info(H5O_loc_t *oloc, H5G_info_t *grp_info, hid_t dxpl_id);
00539 H5_DLL ssize_t H5G_obj_get_name_by_idx(H5O_loc_t *oloc, H5_index_t idx_type,
00540     H5_iter_order_t order, hsize_t n, char* name, size_t size, hid_t dxpl_id);
00541 H5_DLL herr_t H5G_obj_remove(H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r,
00542     const char *name, hid_t dxpl_id);
00543 H5_DLL herr_t H5G_obj_remove_by_idx(H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r,
00544     H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t dxpl_id);
00545 H5_DLL htri_t H5G_obj_lookup(H5O_loc_t *grp_oloc, const char *name,
00546     H5O_link_t *lnk, hid_t dxpl_id);
00547 H5_DLL herr_t H5G_obj_lookup_by_idx(H5O_loc_t *grp_oloc, H5_index_t idx_type,
00548     H5_iter_order_t order, hsize_t n, H5O_link_t *lnk, hid_t dxpl_id);
00549 
00550 /*
00551  * These functions operate on group hierarchy names.
00552  */
00553 H5_DLL herr_t H5G_name_init(H5G_name_t *name, const char *path);
00554 H5_DLL herr_t H5G_name_set(H5G_name_t *loc, H5G_name_t *obj, const char *name);
00555 H5_DLL H5RS_str_t *H5G_build_fullpath_refstr_str(H5RS_str_t *path_r, const char *name);
00556 
00557 /*
00558  * These functions operate on group "locations"
00559  */
00560 H5_DLL herr_t H5G_loc_root(H5F_t *f, H5G_loc_t *loc);
00561 H5_DLL herr_t H5G_loc_copy(H5G_loc_t *dst, const H5G_loc_t *src, H5_copy_depth_t depth);
00562 H5_DLL herr_t H5G_loc_insert(H5G_loc_t *grp_loc, const char *name,
00563     H5G_loc_t *obj_loc, hid_t dxpl_id);
00564 
00565 /* Testing functions */
00566 #ifdef H5G_TESTING
00567 H5_DLL htri_t H5G_is_empty_test(hid_t gid);
00568 H5_DLL htri_t H5G_has_links_test(hid_t gid, unsigned *nmsgs);
00569 H5_DLL htri_t H5G_has_stab_test(hid_t gid);
00570 H5_DLL htri_t H5G_is_new_dense_test(hid_t gid);
00571 H5_DLL herr_t H5G_new_dense_info_test(hid_t gid, hsize_t *name_count, hsize_t *corder_count);
00572 H5_DLL herr_t H5G_lheap_size_test(hid_t gid, size_t *lheap_size);
00573 H5_DLL herr_t H5G_user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsigned *user_path_hidden);
00574 H5_DLL herr_t H5G_verify_cached_stab_test(H5O_loc_t *grp_oloc, H5G_entry_t *ent);
00575 #endif /* H5G_TESTING */
00576 
00577 #endif /* _H5Gpkg_H */
00578