diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-04-11 16:22:16 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-04-11 16:22:16 (GMT) |
commit | 9d2070890b0cfb2c8a406906da0470e948141db4 (patch) | |
tree | 567cc6f6c36d67c78be5e79b3529d30bcbe06a50 /src/H5O.c | |
parent | 78158e8dbffcbf025257a72bb42c1fbe8c7660b7 (diff) | |
download | hdf5-9d2070890b0cfb2c8a406906da0470e948141db4.zip hdf5-9d2070890b0cfb2c8a406906da0470e948141db4.tar.gz hdf5-9d2070890b0cfb2c8a406906da0470e948141db4.tar.bz2 |
[svn-r13636] Description:
Change H5[D|G|T]<foo>_expand() "temporary" API routines to
H5[D|G|T]<foo>2() "versioned" routines. Also added
H5[D|G|T](create|commit)_anon() routines to continue to allow "anonymous"
objects to be created in a file.
Tested on:
Mac OS X/32 10.4.9 (amazon)
FreeBSD/32 6.2 (duty)
FreeBSD/64 6.2 (liberty)
Linux/32 2.6 (chicago)
Linux/64 2.6 (chicago2)
Diffstat (limited to 'src/H5O.c')
-rw-r--r-- | src/H5O.c | 48 |
1 files changed, 48 insertions, 0 deletions
@@ -2086,3 +2086,51 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_get_nlinks() */ + +/*------------------------------------------------------------------------- + * Function: H5O_obj_create + * + * Purpose: Creates an object, in an abstract manner. + * + * Return: Success: Pointer to object opened + * Failure: NULL + * + * Programmer: Quincey Koziol + * April 9 2007 + * + *------------------------------------------------------------------------- + */ +void * +H5O_obj_create(H5F_t *f, H5O_type_t obj_type, void *crt_info, H5G_loc_t *obj_loc, + hid_t dxpl_id) +{ + size_t u; /* Local index variable */ + void *ret_value = NULL; /* Return value */ + + FUNC_ENTER_NOAPI(H5O_obj_create, NULL) + + /* Sanity checks */ + HDassert(f); + HDassert(obj_type >= H5O_TYPE_GROUP && obj_type <= H5O_TYPE_NAMED_DATATYPE); + HDassert(crt_info); + HDassert(obj_loc); + + /* Iterate through the object classes */ + for(u = 0; u < NELMTS(H5O_obj_class_g); u++) { + /* Check for correct type of object to create */ + if(H5O_obj_class_g[u]->type == obj_type) { + /* Call the object class's 'create' routine */ + HDassert(H5O_obj_class_g[u]->create); + if(NULL == (ret_value = H5O_obj_class_g[u]->create(f, crt_info, obj_loc, dxpl_id))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, NULL, "unable to open object") + + /* Break out of loop */ + break; + } /* end if */ + } /* end for */ + HDassert(ret_value); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_obj_create() */ + |