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