summaryrefslogtreecommitdiffstats
path: root/hl/src
diff options
context:
space:
mode:
Diffstat (limited to 'hl/src')
-rw-r--r--hl/src/H5IM.c18
-rw-r--r--hl/src/H5LT.c345
-rw-r--r--hl/src/H5PT.c4
-rw-r--r--hl/src/H5TB.c116
-rw-r--r--hl/src/Makefile.am2
5 files changed, 197 insertions, 288 deletions
diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c
index c7e905d..1405f8d 100644
--- a/hl/src/H5IM.c
+++ b/hl/src/H5IM.c
@@ -253,7 +253,7 @@ herr_t H5IMget_image_info( hid_t loc_id,
*npals = 0;
/* Open the dataset. */
- if((did = H5Dopen(loc_id, dset_name)) < 0)
+ if((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0)
return -1;
/* Try to find the attribute "INTERLACE_MODE" on the >>image<< dataset */
@@ -407,7 +407,7 @@ herr_t H5IMread_image( hid_t loc_id,
hid_t did;
/* Open the dataset. */
- if ( (did = H5Dopen( loc_id, dset_name )) < 0)
+ if((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0)
return -1;
/* Read */
@@ -527,7 +527,7 @@ herr_t H5IMlink_palette( hid_t loc_id,
*/
/* First we get the image id */
- if ( (image_id = H5Dopen( loc_id, image_name )) < 0)
+ if((image_id = H5Dopen2(loc_id, image_name, H5P_DEFAULT)) < 0)
return -1;
/* Try to find the attribute "PALETTE" on the >>image<< dataset */
@@ -694,7 +694,7 @@ herr_t H5IMunlink_palette( hid_t loc_id,
*/
/* First we get the image id */
- if ( (image_id = H5Dopen( loc_id, image_name )) < 0)
+ if((image_id = H5Dopen2(loc_id, image_name, H5P_DEFAULT)) < 0)
return -1;
/* Try to find the attribute "PALETTE" on the >>image<< dataset */
@@ -780,7 +780,7 @@ herr_t H5IMget_npalettes( hid_t loc_id,
*npals = 0;
/* Open the dataset. */
- if((image_id = H5Dopen(loc_id, image_name)) < 0)
+ if((image_id = H5Dopen2(loc_id, image_name, H5P_DEFAULT)) < 0)
return -1;
/* Try to find the attribute "PALETTE" on the >>image<< dataset */
@@ -873,7 +873,7 @@ herr_t H5IMget_palette_info( hid_t loc_id,
hsize_t pal_maxdims[2];
/* Open the dataset. */
- if((image_id = H5Dopen(loc_id, image_name)) < 0)
+ if((image_id = H5Dopen2(loc_id, image_name, H5P_DEFAULT)) < 0)
return -1;
/* Try to find the attribute "PALETTE" on the >>image<< dataset */
@@ -985,7 +985,7 @@ herr_t H5IMget_palette( hid_t loc_id,
hid_t pal_id;
/* Open the dataset. */
- if((image_id = H5Dopen(loc_id, image_name)) < 0)
+ if((image_id = H5Dopen2(loc_id, image_name, H5P_DEFAULT)) < 0)
return -1;
/* Try to find the attribute "PALETTE" on the >>image<< dataset */
@@ -1084,7 +1084,7 @@ herr_t H5IMis_image( hid_t loc_id,
ret = -1;
/* Open the dataset. */
- if ( (did = H5Dopen( loc_id, dset_name )) < 0)
+ if((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0)
return -1;
/* Try to find the attribute "CLASS" on the dataset */
@@ -1169,7 +1169,7 @@ herr_t H5IMis_palette( hid_t loc_id,
ret = -1;
/* Open the dataset. */
- if ( (did = H5Dopen( loc_id, dset_name )) < 0)
+ if((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0)
return -1;
/* Try to find the attribute "CLASS" on the dataset */
diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c
index 865dfb2..a98d567 100644
--- a/hl/src/H5LT.c
+++ b/hl/src/H5LT.c
@@ -560,44 +560,63 @@ out:
/*-------------------------------------------------------------------------
- * Function: H5LTread_dataset
+ * Function: H5LT_read_dataset
*
* Purpose: Reads a dataset from disk.
*
* Return: Success: 0, Failure: -1
*
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+ * Programmer: Quincey Koziol, koziol@hdfgroup.org
*
- * Date: June 13, 2001
+ * Date: October 8, 2007
*
*-------------------------------------------------------------------------
*/
-herr_t H5LTread_dataset( hid_t loc_id,
- const char *dset_name,
- hid_t tid,
- void *data )
+static herr_t
+H5LT_read_dataset(hid_t loc_id, const char *dset_name, hid_t tid, void *data)
{
- hid_t did;
+ hid_t did;
- /* Open the dataset. */
- if ( (did = H5Dopen( loc_id, dset_name )) < 0 )
- return -1;
+ /* Open the dataset. */
+ if((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0)
+ return -1;
- /* Read */
- if ( H5Dread( did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 )
- goto out;
+ /* Read */
+ if(H5Dread(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0)
+ goto out;
- /* End access to the dataset and release resources used by it. */
- if ( H5Dclose( did ) )
- return -1;
+ /* End access to the dataset and release resources used by it. */
+ if(H5Dclose(did))
+ return -1;
- return 0;
+ return 0;
out:
- H5Dclose( did );
- return -1;
+ H5Dclose(did);
+ return -1;
+}
+/*-------------------------------------------------------------------------
+ * Function: H5LTread_dataset
+ *
+ * Purpose: Reads a dataset from disk.
+ *
+ * Return: Success: 0, Failure: -1
+ *
+ * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+ *
+ * Date: June 13, 2001
+ *
+ *-------------------------------------------------------------------------
+ */
+
+herr_t H5LTread_dataset(hid_t loc_id,
+ const char *dset_name,
+ hid_t tid,
+ void *data)
+{
+ return(H5LT_read_dataset(loc_id, dset_name, tid, data));
}
@@ -619,26 +638,7 @@ herr_t H5LTread_dataset_char( hid_t loc_id,
const char *dset_name,
char *data )
{
- hid_t did;
-
- /* Open the dataset. */
- if ( (did = H5Dopen( loc_id, dset_name )) < 0 )
- return -1;
-
- /* Read */
- if ( H5Dread( did, H5T_NATIVE_CHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 )
- goto out;
-
- /* End access to the dataset and release resources used by it. */
- if ( H5Dclose( did ) )
- return -1;
-
- return 0;
-
-out:
- H5Dclose( did );
- return -1;
-
+ return(H5LTread_dataset(loc_id, dset_name, H5T_NATIVE_CHAR, data));
}
/*-------------------------------------------------------------------------
@@ -659,26 +659,7 @@ herr_t H5LTread_dataset_short( hid_t loc_id,
const char *dset_name,
short *data )
{
- hid_t did;
-
- /* Open the dataset. */
- if ( (did = H5Dopen( loc_id, dset_name )) < 0 )
- return -1;
-
- /* Read */
- if ( H5Dread( did, H5T_NATIVE_SHORT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 )
- goto out;
-
- /* End access to the dataset and release resources used by it. */
- if ( H5Dclose( did ) )
- return -1;
-
- return 0;
-
-out:
- H5Dclose( did );
- return -1;
-
+ return(H5LTread_dataset(loc_id, dset_name, H5T_NATIVE_SHORT, data));
}
/*-------------------------------------------------------------------------
@@ -699,26 +680,7 @@ herr_t H5LTread_dataset_int( hid_t loc_id,
const char *dset_name,
int *data )
{
- hid_t did;
-
- /* Open the dataset. */
- if ( (did = H5Dopen( loc_id, dset_name )) < 0 )
- return -1;
-
- /* Read */
- if ( H5Dread( did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 )
- goto out;
-
- /* End access to the dataset and release resources used by it. */
- if ( H5Dclose( did ) )
- return -1;
-
- return 0;
-
-out:
- H5Dclose( did );
- return -1;
-
+ return(H5LTread_dataset(loc_id, dset_name, H5T_NATIVE_INT, data));
}
/*-------------------------------------------------------------------------
@@ -739,26 +701,7 @@ herr_t H5LTread_dataset_long( hid_t loc_id,
const char *dset_name,
long *data )
{
- hid_t did;
-
- /* Open the dataset. */
- if ( (did = H5Dopen( loc_id, dset_name )) < 0 )
- return -1;
-
- /* Read */
- if ( H5Dread( did, H5T_NATIVE_LONG, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 )
- goto out;
-
- /* End access to the dataset and release resources used by it. */
- if ( H5Dclose( did ) )
- return -1;
-
- return 0;
-
-out:
- H5Dclose( did );
- return -1;
-
+ return(H5LTread_dataset(loc_id, dset_name, H5T_NATIVE_LONG, data));
}
/*-------------------------------------------------------------------------
@@ -779,26 +722,7 @@ herr_t H5LTread_dataset_float( hid_t loc_id,
const char *dset_name,
float *data )
{
- hid_t did;
-
- /* Open the dataset. */
- if ( (did = H5Dopen( loc_id, dset_name )) < 0 )
- return -1;
-
- /* Read */
- if ( H5Dread( did, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 )
- goto out;
-
- /* End access to the dataset and release resources used by it. */
- if ( H5Dclose( did ) )
- return -1;
-
- return 0;
-
-out:
- H5Dclose( did );
- return -1;
-
+ return(H5LTread_dataset(loc_id, dset_name, H5T_NATIVE_FLOAT, data));
}
@@ -820,26 +744,7 @@ herr_t H5LTread_dataset_double( hid_t loc_id,
const char *dset_name,
double *data )
{
- hid_t did;
-
- /* Open the dataset. */
- if ( (did = H5Dopen( loc_id, dset_name )) < 0 )
- return -1;
-
- /* Read */
- if ( H5Dread( did, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 )
- goto out;
-
- /* End access to the dataset and release resources used by it. */
- if ( H5Dclose( did ) )
- return -1;
-
- return 0;
-
-out:
- H5Dclose( did );
- return -1;
-
+ return(H5LTread_dataset(loc_id, dset_name, H5T_NATIVE_DOUBLE, data));
}
@@ -861,33 +766,34 @@ herr_t H5LTread_dataset_string( hid_t loc_id,
const char *dset_name,
char *buf )
{
- hid_t did;
- hid_t tid;
+ hid_t did = -1;
+ hid_t tid = -1;
- /* Open the dataset. */
- if ( (did = H5Dopen( loc_id, dset_name )) < 0 )
- return -1;
+ /* Open the dataset. */
+ if((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0)
+ return -1;
- if ( (tid = H5Dget_type(did)) < 0 )
- goto out;
+ if((tid = H5Dget_type(did)) < 0)
+ goto out;
- /* Read */
- if ( H5Dread(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0 )
- goto out;
+ /* Read */
+ if(H5Dread(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ goto out;
- /* close */
- if ( H5Dclose(did) )
- goto out;
- if ( H5Tclose(tid) )
- return -1;
+ /* close */
+ if(H5Dclose(did))
+ goto out;
+ if(H5Tclose(tid))
+ return -1;
- return 0;
+ return 0;
out:
- H5Dclose( did );
- H5Tclose( tid );
- return -1;
-
+ H5E_BEGIN_TRY {
+ H5Dclose(did);
+ H5Tclose(tid);
+ } H5E_END_TRY;
+ return -1;
}
@@ -909,36 +815,37 @@ herr_t H5LTget_dataset_ndims( hid_t loc_id,
const char *dset_name,
int *rank )
{
- hid_t did;
- hid_t sid;
+ hid_t did = -1;
+ hid_t sid = -1;
- /* Open the dataset. */
- if ( (did = H5Dopen( loc_id, dset_name )) < 0 )
- return -1;
+ /* Open the dataset. */
+ if((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0)
+ return -1;
- /* Get the dataspace handle */
- if ( (sid = H5Dget_space( did )) < 0 )
- goto out;
+ /* Get the dataspace handle */
+ if((sid = H5Dget_space(did)) < 0)
+ goto out;
- /* Get rank */
- if ( (*rank = H5Sget_simple_extent_ndims( sid )) < 0 )
- goto out;
+ /* Get rank */
+ if((*rank = H5Sget_simple_extent_ndims(sid)) < 0)
+ goto out;
- /* Terminate access to the dataspace */
- if ( H5Sclose( sid ) < 0 )
- goto out;
+ /* Terminate access to the dataspace */
+ if(H5Sclose(sid) < 0)
+ goto out;
- /* End access to the dataset */
- if ( H5Dclose( did ) )
- return -1;
+ /* End access to the dataset */
+ if(H5Dclose(did))
+ return -1;
- return 0;
+ return 0;
out:
- H5Dclose( did );
- H5Sclose( sid );
- return -1;
-
+ H5E_BEGIN_TRY {
+ H5Dclose(did);
+ H5Sclose(sid);
+ } H5E_END_TRY;
+ return -1;
}
@@ -963,54 +870,56 @@ herr_t H5LTget_dataset_info( hid_t loc_id,
H5T_class_t *type_class,
size_t *type_size )
{
- hid_t did;
- hid_t tid;
- hid_t sid;
+ hid_t did = -1;
+ hid_t tid = -1;
+ hid_t sid = -1;
- /* open the dataset. */
- if ( (did = H5Dopen( loc_id, dset_name )) < 0 )
- return -1;
+ /* open the dataset. */
+ if((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0)
+ return -1;
- /* get an identifier for the datatype. */
- tid = H5Dget_type( did );
+ /* get an identifier for the datatype. */
+ tid = H5Dget_type(did);
- /* get the class. */
- if (type_class!=NULL)
- *type_class = H5Tget_class( tid );
+ /* get the class. */
+ if(type_class != NULL)
+ *type_class = H5Tget_class(tid);
- /* get the size. */
- if (type_size!=NULL)
- *type_size = H5Tget_size( tid );
+ /* get the size. */
+ if(type_size!=NULL)
+ *type_size = H5Tget_size(tid);
- if (dims!=NULL)
- {
- /* get the dataspace handle */
- if ( (sid = H5Dget_space( did )) < 0 )
- goto out;
+ if(dims != NULL) {
+ /* get the dataspace handle */
+ if((sid = H5Dget_space(did)) < 0)
+ goto out;
- /* get dimensions */
- if ( H5Sget_simple_extent_dims( sid, dims, NULL) < 0 )
- goto out;
+ /* get dimensions */
+ if(H5Sget_simple_extent_dims(sid, dims, NULL) < 0)
+ goto out;
- /* terminate access to the dataspace */
- if ( H5Sclose( sid ) < 0 )
- goto out;
- }
+ /* terminate access to the dataspace */
+ if(H5Sclose(sid) < 0)
+ goto out;
+ } /* end if */
- /* release the datatype. */
- if ( H5Tclose( tid ) )
- return -1;
+ /* release the datatype. */
+ if(H5Tclose(tid))
+ return -1;
- /* end access to the dataset */
- if ( H5Dclose( did ) )
- return -1;
+ /* end access to the dataset */
+ if(H5Dclose(did))
+ return -1;
- return 0;
+ return 0;
out:
- H5Tclose( tid );
- H5Dclose( did );
- return -1;
+ H5E_BEGIN_TRY {
+ H5Tclose(tid);
+ H5Sclose(sid);
+ H5Dclose(did);
+ } H5E_END_TRY;
+ return -1;
}
diff --git a/hl/src/H5PT.c b/hl/src/H5PT.c
index a486f35..aedc7b5 100644
--- a/hl/src/H5PT.c
+++ b/hl/src/H5PT.c
@@ -232,10 +232,10 @@ hid_t H5PTopen( hid_t loc_id,
if((H5PT_ptable_id_type = H5Iregister_type((size_t)H5PT_HASH_TABLE_SIZE, 0, (H5I_free_t)free))<0)
goto out;
- table = (htbl_t *) malloc(sizeof(htbl_t));
+ table = (htbl_t *)malloc(sizeof(htbl_t));
/* Open the dataset */
- if(( table->dset_id = H5Dopen(loc_id, dset_name)) <0)
+ if((table->dset_id = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0)
goto out;
if (table->dset_id < 0)
goto out;
diff --git a/hl/src/H5TB.c b/hl/src/H5TB.c
index 9193bbd..9f4b161 100644
--- a/hl/src/H5TB.c
+++ b/hl/src/H5TB.c
@@ -208,7 +208,7 @@ herr_t H5TBmake_table( const char *table_title,
tmp_buf = fill_data;
/* Open the dataset. */
- if((did = H5Dopen( loc_id, dset_name )) < 0)
+ if((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0)
return -1;
if (( sid = H5Screate(H5S_SCALAR)) < 0)
@@ -313,18 +313,18 @@ herr_t H5TBappend_records( hid_t loc_id,
return -1;
/* Open the dataset. */
- if((did = H5Dopen( loc_id, dset_name )) < 0)
+ if((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0)
goto out;
/* Get the datatypes */
if((tid = H5Dget_type( did )) < 0)
goto out;
- if ((mem_type_id=H5TB_create_type(loc_id,dset_name,type_size,field_offset,field_sizes,tid))<0)
+ if ((mem_type_id=H5TB_create_type(loc_id,dset_name,type_size,field_offset,field_sizes,tid)) < 0)
goto out;
/* Append the records */
- if ((H5TB_common_append_records(did, mem_type_id, (size_t)nrecords, nrecords_orig, data))<0)
+ if ((H5TB_common_append_records(did, mem_type_id, (size_t)nrecords, nrecords_orig, data)) < 0)
goto out;
/* Release the datatype. */
@@ -396,14 +396,14 @@ herr_t H5TBwrite_records( hid_t loc_id,
hid_t mem_type_id=-1;
/* Open the dataset. */
- if((did = H5Dopen( loc_id, dset_name )) < 0)
+ if((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0)
return -1;
/* Get the datatype */
if((tid = H5Dget_type( did )) < 0)
goto out;
- if ((mem_type_id=H5TB_create_type(loc_id,dset_name,type_size,field_offset,field_sizes,tid))<0)
+ if ((mem_type_id=H5TB_create_type(loc_id,dset_name,type_size,field_offset,field_sizes,tid)) < 0)
goto out;
/* Get the dataspace handle */
@@ -512,13 +512,13 @@ herr_t H5TBwrite_fields_name( hid_t loc_id,
size_t size_native;
/* Create xfer properties to preserve initialized data */
- if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0)
+ if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER)) < 0)
return -1;
- if (H5Pset_preserve (PRESERVE, 1)<0)
+ if (H5Pset_preserve (PRESERVE, 1) < 0)
return -1;
/* Open the dataset. */
- if((did = H5Dopen( loc_id, dset_name )) < 0)
+ if((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0)
goto out;
/* Get the datatype */
@@ -549,7 +549,7 @@ herr_t H5TBwrite_fields_name( hid_t loc_id,
goto out;
/* Convert to native type */
- if ((nmtype_id=H5Tget_native_type(member_type_id,H5T_DIR_DEFAULT))<0)
+ if ((nmtype_id=H5Tget_native_type(member_type_id,H5T_DIR_DEFAULT)) < 0)
goto out;
size_native=H5Tget_size(nmtype_id);
@@ -557,7 +557,7 @@ herr_t H5TBwrite_fields_name( hid_t loc_id,
/* Adjust, if necessary */
if (field_sizes[j]!=size_native)
{
- if (H5Tset_size(nmtype_id, field_sizes[j])<0)
+ if (H5Tset_size(nmtype_id, field_sizes[j]) < 0)
goto out;
}
@@ -683,13 +683,13 @@ herr_t H5TBwrite_fields_index( hid_t loc_id,
size_t size_native;
/* Create xfer properties to preserve initialized data */
- if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0)
+ if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER)) < 0)
return -1;
- if (H5Pset_preserve (PRESERVE, 1)<0)
+ if (H5Pset_preserve (PRESERVE, 1) < 0)
return -1;
/* Open the dataset. */
- if((did = H5Dopen( loc_id, dset_name )) < 0)
+ if((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0)
goto out;
/* Get the datatype */
@@ -714,14 +714,14 @@ herr_t H5TBwrite_fields_index( hid_t loc_id,
goto out;
/* Convert to native type */
- if ((nmtype_id=H5Tget_native_type(member_type_id,H5T_DIR_DEFAULT))<0)
+ if ((nmtype_id=H5Tget_native_type(member_type_id,H5T_DIR_DEFAULT)) < 0)
goto out;
size_native=H5Tget_size(nmtype_id);
if (field_sizes[i]!=size_native)
{
- if (H5Tset_size(nmtype_id, field_sizes[i])<0)
+ if (H5Tset_size(nmtype_id, field_sizes[i]) < 0)
goto out;
}
@@ -834,7 +834,7 @@ herr_t H5TBread_table( hid_t loc_id,
hsize_t dims[1];
/* open the dataset. */
- if ((did=H5Dopen(loc_id,dset_name))<0)
+ if((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0)
return -1;
/* get the dataspace handle */
@@ -846,10 +846,10 @@ herr_t H5TBread_table( hid_t loc_id,
goto out;
/* get the datatypes */
- if ((ftype_id=H5Dget_type (did))<0)
+ if ((ftype_id=H5Dget_type (did)) < 0)
goto out;
- if ((mem_type_id=H5TB_create_type(loc_id,dset_name,type_size,field_offset,field_sizes,ftype_id))<0)
+ if ((mem_type_id=H5TB_create_type(loc_id,dset_name,type_size,field_offset,field_sizes,ftype_id)) < 0)
goto out;
/* read */
@@ -927,14 +927,14 @@ herr_t H5TBread_records( hid_t loc_id,
return -1;
/* open the dataset */
- if((did = H5Dopen( loc_id, dset_name )) < 0)
+ if((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0)
return -1;
/* get the datatypes */
if((ftype_id = H5Dget_type( did )) < 0)
goto out;
- if ((mem_type_id=H5TB_create_type(loc_id,dset_name,type_size,field_offset,field_sizes,ftype_id))<0)
+ if ((mem_type_id=H5TB_create_type(loc_id,dset_name,type_size,field_offset,field_sizes,ftype_id)) < 0)
goto out;
/* Read the records */
@@ -1043,7 +1043,7 @@ herr_t H5TBread_fields_name( hid_t loc_id,
hssize_t i, j;
/* open the dataset */
- if((did = H5Dopen( loc_id, dset_name )) < 0)
+ if((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0)
goto out;
/* get the datatype */
@@ -1071,14 +1071,14 @@ herr_t H5TBread_fields_name( hid_t loc_id,
goto out;
/* convert to native type */
- if ((nmtype_id=H5Tget_native_type(mtype_id,H5T_DIR_DEFAULT))<0)
+ if ((nmtype_id=H5Tget_native_type(mtype_id,H5T_DIR_DEFAULT)) < 0)
goto out;
size_native=H5Tget_size(nmtype_id);
if (field_sizes[j]!=size_native)
{
- if (H5Tset_size(nmtype_id, field_sizes[j])<0)
+ if (H5Tset_size(nmtype_id, field_sizes[j]) < 0)
goto out;
}
/* the field in the file is found by its name */
@@ -1198,7 +1198,7 @@ herr_t H5TBread_fields_index( hid_t loc_id,
hsize_t i, j;
/* Open the dataset. */
- if((did = H5Dopen( loc_id, dset_name )) < 0)
+ if((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0)
goto out;
/* Get the datatype */
@@ -1226,14 +1226,14 @@ herr_t H5TBread_fields_index( hid_t loc_id,
goto out;
/* Convert to native type */
- if ((nmtype_id=H5Tget_native_type(member_type_id,H5T_DIR_DEFAULT))<0)
+ if ((nmtype_id=H5Tget_native_type(member_type_id,H5T_DIR_DEFAULT)) < 0)
goto out;
size_native=H5Tget_size(nmtype_id);
if (field_sizes[i]!=size_native)
{
- if (H5Tset_size(nmtype_id, field_sizes[i])<0)
+ if (H5Tset_size(nmtype_id, field_sizes[i]) < 0)
goto out;
}
@@ -1407,7 +1407,7 @@ herr_t H5TBdelete_record( hid_t loc_id,
*/
/* Open the dataset. */
- if((did = H5Dopen( loc_id, dset_name )) < 0)
+ if((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0)
return -1;
/* Get the datatype */
@@ -1472,7 +1472,7 @@ herr_t H5TBdelete_record( hid_t loc_id,
nrows = ntotal_records - nrecords;
/* Set the attribute */
if (H5LT_set_attribute_numerical(loc_id,dset_name,"NROWS",(size_t)1,
- H5T_NATIVE_LLONG,&nrows)<0)
+ H5T_NATIVE_LLONG,&nrows) < 0)
return -1;
@@ -1538,7 +1538,7 @@ herr_t H5TBinsert_record( hid_t loc_id,
return -1;
/* Open the dataset. */
- if((did = H5Dopen( loc_id, dset_name )) < 0)
+ if((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0)
goto out;
/* Get the datatype */
@@ -1546,7 +1546,7 @@ herr_t H5TBinsert_record( hid_t loc_id,
goto out;
/* Create the memory data type. */
- if ((mem_type_id=H5TB_create_type(loc_id,dset_name,type_size,field_offset,field_sizes,tid))<0)
+ if ((mem_type_id=H5TB_create_type(loc_id,dset_name,type_size,field_offset,field_sizes,tid)) < 0)
goto out;
read_nrecords = ntotal_records - start;
@@ -1719,7 +1719,7 @@ herr_t H5TBadd_records_from( hid_t loc_id,
*/
/* Open the 1st dataset. */
- if((dataset_id1 = H5Dopen( loc_id, dset_name1 )) < 0)
+ if((dataset_id1 = H5Dopen2(loc_id, dset_name1, H5P_DEFAULT)) < 0)
return -1;
/* Get the datatype */
@@ -1890,7 +1890,7 @@ herr_t H5TBcombine_tables( hid_t loc_id1,
*/
/* Open the 1st dataset. */
- if((dataset_id1 = H5Dopen( loc_id1, dset_name1 )) < 0)
+ if((dataset_id1 = H5Dopen2(loc_id1, dset_name1, H5P_DEFAULT)) < 0)
goto out;
/* Get the datatype */
@@ -2065,7 +2065,7 @@ herr_t H5TBcombine_tables( hid_t loc_id1,
*/
/* Open the dataset. */
- if((dataset_id2 = H5Dopen( loc_id2, dset_name2 )) < 0)
+ if((dataset_id2 = H5Dopen2(loc_id2, dset_name2, H5P_DEFAULT)) < 0)
goto out;
/* Get the datatype */
@@ -2255,7 +2255,7 @@ herr_t H5TBinsert_field( hid_t loc_id,
*/
/* Open the dataset. */
- if((dataset_id1 = H5Dopen( loc_id, dset_name )) < 0)
+ if((dataset_id1 = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0)
return -1;
/* Get creation properties list */
@@ -2430,9 +2430,9 @@ herr_t H5TBinsert_field( hid_t loc_id,
goto out;
/* Create xfer properties to preserve initialized data */
- if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0)
+ if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER)) < 0)
goto out;
- if (H5Pset_preserve (PRESERVE, 1)<0)
+ if (H5Pset_preserve (PRESERVE, 1) < 0)
goto out;
/* Only write if there is something to write */
@@ -2529,7 +2529,7 @@ herr_t H5TBinsert_field( hid_t loc_id,
return -1;
/* Open the dataset. */
- if((dataset_id1 = H5Dopen( loc_id, dset_name )) < 0)
+ if((dataset_id1 = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0)
return -1;
/* Get the datatype */
@@ -2702,7 +2702,7 @@ herr_t H5TBdelete_field( hid_t loc_id,
*/
/* Open the dataset. */
- if((dataset_id1 = H5Dopen( loc_id, dset_name )) < 0)
+ if((dataset_id1 = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0)
return -1;
/* Get creation properties list */
@@ -2914,9 +2914,9 @@ herr_t H5TBdelete_field( hid_t loc_id,
goto out;
/* Create xfer properties to preserve initialized data */
- if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0)
+ if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER)) < 0)
goto out;
- if (H5Pset_preserve (PRESERVE, 1)<0)
+ if (H5Pset_preserve (PRESERVE, 1) < 0)
goto out;
/* Write */
@@ -3014,7 +3014,7 @@ herr_t H5TBdelete_field( hid_t loc_id,
return -1;
/* Open the dataset. */
- if((dataset_id1 = H5Dopen( loc_id, dset_name )) < 0)
+ if((dataset_id1 = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0)
return -1;
/* Get the datatype */
@@ -3246,7 +3246,7 @@ herr_t H5TBget_table_info ( hid_t loc_id,
hsize_t n[1];
/* Open the dataset. */
- if((did = H5Dopen( loc_id, dset_name )) < 0)
+ if((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0)
return -1;
/* Get the datatype */
@@ -3275,7 +3275,7 @@ herr_t H5TBget_table_info ( hid_t loc_id,
if(has_attr == 1 )
{
/* Get the attribute */
- if(H5LTget_attribute(loc_id,dset_name,"NROWS",H5T_NATIVE_LLONG,n)<0)
+ if(H5LTget_attribute(loc_id,dset_name,"NROWS",H5T_NATIVE_LLONG,n) < 0)
return -1;
/**nrecords = *n;*/
@@ -3356,14 +3356,14 @@ herr_t H5TBget_field_info( hid_t loc_id,
hssize_t i;
/* Open the dataset. */
- if(( did = H5Dopen( loc_id, dset_name )) < 0)
+ if((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0)
goto out;
/* Get the datatype */
if(( ftype_id = H5Dget_type( did )) < 0)
goto out;
- if ((native_type_id = H5Tget_native_type(ftype_id,H5T_DIR_DEFAULT))<0)
+ if ((native_type_id = H5Tget_native_type(ftype_id,H5T_DIR_DEFAULT)) < 0)
goto out;
/* Get the type size */
@@ -3388,7 +3388,7 @@ herr_t H5TBget_field_info( hid_t loc_id,
/* Get the member type */
if(( member_type_id = H5Tget_member_type( ftype_id,(unsigned) i )) < 0)
goto out;
- if ((nativem_type_id = H5Tget_native_type(member_type_id,H5T_DIR_DEFAULT))<0)
+ if ((nativem_type_id = H5Tget_native_type(member_type_id,H5T_DIR_DEFAULT)) < 0)
goto out;
/* Get the member size */
@@ -3582,7 +3582,7 @@ hid_t H5TB_create_type(hid_t loc_id,
unsigned i;
/* get the number of fields */
- if (H5TBget_table_info(loc_id,dset_name,&nfields,NULL)<0)
+ if (H5TBget_table_info(loc_id,dset_name,&nfields,NULL) < 0)
return -1;
if ((fnames=malloc(sizeof(char*)*(size_t)nfields))==NULL)
@@ -3597,31 +3597,31 @@ hid_t H5TB_create_type(hid_t loc_id,
}
/* get field info */
- if(H5TBget_field_info(loc_id,dset_name,fnames,NULL,NULL,NULL)<0)
+ if(H5TBget_field_info(loc_id,dset_name,fnames,NULL,NULL,NULL) < 0)
goto out;
/* create the memory data type */
- if ((mem_type_id=H5Tcreate(H5T_COMPOUND,type_size))<0)
+ if ((mem_type_id=H5Tcreate(H5T_COMPOUND,type_size)) < 0)
goto out;
/* get each field ID and adjust its size, if necessary */
for ( i=0; i<nfields; i++)
{
- if ((mtype_id=H5Tget_member_type(ftype_id,i))<0)
+ if ((mtype_id=H5Tget_member_type(ftype_id,i)) < 0)
goto out;
- if ((nmtype_id=H5Tget_native_type(mtype_id,H5T_DIR_DEFAULT))<0)
+ if ((nmtype_id=H5Tget_native_type(mtype_id,H5T_DIR_DEFAULT)) < 0)
goto out;
size_native=H5Tget_size(nmtype_id);
if (field_sizes[i]!=size_native)
{
- if (H5Tset_size(nmtype_id,field_sizes[i])<0)
+ if (H5Tset_size(nmtype_id,field_sizes[i]) < 0)
goto out;
}
if (H5Tinsert(mem_type_id,fnames[i],field_offset[i],nmtype_id) < 0)
goto out;
- if (H5Tclose(mtype_id)<0)
+ if (H5Tclose(mtype_id) < 0)
goto out;
- if (H5Tclose(nmtype_id)<0)
+ if (H5Tclose(nmtype_id) < 0)
goto out;
}
@@ -3706,11 +3706,11 @@ herr_t H5TB_common_append_records( hid_t dataset_id,
/* Define a hyperslab in the dataset */
offset[0] = orig_table_size;
count[0] = nrecords;
- if(H5Sselect_hyperslab( space_id, H5S_SELECT_SET, offset, NULL, count, NULL)<0)
+ if(H5Sselect_hyperslab( space_id, H5S_SELECT_SET, offset, NULL, count, NULL) < 0)
goto out;
/* Write the records */
- if(H5Dwrite( dataset_id, mem_type_id, mem_space_id, space_id, H5P_DEFAULT, data )<0)
+ if(H5Dwrite( dataset_id, mem_type_id, mem_space_id, space_id, H5P_DEFAULT, data ) < 0)
goto out;
/* Terminate access to the dataspace */
@@ -3781,7 +3781,7 @@ herr_t H5TB_common_read_records( hid_t dataset_id,
mem_size[0] = count[0];
if ((mem_space_id = H5Screate_simple( 1, mem_size, NULL )) < 0)
goto out;
- if ((H5Dread( dataset_id, mem_type_id, mem_space_id, space_id, H5P_DEFAULT, data))<0)
+ if ((H5Dread( dataset_id, mem_type_id, mem_space_id, space_id, H5P_DEFAULT, data)) < 0)
goto out;
/* Terminate access to the memory dataspace */
diff --git a/hl/src/Makefile.am b/hl/src/Makefile.am
index f7e1f8e..37bff7b 100644
--- a/hl/src/Makefile.am
+++ b/hl/src/Makefile.am
@@ -26,7 +26,7 @@ AM_CPPFLAGS=-I$(top_srcdir)/src
# This library is our main target.
lib_LTLIBRARIES=libhdf5_hl.la
-libhdf5_hl_la_SOURCES=H5LT.c H5TB.c H5IM.c H5DS.c H5PT.c H5LTparse.c H5LTanalyze.c
+libhdf5_hl_la_SOURCES=H5DS.c H5IM.c H5LT.c H5LTanalyze.c H5LTparse.c H5PT.c H5TB.c
# Public header files (to be installed)
include_HEADERS=hdf5_hl.h H5IMpublic.h H5LTpublic.h H5TBpublic.h H5DSpublic.h H5PTpublic.h