summaryrefslogtreecommitdiffstats
path: root/util/qlalr/lalr.g
Commit message (Expand)AuthorAgeFilesLines
* Long live Qt!Lars Knoll2009-03-231-0/+803
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 diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 4f88061..9988f0b 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -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 diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 38c5d69..484d76e 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -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) diff --git a/hl/c++/test/Makefile.in b/hl/c++/test/Makefile.in index c483810..906cc63 100644 --- a/hl/c++/test/Makefile.in +++ b/hl/c++/test/Makefile.in @@ -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@ diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index f4cb142..28637f1 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -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. diff --git a/src/H5.c b/src/H5.c index 7ca10d5..59bf8b6 100644 --- a/src/H5.c +++ b/src/H5.c @@ -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"); diff --git a/src/H5A.c b/src/H5A.c index 43759b8..6135b91 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -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; diff --git a/src/H5Aprivate.h b/src/H5Aprivate.h index 7adbbe1..9b24490 100644 --- a/src/H5Aprivate.h +++ b/src/H5Aprivate.h @@ -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); diff --git a/src/H5D.c b/src/H5D.c index bc17e49..01cd378 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -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