diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2012-02-10 02:16:52 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2012-02-10 02:16:52 (GMT) |
commit | 3d9e0b86acb27b4aeb21371407b145c692dfd606 (patch) | |
tree | c7fa93f746a80557709affe90fc5fd21d2cd7d2b /src/H5Gprivate.h | |
parent | eca8a50511a2d5c99dde851190e688cd611113cd (diff) | |
download | hdf5-3d9e0b86acb27b4aeb21371407b145c692dfd606.zip hdf5-3d9e0b86acb27b4aeb21371407b145c692dfd606.tar.gz hdf5-3d9e0b86acb27b4aeb21371407b145c692dfd606.tar.bz2 |
[svn-r21923] Description:
Add FUNC_ENTER macros for package-private routines and begin process of
switching package routines to use them. All H5G routines are currently
finished.
Tested on:
Mac OSX/64 10.7.3 (amazon) w/debug, production & parallel
Diffstat (limited to 'src/H5Gprivate.h')
-rw-r--r-- | src/H5Gprivate.h | 92 |
1 files changed, 89 insertions, 3 deletions
diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h index 140e22f..f765b52 100644 --- a/src/H5Gprivate.h +++ b/src/H5Gprivate.h @@ -105,6 +105,18 @@ #define H5G_MOUNTED(G) (H5G_mounted(G)) #endif /* H5G_PACKAGE */ +/* + * During name lookups (see H5G_traverse()) we sometimes want information about + * a symbolic link or a mount point. The normal operation is to follow the + * symbolic link or mount point and return information about its target. + */ +#define H5G_TARGET_NORMAL 0x0000 +#define H5G_TARGET_SLINK 0x0001 +#define H5G_TARGET_MOUNT 0x0002 +#define H5G_TARGET_UDLINK 0x0004 +#define H5G_TARGET_EXISTS 0x0008 +#define H5G_CRT_INTMD_GROUP 0x0010 + /* Type of operation being performed for call to H5G_name_replace() */ typedef enum { H5G_NAME_MOVE = 0, /* H5*move call */ @@ -141,6 +153,38 @@ typedef struct { H5G_name_t *path; /* Group hierarchy path */ } H5G_loc_t; +/* Typedef for path traversal operations */ +/* grp_loc is the location of the group in which the targeted object is located. + * name is the last component of the object's name + * lnk is the link between the group and the object + * obj_loc is the target of the traversal (or NULL if the object doesn't exist) + * operator_data is whatever udata was supplied when H5G_traverse was called + * own_loc should be set to H5G_OWN_OBJ_LOC if this callback takes ownership of obj_loc, + * H5G_OWN_GRP_LOC if it takes ownership of grp_loc, and H5G_OWN_NONE if obj_loc and + * grp_loc need to be deleted. + */ +typedef herr_t (*H5G_traverse_t)(H5G_loc_t *grp_loc/*in*/, const char *name, + const struct H5O_link_t *lnk/*in*/, H5G_loc_t *obj_loc/*out*/, void *operator_data/*in,out*/, + H5G_own_loc_t *own_loc/*out*/); + +/* Describe kind of callback to make for each link */ +typedef enum H5G_link_iterate_op_type_t { +#ifndef H5_NO_DEPRECATED_SYMBOLS + H5G_LINK_OP_OLD, /* "Old" application callback */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ + H5G_LINK_OP_NEW /* "New" application callback */ +} H5G_link_iterate_op_type_t; + +typedef struct { + H5G_link_iterate_op_type_t op_type; + union { +#ifndef H5_NO_DEPRECATED_SYMBOLS + H5G_iterate_t op_old; /* "Old" application callback for each link */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ + H5L_iterate_t op_new; /* "New" application callback for each link */ + } op_func; +} H5G_link_iterate_t; + typedef struct H5G_t H5G_t; typedef struct H5G_shared_t H5G_shared_t; typedef struct H5G_entry_t H5G_entry_t; @@ -150,9 +194,6 @@ typedef struct H5G_entry_t H5G_entry_t; * call. */ H5_DLL struct H5O_loc_t *H5G_oloc(H5G_t *grp); -H5_DLL herr_t H5G_mkroot(H5F_t *f, hid_t dxpl_id, hbool_t create_root); -H5_DLL herr_t H5G_root_free(H5G_t *grp); -H5_DLL H5G_t *H5G_rootof(H5F_t *f); H5_DLL H5G_name_t * H5G_nameof(H5G_t *grp); H5_DLL H5F_t *H5G_fileof(H5G_t *grp); H5_DLL H5G_t *H5G_open(const H5G_loc_t *loc, hid_t dxpl_id); @@ -164,10 +205,45 @@ H5_DLL herr_t H5G_unmount(H5G_t *grp); #ifndef H5_NO_DEPRECATED_SYMBOLS H5_DLL H5G_obj_t H5G_map_obj_type(H5O_type_t obj_type); #endif /* H5_NO_DEPRECATED_SYMBOLS */ + +/* + * Utility functions + */ +H5_DLL char *H5G_normalize(const char *name); + +/* + * Group hierarchy traversal routines + */ +H5_DLL herr_t H5G_traverse(const H5G_loc_t *loc, const char *name, + unsigned target, H5G_traverse_t op, void *op_data, hid_t lapl_id, + hid_t dxpl_id); +H5_DLL herr_t H5G_iterate(hid_t loc_id, const char *group_name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, + const H5G_link_iterate_t *lnk_op, void *op_data, hid_t lapl_id, hid_t dxpl_id); H5_DLL herr_t H5G_visit(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, H5L_iterate_t op, void *op_data, hid_t lapl_id, hid_t dxpl_id); +/* + * Functions that understand links in groups + */ +H5_DLL herr_t H5G_link_to_info(const struct H5O_link_t *lnk, H5L_info_t *linfo); + +/* + * Functions that understand group objects + */ +H5_DLL herr_t H5G_obj_insert(const struct H5O_loc_t *grp_oloc, const char *name, + struct H5O_link_t *obj_lnk, hbool_t adj_link, H5O_type_t obj_type, + const void *crt_info, hid_t dxpl_id); +H5_DLL ssize_t H5G_obj_get_name_by_idx(const struct H5O_loc_t *oloc, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n, char* name, size_t size, hid_t dxpl_id); +H5_DLL herr_t H5G_obj_remove(const struct H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, + const char *name, hid_t dxpl_id); +H5_DLL herr_t H5G_obj_remove_by_idx(const struct H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t dxpl_id); +H5_DLL herr_t H5G_obj_lookup_by_idx(const struct H5O_loc_t *grp_oloc, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n, struct H5O_link_t *lnk, hid_t dxpl_id); + /* * These functions operate on symbol table nodes. */ @@ -184,6 +260,7 @@ H5_DLL herr_t H5G_ent_decode(const H5F_t *f, const uint8_t **pp, H5G_entry_t *en /* * These functions operate on group hierarchy names. */ +H5_DLL herr_t H5G_name_set(const H5G_name_t *loc, H5G_name_t *obj, const char *name); H5_DLL herr_t H5G_name_replace(const struct H5O_link_t *lnk, H5G_names_op_t op, H5F_t *src_file, H5RS_str_t *src_full_path_r, H5F_t *dst_file, H5RS_str_t *dst_full_path_r, hid_t dxpl_id); @@ -194,6 +271,7 @@ H5_DLL ssize_t H5G_get_name(const H5G_loc_t *loc, char *name/*out*/, size_t size hbool_t *cached, hid_t lapl_id, hid_t dxpl_id); H5_DLL ssize_t H5G_get_name_by_addr(hid_t fid, hid_t lapl_id, hid_t dxpl_id, const struct H5O_loc_t *loc, char* name, size_t size); +H5_DLL H5RS_str_t *H5G_build_fullpath_refstr_str(H5RS_str_t *path_r, const char *name); /* * These functions operate on group "locations" @@ -216,5 +294,13 @@ H5_DLL ssize_t H5G_loc_get_comment(H5G_loc_t *loc, const char *name, H5_DLL herr_t H5G_loc_reset(H5G_loc_t *loc); H5_DLL herr_t H5G_loc_free(H5G_loc_t *loc); +/* + * These functions operate on the root group + */ +H5_DLL herr_t H5G_mkroot(H5F_t *f, hid_t dxpl_id, hbool_t create_root); +H5_DLL herr_t H5G_root_loc(H5F_t *f, H5G_loc_t *loc); +H5_DLL herr_t H5G_root_free(H5G_t *grp); +H5_DLL H5G_t *H5G_rootof(H5F_t *f); + #endif /* _H5Gprivate_H */ |