summaryrefslogtreecommitdiffstats
path: root/src/H5G.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-06-23 14:03:22 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-06-23 14:03:22 (GMT)
commit1009b131f69ee6dbf293c106a1aaa003951f2d07 (patch)
treea1d062ffc1060bf8e28da518a3c8c5ba709626fe /src/H5G.c
parent8ec60574b1cfa7a37c8e235e80ef50e8ef8b1a76 (diff)
downloadhdf5-1009b131f69ee6dbf293c106a1aaa003951f2d07.zip
hdf5-1009b131f69ee6dbf293c106a1aaa003951f2d07.tar.gz
hdf5-1009b131f69ee6dbf293c106a1aaa003951f2d07.tar.bz2
[svn-r8725] Purpose:
Refactor bug fix Description: Make bug fix for detecting the type of a soft link more general by registering an "isa" function for soft links. Platforms tested: FreeBSD 4.10 (sleipnir) Too minor to require h5committest
Diffstat (limited to 'src/H5G.c')
-rw-r--r--src/H5G.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/H5G.c b/src/H5G.c
index 4c6fd16..181bbc9 100644
--- a/src/H5G.c
+++ b/src/H5G.c
@@ -172,6 +172,7 @@ static H5G_t *H5G_create(H5G_entry_t *loc, const char *name, size_t size_hint, h
static H5G_t *H5G_reopen(H5G_t *grp);
#endif /* NOT_YET */
static htri_t H5G_isa(H5G_entry_t *ent, hid_t dxpl_id);
+static htri_t H5G_link_isa(H5G_entry_t *ent, hid_t dxpl_id);
static herr_t H5G_link(H5G_entry_t *cur_loc, const char *cur_name,
H5G_entry_t *new_loc, const char *new_name,
H5G_link_t type, unsigned namei_flags, hid_t dxpl_id);
@@ -966,6 +967,7 @@ H5G_init_interface(void)
H5G_register_type(H5G_TYPE, H5T_isa, "datatype");
H5G_register_type(H5G_GROUP, H5G_isa, "group");
H5G_register_type(H5G_DATASET, H5D_isa, "dataset");
+ H5G_register_type(H5G_LINK, H5G_link_isa, "link");
done:
FUNC_LEAVE_NOAPI(ret_value);
@@ -1819,7 +1821,43 @@ H5G_isa(H5G_entry_t *ent, hid_t dxpl_id)
done:
FUNC_LEAVE_NOAPI(ret_value);
}
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5G_link_isa
+ *
+ * Purpose: Determines if an object has the requisite form for being
+ * a soft link.
+ *
+ * Return: Success: TRUE if the symbol table entry is of type
+ * H5G_LINK; FALSE otherwise.
+ *
+ * Failure: Shouldn't fail.
+ *
+ * Programmer: Quincey Koziol
+ * Wednesday, June 23, 2004
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+static htri_t
+H5G_link_isa(H5G_entry_t *ent, hid_t UNUSED dxpl_id)
+{
+ htri_t ret_value;
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_link_isa);
+
+ assert(ent);
+
+ if(ent->type == H5G_CACHED_SLINK)
+ ret_value=TRUE;
+ else
+ ret_value=FALSE;
+
+ FUNC_LEAVE_NOAPI(ret_value);
+} /* end H5G_link_isa() */
+
/*-------------------------------------------------------------------------
* Function: H5G_open