summaryrefslogtreecommitdiffstats
path: root/src/H5Oprivate.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2005-11-15 02:55:39 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2005-11-15 02:55:39 (GMT)
commita1708eb023f2c8f8ac6c2c17bf1e598c8dff956e (patch)
tree34c87a3753b36c4c8d689d58bf456eaf261cd235 /src/H5Oprivate.h
parentbea1e576c5ef5500678f7ce913d835341b625e8f (diff)
downloadhdf5-a1708eb023f2c8f8ac6c2c17bf1e598c8dff956e.zip
hdf5-a1708eb023f2c8f8ac6c2c17bf1e598c8dff956e.tar.gz
hdf5-a1708eb023f2c8f8ac6c2c17bf1e598c8dff956e.tar.bz2
[svn-r11712] Purpose:
New feature Description: Check in baseline for compact group revisions, which radically revises the source code for managing groups and object headers. WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! This initiates the "unstable" phase of the 1.7.x branch, leading up to the 1.8.0 release. Please test this code, but do _NOT_ keep files created with it - the format will change again before the release and you will not be able to read your old files!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! Solution: There's too many changes to really describe them all, but some of them include: - Stop abusing the H5G_entry_t structure and split it into two separate structures for non-symbol table node use within the library: H5O_loc_t for object locations in a file and H5G_name_t to store the path to an opened object. H5G_entry_t is now only used for storing symbol table entries on disk. - Retire H5G_namei() in favor of a more general mechanism for traversing group paths and issuing callbacks on objects located. This gets us out of the business of hacking H5G_namei() for new features, generally. - Revised H5O* routines to take a H5O_loc_t instead of H5G_entry_t - Lots more... Platforms tested: h5committested and maybe another dozen configurations.... :-)
Diffstat (limited to 'src/H5Oprivate.h')
-rw-r--r--src/H5Oprivate.h115
1 files changed, 81 insertions, 34 deletions
diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h
index d619806..b9c7511 100644
--- a/src/H5Oprivate.h
+++ b/src/H5Oprivate.h
@@ -35,8 +35,7 @@
#include "H5Spublic.h" /* Dataspace functions */
/* Private headers needed by this file */
-#include "H5FLprivate.h" /* Free Lists */
-#include "H5HGprivate.h" /* Global heap functions */
+#include "H5Fprivate.h" /* File access */
#include "H5Tprivate.h" /* Datatype functions */
#include "H5Zprivate.h" /* I/O pipeline filters */
@@ -45,6 +44,7 @@
#define H5O_MAX_SIZE 65536 /*max obj header data size */
#define H5O_NEW_MESG (-1) /*new message */
#define H5O_ALL (-1) /* Operate on all messages of type */
+#define H5O_FIRST (-2) /* Operate on first message of type */
/* Flags which are part of a message */
#define H5O_FLAG_CONSTANT 0x01u
@@ -55,18 +55,24 @@
#define H5O_UPDATE_TIME 0x01u
#define H5O_UPDATE_DATA_ONLY 0x02u
+/* The object location information for an object */
+typedef struct H5O_loc_t {
+ H5F_t *file; /* File that object header is located within */
+ haddr_t addr; /* File address of object header */
+} H5O_loc_t;
+
/* Header message IDs */
#define H5O_NULL_ID 0x0000 /* Null Message. */
#define H5O_SDSPACE_ID 0x0001 /* Simple Dataspace Message. */
-/* Complex dataspace is/was planned for message 0x0002 */
+#define H5O_LINFO_ID 0x0002 /* Link Info Message. */
#define H5O_DTYPE_ID 0x0003 /* Datatype Message. */
#define H5O_FILL_ID 0x0004 /* Fill Value Message. (Old) */
#define H5O_FILL_NEW_ID 0x0005 /* Fill Value Message. (New) */
-/* Compact data storage is/was planned for message 0x0006 */
+#define H5O_LINK_ID 0x0006 /* Link Message. */
#define H5O_EFL_ID 0x0007 /* External File List Message */
#define H5O_LAYOUT_ID 0x0008 /* Data Storage Layout Message. */
#define H5O_BOGUS_ID 0x0009 /* "Bogus" Message. */
-/* message 0x000a appears unused... */
+#define H5O_GINFO_ID 0x000a /* Group Info Message. */
#define H5O_PLINE_ID 0x000b /* Filter pipeline message. */
#define H5O_ATTR_ID 0x000c /* Attribute Message. */
#define H5O_NAME_ID 0x000d /* Object name message. */
@@ -77,6 +83,14 @@
#define H5O_MTIME_NEW_ID 0x0012 /* Modification time message. (New) */
/*
+ * Link Info Message.
+ * (Data structure in memory)
+ */
+typedef struct H5O_linfo_t {
+ hsize_t nlinks; /* Number of links in the group */
+} H5O_linfo_t;
+
+/*
* Fill Value Message. (Old)
* (Data structure in memory)
*/
@@ -102,6 +116,29 @@ typedef struct H5O_fill_new_t {
} H5O_fill_new_t;
/*
+ * Link message.
+ * (Data structure in memory)
+ */
+typedef struct H5O_link_hard_t {
+ haddr_t addr; /* Object header address */
+} H5O_link_hard_t;
+
+typedef struct H5O_link_soft_t {
+ char *name; /* Destination name */
+} H5O_link_soft_t;
+
+typedef struct H5O_link_t {
+ H5G_link_t type; /* Type of link */
+ time_t ctime; /* Time link was createed */
+ H5T_cset_t cset; /* Character set of link name */
+ char *name; /* Link name */
+ union {
+ H5O_link_hard_t hard; /* Information for hard links */
+ H5O_link_soft_t soft; /* Information for soft links */
+ } u;
+} H5O_link_t;
+
+/*
* External File List Message
* (Data structure in memory)
*/
@@ -209,11 +246,7 @@ typedef struct H5O_name_t {
*/
typedef struct H5O_shared_t {
- hbool_t in_gh; /*shared by global heap? */
- union {
- H5HG_t gh; /*global heap info */
- H5G_entry_t ent; /*symbol table entry info */
- } u;
+ H5O_loc_t oloc; /*object location info */
} H5O_shared_t;
/*
@@ -250,38 +283,45 @@ typedef struct H5O_stab_t {
typedef herr_t (*H5O_operator_t)(const void *mesg/*in*/, unsigned idx,
void *operator_data/*in,out*/);
+/* Depth of object location copy */
+typedef enum {
+ H5O_COPY_SHALLOW, /* Copy from source to destination, just copy field pointers */
+ H5O_COPY_DEEP /* Deep copy from source to destination, including duplicating fields pointed to */
+} H5O_copy_depth_t;
+
/* Forward declarations for prototype arguments */
struct H5SL_t;
/* General message operators */
+H5_DLL herr_t H5O_init(void);
H5_DLL herr_t H5O_create(H5F_t *f, hid_t dxpl_id, size_t size_hint,
- H5G_entry_t *ent/*out*/);
-H5_DLL herr_t H5O_open(const H5G_entry_t *ent);
-H5_DLL herr_t H5O_close(H5G_entry_t *ent);
-H5_DLL int H5O_link(const H5G_entry_t *ent, int adjust, hid_t dxpl_id);
-H5_DLL int H5O_count(H5G_entry_t *ent, unsigned type_id, hid_t dxpl_id);
-H5_DLL htri_t H5O_exists(H5G_entry_t *ent, unsigned type_id, int sequence,
+ H5O_loc_t *loc/*out*/);
+H5_DLL herr_t H5O_open(const H5O_loc_t *loc);
+H5_DLL herr_t H5O_close(H5O_loc_t *loc);
+H5_DLL int H5O_link(const H5O_loc_t *loc, int adjust, hid_t dxpl_id);
+H5_DLL int H5O_count(H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id);
+H5_DLL htri_t H5O_exists(H5O_loc_t *loc, unsigned type_id, int sequence,
hid_t dxpl_id);
-H5_DLL void *H5O_read(const H5G_entry_t *ent, unsigned type_id, int sequence,
+H5_DLL void *H5O_read(const H5O_loc_t *loc, unsigned type_id, int sequence,
void *mesg, hid_t dxpl_id);
-H5_DLL int H5O_modify(H5G_entry_t *ent, unsigned type_id,
+H5_DLL int H5O_modify(H5O_loc_t *loc, unsigned type_id,
int overwrite, unsigned flags, unsigned update_flags, const void *mesg, hid_t dxpl_id);
-H5_DLL struct H5O_t * H5O_protect(H5G_entry_t *ent, hid_t dxpl_id);
-H5_DLL herr_t H5O_unprotect(H5G_entry_t *ent, struct H5O_t *oh, hid_t dxpl_id,
- unsigned oh_flags);
+H5_DLL struct H5O_t *H5O_protect(H5O_loc_t *loc, hid_t dxpl_id);
+H5_DLL herr_t H5O_unprotect(H5O_loc_t *loc, struct H5O_t *oh, hid_t dxpl_id,
+ unsigned oh_flags);
H5_DLL int H5O_append(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh, unsigned type_id,
unsigned flags, const void *mesg, unsigned * oh_flags_ptr);
-H5_DLL herr_t H5O_touch(H5G_entry_t *ent, hbool_t force, hid_t dxpl_id);
-H5_DLL herr_t H5O_touch_oh(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh,
- hbool_t force, unsigned * oh_flags_ptr);
+H5_DLL herr_t H5O_touch(H5O_loc_t *loc, hbool_t force, hid_t dxpl_id);
+H5_DLL herr_t H5O_touch_oh(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh,
+ hbool_t force, unsigned *oh_flags_ptr);
#ifdef H5O_ENABLE_BOGUS
-H5_DLL herr_t H5O_bogus(H5G_entry_t *ent, hid_t dxpl_id);
+H5_DLL herr_t H5O_bogus(H5O_loc_t *loc, hid_t dxpl_id);
H5_DLL herr_t H5O_bogus_oh(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh,
- unsigned * oh_flags_ptr);
+ unsigned * oh_flags_ptr);
#endif /* H5O_ENABLE_BOGUS */
-H5_DLL herr_t H5O_remove(H5G_entry_t *ent, unsigned type_id, int sequence,
+H5_DLL herr_t H5O_remove(H5O_loc_t *loc, unsigned type_id, int sequence,
hbool_t adj_link, hid_t dxpl_id);
-H5_DLL herr_t H5O_remove_op(H5G_entry_t *ent, unsigned type_id,
+H5_DLL herr_t H5O_remove_op(const H5O_loc_t *loc, unsigned type_id, int sequence,
H5O_operator_t op, void *op_data, hbool_t adj_link, hid_t dxpl_id);
H5_DLL herr_t H5O_reset(unsigned type_id, void *native);
H5_DLL void *H5O_free(unsigned type_id, void *mesg);
@@ -292,17 +332,24 @@ H5_DLL size_t H5O_raw_size(unsigned type_id, const H5F_t *f, const void *mesg);
H5_DLL size_t H5O_mesg_size(unsigned type_id, const H5F_t *f, const void *mesg);
H5_DLL herr_t H5O_get_share(unsigned type_id, H5F_t *f, const void *mesg, H5O_shared_t *share);
H5_DLL herr_t H5O_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr);
-H5_DLL herr_t H5O_get_info(H5G_entry_t *ent, H5O_stat_t *ostat, hid_t dxpl_id);
-H5_DLL herr_t H5O_iterate(const H5G_entry_t *ent, unsigned type_id, H5O_operator_t op,
+H5_DLL herr_t H5O_get_info(H5O_loc_t *loc, H5O_stat_t *ostat, hid_t dxpl_id);
+H5_DLL herr_t H5O_iterate(const H5O_loc_t *loc, unsigned type_id, H5O_operator_t op,
void *op_data, hid_t dxpl_id);
-H5_DLL herr_t H5O_copy_header(const H5G_entry_t *ent_src,
- H5G_entry_t *ent_dst /*out */, hid_t dxpl_id);
-H5_DLL herr_t H5O_copy_header_map(const H5G_entry_t *ent_src,
- H5G_entry_t *ent_dst /*out */, hid_t dxpl_id, struct H5SL_t *obj_list);
+H5_DLL H5G_obj_t H5O_obj_type(H5O_loc_t *loc, hid_t dxpl_id);
+H5_DLL herr_t H5O_copy_header(const H5O_loc_t *oloc_src,
+ H5O_loc_t *oloc_dst /*out */, hid_t dxpl_id);
+H5_DLL herr_t H5O_copy_header_map(const H5O_loc_t *oloc_src,
+ H5O_loc_t *oloc_dst /*out */, hid_t dxpl_id, struct H5SL_t *map_list);
H5_DLL herr_t H5O_debug_id(hid_t type_id, H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, int indent, int fwidth);
H5_DLL herr_t H5O_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent,
int fwidth);
+/*
+ * These functions operate on object locations
+ */
+H5_DLL herr_t H5O_loc_reset(H5O_loc_t *loc);
+H5_DLL herr_t H5O_loc_copy(H5O_loc_t *dst, const H5O_loc_t *src, H5O_copy_depth_t depth);
+
/* Layout operators */
H5_DLL size_t H5O_layout_meta_size(const H5F_t *f, const void *_mesg);