summaryrefslogtreecommitdiffstats
path: root/src/H5P.c
diff options
context:
space:
mode:
authorJames Laird <jlaird@hdfgroup.org>2006-07-05 19:01:50 (GMT)
committerJames Laird <jlaird@hdfgroup.org>2006-07-05 19:01:50 (GMT)
commit801ca2f9cb803b368b36a6c280684c1f6624f169 (patch)
treeed2543e9bc1f2beb9857f442fc8b52b3c371299f /src/H5P.c
parentd582c7bc8ac8679911e4787f5f92cc37b1c9989c (diff)
downloadhdf5-801ca2f9cb803b368b36a6c280684c1f6624f169.zip
hdf5-801ca2f9cb803b368b36a6c280684c1f6624f169.tar.gz
hdf5-801ca2f9cb803b368b36a6c280684c1f6624f169.tar.bz2
[svn-r12452] Purpose:
Feature Description: Revised Link APIs. Solution: New link APIs use H5L* H5*create_expand do not create links to the objects created; this must be done manually with H5Llink. Added APIs to link an object given its ID (H5Llink), to copy links (H5Lcopy), and changed creation APIs (H5Lcreate_hard and H5Lcreate_soft) and query API (H5Lget_linkinfo instead of H5Gget_objinfo). All old APIs are still supported in H5Gdeprec.c . Platforms tested: sol, mir, copper Misc. update: Forgot to update MANIFEST and release docs. Will do after checkin.
Diffstat (limited to 'src/H5P.c')
-rw-r--r--src/H5P.c63
1 files changed, 48 insertions, 15 deletions
diff --git a/src/H5P.c b/src/H5P.c
index c28bd44..9a87b90 100644
--- a/src/H5P.c
+++ b/src/H5P.c
@@ -56,6 +56,8 @@ hid_t H5P_CLS_DATATYPE_CREATE_g = FAIL;
hid_t H5P_CLS_DATATYPE_ACCESS_g = FAIL;
hid_t H5P_CLS_ATTRIBUTE_CREATE_g = FAIL;
hid_t H5P_CLS_OBJECT_COPY_g = FAIL;
+hid_t H5P_CLS_LINK_CREATE_g = FAIL;
+hid_t H5P_CLS_STRING_CREATE_g = FAIL;
/*
* Predefined property lists for each predefined class. These are initialized
@@ -74,6 +76,7 @@ hid_t H5P_LST_DATATYPE_CREATE_g = FAIL;
hid_t H5P_LST_DATATYPE_ACCESS_g = FAIL;
hid_t H5P_LST_ATTRIBUTE_CREATE_g = FAIL;
hid_t H5P_LST_OBJECT_COPY_g = FAIL;
+hid_t H5P_LST_LINK_CREATE_g = FAIL;
/* Track the revision count of a class, to make comparisons faster */
static unsigned H5P_next_rev=0;
@@ -238,10 +241,14 @@ H5P_init_interface(void)
H5O_ginfo_t ginfo = H5G_CRT_GROUP_INFO_DEF;
/* Object creation property class variables. In sequence, they are,
* - Creation property list class to modify
- * - Default value for "intermediate group creation"
*/
H5P_genclass_t *ocrt_class; /* Pointer to object (dataset, group, or datatype) creation property list class created */
- unsigned intmd_group = H5G_CRT_INTERMEDIATE_GROUP_DEF;
+ /* String creation property class variables. In sequence, they are,
+ * - Creation property list class to modify
+ * - Default value for "character encoding"
+ */
+ H5P_genclass_t *strcrt_class; /* Pointer to string creation class */
+ H5T_cset_t char_encoding = H5P_CHAR_ENCODING_DEF;
/* Object copy property class variables. In sequence, they are,
* - Copy property list class to modify
* - Default value for "object copy parameters"
@@ -284,18 +291,6 @@ H5P_init_interface(void)
if ((H5P_CLS_OBJECT_CREATE_g = H5I_register (H5I_GENPROP_CLS, ocrt_class))<0)
HGOTO_ERROR (H5E_PLIST, H5E_CANTREGISTER, FAIL, "can't register property list class")
- /* Get the number of properties in the object class */
- if(H5P_get_nprops_pclass(ocrt_class,&nprops,FALSE)<0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't query number of properties")
-
- /* Assume that if there are properties in the class, they are the default ones */
- if(nprops==0) {
- /* Register create intermediate groups */
- if(H5P_register(ocrt_class,H5G_CRT_INTERMEDIATE_GROUP_NAME,H5G_CRT_INTERMEDIATE_GROUP_SIZE,
- &intmd_group,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
- } /* end if */
-
/* Create object copy property class */
/* Allocate the object copy class */
@@ -436,15 +431,49 @@ H5P_init_interface(void)
if ((H5P_CLS_DATATYPE_ACCESS_g = H5I_register (H5I_GENPROP_CLS, pclass))<0)
HGOTO_ERROR (H5E_PLIST, H5E_CANTREGISTER, FAIL, "can't register property list class");
+ /* Create string creation property class
+ * Objects that contain strings should inherit from this class
+ * For example, links and attributes have names associated with them. */
+
+ /* Allocate the string creation class */
+ assert(H5P_CLS_STRING_CREATE_g==(-1));
+ if (NULL==(strcrt_class = H5P_create_class (root_class,"string create",1,NULL,NULL,NULL,NULL,NULL,NULL)))
+ HGOTO_ERROR (H5E_PLIST, H5E_CANTINIT, FAIL, "class initialization failed");
+
+ /* Register the string class */
+ if ((H5P_CLS_STRING_CREATE_g = H5I_register (H5I_GENPROP_CLS, strcrt_class))<0)
+ HGOTO_ERROR (H5E_PLIST, H5E_CANTREGISTER, FAIL, "can't register property list class");
+
+ /* Get the number of properties in the string class */
+ if(H5P_get_nprops_pclass(strcrt_class,&nprops,FALSE)<0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't query number of properties")
+
+ /* Assume that if there are properties in the class, they are the default ones */
+ if(nprops==0) {
+ /* Register character encoding */
+ if(H5P_register(strcrt_class,H5P_CHAR_ENCODING_NAME,H5P_CHAR_ENCODING_SIZE,
+ &char_encoding,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
+ } /* end if */
+
/* Allocate the attribute creation class */
assert(H5P_CLS_ATTRIBUTE_CREATE_g==(-1));
- if (NULL==(pclass = H5P_create_class (ocrt_class,"attribute create",1,NULL,NULL,NULL,NULL,NULL,NULL)))
+ if (NULL==(pclass = H5P_create_class (strcrt_class,"attribute create",1,NULL,NULL,NULL,NULL,NULL,NULL)))
HGOTO_ERROR (H5E_PLIST, H5E_CANTINIT, FAIL, "class initialization failed");
/* Register the attribute creation class */
if ((H5P_CLS_ATTRIBUTE_CREATE_g = H5I_register (H5I_GENPROP_CLS, pclass))<0)
HGOTO_ERROR (H5E_PLIST, H5E_CANTREGISTER, FAIL, "can't register property list class");
+ /* Allocate the link creation class */
+ assert(H5P_CLS_LINK_CREATE_g==(-1));
+ if (NULL==(pclass = H5P_create_class (strcrt_class,"link create",1,NULL,NULL,NULL,NULL,NULL,NULL)))
+ HGOTO_ERROR (H5E_PLIST, H5E_CANTINIT, FAIL, "class initialization failed");
+
+ /* Register the link creation class */
+ if ((H5P_CLS_LINK_CREATE_g = H5I_register (H5I_GENPROP_CLS, pclass))<0)
+ HGOTO_ERROR (H5E_PLIST, H5E_CANTREGISTER, FAIL, "can't register property list class");
+
done:
FUNC_LEAVE_NOAPI(ret_value);
}
@@ -503,8 +532,10 @@ H5P_term_interface(void)
H5P_LST_GROUP_ACCESS_g =
H5P_LST_DATATYPE_CREATE_g =
H5P_LST_DATATYPE_ACCESS_g =
+ H5P_CLS_STRING_CREATE_g =
H5P_LST_ATTRIBUTE_CREATE_g =
H5P_LST_OBJECT_COPY_g =
+ H5P_LST_LINK_CREATE_g =
H5P_LST_MOUNT_g = (-1);
} /* end if */
} /* end if */
@@ -526,8 +557,10 @@ H5P_term_interface(void)
H5P_CLS_GROUP_ACCESS_g =
H5P_CLS_DATATYPE_CREATE_g =
H5P_CLS_DATATYPE_ACCESS_g =
+ H5P_CLS_STRING_CREATE_g =
H5P_CLS_ATTRIBUTE_CREATE_g =
H5P_CLS_OBJECT_COPY_g =
+ H5P_CLS_LINK_CREATE_g =
H5P_CLS_MOUNT_g = (-1);
} /* end if */
} /* end if */