summaryrefslogtreecommitdiffstats
path: root/src/H5P.c
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/H5P.c
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/H5P.c')
-rw-r--r--src/H5P.c72
1 files changed, 52 insertions, 20 deletions
diff --git a/src/H5P.c b/src/H5P.c
index 637ab59..7ac272f 100644
--- a/src/H5P.c
+++ b/src/H5P.c
@@ -225,8 +225,18 @@ static herr_t
H5P_init_interface(void)
{
H5P_genclass_t *root_class; /* Pointer to root property list class created */
- H5P_genclass_t *ocrt_class; /* Pointer to object (dataset, group, or datatype) creation property list class created */
H5P_genclass_t *pclass; /* Pointer to property list class to create */
+ /* Group creation property class variables. In sequence, they are,
+ * - Creation property list class to modify
+ * - Default value for "group info"
+ */
+ H5P_genclass_t *gcrt_class; /* Pointer to group creation property list class created */
+ 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;
size_t nprops; /* Number of properties */
herr_t ret_value = SUCCEED;
@@ -276,11 +286,48 @@ H5P_init_interface(void)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
} /* end if */
+ /* Register the group creation and group access property classes */
+ /* (Register the group property classes before file property classes, so
+ * file creation property class can inherit from group creation property
+ * class, which is used to allow application to control the group creation
+ * properties of the root group of a file. -QAK)
+ */
+
+ /* Allocate the group creation class */
+ HDassert(H5P_CLS_GROUP_CREATE_g == (-1));
+ if(NULL == (gcrt_class = H5P_create_class(ocrt_class, "group create", 1, NULL, NULL, NULL, NULL, NULL, NULL)))
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "class initialization failed");
+
+ /* Register the group creation class */
+ if((H5P_CLS_GROUP_CREATE_g = H5I_register(H5I_GENPROP_CLS, gcrt_class)) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "can't register property list class");
+
+ /* Get the number of properties in the class */
+ if(H5P_get_nprops_pclass(gcrt_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 group info */
+ if(H5P_register(gcrt_class, H5G_CRT_GROUP_INFO_NAME, H5G_CRT_GROUP_INFO_SIZE,
+ &ginfo, 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 group access class */
+ HDassert(H5P_CLS_GROUP_ACCESS_g == (-1));
+ if(NULL == (pclass = H5P_create_class(root_class, "group access", 1, NULL, NULL, NULL, NULL, NULL, NULL)))
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "class initialization failed");
+
+ /* Register the group access class */
+ if((H5P_CLS_GROUP_ACCESS_g = H5I_register(H5I_GENPROP_CLS, pclass)) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "can't register property list class");
+
/* Register the file creation and file access property classes */
/* Allocate the file creation class */
assert(H5P_CLS_FILE_CREATE_g==(-1));
- if (NULL==(pclass = H5P_create_class (root_class,"file create",1,NULL,NULL,NULL,NULL,NULL,NULL)))
+ if (NULL==(pclass = H5P_create_class (gcrt_class,"file create",1,NULL,NULL,NULL,NULL,NULL,NULL)))
HGOTO_ERROR (H5E_PLIST, H5E_CANTINIT, FAIL, "class initialization failed");
/* Register the file creation class */
@@ -325,6 +372,8 @@ H5P_init_interface(void)
if ((H5P_CLS_DATASET_XFER_g = H5I_register (H5I_GENPROP_CLS, pclass))<0)
HGOTO_ERROR (H5E_PLIST, H5E_CANTREGISTER, FAIL, "can't register property list class");
+ /* Register the mount property classes */
+
/* Allocate the mount class */
assert(H5P_CLS_MOUNT_g==(-1));
if (NULL==(pclass = H5P_create_class (root_class,"file mount",1,NULL,NULL,NULL,NULL,NULL,NULL)))
@@ -334,24 +383,7 @@ H5P_init_interface(void)
if ((H5P_CLS_MOUNT_g = H5I_register (H5I_GENPROP_CLS, pclass))<0)
HGOTO_ERROR (H5E_PLIST, H5E_CANTREGISTER, FAIL, "can't register property list class");
-
- /* Allocate the group creation class */
- assert(H5P_CLS_GROUP_CREATE_g==(-1));
- if (NULL==(pclass = H5P_create_class (ocrt_class,"group create",1,NULL,NULL,NULL,NULL,NULL,NULL)))
- HGOTO_ERROR (H5E_PLIST, H5E_CANTINIT, FAIL, "class initialization failed");
-
- /* Register the group creation class */
- if ((H5P_CLS_GROUP_CREATE_g = H5I_register (H5I_GENPROP_CLS, pclass))<0)
- HGOTO_ERROR (H5E_PLIST, H5E_CANTREGISTER, FAIL, "can't register property list class");
-
- /* Allocate the group access class */
- assert(H5P_CLS_GROUP_ACCESS_g==(-1));
- if (NULL==(pclass = H5P_create_class (root_class,"group access",1,NULL,NULL,NULL,NULL,NULL,NULL)))
- HGOTO_ERROR (H5E_PLIST, H5E_CANTINIT, FAIL, "class initialization failed");
-
- /* Register the group access class */
- if ((H5P_CLS_GROUP_ACCESS_g = H5I_register (H5I_GENPROP_CLS, pclass))<0)
- HGOTO_ERROR (H5E_PLIST, H5E_CANTREGISTER, FAIL, "can't register property list class");
+ /* Register the named datatype creation and named datatype access property classes */
/* Allocate the datatype creation class */
assert(H5P_CLS_DATATYPE_CREATE_g==(-1));