[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.
This commit is contained in:
James Laird 2006-07-05 14:01:50 -05:00
parent d582c7bc8a
commit 801ca2f9cb
58 changed files with 3649 additions and 1565 deletions

View File

@ -48,9 +48,9 @@ $Source = "";
"H5FD_t*" => "x",
"H5FD_class_t*" => "x",
"H5FD_stream_fapl_t*" => "x",
"H5G_link_t" => "Gl",
"H5G_obj_t" => "Go",
"H5G_stat_t*" => "Gs",
"H5L_link_t" => "Ll",
"hsize_t" => "h",
"hssize_t" => "Hs",
"hid_t" => "i",

View File

@ -28,7 +28,7 @@
# access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu.
#
# HDF5-C++ Makefile(.in)
#
#

View File

@ -28,7 +28,7 @@
# access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu.
#
# HDF5-C++ Makefile(.in)
#
#
SOURCES = $(dsets_SOURCES) $(testhdf5_SOURCES)
srcdir = @srcdir@
@ -630,10 +630,10 @@ uninstall-am: uninstall-info-am
build-tests check-clean check-install check-p check-s check-vfd \
install-doc lib progs tests uninstall-doc _exec_check-s _test
# Some C++ compilers/linkers (PGI?) create a directory named "ii_files" that
# Some C++ compilers/linkers (PGI?) create a directory named "ii_files" that
# holds *.ii files, which are template entity instantiations.
# This entire directory should be cleaned.
mostlyclean-local:
mostlyclean-local:
@if test -d ii_files; then \
$(RM) -rf ii_files; \
fi

View File

@ -830,7 +830,7 @@ uninstall-local:
# Also install and uninstall (uninstall-local above) h5fc script
install-exec-local:
@$(INSTALL) h5fc $(bindir)/$(H5FC_NAME)
@$(INSTALL) h5fc $(bindir)/$(H5FC_NAME)
#Specify what Automake needs to create: first the H5fort_type_defines.h
# header, then H5match_types which includes that header, then

View File

@ -28,7 +28,7 @@
# access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu.
#
# HDF5-C++ Makefile(.in)
#
#
SOURCES = $(libhdf5_hl_cpp_la_SOURCES)

View File

@ -28,7 +28,7 @@
# access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu.
#
# HDF5-C++ Makefile(.in)
#
#
SOURCES = $(ptableTest_SOURCES)
srcdir = @srcdir@

View File

@ -347,7 +347,7 @@ lib_LTLIBRARIES = libhdf5hl_fortran.la
# PARALLEL_COND_SRC=HDFDmpiof.c HDF5mpio.f90
#endif
libhdf5hl_fortran_la_SOURCES = H5LTfc.c H5IMfc.c H5IMcc.c H5TBfc.c H5LTff.f90 \
H5IMff.f90 H5TBff.f90
H5IMff.f90 H5TBff.f90
# Automake needs to be taught how to build lib, progs, and tests targets.
@ -692,9 +692,9 @@ uninstall-local:
# determining this automagically (like we do with the C files). So, when
# doing a parallel make, some modules could be made way before the
# modules they depend upon are actually made. *sigh*
H5LTff.lo: $(srcdir)/H5LTff.f90
H5LTff.lo: $(srcdir)/H5LTff.f90
H5IMff.lo: $(srcdir)/H5IMff.f90
H5TBff.lo: $(srcdir)/H5TBff.f90
H5TBff.lo: $(srcdir)/H5TBff.f90
# lib/progs/tests targets recurse into subdirectories. build-* targets
# build files in this directory.

View File

@ -1872,16 +1872,16 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
H5G_link_t link_type = va_arg (ap, H5G_link_t); /*lint !e64 Type mismatch not really occuring */
H5L_link_t link_type = va_arg (ap, H5L_link_t); /*lint !e64 Type mismatch not really occuring */
switch (link_type) {
case H5G_LINK_ERROR:
fprintf (out, "H5G_LINK_ERROR");
case H5L_LINK_ERROR:
fprintf (out, "H5L_LINK_ERROR");
break;
case H5G_LINK_HARD:
fprintf (out, "H5G_LINK_HARD");
case H5L_LINK_HARD:
fprintf (out, "H5L_LINK_HARD");
break;
case H5G_LINK_SOFT:
fprintf (out, "H5G_LINK_SOFT");
case H5L_LINK_SOFT:
fprintf (out, "H5L_LINK_SOFT");
break;
default:
fprintf (out, "%ld", (long)link_type);
@ -1904,7 +1904,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf (out, "H5G_UNKNOWN");
break;
case H5G_LINK:
fprintf (out, "H5G_LINK");
fprintf (out, "H5L_LINK");
break;
case H5G_GROUP:
fprintf (out, "H5G_GROUP");

View File

@ -72,8 +72,6 @@ static herr_t
H5A_init_interface(void)
{
H5P_genclass_t *crt_pclass;
size_t nprops; /* Number of properties */
H5T_cset_t default_cset = H5A_CHAR_ENCODING_DEF;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5A_init_interface)
@ -92,17 +90,6 @@ H5A_init_interface(void)
if (NULL == (crt_pclass = H5I_object(H5P_CLS_ATTRIBUTE_CREATE_g)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list class")
/* Get the number of properties in the class */
if(H5P_get_nprops_pclass(crt_pclass,&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 the size of the character encoding field */
if(H5P_register(crt_pclass,H5A_CHAR_ENCODING_NAME,H5A_CHAR_ENCODING_SIZE,&default_cset,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
}
/* Only register the default property list if it hasn't been created yet */
if(H5P_LST_ATTRIBUTE_CREATE_g==(-1)) {
/* Register the default attribute creation property list */
@ -282,7 +269,7 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type,
/* If the creation property list is H5P_DEFAULT, use the default character encoding */
if(acpl_id == H5P_DEFAULT)
{
attr->encoding = H5A_CHAR_ENCODING_DEF;
attr->encoding = H5P_CHAR_ENCODING_DEF;
}
else
{
@ -290,7 +277,7 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type,
if (NULL == (ac_plist = H5I_object(acpl_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
if(H5P_get(ac_plist, H5A_CHAR_ENCODING_NAME, &(attr->encoding)) < 0)
if(H5P_get(ac_plist, H5P_CHAR_ENCODING_NAME, &(attr->encoding)) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get character encoding flag")
}
@ -1069,7 +1056,7 @@ H5Aget_create_plist(hid_t attr_id)
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "can't get property list")
/* Set the character encoding on the new property list */
if(H5P_set(new_plist, H5A_CHAR_ENCODING_NAME, &(attr->encoding)) < 0)
if(H5P_set(new_plist, H5P_CHAR_ENCODING_NAME, &(attr->encoding)) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set character encoding")
ret_value = new_plist_id;

View File

@ -27,11 +27,6 @@
/* Forward references of package typedefs */
typedef struct H5A_t H5A_t;
/* Attribute creation properties */
#define H5A_CHAR_ENCODING_NAME "character_encoding"
#define H5A_CHAR_ENCODING_SIZE sizeof(H5T_cset_t)
#define H5A_CHAR_ENCODING_DEF H5F_CRT_DEFAULT_CSET
/* Library private functions in package */
H5_DLL struct H5O_loc_t *H5A_oloc(H5A_t *attr);
H5_DLL H5G_name_t *H5A_nameof(H5A_t *attr);

133
src/H5D.c
View File

@ -32,6 +32,7 @@
#include "H5FOprivate.h" /* File objects */
#include "H5HLprivate.h" /* Local heaps */
#include "H5Iprivate.h" /* IDs */
#include "H5Lprivate.h" /* Links */
#include "H5MMprivate.h" /* Memory management */
#include "H5Sprivate.h" /* Dataspaces */
#include "H5Vprivate.h" /* Vectors and arrays */
@ -62,7 +63,7 @@ typedef struct {
/* General stuff */
static herr_t H5D_init_storage(H5D_t *dataset, hbool_t full_overwrite, hid_t dxpl_id);
static H5D_shared_t * H5D_new(hid_t dcpl_id, hbool_t creating, hbool_t vl_type);
static H5D_t * H5D_create(H5G_loc_t *loc, const char *name, hid_t type_id,
static H5D_t * H5D_create(H5F_t *file, hid_t type_id,
const H5S_t *space, hid_t dcpl_id, hid_t dxpl_id);
static herr_t H5D_open_oid(H5D_t *dataset, hid_t dxpl_id);
static herr_t H5D_get_space_status(H5D_t *dset, H5D_space_status_t *allocation, hid_t dxpl_id);
@ -1174,9 +1175,12 @@ H5Dcreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
hid_t dcpl_id)
{
H5G_loc_t loc; /* Object location to insert dataset into */
H5G_loc_t dset_loc; /* Object location of the dataset */
H5F_t* file; /* File in which dataset is being created */
H5D_t *new_dset = NULL; /* New dataset's info */
const H5S_t *space; /* Dataspace for dataset */
hid_t ret_value; /* Return value */
hid_t dset_id = -1; /* New dataset's id */
hid_t ret_value; /* Return value */
FUNC_ENTER_API(H5Dcreate, FAIL)
H5TRACE5("i","isiii",loc_id,name,type_id,space_id,dcpl_id);
@ -1196,8 +1200,108 @@ H5Dcreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
if(TRUE != H5P_isa_class(dcpl_id, H5P_DATASET_CREATE))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset create property list ID")
/* What file is the dataset being added to? */
if(NULL == (file = H5G_insertion_file(&loc, name, H5AC_dxpl_id)))
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to locate insertion point")
/* build and open the new dataset */
if(NULL == (new_dset = H5D_create(&loc, name, type_id, space, dcpl_id, H5AC_dxpl_id)))
if(NULL == (new_dset = H5D_create(file, type_id, space, dcpl_id, H5AC_dxpl_id)))
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create dataset")
/* Register the new dataset to get an ID for it */
if((dset_id = H5I_register(H5I_DATASET, new_dset)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register dataset")
if(H5G_loc(dset_id, &dset_loc) <0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to get location for dataset")
/* Link the new dataset */
if( H5L_link(&loc, name, &dset_loc, H5AC_dxpl_id, H5P_DEFAULT) < 0)
HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to create link to dataset")
ret_value = dset_id;
done:
if(ret_value < 0) {
if(dset_id >= 0)
{
H5I_dec_ref(dset_id);
}
else
{
if(new_dset != NULL) {
if(H5D_close(new_dset) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset")
} /* end if */
} /* end if-else */
} /* end if */
FUNC_LEAVE_API(ret_value)
} /* end H5Dcreate() */
/*-------------------------------------------------------------------------
* Function: H5Dcreate_expand
*
* Purpose: Creates a new dataset named NAME at LOC_ID, opens the
* dataset for access, and associates with that dataset constant
* and initial persistent properties including the type of each
* datapoint as stored in the file (TYPE_ID), the size of the
* dataset (SPACE_ID), and other initial miscellaneous
* properties (DCPL_ID).
*
* All arguments are copied into the dataset, so the caller is
* allowed to derive new types, data spaces, and creation
* parameters from the old ones and reuse them in calls to
* create other datasets.
*
* The resulting ID should be linked into the file with
* H5Lcreate or it will be deleted when closed.
*
* Return: Success: The object ID of the new dataset. At this
* point, the dataset is ready to receive its
* raw data. Attempting to read raw data from
* the dataset will probably return the fill
* value. The dataset should be linked into
* the group hierarchy before being closed or
* it will be deleted. The dataset should be
* closed when the caller is no longer interested
* in it.
*
* Failure: FAIL
*
* Programmer: James Laird
* Tuesday, January 24, 2006
*
*-------------------------------------------------------------------------
*/
hid_t
H5Dcreate_expand(hid_t loc_id, hid_t type_id, hid_t space_id,
hid_t dcpl_id)
{
H5G_loc_t loc; /* Object location to insert dataset into */
H5D_t *new_dset = NULL; /* New dataset's info */
const H5S_t *space; /* Dataspace for dataset */
hid_t ret_value; /* Return value */
FUNC_ENTER_API(H5Dcreate_expand, FAIL)
H5TRACE4("i","iiii",loc_id,type_id,space_id,dcpl_id);
/* Check arguments */
if(H5G_loc(loc_id, &loc) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location ID")
if(H5I_DATATYPE != H5I_get_type(type_id))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype ID")
if(NULL == (space = H5I_object_verify(space_id,H5I_DATASPACE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace ID")
if(H5P_DEFAULT == dcpl_id)
dcpl_id = H5P_DATASET_CREATE_DEFAULT;
else
if(TRUE != H5P_isa_class(dcpl_id, H5P_DATASET_CREATE))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset create property list ID")
/* build and open the new dataset */
if(NULL == (new_dset = H5D_create(loc.oloc->file, type_id, space, dcpl_id, H5AC_dxpl_id)))
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create dataset")
/* Register the new dataset to get an ID for it */
@ -2030,14 +2134,13 @@ done:
*-------------------------------------------------------------------------
*/
static H5D_t *
H5D_create(H5G_loc_t *loc, const char *name, hid_t type_id, const H5S_t *space,
H5D_create(H5F_t *file, hid_t type_id, const H5S_t *space,
hid_t dcpl_id, hid_t dxpl_id)
{
const H5T_t *type; /* Datatype for dataset */
H5D_t *new_dset = NULL;
int i, ndims;
unsigned u;
H5F_t *file=NULL;
unsigned chunk_ndims = 0; /* Dimensionality of chunk */
H5P_genplist_t *dc_plist=NULL; /* New Property list */
hbool_t has_vl_type=FALSE; /* Flag to indicate a VL-type for dataset */
@ -2048,8 +2151,7 @@ H5D_create(H5G_loc_t *loc, const char *name, hid_t type_id, const H5S_t *space,
FUNC_ENTER_NOAPI(H5D_create, NULL)
/* check args */
HDassert(loc);
HDassert(name && *name);
HDassert(file);
HDassert(H5I_DATATYPE==H5I_get_type(type_id));
HDassert(space);
HDassert(H5I_GENPROP_LST==H5I_get_type(dcpl_id));
@ -2084,10 +2186,6 @@ H5D_create(H5G_loc_t *loc, const char *name, hid_t type_id, const H5S_t *space,
if(NULL == (new_dset->shared = H5D_new(dcpl_id,TRUE,has_vl_type)))
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* What file is the dataset being added to? */
if(NULL == (file = H5G_insertion_file(loc, name, dxpl_id)))
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to locate insertion point")
/* Copy datatype for dataset */
if(H5D_init_type(file, new_dset, type_id, type)<0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, NULL, "can't copy datatype")
@ -2306,18 +2404,11 @@ H5D_create(H5G_loc_t *loc, const char *name, hid_t type_id, const H5S_t *space,
if (H5D_get_dcpl_cache(new_dset->shared->dcpl_id,&new_dset->shared->dcpl_cache)<0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't fill DCPL cache")
/*
* Give the dataset a name. That is, create and add a new object to the
* group this dataset is being initially created in.
*/
if(H5G_insert(loc, name, &dset_loc, dxpl_id, dc_plist) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to name dataset")
/* Add the dataset to the list of opened objects in the file */
if(H5FO_top_incr(new_dset->oloc.file, new_dset->oloc.addr) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINC, NULL, "can't incr object ref. count")
if(H5FO_insert(new_dset->oloc.file, new_dset->oloc.addr, new_dset->shared) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, NULL, "can't insert dataset into list of open objects")
if(H5FO_insert(new_dset->oloc.file, new_dset->oloc.addr, new_dset->shared, TRUE) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, NULL, "can't insert dataset into list of open objects")
new_dset->shared->fo_count = 1;
@ -2410,7 +2501,7 @@ H5D_open(const H5G_loc_t *loc, hid_t dxpl_id)
HGOTO_ERROR(H5E_DATASET, H5E_NOTFOUND, NULL, "not found")
/* Add the dataset to the list of opened objects in the file */
if(H5FO_insert(dataset->oloc.file, dataset->oloc.addr, dataset->shared) < 0)
if(H5FO_insert(dataset->oloc.file, dataset->oloc.addr, dataset->shared, FALSE) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, NULL, "can't insert dataset into list of open objects")
/* Increment object count for the object in the top file */

View File

@ -111,6 +111,8 @@ H5_DLL herr_t H5Dfill(const void *fill, hid_t fill_type, void *buf,
hid_t buf_type, hid_t space);
H5_DLL herr_t H5Dset_extent(hid_t dset_id, const hsize_t *size);
H5_DLL herr_t H5Ddebug(hid_t dset_id);
H5_DLL hid_t H5Dcreate_expand(hid_t file_id, hid_t type_id,
hid_t space_id, hid_t plist_id);
#ifdef __cplusplus

View File

@ -115,7 +115,7 @@ hid_t H5E_NOENCODER_g = FAIL; /* Filter present but encoding disabled
hid_t H5E_CANTOPENOBJ_g = FAIL; /* Can't open object */
hid_t H5E_CANTCLOSEOBJ_g = FAIL; /* Can't close object */
hid_t H5E_COMPLEN_g = FAIL; /* Name component is too long */
hid_t H5E_LINK_g = FAIL; /* Link count failure */
hid_t H5E_LINK_g = FAIL; /* Link-related failure */
hid_t H5E_SLINK_g = FAIL; /* Symbolic link error */
hid_t H5E_PATH_g = FAIL; /* Problem with path to object */

View File

@ -414,7 +414,7 @@ if((msg = H5E_create_msg(cls, H5E_MINOR, "Name component is too long"))==NULL)
if((H5E_COMPLEN_g = H5I_register(H5I_ERROR_MSG, msg))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
assert(H5E_LINK_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MINOR, "Link count failure"))==NULL)
if((msg = H5E_create_msg(cls, H5E_MINOR, "Link failure"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_LINK_g = H5I_register(H5I_ERROR_MSG, msg))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")

View File

@ -145,7 +145,7 @@ H5FO_opened(const H5F_t *f, haddr_t addr)
H5F_t *f; IN/OUT: File's opened object info set
haddr_t addr; IN: Address of object to insert
void *obj; IN: Pointer to object to insert
int type; IN: Type of object being inserted
hbool_t delete_flag; IN: Whether to 'mark' this object for deletion
RETURNS
Returns a non-negative on success, negative on failure
@ -157,7 +157,7 @@ H5FO_opened(const H5F_t *f, haddr_t addr)
REVISION LOG
--------------------------------------------------------------------------*/
herr_t
H5FO_insert(const H5F_t *f, haddr_t addr, void *obj)
H5FO_insert(const H5F_t *f, haddr_t addr, void *obj, hbool_t delete_flag)
{
H5FO_open_obj_t *open_obj; /* Information about open object */
herr_t ret_value=SUCCEED; /* Return value */
@ -178,7 +178,7 @@ H5FO_insert(const H5F_t *f, haddr_t addr, void *obj)
/* Assign information */
open_obj->addr=addr;
open_obj->obj=obj;
open_obj->deleted=0;
open_obj->deleted=delete_flag;
/* Insert into container */
if(H5SL_insert(f->shared->open_objs,&open_obj->addr,open_obj)<0)
@ -289,7 +289,7 @@ H5FO_mark(const H5F_t *f, haddr_t addr, hbool_t deleted)
PURPOSE
Check if an object is marked to be deleted when it is closed
USAGE
htri_t H5FO_mark(f,addr)
htri_t H5FO_marked(f,addr)
const H5F_t *f; IN: File opened object is in
haddr_t addr; IN: Address of object to delete

View File

@ -37,7 +37,7 @@ typedef H5SL_t H5FO_t; /* Currently, all open objects are stored in skip l
/* Private routines */
H5_DLL herr_t H5FO_create(const H5F_t *f);
H5_DLL void *H5FO_opened(const H5F_t *f, haddr_t addr);
H5_DLL herr_t H5FO_insert(const H5F_t *f, haddr_t addr, void *obj);
H5_DLL herr_t H5FO_insert(const H5F_t *f, haddr_t addr, void *obj, hbool_t delete_flag);
H5_DLL herr_t H5FO_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr);
H5_DLL herr_t H5FO_mark(const H5F_t *f, haddr_t addr, hbool_t deleted);
H5_DLL htri_t H5FO_marked(const H5F_t *f, haddr_t addr);

1010
src/H5G.c

File diff suppressed because it is too large Load Diff

193
src/H5Gdeprec.c Normal file
View File

@ -0,0 +1,193 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*-------------------------------------------------------------------------
*
* Created: H5Gdeprec.c
* June 21 2006
* James Laird <jlaird@ncsa.uiuc.edu>
*
* Purpose: Deprecated functions from the H5G interface. These
* functions are here for compatibility purposes and may be
* removed in the future. Applications should switch to the
* newer APIs.
*
*-------------------------------------------------------------------------
*/
/* Packages needed by this file... */
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5Gpublic.h" /* Public Group APIs */
#include "H5Lpublic.h" /* Public Link APIs */
#include "H5Ppublic.h" /* Property lists */
/*-------------------------------------------------------------------------
* Function: H5Glink
*
* Purpose: Creates a link between two existing objects. The new
* APIs to do this are H5Lcreate_hard and H5Lcreate_soft.
*
*-------------------------------------------------------------------------
*/
herr_t
H5Glink(hid_t cur_loc_id, H5L_link_t type, const char *cur_name, const char *new_name)
{
herr_t ret_value;
FUNC_ENTER_API(H5Glink, FAIL)
H5TRACE4("e","iLlss",cur_loc_id,type,cur_name,new_name);
if(type == H5L_LINK_HARD)
{
if((ret_value = H5Lcreate_hard(cur_loc_id, cur_name, H5L_SAME_LOC, new_name, H5P_DEFAULT)) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "Couldn't create link")
}
else if(type == H5L_LINK_SOFT)
{
if((ret_value = H5Lcreate_soft(cur_name, cur_loc_id, new_name, H5P_DEFAULT)) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "Couldn't create link")
}
else
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Not a valid link type")
done:
FUNC_LEAVE_API(ret_value)
}
/*-------------------------------------------------------------------------
* Function: H5Glink2
*
* Purpose: Creates a link between two existing objects. The new
* API to do this is H5Llink.
*
*-------------------------------------------------------------------------
*/
H5Glink2(hid_t cur_loc_id, const char *cur_name,
H5L_link_t type, hid_t new_loc_id, const char *new_name)
{
herr_t ret_value;
FUNC_ENTER_API(H5Glink2, FAIL)
if(type == H5L_LINK_HARD)
{
if((ret_value = H5Lcreate_hard(cur_loc_id, cur_name, new_loc_id, new_name, H5P_DEFAULT)) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "Couldn't create link")
}
else if(type == H5L_LINK_SOFT)
{
/* Soft links only need one location, the new_loc_id, but it's possible that
* new_loc_id is H5L_SAME_LOC */
if(new_loc_id == H5L_SAME_LOC)
new_loc_id = cur_loc_id;
if((ret_value = H5Lcreate_soft(cur_name, new_loc_id, new_name, H5P_DEFAULT)) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "Couldn't create link")
}
else
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Not a valid link type")
done:
FUNC_LEAVE_API(ret_value)
}
/*-------------------------------------------------------------------------
* Function: H5Gmove
*
* Purpose: Moves and renames a link. The new API to do this is H5Lmove.
*
*-------------------------------------------------------------------------
*/
herr_t
H5Gmove(hid_t src_loc_id, const char *src_name, const char *dst_name)
{
herr_t ret_value;
FUNC_ENTER_API(H5Gmove, FAIL)
H5TRACE3("e","iss",src_loc_id,src_name,dst_name);
if((ret_value=H5Lmove(src_loc_id, src_name, H5L_SAME_LOC, dst_name, H5P_DEFAULT)) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "Couldn't move link")
done:
FUNC_LEAVE_API(ret_value)
}
/*-------------------------------------------------------------------------
* Function: H5Gmove2
*
* Purpose: Moves and renames a link. The new API to do this is H5Lmove.
*
*-------------------------------------------------------------------------
*/
herr_t H5Gmove2(hid_t src_loc_id, const char *src_name,
hid_t dst_loc_id, const char *dst_name)
{
herr_t ret_value;
FUNC_ENTER_API(H5Gmove2, FAIL)
if((ret_value=H5Lmove(src_loc_id, src_name, dst_loc_id, dst_name, H5P_DEFAULT)) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "Couldn't move link")
done:
FUNC_LEAVE_API(ret_value)
}
/*-------------------------------------------------------------------------
* Function: H5Gunlink
*
* Purpose: Removes a link. The new API is H5Lunlink.
*
*-------------------------------------------------------------------------
*/
herr_t
H5Gunlink(hid_t loc_id, const char *name)
{
herr_t ret_value;
FUNC_ENTER_API(H5Gunlink, FAIL)
H5TRACE2("e","is",loc_id,name);
if((ret_value=H5Lunlink(loc_id, name)) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "Couldn't delete link")
done:
FUNC_LEAVE_API(ret_value)
}
/*-------------------------------------------------------------------------
* Function: H5Gget_linkval
*
* Purpose: Retrieve's a soft link's data. The new API is
* H5Lget_linkval.
*
*-------------------------------------------------------------------------
*/
herr_t H5Gget_linkval(hid_t loc_id, const char *name,
size_t size, char *buf/*out*/)
{
herr_t ret_value;
FUNC_ENTER_API(H5Gget_linkval, FAIL)
if((ret_value=H5Lget_linkval(loc_id, name, size, buf)) < 0)
HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "Couldn't get link info")
done:
FUNC_LEAVE_API(ret_value)
}

View File

@ -28,6 +28,7 @@
#include "H5Gpkg.h" /* Groups */
#include "H5HLprivate.h" /* Local Heaps */
#include "H5Iprivate.h" /* IDs */
#include "H5MMprivate.h" /* Memory Management */
/* Private macros */
#define H5G_NO_CHANGE (-1) /*see H5G_ent_modified() */
@ -436,12 +437,12 @@ H5G_ent_convert(H5F_t *f, haddr_t heap_addr, const char *name, const H5O_link_t
/* Build correct information for symbol table entry based on link type */
switch(lnk->type) {
case H5G_LINK_HARD:
case H5L_LINK_HARD:
ent->type = H5G_NOTHING_CACHED;
ent->header = lnk->u.hard.addr;
break;
case H5G_LINK_SOFT:
case H5L_LINK_SOFT:
{
size_t lnk_offset; /* Offset to sym-link value */

View File

@ -296,7 +296,7 @@ H5G_link_convert(H5O_link_t *lnk, const H5G_entry_t *ent, const H5HL_t *heap,
/* Create link message from object entry */
HDassert(ent->type == H5G_NOTHING_CACHED || ent->type == H5G_CACHED_SLINK);
/* XXX: Set character set & creation time for real? */
lnk->cset = H5T_CSET_ASCII;
lnk->cset = H5F_CRT_DEFAULT_CSET;
lnk->ctime = 0;
lnk->name = H5MM_xstrdup(name); /* Casting away const OK -QAK */
HDassert(lnk->name);

View File

@ -370,7 +370,7 @@ H5G_loc_insert(H5G_loc_t *grp_loc, const char *name, H5G_loc_t *obj_loc,
HDassert(obj_loc);
/* "Translate" object location into link object */
lnk.type = H5G_LINK_HARD;
lnk.type = H5L_LINK_HARD;
#ifdef H5_HAVE_GETTIMEOFDAY
{
struct timeval now_tv;
@ -381,7 +381,7 @@ H5G_loc_insert(H5G_loc_t *grp_loc, const char *name, H5G_loc_t *obj_loc,
#else /* H5_HAVE_GETTIMEOFDAY */
lnk.ctime = HDtime(NULL);
#endif /* H5_HAVE_GETTIMEOFDAY */
lnk.cset = H5T_CSET_ASCII; /* XXX: Allow user to set this */
lnk.cset = H5F_CRT_DEFAULT_CSET;
/* Casting away const OK -QAK */
lnk.name = (char *)name;
lnk.u.hard.addr = obj_loc->oloc->addr;
@ -397,7 +397,6 @@ H5G_loc_insert(H5G_loc_t *grp_loc, const char *name, H5G_loc_t *obj_loc,
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5G_loc_insert() */
/*-------------------------------------------------------------------------
* Function: H5G_loc_exists

View File

@ -814,6 +814,7 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key)
/* Make certain that the source and destination names are full (not relative) paths */
src_path_r = H5RS_dup(names->loc->path->full_path_r);
if(*(H5RS_get_str(names->dst_name)) != '/') {
HDassert(names->dst_loc && names->dst_loc->path);
/* Create reference counted string for full dst path */
if((dst_path_r = H5G_build_fullpath_refstr_refstr(names->dst_loc->path->full_path_r, names->dst_name)) == NULL)
HGOTO_ERROR(H5E_SYM, H5E_PATH, FAIL, "can't build destination path name")
@ -891,6 +892,9 @@ H5G_name_replace(H5G_obj_t type, H5G_loc_t *loc,
FUNC_ENTER_NOAPI(H5G_name_replace, FAIL)
/* Check arguments */
HDassert(loc && loc->path);
/* Check if the object we are manipulating has a path */
if(loc->path->full_path_r) {
unsigned search_group = 0; /* Flag to indicate that groups are to be searched */

View File

@ -1987,14 +1987,14 @@ H5G_node_copy(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr,
HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, H5B_ITER_ERROR, "unable to copy object")
/* Construct link information for eventual insertion */
lnk.type = H5G_LINK_HARD;
lnk.type = H5L_LINK_HARD;
lnk.u.hard.addr = new_oloc.addr;
} /* ( H5F_addr_defined(src_ent->header)) */
else if(H5G_CACHED_SLINK == src_ent->type) {
/* it is a soft link */
/* Construct link information for eventual insertion */
lnk.type = H5G_LINK_SOFT;
lnk.type = H5L_LINK_SOFT;
lnk.u.soft.name = H5HL_offset_into(f, heap, src_ent->cache.slink.lval_offset);
} /* else if */
else
@ -2011,7 +2011,7 @@ H5G_node_copy(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr,
#else /* H5_HAVE_GETTIMEOFDAY */
lnk.ctime = HDtime(NULL);
#endif /* H5_HAVE_GETTIMEOFDAY */
lnk.cset = H5T_CSET_ASCII; /* XXX: Allow user to set this */
lnk.cset = H5F_CRT_DEFAULT_CSET; /* XXX: Allow user to set this */
/* lnk.name = name; */ /* This will be set in callback */
/* Determine name of source object */

View File

@ -33,6 +33,7 @@
#include "H5Gpkg.h" /* Groups */
#include "H5HLprivate.h" /* Local Heaps */
#include "H5Iprivate.h" /* IDs */
#include "H5Lprivate.h" /* Links */
#include "H5MMprivate.h" /* Memory management */
/* Private typedefs */
@ -113,7 +114,7 @@ H5G_obj_create(H5F_t *f, hid_t dxpl_id,
ginfo_size = H5O_mesg_size(H5O_GINFO_ID, f, ginfo);
HDassert(ginfo_size);
lnk.type = H5G_LINK_HARD;
lnk.type = H5L_LINK_HARD;
lnk.name = &null_char;
link_size = H5O_mesg_size(H5O_LINK_ID, f, &lnk);
HDassert(link_size);
@ -776,7 +777,7 @@ H5G_obj_remove(H5O_loc_t *oloc, const char *name, H5G_obj_t *obj_type, hid_t dxp
/* Release memory for link names (and memory for soft link values) */
for(u = 0; u < linfo.nlinks; u++) {
H5MM_xfree(lnk_table[u].name);
if(lnk_table[u].type == H5G_LINK_SOFT)
if(lnk_table[u].type == H5L_LINK_SOFT)
H5MM_xfree(lnk_table[u].u.soft.name);
} /* end for */

View File

@ -245,7 +245,7 @@ typedef struct {
} H5G_linkvalue_soft_t;
typedef struct {
H5G_link_t type; /* Type of link */
H5L_link_t type; /* Type of link */
union {
H5G_linkvalue_hard_t hard; /* Information for hard link */
H5G_linkvalue_soft_t soft; /* Information for soft link */
@ -273,6 +273,7 @@ H5_DLLVAR const H5AC_class_t H5AC_SNODE[1];
/*
* Utility functions
*/
H5_DLL char * H5G_normalize(const char *name);
H5_DLL H5G_t *H5G_rootof(H5F_t *f);
H5_DLL const char * H5G_component(const char *name, size_t *size_p);
H5_DLL herr_t H5G_traverse_term_interface(void);
@ -319,6 +320,8 @@ H5_DLL herr_t H5G_ent_convert(H5F_t *f, haddr_t heap_addr, const char *name,
H5_DLL herr_t H5G_ent_debug(H5F_t *f, hid_t dxpl_id, const H5G_entry_t *ent, FILE * stream,
int indent, int fwidth, haddr_t heap);
struct H5HL_t; /* defined in H5HLprivate.h */
/* Functions that understand symbol table nodes */
H5_DLL herr_t H5G_node_init(H5F_t *f);
H5_DLL int H5G_node_iterate (H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr,

View File

@ -74,21 +74,15 @@
H5G_CRT_GINFO_EST_NUM_ENTRIES, \
H5G_CRT_GINFO_EST_NAME_LEN}
/* Definitions for creating intermediate groups */
#define H5G_CRT_INTERMEDIATE_GROUP_NAME "intermediate_group"
#define H5G_CRT_INTERMEDIATE_GROUP_SIZE sizeof(unsigned)
#define H5G_CRT_INTERMEDIATE_GROUP_DEF 0
/* definitions for copying objects */
#define H5G_CPY_OPTION_NAME "copy object"
#define H5G_CPY_OPTION_SIZE sizeof(unsigned)
#define H5G_CPY_OPTION_DEF 0
/* Type of operation being performed for call to H5G_name_replace() */
typedef enum {
H5G_NAME_MOVE = 0, /* H5*move call */
H5G_NAME_UNLINK, /* H5Gunlink call */
H5G_NAME_UNLINK, /* H5Lunlink call */
H5G_NAME_MOUNT, /* H5Fmount call */
H5G_NAME_UNMOUNT /* H5Funmount call */
} H5G_names_op_t;
@ -128,8 +122,6 @@ H5_DLL H5F_t *H5G_fileof(H5G_t *grp);
H5_DLL herr_t H5G_free(H5G_t *grp);
H5_DLL H5G_t *H5G_open(H5G_loc_t *loc, hid_t dxpl_id);
H5_DLL herr_t H5G_close(H5G_t *grp);
H5_DLL herr_t H5G_insert(H5G_loc_t *loc, const char *name,
H5G_loc_t *obj_loc, hid_t dxpl_id, struct H5P_genplist_t *oc_plist);
H5_DLL herr_t H5G_get_objinfo(const H5G_loc_t *loc, const char *name,
hbool_t follow_link, H5G_stat_t *statbuf/*out*/, hid_t dxpl_id);
H5_DLL H5F_t *H5G_insertion_file(H5G_loc_t *loc, const char *name, hid_t dxpl_id);

View File

@ -31,6 +31,7 @@
#include "H5public.h"
#include "H5Ipublic.h"
#include "H5Lpublic.h"
#include "H5Opublic.h"
#include "H5Tpublic.h"
@ -38,13 +39,6 @@
extern "C" {
#endif
/* Types of links */
typedef enum H5G_link_t {
H5G_LINK_ERROR = -1,
H5G_LINK_HARD = 0,
H5G_LINK_SOFT = 1
} H5G_link_t;
/*
* An object has a certain type. The first few numbers are reserved for use
* internally by HDF5. Users may add their own types with higher values. The
@ -105,17 +99,10 @@ typedef struct H5G_stat_t {
} H5G_stat_t;
#endif /* QAK */
#define H5G_SAME_LOC 0
#define H5Glink(cur_loc_id, type, cur_name, new_name) \
H5Glink2(cur_loc_id, cur_name, type, H5G_SAME_LOC, new_name)
#define H5Gmove(src_loc_id, src_name, dst_name) \
H5Gmove2(src_loc_id, src_name, H5G_SAME_LOC, dst_name)
typedef herr_t (*H5G_iterate_t)(hid_t group, const char *name,
void *op_data);
/* Flags for object copy (H5Gcopy) */
#define H5G_COPY_CREATE_INTERMEDIATE_GROUP_FLAG (0x0001u) /* Create missing groups when create a group */
#define H5G_COPY_SHALLOW_HIERARCHY_FLAG (0x0002u) /* Copy only immediate members */
#define H5G_COPY_EXPAND_SOFT_LINK_FLAG (0x0004u) /* Expand soft links into new objects */
#define H5G_COPY_EXPAND_EXT_LINK_FLAG (0x0008u) /* Expand external links into new objects */
@ -131,26 +118,41 @@ H5_DLL herr_t H5Giterate(hid_t loc_id, const char *name, int *idx,
H5_DLL herr_t H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs);
H5_DLL ssize_t H5Gget_objname_by_idx(hid_t loc_id, hsize_t idx, char* name, size_t size);
H5_DLL H5G_obj_t H5Gget_objtype_by_idx(hid_t loc_id, hsize_t idx);
H5_DLL herr_t H5Gmove2(hid_t src_loc, const char *src, hid_t dst_loc,
const char *dst);
H5_DLL herr_t H5Glink2(hid_t src_loc, const char *cur_name, H5G_link_t type,
hid_t dst_loc, const char *new_name);
H5_DLL herr_t H5Gunlink(hid_t loc_id, const char *name);
H5_DLL herr_t H5Gget_objinfo(hid_t loc_id, const char *name,
hbool_t follow_link, H5G_stat_t *statbuf/*out*/);
H5_DLL herr_t H5Gget_linkval(hid_t loc_id, const char *name, size_t size,
char *buf/*out*/);
H5_DLL herr_t H5Gset_comment(hid_t loc_id, const char *name,
const char *comment);
H5_DLL int H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize,
char *buf);
#ifdef H5_GROUP_REVISION
H5_DLL hid_t H5Gcreate_expand(hid_t loc_id, const char *name, hid_t gcpl_id,
H5_DLL hid_t H5Gcreate_expand(hid_t loc_id, hid_t gcpl_id,
hid_t gapl_id);
H5_DLL hid_t H5Gget_create_plist(hid_t group_id);
#endif /* H5_GROUP_REVISION */
H5_DLL herr_t H5Gcopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id,
const char *dst_name, hid_t plist_id);
const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id);
/* Functions and variables defined for compatibility with previous versions
* of the HDF5 API.
* Use of these functions and variables is depreciated.
*/
H5_DLL herr_t H5Glink(hid_t cur_loc_id, H5L_link_t type,
const char *cur_name, const char *new_name);
H5_DLL herr_t H5Gmove(hid_t src_loc_id, const char *src_name,
const char *dst_name);
H5_DLL herr_t H5Glink2(hid_t cur_loc_id, const char *cur_name,
H5L_link_t type, hid_t new_loc_id, const char *new_name);
H5_DLL herr_t H5Gmove2(hid_t src_loc_id, const char *src_name,
hid_t dst_loc_id, const char *dst_name);
H5_DLL herr_t H5Gunlink(hid_t loc_id, const char *name);
H5_DLL herr_t H5Gget_linkval(hid_t loc_id, const char *name,
size_t size, char *buf/*out*/);
#define H5G_LINK_ERROR H5L_LINK_ERROR
#define H5G_LINK_HARD H5L_LINK_HARD
#define H5G_LINK_SOFT H5L_LINK_SOFT
#define H5G_link_t H5L_link_t
#define H5G_SAME_LOC H5L_SAME_LOC
#ifdef __cplusplus
}

View File

@ -604,7 +604,7 @@ H5G_stab_lookup_cb(const H5G_entry_t *ent, void *_udata)
/* Set link info */
if(udata->lnk) {
/* Set (default) common info for link */
udata->lnk->cset = H5T_CSET_ASCII;
udata->lnk->cset = H5F_CRT_DEFAULT_CSET;
udata->lnk->ctime = 0;
udata->lnk->name = H5MM_xstrdup(udata->name);
@ -627,14 +627,14 @@ H5G_stab_lookup_cb(const H5G_entry_t *ent, void *_udata)
HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to read unprotect link value")
/* Set link type */
udata->lnk->type = H5G_LINK_SOFT;
udata->lnk->type = H5L_LINK_SOFT;
} /* end if */
else {
/* Set address of object */
udata->lnk->u.hard.addr = ent->header;
/* Set link type */
udata->lnk->type = H5G_LINK_HARD;
udata->lnk->type = H5L_LINK_HARD;
} /* end else */
} /* end if */

View File

@ -32,7 +32,9 @@
#include "H5Fpkg.h" /* File access */
#include "H5Gpkg.h" /* Groups */
#include "H5HLprivate.h" /* Local Heaps */
#include "H5Lprivate.h" /* Links */
#include "H5MMprivate.h" /* Memory management */
#include "H5Ppublic.h" /* Property Lists */
/* Private typedefs */
@ -163,7 +165,7 @@ H5G_traverse_slink(H5G_loc_t *grp_loc/*in,out*/, H5O_link_t *lnk,
/* Sanity check */
HDassert(grp_loc);
HDassert(lnk);
HDassert(lnk->type == H5G_LINK_SOFT);
HDassert(lnk->type == H5L_LINK_SOFT);
HDassert(nlinks);
/* Set up temporary location */
@ -423,7 +425,7 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target,
/* Set the object location, if it's a hard link set the address also */
obj_loc.oloc->file = grp_loc.oloc->file;
if(lnk.type == H5G_LINK_HARD)
if(lnk.type == H5L_LINK_HARD)
obj_loc.oloc->addr = lnk.u.hard.addr;
obj_loc_valid = TRUE;
@ -432,7 +434,7 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target,
* is the last component of the name and the H5G_TARGET_SLINK bit of
* TARGET is set then we don't follow it.
*/
if(H5G_LINK_SOFT == lnk.type &&
if(H5L_LINK_SOFT == lnk.type &&
(0 == (target & H5G_TARGET_SLINK) || !last_comp)) {
if((*nlinks)-- <= 0)
HGOTO_ERROR(H5E_SYM, H5E_LINK, FAIL, "too many links")
@ -506,7 +508,6 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target,
/* Insert new group into current group's symbol table */
if(H5G_loc_insert(&grp_loc, H5G_comp_g, &obj_loc, TRUE, dxpl_id) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert intermediate group")
/* Close new group */
if(H5O_close(obj_loc.oloc) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to close")

View File

@ -152,7 +152,7 @@ HDfprintf(stderr, "%s: hdr->id_len = %Zu\n", FUNC, hdr->id_len);
hdr = NULL;
/* Add heap to list of open objects in file */
if(H5FO_insert(f, fh->hdr->heap_addr, fh) < 0)
if(H5FO_insert(f, fh->hdr->heap_addr, fh, FALSE) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, NULL, "can't insert heap into list of open objects")
/* Set open object count */
@ -228,7 +228,7 @@ HDfprintf(stderr, "%s: hdr->rc = %u\n", FUNC, hdr->rc);
HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared heap header")
/* Add heap to list of open objects in file */
if(H5FO_insert(f, fh->hdr->heap_addr, fh) < 0)
if(H5FO_insert(f, fh->hdr->heap_addr, fh, FALSE) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, NULL, "can't insert heap into list of open objects")
/* Set open object count */

1547
src/H5L.c Normal file

File diff suppressed because it is too large Load Diff

36
src/H5Lpkg.h Normal file
View File

@ -0,0 +1,36 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* Programmer: James Laird <matzke@llnl.gov>
* Friday, December 1, 2005
*
* Purpose: This file contains declarations which are visible
* only within the H5L package. Source files outside the
* H5L package should include H5Lprivate.h instead.
*/
#ifndef H5L_PACKAGE
#error "Do not include this file outside the H5L package!"
#endif
#ifndef _H5Lpkg_H
#define _H5Lpkg_H
/* Get package's private header */
#include "H5Lprivate.h"
#endif /* _H5Lpkg_H */

43
src/H5Lprivate.h Normal file
View File

@ -0,0 +1,43 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* This file contains private information about the H5DL module
* for dealing with links in an HDF5 file.
*/
#ifndef _H5Lprivate_H
#define _H5Lprivate_H
/* Include package's public header */
#include "H5Lpublic.h"
/* Private headers needed by this file */
#include "H5Gprivate.h"
#include "H5Oprivate.h"
/* Definitions for creating intermediate groups */
#define H5L_CRT_INTERMEDIATE_GROUP_NAME "intermediate_group"
#define H5L_CRT_INTERMEDIATE_GROUP_SIZE sizeof(unsigned)
#define H5L_CRT_INTERMEDIATE_GROUP_DEF 0
/* Functions that understand link messages */
/* forward reference for later use */
struct H5HL_t; /* defined in H5HLprivate.h */
H5_DLL herr_t H5L_link(H5G_loc_t *new_loc, const char *new_name,
H5G_loc_t *obj_loc, hid_t dxpl, hid_t lcpl_id);
H5_DLL hid_t H5L_get_default_lcpl();
#endif /* _H5Lprivate_H */

78
src/H5Lpublic.h Normal file
View File

@ -0,0 +1,78 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*-------------------------------------------------------------------------
*
* Created: H5Lpublic.h
* Dec 1 2005
* James Laird
*
* Purpose: Public declarations for the H5L package (links)
*
*-------------------------------------------------------------------------
*/
#ifndef _H5Lpublic_H
#define _H5Lpublic_H
/* Public headers needed by this file */
#include "H5public.h"
#include "H5Ipublic.h"
#include "H5Tpublic.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Types of links */
typedef enum H5L_link_t {
H5L_LINK_ERROR = -1,
H5L_LINK_HARD = 0,
H5L_LINK_SOFT = 1
} H5L_link_t;
/* Metadata buffer for user query function */
typedef struct H5L_linkinfo_t {
H5T_cset_t cset; /* Character set of link name */
time_t ctime; /* Creation time */
H5L_link_t linkclass; /* Type of link */
union {
haddr_t objno; /* Data stored in a hard link */
size_t link_size; /* Size of a soft link */
} u;
} H5L_linkinfo_t;
#define H5L_SAME_LOC 0
H5_DLL herr_t H5Llink(hid_t cur_loc_id, const char *cur_name,
hid_t obj_id, hid_t lcpl_id);
H5_DLL herr_t H5Lmove(hid_t src_loc, const char *src_name, hid_t dst_loc,
const char *dst_name, hid_t lcpl_id);
H5_DLL herr_t H5Lcopy(hid_t src_loc, const char *src_name, hid_t dst_loc,
const char *dst_name, hid_t lcpl_id);
H5_DLL herr_t H5Lcreate_hard(hid_t cur_loc, const char *cur_name,
hid_t dst_loc, const char *dst_name, hid_t lcpl_id);
H5_DLL herr_t H5Lcreate_soft(const char *target_path, hid_t loc,
const char *name, hid_t lcpl_id);
H5_DLL herr_t H5Lunlink(hid_t loc_id, const char *name);
H5_DLL herr_t H5Lget_linkval(hid_t loc_id, const char *name, size_t size,
char *buf/*out*/);
H5_DLL herr_t H5Lget_linkinfo(hid_t loc_id, const char *name,
H5L_linkinfo_t *linkbuf /*out*/);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -38,7 +38,6 @@
/* PRIVATE PROTOTYPES */
static void *H5O_link_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p);
static herr_t H5O_link_encode(H5F_t *f, uint8_t *p, const void *_mesg);
static void *H5O_link_copy(const void *_mesg, void *_dest, unsigned update_flags);
static size_t H5O_link_size(const H5F_t *f, const void *_mesg);
static herr_t H5O_link_reset(void *_mesg);
static herr_t H5O_link_free(void *_mesg);
@ -76,9 +75,12 @@ const H5O_msg_class_t H5O_MSG_LINK[1] = {{
/* Current version of link information */
#define H5O_LINK_VERSION 1
#endif /* H5_GROUP_REVISION */
/* Declare a free list to manage the H5O_link_t struct */
H5FL_DEFINE_STATIC(H5O_link_t);
#ifdef H5_GROUP_REVISION
/*-------------------------------------------------------------------------
* Function: H5O_link_decode
@ -122,7 +124,7 @@ H5O_link_decode(H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *p)
/* Get the type of the link */
lnk->type = *p++;
if(lnk->type < H5G_LINK_HARD || lnk->type > H5G_LINK_SOFT)
if(lnk->type < H5L_LINK_HARD || lnk->type > H5L_LINK_SOFT)
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad link type")
/* Get the link creation time from the file */
@ -146,12 +148,12 @@ H5O_link_decode(H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *p)
/* Get the appropriate information for each type of link */
switch(lnk->type) {
case H5G_LINK_HARD:
case H5L_LINK_HARD:
/* Get the address of the object the link points to */
H5F_addr_decode(f, &p, &(lnk->u.hard.addr));
break;
case H5G_LINK_SOFT:
case H5L_LINK_SOFT:
/* Get the link value */
UINT16DECODE(p, len)
if(len == 0)
@ -176,7 +178,7 @@ done:
if(lnk != NULL) {
if(lnk->name != NULL)
H5MM_xfree(lnk->name);
if(lnk->type == H5G_LINK_SOFT && lnk->u.soft.name != NULL)
if(lnk->type == H5L_LINK_SOFT && lnk->u.soft.name != NULL)
H5MM_xfree(lnk->u.soft.name);
H5FL_FREE(H5O_link_t, lnk);
} /* end if */
@ -236,12 +238,12 @@ H5O_link_encode(H5F_t *f, uint8_t *p, const void *_mesg)
/* Store the appropriate information for each type of link */
switch(lnk->type) {
case H5G_LINK_HARD:
case H5L_LINK_HARD:
/* Store the address of the object the link points to */
H5F_addr_encode(f, &p, lnk->u.hard.addr);
break;
case H5G_LINK_SOFT:
case H5L_LINK_SOFT:
/* Store the link value */
len = (uint16_t)HDstrlen(lnk->u.soft.name);
HDassert(len > 0);
@ -251,12 +253,13 @@ H5O_link_encode(H5F_t *f, uint8_t *p, const void *_mesg)
break;
default:
HDassert((lnk->type == H5G_LINK_HARD) || (lnk->type == H5G_LINK_SOFT));
HDassert((lnk->type == H5L_LINK_HARD) || (lnk->type == H5L_LINK_SOFT));
break;
} /* end switch */
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5O_link_encode() */
#endif /* H5_GROUP_REVISION */
/*-------------------------------------------------------------------------
@ -277,7 +280,7 @@ H5O_link_encode(H5F_t *f, uint8_t *p, const void *_mesg)
*
*-------------------------------------------------------------------------
*/
static void *
void *
H5O_link_copy(const void *_mesg, void *_dest, unsigned UNUSED update_flags)
{
const H5O_link_t *lnk = (const H5O_link_t *) _mesg;
@ -295,7 +298,7 @@ H5O_link_copy(const void *_mesg, void *_dest, unsigned UNUSED update_flags)
*dest = *lnk;
HDassert(lnk->name);
dest->name = H5MM_xstrdup(lnk->name);
if(lnk->type == H5G_LINK_SOFT)
if(lnk->type == H5L_LINK_SOFT)
dest->u.soft.name = H5MM_xstrdup(lnk->u.soft.name);
/* Set return value */
@ -306,6 +309,7 @@ done:
} /* end H5O_link_copy() */
#ifdef H5_GROUP_REVISION
/*-------------------------------------------------------------------------
* Function: H5O_link_size
*
@ -341,17 +345,17 @@ H5O_link_size(const H5F_t *f, const void *_mesg)
/* Add the appropriate length for each type of link */
switch(lnk->type) {
case H5G_LINK_HARD:
case H5L_LINK_HARD:
ret_value += H5F_SIZEOF_ADDR(f);
break;
case H5G_LINK_SOFT:
case H5L_LINK_SOFT:
ret_value += 2 + /* Link value length */
HDstrlen(lnk->u.soft.name); /* Link value */
break;
default:
HDassert((lnk->type == H5G_LINK_HARD) || (lnk->type == H5G_LINK_SOFT));
HDassert((lnk->type == H5L_LINK_HARD) || (lnk->type == H5L_LINK_SOFT));
break;
} /* end switch */
@ -381,7 +385,7 @@ H5O_link_reset(void *_mesg)
if(lnk) {
/* Free information for link (but don't free link pointer) */
if(lnk->type == H5G_LINK_SOFT)
if(lnk->type == H5L_LINK_SOFT)
lnk->u.soft.name = H5MM_xfree(lnk->u.soft.name);
lnk->name = H5MM_xfree(lnk->name);
} /* end if */
@ -444,7 +448,7 @@ H5O_link_delete(H5F_t *f, hid_t dxpl_id, const void *_mesg, hbool_t adj_link)
HDassert(lnk);
/* Decrement reference count to the object, for hard links */
if(lnk->type == H5G_LINK_HARD) {
if(lnk->type == H5L_LINK_HARD) {
H5O_loc_t oloc;
/* Construct object location for object, in order to decrement it's ref count */
@ -545,12 +549,12 @@ H5O_link_copy_file(H5F_t UNUSED *file_src, void *native_src, H5F_t UNUSED *file_
/* "Deep copy" other information for each kind of link */
switch(link_src->type) {
case H5G_LINK_HARD:
case H5L_LINK_HARD:
/* Set link's address undefined here, will be fixed up in "post copy" callback */
link_dst->u.hard.addr = HADDR_UNDEF;
break;
case H5G_LINK_SOFT:
case H5L_LINK_SOFT:
/* Copy the soft link's value */
if(NULL == (link_dst->u.soft.name = H5MM_xstrdup(link_src->u.soft.name)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
@ -641,7 +645,7 @@ H5O_link_post_copy_file(const H5O_loc_t *parent_src_oloc, const void *mesg_src,
/* Additional "deep copy" for each kind of link */
switch(link_src->type) {
case H5G_LINK_HARD:
case H5L_LINK_HARD:
/* Copy the object pointed to */
{
H5O_loc_t src_oloc; /* Temporary object location for source object */
@ -669,7 +673,7 @@ H5O_link_post_copy_file(const H5O_loc_t *parent_src_oloc, const void *mesg_src,
} /* end case */
break;
case H5G_LINK_SOFT:
case H5L_LINK_SOFT:
HGOTO_DONE(SUCCEED)
break;
@ -715,8 +719,8 @@ H5O_link_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE *
HDassert(fwidth >= 0);
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
"Link Type:", (lnk->type == H5G_LINK_HARD ? "Hard" :
(lnk->type == H5G_LINK_SOFT ? "Soft" : "Unknown")));
"Link Type:", (lnk->type == H5L_LINK_HARD ? "Hard" :
(lnk->type == H5L_LINK_SOFT ? "Soft" : "Unknown")));
tm = HDlocaltime(&(lnk->ctime));
HDstrftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S %Z", tm);
@ -730,12 +734,12 @@ H5O_link_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE *
"Link Name:", lnk->name);
switch(lnk->type) {
case H5G_LINK_HARD:
case H5L_LINK_HARD:
HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth,
"Object address:", lnk->u.hard.addr);
break;
case H5G_LINK_SOFT:
case H5L_LINK_SOFT:
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
"Link Value:", lnk->u.soft.name);
break;

View File

@ -39,6 +39,7 @@
#include "H5SLprivate.h" /* Skip lists */
#include "H5Tprivate.h" /* Datatype functions */
#include "H5Zprivate.h" /* I/O pipeline filters */
#include "H5Lpublic.h" /* Link functions */
/* Forward references of package typedefs */
typedef struct H5O_msg_class_t H5O_msg_class_t;
@ -153,7 +154,7 @@ typedef struct H5O_link_soft_t {
} H5O_link_soft_t;
typedef struct H5O_link_t {
H5G_link_t type; /* Type of link */
H5L_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 */
@ -365,6 +366,12 @@ H5_DLL herr_t H5O_debug_id(unsigned type_id, H5F_t *f, hid_t dxpl_id, const void
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 links
*/
H5_DLL void *H5O_link_copy(const void *_mesg, void *_dest, unsigned update_flags);
/*
* These functions operate on object locations
*/

View File

@ -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 */

View File

@ -16,88 +16,10 @@
/* Private header files */
#include "H5private.h" /* Generic Functions */
#include "H5Aprivate.h" /* Datasets */
#include "H5Eprivate.h" /* Error handling */
#include "H5Ppkg.h" /* Property lists */
#include "H5Tprivate.h" /* Datatypes */
/* Local datatypes */
/* Static function prototypes */
#ifdef H5_GROUP_REVISION
/*-------------------------------------------------------------------------
* Function: H5Pset_char_encoding
*
* Purpose: Sets the character encoding of the attribute's name.
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: James Laird
* Wednesday, October 26, 2005
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
herr_t
H5Pset_char_encoding(hid_t plist_id, H5T_cset_t encoding)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value=SUCCEED; /* return value */
FUNC_ENTER_API(H5Pset_char_encoding, FAIL);
H5TRACE2("e","iTc",plist_id,encoding);
/* Check arguments */
if (encoding <= H5T_CSET_ERROR || encoding >= H5T_NCSET)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "character encoding is not valid")
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(plist_id,H5P_ATTRIBUTE_CREATE)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Set the character encoding */
if(H5P_set(plist, H5A_CHAR_ENCODING_NAME, &encoding) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set character encoding")
done:
FUNC_LEAVE_API(ret_value);
} /* end H5P_set_char_encoding() */
/*-------------------------------------------------------------------------
* Function: H5Pget_char_encoding
*
* Purpose: Gets the character encoding of the attribute's name.
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: James Laird
* November 1, 2005
*-------------------------------------------------------------------------
*/
herr_t
H5Pget_char_encoding(hid_t plist_id, H5T_cset_t *encoding /*out*/)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_API(H5Pget_char_encoding, FAIL);
H5TRACE2("e","ix",plist_id,encoding);
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Get value */
if(encoding)
if(H5P_get(plist, H5A_CHAR_ENCODING_NAME, encoding) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get character encoding flag")
done:
FUNC_LEAVE_API(ret_value);
} /* end H5Pget_create_intermediate_group() */
#endif /* H5_GROUP_REVISION */

101
src/H5Plcpl.c Normal file
View File

@ -0,0 +1,101 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#define H5P_PACKAGE /*suppress error about including H5Ppkg */
/* Private header files */
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5Lprivate.h" /* Links */
#include "H5Ppkg.h" /* Property lists */
/* Local datatypes */
/* Static function prototypes */
#ifdef H5_GROUP_REVISION
/*-------------------------------------------------------------------------
* Function: H5Pset_create_intermediate_group
*
* Purpose: set crt_intmd_group so that H5Lcreate(), H5Llink, etc.
* will create missing groups along the given path "name"
*
* Note: XXX: This property should really be an access property. -QAK
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Peter Cao
* May 08, 2005
*-------------------------------------------------------------------------
*/
herr_t
H5Pset_create_intermediate_group(hid_t plist_id, unsigned crt_intmd_group)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(H5Pset_create_intermediate_group, FAIL);
H5TRACE2("e","iIu",plist_id,crt_intmd_group);
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(plist_id, H5P_LINK_CREATE)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Set value */
crt_intmd_group = crt_intmd_group > 0 ? 1 : 0;
if(H5P_set(plist, H5L_CRT_INTERMEDIATE_GROUP_NAME, &crt_intmd_group) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set intermediate group creation flag")
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Pset_create_intermediate_group() */
/*-------------------------------------------------------------------------
* Function: H5Pget_create_intermediate_group
*
* Purpose: Returns the crt_intmd_group, which is set to create missing
* groups during H5Lcreate, etc.
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Peter Cao
* May 08, 2005
*-------------------------------------------------------------------------
*/
herr_t
H5Pget_create_intermediate_group(hid_t plist_id, unsigned *crt_intmd_group /*out*/)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_API(H5Pget_create_intermediate_group, FAIL);
H5TRACE2("e","ix",plist_id,crt_intmd_group);
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(plist_id, H5P_LINK_CREATE)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Get values */
if(crt_intmd_group)
if(H5P_get(plist, H5L_CRT_INTERMEDIATE_GROUP_NAME, crt_intmd_group) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get intermediate group creation flag")
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Pget_create_intermediate_group() */
#endif /* H5_GROUP_REVISION */

View File

@ -24,93 +24,6 @@
/* Static function prototypes */
#ifdef H5_GROUP_REVISION
/*-------------------------------------------------------------------------
* Function: H5Pset_create_intermediate_group
*
* Purpose: set crt_intmd_group so that H5Gcreate(), H5Dcreate, etc.
* will create missing groups along the given path "name"
*
* Usage: H5Pset_create_intermediate_group(plist_id, crt_intmd_group)
* hid_t plist_id; IN: Property list to create a new group
* unsigned crt_intmd_group; IN: Flag to create intermediate group
* positive value -- to create intermediate group
* otherwise -- do not create intermediate group
* For example, H5Pset_create_intermediate_group(plist_id, 1) to create intermediate group;
*
* Note: XXX: This property should really be an access property. -QAK
* XXX: The property is used only at creation time. It should
* be a creation property. However, the property is not
* saved with the group. In that sense, it should be access
* property. We do not have a good solution for this kind
* of property. For now, it is used as a creation property.
* -PXC
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Peter Cao
* May 08, 2005
*-------------------------------------------------------------------------
*/
herr_t
H5Pset_create_intermediate_group(hid_t plist_id, unsigned crt_intmd_group)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(H5Pset_create_intermediate_group, FAIL);
H5TRACE2("e","iIu",plist_id,crt_intmd_group);
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Set value */
crt_intmd_group = crt_intmd_group > 0 ? 1 : 0;
if(H5P_set(plist, H5G_CRT_INTERMEDIATE_GROUP_NAME, &crt_intmd_group) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set intermediate group creation flag")
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Pset_create_intermediate_group() */
/*-------------------------------------------------------------------------
* Function: H5Pget_create_intermediate_group
*
* Purpose: Returns the crt_intmd_group, which is set at H5Gcreate(hid_t loc_id,
* const char* name, ... ) for create missing groups
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Peter Cao
* May 08, 2005
*-------------------------------------------------------------------------
*/
herr_t
H5Pget_create_intermediate_group(hid_t plist_id, unsigned *crt_intmd_group /*out*/)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_API(H5Pget_create_intermediate_group, FAIL);
H5TRACE2("e","ix",plist_id,crt_intmd_group);
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Get values */
if(crt_intmd_group)
if(H5P_get(plist, H5G_CRT_INTERMEDIATE_GROUP_NAME, crt_intmd_group) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get intermediate group creation flag")
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Pget_create_intermediate_group() */
#endif /* H5_GROUP_REVISION */
/*-------------------------------------------------------------------------
* Function: H5Pset_copy_object

View File

@ -25,6 +25,11 @@
#include "H5private.h" /* Generic Functions */
#include "H5Oprivate.h" /* Object headers */
/* String creation properties */
#define H5P_CHAR_ENCODING_NAME "character_encoding"
#define H5P_CHAR_ENCODING_SIZE sizeof(H5T_cset_t)
#define H5P_CHAR_ENCODING_DEF H5F_CRT_DEFAULT_CSET
/* Forward declarations for anonymous H5P objects */
typedef struct H5P_genplist_t H5P_genplist_t;
typedef struct H5P_genclass_t H5P_genclass_t;

View File

@ -92,8 +92,10 @@ typedef herr_t (*H5P_iterate_t)(hid_t id, const char *name, void *iter_data);
#define H5P_GROUP_ACCESS (H5OPEN H5P_CLS_GROUP_ACCESS_g)
#define H5P_DATATYPE_CREATE (H5OPEN H5P_CLS_DATATYPE_CREATE_g)
#define H5P_DATATYPE_ACCESS (H5OPEN H5P_CLS_DATATYPE_ACCESS_g)
#define H5P_STRING_CREATE (H5OPEN H5P_CLS_STRING_CREATE_g)
#define H5P_ATTRIBUTE_CREATE (H5OPEN H5P_CLS_ATTRIBUTE_CREATE_g)
#define H5P_OBJECT_COPY (H5OPEN H5P_CLS_OBJECT_COPY_g)
#define H5P_LINK_CREATE (H5OPEN H5P_CLS_LINK_CREATE_g)
H5_DLLVAR hid_t H5P_CLS_NO_CLASS_g;
H5_DLLVAR hid_t H5P_CLS_OBJECT_CREATE_g;
H5_DLLVAR hid_t H5P_CLS_FILE_CREATE_g;
@ -106,8 +108,10 @@ H5_DLLVAR hid_t H5P_CLS_GROUP_CREATE_g;
H5_DLLVAR hid_t H5P_CLS_GROUP_ACCESS_g;
H5_DLLVAR hid_t H5P_CLS_DATATYPE_CREATE_g;
H5_DLLVAR hid_t H5P_CLS_DATATYPE_ACCESS_g;
H5_DLLVAR hid_t H5P_CLS_STRING_CREATE_g;
H5_DLLVAR hid_t H5P_CLS_ATTRIBUTE_CREATE_g;
H5_DLLVAR hid_t H5P_CLS_OBJECT_COPY_g;
H5_DLLVAR hid_t H5P_CLS_LINK_CREATE_g;
/*
* The library created default property lists
@ -127,8 +131,10 @@ H5_DLLVAR hid_t H5P_CLS_OBJECT_COPY_g;
#define H5P_GROUP_ACCESS_DEFAULT (H5OPEN H5P_LST_GROUP_ACCESS_g)
#define H5P_DATATYPE_CREATE_DEFAULT (H5OPEN H5P_LST_DATATYPE_CREATE_g)
#define H5P_DATATYPE_ACCESS_DEFAULT (H5OPEN H5P_LST_DATATYPE_ACCESS_g)
#define H5P_STRING_CLASS_DEFAULT (H5OPEN H5P_LST_STRING_CLASS_g)
#define H5P_ATTRIBUTE_CREATE_DEFAULT (H5OPEN H5P_LST_ATTRIBUTE_CREATE_g)
#define H5P_OBJECT_COPY_DEFAULT (H5OPEN H5P_LST_OBJECT_COPY_g)
#define H5P_LINK_CREATE_DEFAULT (H5OPEN H5P_LST_LINK_CREATE_g)
H5_DLLVAR hid_t H5P_LST_NO_CLASS_g;
H5_DLLVAR hid_t H5P_LST_FILE_CREATE_g;
H5_DLLVAR hid_t H5P_LST_FILE_ACCESS_g;
@ -142,6 +148,7 @@ H5_DLLVAR hid_t H5P_LST_DATATYPE_CREATE_g;
H5_DLLVAR hid_t H5P_LST_DATATYPE_ACCESS_g;
H5_DLLVAR hid_t H5P_LST_ATTRIBUTE_CREATE_g;
H5_DLLVAR hid_t H5P_LST_OBJECT_COPY_g;
H5_DLLVAR hid_t H5P_LST_LINK_CREATE_g;
/* Public functions */
H5_DLL hid_t H5Pcreate_class(hid_t parent, const char *name,

101
src/H5Pstrcpl.c Normal file
View File

@ -0,0 +1,101 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#define H5P_PACKAGE /*suppress error about including H5Ppkg */
/* Private header files */
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5Ppkg.h" /* Property lists */
/* Local datatypes */
/* Static function prototypes */
#ifdef H5_GROUP_REVISION
/*-------------------------------------------------------------------------
* Function: H5Pset_char_encoding
*
* Purpose: Sets the character encoding of the string.
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: James Laird
* Wednesday, October 26, 2005
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
herr_t
H5Pset_char_encoding(hid_t plist_id, H5T_cset_t encoding)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value=SUCCEED; /* return value */
FUNC_ENTER_API(H5Pset_char_encoding, FAIL);
H5TRACE2("e","iTc",plist_id,encoding);
/* Check arguments */
if (encoding <= H5T_CSET_ERROR || encoding >= H5T_NCSET)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "character encoding is not valid")
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(plist_id,H5P_STRING_CREATE)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Set the character encoding */
if(H5P_set(plist, H5P_CHAR_ENCODING_NAME, &encoding) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set character encoding")
done:
FUNC_LEAVE_API(ret_value);
} /* end H5P_set_char_encoding() */
/*-------------------------------------------------------------------------
* Function: H5Pget_char_encoding
*
* Purpose: Gets the character encoding of the string.
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: James Laird
* November 1, 2005
*-------------------------------------------------------------------------
*/
herr_t
H5Pget_char_encoding(hid_t plist_id, H5T_cset_t *encoding /*out*/)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_API(H5Pget_char_encoding, FAIL);
H5TRACE2("e","ix",plist_id,encoding);
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(plist_id, H5P_STRING_CREATE)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Get value */
if(encoding)
if(H5P_get(plist, H5P_CHAR_ENCODING_NAME, encoding) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get character encoding flag")
done:
FUNC_LEAVE_API(ret_value);
} /* end H5Pget_char_encoding() */
#endif /* H5_GROUP_REVISION */

View File

@ -420,7 +420,7 @@ static H5T_t *H5T_decode(const unsigned char *buf);
#define H5T_INIT_TYPE_STRING_COMMON { \
H5T_INIT_TYPE_ALLOC_COMMON(H5T_STRING) \
H5T_INIT_TYPE_NUM_COMMON(H5T_ORDER_NONE) \
dt->shared->u.atomic.u.s.cset = H5T_CSET_ASCII; \
dt->shared->u.atomic.u.s.cset = H5F_CRT_DEFAULT_CSET; \
}
#define H5T_INIT_TYPE_CSTRING_CORE { \
@ -3104,7 +3104,7 @@ H5T_copy(const H5T_t *old_dt, H5T_copy_t method)
HGOTO_ERROR (H5E_DATATYPE, H5E_CANTOPENOBJ, NULL, "unable to reopen named data type");
/* Insert opened named datatype into opened object list for the file */
if(H5FO_insert(old_dt->oloc.file, old_dt->oloc.addr, new_dt->shared)<0)
if(H5FO_insert(old_dt->oloc.file, old_dt->oloc.addr, new_dt->shared, FALSE)<0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINSERT, NULL, "can't insert datatype into list of open objects")
/* Increment object count for the object in the top file */

View File

@ -28,12 +28,13 @@
#include "H5FLprivate.h" /* Free Lists */
#include "H5FOprivate.h" /* File objects */
#include "H5Iprivate.h" /* IDs */
#include "H5Lprivate.h" /* Links */
#include "H5Oprivate.h" /* Object headers */
#include "H5Pprivate.h" /* Property lists */
#include "H5Tpkg.h" /* Datatypes */
/* Static local functions */
static herr_t H5T_commit(H5G_loc_t *loc, const char *name, H5T_t *type,
static herr_t H5T_commit(H5F_t *file, H5T_t *type,
hid_t dxpl_id, hid_t tcpl_id, hid_t tapl_id);
static H5T_t *H5T_open_oid(H5G_loc_t *loc, hid_t dxpl_id);
@ -77,7 +78,11 @@ herr_t
H5Tcommit(hid_t loc_id, const char *name, hid_t type_id)
{
H5G_loc_t loc;
H5G_loc_t type_loc;
H5F_t *file;
H5T_t *type = NULL;
hbool_t uncommit = FALSE; /* TRUE if H5T_commit needs to be undone */
H5T_state_t old_state; /* The state of the datatype before H5T_commit. */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(H5Tcommit, FAIL)
@ -91,11 +96,48 @@ H5Tcommit(hid_t loc_id, const char *name, hid_t type_id)
if(NULL == (type = H5I_object_verify(type_id, H5I_DATATYPE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
/* Commit the type */
if(H5T_commit(&loc, name, type, H5AC_dxpl_id, H5P_DATATYPE_CREATE_DEFAULT, H5P_DEFAULT) < 0)
/* Find the insertion file */
if(NULL == (file = H5G_insertion_file(&loc, name, H5AC_dxpl_id)))
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to find insertion point")
/* Record the type's state so that we can revert to it if linking fails */
old_state = type->shared->state;
/* Write the type to disk */
if(H5T_commit(file, type, H5AC_dxpl_id, H5P_DATATYPE_CREATE_DEFAULT, H5P_DEFAULT) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit datatype")
if(H5G_loc(type_id, &type_loc) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to get committed datatype's location")
/* Link the type into the group hierarchy */
if( H5L_link(&loc, name, &type_loc, H5AC_dxpl_id, H5P_DEFAULT) < 0)
{
uncommit = TRUE; /* Linking failed, and we need to undo H5T_commit. */
HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to create link to type")
}
done:
/* If the datatype was committed but couldn't be linked, we need to return it to the state it was in
* before it was committed. */
if(TRUE == uncommit)
{
if(type->shared->state == H5T_STATE_OPEN && H5F_addr_defined(type->oloc.addr)) {
/* Remove the datatype from the list of opened objects in the file */
if(H5FO_top_decr(type->oloc.file, type->oloc.addr) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "can't decrement count for object")
if(H5FO_delete(type->oloc.file, H5AC_dxpl_id, type->oloc.addr) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "can't remove dataset from list of open objects")
if(H5O_close(&(type->oloc)) < 0)
HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to release object header")
if(H5O_delete(file, H5AC_dxpl_id, type->oloc.addr) < 0)
HDONE_ERROR(H5E_DATATYPE, H5E_CANTDELETE, FAIL, "unable to delete object header")
/* Mark datatype as being back in memory */
if(H5T_set_loc(type, file, H5T_LOC_MEMORY))
HDONE_ERROR(H5E_DATATYPE, H5E_CANTDELETE, FAIL, "unable to return datatype to memory")
type->oloc.addr = HADDR_UNDEF;
type->shared->state = old_state;
} /* end if */ }
FUNC_LEAVE_API(ret_value)
} /* end H5Tcommit() */
@ -105,8 +147,10 @@ done:
* Function: H5Tcommit_expand
*
* Purpose: Save a transient datatype to a file and turn the type handle
* into a named, immutable type.
* Add property to create missing groups along the path.
* into a "named", immutable type.
*
* The resulting ID should be linked into the file with
* H5Lcreate or it will be deleted when closed.
*
* Return: Non-negative on success/Negative on failure
*
@ -116,20 +160,18 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
H5Tcommit_expand(hid_t loc_id, const char *name, hid_t type_id, hid_t tcpl_id, hid_t tapl_id)
H5Tcommit_expand(hid_t loc_id, hid_t type_id, hid_t tcpl_id, hid_t tapl_id)
{
H5G_loc_t loc;
H5T_t *type = NULL;
herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER_API(H5Tcommit_expand, FAIL)
H5TRACE5("e","isiii",loc_id,name,type_id,tcpl_id,tapl_id);
H5TRACE4("e","iiii",loc_id,type_id,tcpl_id,tapl_id);
/* Check arguments */
if(H5G_loc (loc_id, &loc) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
if(!name || !*name)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name")
if(NULL == (type = H5I_object_verify(type_id, H5I_DATATYPE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
@ -150,7 +192,7 @@ H5Tcommit_expand(hid_t loc_id, const char *name, hid_t type_id, hid_t tcpl_id, h
#endif /* LATER */
/* Commit the type */
if(H5T_commit(&loc, name, type, H5AC_dxpl_id, tcpl_id, tapl_id) < 0)
if(H5T_commit(loc.oloc->file, type, H5AC_dxpl_id, tcpl_id, tapl_id) < 0)
HGOTO_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit datatype")
done:
@ -173,18 +215,17 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5T_commit(H5G_loc_t *loc, const char *name, H5T_t *type, hid_t dxpl_id,
H5T_commit(H5F_t *file, H5T_t *type, hid_t dxpl_id,
hid_t tcpl_id, hid_t UNUSED tapl_id)
{
H5F_t *file = NULL;
/* H5F_t *file = NULL; */
H5P_genplist_t *tc_plist; /* Property list created */
H5G_loc_t type_loc; /* Dataset location */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5T_commit)
HDassert(loc);
HDassert(name && *name);
HDassert(file);
HDassert(type);
HDassert(tcpl_id != H5P_DEFAULT);
#ifdef LATER
@ -201,10 +242,6 @@ H5T_commit(H5G_loc_t *loc, const char *name, H5T_t *type, hid_t dxpl_id,
if(H5T_STATE_IMMUTABLE == type->shared->state)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "datatype is immutable")
/* Find the insertion file */
if(NULL == (file = H5G_insertion_file(loc, name, dxpl_id)))
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to find insertion point")
/* Check for a "sensible" datatype to store on disk */
if(H5T_is_sensible(type) <= 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "datatype is not sensible")
@ -232,20 +269,13 @@ H5T_commit(H5G_loc_t *loc, const char *name, H5T_t *type, hid_t dxpl_id,
if(NULL == (tc_plist = H5I_object(tcpl_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
/*
* Give the datatype a name. That is, create and add a new object to the
* group this datatype is being initially created in.
*/
if(H5G_insert(loc, name, &type_loc, dxpl_id, tc_plist) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to name datatype")
type->shared->state = H5T_STATE_OPEN;
type->shared->fo_count=1;
/* Add datatype to the list of open objects in the file */
if(H5FO_top_incr(type->oloc.file, type->oloc.addr) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINC, FAIL, "can't incr object ref. count")
if(H5FO_insert(type->oloc.file, type->oloc.addr, type->shared) < 0)
if(H5FO_insert(type->oloc.file, type->oloc.addr, type->shared, TRUE) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINSERT, FAIL, "can't insert datatype into list of open objects")
/* Mark datatype as being on memory now. Since this datatype may still be used in memory
@ -470,7 +500,7 @@ H5T_open(H5G_loc_t *loc, hid_t dxpl_id)
HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, NULL, "not found")
/* Add the datatype to the list of opened objects in the file */
if(H5FO_insert(dt->oloc.file, dt->oloc.addr, dt->shared) < 0)
if(H5FO_insert(dt->oloc.file, dt->oloc.addr, dt->shared, FALSE) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINSERT, NULL, "can't insert datatype into list of open objects")
/* Increment object count for the object in the top file */

View File

@ -503,9 +503,7 @@ H5_DLL herr_t H5Tclose(hid_t type_id);
H5_DLL htri_t H5Tequal(hid_t type1_id, hid_t type2_id);
H5_DLL herr_t H5Tlock(hid_t type_id);
H5_DLL herr_t H5Tcommit(hid_t loc_id, const char *name, hid_t type_id);
#ifdef H5_GROUP_REVISION
H5_DLL herr_t H5Tcommit_expand(hid_t loc_id, const char *name, hid_t type_id, hid_t tcpl_id, hid_t tapl_id);
#endif /* H5_GROUP_REVISION */
H5_DLL herr_t H5Tcommit_expand(hid_t loc_id, hid_t type_id, hid_t tcpl_id, hid_t tapl_id);
H5_DLL htri_t H5Tcommitted(hid_t type_id);
H5_DLL herr_t H5Tencode(hid_t obj_id, void *buf, size_t *nalloc);
H5_DLL hid_t H5Tdecode(const void *buf);

View File

@ -188,7 +188,7 @@ MINOR, OHDR, H5E_CANTPACK, Can't pack messages
MINOR, GROUP, H5E_CANTOPENOBJ, Can't open object
MINOR, GROUP, H5E_CANTCLOSEOBJ, Can't close object
MINOR, GROUP, H5E_COMPLEN, Name component is too long
MINOR, GROUP, H5E_LINK, Link count failure
MINOR, GROUP, H5E_LINK, Link failure
MINOR, GROUP, H5E_SLINK, Symbolic link error
MINOR, GROUP, H5E_PATH, Problem with path to object

View File

@ -42,37 +42,25 @@ DISTCLEANFILES=H5pubconf.h
# library sources
libhdf5_la_SOURCES= H5.c H5dbg.c H5A.c H5AC.c H5B.c H5Bcache.c \
H5B2.c H5B2cache.c H5B2dbg.c H5B2int.c H5B2stat.c H5B2test.c \
H5C.c \
H5CS.c \
H5D.c \
H5Dcompact.c \
H5Dcontig.c \
H5C.c H5CS.c H5D.c H5Dcompact.c H5Dcontig.c \
H5Defl.c H5Dio.c H5Distore.c H5Dmpio.c H5Doh.c H5Dselect.c H5Dtest.c \
H5E.c H5F.c \
H5Fdbg.c H5Fmount.c H5Fsfile.c H5Fsuper.c H5FD.c H5FDcore.c \
H5FDfamily.c H5FDlog.c H5FDmpi.c H5FDmpio.c \
H5FDmpiposix.c H5FDmulti.c H5FDsec2.c H5FDstdio.c \
H5FDstream.c H5FL.c H5FO.c \
H5FS.c H5FScache.c H5FSdbg.c \
H5G.c H5Gent.c H5Glink.c H5Gloc.c H5Gname.c H5Gnode.c H5Gobj.c \
H5Goh.c \
H5Gstab.c \
H5Gtest.c \
H5Gtraverse.c \
H5FDstream.c H5FL.c H5FO.c H5FS.c H5FScache.c H5FSdbg.c \
H5G.c H5Gdeprec.c H5Gent.c H5Glink.c H5Gloc.c H5Gname.c H5Gnode.c \
H5Gobj.c H5Goh.c H5Gstab.c H5Gtest.c H5Gtraverse.c \
H5HF.c H5HFcache.c H5HFdbg.c H5HFdblock.c H5HFdtable.c \
H5HFhdr.c H5HFiblock.c H5HFint.c H5HFiter.c H5HFsection.c \
H5HFspace.c H5HFstat.c H5HFtest.c \
H5HG.c H5HGdbg.c H5HL.c H5HLdbg.c H5HP.c H5I.c H5MF.c H5MM.c \
H5MP.c H5MPtest.c \
H5O.c \
H5Oattr.c H5Obogus.c H5Ocache.c \
H5MP.c H5MPtest.c H5L.c H5O.c H5Oattr.c H5Obogus.c H5Ocache.c \
H5Ocont.c H5Odtype.c H5Oefl.c H5Ofill.c H5Oginfo.c H5Olayout.c \
H5Olinfo.c \
H5Olink.c \
H5Omtime.c \
H5Olinfo.c H5Olink.c H5Omtime.c \
H5Oname.c H5Onull.c H5Opline.c H5Osdspace.c H5Oshared.c H5Ostab.c \
H5P.c H5Pacpl.c H5Pdcpl.c H5Pdxpl.c H5Pfapl.c H5Pfcpl.c H5Pgcpl.c \
H5Pocpl.c H5Ptest.c H5R.c H5RC.c \
H5Plcpl.c H5Pocpl.c H5Pstrcpl.c H5Ptest.c H5R.c H5RC.c \
H5RS.c H5S.c H5Sall.c H5Shyper.c H5Smpio.c H5Snone.c H5Spoint.c \
H5Sselect.c H5Stest.c \
H5SL.c H5ST.c H5T.c H5Tarray.c H5Tbit.c H5Tcommit.c \
@ -90,7 +78,7 @@ include_HEADERS =H5public.h H5Apublic.h H5ACpublic.h \
H5Epubgen.h H5Epublic.h H5Fpublic.h H5FDpublic.h H5FDcore.h H5FDfamily.h \
H5FDlog.h H5FDmpi.h H5FDmpio.h H5FDmpiposix.h \
H5FDmulti.h H5FDsec2.h H5FDstdio.h H5FDstream.h \
H5Gpublic.h H5Ipublic.h \
H5Gpublic.h H5Ipublic.h H5Lpublic.h \
H5MMpublic.h H5Opublic.h H5Ppublic.h H5Rpublic.h H5Spublic.h \
H5Tpublic.h H5Zpublic.h H5pubconf.h hdf5.h H5api_adpt.h

View File

@ -91,26 +91,27 @@ am_libhdf5_la_OBJECTS = H5.lo H5dbg.lo H5A.lo H5AC.lo H5B.lo \
H5FDfamily.lo H5FDlog.lo H5FDmpi.lo H5FDmpio.lo \
H5FDmpiposix.lo H5FDmulti.lo H5FDsec2.lo H5FDstdio.lo \
H5FDstream.lo H5FL.lo H5FO.lo H5FS.lo H5FScache.lo H5FSdbg.lo \
H5G.lo H5Gent.lo H5Glink.lo H5Gloc.lo H5Gname.lo H5Gnode.lo \
H5Gobj.lo H5Goh.lo H5Gstab.lo H5Gtest.lo H5Gtraverse.lo \
H5HF.lo H5HFcache.lo H5HFdbg.lo H5HFdblock.lo H5HFdtable.lo \
H5HFhdr.lo H5HFiblock.lo H5HFint.lo H5HFiter.lo H5HFsection.lo \
H5HFspace.lo H5HFstat.lo H5HFtest.lo H5HG.lo H5HGdbg.lo \
H5HL.lo H5HLdbg.lo H5HP.lo H5I.lo H5MF.lo H5MM.lo H5MP.lo \
H5MPtest.lo H5O.lo H5Oattr.lo H5Obogus.lo H5Ocache.lo \
H5Ocont.lo H5Odtype.lo H5Oefl.lo H5Ofill.lo H5Oginfo.lo \
H5Olayout.lo H5Olinfo.lo H5Olink.lo H5Omtime.lo H5Oname.lo \
H5Onull.lo H5Opline.lo H5Osdspace.lo H5Oshared.lo H5Ostab.lo \
H5P.lo H5Pacpl.lo H5Pdcpl.lo H5Pdxpl.lo H5Pfapl.lo H5Pfcpl.lo \
H5Pgcpl.lo H5Pocpl.lo H5Ptest.lo H5R.lo H5RC.lo H5RS.lo H5S.lo \
H5Sall.lo H5Shyper.lo H5Smpio.lo H5Snone.lo H5Spoint.lo \
H5Sselect.lo H5Stest.lo H5SL.lo H5ST.lo H5T.lo H5Tarray.lo \
H5Tbit.lo H5Tcommit.lo H5Tcompound.lo H5Tconv.lo H5Tcset.lo \
H5Tenum.lo H5Tfields.lo H5Tfixed.lo H5Tfloat.lo H5Tinit.lo \
H5Tnative.lo H5Toffset.lo H5Toh.lo H5Topaque.lo H5Torder.lo \
H5Tpad.lo H5Tprecis.lo H5Tstrpad.lo H5Tvlen.lo H5TS.lo H5V.lo \
H5Z.lo H5Zdeflate.lo H5Zfletcher32.lo H5Znbit.lo H5Zshuffle.lo \
H5Zszip.lo H5Zscaleoffset.lo H5Ztrans.lo
H5G.lo H5Gdeprec.lo H5Gent.lo H5Glink.lo H5Gloc.lo H5Gname.lo \
H5Gnode.lo H5Gobj.lo H5Goh.lo H5Gstab.lo H5Gtest.lo \
H5Gtraverse.lo H5HF.lo H5HFcache.lo H5HFdbg.lo H5HFdblock.lo \
H5HFdtable.lo H5HFhdr.lo H5HFiblock.lo H5HFint.lo H5HFiter.lo \
H5HFsection.lo H5HFspace.lo H5HFstat.lo H5HFtest.lo H5HG.lo \
H5HGdbg.lo H5HL.lo H5HLdbg.lo H5HP.lo H5I.lo H5MF.lo H5MM.lo \
H5MP.lo H5MPtest.lo H5L.lo H5O.lo H5Oattr.lo H5Obogus.lo \
H5Ocache.lo H5Ocont.lo H5Odtype.lo H5Oefl.lo H5Ofill.lo \
H5Oginfo.lo H5Olayout.lo H5Olinfo.lo H5Olink.lo H5Omtime.lo \
H5Oname.lo H5Onull.lo H5Opline.lo H5Osdspace.lo H5Oshared.lo \
H5Ostab.lo H5P.lo H5Pacpl.lo H5Pdcpl.lo H5Pdxpl.lo H5Pfapl.lo \
H5Pfcpl.lo H5Pgcpl.lo H5Plcpl.lo H5Pocpl.lo H5Pstrcpl.lo \
H5Ptest.lo H5R.lo H5RC.lo H5RS.lo H5S.lo H5Sall.lo H5Shyper.lo \
H5Smpio.lo H5Snone.lo H5Spoint.lo H5Sselect.lo H5Stest.lo \
H5SL.lo H5ST.lo H5T.lo H5Tarray.lo H5Tbit.lo H5Tcommit.lo \
H5Tcompound.lo H5Tconv.lo H5Tcset.lo H5Tenum.lo H5Tfields.lo \
H5Tfixed.lo H5Tfloat.lo H5Tinit.lo H5Tnative.lo H5Toffset.lo \
H5Toh.lo H5Topaque.lo H5Torder.lo H5Tpad.lo H5Tprecis.lo \
H5Tstrpad.lo H5Tvlen.lo H5TS.lo H5V.lo H5Z.lo H5Zdeflate.lo \
H5Zfletcher32.lo H5Znbit.lo H5Zshuffle.lo H5Zszip.lo \
H5Zscaleoffset.lo H5Ztrans.lo
libhdf5_la_OBJECTS = $(am_libhdf5_la_OBJECTS)
PROGRAMS = $(noinst_PROGRAMS)
H5detect_SOURCES = H5detect.c
@ -388,37 +389,25 @@ DISTCLEANFILES = H5pubconf.h
# library sources
libhdf5_la_SOURCES = H5.c H5dbg.c H5A.c H5AC.c H5B.c H5Bcache.c \
H5B2.c H5B2cache.c H5B2dbg.c H5B2int.c H5B2stat.c H5B2test.c \
H5C.c \
H5CS.c \
H5D.c \
H5Dcompact.c \
H5Dcontig.c \
H5C.c H5CS.c H5D.c H5Dcompact.c H5Dcontig.c \
H5Defl.c H5Dio.c H5Distore.c H5Dmpio.c H5Doh.c H5Dselect.c H5Dtest.c \
H5E.c H5F.c \
H5Fdbg.c H5Fmount.c H5Fsfile.c H5Fsuper.c H5FD.c H5FDcore.c \
H5FDfamily.c H5FDlog.c H5FDmpi.c H5FDmpio.c \
H5FDmpiposix.c H5FDmulti.c H5FDsec2.c H5FDstdio.c \
H5FDstream.c H5FL.c H5FO.c \
H5FS.c H5FScache.c H5FSdbg.c \
H5G.c H5Gent.c H5Glink.c H5Gloc.c H5Gname.c H5Gnode.c H5Gobj.c \
H5Goh.c \
H5Gstab.c \
H5Gtest.c \
H5Gtraverse.c \
H5FDstream.c H5FL.c H5FO.c H5FS.c H5FScache.c H5FSdbg.c \
H5G.c H5Gdeprec.c H5Gent.c H5Glink.c H5Gloc.c H5Gname.c H5Gnode.c \
H5Gobj.c H5Goh.c H5Gstab.c H5Gtest.c H5Gtraverse.c \
H5HF.c H5HFcache.c H5HFdbg.c H5HFdblock.c H5HFdtable.c \
H5HFhdr.c H5HFiblock.c H5HFint.c H5HFiter.c H5HFsection.c \
H5HFspace.c H5HFstat.c H5HFtest.c \
H5HG.c H5HGdbg.c H5HL.c H5HLdbg.c H5HP.c H5I.c H5MF.c H5MM.c \
H5MP.c H5MPtest.c \
H5O.c \
H5Oattr.c H5Obogus.c H5Ocache.c \
H5MP.c H5MPtest.c H5L.c H5O.c H5Oattr.c H5Obogus.c H5Ocache.c \
H5Ocont.c H5Odtype.c H5Oefl.c H5Ofill.c H5Oginfo.c H5Olayout.c \
H5Olinfo.c \
H5Olink.c \
H5Omtime.c \
H5Olinfo.c H5Olink.c H5Omtime.c \
H5Oname.c H5Onull.c H5Opline.c H5Osdspace.c H5Oshared.c H5Ostab.c \
H5P.c H5Pacpl.c H5Pdcpl.c H5Pdxpl.c H5Pfapl.c H5Pfcpl.c H5Pgcpl.c \
H5Pocpl.c H5Ptest.c H5R.c H5RC.c \
H5Plcpl.c H5Pocpl.c H5Pstrcpl.c H5Ptest.c H5R.c H5RC.c \
H5RS.c H5S.c H5Sall.c H5Shyper.c H5Smpio.c H5Snone.c H5Spoint.c \
H5Sselect.c H5Stest.c \
H5SL.c H5ST.c H5T.c H5Tarray.c H5Tbit.c H5Tcommit.c \
@ -436,7 +425,7 @@ include_HEADERS = H5public.h H5Apublic.h H5ACpublic.h \
H5Epubgen.h H5Epublic.h H5Fpublic.h H5FDpublic.h H5FDcore.h H5FDfamily.h \
H5FDlog.h H5FDmpi.h H5FDmpio.h H5FDmpiposix.h \
H5FDmulti.h H5FDsec2.h H5FDstdio.h H5FDstream.h \
H5Gpublic.h H5Ipublic.h \
H5Gpublic.h H5Ipublic.h H5Lpublic.h \
H5MMpublic.h H5Opublic.h H5Ppublic.h H5Rpublic.h H5Spublic.h \
H5Tpublic.h H5Zpublic.h H5pubconf.h hdf5.h H5api_adpt.h
@ -606,6 +595,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Fsfile.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Fsuper.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5G.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Gdeprec.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Gent.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Glink.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Gloc.Plo@am__quote@
@ -635,6 +625,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5HLdbg.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5HP.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5I.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5L.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5MF.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5MM.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5MP.Plo@am__quote@
@ -665,7 +656,9 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Pfapl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Pfcpl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Pgcpl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Plcpl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Pocpl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Pstrcpl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Ptest.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5R.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5RC.Plo@am__quote@

View File

@ -29,6 +29,7 @@
#include "H5FDpublic.h" /* File drivers */
#include "H5Gpublic.h" /* Groups */
#include "H5Ipublic.h" /* ID management */
#include "H5Lpublic.h" /* Links */
#include "H5MMpublic.h" /* Memory management */
#include "H5Opublic.h" /* Object headers */
#include "H5Ppublic.h" /* Property lists */

View File

@ -588,7 +588,7 @@ TRACE = perl $(top_srcdir)/bin/trace
# Temporary files. These files are the ones created by setting the
# HDF5_NOCLEANUP environment variable and running `make test' without
# specifying a file prefix or low-level driver. Changing the file
# prefix or low-level driver with environment variables will influence
# prefix or low-level driver with environment variables will influence
# the temporary file name in ways that the makefile is not aware of.
CHECK_CLEANFILES = *.chkexe *.chklog *.clog cmpd_dset.h5 \
compact_dataset.h5 dataset.h5 extend.h5 istore.h5 \

File diff suppressed because it is too large Load Diff

View File

@ -453,7 +453,7 @@ test_mntlnk(hid_t fapl)
/*-------------------------------------------------------------------------
* Function: test_move
*
* Purpose: An object cannot be moved or renamed with H5Gmove() in such a
* Purpose: An object cannot be moved or renamed with in such a
* way that the new location would be in a different file than
* the original location.
*
@ -486,9 +486,9 @@ test_move(hid_t fapl)
if (H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT)<0) goto error;
/* First rename an object in the mounted file, then try it across files */
if (H5Gmove(file1, "/mnt1/rename_a/x", "/mnt1/rename_b/y")<0) goto error;
if (H5Lmove(file1, "/mnt1/rename_a/x", H5L_SAME_LOC, "/mnt1/rename_b/y", H5P_DEFAULT)<0) goto error;
H5E_BEGIN_TRY {
status = H5Gmove(file1, "/mnt1/rename_b/y", "/y");
status = H5Lmove(file1, "/mnt1/rename_b/y", H5L_SAME_LOC, "/y", H5P_DEFAULT);
} H5E_END_TRY;
if (status>=0) {
H5_FAILED();
@ -796,7 +796,7 @@ test_mvmpt(hid_t fapl)
if (H5Fmount(file1, "/mnt_move_a", file2, H5P_DEFAULT)<0) TEST_ERROR
/* Rename the mount point */
if (H5Gmove(file1, "/mnt_move_a", "/mnt_move_b")<0) TEST_ERROR
if (H5Lmove(file1, "/mnt_move_a", H5L_SAME_LOC, "/mnt_move_b", H5P_DEFAULT)<0) TEST_ERROR
/* Access something under the new name */
if (H5Gget_objinfo(file1, "/mnt_move_b/file2", TRUE, NULL)<0) TEST_ERROR
@ -864,7 +864,7 @@ test_interlink(hid_t fapl)
/* Try an interfile hard link by renaming something */
H5E_BEGIN_TRY {
status = H5Gmove(file1, "/mnt1/file2", "/file2");
status = H5Lmove(file1, "/mnt1/file2", H5L_SAME_LOC, "/file2", H5P_DEFAULT);
} H5E_END_TRY;
if (status>=0) {
H5_FAILED();
@ -1450,7 +1450,7 @@ test_mount_after_unmount(hid_t fapl)
/* Rename object in file #3 that is "disconnected" from name hiearchy */
/* (It is "disconnected" because it's parent file has been unmounted) */
if(H5Gmove2(gidAMX,"M/Y",gidAMX,"M/Z") < 0)
if(H5Lmove(gidAMX,"M/Y",gidAMX,"M/Z", H5P_DEFAULT) < 0)
TEST_ERROR
/* Close group in file #3 */

View File

@ -978,7 +978,7 @@ test_copy_named_datatype(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the datatype from SRC to DST */
if ( H5Gcopy(fid_src, NAME_DATATYPE_SIMPLE, fid_dst, NAME_DATATYPE_SIMPLE, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_DATATYPE_SIMPLE, fid_dst, NAME_DATATYPE_SIMPLE, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the datatype for copy */
if ( (tid = H5Topen(fid_src, NAME_DATATYPE_SIMPLE)) < 0) TEST_ERROR;
@ -1071,7 +1071,7 @@ test_copy_named_datatype_vl(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the datatype from SRC to DST */
if ( H5Gcopy(fid_src, NAME_DATATYPE_VL, fid_dst, NAME_DATATYPE_VL, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_DATATYPE_VL, fid_dst, NAME_DATATYPE_VL, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the datatype for copy */
if ( (tid = H5Topen(fid_src, NAME_DATATYPE_VL)) < 0) TEST_ERROR;
@ -1170,7 +1170,7 @@ test_copy_named_datatype_vl_vl(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the datatype from SRC to DST */
if ( H5Gcopy(fid_src, NAME_DATATYPE_VL_VL, fid_dst, NAME_DATATYPE_VL_VL, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_DATATYPE_VL_VL, fid_dst, NAME_DATATYPE_VL_VL, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the datatype for copy */
if ( (tid = H5Topen(fid_src, NAME_DATATYPE_VL_VL)) < 0) TEST_ERROR;
@ -1287,7 +1287,7 @@ test_copy_dataset_simple(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the dataset from SRC to DST */
if ( H5Gcopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the dataset for copy */
if ( (did = H5Dopen(fid_src, NAME_DATASET_SIMPLE)) < 0) TEST_ERROR;
@ -1394,7 +1394,7 @@ test_copy_dataset_simple_empty(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the dataset from SRC to DST */
if ( H5Gcopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the dataset for copy */
if ( (did = H5Dopen(fid_src, NAME_DATASET_SIMPLE)) < 0) TEST_ERROR;
@ -1524,7 +1524,7 @@ test_copy_dataset_compound(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the dataset from SRC to DST */
if ( H5Gcopy(fid_src, NAME_DATASET_COMPOUND, fid_dst, NAME_DATASET_COMPOUND, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_DATASET_COMPOUND, fid_dst, NAME_DATASET_COMPOUND, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the dataset for copy */
if ( (did = H5Dopen(fid_src, NAME_DATASET_COMPOUND)) < 0) TEST_ERROR;
@ -1652,7 +1652,7 @@ test_copy_dataset_chunked(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the dataset from SRC to DST */
if ( H5Gcopy(fid_src, NAME_DATASET_CHUNKED, fid_dst, NAME_DATASET_CHUNKED, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_DATASET_CHUNKED, fid_dst, NAME_DATASET_CHUNKED, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the dataset for copy */
if ( (did = H5Dopen(fid_src, NAME_DATASET_CHUNKED)) < 0) TEST_ERROR;
@ -1769,7 +1769,7 @@ test_copy_dataset_chunked_empty(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the dataset from SRC to DST */
if ( H5Gcopy(fid_src, NAME_DATASET_CHUNKED, fid_dst, NAME_DATASET_CHUNKED, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_DATASET_CHUNKED, fid_dst, NAME_DATASET_CHUNKED, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the dataset for copy */
if ( (did = H5Dopen(fid_src, NAME_DATASET_CHUNKED)) < 0) TEST_ERROR;
@ -1907,7 +1907,7 @@ test_copy_dataset_chunked_sparse(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the dataset from SRC to DST */
if ( H5Gcopy(fid_src, NAME_DATASET_CHUNKED, fid_dst, NAME_DATASET_CHUNKED, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_DATASET_CHUNKED, fid_dst, NAME_DATASET_CHUNKED, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the dataset for copy */
if ( (did = H5Dopen(fid_src, NAME_DATASET_CHUNKED)) < 0) TEST_ERROR;
@ -2040,7 +2040,7 @@ test_copy_dataset_compressed(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the dataset from SRC to DST */
if ( H5Gcopy(fid_src, NAME_DATASET_CHUNKED, fid_dst, NAME_DATASET_CHUNKED, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_DATASET_CHUNKED, fid_dst, NAME_DATASET_CHUNKED, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the dataset for copy */
if ( (did = H5Dopen(fid_src, NAME_DATASET_CHUNKED)) < 0) TEST_ERROR;
@ -2168,7 +2168,7 @@ test_copy_dataset_compact(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the dataset from SRC to DST */
if ( H5Gcopy(fid_src, NAME_DATASET_COMPACT, fid_dst, NAME_DATASET_COMPACT, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_DATASET_COMPACT, fid_dst, NAME_DATASET_COMPACT, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the dataset for copy */
if ( (did = H5Dopen(fid_src, NAME_DATASET_COMPACT)) < 0) TEST_ERROR;
@ -2302,7 +2302,7 @@ test_copy_dataset_external(hid_t fapl)
#endif /* 0 */
/* copy the dataset from SRC to DST */
if ( H5Gcopy(fid_src, NAME_DATASET_EXTERNAL, fid_dst, NAME_DATASET_EXTERNAL, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_DATASET_EXTERNAL, fid_dst, NAME_DATASET_EXTERNAL, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the dataset for copy */
if ( (did = H5Dopen(fid_src, NAME_DATASET_EXTERNAL)) < 0) TEST_ERROR;
@ -2423,7 +2423,7 @@ test_copy_dataset_named_dtype(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the dataset from SRC to DST */
if ( H5Gcopy(fid_src, NAME_DATASET_NAMED_DTYPE, fid_dst, NAME_DATASET_NAMED_DTYPE, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_DATASET_NAMED_DTYPE, fid_dst, NAME_DATASET_NAMED_DTYPE, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the dataset for copy */
if ( (did = H5Dopen(fid_src, NAME_DATASET_NAMED_DTYPE)) < 0) TEST_ERROR;
@ -2560,7 +2560,7 @@ test_copy_dataset_named_dtype_hier(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the dataset from SRC to DST */
if ( H5Gcopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the group for copy */
if ( (gid = H5Gopen(fid_src, NAME_GROUP_TOP)) < 0) TEST_ERROR;
@ -2699,7 +2699,7 @@ test_copy_dataset_named_dtype_hier_outside(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the dataset from SRC to DST */
if ( H5Gcopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the group for copy */
if ( (gid = H5Gopen(fid_src, NAME_GROUP_TOP)) < 0) TEST_ERROR;
@ -2833,7 +2833,7 @@ test_copy_dataset_multi_ohdr_chunks(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the dataset from SRC to DST */
if ( H5Gcopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the group for copy */
if ( (gid = H5Gopen(fid_src, NAME_GROUP_TOP)) < 0) TEST_ERROR;
@ -2974,7 +2974,7 @@ test_copy_dataset_attr_named_dtype(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the dataset from SRC to DST */
if ( H5Gcopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the group for copy */
if ( (gid = H5Gopen(fid_src, NAME_GROUP_TOP)) < 0) TEST_ERROR;
@ -3094,7 +3094,7 @@ test_copy_dataset_contig_vl(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the dataset from SRC to DST */
if ( H5Gcopy(fid_src, NAME_DATASET_VL, fid_dst, NAME_DATASET_VL, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_DATASET_VL, fid_dst, NAME_DATASET_VL, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the dataset for copy */
if ( (did = H5Dopen(fid_src, NAME_DATASET_VL)) < 0) TEST_ERROR;
@ -3232,7 +3232,7 @@ test_copy_dataset_chunked_vl(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the dataset from SRC to DST */
if ( H5Gcopy(fid_src, NAME_DATASET_VL, fid_dst, NAME_DATASET_VL, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_DATASET_VL, fid_dst, NAME_DATASET_VL, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the dataset for copy */
if ( (did = H5Dopen(fid_src, NAME_DATASET_VL)) < 0) TEST_ERROR;
@ -3369,7 +3369,7 @@ test_copy_dataset_compact_vl(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the dataset from SRC to DST */
if ( H5Gcopy(fid_src, NAME_DATASET_VL, fid_dst, NAME_DATASET_VL, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_DATASET_VL, fid_dst, NAME_DATASET_VL, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the dataset for copy */
if ( (did = H5Dopen(fid_src, NAME_DATASET_VL)) < 0) TEST_ERROR;
@ -3489,7 +3489,7 @@ test_copy_attribute_vl(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the dataset from SRC to DST */
if ( H5Gcopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the dataset for copy */
if ( (did = H5Dopen(fid_src, NAME_DATASET_SIMPLE)) < 0) TEST_ERROR;
@ -3632,7 +3632,7 @@ test_copy_dataset_compressed_vl(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the dataset from SRC to DST */
if ( H5Gcopy(fid_src, NAME_DATASET_CHUNKED, fid_dst, NAME_DATASET_CHUNKED, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_DATASET_CHUNKED, fid_dst, NAME_DATASET_CHUNKED, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the dataset for copy */
if ( (did = H5Dopen(fid_src, NAME_DATASET_CHUNKED)) < 0) TEST_ERROR;
@ -3743,7 +3743,7 @@ test_copy_group_empty(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the group from SRC to DST */
if ( H5Gcopy(fid_src, NAME_GROUP_EMPTY, fid_dst, NAME_GROUP_EMPTY, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_GROUP_EMPTY, fid_dst, NAME_GROUP_EMPTY, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the group for copy */
if ( (gid = H5Gopen(fid_src, NAME_GROUP_EMPTY)) < 0) TEST_ERROR;
@ -3874,7 +3874,7 @@ test_copy_group(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the group from SRC to DST */
if ( H5Gcopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the group for copy */
if ( (gid = H5Gopen(fid_src, NAME_GROUP_TOP)) < 0) TEST_ERROR;
@ -4016,7 +4016,7 @@ test_copy_group_deep(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the group from SRC to DST */
if ( H5Gcopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the group for copy */
if ( (gid = H5Gopen(fid_src, NAME_GROUP_TOP)) < 0) TEST_ERROR;
@ -4127,7 +4127,7 @@ test_copy_group_loop(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the group from SRC to DST */
if ( H5Gcopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the group for copy */
if ( (gid = H5Gopen(fid_src, NAME_GROUP_TOP)) < 0) TEST_ERROR;
@ -4256,7 +4256,7 @@ test_copy_group_wide_loop(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the group from SRC to DST */
if ( H5Gcopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the group for copy */
if ( (gid = H5Gopen(fid_src, NAME_GROUP_TOP)) < 0) TEST_ERROR;
@ -4389,7 +4389,7 @@ test_copy_group_links(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the group from SRC to DST */
if ( H5Gcopy(fid_src, NAME_GROUP_LINK, fid_dst, NAME_GROUP_LINK, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_GROUP_LINK, fid_dst, NAME_GROUP_LINK, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the group for copy */
if ( (gid = H5Gopen(fid_src, NAME_GROUP_LINK)) < 0) TEST_ERROR;
@ -4515,7 +4515,7 @@ test_copy_soft_link(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the dataset from SRC to DST */
if ( H5Gcopy(fid_src, NAME_LINK_SOFT, fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_LINK_SOFT, fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the dataset through the soft link for copy */
if ( (did = H5Dopen(fid_src, NAME_LINK_SOFT)) < 0) TEST_ERROR;
@ -4634,11 +4634,11 @@ test_copy_exist(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the dataset from SRC to DST */
if ( H5Gcopy(fid_src, NAME_DATASET_SIMPLE,fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_DATASET_SIMPLE,fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* try to copy the dataset from SRC to DST again (should fail) */
H5E_BEGIN_TRY {
ret = H5Gcopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT);
ret = H5Gcopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT, H5P_DEFAULT);
} H5E_END_TRY;
if( ret >= 0) TEST_ERROR;
@ -4744,7 +4744,7 @@ test_copy_path(hid_t fapl)
/* copy the dataset from SRC to DST (should fail - intermediate groups not there) */
H5E_BEGIN_TRY {
ret = H5Gcopy(fid_src, NAME_DATASET_SUB_SUB, fid_dst, NAME_DATASET_SUB_SUB, H5P_DEFAULT);
ret = H5Gcopy(fid_src, NAME_DATASET_SUB_SUB, fid_dst, NAME_DATASET_SUB_SUB, H5P_DEFAULT, H5P_DEFAULT);
} H5E_END_TRY;
if( ret >= 0) TEST_ERROR;
@ -4759,7 +4759,7 @@ test_copy_path(hid_t fapl)
if ( H5Gclose(gid) < 0) TEST_ERROR;
/* copy the dataset from SRC to DST, using full path */
if ( H5Gcopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SUB_SUB, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SUB_SUB, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the dataset for copy */
if ( (did = H5Dopen(fid_src, NAME_DATASET_SIMPLE)) < 0) TEST_ERROR;
@ -4837,7 +4837,7 @@ test_copy_same_file_named_datatype(hid_t fapl)
/* copy the datatype from SRC to DST */
if ( H5Gcopy(fid, NAME_DATATYPE_SIMPLE, fid, NAME_DATATYPE_SIMPLE2, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid, NAME_DATATYPE_SIMPLE, fid, NAME_DATATYPE_SIMPLE2, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the copied datatype */
if ( (tid2 = H5Topen(fid, NAME_DATATYPE_SIMPLE2)) < 0) TEST_ERROR;
@ -4987,7 +4987,7 @@ test_copy_dataset_compact_named_vl(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the dataset from SRC to DST */
if ( H5Gcopy(fid_src, NAME_DATASET_VL, fid_dst, NAME_DATASET_VL, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_DATASET_VL, fid_dst, NAME_DATASET_VL, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the dataset for copy */
if ( (did = H5Dopen(fid_src, NAME_DATASET_VL)) < 0) TEST_ERROR;
@ -5127,7 +5127,7 @@ test_copy_dataset_contig_named_vl(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the dataset from SRC to DST */
if ( H5Gcopy(fid_src, NAME_DATASET_VL, fid_dst, NAME_DATASET_VL, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_DATASET_VL, fid_dst, NAME_DATASET_VL, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the dataset for copy */
if ( (did = H5Dopen(fid_src, NAME_DATASET_VL)) < 0) TEST_ERROR;
@ -5275,7 +5275,7 @@ test_copy_dataset_chunked_named_vl(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the dataset from SRC to DST */
if ( H5Gcopy(fid_src, NAME_DATASET_VL, fid_dst, NAME_DATASET_VL, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_DATASET_VL, fid_dst, NAME_DATASET_VL, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the dataset for copy */
if ( (did = H5Dopen(fid_src, NAME_DATASET_VL)) < 0) TEST_ERROR;
@ -5425,7 +5425,7 @@ test_copy_dataset_compressed_named_vl(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the dataset from SRC to DST */
if ( H5Gcopy(fid_src, NAME_DATASET_VL, fid_dst, NAME_DATASET_VL, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_DATASET_VL, fid_dst, NAME_DATASET_VL, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the dataset for copy */
if ( (did = H5Dopen(fid_src, NAME_DATASET_VL)) < 0) TEST_ERROR;
@ -5581,7 +5581,7 @@ test_copy_dataset_compact_vl_vl(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the dataset from SRC to DST */
if ( H5Gcopy(fid_src, NAME_DATASET_VL_VL, fid_dst, NAME_DATASET_VL_VL, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_DATASET_VL_VL, fid_dst, NAME_DATASET_VL_VL, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the dataset for copy */
if ( (did = H5Dopen(fid_src, NAME_DATASET_VL_VL)) < 0) TEST_ERROR;
@ -5735,7 +5735,7 @@ test_copy_dataset_contig_vl_vl(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the dataset from SRC to DST */
if ( H5Gcopy(fid_src, NAME_DATASET_VL_VL, fid_dst, NAME_DATASET_VL_VL, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_DATASET_VL_VL, fid_dst, NAME_DATASET_VL_VL, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the dataset for copy */
if ( (did = H5Dopen(fid_src, NAME_DATASET_VL_VL)) < 0) TEST_ERROR;
@ -5889,7 +5889,7 @@ test_copy_dataset_chunked_vl_vl(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the dataset from SRC to DST */
if ( H5Gcopy(fid_src, NAME_DATASET_VL_VL, fid_dst, NAME_DATASET_VL_VL, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_DATASET_VL_VL, fid_dst, NAME_DATASET_VL_VL, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the dataset for copy */
if ( (did = H5Dopen(fid_src, NAME_DATASET_VL_VL)) < 0) TEST_ERROR;
@ -6046,7 +6046,7 @@ test_copy_dataset_compressed_vl_vl(hid_t fapl)
if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR;
/* copy the dataset from SRC to DST */
if ( H5Gcopy(fid_src, NAME_DATASET_VL_VL, fid_dst, NAME_DATASET_VL_VL, H5P_DEFAULT) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_DATASET_VL_VL, fid_dst, NAME_DATASET_VL_VL, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the dataset for copy */
if ( (did = H5Dopen(fid_src, NAME_DATASET_VL_VL)) < 0) TEST_ERROR;
@ -6115,14 +6115,14 @@ error:
*-------------------------------------------------------------------------
*/
static int
test_copy_option(hid_t fapl, unsigned flag, const char* test_desciption)
test_copy_option(hid_t fapl, unsigned flag, hbool_t crt_intermediate_grp, const char* test_desciption)
{
hid_t fid_src = -1, fid_dst = -1; /* File IDs */
hid_t sid = -1; /* Dataspace ID */
hid_t did = -1; /* Dataset ID */
hid_t gid = -1, gid2 = -1; /* Group IDs */
hid_t gid_sub=-1, gid_sub_sub=-1; /* Sub-group ID */
hid_t pid=-1; /* Property ID */
hid_t pid=-1, lcpl_id=-1; /* Property IDs */
unsigned cpy_flags; /* Object copy flags */
int depth = -1; /* Copy depth */
hsize_t dim2d[2];
@ -6237,8 +6237,16 @@ test_copy_option(hid_t fapl, unsigned flag, const char* test_desciption)
if ( cpy_flags != flag) TEST_ERROR;
/* copy the group from SRC to DST */
if ((flag & H5G_COPY_CREATE_INTERMEDIATE_GROUP_FLAG) > 0) {
if ( H5Gcopy(fid_src, NAME_GROUP_TOP, fid_dst, "/new_g0/new_g00", pid) < 0) TEST_ERROR;
if (crt_intermediate_grp) {
/* Create link creation plist to pass in intermediate group creation */
if ( (lcpl_id = H5Pcreate(H5P_LINK_CREATE)) < 0) TEST_ERROR;
#ifdef H5_GROUP_REVISION
if ( H5Pset_create_intermediate_group(lcpl_id, TRUE) < 0) TEST_ERROR;
#endif /* H5_GROUP_REVISION */
if ( H5Gcopy(fid_src, NAME_GROUP_TOP, fid_dst, "/new_g0/new_g00", pid, lcpl_id) < 0) TEST_ERROR;
if ( H5Pclose(lcpl_id) < 0) TEST_ERROR;
/* open the group for copy */
if ( (gid = H5Gopen(fid_src, NAME_GROUP_TOP)) < 0) TEST_ERROR;
@ -6247,7 +6255,7 @@ test_copy_option(hid_t fapl, unsigned flag, const char* test_desciption)
if ( (gid2 = H5Gopen(fid_dst, "/new_g0/new_g00")) < 0) TEST_ERROR;
} else if ((flag & H5G_COPY_EXPAND_SOFT_LINK_FLAG) > 0) {
if ( H5Gcopy(fid_src, NAME_GROUP_LINK, fid_dst, NAME_GROUP_LINK, pid) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_GROUP_LINK, fid_dst, NAME_GROUP_LINK, pid, H5P_DEFAULT) < 0) TEST_ERROR;
/* Unlink dataset to copy from original location */
/* (So group comparison works properly) */
@ -6260,7 +6268,7 @@ test_copy_option(hid_t fapl, unsigned flag, const char* test_desciption)
if ( (gid2 = H5Gopen(fid_dst, NAME_GROUP_LINK)) < 0) TEST_ERROR;
} else if(flag & H5G_COPY_WITHOUT_ATTR_FLAG) {
if ( H5Gcopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, pid) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, pid, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the group for copy */
if ( (gid = H5Gopen(fid_src, NAME_GROUP_TOP)) < 0) TEST_ERROR;
@ -6268,7 +6276,7 @@ test_copy_option(hid_t fapl, unsigned flag, const char* test_desciption)
/* open the destination group */
if ( (gid2 = H5Gopen(fid_dst, NAME_GROUP_TOP)) < 0) TEST_ERROR;
} else if(flag & H5G_COPY_SHALLOW_HIERARCHY_FLAG) {
if ( H5Gcopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, pid) < 0) TEST_ERROR;
if ( H5Gcopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, pid, H5P_DEFAULT) < 0) TEST_ERROR;
/* open the group for copy */
if ( (gid = H5Gopen(fid_src, NAME_GROUP_TOP)) < 0) TEST_ERROR;
@ -6298,7 +6306,7 @@ test_copy_option(hid_t fapl, unsigned flag, const char* test_desciption)
/* close the DST file */
if ( H5Fclose(fid_dst) < 0) TEST_ERROR;
/* close property */
/* close properties */
if ( H5Pclose(pid) < 0) TEST_ERROR;
PASSED();
@ -6306,6 +6314,7 @@ test_copy_option(hid_t fapl, unsigned flag, const char* test_desciption)
error:
H5E_BEGIN_TRY {
H5Pclose(lcpl_id);
H5Pclose(pid);
H5Sclose(sid);
H5Dclose(did);
@ -6384,14 +6393,16 @@ main(void)
nerrors += test_copy_exist(fapl);
nerrors += test_copy_path(fapl);
nerrors += test_copy_same_file_named_datatype(fapl);
nerrors += test_copy_option(fapl, H5G_COPY_WITHOUT_ATTR_FLAG, "H5Gcopy(): without attributes");
nerrors += test_copy_option(fapl, H5G_COPY_CREATE_INTERMEDIATE_GROUP_FLAG, "H5Gcopy(): with missing groups");
nerrors += test_copy_option(fapl, H5G_COPY_EXPAND_SOFT_LINK_FLAG, "H5Gcopy(): expand soft link");
nerrors += test_copy_option(fapl, H5G_COPY_SHALLOW_HIERARCHY_FLAG, "H5Gcopy(): shallow group copy");
nerrors += test_copy_option(fapl, H5G_COPY_WITHOUT_ATTR_FLAG, FALSE, "H5Gcopy(): without attributes");
#ifdef H5_GROUP_REVISION
nerrors += test_copy_option(fapl, 0, TRUE, "H5Gcopy(): with missing groups");
#endif /* H5_GROUP_REVISION */
nerrors += test_copy_option(fapl, H5G_COPY_EXPAND_SOFT_LINK_FLAG, FALSE, "H5Gcopy(): expand soft link");
nerrors += test_copy_option(fapl, H5G_COPY_SHALLOW_HIERARCHY_FLAG, FALSE, "H5Gcopy(): shallow group copy");
/* TODO: not implemented
nerrors += test_copy_option(fapl, H5G_COPY_EXPAND_EXT_LINK_FLAG, "H5Gcopy: expand external link");
nerrors += test_copy_option(fapl, H5G_COPY_EXPAND_EXPAND_OBJ_REFERENCE_FLAG, "H5Gcopy: expand object reference");
nerrors += test_copy_option(fapl, H5G_COPY_EXPAND_EXT_LINK_FLAG, FALSE, "H5Gcopy: expand external link");
nerrors += test_copy_option(fapl, H5G_COPY_EXPAND_EXPAND_OBJ_REFERENCE_FLAG, FALSE, "H5Gcopy: expand object reference");
*/
/* TODO: Add more tests for copying objects in same file */

View File

@ -329,7 +329,8 @@ lifecycle(hid_t fapl)
if(H5Pset_est_link_info(gcpl, LIFECYCLE_EST_NUM_ENTRIES, LIFECYCLE_EST_NAME_LEN) < 0) TEST_ERROR;
/* Create group for testing lifecycle */
if((gid = H5Gcreate_expand(fid, LIFECYCLE_TOP_GROUP, gcpl, H5P_DEFAULT)) < 0) TEST_ERROR
if((gid = H5Gcreate_expand(fid, gcpl, H5P_DEFAULT)) < 0) TEST_ERROR
if((H5Lcreate(fid, LIFECYCLE_TOP_GROUP, gid, H5P_DEFAULT)) < 0) TEST_ERROR
/* Query group creation property settings */
if(H5Pget_local_heap_size_hint(gcpl, &lheap_size_hint) < 0) TEST_ERROR;
@ -787,7 +788,8 @@ no_compact(hid_t fapl)
if(est_name_len != H5G_CRT_GINFO_EST_NAME_LEN) TEST_ERROR;
/* Create group for testing lifecycle */
if((gid = H5Gcreate_expand(fid, NO_COMPACT_TOP_GROUP, gcpl, H5P_DEFAULT)) < 0) TEST_ERROR
if((gid = H5Gcreate_expand(fid, gcpl, H5P_DEFAULT)) < 0) TEST_ERROR
if((H5Lcreate(fid, NO_COMPACT_TOP_GROUP, gid, H5P_DEFAULT)) < 0) TEST_ERROR
/* Close GCPL */
if(H5Pclose(gcpl) < 0) TEST_ERROR;
@ -873,6 +875,7 @@ gcpl_on_root(hid_t fapl)
hid_t gid2 = (-1); /* Datatype ID */
hid_t fcpl = (-1); /* File creation property list ID */
hid_t gcpl = (-1); /* Group creation property list ID */
hid_t lcpl = (-1); /* Link creation property list ID */
unsigned max_compact; /* Maximum # of links to store in group compactly */
unsigned min_dense; /* Minimum # of links to store in group "densely" */
char filename[NAME_BUF_SIZE];
@ -912,14 +915,15 @@ gcpl_on_root(hid_t fapl)
if(H5Pclose(gcpl) < 0) TEST_ERROR;
/* Create a group creation property list, with intermediate group creation set */
if((gcpl = H5Pcreate(H5P_GROUP_CREATE)) < 0) TEST_ERROR;
if(H5Pset_create_intermediate_group(gcpl, TRUE) < 0) TEST_ERROR
if((lcpl = H5Pcreate(H5P_LINK_CREATE)) < 0) TEST_ERROR;
if(H5Pset_create_intermediate_group(lcpl, TRUE) < 0) TEST_ERROR
/* Create a group and intermediate groups, to check if root group settings are inherited */
if((gid2 = H5Gcreate_expand(gid, GCPL_ON_ROOT_BOTTOM_GROUP, gcpl, H5P_DEFAULT)) < 0) TEST_ERROR
if((gid2 = H5Gcreate_expand(gid, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if((H5Lcreate(gid, GCPL_ON_ROOT_BOTTOM_GROUP, gid2, lcpl)) < 0) TEST_ERROR
/* Close GCPL */
if(H5Pclose(gcpl) < 0) TEST_ERROR;
/* Close LCPL */
if(H5Pclose(lcpl) < 0) TEST_ERROR;
/* Query the group creation properties */
if((gcpl = H5Gget_create_plist(gid2)) < 0) TEST_ERROR;
@ -1022,6 +1026,7 @@ main(void)
nerrors += read_old(fapl);
nerrors += no_compact(fapl);
nerrors += gcpl_on_root(fapl);
#endif /* H5_GROUP_REVISION */
if (nerrors) goto error;

View File

@ -3830,8 +3830,8 @@ test_misc23(void)
* test H5Gcreate_expand()
**********************************************************************/
/* Create group creation property list */
create_id = H5Pcreate(H5P_GROUP_CREATE);
/* Create link creation property list */
create_id = H5Pcreate(H5P_LINK_CREATE);
CHECK(create_id, FAIL, "H5Pcreate");
/* Set flag for intermediate group creation */
@ -3839,9 +3839,12 @@ test_misc23(void)
CHECK(status, FAIL, "H5Pset_create_intermediate_group");
tmp_id = H5Gcreate_expand(file_id, "/A/B01/grp", create_id, access_id);
tmp_id = H5Gcreate_expand(file_id, H5P_DEFAULT, access_id);
CHECK(tmp_id, FAIL, "H5Gcreate_expand");
status = H5Llink(file_id, "/A/B01/grp", tmp_id, create_id);
CHECK(status, FAIL, "H5Llink");
/* Query that the name of the new group is correct */
status = H5Iget_name( tmp_id, objname, (size_t)MISC23_NAME_BUF_SIZE );
CHECK(status, FAIL, "H5Iget_name");
@ -3862,30 +3865,42 @@ test_misc23(void)
CHECK(status, FAIL, "H5Gclose");
tmp_id = H5Gcreate_expand(file_id, "/A/B02/C02/grp", create_id, access_id);
tmp_id = H5Gcreate_expand(file_id, H5P_DEFAULT, access_id);
CHECK(tmp_id, FAIL, "H5Gcreate_expand");
status = H5Llink(file_id, "/A/B02/C02/grp", tmp_id, create_id);
CHECK(status, FAIL, "H5Llink");
status = H5Gclose(tmp_id);
CHECK(status, FAIL, "H5Gclose");
tmp_id = H5Gcreate_expand(group_id, "B03/grp/", create_id, access_id);
tmp_id = H5Gcreate_expand(group_id, H5P_DEFAULT, access_id);
CHECK(tmp_id, FAIL, "H5Gcreate_expand");
status = H5Llink(group_id, "B03/grp/", tmp_id, create_id);
CHECK(status, FAIL, "H5Llink");
status = H5Gclose(tmp_id);
CHECK(status, FAIL, "H5Gclose");
if ( (tmp_id = H5Gcreate_expand(group_id, "/A/B04/grp/", create_id, access_id)) < 0)
if ( (tmp_id = H5Gcreate_expand(group_id, H5P_DEFAULT, access_id)) < 0)
CHECK(tmp_id, FAIL, "H5Gcreate_expand");
status = H5Llink(group_id, "/A/B04/grp/", tmp_id, create_id);
CHECK(status, FAIL, "H5Llink");
status = H5Gclose(tmp_id);
CHECK(status, FAIL, "H5Gclose");
if ( (tmp_id = H5Gcreate_expand(file_id, "/A/B05/C05/A", create_id, access_id)) < 0)
if ( (tmp_id = H5Gcreate_expand(file_id, H5P_DEFAULT, access_id)) < 0)
CHECK(tmp_id, FAIL, "H5Gcreate_expand");
status = H5Llink(file_id, "/A/B05/C05/A", tmp_id, create_id);
CHECK(status, FAIL, "H5Llink");
status = H5Gclose(tmp_id);
CHECK(status, FAIL, "H5Gclose");
@ -3898,8 +3913,8 @@ test_misc23(void)
* test new H5Dcreate
**********************************************************************/
/* Create dataset creation property list */
create_id = H5Pcreate(H5P_DATASET_CREATE);
/* Create link creation property list */
create_id = H5Pcreate(H5P_LINK_CREATE);
CHECK(create_id, FAIL, "H5Pcreate");
/* Set flag for intermediate group creation */
@ -3907,36 +3922,51 @@ test_misc23(void)
CHECK(status, FAIL, "H5Pset_create_intermediate_group");
tmp_id = H5Dcreate(file_id, "/A/B06/dset", type_id, space_id, create_id);
tmp_id = H5Dcreate_expand(file_id, type_id, space_id, H5P_DEFAULT);
CHECK(tmp_id, FAIL, "H5Dcreate");
status = H5Llink(file_id, "/A/B06/dset", tmp_id, create_id);
CHECK(status, FAIL, "H5Llink");
status = H5Dclose(tmp_id);
CHECK(status, FAIL, "H5Dclose");
tmp_id = H5Dcreate_expand(file_id, type_id, space_id, H5P_DEFAULT);
CHECK(tmp_id, FAIL, "H5Dcreate");
status = H5Llink(file_id, "/A/B07/B07/dset", tmp_id, create_id);
CHECK(status, FAIL, "H5Llink");
status = H5Dclose(tmp_id);
CHECK(status, FAIL, "H5Dclose");
tmp_id = H5Dcreate(file_id, "/A/B07/B07/dset", type_id, space_id, create_id);
tmp_id = H5Dcreate_expand(group_id, type_id, space_id, H5P_DEFAULT);
CHECK(tmp_id, FAIL, "H5Dcreate");
status = H5Llink(group_id, "B08/dset", tmp_id, create_id);
CHECK(status, FAIL, "H5Llink");
status = H5Dclose(tmp_id);
CHECK(status, FAIL, "H5Dclose");
tmp_id = H5Dcreate(group_id, "B08/dset", type_id, space_id, create_id);
tmp_id = H5Dcreate_expand(group_id, type_id, space_id, H5P_DEFAULT);
CHECK(tmp_id, FAIL, "H5Dcreate");
status = H5Llink(group_id, "/A/B09/dset", tmp_id, create_id);
CHECK(status, FAIL, "H5Llink");
status = H5Dclose(tmp_id);
CHECK(status, FAIL, "H5Dclose");
tmp_id = H5Dcreate(group_id, "/A/B09/dset", type_id, space_id, create_id);
tmp_id = H5Dcreate_expand(file_id, type_id, space_id, H5P_DEFAULT);
CHECK(tmp_id, FAIL, "H5Dcreate");
status = H5Dclose(tmp_id);
CHECK(status, FAIL, "H5Dclose");
tmp_id = H5Dcreate(file_id, "/A/B10/C10/A/dset", type_id, space_id, create_id);
CHECK(tmp_id, FAIL, "H5Dcreate");
status = H5Llink(file_id, "/A/B10/C10/A/dset", tmp_id, create_id);
CHECK(status, FAIL, "H5Llink");
status = H5Dclose(tmp_id);
CHECK(status, FAIL, "H5Dclose");
@ -3948,7 +3978,6 @@ test_misc23(void)
status = H5Sclose(space_id);
CHECK(status, FAIL, "H5Sclose");
status = H5Pclose(create_id);
CHECK(status, FAIL, "H5Pclose");
@ -3957,21 +3986,23 @@ test_misc23(void)
* test new H5Tcommit
**********************************************************************/
/* Create datatype creation property list */
create_id = H5Pcreate(H5P_DATATYPE_CREATE);
/* Create link creation property list */
create_id = H5Pcreate(H5P_LINK_CREATE);
CHECK(create_id, FAIL, "H5Pcreate");
/* Set flag for intermediate group creation */
status = H5Pset_create_intermediate_group(create_id, TRUE);
CHECK(status, FAIL, "H5Pset_create_intermediate_group");
tmp_id = H5Tcopy(H5T_NATIVE_INT16);
CHECK(tmp_id, FAIL, "H5Tcopy");
status = H5Tcommit_expand(file_id, "/A/B11/dtype", tmp_id, create_id, access_id);
status = H5Tcommit_expand(file_id, tmp_id, H5P_DEFAULT, access_id);
CHECK(status, FAIL, "H5Tcommit_expand");
status = H5Llink(file_id, "/A/B11/dtype", tmp_id, create_id);
CHECK(status, FAIL, "H5Llink");
status = H5Tclose(tmp_id);
CHECK(status, FAIL, "H5Tclose");
@ -3979,9 +4010,12 @@ test_misc23(void)
tmp_id = H5Tcopy(H5T_NATIVE_INT32);
CHECK(tmp_id, FAIL, "H5Tcopy");
status = H5Tcommit_expand(file_id, "/A/B12/C12/dtype", tmp_id, create_id, access_id);
status = H5Tcommit_expand(file_id, tmp_id, H5P_DEFAULT, access_id);
CHECK(status, FAIL, "H5Tcommit_expand");
status = H5Llink(file_id, "/A/B12/C12/dtype", tmp_id, create_id);
CHECK(status, FAIL, "H5Llink");
status = H5Tclose(tmp_id);
CHECK(status, FAIL, "H5Tclose");
@ -3989,8 +4023,11 @@ test_misc23(void)
tmp_id = H5Tcopy(H5T_NATIVE_INT64);
CHECK(tmp_id, FAIL, "H5Tcopy");
status = H5Tcommit_expand(group_id, "B13/dtype", tmp_id, create_id, access_id);
status = H5Tcommit_expand(group_id, tmp_id, H5P_DEFAULT, access_id);
CHECK(status, FAIL, "H5Tcommit_expand");
status = H5Llink(group_id, "B13/C12/dtype", tmp_id, create_id);
CHECK(status, FAIL, "H5Llink");
status = H5Tclose(tmp_id);
CHECK(status, FAIL, "H5Tclose");
@ -3999,9 +4036,12 @@ test_misc23(void)
tmp_id = H5Tcopy(H5T_NATIVE_FLOAT);
CHECK(tmp_id, FAIL, "H5Tcopy");
status = H5Tcommit_expand(group_id, "/A/B14/dtype", tmp_id, create_id, access_id);
status = H5Tcommit_expand(group_id, tmp_id, H5P_DEFAULT, access_id);
CHECK(status, FAIL, "H5Tcommit_expand");
status = H5Llink(group_id, "/A/B14/dtype", tmp_id, create_id);
CHECK(status, FAIL, "H5Llink");
status = H5Tclose(tmp_id);
CHECK(status, FAIL, "H5Tclose");
@ -4009,9 +4049,12 @@ test_misc23(void)
tmp_id = H5Tcopy(H5T_NATIVE_DOUBLE);
CHECK(tmp_id, FAIL, "H5Tcopy");
status = H5Tcommit_expand(file_id, "/A/B15/C15/A/dtype", tmp_id, create_id, access_id);
status = H5Tcommit_expand(file_id, tmp_id, H5P_DEFAULT, access_id);
CHECK(status, FAIL, "H5Tcommit_expand");
status = H5Llink(file_id, "/A/B15/C15/A/dtype", tmp_id, create_id);
CHECK(status, FAIL, "H5Llink");
status = H5Tclose(tmp_id);
CHECK(status, FAIL, "H5Tclose");

View File

@ -373,6 +373,11 @@ void test_vl_string(hid_t fid, const char *string)
* test_objnames
* Tests that UTF-8 can be used for object names in the file.
* Tests groups, datasets, named datatypes, and soft links.
* Note that this test doesn't actually mark the names as being
* in UTF-8. At the time this test was written, that feature
* didn't exist in HDF5, and when the character encoding property
* was added to links it didn't change how they were stored in the file,
* -JML 2/2/2006
*/
void test_objnames(hid_t fid, const char* string)
{
@ -552,7 +557,7 @@ void test_attrname(hid_t fid, const char * string)
}
/*
* test_attrname
* test_compound
* Test that compound datatypes can have UTF-8 field names.
*/
void test_compound(hid_t fid, const char * string)

View File

@ -361,7 +361,7 @@ ph5diff_SOURCES = ph5diff_main.c h5diff_common.c
h5diffgentest_SOURCES = h5diffgentest.c
# Programs depend on the main HDF5 library and tools library
LDADD = $(LIBH5TOOLS) $(LIBHDF5)
LDADD = $(LIBH5TOOLS) $(LIBHDF5)
# Automake needs to be taught how to build lib, progs, and tests targets.
# These will be filled in automatically for the most part (e.g.,