[svn-r11245] Purpose:

Code cleanup

Description:
    Trim trailing whitespace, which is making 'diff'ing the two branches
difficult.

Solution:
    Ran this script in each directory:

foreach f (*.[ch] *.cpp)
    sed 's/[[:blank:]]*$//' $f > sed.out && mv sed.out $f
end


Platforms tested:
    FreeBSD 4.11 (sleipnir)
    Too minor to require h5committest
This commit is contained in:
Quincey Koziol
2005-08-13 15:53:35 -05:00
parent 6562465a2c
commit 6b45f5172c
449 changed files with 16817 additions and 16817 deletions
+40 -40
View File
@@ -12,11 +12,11 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
/*
* This example shows how to read data from a chunked dataset.
* We will read from the file created by extend.C
* We will read from the file created by extend.C
*/
#include <string>
#ifdef OLD_HEADER_FILENAME
@@ -55,7 +55,7 @@ int main (void)
*/
H5File file( FILE_NAME, H5F_ACC_RDONLY );
DataSet dataset = file.openDataSet( DATASET_NAME );
/*
* Get filespace for rank and dimension
*/
@@ -69,18 +69,18 @@ int main (void)
/*
* Get and print the dimension sizes of the file dataspace
*/
hsize_t dims[2]; // dataset dimensions
hsize_t dims[2]; // dataset dimensions
rank = filespace.getSimpleExtentDims( dims );
cout << "dataset rank = " << rank << ", dimensions "
cout << "dataset rank = " << rank << ", dimensions "
<< (unsigned long)(dims[0]) << " x " << (unsigned long)(dims[1])
<< endl;
/*
* Get creation properties list.
*/
DSetCreatPropList cparms = dataset.getCreatePlist();
DSetCreatPropList cparms = dataset.getCreatePlist();
/*
/*
* Check if dataset is chunked.
*/
hsize_t chunk_dims[2];
@@ -91,16 +91,16 @@ int main (void)
* Get chunking information: rank and dimensions
*/
rank_chunk = cparms.getChunk( 2, chunk_dims);
cout << "chunk rank " << rank_chunk << "dimensions "
<< (unsigned long)(chunk_dims[0]) << " x "
cout << "chunk rank " << rank_chunk << "dimensions "
<< (unsigned long)(chunk_dims[0]) << " x "
<< (unsigned long)(chunk_dims[1]) << endl;
}
/*
* Define the memory space to read dataset.
*/
DataSpace mspace1( RANK, dims );
/*
* Read dataset back and display.
*/
@@ -113,23 +113,23 @@ int main (void)
for (i = 0; i < dims[1]; i++)
cout << data_out[j][i] << " ";
cout << endl;
}
}
/*
* dataset rank 2, dimensions 10 x 5
* chunk rank 2, dimensions 2 x 5
* dataset rank 2, dimensions 10 x 5
* chunk rank 2, dimensions 2 x 5
* Dataset:
* 1 1 1 3 3
* 1 1 1 3 3
* 1 1 1 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 1 1 1 3 3
* 1 1 1 3 3
* 1 1 1 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 2 0 0 0 0
*/
/*
@@ -157,17 +157,17 @@ int main (void)
cout << column[i] << endl;
/*
* Third column:
* 1
* 1
* 1
* 0
* 0
* 0
* 0
* 0
* 0
* 0
* Third column:
* 1
* 1
* 1
* 0
* 0
* 0
* 0
* 0
* 0
* 0
*/
/*
@@ -196,11 +196,11 @@ int main (void)
for (i = 0; i < chunk_dims[1]; i++)
cout << chunk_out[j][i] << " ";
cout << endl;
}
}
/*
* Chunk:
* 1 1 1 0 0
* 2 0 0 0 0
* Chunk:
* 1 1 1 0 0
* 2 0 0 0 0
*/
} // end of try block
+8 -8
View File
@@ -45,7 +45,7 @@ int main(void)
typedef struct s1_t {
int a;
float b;
double c;
double c;
} s1_t;
/* Second structure (subset of s1_t) and dataset*/
@@ -87,21 +87,21 @@ int main(void)
H5File* file = new H5File( FILE_NAME, H5F_ACC_TRUNC );
/*
* Create the memory datatype.
* Create the memory datatype.
*/
CompType mtype1( sizeof(s1_t) );
mtype1.insertMember( MEMBER1, HOFFSET(s1_t, a), PredType::NATIVE_INT);
mtype1.insertMember( MEMBER3, HOFFSET(s1_t, c), PredType::NATIVE_DOUBLE);
mtype1.insertMember( MEMBER2, HOFFSET(s1_t, b), PredType::NATIVE_FLOAT);
/*
/*
* Create the dataset.
*/
DataSet* dataset;
dataset = new DataSet( file->createDataSet( DATASET_NAME, mtype1, space ));
/*
* Wtite data to the dataset;
* Wtite data to the dataset;
*/
dataset->write( s1, mtype1 );
@@ -110,7 +110,7 @@ int main(void)
*/
delete dataset;
delete file;
// Get the class of the first member in mtype1, then get its type
H5T_class_t member1_class = mtype1.getMemberClass( 2 );
if( member1_class == H5T_FLOAT )
@@ -127,7 +127,7 @@ int main(void)
file = new H5File( FILE_NAME, H5F_ACC_RDONLY );
dataset = new DataSet (file->openDataSet( DATASET_NAME ));
/*
/*
* Create a datatype for s2
*/
CompType mtype2( sizeof(s2_t) );
@@ -151,11 +151,11 @@ int main(void)
cout << endl;
cout << endl << "Field a : " << endl;
for( i = 0; i < LENGTH; i++)
for( i = 0; i < LENGTH; i++)
cout << s2[i].a << " ";
cout << endl;
/*
/*
* Create a datatype for s3.
*/
CompType mtype3( sizeof(float) );
+9 -9
View File
@@ -12,10 +12,10 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
/*
* This example writes a dataset to a new HDF5 file.
*/
#include <string>
#ifdef OLD_HEADER_FILENAME
@@ -37,8 +37,8 @@ const int RANK = 2;
int main (void)
{
/*
* Data initialization.
/*
* Data initialization.
*/
int i, j;
int data[NX][NY]; // buffer for data to write
@@ -46,9 +46,9 @@ int main (void)
{
for (i = 0; i < NY; i++)
data[j][i] = i + j;
}
}
/*
* 0 1 2 3 4 5
* 0 1 2 3 4 5
* 1 2 3 4 5 6
* 2 3 4 5 6 7
* 3 4 5 6 7 8
@@ -73,12 +73,12 @@ int main (void)
/*
* Define the size of the array and create the data space for fixed
* size dataset.
* size dataset.
*/
hsize_t dimsf[2]; // dataset dimensions
dimsf[0] = NX;
dimsf[1] = NY;
DataSpace dataspace( RANK, dimsf );
DataSpace dataspace( RANK, dimsf );
/*
* Define datatype for the data in the file.
@@ -129,5 +129,5 @@ int main (void)
}
return 0; // successfully terminated
}
}
+24 -24
View File
@@ -12,13 +12,13 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
/*
* This example shows how to work with extendible dataset.
* In the current version of the library dataset MUST be
* chunked.
*
*
*/
#include <string>
#ifdef OLD_HEADER_FILENAME
@@ -52,18 +52,18 @@ int main (void)
Exception::dontPrint();
/*
* Create the data space with unlimited dimensions.
* Create the data space with unlimited dimensions.
*/
hsize_t dims[2] = { 3, 3}; // dataset dimensions at creation
hsize_t dims[2] = { 3, 3}; // dataset dimensions at creation
hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED};
DataSpace mspace1( RANK, dims, maxdims);
DataSpace mspace1( RANK, dims, maxdims);
/*
* Create a new file. If file exists its contents will be overwritten.
*/
H5File file( FILE_NAME, H5F_ACC_TRUNC );
/*
/*
* Modify dataset creation properties, i.e. enable chunking.
*/
DSetCreatPropList cparms;
@@ -87,8 +87,8 @@ int main (void)
* Extend the dataset. This call assures that dataset is at least 3 x 3.
*/
hsize_t size[2];
size[0] = 3;
size[1] = 3;
size[0] = 3;
size[1] = 3;
dataset.extend( size );
/*
@@ -98,24 +98,24 @@ int main (void)
hsize_t offset[2];
offset[0] = 0;
offset[1] = 0;
hsize_t dims1[2] = { 3, 3}; /* data1 dimensions */
fspace1.selectHyperslab( H5S_SELECT_SET, dims1, offset );
hsize_t dims1[2] = { 3, 3}; /* data1 dimensions */
fspace1.selectHyperslab( H5S_SELECT_SET, dims1, offset );
/*
* Write the data to the hyperslab.
*/
int data1[3][3] = { {1, 1, 1}, /* data to write */
{1, 1, 1},
{1, 1, 1} };
{1, 1, 1} };
dataset.write( data1, PredType::NATIVE_INT, mspace1, fspace1 );
/*
* Extend the dataset. Dataset becomes 10 x 3.
*/
hsize_t dims2[2] = { 7, 1}; /* data2 dimensions */
hsize_t dims2[2] = { 7, 1}; /* data2 dimensions */
dims[0] = dims1[0] + dims2[0];
size[0] = dims[0];
size[1] = dims[1];
size[0] = dims[0];
size[1] = dims[1];
dataset.extend( size );
/*
@@ -124,12 +124,12 @@ int main (void)
DataSpace fspace2 = dataset.getSpace ();
offset[0] = 3;
offset[1] = 0;
fspace2.selectHyperslab( H5S_SELECT_SET, dims2, offset );
fspace2.selectHyperslab( H5S_SELECT_SET, dims2, offset );
/*
* Define memory space
*/
DataSpace mspace2( RANK, dims2 );
DataSpace mspace2( RANK, dims2 );
/*
* Write the data to the hyperslab.
@@ -140,10 +140,10 @@ int main (void)
/*
* Extend the dataset. Dataset becomes 10 x 5.
*/
hsize_t dims3[2] = { 2, 2}; /* data3 dimensions */
hsize_t dims3[2] = { 2, 2}; /* data3 dimensions */
dims[1] = dims1[1] + dims3[1];
size[0] = dims[0];
size[1] = dims[1];
size[0] = dims[0];
size[1] = dims[1];
dataset.extend( size );
/*
@@ -152,12 +152,12 @@ int main (void)
DataSpace fspace3 = dataset.getSpace ();
offset[0] = 0;
offset[1] = 3;
fspace3.selectHyperslab( H5S_SELECT_SET, dims3, offset );
fspace3.selectHyperslab( H5S_SELECT_SET, dims3, offset );
/*
* Define memory space.
*/
DataSpace mspace3( RANK, dims3 );
DataSpace mspace3( RANK, dims3 );
/*
* Write the data to the hyperslab.
@@ -178,7 +178,7 @@ int main (void)
dataset.read( data_out, PredType::NATIVE_INT );
/*
* Resulting dataset
*
*
* 1 1 1 3 3
* 1 1 1 3 3
* 1 1 1 0 0
@@ -229,4 +229,4 @@ int main (void)
return -1;
}
return 0;
}
}
+14 -14
View File
@@ -13,13 +13,13 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* This example creates a group in the file and dataset in the group.
* This example creates a group in the file and dataset in the group.
* Hard link to the group object is created and the dataset is accessed
* under different names.
* under different names.
* Iterator function is used to find the object names in the root group.
* Note that the C++ API iterator function is not completed yet, thus
* the C version is used in this example.
*/
*/
#include <string>
#ifdef OLD_HEADER_FILENAME
@@ -67,9 +67,9 @@ int main(void)
/*
* Create dataset "Compressed Data" in the group using absolute
* name. Dataset creation property list is modified to use
* GZIP compression with the compression effort set to 6.
* Note that compression can be used only when dataset is chunked.
* name. Dataset creation property list is modified to use
* GZIP compression with the compression effort set to 6.
* Note that compression can be used only when dataset is chunked.
*/
dims[0] = 1000;
dims[1] = 20;
@@ -92,13 +92,13 @@ int main(void)
delete file;
/*
* Now reopen the file and group in the file.
* Now reopen the file and group in the file.
*/
file = new H5File( FILE_NAME, H5F_ACC_RDWR );
group = new Group( file->openGroup( "Data" ));
/*
* Access "Compressed_Data" dataset in the group.
* Access "Compressed_Data" dataset in the group.
*/
try { // to determine if the dataset exists in the group
dataset = new DataSet( group->openDataSet( "Compressed_Data" ));
@@ -121,11 +121,11 @@ int main(void)
/*
* We can access "Compressed_Data" dataset using created
* hard link "Data_new".
* hard link "Data_new".
*/
try { // to determine if the dataset exists in the file
dataset = new DataSet( file->openDataSet( "/Data_new/Compressed_Data" ));
}
}
catch( FileIException not_found_error )
{
cout << " Dataset is not found." << endl;
@@ -150,9 +150,9 @@ int main(void)
* of the objects in the file root direvtory.
*/
cout << "Unlinking..." << endl;
try { // attempt to unlink the dataset
try { // attempt to unlink the dataset
file->unlink( "Data" );
}
}
catch( FileIException unlink_error )
{
cout << " unlink failed." << endl;
@@ -211,12 +211,12 @@ file_info(hid_t loc_id, const char *name, void *opdata)
* Open the group using its name.
*/
group = H5Gopen(loc_id, name);
/*
* Display group name.
*/
cout << "Name : " << name << endl;
H5Gclose(group);
return 0;
}
+10 -10
View File
@@ -12,10 +12,10 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
//
//
// This example reads hyperslab from the SDS.h5 file into
// two-dimensional plane of a three-dimensional array. Various
// information about the dataset in the SDS.h5 file is obtained.
// two-dimensional plane of a three-dimensional array. Various
// information about the dataset in the SDS.h5 file is obtained.
//
#include <string>
@@ -54,7 +54,7 @@ int main (void)
for (k = 0; k < NZ ; k++)
data_out[j][i][k] = 0;
}
}
}
/*
* Try block to detect exceptions raised by any of the calls inside it
@@ -125,7 +125,7 @@ int main (void)
(unsigned long)(dims_out[1]) << endl;
/*
* Define hyperslab in the dataset; implicitly giving strike and
* Define hyperslab in the dataset; implicitly giving strike and
* block NULL.
*/
hsize_t offset[2]; // hyperslab offset in the file
@@ -143,10 +143,10 @@ int main (void)
dimsm[0] = NX;
dimsm[1] = NY;
dimsm[2] = NZ ;
DataSpace memspace( RANK_OUT, dimsm );
DataSpace memspace( RANK_OUT, dimsm );
/*
* Define memory hyperslab.
* Define memory hyperslab.
*/
hsize_t offset_out[3]; // hyperslab offset in memory
hsize_t count_out[3]; // size of the hyperslab in memory
@@ -159,7 +159,7 @@ int main (void)
memspace.selectHyperslab( H5S_SELECT_SET, count_out, offset_out );
/*
* Read data from hyperslab in the file into the hyperslab in
* Read data from hyperslab in the file into the hyperslab in
* memory and display the data.
*/
dataset.read( data_out, PredType::NATIVE_INT, memspace, dataspace );
@@ -174,7 +174,7 @@ int main (void)
* 0 0 0 0 0 0 0
* 0 0 0 0 0 0 0
* 0 0 0 0 0 0 0
* 3 4 5 6 0 0 0
* 3 4 5 6 0 0 0
* 4 5 6 7 0 0 0
* 5 6 7 8 0 0 0
* 0 0 0 0 0 0 0
@@ -210,5 +210,5 @@ int main (void)
}
return 0; // successfully terminated
}
}
+24 -24
View File
@@ -12,15 +12,15 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
/*
* This program shows how the select_hyperslab and select_elements
* functions are used to write selected data from memory to the file.
* Program takes 48 elements from the linear buffer and writes them into
* the matrix using 3x2 blocks, (4,3) stride and (2,4) count.
* Then four elements of the matrix are overwritten with the new values and
* the matrix using 3x2 blocks, (4,3) stride and (2,4) count.
* Then four elements of the matrix are overwritten with the new values and
* file is closed. Program reopens the file and reads and displays the result.
*/
*/
#include <string>
#ifdef OLD_HEADER_FILENAME
@@ -29,7 +29,7 @@
#include <iostream>
#endif
#include "H5Cpp.h"
#ifndef H5_NO_NAMESPACE
using namespace H5;
#endif
@@ -42,7 +42,7 @@ const int MSPACE2_RANK = 1; // Rank of the second dataset in memory
const int MSPACE2_DIM = 4; // Dataset size in memory
const int FSPACE_RANK = 2; // Dataset rank as it is stored in the file
const int FSPACE_DIM1 = 8; // Dimension sizes of the dataset as it is...
const int FSPACE_DIM2 = 12; // ...stored in the file
const int FSPACE_DIM2 = 12; // ...stored in the file
const int MSPACE_DIM1 = 8; // We will read dataset back from the file...
const int MSPACE_DIM2 = 12; // ...to the dataset in memory with these ...
// ...dataspace parameters
@@ -90,12 +90,12 @@ int main (void)
/*
* Create dataset and write it into the file.
*/
DataSet* dataset = new DataSet(
DataSet* dataset = new DataSet(
file->createDataSet( DATASET_NAME, PredType::NATIVE_INT, fspace ));
dataset->write( matrix, PredType::NATIVE_INT );
/*
* Select hyperslab for the dataset in the file, using 3x2 blocks,
* Select hyperslab for the dataset in the file, using 3x2 blocks,
* (4,3) stride and (2,4) count starting at the position (0,1).
*/
hsize_t start[2]; // Start of hyperslab
@@ -104,20 +104,20 @@ int main (void)
hsize_t block[2]; // Block sizes
start[0] = 0; start[1] = 1;
stride[0] = 4; stride[1] = 3;
count[0] = 2; count[1] = 4;
count[0] = 2; count[1] = 4;
block[0] = 3; block[1] = 2;
fspace.selectHyperslab( H5S_SELECT_SET, count, start, stride, block);
/*
* Create dataspace for the first dataset.
*/
hsize_t dim1[] = {MSPACE1_DIM}; /* Dimension size of the first dataset
(in memory) */
hsize_t dim1[] = {MSPACE1_DIM}; /* Dimension size of the first dataset
(in memory) */
DataSpace mspace1( MSPACE1_RANK, dim1 );
/*
* Select hyperslab.
* We will use 48 elements of the vector buffer starting at the
* Select hyperslab.
* We will use 48 elements of the vector buffer starting at the
* second element. Selected elements are 1 2 3 . . . 48
*/
start[0] = 1;
@@ -125,12 +125,12 @@ int main (void)
count[0] = 48;
block[0] = 1;
mspace1.selectHyperslab( H5S_SELECT_SET, count, start, stride, block);
/*
* Write selection from the vector buffer to the dataset in the file.
*
* File dataset should look like this:
* 0 1 2 0 3 4 0 5 6 0 7 8
* File dataset should look like this:
* 0 1 2 0 3 4 0 5 6 0 7 8
* 0 9 10 0 11 12 0 13 14 0 15 16
* 0 17 18 0 19 20 0 21 22 0 23 24
* 0 0 0 0 0 0 0 0 0 0 0 0
@@ -150,14 +150,14 @@ int main (void)
* Create dataspace for the second dataset.
*/
hsize_t dim2[] = {MSPACE2_DIM}; /* Dimension size of the second dataset
(in memory */
(in memory */
DataSpace mspace2( MSPACE2_RANK, dim2 );
/*
* Select sequence of NPOINTS points in the file dataspace.
*/
hsize_t coord[NPOINTS][FSPACE_RANK]; /* Array to store selected points
from the file dataspace */
hsize_t coord[NPOINTS][FSPACE_RANK]; /* Array to store selected points
from the file dataspace */
coord[0][0] = 0; coord[0][1] = 0;
coord[1][0] = 3; coord[1][1] = 3;
coord[2][0] = 3; coord[2][1] = 5;
@@ -169,11 +169,11 @@ int main (void)
* Write new selection of points to the dataset.
*/
int values[] = {53, 59, 61, 67}; /* New values to be written */
dataset->write( values, PredType::NATIVE_INT, mspace2, fspace );
dataset->write( values, PredType::NATIVE_INT, mspace2, fspace );
/*
* File dataset should look like this:
* 53 1 2 0 3 4 0 5 6 0 7 8
* File dataset should look like this:
* 53 1 2 0 3 4 0 5 6 0 7 8
* 0 9 10 0 11 12 0 13 14 0 15 16
* 0 17 18 0 19 20 0 21 22 0 23 24
* 0 0 0 59 0 61 0 0 0 0 0 0
@@ -181,7 +181,7 @@ int main (void)
* 0 33 34 0 35 36 67 37 38 0 39 40
* 0 41 42 0 43 44 0 45 46 0 47 48
* 0 0 0 0 0 0 0 0 0 0 0 0
*
*
*/
/*
+23 -23
View File
@@ -51,7 +51,7 @@ AbstractDs::AbstractDs( const AbstractDs& original ) : H5Object( original ) {}
//--------------------------------------------------------------------------
// Function: AbstractDs::getTypeClass
///\brief Returns the class of the datatype that is used by this
///\brief Returns the class of the datatype that is used by this
/// object, which can be a dataset or an attribute.
///\return Datatype class identifier
///\exception H5::DataTypeIException
@@ -60,7 +60,7 @@ AbstractDs::AbstractDs( const AbstractDs& original ) : H5Object( original ) {}
H5T_class_t AbstractDs::getTypeClass() const
{
// Gets the datatype used by this dataset or attribute.
// p_get_type calls either H5Dget_type or H5Aget_type depending on
// p_get_type calls either H5Dget_type or H5Aget_type depending on
// which object invokes getTypeClass
hid_t datatype_id;
try {
@@ -79,7 +79,7 @@ H5T_class_t AbstractDs::getTypeClass() const
return( type_class );
else
{
throw DataTypeIException(inMemFunc("getTypeClass"),
throw DataTypeIException(inMemFunc("getTypeClass"),
"H5Tget_class returns H5T_NO_CLASS");
}
}
@@ -95,8 +95,8 @@ H5T_class_t AbstractDs::getTypeClass() const
DataType AbstractDs::getDataType() const
{
// Gets the id of the datatype used by this dataset or attribute using
// p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
// depending on which object invokes getDataType. Then, create and
// p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
// depending on which object invokes getDataType. Then, create and
// return the DataType object
try {
DataType datatype(p_get_type());
@@ -121,8 +121,8 @@ DataType AbstractDs::getDataType() const
ArrayType AbstractDs::getArrayType() const
{
// Gets the id of the datatype used by this dataset or attribute using
// p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
// depending on which object invokes getArrayType. Then, create and
// p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
// depending on which object invokes getArrayType. Then, create and
// return the ArrayType object
try {
ArrayType arraytype(p_get_type());
@@ -138,7 +138,7 @@ ArrayType AbstractDs::getArrayType() const
//--------------------------------------------------------------------------
// Function: AbstractDs::getCompType
///\brief Returns the compound datatype of this abstract dataset which
///\brief Returns the compound datatype of this abstract dataset which
/// can be a dataset or an attribute.
///\return CompType instance
///\exception H5::DataTypeIException
@@ -147,8 +147,8 @@ ArrayType AbstractDs::getArrayType() const
CompType AbstractDs::getCompType() const
{
// Gets the id of the datatype used by this dataset or attribute using
// p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
// depending on which object invokes getCompType. Then, create and
// p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
// depending on which object invokes getCompType. Then, create and
// return the CompType object
try {
CompType comptype(p_get_type());
@@ -164,7 +164,7 @@ CompType AbstractDs::getCompType() const
//--------------------------------------------------------------------------
// Function: AbstractDs::getEnumType
///\brief Returns the enumeration datatype of this abstract dataset which
///\brief Returns the enumeration datatype of this abstract dataset which
/// can be a dataset or an attribute.
///\return EnumType instance
///\exception H5::DataTypeIException
@@ -173,8 +173,8 @@ CompType AbstractDs::getCompType() const
EnumType AbstractDs::getEnumType() const
{
// Gets the id of the datatype used by this dataset or attribute using
// p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
// depending on which object invokes getEnumType. Then, create and
// p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
// depending on which object invokes getEnumType. Then, create and
// return the EnumType object
try {
EnumType enumtype(p_get_type());
@@ -190,7 +190,7 @@ EnumType AbstractDs::getEnumType() const
//--------------------------------------------------------------------------
// Function: AbstractDs::getIntType
///\brief Returns the integer datatype of this abstract dataset which
///\brief Returns the integer datatype of this abstract dataset which
/// can be a dataset or an attribute.
///\return IntType instance
///\exception H5::DataTypeIException
@@ -199,8 +199,8 @@ EnumType AbstractDs::getEnumType() const
IntType AbstractDs::getIntType() const
{
// Gets the id of the datatype used by this dataset or attribute using
// p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
// depending on which object invokes getIntType. Then, create and
// p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
// depending on which object invokes getIntType. Then, create and
// return the IntType object
try {
IntType inttype(p_get_type());
@@ -225,8 +225,8 @@ IntType AbstractDs::getIntType() const
FloatType AbstractDs::getFloatType() const
{
// Gets the id of the datatype used by this dataset or attribute using
// p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
// depending on which object invokes getFloatType. Then, create and
// p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
// depending on which object invokes getFloatType. Then, create and
// return the FloatType object
try {
FloatType floatype(p_get_type());
@@ -242,7 +242,7 @@ FloatType AbstractDs::getFloatType() const
//--------------------------------------------------------------------------
// Function: AbstractDs::getStrType
///\brief Returns the string datatype of this abstract dataset which
///\brief Returns the string datatype of this abstract dataset which
/// can be a dataset or an attribute.
///\return StrType instance
///\exception H5::DataTypeIException
@@ -251,8 +251,8 @@ FloatType AbstractDs::getFloatType() const
StrType AbstractDs::getStrType() const
{
// Gets the id of the datatype used by this dataset or attribute using
// p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
// depending on which object invokes getStrType. Then, create and
// p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
// depending on which object invokes getStrType. Then, create and
// return the StrType object
try {
StrType strtype(p_get_type());
@@ -277,8 +277,8 @@ StrType AbstractDs::getStrType() const
VarLenType AbstractDs::getVarLenType() const
{
// Gets the id of the datatype used by this dataset or attribute using
// p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
// depending on which object invokes getVarLenType. Then, create and
// p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
// depending on which object invokes getVarLenType. Then, create and
// return the VarLenType object
try {
VarLenType varlentype(p_get_type());
+6 -6
View File
@@ -35,9 +35,9 @@ class VarLenType;
class H5_DLLCPP AbstractDs : public H5Object {
public:
// Gets a copy the datatype of that this abstract dataset uses.
// Note that this datatype is a generic one and can only be accessed
// via generic member functions, i.e., member functions belong
// to DataType. To get specific datatype, i.e. EnumType, FloatType,
// Note that this datatype is a generic one and can only be accessed
// via generic member functions, i.e., member functions belong
// to DataType. To get specific datatype, i.e. EnumType, FloatType,
// etc..., use the specific functions, that follow, instead.
DataType getDataType() const;
@@ -53,11 +53,11 @@ class H5_DLLCPP AbstractDs : public H5Object {
// Gets the dataspace of this abstract dataset - pure virtual.
virtual DataSpace getSpace() const = 0;
// Gets the class of the datatype that is used by this abstract
// Gets the class of the datatype that is used by this abstract
// dataset.
H5T_class_t getTypeClass() const;
// Returns the amount of storage size required for this abstract
// Returns the amount of storage size required for this abstract
// dataset - pure virtual.
virtual hsize_t getStorageSize() const = 0;
@@ -65,7 +65,7 @@ class H5_DLLCPP AbstractDs : public H5Object {
AbstractDs( const AbstractDs& original );
// Destructor
virtual ~AbstractDs();
virtual ~AbstractDs();
protected:
// Default constructor
+10 -10
View File
@@ -33,11 +33,11 @@ namespace H5 {
///\brief Default constructor: Creates a stub ArrayType
// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
ArrayType::ArrayType() : DataType()
ArrayType::ArrayType() : DataType()
{
// Initialize members
rank = -1;
dimensions = NULL;
dimensions = NULL;
}
//--------------------------------------------------------------------------
@@ -47,7 +47,7 @@ ArrayType::ArrayType() : DataType()
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
ArrayType::ArrayType( const hid_t existing_id ) : DataType( existing_id )
ArrayType::ArrayType( const hid_t existing_id ) : DataType( existing_id )
{
// Get the rank of the existing array and store it in this array
rank = H5Tget_array_ndims(existing_id);
@@ -71,17 +71,17 @@ ArrayType::ArrayType( const hid_t existing_id ) : DataType( existing_id )
///\brief Copy constructor: makes a copy of the original ArrayType object.
// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
ArrayType::ArrayType( const ArrayType& original ) : DataType( original )
ArrayType::ArrayType( const ArrayType& original ) : DataType( original )
{
rank = original.rank;
dimensions = new hsize_t[rank];
for (int i = 0; i < rank; i++)
dimensions[i] = original.dimensions[i];
dimensions[i] = original.dimensions[i];
}
//--------------------------------------------------------------------------
// Function: ArrayType overloaded constructor
///\brief Creates a new array data type based on the specified
///\brief Creates a new array data type based on the specified
/// \a base_type.
///\param base_type - IN: Existing datatype
///\param ndims - IN: Rank of the array, [0..H5S_MAX_RANK]
@@ -100,7 +100,7 @@ ArrayType::ArrayType(const DataType& base_type, int ndims, const hsize_t* dims)
rank = ndims;
dimensions = new hsize_t[rank];
for (int i = 0; i < rank; i++)
dimensions[i] = dims[i];
dimensions[i] = dims[i];
}
//--------------------------------------------------------------------------
@@ -147,11 +147,11 @@ int ArrayType::getArrayDims(hsize_t* dims)
rank = ndims;
dimensions = new hsize_t[rank];
for (int i = 0; i < rank; i++)
dimensions[i] = dims[i];
dimensions[i] = dims[i];
}
// otherwise, simply copy what's in 'dimensions' to 'dims'
for (int i = 0; i < rank; i++)
dims[i] = dimensions[i];
dims[i] = dimensions[i];
return(rank);
}
@@ -160,7 +160,7 @@ int ArrayType::getArrayDims(hsize_t* dims)
///\brief Properly terminates access to this array datatype.
// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
ArrayType::~ArrayType()
ArrayType::~ArrayType()
{
// Free allocated memory
if (dimensions != NULL)
+1 -1
View File
@@ -24,7 +24,7 @@ namespace H5 {
#endif
class H5_DLLCPP ArrayType : public DataType {
public:
// Constructor that creates a new array data type based on the
// Constructor that creates a new array data type based on the
// specified base type.
ArrayType(const DataType& base_type, int ndims, const hsize_t* dims);
+17 -17
View File
@@ -55,7 +55,7 @@ AtomType::AtomType( const AtomType& original ) : DataType( original ) {}
//--------------------------------------------------------------------------
// Function: AtomType::setSize
///\brief Sets the total size for an atomic datatype.
///\brief Sets the total size for an atomic datatype.
///\param size - IN: Size to set
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
@@ -88,7 +88,7 @@ H5T_order_t AtomType::getOrder() const
// return a byte order constant if successful
if( type_order == H5T_ORDER_ERROR )
{
throw DataTypeIException(inMemFunc("getOrder"),
throw DataTypeIException(inMemFunc("getOrder"),
"H5Tget_order returns H5T_ORDER_ERROR");
}
return( type_order );
@@ -148,12 +148,12 @@ void AtomType::setOrder( H5T_order_t order ) const
//--------------------------------------------------------------------------
// Function: AtomType::getPrecision
///\brief Returns the precision of an atomic datatype.
///\return Number of significant bits
///\brief Returns the precision of an atomic datatype.
///\return Number of significant bits
///\exception H5::DataTypeIException
///\par Description
/// The precision is the number of significant bits which,
/// unless padding is present, is 8 times larger than the
/// The precision is the number of significant bits which,
/// unless padding is present, is 8 times larger than the
/// value returned by \c DataType::getSize().
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -172,7 +172,7 @@ size_t AtomType::getPrecision() const
//--------------------------------------------------------------------------
// Function: AtomType::setPrecision
///\brief Sets the precision of an atomic datatype.
///\brief Sets the precision of an atomic datatype.
///\param precision - IN: Number of bits of precision
///\exception H5::DataTypeIException
///\par Description
@@ -192,7 +192,7 @@ void AtomType::setPrecision( size_t precision ) const
//--------------------------------------------------------------------------
// Function: AtomType::getOffset
///\brief Retrieves the bit offset of the first significant bit.
///\brief Retrieves the bit offset of the first significant bit.
///\return Offset value
///\exception H5::DataTypeIException
///\par Description
@@ -219,7 +219,7 @@ int AtomType::getOffset() const
//--------------------------------------------------------------------------
// Function: AtomType::setOffset
///\brief Sets the bit offset of the first significant bit.
///\brief Sets the bit offset of the first significant bit.
///\param offset - IN: Offset of first significant bit
///\exception H5::DataTypeIException
///\par Description
@@ -239,16 +239,16 @@ void AtomType::setOffset( size_t offset ) const
//--------------------------------------------------------------------------
// Function: AtomType::getPad
///\brief Retrieves the padding type of the least and most-significant
/// bit padding.
///\brief Retrieves the padding type of the least and most-significant
/// bit padding.
///\param lsb - OUT: Least-significant bit padding type
///\param msb - OUT: Most-significant bit padding type
///\exception H5::DataTypeIException
///\par Description
/// Possible values for \a lsb and \a msb include:
/// \li \c H5T_PAD_ZERO (0) - Set background to zeros.
/// \li \c H5T_PAD_ONE (1) - Set background to ones.
/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone.
/// \li \c H5T_PAD_ZERO (0) - Set background to zeros.
/// \li \c H5T_PAD_ONE (1) - Set background to ones.
/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void AtomType::getPad( H5T_pad_t& lsb, H5T_pad_t& msb ) const
@@ -269,9 +269,9 @@ void AtomType::getPad( H5T_pad_t& lsb, H5T_pad_t& msb ) const
///\exception H5::DataTypeIException
///\par Description
/// Valid values for \a lsb and \a msb include:
/// \li \c H5T_PAD_ZERO (0) - Set background to zeros.
/// \li \c H5T_PAD_ONE (1) - Set background to ones.
/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone.
/// \li \c H5T_PAD_ZERO (0) - Set background to zeros.
/// \li \c H5T_PAD_ONE (1) - Set background to ones.
/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void AtomType::setPad( H5T_pad_t lsb, H5T_pad_t msb ) const
+8 -8
View File
@@ -26,33 +26,33 @@ namespace H5 {
#endif
class H5_DLLCPP AtomType : public DataType {
public:
// Returns the byte order of an atomic datatype.
// Returns the byte order of an atomic datatype.
H5T_order_t getOrder( string& order_string ) const;
H5T_order_t getOrder() const;
// Sets the byte ordering of an atomic datatype.
// Sets the byte ordering of an atomic datatype.
void setOrder( H5T_order_t order ) const;
// Retrieves the bit offset of the first significant bit.
// Retrieves the bit offset of the first significant bit.
// 12/05/00 - changed return type to int from size_t - C API
int getOffset() const;
// Sets the bit offset of the first significant bit.
// Sets the bit offset of the first significant bit.
void setOffset( size_t offset ) const;
// Retrieves the padding type of the least and most-significant bit padding.
// Retrieves the padding type of the least and most-significant bit padding.
void getPad( H5T_pad_t& lsb, H5T_pad_t& msb ) const;
// Sets the least and most-significant bits padding types
void setPad( H5T_pad_t lsb, H5T_pad_t msb ) const;
// Returns the precision of an atomic datatype.
// Returns the precision of an atomic datatype.
size_t getPrecision() const;
// Sets the precision of an atomic datatype.
// Sets the precision of an atomic datatype.
void setPrecision( size_t precision ) const;
// Sets the total size for an atomic datatype.
// Sets the total size for an atomic datatype.
void setSize( size_t size ) const;
// Returns this class name
+8 -8
View File
@@ -52,7 +52,7 @@ Attribute::Attribute( const Attribute& original ) : AbstractDs( original ) {}
//--------------------------------------------------------------------------
// Function: Attribute overloaded constructor
///\brief Creates an Attribute object using the id of an existing
///\brief Creates an Attribute object using the id of an existing
/// attribute.
///\param existing_id - IN: Id of an existing attribute
///\exception H5::AttributeIException
@@ -203,7 +203,7 @@ ssize_t Attribute::getName( size_t buf_size, string& attr_name ) const
{
throw AttributeIException("Attribute::getName", "H5Aget_name failed");
}
// otherwise, convert the C attribute name and return
// otherwise, convert the C attribute name and return
attr_name = name_C;
delete []name_C;
return( name_size );
@@ -212,7 +212,7 @@ ssize_t Attribute::getName( size_t buf_size, string& attr_name ) const
//--------------------------------------------------------------------------
// Function: Attribute::getName
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it returns the
/// It differs from the above function in that it returns the
/// attribute's name, not the length.
///\return Name of the attribute
///\param buf_size - IN: Desired length of the name
@@ -223,7 +223,7 @@ string Attribute::getName( size_t buf_size ) const
{
string attr_name;
ssize_t name_size = getName( buf_size, attr_name );
return( attr_name );
return( attr_name );
// let caller catch exception if any
}
@@ -238,8 +238,8 @@ string Attribute::getName( size_t buf_size ) const
//--------------------------------------------------------------------------
string Attribute::getName() const
{
// Try with 256 characters for the name first, if the name's length
// returned is more than that then, read the name again with the
// Try with 256 characters for the name first, if the name's length
// returned is more than that then, read the name again with the
// appropriate space allocation
char* name_C = new char[256]; // temporary C-string for C API
ssize_t name_size = H5Aget_name(id, 255, name_C);
@@ -248,12 +248,12 @@ string Attribute::getName() const
if (name_size >= 256)
name_size = getName(name_size, attr_name);
// otherwise, convert the C attribute name and return
// otherwise, convert the C attribute name and return
else
attr_name = name_C;
delete []name_C;
return( attr_name );
return( attr_name );
}
//--------------------------------------------------------------------------
+3 -3
View File
@@ -57,9 +57,9 @@ class H5_DLLCPP Attribute : public AbstractDs {
virtual ~Attribute();
private:
// This function contains the common code that is used by
// getTypeClass and various API functions getXxxType
// defined in AbstractDs for generic datatype and specific
// This function contains the common code that is used by
// getTypeClass and various API functions getXxxType
// defined in AbstractDs for generic datatype and specific
// sub-types
virtual hid_t p_get_type() const;
+88 -88
View File
@@ -50,10 +50,10 @@ namespace H5 {
//--------------------------------------------------------------------------
// Function: CommonFG::createGroup
///\brief Creates a new group at this location which can be a file
///\brief Creates a new group at this location which can be a file
/// or another group.
///\param name - IN: Name of the group to create
///\param size_hint - IN: Indicates the number of bytes to reserve for
///\param size_hint - IN: Indicates the number of bytes to reserve for
/// the names that will appear in the group
///\return Group instance
///\exception H5::GroupIException
@@ -66,7 +66,7 @@ namespace H5 {
//--------------------------------------------------------------------------
Group CommonFG::createGroup( const char* name, size_t size_hint ) const
{
// Call C routine H5Gcreate to create the named group, giving the
// Call C routine H5Gcreate to create the named group, giving the
// location id which can be a file id or a group id
hid_t group_id = H5Gcreate( getLocId(), name, size_hint );
@@ -84,7 +84,7 @@ Group CommonFG::createGroup( const char* name, size_t size_hint ) const
//--------------------------------------------------------------------------
// Function: CommonFG::createGroup
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes an
/// It differs from the above function in that it takes an
/// \c std::string for \a name.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -95,7 +95,7 @@ Group CommonFG::createGroup( const string& name, size_t size_hint ) const
//--------------------------------------------------------------------------
// Function: CommonFG::openGroup
///\brief Opens an existing group in a location which can be a file
///\brief Opens an existing group in a location which can be a file
/// or another group.
///\param name - IN: Name of the group to open
///\return Group instance
@@ -104,11 +104,11 @@ Group CommonFG::createGroup( const string& name, size_t size_hint ) const
//--------------------------------------------------------------------------
Group CommonFG::openGroup( const char* name ) const
{
// Call C routine H5Gopen to open the named group, giving the
// Call C routine H5Gopen to open the named group, giving the
// location id which can be a file id or a group id
hid_t group_id = H5Gopen( getLocId(), name );
// If the opening of the group failed, throw an exception
// If the opening of the group failed, throw an exception
if( group_id < 0 )
{
throwException("openGroup", "H5Gopen failed");
@@ -122,7 +122,7 @@ Group CommonFG::openGroup( const char* name ) const
//--------------------------------------------------------------------------
// Function: CommonFG::openGroup
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes an
/// It differs from the above function in that it takes an
/// \c std::string for \a name.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -152,7 +152,7 @@ DataSet CommonFG::createDataSet( const char* name, const DataType& data_type, co
// Call C routine H5Dcreate to create the named dataset
hid_t dataset_id = H5Dcreate( getLocId(), name, type_id, space_id, create_plist_id );
// If the creation of the dataset failed, throw an exception
// If the creation of the dataset failed, throw an exception
if( dataset_id < 0 )
{
throwException("createDataSet", "H5Dcreate failed");
@@ -166,7 +166,7 @@ DataSet CommonFG::createDataSet( const char* name, const DataType& data_type, co
//--------------------------------------------------------------------------
// Function: CommonFG::createDataSet
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes an
/// It differs from the above function in that it takes an
/// \c std::string for \a name.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -186,7 +186,7 @@ DataSet CommonFG::createDataSet( const string& name, const DataType& data_type,
DataSet CommonFG::openDataSet( const char* name ) const
{
// Call C function H5Dopen to open the specified dataset, giving
// the location id and the dataset's name
// the location id and the dataset's name
hid_t dataset_id = H5Dopen( getLocId(), name );
// If the dataset's opening failed, throw an exception
@@ -203,7 +203,7 @@ DataSet CommonFG::openDataSet( const char* name ) const
//--------------------------------------------------------------------------
// Function: CommonFG::openDataSet
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes an
/// It differs from the above function in that it takes an
/// \c std::string for \a name.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -214,17 +214,17 @@ DataSet CommonFG::openDataSet( const string& name ) const
//--------------------------------------------------------------------------
// Function: CommonFG::link
///\brief Creates a link of the specified type from \a new_name to
///\brief Creates a link of the specified type from \a new_name to
/// \a curr_name.
///\param link_type - IN: Link type; possible values are
///\param link_type - IN: Link type; possible values are
/// \li \c H5G_LINK_HARD
/// \li \c H5G_LINK_SOFT
///\param curr_name - IN: Name of the existing object if link is a hard
///\param curr_name - IN: Name of the existing object if link is a hard
/// link; can be anything for the soft link
///\param new_name - IN: New name for the object
///\exception H5::FileIException or H5::GroupIException
///\par Description
/// Note that both names are interpreted relative to the
/// Note that both names are interpreted relative to the
/// specified location.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -240,7 +240,7 @@ void CommonFG::link( H5G_link_t link_type, const char* curr_name, const char* ne
//--------------------------------------------------------------------------
// Function: CommonFG::link
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes an
/// It differs from the above function in that it takes an
/// \c std::string for \a curr_name and \a new_name.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -268,7 +268,7 @@ void CommonFG::unlink( const char* name ) const
//--------------------------------------------------------------------------
// Function: CommonFG::unlink
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes an
/// It differs from the above function in that it takes an
/// \c std::string for \a name.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -284,7 +284,7 @@ void CommonFG::unlink( const string& name ) const
///\param dst - IN: Object's new name
///\exception H5::FileIException or H5::GroupIException
///\note
/// Exercise care in moving groups as it is possible to render
/// Exercise care in moving groups as it is possible to render
/// data in a file inaccessible with Group::move. Please refer
/// to the Group Interface in the HDF5 User's Guide at:
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/Groups.html
@@ -302,7 +302,7 @@ void CommonFG::move( const char* src, const char* dst ) const
//--------------------------------------------------------------------------
// Function: CommonFG::move
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes an
/// It differs from the above function in that it takes an
/// \c std::string for \a src and \a dst.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -336,7 +336,7 @@ void CommonFG::getObjinfo( const char* name, hbool_t follow_link, H5G_stat_t& st
//--------------------------------------------------------------------------
// Function: CommonFG::getObjinfo
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes an
/// It differs from the above function in that it takes an
/// \c std::string for \a name.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -348,7 +348,7 @@ void CommonFG::getObjinfo( const string& name, hbool_t follow_link, H5G_stat_t&
//--------------------------------------------------------------------------
// Function: CommonFG::getLinkval
///\brief Returns the name of the object that the symbolic link points to.
///\param name - IN: Symbolic link to the object
///\param name - IN: Symbolic link to the object
///\param size - IN: Maximum number of characters of value to be returned
///\return Name of the object
///\exception H5::FileIException or H5::GroupIException
@@ -371,7 +371,7 @@ string CommonFG::getLinkval( const char* name, size_t size ) const
//--------------------------------------------------------------------------
// Function: CommonFG::getLinkval
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes an
/// It differs from the above function in that it takes an
/// \c std::string for \a name.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -387,11 +387,11 @@ string CommonFG::getLinkval( const string& name, size_t size ) const
///\param comment - IN: New comment
///\exception H5::FileIException or H5::GroupIException
///\par Description
/// If \a comment is an empty string or a null pointer, the comment
/// message is removed from the object.
/// Comments should be relatively short, null-terminated, ASCII
/// strings. They can be attached to any object that has an
/// object header, e.g., data sets, groups, named data types,
/// If \a comment is an empty string or a null pointer, the comment
/// message is removed from the object.
/// Comments should be relatively short, null-terminated, ASCII
/// strings. They can be attached to any object that has an
/// object header, e.g., data sets, groups, named data types,
/// and data spaces, but not symbolic links.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -407,7 +407,7 @@ void CommonFG::setComment( const char* name, const char* comment ) const
//--------------------------------------------------------------------------
// Function: CommonFG::setComment
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes an
/// It differs from the above function in that it takes an
/// \c std::string for \a name and \a comment.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -495,7 +495,7 @@ string CommonFG::getComment (const string& name) const
string CommonFG::getComment( const char* name, size_t bufsize ) const
{
// temporary C-string for the object's comment
char* comment_C = new char[bufsize+1];
char* comment_C = new char[bufsize+1];
herr_t ret_value = H5Gget_comment( getLocId(), name, bufsize, comment_C );
@@ -512,7 +512,7 @@ string CommonFG::getComment( const char* name, size_t bufsize ) const
//--------------------------------------------------------------------------
// Function: CommonFG::getComment
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes an
/// It differs from the above function in that it takes an
/// \c std::string for \a name.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -549,7 +549,7 @@ void CommonFG::mount( const char* name, H5File& child, PropList& plist ) const
//--------------------------------------------------------------------------
// Function: CommonFG::mount
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes an
/// It differs from the above function in that it takes an
/// \c std::string for \a name.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -580,7 +580,7 @@ void CommonFG::unmount( const char* name ) const
//--------------------------------------------------------------------------
// Function: CommonFG::unmount
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes an
/// It differs from the above function in that it takes an
/// \c std::string for \a name.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -600,14 +600,14 @@ void CommonFG::unmount( const string& name ) const
DataType CommonFG::openDataType( const char* name ) const
{
// Call C function H5Topen to open the named datatype in this group,
// given either the file or group id
// given either the file or group id
hid_t type_id = H5Topen(getLocId(), name);
// If the datatype's opening failed, throw an exception
if( type_id < 0 )
{
if( type_id < 0 )
{
throwException("openDataType", "H5Topen failed");
}
}
// No failure, create and return the DataType object
DataType data_type(type_id);
return(data_type);
@@ -616,7 +616,7 @@ DataType CommonFG::openDataType( const char* name ) const
//--------------------------------------------------------------------------
// Function: CommonFG::openDataType
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes an
/// It differs from the above function in that it takes an
/// \c std::string for \a name.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -636,14 +636,14 @@ DataType CommonFG::openDataType( const string& name ) const
ArrayType CommonFG::openArrayType( const char* name ) const
{
// Call C function H5Topen to open the named datatype in this group,
// given either the file or group id
// given either the file or group id
hid_t type_id = H5Topen(getLocId(), name);
// If the datatype's opening failed, throw an exception
if( type_id < 0 )
{
if( type_id < 0 )
{
throwException("openArrayType", "H5Topen failed");
}
}
// No failure, create and return the ArrayType object
ArrayType array_type (type_id);
return(array_type);
@@ -672,14 +672,14 @@ ArrayType CommonFG::openArrayType( const string& name ) const
CompType CommonFG::openCompType( const char* name ) const
{
// Call C function H5Topen to open the named datatype in this group,
// given either the file or group id
// given either the file or group id
hid_t type_id = H5Topen(getLocId(), name);
// If the datatype's opening failed, throw an exception
if( type_id < 0 )
{
if( type_id < 0 )
{
throwException("openCompType", "H5Topen failed");
}
}
// No failure, create and return the CompType object
CompType comp_type(type_id);
return(comp_type);
@@ -688,7 +688,7 @@ CompType CommonFG::openCompType( const char* name ) const
//--------------------------------------------------------------------------
// Function: CommonFG::openCompType
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes an
/// It differs from the above function in that it takes an
/// \c std::string for \a name.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -708,30 +708,30 @@ CompType CommonFG::openCompType( const string& name ) const
EnumType CommonFG::openEnumType( const char* name ) const
{
// Call C function H5Topen to open the named datatype in this group,
// given either the file or group id
// given either the file or group id
hid_t type_id = H5Topen(getLocId(), name);
// If the datatype's opening failed, throw an exception
if( type_id < 0 )
{
if( type_id < 0 )
{
throwException("openEnumType", "H5Topen failed");
}
}
// No failure, create and return the EnumType object
EnumType enum_type(type_id);
return(enum_type);
}
}
//--------------------------------------------------------------------------
// Function: CommonFG::openEnumType
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes an
/// It differs from the above function in that it takes an
/// \c std::string for \a name.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
EnumType CommonFG::openEnumType( const string& name ) const
{
return( openEnumType( name.c_str()) );
}
}
//--------------------------------------------------------------------------
// Function: CommonFG::openIntType
@@ -742,16 +742,16 @@ EnumType CommonFG::openEnumType( const string& name ) const
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
IntType CommonFG::openIntType( const char* name ) const
{
{
// Call C function H5Topen to open the named datatype in this group,
// given either the file or group id
// given either the file or group id
hid_t type_id = H5Topen(getLocId(), name);
// If the datatype's opening failed, throw an exception
if( type_id < 0 )
{
if( type_id < 0 )
{
throwException("openIntType", "H5Topen failed");
}
}
// No failure, create and return the IntType object
IntType int_type(type_id);
return(int_type);
@@ -760,12 +760,12 @@ IntType CommonFG::openIntType( const char* name ) const
//--------------------------------------------------------------------------
// Function: CommonFG::openIntType
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes an
/// It differs from the above function in that it takes an
/// \c std::string for \a name.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
IntType CommonFG::openIntType( const string& name ) const
{
{
return( openIntType( name.c_str()) );
}
@@ -778,16 +778,16 @@ IntType CommonFG::openIntType( const string& name ) const
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
FloatType CommonFG::openFloatType( const char* name ) const
{
{
// Call C function H5Topen to open the named datatype in this group,
// given either the file or group id
// given either the file or group id
hid_t type_id = H5Topen(getLocId(), name);
// If the datatype's opening failed, throw an exception
if( type_id < 0 )
{
if( type_id < 0 )
{
throwException("openFloatType", "H5Topen failed");
}
}
// No failure, create and return the FloatType object
FloatType float_type(type_id);
return(float_type);
@@ -796,12 +796,12 @@ FloatType CommonFG::openFloatType( const char* name ) const
//--------------------------------------------------------------------------
// Function: CommonFG::openFloatType
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes an
/// It differs from the above function in that it takes an
/// \c std::string for \a name.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
FloatType CommonFG::openFloatType( const string& name ) const
{
{
return( openFloatType( name.c_str()) );
}
@@ -816,14 +816,14 @@ FloatType CommonFG::openFloatType( const string& name ) const
StrType CommonFG::openStrType( const char* name ) const
{
// Call C function H5Topen to open the named datatype in this group,
// given either the file or group id
// given either the file or group id
hid_t type_id = H5Topen(getLocId(), name);
// If the datatype's opening failed, throw an exception
if( type_id < 0 )
{
if( type_id < 0 )
{
throwException("openStrType", "H5Topen failed");
}
}
// No failure, create and return the StrType object
StrType str_type(type_id);
return(str_type);
@@ -832,7 +832,7 @@ StrType CommonFG::openStrType( const char* name ) const
//--------------------------------------------------------------------------
// Function: CommonFG::openStrType
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes an
/// It differs from the above function in that it takes an
/// \c std::string for \a name.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -852,14 +852,14 @@ StrType CommonFG::openStrType( const string& name ) const
VarLenType CommonFG::openVarLenType( const char* name ) const
{
// Call C function H5Topen to open the named datatype in this group,
// given either the file or group id
// given either the file or group id
hid_t type_id = H5Topen(getLocId(), name);
// If the datatype's opening failed, throw an exception
if( type_id < 0 )
{
if( type_id < 0 )
{
throwException("openVarLenType", "H5Topen failed");
}
}
// No failure, create and return the VarLenType object
VarLenType varlen_type(type_id);
return(varlen_type);
@@ -884,8 +884,8 @@ VarLenType CommonFG::openVarLenType( const string& name ) const
///\param idx - IN/OUT: Starting (IN) and ending (OUT) entry indices
///\param op - IN : User's function to operate on each entry
///\param op_data - IN/OUT: Data associated with the operation
///\return The return value of the first operator that returns non-zero,
/// or zero if all members were processed with no operator
///\return The return value of the first operator that returns non-zero,
/// or zero if all members were processed with no operator
/// returning non-zero.
///\exception H5::FileIException or H5::GroupIException
// Programmer Binh-Minh Ribler - 2000
@@ -903,7 +903,7 @@ int CommonFG::iterateElems( const char* name, int *idx, H5G_iterate_t op , void*
//--------------------------------------------------------------------------
// Function: CommonFG::iterateElems
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes an
/// It differs from the above function in that it takes an
/// \c std::string for \a name.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
+5 -5
View File
@@ -30,12 +30,12 @@ class ArrayType;
class VarLenType;
class H5_DLLCPP CommonFG {
public:
// Creates a new group at this location which can be a file
// Creates a new group at this location which can be a file
// or another group.
Group createGroup(const char* name, size_t size_hint = 0) const;
Group createGroup(const string& name, size_t size_hint = 0) const;
// Opens an existing group in a location which can be a file
// Opens an existing group in a location which can be a file
// or another group.
Group openGroup(const char* name) const;
Group openGroup(const string& name) const;
@@ -68,7 +68,7 @@ class H5_DLLCPP CommonFG {
// Returns the number of objects in this group.
hsize_t getNumObjs() const;
// Returns information about an HDF5 object, given by its name,
// Returns information about an HDF5 object, given by its name,
// at this location.
void getObjinfo(const char* name, hbool_t follow_link, H5G_stat_t& statbuf) const;
void getObjinfo(const string& name, hbool_t follow_link, H5G_stat_t& statbuf) const;
@@ -142,9 +142,9 @@ class H5_DLLCPP CommonFG {
VarLenType openVarLenType(const string& name) const;
#ifndef DOXYGEN_SHOULD_SKIP_THIS
/// For subclasses, H5File and Group, to return the correct
/// For subclasses, H5File and Group, to return the correct
/// object id, i.e. file or group id.
virtual hid_t getLocId() const = 0;
virtual hid_t getLocId() const = 0;
#endif // DOXYGEN_SHOULD_SKIP_THIS
+42 -42
View File
@@ -89,7 +89,7 @@ CompType::CompType( const DataSet& dataset ) : DataType()
//--------------------------------------------------------------------------
// Function: CompType::getNmembers
///\brief Returns the number of members in this compound datatype.
///\brief Returns the number of members in this compound datatype.
///\return Number of members
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
@@ -99,7 +99,7 @@ int CompType::getNmembers() const
int num_members = H5Tget_nmembers( id );
if( num_members < 0 )
{
throw DataTypeIException("CompType::getNmembers",
throw DataTypeIException("CompType::getNmembers",
"H5Tget_nmembers returns negative number of members");
}
return( num_members );
@@ -107,7 +107,7 @@ int CompType::getNmembers() const
//--------------------------------------------------------------------------
// Function: CompType::getMemberName
///\brief Returns the name of a member in this compound datatype.
///\brief Returns the name of a member in this compound datatype.
///\param member_num - IN: Zero-based index of the member
///\return Name of member
///\exception H5::DataTypeIException
@@ -118,23 +118,23 @@ string CompType::getMemberName( unsigned member_num ) const
char* member_name_C = H5Tget_member_name( id, member_num );
if( member_name_C == NULL ) // NULL means failure
{
throw DataTypeIException("CompType::getMemberName",
throw DataTypeIException("CompType::getMemberName",
"H5Tget_member_name returns NULL for member name");
}
string member_name = string(member_name_C); // convert C string to string
HDfree(member_name_C); // free the C string
string member_name = string(member_name_C); // convert C string to string
HDfree(member_name_C); // free the C string
return( member_name ); // return the member name string
}
//--------------------------------------------------------------------------
// Function: CompType::getMemberIndex
///\brief Returns the index of a member in this compound datatype.
///\brief Returns the index of a member in this compound datatype.
///\param name - IN: Name of the member
///\return Index of member
///\exception H5::DataTypeIException
///\par Description
/// Members are stored in no particular order with numbers 0
/// through N-1, where N is the value returned by the member
/// Members are stored in no particular order with numbers 0
/// through N-1, where N is the value returned by the member
/// function \c CompType::getNmembers.
// Programmer Binh-Minh Ribler - May 16, 2002
//--------------------------------------------------------------------------
@@ -143,7 +143,7 @@ int CompType::getMemberIndex(const char* name) const
int member_index = H5Tget_member_index(id, name);
if( member_index < 0 )
{
throw DataTypeIException("CompType::getMemberIndex",
throw DataTypeIException("CompType::getMemberIndex",
"H5Tget_member_index returns negative value");
}
return( member_index );
@@ -162,8 +162,8 @@ int CompType::getMemberIndex(const string& name) const
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
// Description
/// Members are stored in no particular order with numbers 0
/// through N-1, where N is the value returned by the member
/// Members are stored in no particular order with numbers 0
/// through N-1, where N is the value returned by the member
/// function \c CompType::getNmembers.
//
// Note that byte offset being returned as 0 doesn't indicate
@@ -175,11 +175,11 @@ size_t CompType::getMemberOffset( unsigned member_num ) const
return( offset );
}
// Returns the dimensionality of the member.
// Returns the dimensionality of the member.
int CompType::getMemberDims( unsigned member_num, size_t* dims, int* perm ) const
{
throw DataTypeIException( "Error: getMemberDims is no longer supported." );
return (-1); // unreachable statement; but without it, the compiler
return (-1); // unreachable statement; but without it, the compiler
// will complain
}
@@ -204,7 +204,7 @@ H5T_class_t CompType::getMemberClass( unsigned member_num ) const
return(member_class);
}
// This private member function calls the C API to get the identifier
// This private member function calls the C API to get the identifier
// of the specified member. It provides the id to construct appropriate
// sub-types in the functions getMemberXxxType below, where Xxx indicates
// the sub-types.
@@ -224,8 +224,8 @@ hid_t CompType::p_get_member_type(unsigned member_num) const
//--------------------------------------------------------------------------
// Function: CompType::getMemberDataType
///\brief Returns the generic datatype of the specified member in this
/// compound datatype.
///\brief Returns the generic datatype of the specified member in this
/// compound datatype.
///\param member_num - IN: Zero-based index of the member
///\return DataType instance
///\exception H5::DataTypeIException
@@ -234,7 +234,7 @@ hid_t CompType::p_get_member_type(unsigned member_num) const
DataType CompType::getMemberDataType( unsigned member_num ) const
{
try {
DataType datatype(p_get_member_type(member_num));
DataType datatype(p_get_member_type(member_num));
return(datatype);
}
catch (DataTypeIException E) {
@@ -264,8 +264,8 @@ ArrayType CompType::getMemberArrayType( unsigned member_num ) const
//--------------------------------------------------------------------------
// Function: CompType::getMemberEnumType
///\brief Returns the enumeration datatype of the specified member in
/// this compound datatype.
///\brief Returns the enumeration datatype of the specified member in
/// this compound datatype.
///\param member_num - IN: Zero-based index of the member
///\return EnumType instance
///\exception H5::DataTypeIException
@@ -274,7 +274,7 @@ ArrayType CompType::getMemberArrayType( unsigned member_num ) const
EnumType CompType::getMemberEnumType( unsigned member_num ) const
{
try {
EnumType enumtype(p_get_member_type(member_num));
EnumType enumtype(p_get_member_type(member_num));
return(enumtype);
}
catch (DataTypeIException E) {
@@ -284,8 +284,8 @@ EnumType CompType::getMemberEnumType( unsigned member_num ) const
//--------------------------------------------------------------------------
// Function: CompType::getMemberCompType
///\brief Returns the compound datatype of the specified member in this
/// compound datatype.
///\brief Returns the compound datatype of the specified member in this
/// compound datatype.
///\param member_num - IN: Zero-based index of the member
///\return CompType instance
///\exception H5::DataTypeIException
@@ -294,7 +294,7 @@ EnumType CompType::getMemberEnumType( unsigned member_num ) const
CompType CompType::getMemberCompType( unsigned member_num ) const
{
try {
CompType comptype(p_get_member_type(member_num));
CompType comptype(p_get_member_type(member_num));
return(comptype);
}
catch (DataTypeIException E) {
@@ -304,8 +304,8 @@ CompType CompType::getMemberCompType( unsigned member_num ) const
//--------------------------------------------------------------------------
// Function: CompType::getMemberIntType
///\brief Returns the integer datatype of the specified member in this
/// compound datatype.
///\brief Returns the integer datatype of the specified member in this
/// compound datatype.
///\param member_num - IN: Zero-based index of the member
///\return IntType instance
///\exception H5::DataTypeIException
@@ -314,7 +314,7 @@ CompType CompType::getMemberCompType( unsigned member_num ) const
IntType CompType::getMemberIntType( unsigned member_num ) const
{
try {
IntType inttype(p_get_member_type(member_num));
IntType inttype(p_get_member_type(member_num));
return(inttype);
}
catch (DataTypeIException E) {
@@ -324,8 +324,8 @@ IntType CompType::getMemberIntType( unsigned member_num ) const
//--------------------------------------------------------------------------
// Function: CompType::getMemberFloatType
///\brief Returns the floating-point datatype of the specified member
/// in this compound datatype.
///\brief Returns the floating-point datatype of the specified member
/// in this compound datatype.
///\param member_num - IN: Zero-based index of the member
///\return FloatType instance
///\exception H5::DataTypeIException
@@ -334,7 +334,7 @@ IntType CompType::getMemberIntType( unsigned member_num ) const
FloatType CompType::getMemberFloatType( unsigned member_num ) const
{
try {
FloatType floatype(p_get_member_type(member_num));
FloatType floatype(p_get_member_type(member_num));
return(floatype);
}
catch (DataTypeIException E) {
@@ -344,8 +344,8 @@ FloatType CompType::getMemberFloatType( unsigned member_num ) const
//--------------------------------------------------------------------------
// Function: CompType::getMemberStrType
///\brief Returns the string datatype of the specified member in this
/// compound datatype.
///\brief Returns the string datatype of the specified member in this
/// compound datatype.
///\param member_num - IN: Zero-based index of the member
///\return StrType instance
///\exception H5::DataTypeIException
@@ -354,13 +354,13 @@ FloatType CompType::getMemberFloatType( unsigned member_num ) const
StrType CompType::getMemberStrType( unsigned member_num ) const
{
try {
StrType strtype(p_get_member_type(member_num));
StrType strtype(p_get_member_type(member_num));
return(strtype);
}
catch (DataTypeIException E) {
throw DataTypeIException("CompType::getMemberStrType", E.getDetailMsg());
}
}
}
//--------------------------------------------------------------------------
// Function: CompType::getMemberVarLenType
@@ -382,35 +382,35 @@ VarLenType CompType::getMemberVarLenType( unsigned member_num ) const
}
}
/* old style of getMemberType - using overloads; new style above
/* old style of getMemberType - using overloads; new style above
returns the appropriate datatypes but has different named functions.
In the old style, a datatype must be passed into the function.
May, 2004: These should be reconsidered to provide more convenience.
// Returns the datatype of the specified member in this compound datatype.
// Returns the datatype of the specified member in this compound datatype.
// Several overloading of getMemberType are for different datatypes
void CompType::getMemberType( unsigned member_num, EnumType& enumtype ) const
{
p_get_member_type(member_num, enumtype);
p_get_member_type(member_num, enumtype);
}
void CompType::getMemberType( unsigned member_num, CompType& comptype ) const
{
p_get_member_type(member_num, comptype);
p_get_member_type(member_num, comptype);
}
void CompType::getMemberType( unsigned member_num, IntType& inttype ) const
{
p_get_member_type(member_num, inttype);
p_get_member_type(member_num, inttype);
}
void CompType::getMemberType( unsigned member_num, FloatType& floatype ) const
{
p_get_member_type(member_num, floatype);
p_get_member_type(member_num, floatype);
}
void CompType::getMemberType( unsigned member_num, StrType& strtype ) const
{
p_get_member_type(member_num, strtype);
p_get_member_type(member_num, strtype);
}
// end of overloading of getMemberType
*/
@@ -442,7 +442,7 @@ void CompType::insertMember( const string& name, size_t offset, const DataType&
//--------------------------------------------------------------------------
// Function: CompType::pack
///\brief Recursively removes padding from within a compound datatype.
///\brief Recursively removes padding from within a compound datatype.
///
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
+14 -14
View File
@@ -36,58 +36,58 @@ class H5_DLLCPP CompType : public DataType {
// to create another datatype of the same class
H5T_class_t getMemberClass( unsigned member_num ) const;
// Returns the dimensionality of the specified member.
// Returns the dimensionality of the specified member.
int getMemberDims( unsigned member_num, size_t* dims, int* perm ) const;
// Returns the index of a member in this compound data type.
int getMemberIndex(const char* name) const;
int getMemberIndex(const string& name) const;
// Returns the offset of a member of this compound datatype.
// Returns the offset of a member of this compound datatype.
size_t getMemberOffset( unsigned memb_no ) const;
// Returns the name of a member of this compound datatype.
// Returns the name of a member of this compound datatype.
string getMemberName( unsigned member_num ) const;
// Returns the generic datatype of the specified member in
// Returns the generic datatype of the specified member in
// this compound datatype.
DataType getMemberDataType( unsigned member_num ) const;
// Returns the array datatype of the specified member in
// Returns the array datatype of the specified member in
// this compound datatype.
ArrayType getMemberArrayType( unsigned member_num ) const;
// Returns the compound datatype of the specified member in
// Returns the compound datatype of the specified member in
// this compound datatype.
CompType getMemberCompType( unsigned member_num ) const;
// Returns the enumeration datatype of the specified member in
// Returns the enumeration datatype of the specified member in
// this compound datatype.
EnumType getMemberEnumType( unsigned member_num ) const;
// Returns the integer datatype of the specified member in
// Returns the integer datatype of the specified member in
// this compound datatype.
IntType getMemberIntType( unsigned member_num ) const;
// Returns the floating-point datatype of the specified member in
// Returns the floating-point datatype of the specified member in
// this compound datatype.
FloatType getMemberFloatType( unsigned member_num ) const;
// Returns the string datatype of the specified member in
// Returns the string datatype of the specified member in
// this compound datatype.
StrType getMemberStrType( unsigned member_num ) const;
// Returns the variable length datatype of the specified member in
// Returns the variable length datatype of the specified member in
// this compound datatype.
VarLenType getMemberVarLenType( unsigned member_num ) const;
// Returns the number of members in this compound datatype.
// Returns the number of members in this compound datatype.
int getNmembers() const;
// Adds a new member to this compound datatype.
void insertMember( const string& name, size_t offset, const DataType& new_member ) const;
// Recursively removes padding from within this compound datatype.
// Recursively removes padding from within this compound datatype.
void pack() const;
// Returns this class name
@@ -108,7 +108,7 @@ class H5_DLLCPP CompType : public DataType {
private:
// Contains common code that is used by the member functions
// getMemberXxxType
hid_t p_get_member_type(unsigned member_num) const;
hid_t p_get_member_type(unsigned member_num) const;
};
#ifndef H5_NO_NAMESPACE
}
+6 -6
View File
@@ -17,7 +17,7 @@
#define _H5CPPDOC_H
//-------------------------------------------------------------------------
// The following section will be used to generate the 'Mainpage'
// The following section will be used to generate the 'Mainpage'
// and the 'Examples' for the RM.
// ------------------------------------------------------------------------
@@ -26,15 +26,15 @@
* \section intro_sec Introduction
*
* The C++ API provides C++ wrappers for the HDF5 C library.
* It is assumed that the user has knowledge of the HDF5 file format
* It is assumed that the user has knowledge of the HDF5 file format
* and its components. If you are not familiar with HDF5 file format,
* and would like to find out more, please refer to the HDF5 documentation
* at http://hdf.ncsa.uiuc.edu/HDF5/doc/H5.intro.html
*
* Because the HDF5 library maps very well to
* the object oriented design approach, classes in the C++ API can
* Because the HDF5 library maps very well to
* the object oriented design approach, classes in the C++ API can
* closely represent the interfaces of the HDF5 APIs, as followed:
*
*
* \verbatim
HDF5 C APIs C++ Classes
----------- -----------
@@ -54,7 +54,7 @@
* under the top directory for information about installing, building,
* and testing the C++ API.
*
*
*
*/
/// This example shows how to create datasets.
+22 -22
View File
@@ -82,7 +82,7 @@ DataSpace DataSet::getSpace() const
return( data_space );
}
// This private member function calls the C API to get the identifier
// This private member function calls the C API to get the identifier
// of the datatype that is used by this dataset. It is used
// by the various AbstractDs functions to get the specific datatype.
hid_t DataSet::p_get_type() const
@@ -110,7 +110,7 @@ DSetCreatPropList DataSet::getCreatePlist() const
{
throw DataSetIException("DataSet::getCreatePlist", "H5Dget_create_plist failed");
}
// create and return the DSetCreatPropList object
// create and return the DSetCreatPropList object
DSetCreatPropList create_plist( create_plist_id );
return( create_plist );
}
@@ -190,9 +190,9 @@ hsize_t DataSet::getVlenBufSize( DataType& type, DataSpace& space ) const
//--------------------------------------------------------------------------
// Function: DataSet::vlenReclaim
///\brief Reclaims VL datatype memory buffers.
///\brief Reclaims VL datatype memory buffers.
///\param type - IN: Datatype, which is the datatype stored in the buffer
///\param space - IN: Selection for the memory buffer to free the
///\param space - IN: Selection for the memory buffer to free the
/// VL datatypes within
///\param xfer_plist - IN: Property list used to create the buffer
///\param buf - IN: Pointer to the buffer to be reclaimed
@@ -223,9 +223,9 @@ void DataSet::vlenReclaim( DataType& type, DataSpace& space, DSetMemXferPropList
///\param xfer_plist - IN: Transfer property list for this I/O operation
///\exception H5::DataSetIException
///\par Description
/// This function reads raw data from this dataset into the
/// buffer \a buf, converting from file datatype and dataspace
/// to memory datatype \a mem_type and dataspace \a mem_space.
/// This function reads raw data from this dataset into the
/// buffer \a buf, converting from file datatype and dataspace
/// to memory datatype \a mem_type and dataspace \a mem_space.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DataSet::read( void* buf, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist ) const
@@ -273,9 +273,9 @@ void DataSet::read( string& strg, const DataType& mem_type, const DataSpace& mem
///\param xfer_plist - IN: Transfer property list for this I/O operation
///\exception H5::DataSetIException
///\par Description
/// This function writes raw data from an application buffer
/// \a buf to a dataset, converting from memory datatype
/// \a mem_type and dataspace \a mem_space to file datatype
/// This function writes raw data from an application buffer
/// \a buf to a dataset, converting from memory datatype
/// \a mem_type and dataspace \a mem_space to file datatype
/// and dataspace.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -312,18 +312,18 @@ void DataSet::write( const string& strg, const DataType& mem_type, const DataSpa
//--------------------------------------------------------------------------
// Function: DataSet::iterateElems
///\brief Iterates over all selected elements in a dataspace.
///\param buf - IN/OUT: Pointer to the buffer in memory containing the
///\brief Iterates over all selected elements in a dataspace.
///\param buf - IN/OUT: Pointer to the buffer in memory containing the
/// elements to iterate over
///\param type - IN: Datatype for the elements stored in \a buf
///\param space - IN: Dataspace for \a buf. Also contains the selection
///\param space - IN: Dataspace for \a buf. Also contains the selection
/// to iterate over.
///\param op - IN: Function pointer to the routine to be called for
///\param op - IN: Function pointer to the routine to be called for
/// each element in \a buf iterated over
///\param op_data - IN/OUT: Pointer to any user-defined data associated
///\param op_data - IN/OUT: Pointer to any user-defined data associated
/// with the operation
///\exception H5::DataSetIException
///\note This function may not work correctly yet - it's still
///\note This function may not work correctly yet - it's still
/// under development.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -436,7 +436,7 @@ void* DataSet::Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_
///\return A reference
///\exception H5::DataSetIException
///\par Description
// This function passes H5R_OBJECT and -1 to the protected
// This function passes H5R_OBJECT and -1 to the protected
// function for it to pass to the C API H5Rcreate
// to create a reference to the named object.
// Programmer Binh-Minh Ribler - May, 2004
@@ -454,7 +454,7 @@ void* DataSet::Reference(const char* name) const
//--------------------------------------------------------------------------
// Function: DataSet::Reference
///\brief This is an overloaded function, provided for your convenience.
/// It differs from the above function in that it takes an
/// It differs from the above function in that it takes an
/// \c std::string for the object's name.
///\param name - IN: Name of the object to be referenced - \c std::string
// Programmer Binh-Minh Ribler - May, 2004
@@ -470,10 +470,10 @@ void* DataSet::Reference(const string& name) const
///\param ref_type - IN: Type of reference to query
///\param ref - IN: Reference to query
///\return An object type, which can be one of the following:
// H5G_LINK Object is a symbolic link.
// H5G_GROUP Object is a group.
// H5G_DATASET Object is a dataset.
// H5G_TYPE Object is a named datatype
// H5G_LINK Object is a symbolic link.
// H5G_GROUP Object is a group.
// H5G_DATASET Object is a dataset.
// H5G_TYPE Object is a named datatype
///\exception H5::DataSetIException
// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
+3 -3
View File
@@ -32,7 +32,7 @@ class H5_DLLCPP DataSet : public AbstractDs {
// Fills a selection in memory with a value
void fillMemBuf(const void *fill, DataType& fill_type, void *buf, DataType& buf_type, DataSpace& space);
// Fills a selection in memory with zero
// Fills a selection in memory with zero
void fillMemBuf(void *buf, DataType& buf_type, DataSpace& space);
// Gets the creation property list of this dataset.
@@ -40,7 +40,7 @@ class H5_DLLCPP DataSet : public AbstractDs {
// Returns the address of this dataset in the file.
haddr_t getOffset() const;
// Gets the dataspace of this dataset.
virtual DataSpace getSpace() const;
@@ -100,7 +100,7 @@ class H5_DLLCPP DataSet : public AbstractDs {
private:
// This function contains the common code that is used by
// getTypeClass and various API functions getXxxType
// getTypeClass and various API functions getXxxType
// defined in AbstractDs for generic datatype and specific
// sub-types
virtual hid_t p_get_type() const;
+30 -30
View File
@@ -36,7 +36,7 @@ const DataSpace DataSpace::ALL( H5S_ALL );
//--------------------------------------------------------------------------
// Function: DataSpace constructor
///\brief Creates a new dataspace given a dataspace type.
///\param type - IN: Type of the dataspace to be created, which
///\param type - IN: Type of the dataspace to be created, which
/// currently can be either \c H5S_SCALAR or \c H5S_SIMPLE;
/// default to \c H5S_SCALAR.
///\exception H5::DataSpaceIException
@@ -54,9 +54,9 @@ DataSpace::DataSpace( H5S_class_t type ) : IdComponent()
//--------------------------------------------------------------------------
// Function: DataSpace overloaded constructor
///\brief Creates a new simple dataspace.
///\param rank - IN: Number of dimensions of dataspace.
///\param dims - IN: An array of the size of each dimension.
///\param maxdims - IN: An array of the maximum size of each dimension.
///\param rank - IN: Number of dimensions of dataspace.
///\param dims - IN: An array of the size of each dimension.
///\param maxdims - IN: An array of the maximum size of each dimension.
///\exception H5::DataSpaceIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -71,7 +71,7 @@ DataSpace::DataSpace( int rank, const hsize_t * dims, const hsize_t * maxdims) :
//--------------------------------------------------------------------------
// Function: DataSpace overloaded constructor
///\brief Creates a DataSpace object using the id of an existing
///\brief Creates a DataSpace object using the id of an existing
/// dataspace.
///\param existing_id - IN: Id of an existing dataspace
///\exception H5::DataSpaceIException
@@ -101,7 +101,7 @@ void DataSpace::copy( const DataSpace& like_space )
{
// If this object has a valid id, appropriately decrement reference
// counter and close the id.
if( id != H5S_ALL ) {
if( id != H5S_ALL ) {
try {
decRefCount();
}
@@ -110,7 +110,7 @@ void DataSpace::copy( const DataSpace& like_space )
}
} // if
// call C routine to copy the dataspace
// call C routine to copy the dataspace
id = H5Scopy( like_space.getId() );
if( id < 0 )
@@ -137,7 +137,7 @@ DataSpace& DataSpace::operator=( const DataSpace& rhs )
//--------------------------------------------------------------------------
// Function: DataSpace::isSimple
///\brief Determines whether this dataspace is a simple dataspace.
///\return \c true if the dataspace is a simple dataspace, and \c false,
///\return \c true if the dataspace is a simple dataspace, and \c false,
/// otherwise
///\exception H5::DataSpaceIException
// Programmer Binh-Minh Ribler - 2000
@@ -151,7 +151,7 @@ bool DataSpace::isSimple () const
return false;
else
{
throw DataSpaceIException("DataSpace::isSimple",
throw DataSpaceIException("DataSpace::isSimple",
"H5Sis_simple returns negative value");
}
}
@@ -162,9 +162,9 @@ bool DataSpace::isSimple () const
///\param offset - IN: Offset to position the selection at
///\exception H5::DataSpaceIException
///\par Description
/// This function creates an offset for the selection within
/// an extent, allowing the same shaped selection to be moved
/// to different locations within a dataspace without requiring
/// This function creates an offset for the selection within
/// an extent, allowing the same shaped selection to be moved
/// to different locations within a dataspace without requiring
/// it to be re-defined.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -182,7 +182,7 @@ void DataSpace::offsetSimple ( const hssize_t* offset ) const
///\brief Retrieves dataspace dimension size and maximum size.
///\param dims - IN: Name of the new member
///\param maxdims - IN: Pointer to the value of the new member
///\return Number of dimensions, the same value as returned by
///\return Number of dimensions, the same value as returned by
/// \c DataSpace::getSimpleExtentNdims()
///\exception H5::DataSpaceIException
// Programmer Binh-Minh Ribler - 2000
@@ -192,7 +192,7 @@ int DataSpace::getSimpleExtentDims ( hsize_t *dims, hsize_t *maxdims ) const
int ndims = H5Sget_simple_extent_dims( id, dims, maxdims );
if( ndims < 0 )
{
throw DataSpaceIException("DataSpace::getSimpleExtentDims",
throw DataSpaceIException("DataSpace::getSimpleExtentDims",
"H5Sget_simple_extent_dims returns negative number of dimensions");
}
return( ndims );
@@ -210,7 +210,7 @@ int DataSpace::getSimpleExtentNdims () const
int ndims = H5Sget_simple_extent_ndims( id );
if( ndims < 0 )
{
throw DataSpaceIException("DataSpace::getSimpleExtentNdims",
throw DataSpaceIException("DataSpace::getSimpleExtentNdims",
"H5Sget_simple_extent_ndims returns negative value for dimensionality of the dataspace");
}
return( ndims );
@@ -235,7 +235,7 @@ hssize_t DataSpace::getSimpleExtentNpoints () const
return( num_elements );
else
{
throw DataSpaceIException("DataSpace::getSimpleExtentNpoints",
throw DataSpaceIException("DataSpace::getSimpleExtentNpoints",
"H5Sget_simple_extent_npoints returns negative value for the number of elements in the dataspace");
}
}
@@ -252,7 +252,7 @@ H5S_class_t DataSpace::getSimpleExtentType () const
H5S_class_t class_name = H5Sget_simple_extent_type( id );
if( class_name == H5S_NO_CLASS )
{
throw DataSpaceIException("DataSpace::getSimpleExtentType",
throw DataSpaceIException("DataSpace::getSimpleExtentType",
"H5Sget_simple_extent_type returns H5S_NO_CLASS");
}
return( class_name );
@@ -322,7 +322,7 @@ hssize_t DataSpace::getSelectNpoints () const
hssize_t num_elements = H5Sget_select_npoints( id );
if( num_elements < 0 )
{
throw DataSpaceIException("DataSpace::getSelectNpoints",
throw DataSpaceIException("DataSpace::getSelectNpoints",
"H5Sget_select_npoints returns negative value for number of elements in the dataspace selection");
}
return( num_elements );
@@ -340,7 +340,7 @@ hssize_t DataSpace::getSelectHyperNblocks () const
hssize_t num_blocks = H5Sget_select_hyper_nblocks( id );
if( num_blocks < 0 )
{
throw DataSpaceIException("DataSpace::getSelectHyperNblocks",
throw DataSpaceIException("DataSpace::getSelectHyperNblocks",
"H5Sget_select_hyper_nblocks returns negative value for the number of hyperslab blocks");
}
return( num_blocks );
@@ -361,7 +361,7 @@ void DataSpace::getSelectHyperBlocklist( hsize_t startblock, hsize_t numblocks,
ret_value = H5Sget_select_hyper_blocklist( id, startblock, numblocks, buf );
if( ret_value < 0 )
{
throw DataSpaceIException("DataSpace::getSelectHyperBlocklist",
throw DataSpaceIException("DataSpace::getSelectHyperBlocklist",
"H5Sget_select_hyper_blocklist failed");
}
}
@@ -378,7 +378,7 @@ hssize_t DataSpace::getSelectElemNpoints () const
hssize_t num_points = H5Sget_select_elem_npoints( id );
if( num_points < 0 )
{
throw DataSpaceIException("DataSpace::getSelectElemNpoints",
throw DataSpaceIException("DataSpace::getSelectElemNpoints",
"H5Sget_select_elem_npoints failed");
}
return( num_points );
@@ -412,7 +412,7 @@ void DataSpace::getSelectElemPointlist ( hsize_t startpoint, hsize_t numpoints,
// Function: DataSpace::getSelectBounds
///\brief Gets the bounding box containing the current selection.
///\param start - IN: Starting coordinates of the bounding box
///\param end - IN: Ending coordinates of the bounding box, i.e.,
///\param end - IN: Ending coordinates of the bounding box, i.e.,
/// the coordinates of the diagonally opposite corner
///\exception H5::DataSpaceIException
///\par Description
@@ -433,12 +433,12 @@ void DataSpace::getSelectBounds ( hsize_t* start, hsize_t* end ) const
//--------------------------------------------------------------------------
// Function: DataSpace::H5Sselect_elements
///\brief Selects array elements to be included in the selection for
///\brief Selects array elements to be included in the selection for
/// this dataspace.
///\param op - IN: Operator specifying how the new selection is to be
///\param op - IN: Operator specifying how the new selection is to be
/// combined with the existing selection for the dataspace
///\param num_elements - IN: Number of elements to be selected
///\param coord - IN: A 2-dimensional array of 0-based values
///\param coord - IN: A 2-dimensional array of 0-based values
/// specifying the coordinates of the elements being selected
///\exception H5::DataSpaceIException
///\par Description
@@ -493,7 +493,7 @@ void DataSpace::selectNone () const
//--------------------------------------------------------------------------
// Function: DataSpace::selectValid
///\brief Verifies that the selection is within the extent of the
///\brief Verifies that the selection is within the extent of the
/// dataspace.
///\return \c true if the selection is within the extent of the
/// dataspace, and \c false, otherwise
@@ -525,7 +525,7 @@ bool DataSpace::selectValid () const
///\exception H5::DataSpaceIException
///\par Description
/// For more information, please refer to the C layer Reference
/// Manual at:
/// Manual at:
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5S.html#Dataspace-SelectHyperslab
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -572,10 +572,10 @@ void DataSpace::close()
// ID reference counting mechanism - June 1, 2004
//--------------------------------------------------------------------------
DataSpace::~DataSpace()
{
{
// If this object has a valid id, appropriately decrement reference
// counter and close the id.
if( id != H5S_ALL ) {
if( id != H5S_ALL ) {
try {
decRefCount();
}
@@ -583,7 +583,7 @@ DataSpace::~DataSpace()
cerr << "DataSpace::~DataSpace - " << close_error.getDetailMsg() << endl;
}
} // if
}
}
#ifndef H5_NO_NAMESPACE
} // end namespace
+2 -2
View File
@@ -68,7 +68,7 @@ class H5_DLLCPP DataSpace : public IdComponent {
int getSimpleExtentNdims() const;
// Gets the number of elements in this dataspace.
// 12/05/00 - changed return type to hssize_t from hsize_t - C API
// 12/05/00 - changed return type to hssize_t from hsize_t - C API
hssize_t getSimpleExtentNpoints() const;
// Gets the current class of this dataspace.
@@ -83,7 +83,7 @@ class H5_DLLCPP DataSpace : public IdComponent {
// Selects the entire dataspace.
void selectAll() const;
// Selects array elements to be included in the selection for
// Selects array elements to be included in the selection for
// this dataspace.
void selectElements( H5S_seloper_t op, const size_t num_elements, const hsize_t *coord[ ] ) const;
+55 -55
View File
@@ -43,11 +43,11 @@ namespace H5 {
///\param predefined - IN: Indicates whether or not this datatype is
/// a predefined datatype; default to \c false
// Description
// Constructor creates a copy of an existing DataType using
// its id. The argument "predefined" is default to false;
// when a default datatype is created, this argument is set
// to true so H5Tclose will not be called on it later. - need
// a reassessment after changing to the new ref counting mech.
// Constructor creates a copy of an existing DataType using
// its id. The argument "predefined" is default to false;
// when a default datatype is created, this argument is set
// to true so H5Tclose will not be called on it later. - need
// a reassessment after changing to the new ref counting mech.
// - BMR 5/2004
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -125,8 +125,8 @@ void DataType::copy( const DataType& like_type )
///\return Reference to DataType instance
///\exception H5::DataTypeIException
// Description
// Makes a copy of the type on the right hand side and stores
// the new id in the left hand side object.
// Makes a copy of the type on the right hand side and stores
// the new id in the left hand side object.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DataType& DataType::operator=( const DataType& rhs )
@@ -137,7 +137,7 @@ DataType& DataType::operator=( const DataType& rhs )
//--------------------------------------------------------------------------
// Function: DataType::operator==
///\brief Compares this DataType against the given one to determines
///\brief Compares this DataType against the given one to determines
/// whether the two objects refer to the same actual datatype.
///\param compared_type - IN: Reference to the datatype to compare
///\return true if the datatypes are equal, and false, otherwise.
@@ -146,7 +146,7 @@ DataType& DataType::operator=( const DataType& rhs )
//--------------------------------------------------------------------------
bool DataType::operator==(const DataType& compared_type ) const
{
// Call C routine H5Tequal to determines whether two datatype
// Call C routine H5Tequal to determines whether two datatype
// identifiers refer to the same datatype
htri_t ret_value = H5Tequal( id, compared_type.getId() );
if( ret_value > 0 )
@@ -161,7 +161,7 @@ bool DataType::operator==(const DataType& compared_type ) const
//--------------------------------------------------------------------------
// Function: DataType::commit
///\brief Commits a transient datatype to a file, creating a new
///\brief Commits a transient datatype to a file, creating a new
/// named datatype
///\param loc - IN: Either a file or a group
///\param name - IN: Name of the datatype
@@ -172,7 +172,7 @@ void DataType::commit(CommonFG& loc, const char* name) const
{
hid_t loc_id = loc.getLocId(); // get location id for C API
// Call C routine to commit the transient datatype
// Call C routine to commit the transient datatype
herr_t ret_value = H5Tcommit( loc_id, name, id );
if( ret_value < 0 )
{
@@ -183,7 +183,7 @@ void DataType::commit(CommonFG& loc, const char* name) const
//--------------------------------------------------------------------------
// Function: DataType::commit
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function only in the type of the
/// It differs from the above function only in the type of the
/// argument \a name.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -194,8 +194,8 @@ void DataType::commit(CommonFG& loc, const string& name) const
//--------------------------------------------------------------------------
// Function: DataType::committed
///\brief Determines whether a datatype is a named type or a
/// transient type.
///\brief Determines whether a datatype is a named type or a
/// transient type.
///\return true if the datatype is a named type, and false, otherwise.
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
@@ -216,11 +216,11 @@ bool DataType::committed() const
//--------------------------------------------------------------------------
// Function: DataType::find
///\brief Finds a conversion function that can handle a conversion
///\brief Finds a conversion function that can handle a conversion
/// from this datatype to the specified datatype, \a dest.
///\param dest - IN: Destination datatype
///\param pcdata - IN: Pointer to type conversion data
///\return Pointer to a suitable conversion function
///\return Pointer to a suitable conversion function
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -237,14 +237,14 @@ H5T_conv_t DataType::find( const DataType& dest, H5T_cdata_t **pcdata ) const
//--------------------------------------------------------------------------
// Function: DataType::convert
///\brief Converts data from this datatype to the specified datatypes.
///\brief Converts data from this datatype to the specified datatypes.
///\param dest - IN: Destination datatype
///\param nelmts - IN: Size of array \a buf
///\param buf - IN/OUT: Array containing pre- and post-conversion
///\param buf - IN/OUT: Array containing pre- and post-conversion
/// values
///\param background - IN: Optional backgroud buffer
///\param plist - IN: Dataset transfer property list
///\return Pointer to a suitable conversion function
///\return Pointer to a suitable conversion function
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -269,8 +269,8 @@ void DataType::convert( const DataType& dest, size_t nelmts, void *buf, void *ba
///
///\exception H5::DataTypeIException
///\par Descrition
/// This is normally done by the library for predefined data
/// types so the application doesn't inadvertently change or
/// This is normally done by the library for predefined data
/// types so the application doesn't inadvertently change or
/// delete a predefined type.
///
/// Once a data type is locked it can never be unlocked unless
@@ -289,7 +289,7 @@ void DataType::lock() const
//--------------------------------------------------------------------------
// Function: DataType::getClass
///\brief Returns the datatype class identifier.
///\brief Returns the datatype class identifier.
///\return Datatype class identifier
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
@@ -308,7 +308,7 @@ H5T_class_t DataType::getClass() const
//--------------------------------------------------------------------------
// Function: DataType::getSize
///\brief Returns the size of a datatype.
///\brief Returns the size of a datatype.
///\return Datatype size in bytes
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
@@ -326,7 +326,7 @@ size_t DataType::getSize() const
//--------------------------------------------------------------------------
// Function: DataType::getSuper
///\brief Returns the base datatype from which a datatype is derived.
///\brief Returns the base datatype from which a datatype is derived.
///\return DataType object
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
@@ -334,7 +334,7 @@ size_t DataType::getSize() const
DataType DataType::getSuper() const
{
// Call C routine to get the base datatype from which the specified
// datatype is derived.
// datatype is derived.
hid_t base_type_id = H5Tget_super( id );
// If H5Tget_super returns a valid datatype id, create and return
@@ -352,14 +352,14 @@ DataType DataType::getSuper() const
//--------------------------------------------------------------------------
// Function: DataType::registerFunc
///\brief Registers the specified conversion function.
///\brief Registers the specified conversion function.
///\param pers - IN: Conversion option
/// \li \c H5T_PERS_HARD for hard conversion functions
/// \li \c H5T_PERS_SOFT for soft conversion functions.
///\param name - IN: Name displayed in diagnostic output.
/// \li \c H5T_PERS_SOFT for soft conversion functions.
///\param name - IN: Name displayed in diagnostic output.
///\param dest - IN: Destination datatype.
///\param func - IN: Function to convert between source and
/// destination datatypes.
///\param func - IN: Function to convert between source and
/// destination datatypes.
///\exception H5::DataTypeIException
///\par Description
/// For more information, please see:
@@ -381,7 +381,7 @@ void DataType::registerFunc( H5T_pers_t pers, const char* name, const DataType&
//--------------------------------------------------------------------------
// Function: DataType::registerFunc
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function only in the type of the
/// It differs from the above function only in the type of the
/// argument \a name.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -392,14 +392,14 @@ void DataType::registerFunc( H5T_pers_t pers, const string& name, const DataType
//--------------------------------------------------------------------------
// Function: DataType::unregister
///\brief Removes a conversion function from all conversion paths.
///\brief Removes a conversion function from all conversion paths.
///\param pers - IN: Conversion option
/// \li \c H5T_PERS_HARD for hard conversion functions
/// \li \c H5T_PERS_SOFT for soft conversion functions.
///\param name - IN: Name displayed in diagnostic output.
/// \li \c H5T_PERS_SOFT for soft conversion functions.
///\param name - IN: Name displayed in diagnostic output.
///\param dest - IN: Destination datatype.
///\param func - IN: Function to convert between source and
/// destination datatypes.
///\param func - IN: Function to convert between source and
/// destination datatypes.
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -407,7 +407,7 @@ void DataType::unregister( H5T_pers_t pers, const char* name, const DataType& de
{
hid_t dest_id = dest.getId(); // get id of the dest datatype for C API
// Call C routine H5Tunregister to remove the conversion function
// Call C routine H5Tunregister to remove the conversion function
herr_t ret_value = H5Tunregister( pers, name, id, dest_id, func );
if( ret_value < 0 )
{
@@ -418,7 +418,7 @@ void DataType::unregister( H5T_pers_t pers, const char* name, const DataType& de
//--------------------------------------------------------------------------
// Function: DataType::unregister
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function only in the type of the
/// It differs from the above function only in the type of the
/// argument \a name.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -429,15 +429,15 @@ void DataType::unregister( H5T_pers_t pers, const string& name, const DataType&
//--------------------------------------------------------------------------
// Function: DataType::setTag
///\brief Tags an opaque datatype.
///\param tag - IN: Descriptive ASCII string with which the opaque
/// datatype is to be tagged.
///\brief Tags an opaque datatype.
///\param tag - IN: Descriptive ASCII string with which the opaque
/// datatype is to be tagged.
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DataType::setTag( const char* tag ) const
{
// Call C routine H5Tset_tag to tag an opaque datatype.
// Call C routine H5Tset_tag to tag an opaque datatype.
herr_t ret_value = H5Tset_tag( id, tag );
if( ret_value < 0 )
{
@@ -448,7 +448,7 @@ void DataType::setTag( const char* tag ) const
//--------------------------------------------------------------------------
// Function: DataType::setTag
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function only in the type of the
/// It differs from the above function only in the type of the
/// argument \a name.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -459,7 +459,7 @@ void DataType::setTag( const string& tag ) const
//--------------------------------------------------------------------------
// Function: DataType::getTag
///\brief Gets the tag associated with an opaque datatype.
///\brief Gets the tag associated with an opaque datatype.
///\return Tag associated with the opaque datatype
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
@@ -473,8 +473,8 @@ string DataType::getTag() const
if( tag_Cstr != NULL )
{
string tag = string(tag_Cstr); // convert C string to string object
HDfree(tag_Cstr); // free the C string
return (tag); // return the tag
HDfree(tag_Cstr); // free the C string
return (tag); // return the tag
}
else
{
@@ -486,7 +486,7 @@ string DataType::getTag() const
// Function: DataType::detectClass
///\brief Checks whether a datatype contains (or is) a certain type of
/// datatype.
///\return true if this datatype contains or is the specified type,
///\return true if this datatype contains or is the specified type,
/// and false, otherwise.
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - May, 2004
@@ -507,7 +507,7 @@ bool DataType::detectClass(H5T_class_t cls) const
//--------------------------------------------------------------------------
// Function: DataType::isVariableStr
///\brief Check whether this datatype is a variable-length string.
///\return true if this datatype is a variable-length string, and
///\return true if this datatype is a variable-length string, and
/// false, otherwise.
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - May, 2004
@@ -554,7 +554,7 @@ void* DataType::Reference(const char* name, DataSpace& dataspace, H5R_type_t ref
///\return A reference
///\exception H5::DataTypeIException
///\par Description
// This function passes H5R_OBJECT and -1 to the protected
// This function passes H5R_OBJECT and -1 to the protected
// function for it to pass to the C API H5Rcreate
// to create a reference to the named object.
// Programmer Binh-Minh Ribler - May, 2004
@@ -589,10 +589,10 @@ void* DataType::Reference(const string& name) const
///\param ref - IN: Reference to query
///\param ref_type - IN: Type of reference to query
///\return Object type, which can be one of the following:
/// \li \c H5G_LINK Object is a symbolic link.
/// \li \c H5G_GROUP Object is a group.
/// \li \c H5G_DATASET Object is a dataset.
/// \li \c H5G_TYPE Object is a named datatype
/// \li \c H5G_LINK Object is a symbolic link.
/// \li \c H5G_GROUP Object is a group.
/// \li \c H5G_DATASET Object is a dataset.
/// \li \c H5G_TYPE Object is a named datatype
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
@@ -659,7 +659,7 @@ void DataType::close()
// ID reference counting mechanism - June 1, 2004
//--------------------------------------------------------------------------
DataType::~DataType()
{
{
// The datatype id will be closed properly
if( is_predtype == false ) {
try {
@@ -669,7 +669,7 @@ DataType::~DataType()
cerr << inMemFunc("~DataType - ") << close_error.getDetailMsg() << endl;
}
}
}
}
#ifndef H5_NO_NAMESPACE
} // end namespace
+14 -14
View File
@@ -34,23 +34,23 @@ class H5_DLLCPP DataType : public H5Object {
// Copies an existing datatype to this datatype object
void copy( const DataType& like_type );
// Returns the datatype class identifier.
// Returns the datatype class identifier.
H5T_class_t getClass() const;
// Commits a transient datatype to a file; this datatype becomes
// Commits a transient datatype to a file; this datatype becomes
// a named datatype which can be accessed from the location.
void commit( CommonFG& loc, const string& name ) const;
void commit( CommonFG& loc, const char* name ) const;
// Determines whether this datatype is a named datatype or
// a transient datatype.
// Determines whether this datatype is a named datatype or
// a transient datatype.
bool committed() const;
// Finds a conversion function that can handle the conversion
// Finds a conversion function that can handle the conversion
// this datatype to the given datatype, dest.
H5T_conv_t find( const DataType& dest, H5T_cdata_t **pcdata ) const;
// Converts data from between specified datatypes.
// Converts data from between specified datatypes.
void convert( const DataType& dest, size_t nelmts, void *buf, void *background, PropList& plist ) const;
// Assignment operator
@@ -59,29 +59,29 @@ class H5_DLLCPP DataType : public H5Object {
// Determines whether two datatypes are the same.
bool operator==(const DataType& compared_type ) const;
// Locks a datatype.
// Locks a datatype.
void lock() const;
// Returns the size of a datatype.
// Returns the size of a datatype.
size_t getSize() const;
// Returns the base datatype from which a datatype is derived.
// Returns the base datatype from which a datatype is derived.
// Note: not quite right for specific types yet???
DataType getSuper() const;
// Registers a conversion function.
// Registers a conversion function.
void registerFunc(H5T_pers_t pers, const string& name, const DataType& dest, H5T_conv_t func ) const;
void registerFunc(H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const;
// Removes a conversion function from all conversion paths.
// Removes a conversion function from all conversion paths.
void unregister( H5T_pers_t pers, const string& name, const DataType& dest, H5T_conv_t func ) const;
void unregister( H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const;
// Tags an opaque datatype.
// Tags an opaque datatype.
void setTag( const string& tag ) const;
void setTag( const char* tag ) const;
// Gets the tag associated with an opaque datatype.
// Gets the tag associated with an opaque datatype.
string getTag() const;
// Checks whether this datatype contains (or is) a certain type class.
@@ -106,7 +106,7 @@ class H5_DLLCPP DataType : public H5Object {
virtual string fromClass () const { return ("DataType"); }
// Creates a copy of an existing DataType using its id
// Creates a copy of an existing DataType using its id
DataType( const hid_t type_id, bool predtype = false );
// Default constructor
+8 -8
View File
@@ -49,7 +49,7 @@ DSetCreatPropList::DSetCreatPropList( const DSetCreatPropList& orig ) : PropList
//--------------------------------------------------------------------------
// Function: DSetCreatPropList overloaded constructor
///\brief Creates a DSetCreatPropList object using the id of an
///\brief Creates a DSetCreatPropList object using the id of an
/// existing dataset creation property list.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -93,7 +93,7 @@ int DSetCreatPropList::getChunk( int max_ndims, hsize_t* dim ) const
int chunk_size = H5Pget_chunk( id, max_ndims, dim );
if( chunk_size < 0 )
{
throw PropListIException("DSetCreatPropList::getChunk",
throw PropListIException("DSetCreatPropList::getChunk",
"H5Pget_chunk returns negative chunk size");
}
return( chunk_size );
@@ -140,7 +140,7 @@ H5D_layout_t DSetCreatPropList::getLayout() const
H5D_layout_t layout = H5Pget_layout( id );
if( layout == H5D_LAYOUT_ERROR )
{
throw PropListIException("DSetCreatPropList::getLayout",
throw PropListIException("DSetCreatPropList::getLayout",
"H5Pget_layout returns H5D_LAYOUT_ERROR");
}
return( layout );
@@ -314,10 +314,10 @@ int DSetCreatPropList::getNfilters() const
//--------------------------------------------------------------------------
// Function: DSetCreatPropList::getFilter
///\brief Returns information about a filter in a pipeline
///\param filter_number - IN: Filter to get, range [0..N-1], where
///\param filter_number - IN: Filter to get, range [0..N-1], where
/// N is returned by H5Pget_nfilters()
///\param flags - OUT: General properties of the filter
///\param cd_nelmts - IN/OUT: Number of elements in \a cd_values /Number
///\param cd_nelmts - IN/OUT: Number of elements in \a cd_values /Number
/// of values defined by the filter
///\param cd_values - OUT: Array to hold the data; allocated by the user
///\param namelen - OUT: Length of \a name
@@ -333,7 +333,7 @@ H5Z_filter_t DSetCreatPropList::getFilter(int filter_number, unsigned int &flags
unsigned int& filter_config) const
{
H5Z_filter_t filter_id;
filter_id = H5Pget_filter( id, filter_number, &flags, &cd_nelmts,
filter_id = H5Pget_filter( id, filter_number, &flags, &cd_nelmts,
cd_values, namelen, name, &filter_config);
if( filter_id == H5Z_FILTER_ERROR )
{
@@ -350,7 +350,7 @@ H5Z_filter_t DSetCreatPropList::getFilter(int filter_number, unsigned int &flags
/// filter id
///\param filter_id - IN: Filter to get
///\param flags - OUT: General properties of the filter
///\param cd_nelmts - IN/OUT: Number of elements in \a cd_values /Number
///\param cd_nelmts - IN/OUT: Number of elements in \a cd_values /Number
/// of values defined by the filter
///\param cd_values - OUT: Array to hold the data; allocated by the user
///\param namelen - IN: Length of \a name
@@ -363,7 +363,7 @@ void DSetCreatPropList::getFilterById(H5Z_filter_t filter_id, unsigned int &flag
unsigned int* cd_values, size_t namelen, char name[],
unsigned int &filter_config) const
{
herr_t ret_value = H5Pget_filter_by_id(id, filter_id, &flags, &cd_nelmts,
herr_t ret_value = H5Pget_filter_by_id(id, filter_id, &flags, &cd_nelmts,
cd_values, namelen, name, &filter_config );
if (ret_value < 0)
{
+4 -4
View File
@@ -21,11 +21,11 @@ namespace H5 {
#endif
class H5_DLLCPP DSetCreatPropList : public PropList {
public:
public:
// Default dataset creation property list.
static const DSetCreatPropList DEFAULT;
// Queries whether all the filters set in this property list are
// Queries whether all the filters set in this property list are
// available currently.
bool allFiltersAvail();
@@ -69,7 +69,7 @@ class H5_DLLCPP DSetCreatPropList : public PropList {
// property list.
H5D_layout_t getLayout() const;
// Sets the type of storage used to store the raw data for the
// Sets the type of storage used to store the raw data for the
// dataset that uses this property list.
void setLayout(H5D_layout_t layout) const;
@@ -109,7 +109,7 @@ class H5_DLLCPP DSetCreatPropList : public PropList {
// Copy constructor: creates a copy of a DSetCreatPropList object.
DSetCreatPropList(const DSetCreatPropList& orig);
// Creates a copy of an existing dataset creation property list
// Creates a copy of an existing dataset creation property list
// using the property list id.
DSetCreatPropList(const hid_t plist_id);
+12 -12
View File
@@ -41,7 +41,7 @@ DSetMemXferPropList::DSetMemXferPropList() : PropList(H5P_DATASET_XFER) {}
// Function DSetMemXferPropList copy constructor
///\brief Copy constructor: makes a copy of the original
/// DSetMemXferPropList object
///\param orig - IN: The original dataset memory and transfer property
///\param orig - IN: The original dataset memory and transfer property
/// list object to copy
// Programmer: Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -222,7 +222,7 @@ void DSetMemXferPropList::getTypeConvCB( H5T_conv_except_func_t *op, void **user
//--------------------------------------------------------------------------
void DSetMemXferPropList::setVlenMemManager( H5MM_allocate_t alloc_func, void* alloc_info, H5MM_free_t free_func, void* free_info ) const
{
herr_t ret_value = H5Pset_vlen_mem_manager( id, alloc_func, alloc_info,
herr_t ret_value = H5Pset_vlen_mem_manager( id, alloc_func, alloc_info,
free_func, free_info );
if( ret_value < 0 )
{
@@ -233,7 +233,7 @@ void DSetMemXferPropList::setVlenMemManager( H5MM_allocate_t alloc_func, void* a
//--------------------------------------------------------------------------
// Function: DSetMemXferPropList::setVlenMemManager
///\brief Sets the memory manager for variable-length datatype
///\brief Sets the memory manager for variable-length datatype
/// allocation - system \c malloc and \c free will be used.
///
///\exception H5::PropListIException
@@ -246,7 +246,7 @@ void DSetMemXferPropList::setVlenMemManager() const
//--------------------------------------------------------------------------
// Function: DSetMemXferPropList::getVlenMemManager
///\brief Gets the memory manager for variable-length datatype allocation
///\brief Gets the memory manager for variable-length datatype allocation
///\param alloc_func - OUT: User's allocate routine
///\param alloc_info - OUT: User's allocation parameters
///\param free_func - OUT: User's free routine
@@ -270,7 +270,7 @@ void DSetMemXferPropList::getVlenMemManager( H5MM_allocate_t& alloc_func, void**
///\param memb_dxpl - OUT: Array of data access property lists
///\exception H5::PropListIException
///\par Description
/// This function can only be used after the member map has
/// This function can only be used after the member map has
/// been set with FileAccPropList::setMulti (not done - BMR.)
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
@@ -304,7 +304,7 @@ void DSetMemXferPropList::getMulti(hid_t *memb_dxpl)
//--------------------------------------------------------------------------
// Function: DSetMemXferPropList::setSmallDataBlockSize
///\brief Sets the size of a contiguous block reserved for small data.
///\param size - IN: Maximum size, in bytes, of the small data block.
///\param size - IN: Maximum size, in bytes, of the small data block.
///\exception H5::PropListIException
///\par Description
/// For detail, please refer to the C layer Reference Manual at:
@@ -363,7 +363,7 @@ void DSetMemXferPropList::setHyperVectorSize(size_t vector_size)
//--------------------------------------------------------------------------
// Function: DSetMemXferPropList::getSmallDataBlockSize
///\brief Returns the number of I/O vectors to be read/written in
///\brief Returns the number of I/O vectors to be read/written in
/// hyperslab I/O.
///\return Number of I/O vectors
///\exception H5::PropListIException
@@ -389,14 +389,14 @@ size_t DSetMemXferPropList::getHyperVectorSize()
/// disabled
///\exception H5::PropListIException
///\par Description
/// The error detection algorithm used is the algorithm previously
/// specified in the corresponding dataset creation property
/// list. This function does not affect the use of error
/// The error detection algorithm used is the algorithm previously
/// specified in the corresponding dataset creation property
/// list. This function does not affect the use of error
/// detection in the writing process.
///\par
/// Valid values are as follows:
/// \li \c H5Z_ENABLE_EDC (default)
/// \li \c H5Z_DISABLE_EDC
/// \li \c H5Z_ENABLE_EDC (default)
/// \li \c H5Z_DISABLE_EDC
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
void DSetMemXferPropList::setEDCCheck(H5Z_EDC_t check)
+7 -7
View File
@@ -42,7 +42,7 @@ class H5_DLLCPP DSetMemXferPropList : public PropList {
// Checks status of the dataset transfer property list
bool getPreserve() const;
// Sets B-tree split ratios for a dataset transfer property list
// Sets B-tree split ratios for a dataset transfer property list
void setBtreeRatios( double left, double middle, double right ) const;
// Gets B-tree split ratios for a dataset transfer property list
@@ -54,18 +54,18 @@ class H5_DLLCPP DSetMemXferPropList : public PropList {
// Gets the exception handling callback for datatype conversion
void getTypeConvCB( H5T_conv_except_func_t *op, void **user_data) const;
// Sets the memory manager for variable-length datatype
// Sets the memory manager for variable-length datatype
// allocation in H5Dread and H5Dvlen_reclaim
void setVlenMemManager( H5MM_allocate_t alloc, void* alloc_info,
void setVlenMemManager( H5MM_allocate_t alloc, void* alloc_info,
H5MM_free_t free, void* free_info ) const;
// alloc and free are set to NULL, indicating that system
// alloc and free are set to NULL, indicating that system
// malloc and free are to be used
void setVlenMemManager() const;
// Gets the memory manager for variable-length datatype
// Gets the memory manager for variable-length datatype
// allocation in H5Dread and H5Tvlen_reclaim
void getVlenMemManager( H5MM_allocate_t& alloc, void** alloc_info,
void getVlenMemManager( H5MM_allocate_t& alloc, void** alloc_info,
H5MM_free_t& free, void** free_info ) const;
// Sets the data transfer property list for the multi-file driver.
@@ -97,7 +97,7 @@ class H5_DLLCPP DSetMemXferPropList : public PropList {
// Returns this class name
virtual string fromClass () const { return ("DSetMemXferPropList"); }
// Creates a copy of an existing dataset memory and transfer
// Creates a copy of an existing dataset memory and transfer
// property list using the property list id.
DSetMemXferPropList (const hid_t plist_id);
+10 -10
View File
@@ -117,7 +117,7 @@ EnumType::EnumType( const IntType& data_type ) : DataType()
//--------------------------------------------------------------------------
void EnumType::insert( const char* name, void *value ) const
{
// Calls C routine H5Tenum_insert to insert the new enum datatype member.
// Calls C routine H5Tenum_insert to insert the new enum datatype member.
herr_t ret_value = H5Tenum_insert( id, name, value );
if( ret_value < 0 )
{
@@ -128,7 +128,7 @@ void EnumType::insert( const char* name, void *value ) const
//--------------------------------------------------------------------------
// Function: EnumType::insert
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function only in the type of
/// It differs from the above function only in the type of
/// argument \a name.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -139,8 +139,8 @@ void EnumType::insert( const string& name, void *value ) const
//--------------------------------------------------------------------------
// Function: EnumType::nameOf
///\brief Returns the symbol name corresponding to a specified member
/// of this enumeration datatype.
///\brief Returns the symbol name corresponding to a specified member
/// of this enumeration datatype.
///\param value - IN: Pointer to the value of the enum datatype
///\param size - IN: Size for the name
///\exception H5::DataTypeIException
@@ -166,8 +166,8 @@ string EnumType::nameOf( void *value, size_t size ) const
//--------------------------------------------------------------------------
// Function: EnumType::valueOf
///\brief Retrieves the value corresponding to a member of this
/// enumeration datatype, given the member's name.
///\brief Retrieves the value corresponding to a member of this
/// enumeration datatype, given the member's name.
///\param name - IN: Name of the queried member
///\param value - OUT: Pointer to the retrieved value
///\exception H5::DataTypeIException
@@ -186,7 +186,7 @@ void EnumType::valueOf( const char* name, void *value ) const
//--------------------------------------------------------------------------
// Function: EnumType::valueOf
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function only in the type of
/// It differs from the above function only in the type of
/// argument \a name.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -200,7 +200,7 @@ void EnumType::valueOf( const string& name, void *value ) const
///\brief Returns the index of a member in this enumeration datatype.
///\param name - IN: Name of the queried member
///\return Index of the member if it exists. Index will have the value
/// between 0 and \c N-1, where \c N is the value returned by the
/// between 0 and \c N-1, where \c N is the value returned by the
/// member function \c EnumType::getNmembers.
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - May 16, 2002
@@ -219,7 +219,7 @@ int EnumType::getMemberIndex(const char *name) const
//--------------------------------------------------------------------------
// Function: EnumType::getMemberIndex
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function only in the type of
/// It differs from the above function only in the type of
/// argument \a name.
// Programmer Binh-Minh Ribler - May 16, 2002
//--------------------------------------------------------------------------
@@ -248,7 +248,7 @@ int EnumType::getNmembers() const
//--------------------------------------------------------------------------
// Function: EnumType::getMemberValue
///\brief Retrieves the value of a member in this enumeration datatype,
///\brief Retrieves the value of a member in this enumeration datatype,
/// given the member's index.
///\param memb_no - IN: Index of the queried member
///\param value - OUT: Pointer to the retrieved value
+6 -6
View File
@@ -23,7 +23,7 @@ namespace H5 {
class H5_DLLCPP EnumType : public DataType {
public:
// Creates an empty enumeration datatype based on a native signed
// Creates an empty enumeration datatype based on a native signed
// integer type, whose size is given by size.
EnumType( size_t size );
@@ -43,16 +43,16 @@ class H5_DLLCPP EnumType : public DataType {
// Returns the value of an enumeration datatype member
void getMemberValue( unsigned memb_no, void *value ) const;
// Inserts a new member to this enumeration type.
// Inserts a new member to this enumeration type.
void insert( const char* name, void *value ) const;
void insert( const string& name, void *value ) const;
// Returns the symbol name corresponding to a specified member
// of this enumeration datatype.
// Returns the symbol name corresponding to a specified member
// of this enumeration datatype.
string nameOf( void *value, size_t size ) const;
// Returns the value corresponding to a specified member of this
// enumeration datatype.
// Returns the value corresponding to a specified member of this
// enumeration datatype.
void valueOf( const char* name, void *value ) const;
void valueOf( const string& name, void *value ) const;
+19 -19
View File
@@ -33,7 +33,7 @@ Exception::Exception() : detail_message(""), func_name("") {}
//--------------------------------------------------------------------------
// Function: Exception overloaded constructor
///\brief Creates an exception with the name of the function,
///\brief Creates an exception with the name of the function,
/// in which the failure occurs, and an optional detailed message.
///\param func_name - IN: Name of the function where failure occurs
///\param message - IN: Message on the failure
@@ -71,7 +71,7 @@ string Exception::getMajorString( hid_t err_major ) const
// If H5Eget_msg() returns a negative value, raise an exception,
if( mesg_size < 0 )
throw IdComponentException("Exception::getMajorString",
throw IdComponentException("Exception::getMajorString",
"H5Eget_msg failed");
// Call H5Eget_msg again to get the actual message
@@ -80,7 +80,7 @@ string Exception::getMajorString( hid_t err_major ) const
// Check for failure again
if( mesg_size < 0 )
throw IdComponentException("Exception::getMajorString",
throw IdComponentException("Exception::getMajorString",
"H5Eget_msg failed");
// Convert the C error description and return
@@ -107,7 +107,7 @@ string Exception::getMinorString( hid_t err_minor ) const
// If H5Eget_msg() returns a negative value, raise an exception,
if( mesg_size < 0 )
throw IdComponentException("Exception::getMinorString",
throw IdComponentException("Exception::getMinorString",
"H5Eget_msg failed");
// Call H5Eget_msg again to get the actual message
@@ -116,7 +116,7 @@ string Exception::getMinorString( hid_t err_minor ) const
// Check for failure again
if( mesg_size < 0 )
throw IdComponentException("Exception::getMinorString",
throw IdComponentException("Exception::getMinorString",
"H5Eget_msg failed");
// Convert the C error description and return
@@ -132,7 +132,7 @@ string Exception::getMinorString( hid_t err_minor ) const
///\param client_data - IN: Data passed to the error function
///\par Description
/// When the library is first initialized the auto printing
/// function, \a func, is set to the C API \c H5Eprint and
/// function, \a func, is set to the C API \c H5Eprint and
/// \a client_data is the standard error stream pointer, \c stderr.
/// Automatic stack traversal is always in the \c H5E_WALK_DOWNWARD
/// direction.
@@ -168,16 +168,16 @@ void Exception::dontPrint()
// Function: Exception::getAutoPrint
///\brief Retrieves the current settings for the automatic error
/// stack traversal function and its data.
///\param func - OUT: Current setting for the function to be
///\param func - OUT: Current setting for the function to be
/// called upon an error condition
///\param client_data - OUT: Current setting for the data passed to
///\param client_data - OUT: Current setting for the data passed to
/// the error function
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void Exception::getAutoPrint( H5E_auto_stack_t& func, void** client_data )
{
// calls the C API routine H5Eget_auto to get the current setting of
// the automatic error printing
// the automatic error printing
herr_t ret_value = H5Eget_auto_stack( H5E_DEFAULT, &func, client_data );
if( ret_value < 0 )
throw Exception( "Exception::getAutoPrint", "H5Eget_auto failed" );
@@ -325,7 +325,7 @@ Exception::~Exception() {}
FileIException::FileIException():Exception(){}
//--------------------------------------------------------------------------
// Function: FileIException overloaded constructor
///\brief Creates a FileIException with the name of the function,
///\brief Creates a FileIException with the name of the function,
/// in which the failure occurs, and an optional detailed message.
///\param func_name - IN: Name of the function where failure occurs
///\param message - IN: Message on the failure
@@ -348,7 +348,7 @@ FileIException::~FileIException() {}
GroupIException::GroupIException():Exception(){}
//--------------------------------------------------------------------------
// Function: GroupIException overloaded constructor
///\brief Creates a GroupIException with the name of the function,
///\brief Creates a GroupIException with the name of the function,
/// in which the failure occurs, and an optional detailed message.
///\param func_name - IN: Name of the function where failure occurs
///\param message - IN: Message on the failure
@@ -371,7 +371,7 @@ GroupIException::~GroupIException() {}
DataSpaceIException::DataSpaceIException():Exception(){}
//--------------------------------------------------------------------------
// Function: DataSpaceIException overloaded constructor
///\brief Creates a DataSpaceIException with the name of the function,
///\brief Creates a DataSpaceIException with the name of the function,
/// in which the failure occurs, and an optional detailed message.
///\param func_name - IN: Name of the function where failure occurs
///\param message - IN: Message on the failure
@@ -394,7 +394,7 @@ DataSpaceIException::~DataSpaceIException() {}
DataTypeIException::DataTypeIException():Exception(){}
//--------------------------------------------------------------------------
// Function: DataTypeIException overloaded constructor
///\brief Creates a DataTypeIException with the name of the function,
///\brief Creates a DataTypeIException with the name of the function,
/// in which the failure occurs, and an optional detailed message.
///\param func_name - IN: Name of the function where failure occurs
///\param message - IN: Message on the failure
@@ -417,7 +417,7 @@ DataTypeIException::~DataTypeIException() {}
PropListIException::PropListIException():Exception(){}
//--------------------------------------------------------------------------
// Function: PropListIException overloaded constructor
///\brief Creates a PropListIException with the name of the function,
///\brief Creates a PropListIException with the name of the function,
/// in which the failure occurs, and an optional detailed message.
///\param func_name - IN: Name of the function where failure occurs
///\param message - IN: Message on the failure
@@ -440,7 +440,7 @@ PropListIException::~PropListIException() {}
DataSetIException::DataSetIException():Exception(){}
//--------------------------------------------------------------------------
// Function: DataSetIException overloaded constructor
///\brief Creates a DataSetIException with the name of the function,
///\brief Creates a DataSetIException with the name of the function,
/// in which the failure occurs, and an optional detailed message.
///\param func_name - IN: Name of the function where failure occurs
///\param message - IN: Message on the failure
@@ -463,7 +463,7 @@ DataSetIException::~DataSetIException() {}
AttributeIException::AttributeIException():Exception(){}
//--------------------------------------------------------------------------
// Function: AttributeIException overloaded constructor
///\brief Creates an AttributeIException with the name of the function,
///\brief Creates an AttributeIException with the name of the function,
/// in which the failure occurs, and an optional detailed message.
///\param func_name - IN: Name of the function where failure occurs
///\param message - IN: Message on the failure
@@ -486,7 +486,7 @@ AttributeIException::~AttributeIException() {}
ReferenceException::ReferenceException():Exception(){}
//--------------------------------------------------------------------------
// Function: ReferenceException overloaded constructor
///\brief Creates a ReferenceException with the name of the function,
///\brief Creates a ReferenceException with the name of the function,
/// in which the failure occurs, and an optional detailed message.
///\param func_name - IN: Name of the function where failure occurs
///\param message - IN: Message on the failure
@@ -509,7 +509,7 @@ ReferenceException::~ReferenceException() {}
LibraryIException::LibraryIException():Exception(){}
//--------------------------------------------------------------------------
// Function: LibraryIException overloaded constructor
///\brief Creates a LibraryIException with the name of the function,
///\brief Creates a LibraryIException with the name of the function,
/// in which the failure occurs, and an optional detailed message.
///\param func_name - IN: Name of the function where failure occurs
///\param message - IN: Message on the failure
@@ -532,7 +532,7 @@ LibraryIException::~LibraryIException() {}
IdComponentException::IdComponentException(): Exception() {}
//--------------------------------------------------------------------------
// Function: IdComponentException overloaded constructor
///\brief Creates a IdComponentException with the name of the function,
///\brief Creates a IdComponentException with the name of the function,
/// in which the failure occurs, and an optional detailed message.
///\param func_name - IN: Name of the function where failure occurs
///\param message - IN: Message on the failure
+5 -5
View File
@@ -43,7 +43,7 @@ class H5_DLLCPP Exception {
string getDetailMsg() const;
const char* getCDetailMsg() const; // C string of detailed message
string getFuncName() const; // function name as a string object
const char* getCFuncName() const; // function name as a char string
const char* getCFuncName() const; // function name as a char string
// Turns on the automatic error printing.
static void setAutoPrint( H5E_auto_stack_t& func, void* client_data);
@@ -51,16 +51,16 @@ class H5_DLLCPP Exception {
// Turns off the automatic error printing.
static void dontPrint();
// Retrieves the current settings for the automatic error stack
// Retrieves the current settings for the automatic error stack
// traversal function and its data.
static void getAutoPrint( H5E_auto_stack_t& func, void** client_data);
// Clears the error stack for the current thread.
static void clearErrorStack();
// Walks the error stack for the current thread, calling the
// Walks the error stack for the current thread, calling the
// specified function.
static void walkErrorStack( H5E_direction_t direction,
static void walkErrorStack( H5E_direction_t direction,
H5E_walk_t func, void* client_data);
// Prints the error stack in a default manner.
@@ -77,7 +77,7 @@ class H5_DLLCPP Exception {
private:
// Because 'string' is not instantiated at compilation time, this
// warning is displayed when building DLL; but the class is exported
// warning is displayed when building DLL; but the class is exported
// so the warning is harmless
#if defined(WIN32)
#pragma warning(disable: 4251)
+21 -21
View File
@@ -71,7 +71,7 @@ void FileAccPropList::setStdio() const
//--------------------------------------------------------------------------
// Function: FileAccPropList::getDriver
///\brief Return the ID of the low-level file driver.
///\return A low-level driver ID which is the same ID used when the
///\return A low-level driver ID which is the same ID used when the
/// driver was set for the property list. The driver ID is
/// only valid as long as the file driver remains registered.
/// Valid driver identifiers can be found at:
@@ -96,7 +96,7 @@ hid_t FileAccPropList::getDriver() const
///\param new_driver_info - IN: Struct containing the driver-specific properites
///\exception H5::PropListIException
///\par Description
/// For a list of valid driver identifiers, please see the C
/// For a list of valid driver identifiers, please see the C
/// layer Reference Manual at:
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-GetDriver
// Programmer: Binh-Minh Ribler - April, 2004
@@ -148,13 +148,13 @@ hsize_t FileAccPropList::getFamilyOffset() const
// Function: FileAccPropList::setCore
///\brief Modifies this file access property list to use the \c H5FD_CORE
/// driver.
///\param increment - IN: Specifies how much memory to increase each
///\param increment - IN: Specifies how much memory to increase each
/// time more memory is needed, in bytes
///\param backing_store - IN: Indicating whether to write the file
///\param backing_store - IN: Indicating whether to write the file
/// contents to disk when the file is closed
///\exception H5::PropListIException
///\par Description
/// For more details on the use of \c H5FD_CORE driver, please
/// For more details on the use of \c H5FD_CORE driver, please
/// refer to
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetFaplCore
// Programmer: Binh-Minh Ribler - April, 2004
@@ -172,7 +172,7 @@ void FileAccPropList::setCore (size_t increment, hbool_t backing_store) const
// Function: FileAccPropList::getCore
///\brief Queries core file driver properties.
///\param increment - OUT: Size of memory increment, in bytes
///\param backing_store - OUT: Indicating whether to write the file
///\param backing_store - OUT: Indicating whether to write the file
/// contents to disk when the file is closed
///\exception H5::PropListIException
// Programmer: Binh-Minh Ribler - April, 2004
@@ -251,7 +251,7 @@ FileAccPropList FileAccPropList::getFamily(hsize_t& memb_size) const
//--------------------------------------------------------------------------
// Function: FileAccPropList::setSplit
///\brief Emulates the old split file driver, which stored meta data
///\brief Emulates the old split file driver, which stored meta data
/// in one file and raw data in another file.
///\param meta_plist - IN: File access plist for the metadata file
///\param raw_plist - IN: File access plist for the raw data file
@@ -374,7 +374,7 @@ void FileAccPropList::setSieveBufSize(size_t bufsize) const
//--------------------------------------------------------------------------
// Function: FileAccPropList::setMetaBlockSize
///\brief Sets the minimum size of metadata block allocations.
///\param block_size - IN: Minimum size, in bytes, of metadata
///\param block_size - IN: Minimum size, in bytes, of metadata
/// block allocations
///\exception H5::PropListIException
///\par Description
@@ -470,9 +470,9 @@ void FileAccPropList::setSec2() const
///\param alignment - IN: Alignment value
///\exception H5::PropListIException
///\par Description
/// The parameter \a threshold must have a non-negative value.
/// Note that setting the threshold value to 0 (zero) has the
/// effect of a special case, forcing everything to be aligned.
/// The parameter \a threshold must have a non-negative value.
/// Note that setting the threshold value to 0 (zero) has the
/// effect of a special case, forcing everything to be aligned.
/// The parameter \a alignment must have a positive value.
///
/// For detail on \a setting alignment, please refer to
@@ -490,7 +490,7 @@ void FileAccPropList::setAlignment( hsize_t threshold, hsize_t alignment ) const
//--------------------------------------------------------------------------
// Function: FileAccPropList::getAlignment
///\brief Returns the current settings for alignment properties from
///\brief Returns the current settings for alignment properties from
/// this property list.
///\param threshold - OUT: Retrieved threshold value for file object size
///\param alignment - OUT: Retrieved alignment value
@@ -555,12 +555,12 @@ H5FD_mem_t FileAccPropList::getMultiType() const
///\param rdcc_w0 - IN: Preemption policy
///\exception H5::PropListIException
///\par Description
/// The argument \a rdcc_w0 should hold a value between 0 and 1
/// inclusive. This value indicates how much chunks that have
/// been fully read are favored for preemption. A value of zero
/// means fully read chunks are treated no differently than other
/// chunks (the preemption is strictly LRU) while a value of one
/// means fully read chunks are always preempted before other chunks.
/// The argument \a rdcc_w0 should hold a value between 0 and 1
/// inclusive. This value indicates how much chunks that have
/// been fully read are favored for preemption. A value of zero
/// means fully read chunks are treated no differently than other
/// chunks (the preemption is strictly LRU) while a value of one
/// means fully read chunks are always preempted before other chunks.
// Programmer: Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void FileAccPropList::setCache( int mdc_nelmts, size_t rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0 ) const
@@ -594,7 +594,7 @@ void FileAccPropList::getCache( int& mdc_nelmts, size_t& rdcc_nelmts, size_t& rd
//--------------------------------------------------------------------------
// Function: FileAccPropList::setFcloseDegree
///\brief Sets the degree for the file close behavior.
///\param degree - IN:
///\param degree - IN:
///\exception H5::PropListIException
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
@@ -628,8 +628,8 @@ H5F_close_degree_t FileAccPropList::getFcloseDegree()
//--------------------------------------------------------------------------
// Function: FileAccPropList::setGcReferences
///\brief Sets garbage collecting references flag.
///\param gc_ref - IN: Flag setting reference garbage collection to
/// on (1) or off (0).
///\param gc_ref - IN: Flag setting reference garbage collection to
/// on (1) or off (0).
///\exception H5::PropListIException
///\par Description
/// For detail on \a fapl, please refer to
+2 -2
View File
@@ -58,9 +58,9 @@ class H5_DLLCPP FileAccPropList : public PropList {
FileAccPropList getFamily(hsize_t& memb_size) const;
// Emulates the old split file driver,
void setSplit( FileAccPropList& meta_plist, FileAccPropList& raw_plist,
void setSplit( FileAccPropList& meta_plist, FileAccPropList& raw_plist,
const char* meta_ext = ".meta", const char* raw_ext = ".raw" ) const;
void setSplit( FileAccPropList& meta_plist, FileAccPropList& raw_plist,
void setSplit( FileAccPropList& meta_plist, FileAccPropList& raw_plist,
const string& meta_ext, const string& raw_ext ) const;
#ifdef H5_HAVE_STREAM // for Stream Virtual File Driver
+17 -17
View File
@@ -38,7 +38,7 @@ FileCreatPropList::FileCreatPropList() : PropList( H5P_FILE_CREATE ) {}
//--------------------------------------------------------------------------
// Function: FileCreatPropList copy constructor
///\brief Copy constructor: makes a copy of the original
///\brief Copy constructor: makes a copy of the original
/// FileCreatPropList object.
///\param original - IN: FileCreatPropList instance to copy
// Programmer Binh-Minh Ribler - 2000
@@ -71,7 +71,7 @@ void FileCreatPropList::getVersion(unsigned& super, unsigned& freelist, unsigned
herr_t ret_value = H5Pget_version( id, &super, &freelist, &stab, &shhdr );
if( ret_value < 0 )
{
throw PropListIException("FileCreatPropList::getVersion",
throw PropListIException("FileCreatPropList::getVersion",
"H5Pget_version failed");
}
}
@@ -82,7 +82,7 @@ void FileCreatPropList::getVersion(unsigned& super, unsigned& freelist, unsigned
///\param size - IN: User block size to be set, in bytes
///\exception H5::PropListIException
///\par Description
/// The default user block size is 0; it may be set to any power
/// The default user block size is 0; it may be set to any power
/// of 2 equal to 512 or greater (512, 1024, 2048, etc.)
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -91,7 +91,7 @@ void FileCreatPropList::setUserblock( hsize_t size ) const
herr_t ret_value = H5Pset_userblock( id, size);
if( ret_value < 0 )
{
throw PropListIException("FileCreatPropList::setUserblock",
throw PropListIException("FileCreatPropList::setUserblock",
"H5Pset_userblock failed");
}
}
@@ -109,7 +109,7 @@ hsize_t FileCreatPropList::getUserblock() const
herr_t ret_value = H5Pget_userblock( id, &userblock_size );
if( ret_value < 0 )
{
throw PropListIException("FileCreatPropList::getUserblock",
throw PropListIException("FileCreatPropList::getUserblock",
"H5Pget_userblock failed");
}
return( userblock_size );
@@ -117,10 +117,10 @@ hsize_t FileCreatPropList::getUserblock() const
//--------------------------------------------------------------------------
// Function: FileCreatPropList::setSizes
///\brief Sets the byte size of the offsets and lengths used to
///\brief Sets the byte size of the offsets and lengths used to
/// address objects in an HDF5 file.
///\param sizeof_addr - IN: Size of an object offset in bytes
///\param sizeof_size - IN: Size of an object length in bytes.
///\param sizeof_size - IN: Size of an object length in bytes.
///\exception H5::PropListIException
///\par Description
/// For information on setting sizes, please refer to the
@@ -133,14 +133,14 @@ void FileCreatPropList::setSizes( size_t sizeof_addr, size_t sizeof_size ) const
herr_t ret_value = H5Pset_sizes( id, sizeof_addr, sizeof_size );
if( ret_value < 0 )
{
throw PropListIException("FileCreatPropList::setSizes",
throw PropListIException("FileCreatPropList::setSizes",
"H5Pset_sizes failed");
}
}
//--------------------------------------------------------------------------
// Function: FileCreatPropList::getSizes
///\brief Retrieves the size of the offsets and lengths used in an
///\brief Retrieves the size of the offsets and lengths used in an
/// HDF5 file.
///
///\exception H5::PropListIException
@@ -151,14 +151,14 @@ void FileCreatPropList::getSizes( size_t& sizeof_addr, size_t& sizeof_size ) con
herr_t ret_value = H5Pget_sizes( id, &sizeof_addr, &sizeof_size );
if( ret_value < 0 )
{
throw PropListIException("FileCreatPropList::getSizes",
throw PropListIException("FileCreatPropList::getSizes",
"H5Pget_sizes failed");
}
}
//--------------------------------------------------------------------------
// Function: FileCreatPropList::setSymk
///\brief Sets the size of parameters used to control the symbol table
///\brief Sets the size of parameters used to control the symbol table
/// nodes.
///\param ik - IN: Symbol table tree rank
///\param lk - IN: Symbol table node size
@@ -173,14 +173,14 @@ void FileCreatPropList::setSymk( unsigned ik, unsigned lk ) const
herr_t ret_value = H5Pset_sym_k( id, ik, lk );
if( ret_value < 0 )
{
throw PropListIException("FileCreatPropList::setSymk",
throw PropListIException("FileCreatPropList::setSymk",
"H5Pset_sym_k failed");
}
}
//--------------------------------------------------------------------------
// Function: FileCreatPropList::getSymk
///\brief Retrieves the size of the symbol table B-tree 1/2 rank and
///\brief Retrieves the size of the symbol table B-tree 1/2 rank and
/// the symbol table leaf node 1/2 size.
///
///\exception H5::PropListIException
@@ -194,14 +194,14 @@ void FileCreatPropList::getSymk( unsigned& ik, unsigned& lk ) const
herr_t ret_value = H5Pget_sym_k( id, &ik, &lk );
if( ret_value < 0 )
{
throw PropListIException("FileCreatPropList::getSymk",
throw PropListIException("FileCreatPropList::getSymk",
"H5Pget_sym_k failed");
}
}
//--------------------------------------------------------------------------
// Function: FileCreatPropList::setIstorek
///\brief Sets the size of the parameter used to control the B-trees
///\brief Sets the size of the parameter used to control the B-trees
/// for indexing chunked datasets.
///\param ik - IN: 1/2 rank of chunked storage B-tree
///\exception H5::PropListIException
@@ -215,7 +215,7 @@ void FileCreatPropList::setIstorek( unsigned ik ) const
herr_t ret_value = H5Pset_istore_k( id, ik );
if( ret_value < 0 )
{
throw PropListIException("FileCreatPropList::setIstorek",
throw PropListIException("FileCreatPropList::setIstorek",
"H5Pset_istore_k failed");
}
}
@@ -236,7 +236,7 @@ unsigned FileCreatPropList::getIstorek() const
herr_t ret_value = H5Pget_istore_k( id, &ik );
if( ret_value < 0 )
{
throw PropListIException("FileCreatPropList::getIstorek",
throw PropListIException("FileCreatPropList::getIstorek",
"H5Pget_istore_k failed");
}
return( ik );
+2 -2
View File
@@ -25,7 +25,7 @@ class H5_DLLCPP FileCreatPropList : public PropList {
public:
// Default file creation property list.
static const FileCreatPropList DEFAULT;
// Retrieves version information for various parts of a file.
void getVersion( unsigned& super, unsigned& freelist, unsigned& stab, unsigned& shhdr ) const;
@@ -35,7 +35,7 @@ class H5_DLLCPP FileCreatPropList : public PropList {
// Gets the size of a user block in this file creation property list.
hsize_t getUserblock() const;
// Retrieves the size-of address and size quantities stored in a
// Retrieves the size-of address and size quantities stored in a
// file according to this file creation property list.
void getSizes( size_t& sizeof_addr, size_t& sizeof_size ) const;
+62 -62
View File
@@ -52,21 +52,21 @@ H5File::H5File() : IdComponent() {}
///\brief Creates or opens an HDF5 file depending on the parameter flags.
///\param name - IN: Name of the file
///\param flags - IN: File access flags
///\param create_plist - IN: File creation property list, used when
/// modifying default file meta-data. Default to
///\param create_plist - IN: File creation property list, used when
/// modifying default file meta-data. Default to
/// FileCreatPropList::DEFAULT
///\param access_plist - IN: File access property list. Default to
///\param access_plist - IN: File access property list. Default to
/// FileCreatPropList::DEFAULT
///\par Description
/// Valid values of \a flags include:
/// \li \c H5F_ACC_TRUNC - Truncate file, if it already exists,
/// erasing all data previously stored in
/// the file.
/// \li \c H5F_ACC_EXCL - Fail if file already exists.
/// \li \c H5F_ACC_TRUNC - Truncate file, if it already exists,
/// erasing all data previously stored in
/// the file.
/// \li \c H5F_ACC_EXCL - Fail if file already exists.
/// \c H5F_ACC_TRUNC and \c H5F_ACC_EXCL are mutually exclusive
/// \li \c H5F_ACC_DEBUG - print debug information. This flag is
/// used only by HDF5 library developers; it is neither
/// tested nor supported for use in applications.
/// \li \c H5F_ACC_DEBUG - print debug information. This flag is
/// used only by HDF5 library developers; it is neither
/// tested nor supported for use in applications.
///\par
/// For info on file creation in the case of an already-open file,
/// please refer to the \b Special \b case section in the C layer
@@ -81,14 +81,14 @@ H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& c
//--------------------------------------------------------------------------
// Function: H5File overloaded constructor
///\brief This is another overloaded constructor. It differs from the
///\brief This is another overloaded constructor. It differs from the
/// above constructor only in the type of the \a name argument.
///\param name - IN: Name of the file - \c std::string
///\param flags - IN: File access flags
///\param create_plist - IN: File creation property list, used when
/// modifying default file meta-data. Default to
///\param create_plist - IN: File creation property list, used when
/// modifying default file meta-data. Default to
/// FileCreatPropList::DEFAULT
///\param access_plist - IN: File access property list. Default to
///\param access_plist - IN: File access property list. Default to
/// FileCreatPropList::DEFAULT
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -98,7 +98,7 @@ H5File::H5File( const string& name, unsigned int flags, const FileCreatPropList&
}
//--------------------------------------------------------------------------
// This function is private and contains common code between the
// This function is private and contains common code between the
// constructors taking a string or a char*
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -145,16 +145,16 @@ H5File::H5File( const H5File& original ) : IdComponent( original ) {}
///\exception H5::FileIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
bool H5File::isHdf5(const char* name )
bool H5File::isHdf5(const char* name )
{
// Calls C routine H5Fis_hdf5 to determine whether the file is in
// Calls C routine H5Fis_hdf5 to determine whether the file is in
// HDF5 format. It returns positive value, 0, or negative value
htri_t ret_value = H5Fis_hdf5( name );
if( ret_value > 0 )
return true;
else if( ret_value == 0 )
return false;
else // Raise exception when H5Fis_hdf5 returns a negative value
else // Raise exception when H5Fis_hdf5 returns a negative value
{
throw FileIException("H5File::isHdf5", "H5Fis_hdf5 returned negative value");
}
@@ -167,7 +167,7 @@ bool H5File::isHdf5(const char* name )
///\param name - IN: Name of the file - \c std::string
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
bool H5File::isHdf5(const string& name )
bool H5File::isHdf5(const string& name )
{
return( isHdf5( name.c_str()) );
}
@@ -288,21 +288,21 @@ hssize_t H5File::getFreeSpace() const
//--------------------------------------------------------------------------
// Function: H5File::getObjCount
///\brief Returns the number of opened object IDs (files, datasets,
///\brief Returns the number of opened object IDs (files, datasets,
/// groups and datatypes) in the same file.
///\param types - Type of object to retrieve the count
///\param types - Type of object to retrieve the count
///\return Number of opened object IDs
///\exception H5::FileIException
///\par Description
/// The valid values for \a types include:
/// \li \c H5F_OBJ_FILE - Files only
/// \li \c H5F_OBJ_DATASET - Datasets only
/// \li \c H5F_OBJ_GROUP - Groups only
/// \li \c H5F_OBJ_DATATYPE - Named datatypes only
/// \li \c H5F_OBJ_ATTR - Attributes only
/// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE
/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP
/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR
/// \li \c H5F_OBJ_FILE - Files only
/// \li \c H5F_OBJ_DATASET - Datasets only
/// \li \c H5F_OBJ_GROUP - Groups only
/// \li \c H5F_OBJ_DATATYPE - Named datatypes only
/// \li \c H5F_OBJ_ATTR - Attributes only
/// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE
/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP
/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR
///\par
/// Multiple object types can be combined with the logical OR operator (|).
// Programmer Binh-Minh Ribler - May 2004
@@ -320,7 +320,7 @@ int H5File::getObjCount(unsigned types) const
//--------------------------------------------------------------------------
// Function: H5File::getObjCount
///\brief This is an overloaded member function, provided for convenience.
/// It takes no parameter and returns the object count of all
/// It takes no parameter and returns the object count of all
/// object types.
///\return Number of opened object IDs
///\exception H5::FileIException
@@ -338,23 +338,23 @@ int H5File::getObjCount() const
//--------------------------------------------------------------------------
// Function: H5File::getObjIDs
///\brief Retrieves a list of opened object IDs (files, datasets,
///\brief Retrieves a list of opened object IDs (files, datasets,
/// groups and datatypes) in the same file.
///\param types - Type of object to retrieve the count
///\param max_objs - Maximum number of object identifiers to place
///\param types - Type of object to retrieve the count
///\param max_objs - Maximum number of object identifiers to place
/// into obj_id_list.
///\param oid_list - List of open object identifiers
///\exception H5::FileIException
///\par Description
/// The valid values for \a types include:
/// \li \c H5F_OBJ_FILE - Files only
/// \li \c H5F_OBJ_DATASET - Datasets only
/// \li \c H5F_OBJ_GROUP - Groups only
/// \li \c H5F_OBJ_DATATYPE - Named datatypes only
/// \li \c H5F_OBJ_ATTR - Attributes only
/// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE
/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP
/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR
/// \li \c H5F_OBJ_FILE - Files only
/// \li \c H5F_OBJ_DATASET - Datasets only
/// \li \c H5F_OBJ_GROUP - Groups only
/// \li \c H5F_OBJ_DATATYPE - Named datatypes only
/// \li \c H5F_OBJ_ATTR - Attributes only
/// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE
/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP
/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR
///\par
/// Multiple object types can be combined with the logical OR operator (|).
//
@@ -379,13 +379,13 @@ void H5File::getObjIDs(unsigned types, int max_objs, hid_t *oid_list) const
/// the low-level virtual file driver
///\exception H5::FileIException
///\par Description
/// For the \c FAMILY or \c MULTI drivers, \a fapl should be
/// defined through the property list functions:
/// \c FileAccPropList::setFamilyOffset for the \c FAMILY driver
/// For the \c FAMILY or \c MULTI drivers, \a fapl should be
/// defined through the property list functions:
/// \c FileAccPropList::setFamilyOffset for the \c FAMILY driver
/// and \c FileAccPropList::setMultiType for the \c MULTI driver.
///
/// The obtained file handle is dynamic and is valid only while
/// the file remains open; it will be invalid if the file is
/// The obtained file handle is dynamic and is valid only while
/// the file remains open; it will be invalid if the file is
/// closed and reopened or opened during a subsequent session.
// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
@@ -466,11 +466,11 @@ void* H5File::Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_t
///\return A reference
///\exception H5::IdComponentException
///\par Description
// This function passes H5R_OBJECT and -1 to the protected
// This function passes H5R_OBJECT and -1 to the protected
// function for it to pass to the C API H5Rcreate
// to create a reference to the named object.
///\par
/// Note that, for H5File, name must be an absolute path to the
/// Note that, for H5File, name must be an absolute path to the
/// object in the file.
// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
@@ -503,10 +503,10 @@ void* H5File::Reference(const string& name) const
///\param ref - IN: Reference to query
///\param ref_type - IN: Type of reference to query
///\return Object type, which can be one of the following:
/// \li \c H5G_LINK - Object is a symbolic link.
/// \li \c H5G_GROUP - Object is a group.
/// \li \c H5G_DATASET - Object is a dataset.
/// \li \c H5G_TYPE - Object is a named datatype
/// \li \c H5G_LINK - Object is a symbolic link.
/// \li \c H5G_GROUP - Object is a group.
/// \li \c H5G_DATASET - Object is a dataset.
/// \li \c H5G_TYPE - Object is a named datatype
///\exception H5::IdComponentException
// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
@@ -546,7 +546,7 @@ DataSpace H5File::getRegion(void *ref, H5R_type_t ref_type) const
///\return File size
///\exception H5::FileIException
///\par Description
/// This function is called after an existing file is opened in
/// This function is called after an existing file is opened in
/// order to learn the true size of the underlying file.
// Programmer Raymond Lu - June 24, 2004
//--------------------------------------------------------------------------
@@ -599,30 +599,30 @@ void H5File::close()
///\param msg - Message describing the failure
///\exception H5::FileIException
// Description
// This function is used in CommonFG implementation so that
// proper exception can be thrown for file or group. The
// argument func_name is a member of CommonFG and "H5File::"
// will be inserted to indicate the function called is an
// This function is used in CommonFG implementation so that
// proper exception can be thrown for file or group. The
// argument func_name is a member of CommonFG and "H5File::"
// will be inserted to indicate the function called is an
// implementation of H5File.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void H5File::throwException(const string func_name, const string msg) const
{
string full_name = func_name;
full_name.insert(0, "H5File::");
full_name.insert(0, "H5File::");
throw FileIException(full_name, msg);
}
//--------------------------------------------------------------------------
// Function: H5File destructor
///\brief Properly terminates access to this file.
///\brief Properly terminates access to this file.
// Programmer Binh-Minh Ribler - 2000
// Modification
// Replaced resetIdComponent with decRefCount to use C library
// ID reference counting mechanism - June 1, 2004
//--------------------------------------------------------------------------
H5File::~H5File()
{
H5File::~H5File()
{
// The HDF5 file id will be closed properly
try {
decRefCount();
@@ -630,7 +630,7 @@ H5File::~H5File()
catch (Exception close_error) {
cerr << "H5File::~H5File - " << close_error.getDetailMsg() << endl;
}
}
}
#ifndef H5_NO_NAMESPACE
} // end namespace
+3 -3
View File
@@ -48,12 +48,12 @@ class H5_DLLCPP H5File : public IdComponent, public CommonFG {
// Returns the amount of free space in the file.
hssize_t getFreeSpace() const;
// Returns the number of opened object IDs (files, datasets, groups
// Returns the number of opened object IDs (files, datasets, groups
// and datatypes) in the same file.
int getObjCount(unsigned types) const;
int getObjCount() const;
// Retrieves a list of opened object IDs (files, datasets, groups
// Retrieves a list of opened object IDs (files, datasets, groups
// and datatypes) in the same file.
void getObjIDs(unsigned types, int max_objs, hid_t *oid_list) const;
@@ -75,7 +75,7 @@ class H5_DLLCPP H5File : public IdComponent, public CommonFG {
void reOpen(); // added for better name
void reopen();
// Creates a reference to a named Hdf5 object or to a dataset region
// Creates a reference to a named Hdf5 object or to a dataset region
// in this object.
void* Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_type = H5R_DATASET_REGION) const;
+24 -24
View File
@@ -56,7 +56,7 @@ FloatType::FloatType( const PredType& pred_type ) : AtomType()
//--------------------------------------------------------------------------
// Function: FloatType overloaded constructor
///\brief Creates an FloatType object using the id of an existing
///\brief Creates an FloatType object using the id of an existing
/// datatype.
///\param existing_id - IN: Id of an existing datatype
///\exception H5::DataTypeIException
@@ -74,7 +74,7 @@ FloatType::FloatType( const FloatType& original ) : AtomType( original ){}
//--------------------------------------------------------------------------
// Function: EnumType overloaded constructor
///\brief Gets the floating-point datatype of the specified dataset
///\param dataset - IN: Dataset that this floating-point datatype
///\param dataset - IN: Dataset that this floating-point datatype
/// associates with
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
@@ -92,7 +92,7 @@ FloatType::FloatType( const DataSet& dataset ) : AtomType()
//--------------------------------------------------------------------------
// Function: FloatType::getFields
///\brief Retrieves floating point datatype bit field information.
///\brief Retrieves floating point datatype bit field information.
///\param spos - OUT: Retrieved floating-point sign bit
///\param epos - OUT: Retrieved exponent bit-position
///\param esize - OUT: Retrieved size of exponent, in bits
@@ -112,8 +112,8 @@ void FloatType::getFields( size_t& spos, size_t& epos, size_t& esize, size_t& mp
//--------------------------------------------------------------------------
// Function: FloatType::setFields
///\brief Sets locations and sizes of floating point bit fields.
///\param spos - OUT: Sign position, i.e., the bit offset of the
///\brief Sets locations and sizes of floating point bit fields.
///\param spos - OUT: Sign position, i.e., the bit offset of the
/// floating-point sign bit.
///\param epos - OUT: Exponent bit position
///\param esize - OUT: Size of exponent, in bits
@@ -133,7 +133,7 @@ void FloatType::setFields( size_t spos, size_t epos, size_t esize, size_t mpos,
//--------------------------------------------------------------------------
// Function: FloatType::getEbias
///\brief Retrieves the exponent bias of a floating-point type.
///\brief Retrieves the exponent bias of a floating-point type.
///\return Exponent bias
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
@@ -151,7 +151,7 @@ size_t FloatType::getEbias() const
//--------------------------------------------------------------------------
// Function: FloatType::setEbias
///\brief Sets the exponent bias of a floating-point type.
///\brief Sets the exponent bias of a floating-point type.
///\param ebias - Exponent bias value
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
@@ -167,16 +167,16 @@ void FloatType::setEbias( size_t ebias ) const
//--------------------------------------------------------------------------
// Function: FloatType::getNorm
///\brief Retrieves mantissa normalization of a floating-point datatype.
///\brief Retrieves mantissa normalization of a floating-point datatype.
///\param norm_string - OUT: Text string of the normalization type
///\return Valid normalization type, which can be:
/// \li \c H5T_NORM_IMPLIED (0) - MSB of mantissa is not stored
/// \li \c H5T_NORM_MSBSET (1) - MSB of mantissa is always 1
/// \li \c H5T_NORM_NONE (2) - Mantissa is not normalized
/// \li \c H5T_NORM_MSBSET (1) - MSB of mantissa is always 1
/// \li \c H5T_NORM_NONE (2) - Mantissa is not normalized
///\exception H5::DataTypeIException
///\par Description
/// For your convenience, this function also provides the text
/// string of the returned normalization type, via parameter
/// For your convenience, this function also provides the text
/// string of the returned normalization type, via parameter
/// \a norm_string.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -199,14 +199,14 @@ H5T_norm_t FloatType::getNorm( string& norm_string ) const
//--------------------------------------------------------------------------
// Function: FloatType::setNorm
///\brief Sets the mantissa normalization of a floating-point datatype.
///\brief Sets the mantissa normalization of a floating-point datatype.
///\param norm - IN: Mantissa normalization type
///\exception H5::DataTypeIException
///\par Description
/// Valid values for normalization type include:
/// \li \c H5T_NORM_IMPLIED (0) - MSB of mantissa is not stored
/// \li \c H5T_NORM_MSBSET (1) - MSB of mantissa is always 1
/// \li \c H5T_NORM_NONE (2) - Mantissa is not normalized
/// \li \c H5T_NORM_MSBSET (1) - MSB of mantissa is always 1
/// \li \c H5T_NORM_NONE (2) - Mantissa is not normalized
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void FloatType::setNorm( H5T_norm_t norm ) const
@@ -220,16 +220,16 @@ void FloatType::setNorm( H5T_norm_t norm ) const
//--------------------------------------------------------------------------
// Function: FloatType::getInpad
///\brief Retrieves the internal padding type for unused bits in
/// this floating-point datatypes.
///\brief Retrieves the internal padding type for unused bits in
/// this floating-point datatypes.
///\return Internal padding type, which can be:
/// \li \c H5T_PAD_ZERO (0) - Set background to zeros
/// \li \c H5T_PAD_ONE (1) - Set background to ones
/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone
///\exception H5::DataTypeIException
///\par Description
/// For your convenience, this function also provides the text
/// string of the returned internal padding type, via parameter
/// For your convenience, this function also provides the text
/// string of the returned internal padding type, via parameter
/// \a pad_string.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -252,14 +252,14 @@ H5T_pad_t FloatType::getInpad( string& pad_string ) const
//--------------------------------------------------------------------------
// Function: FloatType::setInpad
///\brief Fills unused internal floating point bits.
///\brief Fills unused internal floating point bits.
///\param inpad - IN: Internal padding type
///\exception H5::DataTypeIException
///\par Description
/// If any internal bits of a floating point type are unused
/// (that is, those significant bits which are not part of the
/// sign, exponent, or mantissa), then they will be filled
/// according to the padding value provided by \a inpad.
/// If any internal bits of a floating point type are unused
/// (that is, those significant bits which are not part of the
/// sign, exponent, or mantissa), then they will be filled
/// according to the padding value provided by \a inpad.
///\par
/// Valid values for normalization type include:
/// \li \c H5T_PAD_ZERO (0) - Set background to zeros
+10 -10
View File
@@ -25,31 +25,31 @@ class H5_DLLCPP FloatType : public AtomType {
// Creates a floating-point type using a predefined type
FloatType( const PredType& pred_type );
// Gets the floating-point datatype of the specified dataset
// Gets the floating-point datatype of the specified dataset
FloatType( const DataSet& dataset );
// Retrieves the exponent bias of a floating-point type.
// Retrieves the exponent bias of a floating-point type.
size_t getEbias() const;
// Sets the exponent bias of a floating-point type.
// Sets the exponent bias of a floating-point type.
void setEbias( size_t ebias ) const;
// Retrieves floating point datatype bit field information.
// Retrieves floating point datatype bit field information.
void getFields( size_t& spos, size_t& epos, size_t& esize, size_t& mpos, size_t& msize ) const;
// Sets locations and sizes of floating point bit fields.
// Sets locations and sizes of floating point bit fields.
void setFields( size_t spos, size_t epos, size_t esize, size_t mpos, size_t msize ) const;
// Retrieves the internal padding type for unused bits in floating-point datatypes.
// Retrieves the internal padding type for unused bits in floating-point datatypes.
H5T_pad_t getInpad( string& pad_string ) const;
// Fills unused internal floating point bits.
// Fills unused internal floating point bits.
void setInpad( H5T_pad_t inpad ) const;
// Retrieves mantissa normalization of a floating-point datatype.
// Retrieves mantissa normalization of a floating-point datatype.
H5T_norm_t getNorm( string& norm_string ) const;
// Sets the mantissa normalization of a floating-point datatype.
// Sets the mantissa normalization of a floating-point datatype.
void setNorm( H5T_norm_t norm ) const;
// Returns this class name
+8 -8
View File
@@ -103,7 +103,7 @@ void* Group::Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_ty
///\return A reference
///\exception H5::GroupIException
///\par Description
// This function passes H5R_OBJECT and -1 to the protected
// This function passes H5R_OBJECT and -1 to the protected
// function for it to pass to the C API H5Rcreate
// to create a reference to the named object.
// Programmer Binh-Minh Ribler - May, 2004
@@ -137,10 +137,10 @@ void* Group::Reference(const string& name) const
///\param ref - IN: Reference to query
///\param ref_type - IN: Type of reference to query
///\return An object type, which can be one of the following:
// H5G_LINK Object is a symbolic link.
// H5G_GROUP Object is a group.
// H5G_DATASET Object is a dataset.
// H5G_TYPE Object is a named datatype
// H5G_LINK Object is a symbolic link.
// H5G_GROUP Object is a group.
// H5G_DATASET Object is a dataset.
// H5G_TYPE Object is a named datatype
///\exception H5::GroupIException
// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
@@ -222,16 +222,16 @@ void Group::throwException(const string func_name, const string msg) const
// ID reference counting mechanism - June 1, 2004
//--------------------------------------------------------------------------
Group::~Group()
{
{
// The group id will be closed properly
try {
decRefCount();
}
catch (Exception close_error) {
catch (Exception close_error) {
cerr << "Group::~Group - " << close_error.getDetailMsg() << endl;
}
}
}
#ifndef H5_NO_NAMESPACE
} // end namespace
+17 -17
View File
@@ -79,10 +79,10 @@ void IdComponent::decRefCount(const hid_t obj_id) const
if (p_valid_id(obj_id))
if (H5Idec_ref(obj_id) < 0)
if (H5Iget_ref(obj_id) <= 0)
throw IdComponentException(inMemFunc("decRefCount"),
throw IdComponentException(inMemFunc("decRefCount"),
"object ref count is 0 or negative");
else
throw IdComponentException(inMemFunc("decRefCount"),
throw IdComponentException(inMemFunc("decRefCount"),
"decrementing object ref count failed");
}
@@ -158,8 +158,8 @@ H5I_type_t IdComponent::getHDFObjType(const hid_t obj_id)
// Description
// The underlaying reference counting in the C library ensures
// that the current valid id of this object is properly closed.
// Copy the id from rhs to this object, then increment the
// reference counter of the id to indicate that another object
// Copy the id from rhs to this object, then increment the
// reference counter of the id to indicate that another object
// is referencing it.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -200,7 +200,7 @@ void IdComponent::setId(const hid_t new_id)
//--------------------------------------------------------------------------
// Function: IdComponent::getId
///\brief Returns the id of this object
///\brief Returns the id of this object
///\return HDF5 id
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -216,8 +216,8 @@ hid_t IdComponent::getId () const
//--------------------------------------------------------------------------
IdComponent::~IdComponent() {
/* uncomment this block and complete it when deciding to use dontAtExit
unless the atexit/global destructor problem is fixed, then
/* uncomment this block and complete it when deciding to use dontAtExit
unless the atexit/global destructor problem is fixed, then
remove it- BMR 11/14/00
if( id == NOTATEXIT )
@@ -242,7 +242,7 @@ IdComponent::~IdComponent() {
//
// Implementation of protected functions for HDF5 Reference Interface.
//
//
#ifndef DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
@@ -250,9 +250,9 @@ IdComponent::~IdComponent() {
///\brief Makes and returns string "<class-name>::<func_name>"
///\param func_name - Name of the function where failure occurs
// Description
/// Concatenates the class name of this object with the
/// passed-in function name to create a string that indicates
/// where the failure occurs. The class-name is provided by
/// Concatenates the class name of this object with the
/// passed-in function name to create a string that indicates
/// where the failure occurs. The class-name is provided by
/// fromClass(). This string will be used by a base class when
/// an exception is thrown.
// Programmer Binh-Minh Ribler - Aug 6, 2005
@@ -278,7 +278,7 @@ IdComponent::IdComponent() : id(-1) {}
// Exception: H5::IdComponentException
// Description:
// This function is protected so that the user applications can
// only have access to its code via allowable classes, namely,
// only have access to its code via allowable classes, namely,
// H5File and H5Object subclasses.
// Programmer Binh-Minh Ribler - Jul, 2004
//--------------------------------------------------------------------------
@@ -338,10 +338,10 @@ void* IdComponent::p_reference(const char* name, hid_t space_id, H5R_type_t ref_
// ref - IN: Reference to query
// ref_type - IN: Type of reference to query
// Return An object type, which can be one of the following:
// H5G_LINK Object is a symbolic link.
// H5G_GROUP Object is a group.
// H5G_DATASET Object is a dataset.
// H5G_TYPE Object is a named datatype
// H5G_LINK Object is a symbolic link.
// H5G_GROUP Object is a group.
// H5G_DATASET Object is a dataset.
// H5G_TYPE Object is a named datatype
// Exception H5::IdComponentException
// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
@@ -378,7 +378,7 @@ hid_t IdComponent::p_get_region(void *ref, H5R_type_t ref_type) const
//
// Local functions used in this class
//
//
//--------------------------------------------------------------------------
// Function: p_valid_id
+5 -5
View File
@@ -64,7 +64,7 @@ IntType::IntType( const PredType& pred_type ) : AtomType()
//--------------------------------------------------------------------------
// Function: IntType overloaded constructor
///\brief Creates an integer datatype using the id of an existing
///\brief Creates an integer datatype using the id of an existing
/// datatype.
///\param existing_id - IN: Id of an existing datatype
///\exception H5::DataTypeIException
@@ -80,7 +80,7 @@ IntType::IntType( const hid_t existing_id ) : AtomType( existing_id ) {}
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
IntType::IntType( const DataSet& dataset ) : AtomType()
{
{
// Calls C function H5Dget_type to get the id of the datatype
id = H5Dget_type( dataset.getId() );
@@ -88,7 +88,7 @@ IntType::IntType( const DataSet& dataset ) : AtomType()
{
throw DataSetIException("IntType constructor", "H5Dget_type failed");
}
}
}
//--------------------------------------------------------------------------
// Function: IntType::getSign
@@ -104,7 +104,7 @@ H5T_sign_t IntType::getSign() const
// Returns a valid sign type if no errors
if( type_sign == H5T_SGN_ERROR )
{
throw DataTypeIException("IntType::getSign",
throw DataTypeIException("IntType::getSign",
"H5Tget_sign failed - returned H5T_SGN_ERROR for the sign type");
}
return( type_sign );
@@ -112,7 +112,7 @@ H5T_sign_t IntType::getSign() const
//--------------------------------------------------------------------------
// Function: IntType::getSign
///\brief Sets the sign property for an integer type.
///\brief Sets the sign property for an integer type.
///\param sign - IN: Sign type
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
+1 -1
View File
@@ -30,7 +30,7 @@ class H5_DLLCPP IntType : public AtomType {
// Retrieves the sign type for an integer type
H5T_sign_t getSign() const;
// Sets the sign proprety for an integer type.
// Sets the sign proprety for an integer type.
void setSign( H5T_sign_t sign ) const;
// Returns this class name
+18 -18
View File
@@ -14,7 +14,7 @@
#include <string>
#include "H5CppDoc.h" // included only for Doxygen to generate part of RM
#include "H5CppDoc.h" // included only for Doxygen to generate part of RM
#include "H5Include.h"
#include "H5Exception.h"
#include "H5Library.h"
@@ -30,7 +30,7 @@ bool H5Library::need_cleanup = false;
//--------------------------------------------------------------------------
// Function: H5Library::open
///\brief Initializes the HDF5 library.
///\brief Initializes the HDF5 library.
///
///\exception H5::LibraryIException
// Programmer Binh-Minh Ribler - 2000
@@ -46,7 +46,7 @@ void H5Library::open()
//--------------------------------------------------------------------------
// Function: H5Library::close
///\brief Flushes all data to disk, closes files, and cleans up memory.
///\brief Flushes all data to disk, closes files, and cleans up memory.
///
///\exception H5::LibraryIException
// Programmer Binh-Minh Ribler - 2000
@@ -78,7 +78,7 @@ void H5Library::dontAtExit()
//--------------------------------------------------------------------------
// Function: H5Library::getLibVersion
///\brief Returns the HDF library release number.
///\brief Returns the HDF library release number.
///\param majnum - OUT: Major version of the library
///\param minnum - OUT: Minor version of the library
///\param relnum - OUT: Release number of the library
@@ -96,7 +96,7 @@ void H5Library::getLibVersion( unsigned& majnum, unsigned& minnum, unsigned& rel
//--------------------------------------------------------------------------
// Function: H5Library::checkVersion
///\brief Verifies that the arguments match the version numbers
///\brief Verifies that the arguments match the version numbers
/// compiled into the library
///\param majnum - IN: Major version of the library
///\param minnum - IN: Minor version of the library
@@ -120,21 +120,21 @@ void H5Library::checkVersion(unsigned majnum, unsigned minnum, unsigned relnum)
//--------------------------------------------------------------------------
// Function: H5Library::garbageCollect
///\brief Walks through all the garbage collection routines for the
/// library, which are supposed to free any unused memory they
/// library, which are supposed to free any unused memory they
/// have allocated.
///
///\exception H5::LibraryIException
///\par Description
/// It is not required that H5Library::garbageCollect be called
/// at any particular time; it is only necessary in certain
/// situations, such as when the application has performed actions
/// that cause the library to allocate many objects. The
/// application should call H5Library::garbageCollect if it
/// eventually releases those objects and wants to reduce the
/// memory used by the library from the peak usage required.
/// It is not required that H5Library::garbageCollect be called
/// at any particular time; it is only necessary in certain
/// situations, such as when the application has performed actions
/// that cause the library to allocate many objects. The
/// application should call H5Library::garbageCollect if it
/// eventually releases those objects and wants to reduce the
/// memory used by the library from the peak usage required.
///\par
/// The library automatically garbage collects all the free
/// lists when the application ends.
/// The library automatically garbage collects all the free
/// lists when the application ends.
// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
void H5Library::garbageCollect()
@@ -158,13 +158,13 @@ void H5Library::garbageCollect()
///\exception H5::LibraryIException
///\par Description
/// Setting a value of -1 for a limit means no limit of that type.
/// For more information on free list limits, please refer to C
/// For more information on free list limits, please refer to C
/// layer Reference Manual at:
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5.html#Library-SetFreeListLimits
// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
void H5Library::setFreeListLimits(int reg_global_lim, int reg_list_lim,
int arr_global_lim, int arr_list_lim, int blk_global_lim,
void H5Library::setFreeListLimits(int reg_global_lim, int reg_list_lim,
int arr_global_lim, int arr_list_lim, int blk_global_lim,
int blk_list_lim)
{
herr_t ret_value = H5set_free_list_limits(reg_global_lim, reg_list_lim, arr_global_lim, arr_list_lim, blk_global_lim, blk_list_lim);
+11 -11
View File
@@ -23,7 +23,7 @@ namespace H5 {
#ifndef DOXYGEN_SHOULD_SKIP_THIS
#define NOTATEXIT (-10) // just in case the HDF5 library use more
// negative constants. Note: the solution used for the atexit/global
// destructors is not reliable, and desperately needs improvement
// destructors is not reliable, and desperately needs improvement
// It is not even working, inifiteloop message still printed when
// calling H5close
#endif // DOXYGEN_SHOULD_SKIP_THIS
@@ -34,30 +34,30 @@ class H5_DLLCPP H5Library {
static bool need_cleanup; // indicates if H5close should be called
#endif // DOXYGEN_SHOULD_SKIP_THIS
// Initializes the HDF5 library.
static void open();
// Initializes the HDF5 library.
static void open();
// Flushes all data to disk, closes files, and cleans up memory.
static void close();
// Flushes all data to disk, closes files, and cleans up memory.
static void close();
// Instructs library not to install atexit cleanup routine
static void dontAtExit();
static void dontAtExit();
// Returns the HDF library release number.
static void getLibVersion( unsigned& majnum, unsigned& minnum, unsigned& relnum );
// Returns the HDF library release number.
static void getLibVersion( unsigned& majnum, unsigned& minnum, unsigned& relnum );
// Verifies that the arguments match the version numbers compiled
// into the library
static void checkVersion( unsigned majnum, unsigned minnum, unsigned relnum );
static void checkVersion( unsigned majnum, unsigned minnum, unsigned relnum );
// Walks through all the garbage collection routines for the library,
// Walks through all the garbage collection routines for the library,
// which are supposed to free any unused memory they have allocated.
static void garbageCollect();
// Sets limits on the different kinds of free lists.
static void setFreeListLimits(int reg_global_lim, int reg_list_lim, int
arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim);
private:
// Default constructor - no instance ever created
H5Library() {};
+17 -17
View File
@@ -32,7 +32,7 @@ namespace H5 {
#ifndef DOXYGEN_SHOULD_SKIP_THIS
// userAttrOpWrpr simply interfaces between the user's function and the
// C library function H5Aiterate; used to resolve the different prototype
// C library function H5Aiterate; used to resolve the different prototype
// problem. May be moved to Iterator later.
extern "C" herr_t userAttrOpWrpr( hid_t loc_id, const char* attr_name, void* op_data )
{
@@ -49,7 +49,7 @@ extern "C" herr_t userAttrOpWrpr( hid_t loc_id, const char* attr_name, void* op_
//--------------------------------------------------------------------------
// Function: H5Object default constructor (protected)
// Description
// The id is set by IdComponent() but subclass constructor will
// The id is set by IdComponent() but subclass constructor will
// set it to a valid HDF5 id.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -57,7 +57,7 @@ H5Object::H5Object() : IdComponent() {}
//--------------------------------------------------------------------------
// Function: H5Object overloaded constructor (protected)
// Purpose Creates an H5Object object using the id of an existing HDF5
// Purpose Creates an H5Object object using the id of an existing HDF5
// object.
// Parameters object_id - IN: Id of an existing HDF5 object
// Programmer Binh-Minh Ribler - 2000
@@ -68,7 +68,7 @@ H5Object::H5Object( const hid_t object_id ) : IdComponent( object_id ) {}
//--------------------------------------------------------------------------
// Function: H5Object copy constructor
///\brief Copy constructor: makes a copy of the original H5Object
///\brief Copy constructor: makes a copy of the original H5Object
/// instance.
///\param original - IN: H5Object instance to copy
// Programmer Binh-Minh Ribler - 2000
@@ -80,18 +80,18 @@ H5Object::H5Object( const H5Object& original ) : IdComponent( original ) {}
///\brief Creates an attribute for a group, dataset, or named datatype.
///\param name - IN: Name of the attribute
///\param data_type - IN: Datatype for the attribute
///\param data_space - IN: Dataspace for the attribute - only simple
///\param data_space - IN: Dataspace for the attribute - only simple
/// dataspaces are allowed at this time
///\param create_plist - IN: Creation property list - default to
///\param create_plist - IN: Creation property list - default to
/// PropList::DEFAULT
///\return Attribute instance
///\exception H5::AttributeIException
///\par Description
/// The attribute name specified in \a name must be unique.
/// Attempting to create an attribute with the same name as an
/// existing attribute will raise an exception, leaving the
/// pre-existing attribute intact. To overwrite an existing
/// attribute with a new attribute of the same name, first
/// The attribute name specified in \a name must be unique.
/// Attempting to create an attribute with the same name as an
/// existing attribute will raise an exception, leaving the
/// pre-existing attribute intact. To overwrite an existing
/// attribute with a new attribute of the same name, first
/// delete the existing one with \c H5Object::removeAttr, then
/// recreate it with this function.
// Programmer Binh-Minh Ribler - 2000
@@ -118,7 +118,7 @@ Attribute H5Object::createAttribute( const char* name, const DataType& data_type
//--------------------------------------------------------------------------
// Function: H5Object::createAttribute
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes
/// It differs from the above function in that it takes
/// a reference to an \c std::string for \a name.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -152,7 +152,7 @@ Attribute H5Object::openAttribute( const char* name ) const
//--------------------------------------------------------------------------
// Function: H5Object::openAttribute
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes
/// It differs from the above function in that it takes
/// a reference to an \c std::string for \a name.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -189,7 +189,7 @@ Attribute H5Object::openAttribute( const unsigned int idx ) const
/// object, which may be a group, dataset or named datatype.
///\param user_op - IN: User's function to operate on each attribute
///\param idx - IN/OUT: Starting (IN) and ending (OUT) attribute indices
///\param op_data - IN: User's data to pass to user's operator function
///\param op_data - IN: User's data to pass to user's operator function
///\return Returned value of the last operator if it was non-zero, or
/// zero if all attributes were processed
///\exception H5::AttributeIException
@@ -233,7 +233,7 @@ int H5Object::getNumAttrs() const
int num_attrs = H5Aget_num_attrs( id );
if( num_attrs < 0 )
{
throw AttributeIException(inMemFunc("getNumAttrs"),
throw AttributeIException(inMemFunc("getNumAttrs"),
"H5Aget_num_attrs failed - returned negative number of attributes");
}
else
@@ -259,7 +259,7 @@ void H5Object::removeAttr( const char* name ) const
//--------------------------------------------------------------------------
// Function: H5Object::removeAttr
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes
/// It differs from the above function in that it takes
/// a reference to an \c std::string for \a name.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -288,7 +288,7 @@ void H5Object::renameAttr(const char* oldname, const char* newname) const
//--------------------------------------------------------------------------
// Function: H5Object::renameAttr
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes
/// It differs from the above function in that it takes
/// a reference to an \c std::string for the names.
// Programmer Binh-Minh Ribler - Mar, 2005
//--------------------------------------------------------------------------
+4 -4
View File
@@ -18,8 +18,8 @@
#include "H5Classes.h" // constains forward class declarations
// H5Object is a baseclass. It has these subclasses:
// Group, AbstractDs, and DataType.
// H5Object is a baseclass. It has these subclasses:
// Group, AbstractDs, and DataType.
// AbstractDs, in turn, has subclasses DataSet and Attribute.
// DataType, in turn, has several specific datatypes as subclasses.
@@ -31,8 +31,8 @@ namespace H5 {
class H5_DLLCPP H5Object; // forward declaration for UserData4Aiterate
// Define the operator function pointer for H5Aiterate().
typedef void (*attr_operator_t)( H5Object& loc/*in*/,
const string attr_name/*in*/,
typedef void (*attr_operator_t)( H5Object& loc/*in*/,
const string attr_name/*in*/,
void *operator_data/*in,out*/);
class UserData4Aiterate { // user data for attribute iteration
+8 -8
View File
@@ -33,17 +33,17 @@ namespace H5 {
#ifndef DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
// Function: PredType overloaded constructor
///\brief Creates a PredType object using the id of an existing
///\brief Creates a PredType object using the id of an existing
/// predefined datatype.
///\param predtype_id - IN: Id of a predefined datatype
// Description
// This constructor creates a predefined datatype, so it sets
// This constructor creates a predefined datatype, so it sets
// DataType::is_predtype to true.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
PredType::PredType( const hid_t predtype_id ) : AtomType( predtype_id )
{
is_predtype = true;
{
is_predtype = true;
}
//--------------------------------------------------------------------------
@@ -64,7 +64,7 @@ PredType::PredType( const PredType& original ) : AtomType( original ) {}
const PredType PredType::NotAtexit; // only for atexit/global dest. problem
// Definition of pre-defined types
// Note: the parameter E_xxxx_yyyy is the enum value that represents
// Note: the parameter E_xxxx_yyyy is the enum value that represents
// the corresponding HDF5 predefined type H5T_xxxx_yyyy. This enum value
// is stored in PredType::id since it is a PredType object id, in a way.
// In addition, this storage makes things safely simpler. When a PredType
@@ -514,18 +514,18 @@ hid_t PredType::getId() const
void PredType::commit( H5Object& loc, const char* name )
{
throw DataTypeIException("PredType::commit", "Attempting to commit a predefined datatype. This operation is invalid" );
}
}
void PredType::commit( H5Object& loc, const string& name )
{
commit( loc, name.c_str());
}
}
bool PredType::committed()
{
throw DataTypeIException("PredType::committed", "Error: Attempting to check for commit status on a predefined datatype." );
return (0);
}
}
#endif // DOXYGEN_SHOULD_SKIP_THIS
// Default destructor
+5 -5
View File
@@ -28,7 +28,7 @@ namespace H5 {
class H5_DLLCPP PredType : public AtomType {
public:
// Makes a copy of the predefined type and stores the new
// id in the left hand side object.
// id in the left hand side object.
PredType& operator=( const PredType& rhs );
// Copy constructor - makes copy of the original object
@@ -191,7 +191,7 @@ class H5_DLLCPP PredType : public AtomType {
#endif // DOXYGEN_SHOULD_SKIP_THIS
private:
// added this to work around the atexit/global destructor problem
// added this to work around the atexit/global destructor problem
// temporarily - it'll prevent the use of atexit to clean up
static const PredType NotAtexit; // not working yet
@@ -207,7 +207,7 @@ class H5_DLLCPP PredType : public AtomType {
E_STD_I8BE, E_STD_I8LE, E_STD_I16BE, E_STD_I16LE, E_STD_I32BE,
E_STD_I32LE, E_STD_I64BE, E_STD_I64LE, E_STD_U8BE, E_STD_U8LE,
E_STD_U16BE, E_STD_U16LE, E_STD_U32BE, E_STD_U32LE, E_STD_U64BE,
E_STD_U64LE, E_STD_B8BE, E_STD_B8LE, E_STD_B16BE, E_STD_B16LE,
E_STD_U64LE, E_STD_B8BE, E_STD_B8LE, E_STD_B16BE, E_STD_B16LE,
E_STD_B32BE, E_STD_B32LE, E_STD_B64BE, E_STD_B64LE, E_STD_REF_OBJ,
E_STD_REF_DSETREG,
@@ -223,8 +223,8 @@ class H5_DLLCPP PredType : public AtomType {
E_ALPHA_U16, E_ALPHA_U32, E_ALPHA_U64, E_ALPHA_B8, E_ALPHA_B16,
E_ALPHA_B32, E_ALPHA_B64, E_ALPHA_F32, E_ALPHA_F64,
E_MIPS_I8, E_MIPS_I16, E_MIPS_I32, E_MIPS_I64, E_MIPS_U8,
E_MIPS_U16, E_MIPS_U32, E_MIPS_U64, E_MIPS_B8, E_MIPS_B16,
E_MIPS_I8, E_MIPS_I16, E_MIPS_I32, E_MIPS_I64, E_MIPS_U8,
E_MIPS_U16, E_MIPS_U32, E_MIPS_U64, E_MIPS_B8, E_MIPS_B16,
E_MIPS_B32, E_MIPS_B64, E_MIPS_F32, E_MIPS_F64,
E_NATIVE_CHAR, E_NATIVE_INT, E_NATIVE_FLOAT, E_NATIVE_SCHAR,
+32 -32
View File
@@ -54,11 +54,11 @@ PropList::PropList( const PropList& original ) : IdComponent( original ) {}
///\param plist_id - IN: Id of the existing property list
///\exception H5::PropListIException
// Description
// This function calls H5Pcreate to create a new property list
// if the given id, plist_id, is that of a property class. If
// the given id is equal to H5P_NO_CLASS, then set this
// property's id to H5P_DEFAULT, otherwise, to the given id.
// Note: someone else added this code without comments and this
// This function calls H5Pcreate to create a new property list
// if the given id, plist_id, is that of a property class. If
// the given id is equal to H5P_NO_CLASS, then set this
// property's id to H5P_DEFAULT, otherwise, to the given id.
// Note: someone else added this code without comments and this
// description was what I came up with from reading the code.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -115,7 +115,7 @@ void PropList::copy( const PropList& like_plist )
///\return Reference to PropList instance
///\exception H5::PropListIException
// Description
// Makes a copy of the property list on the right hand side
// Makes a copy of the property list on the right hand side
// and stores the new id in the left hand side object.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -146,7 +146,7 @@ void PropList::copyProp(PropList& dest, const char *name) const
//--------------------------------------------------------------------------
// Function: PropList::copyProp
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function only in what arguments it
/// It differs from the above function only in what arguments it
/// accepts.
///\param dest - IN: Destination property list or class
///\param name - IN: Name of the property to copy - \c std::string
@@ -182,7 +182,7 @@ void PropList::copyProp( PropList& dest, PropList& src, const char *name ) const
//--------------------------------------------------------------------------
// Function: PropList::copyProp
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function only in what arguments it
/// It differs from the above function only in what arguments it
/// accepts. - Obsolete
///\param dest - IN: Destination property list or class
///\param src - IN: Source property list or class
@@ -229,7 +229,7 @@ hid_t PropList::getClass() const
hid_t plist_class = H5Pget_class( id );
if( plist_class == H5P_NO_CLASS )
{
throw PropListIException(inMemFunc("getClass"),
throw PropListIException(inMemFunc("getClass"),
"H5Pget_class failed - returned H5P_NO_CLASS");
}
return( plist_class );
@@ -243,14 +243,14 @@ hid_t PropList::getClass() const
/// false, otherwise.
///\exception H5::PropListIException
///\par Description
/// This routine checks if a property exists within a property
/// This routine checks if a property exists within a property
/// list or class.
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
bool PropList::propExist(const char* name ) const
{
// Calls C routine H5Pexist to determine whether a property exists
// within a property list or class. It returns a positive value, 0,
// Calls C routine H5Pexist to determine whether a property exists
// within a property list or class. It returns a positive value, 0,
// or a negative value
htri_t ret_value = H5Pexist(id, name);
if( ret_value > 0 )
@@ -265,7 +265,7 @@ bool PropList::propExist(const char* name ) const
//--------------------------------------------------------------------------
// Function: PropList::propExist
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function only in what arguments it
/// It differs from the above function only in what arguments it
/// accepts.
///\param name - IN: Name of property to check for - \c std::string
// Programmer: Binh-Minh Ribler - April, 2004
@@ -281,7 +281,7 @@ bool PropList::propExist(const string& name ) const
///
///\exception H5::PropListIException
///\par Description
/// Releases memory and detaches a class from the property
/// Releases memory and detaches a class from the property
/// list class hierarchy.
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
@@ -301,8 +301,8 @@ void PropList::closeClass() const
///\param value - OUT: Pointer to the buffer for the property value
///\exception H5::PropListIException
///\par Description
/// Retrieves a copy of the value for a property in a property
/// list. The property name must exist or this routine will
/// Retrieves a copy of the value for a property in a property
/// list. The property name must exist or this routine will
/// throw an exception.
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
@@ -317,7 +317,7 @@ void PropList::getProperty(const char* name, void* value) const
//--------------------------------------------------------------------------
// Function: PropList::getProperty
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function only in what arguments it
/// It differs from the above function only in what arguments it
/// accepts.
///\param name - IN: Name of property to query - \c char pointer
///\return The property that is a \c std::string.
@@ -344,7 +344,7 @@ string PropList::getProperty(const char* name) const
//--------------------------------------------------------------------------
// Function: PropList::getProperty
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function only in what arguments it
/// It differs from the above function only in what arguments it
/// accepts.
///\param name - IN: Name of property to query - \c std::string
///\param value - OUT: Pointer to the buffer for the property value
@@ -357,7 +357,7 @@ void PropList::getProperty(const string& name, void* value) const
//--------------------------------------------------------------------------
// Function: PropList::getProperty
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function only in what arguments it
/// It differs from the above function only in what arguments it
/// accepts.
///\param name - IN: Name of property to query - \c std::string
///\return The property that is a \c std::string.
@@ -375,9 +375,9 @@ string PropList::getProperty(const string& name) const
///\return Size of the property
///\exception H5::PropListIException
///\par Description
/// This routine retrieves the size of a property's value
/// in bytes. Zero-sized properties are allowed and the return
/// value will be of 0. This function works for both property
/// This routine retrieves the size of a property's value
/// in bytes. Zero-sized properties are allowed and the return
/// value will be of 0. This function works for both property
/// lists and classes.
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
@@ -394,7 +394,7 @@ size_t PropList::getPropSize(const char *name) const
//--------------------------------------------------------------------------
// Function: PropList::getPropSize
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function only in what arguments it
/// It differs from the above function only in what arguments it
/// accepts.
///\param name - IN: Name of property to query - \c std::string
///
@@ -463,7 +463,7 @@ void PropList::setProperty(const char* name, void* value) const
//--------------------------------------------------------------------------
// Function: PropList::setProperty
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function only in what arguments it
/// It differs from the above function only in what arguments it
/// accepts.
///\param name - IN: Name of property to set - \c char pointer
///\param charptr - IN: Char pointer to the value for the property
@@ -480,7 +480,7 @@ void PropList::setProperty(const char* name, const char* charptr) const
//--------------------------------------------------------------------------
// Function: PropList::setProperty
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function only in what arguments it
/// It differs from the above function only in what arguments it
/// accepts.
///\param name - IN: Name of property to set - \c char pointer
///\param strg - IN: Value for the property is a \c std::string
@@ -494,7 +494,7 @@ void PropList::setProperty(const char* name, string& strg) const
//--------------------------------------------------------------------------
// Function: PropList::setProperty
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function only in what arguments it
/// It differs from the above function only in what arguments it
/// accepts.
///\param name - IN: Name of property to set - \c std::string
///\param value - IN: Void pointer to the value for the property
@@ -508,7 +508,7 @@ void PropList::setProperty(const string& name, void* value) const
//--------------------------------------------------------------------------
// Function: PropList::setProperty
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function only in what arguments it
/// It differs from the above function only in what arguments it
/// accepts.
///\param name - IN: Name of property to set - \c std::string
///\param strg - IN: Value for the property is a \c std::string
@@ -523,7 +523,7 @@ void PropList::setProperty(const string& name, string& strg) const
// Function: PropList::isAClass
///\brief Determines whether a property list is a certain class.
///\param prop_class - IN: Property class to query
///\return true if the property list is a member of the property list
///\return true if the property list is a member of the property list
/// class, and false, otherwise.
///\exception H5::PropListIException
// Programmer: Binh-Minh Ribler - April, 2004
@@ -561,7 +561,7 @@ void PropList::removeProp(const char *name) const
//--------------------------------------------------------------------------
// Function: PropList::removeProp
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function only in what arguments it
/// It differs from the above function only in what arguments it
/// accepts.
///\param name - IN: Name of property to remove - \c std::string
// Programmer: Binh-Minh Ribler - April, 2004
@@ -575,7 +575,7 @@ void PropList::removeProp(const string& name) const
// Function: PropList::operator==
///\brief Compares this property list or class against the given list or class.
///\param rhs - IN: Reference to the property list to compare
///\return true if the property lists or classes are equal, and
///\return true if the property lists or classes are equal, and
/// false, otherwise.
///\exception H5::PropListIException
// Programmer: Binh-Minh Ribler - April, 2004
@@ -620,7 +620,7 @@ PropList PropList::getClassParent() const
// ID reference counting mechanism - June 1, 2004
//--------------------------------------------------------------------------
PropList::~PropList()
{
{
// The property list id will be closed properly
try {
decRefCount();
@@ -628,7 +628,7 @@ PropList::~PropList()
catch (Exception close_error) {
cerr << "PropList::~PropList - " << close_error.getDetailMsg() << endl;
}
}
}
#ifndef H5_NO_NAMESPACE
} // end namespace
+1 -1
View File
@@ -25,7 +25,7 @@ class H5_DLLCPP PropList : public IdComponent {
// Default property list
static const PropList DEFAULT;
// Creates a property list of a given type or creates a copy of an
// Creates a property list of a given type or creates a copy of an
// existing property list giving the property list id.
PropList(const hid_t plist_id);
+9 -9
View File
@@ -60,18 +60,18 @@ StrType::StrType( const PredType& pred_type ) : AtomType()
///\param existing_id - IN: Id of an existing datatype
///\exception H5::DataTypeIException
// Description
// The 1st argument could have been skipped, but this
// constructor will collide with the one that takes an
// The 1st argument could have been skipped, but this
// constructor will collide with the one that takes an
// existing id.
//
// Update: by passing 'size' by reference will avoid the
// clashing problem, so the 1st argument can actually be
// omitted. This constructor should be replaced by the
// omitted. This constructor should be replaced by the
// other after announcing. - May, 2004
///\note
///\note
/// This constructor will be obsolete in later releases,
/// please use StrType( const size_t& size ) instead.
// Programmer Binh-Minh Ribler - 2000
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
StrType::StrType( const PredType& pred_type, const size_t size ) : AtomType()
{
@@ -124,7 +124,7 @@ StrType::StrType( const DataSet& dataset ) : AtomType ()
//--------------------------------------------------------------------------
// Function: StrType::getCset
///\brief Retrieves the character set type of this string datatype.
///\brief Retrieves the character set type of this string datatype.
///\return Character set type, which can be:
/// \li \c H5T_CSET_ASCII (0) - Character set is US ASCII.
///\exception H5::DataTypeIException
@@ -144,7 +144,7 @@ H5T_cset_t StrType::getCset() const
//--------------------------------------------------------------------------
// Function: StrType::setCset
///\brief Sets character set to be used.
///\brief Sets character set to be used.
///\param cset - IN: character set type
///\exception H5::DataTypeIException
/// \li \c H5T_CSET_ASCII (0) - Character set is US ASCII.
@@ -162,7 +162,7 @@ void StrType::setCset( H5T_cset_t cset ) const
//--------------------------------------------------------------------------
// Function: StrType::getCset
///\brief Retrieves the storage mechanism for of this string datatype.
///\brief Retrieves the storage mechanism for of this string datatype.
///\return String storage mechanism, which can be:
/// \li \c H5T_STR_NULLTERM (0) - Null terminate (as C does)
/// \li \c H5T_STR_NULLPAD (0) - Pad with zeros
@@ -177,7 +177,7 @@ H5T_str_t StrType::getStrpad() const
// Returns a valid string padding type if successful
if( strpad == H5T_STR_ERROR )
{
throw DataTypeIException("StrType::getStrpad",
throw DataTypeIException("StrType::getStrpad",
"H5Tget_strpad failed - returned H5T_STR_ERROR");
}
return( strpad );
+6 -6
View File
@@ -31,25 +31,25 @@ class H5_DLLCPP StrType : public AtomType {
// Creates a string type with specified length - will be obsolete
StrType(const PredType& pred_type, const size_t size);
// Gets the string datatype of the specified dataset
// Gets the string datatype of the specified dataset
StrType(const DataSet& dataset);
// Retrieves the character set type of this string datatype.
// Retrieves the character set type of this string datatype.
H5T_cset_t getCset() const;
// Sets character set to be used.
// Sets character set to be used.
void setCset(H5T_cset_t cset) const;
// Retrieves the string padding method for this string datatype.
// Retrieves the string padding method for this string datatype.
H5T_str_t getStrpad() const;
// Defines the storage mechanism for character strings.
// Defines the storage mechanism for character strings.
void setStrpad(H5T_str_t strpad) const;
// Returns this class name
virtual string fromClass () const { return ("StrType"); }
// default constructor
// default constructor
StrType();
// Creates a string datatype using an existing id
+1 -1
View File
@@ -58,7 +58,7 @@ VarLenType::VarLenType(const VarLenType& original) : DataType(original) {}
///\param base_type - IN: Pointer to existing datatype
///\exception H5::DataTypeIException
// Description
// DataType passed by pointer to avoid clashing with copy
// DataType passed by pointer to avoid clashing with copy
// constructor.
// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
+58 -58
View File
@@ -50,7 +50,7 @@ const string DSET_BOGUS_NAME ("bogus");
const int H5Z_FILTER_BOGUS = 305;
// Local prototypes
static size_t bogus(unsigned int flags, size_t cd_nelmts,
static size_t bogus(unsigned int flags, size_t cd_nelmts,
const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
void cleanup_dsets(void);
@@ -85,7 +85,7 @@ test_create( H5File& file)
dims[1] = 512;
DataSpace space (2, dims, NULL);
// Create a dataset using the default dataset creation properties.
// Create a dataset using the default dataset creation properties.
// We're not sure what they are, so we won't check.
dataset = new DataSet (file.createDataSet
(DSET_DEFAULT_NAME, PredType::NATIVE_DOUBLE, space));
@@ -101,7 +101,7 @@ test_create( H5File& file)
// dataset can only be created once. If an exception is not thrown for
// this action by createDataSet, then throw an invalid action exception.
try {
dataset = new DataSet (file.createDataSet
dataset = new DataSet (file.createDataSet
(DSET_DEFAULT_NAME, PredType::NATIVE_DOUBLE, space));
// continuation here, that means no exception has been thrown
@@ -140,7 +140,7 @@ test_create( H5File& file)
csize[1] = 100;
create_parms.setChunk( 2, csize );
dataset = new DataSet (file.createDataSet
dataset = new DataSet (file.createDataSet
(DSET_CHUNKED_NAME, PredType::NATIVE_DOUBLE, space, create_parms));
// Note: this one has no error message in C when failure occurs?
@@ -176,7 +176,7 @@ test_create( H5File& file)
/*-------------------------------------------------------------------------
* Function: check_values
*
* Purpose: Checks a read value against the written value. If they are
* Purpose: Checks a read value against the written value. If they are
* different, the function will print out a message and the
* different values. This function is made to reuse the code
* segment that is used in various places throughout
@@ -195,13 +195,13 @@ test_create( H5File& file)
*
*-------------------------------------------------------------------------
*/
static int
static int
check_values (hsize_t i, hsize_t j, int apoint, int acheck)
{
if (apoint != acheck)
{
cerr << " Read different values than written.\n" << endl;
cerr << " At index " << (unsigned long)i << "," <<
cerr << " At index " << (unsigned long)i << "," <<
(unsigned long)j << endl;
return -1;
}
@@ -245,7 +245,7 @@ test_simple_io( H5File& file)
}
char* tconv_buf = new char [1000];
try
try
{
// Create the data space
hsize_t dims[2];
@@ -322,7 +322,7 @@ test_tconv( H5File& file)
//assert (in);
TESTING("data type conversion");
// Initialize the dataset
for (int i = 0; i < 1000000; i++) {
out[i*4+0] = 0x11;
@@ -352,7 +352,7 @@ test_tconv( H5File& file)
if (in[4*i+0]!=out[4*i+3] ||
in[4*i+1]!=out[4*i+2] ||
in[4*i+2]!=out[4*i+1] ||
in[4*i+3]!=out[4*i+0])
in[4*i+3]!=out[4*i+0])
{
throw Exception("DataSet::read", "Read with byte order conversion failed");
}
@@ -455,7 +455,7 @@ test_compression(H5File& file)
}
char* tconv_buf = new char [1000];
DataSet* dataset = NULL;
try
try
{
const hsize_t size[2] = {100, 200};
// Create the data space
@@ -465,37 +465,37 @@ test_compression(H5File& file)
DSetMemXferPropList xfer;
xfer.setBuffer (1000, tconv_buf, NULL);
// Use chunked storage with compression
DSetCreatPropList dscreatplist;
const hsize_t chunk_size[2] = {2, 25};
dscreatplist.setChunk (2, chunk_size);
dscreatplist.setDeflate (6);
#ifdef H5_HAVE_FILTER_DEFLATE
TESTING("compression (setup)");
// Create the dataset
dataset = new DataSet (file.createDataSet
dataset = new DataSet (file.createDataSet
(DSET_COMPRESS_NAME, PredType::NATIVE_INT, space1, dscreatplist));
PASSED();
/*----------------------------------------------------------------------
* STEP 1: Read uninitialized data. It should be zero.
*----------------------------------------------------------------------
*----------------------------------------------------------------------
*/
TESTING("compression (uninitialized read)");
dataset->read ((void*) check, PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer);
for (i=0; i<size[0]; i++) {
for (j=0; j<size[1]; j++) {
if (0!=check[i][j]) {
H5_FAILED();
cerr << " Read a non-zero value." << endl;
cerr << " At index " << (unsigned long)i << "," <<
cerr << " At index " << (unsigned long)i << "," <<
(unsigned long)j << endl;
throw Exception("test_compression", "Failed in uninitialized read");
}
@@ -506,13 +506,13 @@ test_compression(H5File& file)
/*----------------------------------------------------------------------
* STEP 2: Test compression by setting up a chunked dataset and writing
* to it.
*----------------------------------------------------------------------
*----------------------------------------------------------------------
*/
TESTING("compression (write)");
for (i=n=0; i<size[0]; i++)
{
for (j=0; j<size[1]; j++)
for (j=0; j<size[1]; j++)
{
points[i][j] = n++;
}
@@ -524,7 +524,7 @@ test_compression(H5File& file)
/*----------------------------------------------------------------------
* STEP 3: Try to read the data we just wrote.
*----------------------------------------------------------------------
*----------------------------------------------------------------------
*/
TESTING("compression (read)");
@@ -547,13 +547,13 @@ test_compression(H5File& file)
* random thus not very compressible, and will cause the chunks to move
* around as they grow. We only change values for the left half of the
* dataset although we rewrite the whole thing.
*----------------------------------------------------------------------
*----------------------------------------------------------------------
*/
TESTING("compression (modify)");
for (i=0; i<size[0]; i++)
{
for (j=0; j<size[1]/2; j++)
for (j=0; j<size[1]/2; j++)
{
points[i][j] = rand ();
}
@@ -578,13 +578,13 @@ test_compression(H5File& file)
* STEP 5: Close the dataset and then open it and read it again. This
* insures that the compression message is picked up properly from the
* object header.
*----------------------------------------------------------------------
*----------------------------------------------------------------------
*/
TESTING("compression (re-open)");
// close this dataset to reuse the var
delete dataset;
dataset = new DataSet (file.openDataSet (DSET_COMPRESS_NAME));
dataset->read ((void*)check, PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer);
@@ -598,13 +598,13 @@ test_compression(H5File& file)
}
PASSED();
/*----------------------------------------------------------------------
* STEP 6: Test partial I/O by writing to and then reading from a
* hyperslab of the dataset. The hyperslab does not line up on chunk
* boundaries (we know that case already works from above tests).
*----------------------------------------------------------------------
*----------------------------------------------------------------------
*/
TESTING("compression (partial I/O)");
@@ -618,7 +618,7 @@ test_compression(H5File& file)
space1.selectHyperslab( H5S_SELECT_SET, hs_size, hs_offset );
dataset->write ((void*)points, PredType::NATIVE_INT, space1, space1, xfer);
dataset->read ((void*)check, PredType::NATIVE_INT, space1, space1, xfer);
// Check that the values read are the same as the values written
for (i=0; i<hs_size[0]; i++) {
for (j=0; j<hs_size[1]; j++) {
@@ -626,9 +626,9 @@ test_compression(H5File& file)
check[hs_offset[0]+i][hs_offset[1]+j]) {
H5_FAILED();
cerr << " Read different values than written.\n" << endl;
cerr << " At index " << (unsigned long)(hs_offset[0]+i) <<
cerr << " At index " << (unsigned long)(hs_offset[0]+i) <<
"," << (unsigned long)(hs_offset[1]+j) << endl;
cerr << " At original: " << (int)points[hs_offset[0]+i][hs_offset[1]+j] << endl;
cerr << " At returned: " << (int)check[hs_offset[0]+i][hs_offset[1]+j] << endl;
throw Exception("test_compression", "Failed in partial I/O");
@@ -650,13 +650,13 @@ test_compression(H5File& file)
/*----------------------------------------------------------------------
* STEP 7: Register an application-defined compression method and use it
* to write and then read the dataset.
*----------------------------------------------------------------------
*----------------------------------------------------------------------
*/
TESTING("compression (app-defined method)");
if (H5Zregister (H5Z_BOGUS)<0)
throw Exception("test_compression", "Failed in app-defined method");
if (H5Pset_filter (dscreatplist.getId(), H5Z_FILTER_BOGUS, 0, 0, NULL)<0)
if (H5Pset_filter (dscreatplist.getId(), H5Z_FILTER_BOGUS, 0, 0, NULL)<0)
throw Exception("test_compression", "Failed in app-defined method");
dscreatplist.setFilter (H5Z_FILTER_BOGUS, 0, 0, NULL);
@@ -665,21 +665,21 @@ test_compression(H5File& file)
dataset->write ((void*)points, PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer);
dataset->read ((void*)check, PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer);
// Check that the values read are the same as the values written
for (i = 0; i < size[0]; i++)
for (j = 0; j < size[1]; j++)
{
int status = check_values (i, j, points[i][j], check[i][j]);
if (status == -1)
if (status == -1)
throw Exception("test_compression", "Failed in app-defined method");
}
PASSED();
/*----------------------------------------------------------------------
* Cleanup
*----------------------------------------------------------------------
*----------------------------------------------------------------------
*/
delete dataset;
delete [] tconv_buf;
@@ -742,7 +742,7 @@ test_multiopen (H5File& file)
// Create first dataset
DataSet dset1 = file.createDataSet ("multiopen", PredType::NATIVE_INT, *space, dcpl);
// Open again the first dataset from the file to another DataSet object.
DataSet dset2 = file.openDataSet ("multiopen");
@@ -759,13 +759,13 @@ test_multiopen (H5File& file)
hsize_t tmp_size[1];
space->getSimpleExtentDims (tmp_size);
if (cur_size[0]!=tmp_size[0])
if (cur_size[0]!=tmp_size[0])
{
cerr << " Got " << (int)tmp_size[0] << " instead of "
cerr << " Got " << (int)tmp_size[0] << " instead of "
<< (int)cur_size[0] << "!" << endl;
throw Exception("test_multiopen", "Failed in multi-open with extending");
}
// clean up and return with success
delete space;
PASSED();
@@ -846,7 +846,7 @@ test_types(H5File& file)
dset = new DataSet(grp.createDataSet("bitfield_1", type, space));
// Fill buffer
for (i=0; i<sizeof buf; i++)
for (i=0; i<sizeof buf; i++)
buf[i] = (unsigned char)0xff ^ (unsigned char)i;
// Write data from buf using all default dataspaces and property list
@@ -857,7 +857,7 @@ test_types(H5File& file)
} // end try block of bitfield_1
// catch exceptions thrown in try block of bitfield_1
catch (Exception E)
catch (Exception E)
{
cerr << " FAILED" << endl;
cerr << " <<< " << "bitfield_1: " << E.getFuncName()
@@ -875,7 +875,7 @@ test_types(H5File& file)
dset = new DataSet(grp.createDataSet("bitfield_2", type, space));
// Fill buffer
for (i=0; i<sizeof(buf); i++)
for (i=0; i<sizeof(buf); i++)
buf[i] = (unsigned char)0xff ^ (unsigned char)i;
// Write data from buf using all default dataspaces and property
@@ -908,7 +908,7 @@ test_types(H5File& file)
dset = new DataSet(grp.createDataSet("opaque_1", *optype, space));
// Fill buffer
for (i=0; i<sizeof buf; i++)
for (i=0; i<sizeof buf; i++)
buf[i] = (unsigned char)0xff ^ (unsigned char)i;
// Write data from buf using all default dataspaces and property
@@ -931,7 +931,7 @@ test_types(H5File& file)
delete optype;
throw E; // propagate the exception
}
/* opaque_2 */
try { // block opaque_2
nelmts = sizeof(buf)/4;
@@ -941,7 +941,7 @@ test_types(H5File& file)
dset = new DataSet(grp.createDataSet("opaque_2", *optype, space));
// Fill buffer
for (i=0; i<sizeof(buf); i++)
for (i=0; i<sizeof(buf); i++)
buf[i] = (unsigned char)0xff ^ (unsigned char)i;
// Write data from buf using all default dataspaces and property
@@ -964,7 +964,7 @@ test_types(H5File& file)
delete optype;
throw E; // propagate the exception
}
PASSED();
return 0;
} // end top try block
@@ -991,7 +991,7 @@ test_types(H5File& file)
* Nov 12, 01:
* - moved h5_cleanup to outside of try block because
* dataset.h5 cannot be removed until "file" is out of
* scope and dataset.h5 is closed.
* scope and dataset.h5 is closed.
* Feb 20, 05:
* - cleanup_dsets took care of the cleanup now.
*
@@ -1004,11 +1004,11 @@ main(void)
hid_t fapl_id;
fapl_id = h5_fileaccess(); // in h5test.c, returns a file access template
int nerrors=0; // keep track of number of failures occurr
try
try
{
// Turn of the auto-printing when failure occurs so that we can
// Turn of the auto-printing when failure occurs so that we can
// handle the errors appropriately since sometime failures are
// caused deliberately and expected.
Exception::dontPrint();
@@ -1018,7 +1018,7 @@ main(void)
FileAccPropList fapl(fapl_id);
H5File file(FILE1, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl);
// Cause the library to emit initial messages
Group grp = file.createGroup( "emit diagnostics", 0);
grp.setComment( ".", "Causes diagnostic messages to be emitted");
@@ -1030,7 +1030,7 @@ main(void)
nerrors += test_multiopen (file)<0 ?1:0;
nerrors += test_types(file)<0 ?1:0;
}
catch (Exception E)
catch (Exception E)
{
return(test_report(nerrors, string(" Dataset")));
}
@@ -1038,7 +1038,7 @@ main(void)
// Clean up data file
cleanup_dsets();
// Print out dsets test results
// Print out dsets test results
cerr << endl << endl;
return(test_report(nerrors, string(" Dataset")));
} // main
+5 -5
View File
@@ -40,7 +40,7 @@ using namespace H5;
* Function: test_report
*
* Purpose: Prints out the number of errors for the tests indicated
* by 'testname,' if there were any failures occurred. If
* by 'testname,' if there were any failures occurred. If
* no failure, test_report prints out the tests passed message.
*
* Return: if any failure has occurred: 1
@@ -67,7 +67,7 @@ int test_report( int nerrors, const string& testname )
<< " TESTS FAILED! *****" << endl;
return 1;
}
else
else
{
cerr << "All" << testname << " tests passed." << endl;
return 0;
@@ -86,7 +86,7 @@ int test_report( int nerrors, const string& testname )
*
*-------------------------------------------------------------------------
*/
void issue_fail_msg(const char* where, int line, const char* file_name,
void issue_fail_msg(const char* where, int line, const char* file_name,
const char* message)
{
if (GetTestVerbosity()>=VERBO_HI)
@@ -105,11 +105,11 @@ InvalidActionException::InvalidActionException():Exception(){}
// Function: InvalidActionException overloaded constructor
//
// Purpose: Creates an InvalidActionException with the name of the function,
// which the failure should have occurred but didn't, and a
// which the failure should have occurred but didn't, and a
// message explaining why it should fail.
// Parameters
// func_name - IN: Name of the function where failure should occur
// message - IN: Message
// message - IN: Message
//--------------------------------------------------------------------------
InvalidActionException::InvalidActionException(const string func_name, const string message) : Exception(func_name, message) {}
+2 -2
View File
@@ -62,8 +62,8 @@ template <class Type1, class Type2>
{
if (x != value)
{
cerr << "*** UNEXPECTED VALUE: " << file_name << ":line " << line
<< ":" << msg << " different: " << x << ", should be " << value
cerr << "*** UNEXPECTED VALUE: " << file_name << ":line " << line
<< ":" << msg << " different: " << x << ", should be " << value
<< endl;
IncTestNumErrs();
}
+60 -60
View File
@@ -103,9 +103,9 @@ int attr_data1a[ATTR1_DIM1]={256,11945,-22107};
**
** test_attr_basic_write(): Test basic write attribute.
** Tests integer attributes on both datasets and groups
**
**
****************************************************************/
static void
static void
test_attr_basic_write(void)
{
hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
@@ -114,10 +114,10 @@ test_attr_basic_write(void)
int read_data1[ATTR1_DIM1]={0}; // Buffer for reading 1st attribute
int i;
// Output message about test being performed
// Output message about test being performed
MESSAGE(5, ("Testing Basic Attribute Writing Functions\n"));
try {
try {
// Create file
H5File fid1 (FILENAME, H5F_ACC_TRUNC);
@@ -133,12 +133,12 @@ test_attr_basic_write(void)
// Create an attribute for the dataset
Attribute ds_attr1 = dataset.createAttribute (ATTR1_NAME, PredType::NATIVE_INT, att_space);
// Try creating an attribute that already exists. This should fail
// since two attributes cannot have the same name. If an exception
// is not thrown for this action by createAttribute, then throw an
// Try creating an attribute that already exists. This should fail
// since two attributes cannot have the same name. If an exception
// is not thrown for this action by createAttribute, then throw an
// invalid action exception.
try {
Attribute invalid_attr = dataset.createAttribute (ATTR1_NAME, PredType::NATIVE_INT, att_space);
Attribute invalid_attr = dataset.createAttribute (ATTR1_NAME, PredType::NATIVE_INT, att_space);
// continuation here, that means no exception has been thrown
throw InvalidActionException("H5File::createDataSet", "Library allowed overwrite of existing dataset");
@@ -197,7 +197,7 @@ test_attr_basic_write(void)
try {
Attribute invalid_attr = group.createAttribute (ATTR2_NAME, PredType::NATIVE_INT, sid3);
// continuation here, that means no exception has been thrown
throw InvalidActionException("H5Group::createAttribute",
throw InvalidActionException("H5Group::createAttribute",
"Attempting to create an existing attribute");
}
catch (AttributeIException E) // catching invalid creating attribute
@@ -208,7 +208,7 @@ test_attr_basic_write(void)
// Check storage size for attribute
attr_size = gr_attr.getStorageSize();
verify_val((long)attr_size, (long)(ATTR2_DIM1*ATTR2_DIM2*sizeof(int)),
verify_val((long)attr_size, (long)(ATTR2_DIM1*ATTR2_DIM2*sizeof(int)),
"Attribute::getStorageSize", __LINE__, __FILE__);
} // end try block
@@ -220,9 +220,9 @@ test_attr_basic_write(void)
/****************************************************************
**
** test_attr_rename(): Test renaming attribute function.
**
**
****************************************************************/
static void
static void
test_attr_rename(void)
{
int read_data1[ATTR1_DIM1]={0}; // Buffer for reading the attribute
@@ -276,7 +276,7 @@ test_attr_rename(void)
if(attr_data1a[i]!=read_data1[i])
TestErrPrintf("%d: attribute data different: attr_data1a[%d]=%d,read_data1[%d]=%d\n",__LINE__,i,attr_data1a[i],i,read_data1[i]);
// Close attribute
// Close attribute
attr2.close();
// Change first attribute back to the original name
@@ -291,9 +291,9 @@ test_attr_rename(void)
/********************************************************************
**
** test_attr_basic_read(): Test basic read attribute.
**
**
********************************************************************/
static void
static void
test_attr_basic_read(void)
{
int i, j;
@@ -301,7 +301,7 @@ test_attr_basic_read(void)
// Output message about test being performed
MESSAGE(5, ("Testing Basic Attribute Reading Functions\n"));
try {
try {
// Open file
H5File fid1(FILENAME, H5F_ACC_RDWR);
@@ -321,7 +321,7 @@ test_attr_basic_read(void)
// Verify values read in
for(i=0; i<ATTR1_DIM1; i++)
if(attr_data1[i]!=read_data1[i])
if(attr_data1[i]!=read_data1[i])
TestErrPrintf("%d: attribute data different: attr_data1[%d]=%d, read_data1[%d]=%d\n",__LINE__,i,attr_data1[i],i,read_data1[i]);
/*
@@ -358,16 +358,16 @@ test_attr_basic_read(void)
/****************************************************************
**
** test_attr_compound_write(): Tests compound datatype attributes
**
**
****************************************************************/
static void
static void
test_attr_compound_write(void)
{
// Output message about test being performed
MESSAGE(5, ("Testing Multiple Attribute Functions\n"));
try {
try {
// Create file
H5File fid1(FILENAME.c_str(), H5F_ACC_TRUNC);
@@ -378,7 +378,7 @@ test_attr_compound_write(void)
// Create a dataset
DataSet dataset = fid1.createDataSet(DSET1_NAME, PredType::NATIVE_UCHAR,sid1);
// Create the attribute datatype.
// Create the attribute datatype.
CompType comp_type(sizeof(struct attr4_struct));
attr4_field1_off = HOFFSET(struct attr4_struct, i);
@@ -416,9 +416,9 @@ test_attr_compound_write(void)
/****************************************************************
**
** test_attr_compound_read(): Test basic H5A (attribute) code.
**
**
****************************************************************/
static void
static void
test_attr_compound_read(void)
{
hsize_t dims[ATTR_MAX_DIMS]; // Attribute dimensions
@@ -430,8 +430,8 @@ test_attr_compound_read(void)
// Output message about test being performed
MESSAGE(5, ("Testing Basic Attribute Functions\n"));
try {
// Open file
try {
// Open file
H5File fid1(FILENAME, H5F_ACC_RDWR);
// Open the dataset
@@ -441,7 +441,7 @@ test_attr_compound_read(void)
int num_attrs = dataset.getNumAttrs();
verify_val(num_attrs, 1, "H5Object::getNumAttrs", __LINE__, __FILE__);
// Open 1st attribute for the dataset
// Open 1st attribute for the dataset
Attribute attr = dataset.openAttribute((unsigned)0);
/* Verify Dataspace */
@@ -472,12 +472,12 @@ test_attr_compound_read(void)
int fields = datatype.getNmembers();
verify_val(fields, 3, "CompType::getNmembers", __LINE__, __FILE__);
// Verify that the fields have the same names as when the type
// Verify that the fields have the same names as when the type
// was created
for(i=0; i<fields; i++)
for(i=0; i<fields; i++)
{
string fieldname = datatype.getMemberName(i);
if(!((fieldname == ATTR4_FIELDNAME1) ||
if(!((fieldname == ATTR4_FIELDNAME1) ||
(fieldname == ATTR4_FIELDNAME2) ||
(fieldname == ATTR4_FIELDNAME3)))
TestErrPrintf("%d:invalid field name for field #%d: %s\n",__LINE__,i,fieldname.c_str());
@@ -550,15 +550,15 @@ test_attr_compound_read(void)
/****************************************************************
**
** test_attr_scalar_write(): Test scalar attribute writing functionality.
**
**
****************************************************************/
static void
static void
test_attr_scalar_write(void)
{
// Output message about test being performed
MESSAGE(5, ("Testing Basic Scalar Attribute Writing Functions\n"));
try {
try {
// Create file
H5File fid1(FILENAME, H5F_ACC_TRUNC);
@@ -578,12 +578,12 @@ test_attr_scalar_write(void)
// Create an attribute for the dataset
Attribute ds_attr = dataset.createAttribute (ATTR5_NAME, PredType::NATIVE_FLOAT, att_space);
// Try creating an attribute that already exists. This should fail
// since two attributes cannot have the same name. If an exception
// is not thrown for this action by createAttribute, then throw an
// Try creating an attribute that already exists. This should fail
// since two attributes cannot have the same name. If an exception
// is not thrown for this action by createAttribute, then throw an
// invalid action exception.
try {
Attribute invalid_attr = dataset.createAttribute (ATTR5_NAME, PredType::NATIVE_FLOAT, att_space);
Attribute invalid_attr = dataset.createAttribute (ATTR5_NAME, PredType::NATIVE_FLOAT, att_space);
// continuation here, that means no exception has been thrown
throw InvalidActionException("H5File::createDataSet", "Library allowed overwrite of existing dataset");
@@ -603,15 +603,15 @@ test_attr_scalar_write(void)
/****************************************************************
**
** test_attr_scalar_read(): Test scalar attribute reading functionality.
**
**
****************************************************************/
static void
static void
test_attr_scalar_read(void)
{
// Output message about test being performed
MESSAGE(5, ("Testing Basic Scalar Attribute Reading Functions\n"));
try {
try {
// Open file
H5File fid1(FILENAME, H5F_ACC_RDWR);
@@ -646,9 +646,9 @@ test_attr_scalar_read(void)
/****************************************************************
**
** test_attr_mult_write(): Test multiple attributes
**
**
****************************************************************/
static void
static void
test_attr_mult_write(void)
{
// Output message about test being performed
@@ -692,12 +692,12 @@ test_attr_mult_write(void)
// Create 3rd attribute for the dataset
Attribute ds_attr3 = dataset.createAttribute (ATTR3_NAME, PredType::NATIVE_DOUBLE, att3_space);
// Try creating an attribute that already exists. This should fail
// since two attributes cannot have the same name. If an exception
// is not thrown for this action by createAttribute, then throw an
// Try creating an attribute that already exists. This should fail
// since two attributes cannot have the same name. If an exception
// is not thrown for this action by createAttribute, then throw an
// invalid action exception.
try {
Attribute invalid_attr = dataset.createAttribute (ATTR3_NAME, PredType::NATIVE_DOUBLE, att3_space);
Attribute invalid_attr = dataset.createAttribute (ATTR3_NAME, PredType::NATIVE_DOUBLE, att3_space);
// continuation here, that means no exception has been thrown
throw InvalidActionException("DataSet::createAttribute", "Attempting to create a duplicate attribute");
@@ -717,9 +717,9 @@ test_attr_mult_write(void)
/****************************************************************
**
** test_attr_mult_read(): Test reading multiple attributes.
**
**
****************************************************************/
static void
static void
test_attr_mult_read(void)
{
int read_data1[ATTR1_DIM1]={0}; // Buffer for reading 1st attribute
@@ -730,8 +730,8 @@ test_attr_mult_read(void)
// Output message about test being performed
MESSAGE(5, ("Testing Multiple Attribute Reading Functions\n"));
try {
// Open file
try {
// Open file
H5File fid1(FILENAME, H5F_ACC_RDWR);
// Open the dataset
@@ -741,7 +741,7 @@ test_attr_mult_read(void)
int num_attrs = dataset.getNumAttrs();
verify_val(num_attrs, 3, "H5Object::getNumAttrs", __LINE__, __FILE__);
// Open 1st attribute for the dataset
// Open 1st attribute for the dataset
Attribute attr = dataset.openAttribute((unsigned)0);
/* Verify Dataspace */
@@ -793,7 +793,7 @@ test_attr_mult_read(void)
attr.close();
space.close();
// Open 2nd attribute for the dataset
// Open 2nd attribute for the dataset
attr = dataset.openAttribute((unsigned)1);
/* Verify Dataspace */
@@ -847,7 +847,7 @@ test_attr_mult_read(void)
attr.close();
space.close();
// Open 3rd attribute for the dataset
// Open 3rd attribute for the dataset
attr = dataset.openAttribute((unsigned)2);
/* Verify Dataspace */
@@ -906,11 +906,11 @@ test_attr_mult_read(void)
/****************************************************************
**
** test_attr_delete(): Test deleting attribute from different
** test_attr_delete(): Test deleting attribute from different
** hdf5 objects.
**
**
****************************************************************/
static void
static void
test_attr_delete(void)
{
string attr_name; // Buffer for attribute names
@@ -918,8 +918,8 @@ test_attr_delete(void)
// Output message about test being performed
MESSAGE(5, ("Testing Removing Attribute Function\n"));
try {
// Open file
try {
// Open file
H5File fid1(FILENAME, H5F_ACC_RDWR);
// Open the dataset
@@ -950,7 +950,7 @@ test_attr_delete(void)
num_attrs = dataset.getNumAttrs();
verify_val(num_attrs, 2, "H5Object::getNumAttrs", __LINE__, __FILE__);
// Open 1st attribute for the dataset
// Open 1st attribute for the dataset
Attribute attr = dataset.openAttribute((unsigned)0);
// Verify Name
@@ -1001,9 +1001,9 @@ test_attr_delete(void)
/****************************************************************
**
** test_attr(): Main attribute testing routine.
**
**
****************************************************************/
void
void
test_attr(void)
{
// Output message about test being performed
+1 -1
View File
@@ -51,7 +51,7 @@
using namespace H5;
#endif /* !H5_NO_NAMESPACE */
int
int
main(int argc, char *argv[])
{
/* Initialize testing framework */
+11 -11
View File
@@ -84,7 +84,7 @@ const string FILE4("tfile4.h5");
*
*-------------------------------------------------------------------------
*/
static void
static void
test_file_create(void)
{
// Output message about test being performed
@@ -114,13 +114,13 @@ test_file_create(void)
catch( FileIException E ) // catch truncating existing file
{} // do nothing, FAIL expected
// Close file1
// Close file1
delete file1;
file1 = NULL;
// Try again with H5F_ACC_EXCL. This should fail because the file
// Try again with H5F_ACC_EXCL. This should fail because the file
// already exists from the previous steps.
try {
try {
H5File file2(FILE1, H5F_ACC_EXCL); // should throw E
// Should FAIL but didn't, so throw an invalid action exception
@@ -291,7 +291,7 @@ test_file_create(void)
*
*-------------------------------------------------------------------------
*/
static void
static void
test_file_open(void)
{
// Output message about test being performed
@@ -329,7 +329,7 @@ test_file_open(void)
/*-------------------------------------------------------------------------
* Function: test_file_size
*
* Purpose: Test file size.
* Purpose: Test file size.
*
* Return: None
*
@@ -340,7 +340,7 @@ test_file_open(void)
*
*-------------------------------------------------------------------------
*/
static void
static void
test_file_size(void)
{
// Output message about test being performed
@@ -376,14 +376,14 @@ test_file_size(void)
// use C test utility routine to close property list.
H5Pclose(fapl_id);
} // test_file_size()
/*-------------------------------------------------------------------------
* Function: test_file_name
*
* Purpose: Test getting file's name.
* Purpose: Test getting file's name.
*
* Return: None
*
@@ -408,7 +408,7 @@ typedef struct s1_t {
float b;
} s1_t;
static void
static void
test_file_name()
{
// Output message about test being performed
@@ -484,7 +484,7 @@ test_file_name()
*
*-------------------------------------------------------------------------
*/
void
void
test_file(void)
{
// Output message about test being performed
+27 -27
View File
@@ -84,7 +84,7 @@ struct space4_struct {
int space5_data = 7;
/*-------------------------------------------------------------------------
*
*
* Function: test_h5s_basic
*
* Purpose: Test basic H5S (dataspace) code
@@ -103,7 +103,7 @@ int space5_data = 7;
* with a special routine.
*-------------------------------------------------------------------------
*/
static void
static void
test_h5s_basic(void)
{
hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
@@ -115,7 +115,7 @@ test_h5s_basic(void)
// Output message about test being performed
MESSAGE(5, ("Testing Dataspace Manipulation\n"));
try
try
{ // beginning of first try block
// Create simple dataspace sid1
@@ -153,7 +153,7 @@ test_h5s_basic(void)
rank = sid2.getSimpleExtentNdims();
verify_val(rank, SPACE2_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__);
// Retrieves dimension size and max size of dataspace sid2 and
// Retrieves dimension size and max size of dataspace sid2 and
// verify them
ndims = sid2.getSimpleExtentDims( tdims, tmax );
verify_val(HDmemcmp(tdims, dims2, SPACE2_RANK * sizeof(unsigned)), 0,
@@ -163,7 +163,7 @@ test_h5s_basic(void)
// Check to be sure we can't create a simple data space that has too
// many dimensions.
try {
try {
DataSpace manydims_ds(H5S_MAX_RANK+1, dims3, NULL);
// Should FAIL but didn't, so throw an invalid action exception
@@ -190,10 +190,10 @@ test_h5s_basic(void)
// Create file
H5File fid1(testfile, H5F_ACC_RDONLY);
// Try to open the dataset that has higher dimensionality than
// Try to open the dataset that has higher dimensionality than
// what the library can handle and this operation should fail.
try {
DataSet dset1 = fid1.openDataSet( "dset" );
DataSet dset1 = fid1.openDataSet( "dset" );
// Should FAIL but didn't, so throw an invalid action exception
throw InvalidActionException("H5File::openDataSet", "Opening a dataset with higher dimensionality than what the library can handle");
@@ -207,7 +207,7 @@ test_h5s_basic(void)
// Verify that incorrect dimensions don't work
dims1[0] = 0;
try {
DataSpace wrongdim_ds (SPACE1_RANK, dims1);
DataSpace wrongdim_ds (SPACE1_RANK, dims1);
// Should FAIL but didn't, so throw an invalid action exception
throw InvalidActionException("DataSpace constructor", "Attempted to use incorrect dimensions");
@@ -233,14 +233,14 @@ test_h5s_basic(void)
cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl;
}
// catch all other exceptions
catch (Exception E)
catch (Exception E)
{
issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg());
}
} // test_h5s_basic()
/*-------------------------------------------------------------------------
*
*
* Function: test_h5s_scalar_write
*
* Purpose: Test scalar H5S (dataspace) writing code
@@ -259,7 +259,7 @@ test_h5s_basic(void)
* with a special routine.
*-------------------------------------------------------------------------
*/
static void
static void
test_h5s_scalar_write(void)
{
// Output message about test being performed
@@ -305,7 +305,7 @@ test_h5s_scalar_write(void)
} // test_h5s_scalar_write()
/*-------------------------------------------------------------------------
*
*
* Function: test_h5s_scalar_read
*
* Purpose: Test scalar H5S (dataspace) reading code
@@ -324,7 +324,7 @@ test_h5s_scalar_write(void)
* with a special routine.
*-------------------------------------------------------------------------
*/
static void
static void
test_h5s_scalar_read(void)
{
hsize_t tdims[4]; // Dimension array to test with
@@ -362,11 +362,11 @@ test_h5s_scalar_read(void)
// all the exceptions caused by negative returned values by C APIs
issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg());
}
} // test_h5s_scalar_read()
/*-------------------------------------------------------------------------
*
*
* Function: test_h5s_null
*
* Purpose: Test null H5S (dataspace) code
@@ -385,7 +385,7 @@ test_h5s_scalar_read(void)
* with a special routine.
*-------------------------------------------------------------------------
*/
static void
static void
test_h5s_null(void)
{
// Output message about test being performed
@@ -403,7 +403,7 @@ test_h5s_null(void)
n = sid1.getSimpleExtentNpoints();
verify_val((long)n, 0, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__);
// Create a dataset
// Create a dataset
DataSet dataset = fid1.createDataSet("Dataset1", PredType::NATIVE_UINT,sid1);
// Try to write nothing to the dataset
@@ -420,10 +420,10 @@ test_h5s_null(void)
} // test_h5s_null()
/*-------------------------------------------------------------------------
*
*
* Function: test_h5s_compound_scalar_write
*
* Purpose: Test scalar H5S (dataspace) writing for compound
* Purpose: Test scalar H5S (dataspace) writing for compound
* datatypes
*
* Return: none
@@ -440,7 +440,7 @@ test_h5s_null(void)
* with a special routine.
*-------------------------------------------------------------------------
*/
static void
static void
test_h5s_compound_scalar_write(void)
{
// Output message about test being performed
@@ -494,10 +494,10 @@ test_h5s_compound_scalar_write(void)
} // test_h5s_compound_scalar_write()
/*-------------------------------------------------------------------------
*
*
* Function: test_h5s_compound_scalar_read
*
* Purpose: Test scalar H5S (dataspace) reading for compound
* Purpose: Test scalar H5S (dataspace) reading for compound
* datatypes
*
* Return: none
@@ -514,7 +514,7 @@ test_h5s_compound_scalar_write(void)
* with a special routine.
*-------------------------------------------------------------------------
*/
static void
static void
test_h5s_compound_scalar_read(void)
{
hsize_t tdims[4]; // Dimension array to test with
@@ -544,14 +544,14 @@ test_h5s_compound_scalar_read(void)
// Get the datatype of this dataset.
CompType type(dataset);
struct space4_struct rdata; // Scalar data read in
dataset.read(&rdata, type);
// Verify read data
if(HDmemcmp(&space4_data,&rdata,sizeof(struct space4_struct)))
{
cerr << "scalar data different: space4_data.c1="
cerr << "scalar data different: space4_data.c1="
<< space4_data.c1 << ", read_data4.c1=" << rdata.c1 << endl;
cerr << "scalar data different: space4_data.u="
<< space4_data.u << ", read_data4.u=" << rdata.u << endl;
@@ -569,7 +569,7 @@ test_h5s_compound_scalar_read(void)
} // test_h5s_compound_scalar_read()
/*-------------------------------------------------------------------------
*
*
* Function: test_h5s
*
* Purpose: Main dataspace testing routine
@@ -582,7 +582,7 @@ test_h5s_compound_scalar_read(void)
* Modifications:
*-------------------------------------------------------------------------
*/
void
void
test_h5s(void)
{
// Output message about test being performed
+39 -39
View File
@@ -12,52 +12,52 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
/*
* This program illustrates the usage of the H5A Interface functions.
* It creates and writes a dataset, and then creates and writes array,
* scalar, and string attributes of the dataset.
* scalar, and string attributes of the dataset.
* Program reopens the file, attaches to the scalar attribute using
* attribute name and reads and displays its value. Then index of the
* third attribute is used to read and display attribute values.
* The H5Aiterate function is used to iterate through the dataset attributes,
* and display their names. The function is also reads and displays the values
* of the array attribute.
*/
* and display their names. The function is also reads and displays the values
* of the array attribute.
*/
#include <stdlib.h>
#include "hdf5.h"
#define H5FILE_NAME "Attributes.h5"
#define RANK 1 /* Rank and size of the dataset */
#define RANK 1 /* Rank and size of the dataset */
#define SIZE 7
#define ARANK 2 /* Rank and dimension sizes of the first dataset attribute */
#define ADIM1 2
#define ADIM2 3
#define ADIM2 3
#define ANAME "Float attribute" /* Name of the array attribute */
#define ANAMES "Character attribute" /* Name of the string attribute */
herr_t attr_info(hid_t loc_id, const char *name, void *opdata);
herr_t attr_info(hid_t loc_id, const char *name, void *opdata);
/* Operator function */
int
int
main (void)
{
hid_t file, dataset; /* File and dataset identifiers */
hid_t fid; /* Dataspace identifier */
hid_t attr1, attr2, attr3; /* Attribute identifiers */
hid_t attr;
hid_t aid1, aid2, aid3; /* Attribute dataspace identifiers */
hid_t aid1, aid2, aid3; /* Attribute dataspace identifiers */
hid_t atype; /* Attribute type */
hsize_t fdim[] = {SIZE};
hsize_t adim[] = {ADIM1, ADIM2}; /* Dimensions of the first attribute */
float matrix[ADIM1][ADIM2]; /* Attribute data */
float matrix[ADIM1][ADIM2]; /* Attribute data */
herr_t ret; /* Return value */
unsigned i,j; /* Counters */
@@ -69,10 +69,10 @@ main (void)
* Data initialization.
*/
int vector[] = {1, 2, 3, 4, 5, 6, 7}; /* Dataset data */
int point = 1; /* Value of the scalar attribute */
int point = 1; /* Value of the scalar attribute */
char string[] = "ABCD"; /* Value of the string attribute */
for (i=0; i < ADIM1; i++) { /* Values of the array attribute */
for (j=0; j < ADIM2; j++)
matrix[i][j] = -1.;
@@ -83,7 +83,7 @@ main (void)
*/
file = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
/*
/*
* Create the dataspace for the dataset in the file.
*/
fid = H5Screate(H5S_SIMPLE);
@@ -100,7 +100,7 @@ main (void)
ret = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL , H5S_ALL, H5P_DEFAULT, vector);
/*
* Create dataspace for the first attribute.
* Create dataspace for the first attribute.
*/
aid1 = H5Screate(H5S_SIMPLE);
ret = H5Sset_extent_simple(aid1, ARANK, adim, NULL);
@@ -125,7 +125,7 @@ main (void)
/*
* Write scalar attribute.
*/
ret = H5Awrite(attr2, H5T_NATIVE_INT, &point);
ret = H5Awrite(attr2, H5T_NATIVE_INT, &point);
/*
* Create string attribute.
@@ -139,23 +139,23 @@ main (void)
/*
* Write string attribute.
*/
ret = H5Awrite(attr3, atype, string);
ret = H5Awrite(attr3, atype, string);
/*
* Close attribute and file dataspaces.
*/
ret = H5Sclose(aid1);
ret = H5Sclose(aid2);
ret = H5Sclose(aid3);
ret = H5Sclose(fid);
ret = H5Sclose(aid1);
ret = H5Sclose(aid2);
ret = H5Sclose(aid3);
ret = H5Sclose(fid);
/*
* Close the attributes.
*/
*/
ret = H5Aclose(attr1);
ret = H5Aclose(attr2);
ret = H5Aclose(attr3);
/*
* Close the dataset.
*/
@@ -177,12 +177,12 @@ main (void)
dataset = H5Dopen(file,"Dataset");
/*
* Attach to the scalar attribute using attribute name, then read and
* Attach to the scalar attribute using attribute name, then read and
* display its value.
*/
attr = H5Aopen_name(dataset,"Integer attribute");
ret = H5Aread(attr, H5T_NATIVE_INT, &point_out);
printf("The value of the attribute \"Integer attribute\" is %d \n", point_out);
printf("The value of the attribute \"Integer attribute\" is %d \n", point_out);
ret = H5Aclose(attr);
/*
@@ -197,7 +197,7 @@ main (void)
ret = H5Tclose(atype);
/*
* Get attribute info using iteration function.
* Get attribute info using iteration function.
*/
idx = H5Aiterate(dataset, NULL, attr_info, NULL);
@@ -207,21 +207,21 @@ main (void)
H5Dclose(dataset);
H5Fclose(file);
return 0;
return 0;
}
/*
* Operator function.
*/
herr_t
herr_t
attr_info(hid_t loc_id, const char *name, void *opdata)
{
hid_t attr, atype, aspace; /* Attribute, datatype and dataspace identifiers */
int rank;
hsize_t sdim[64];
hsize_t sdim[64];
herr_t ret;
int i;
size_t npoints; /* Number of elements in the array attribute. */
size_t npoints; /* Number of elements in the array attribute. */
float *float_array; /* Pointer to the array attribute. */
/* avoid warnings */
@@ -229,7 +229,7 @@ attr_info(hid_t loc_id, const char *name, void *opdata)
/*
* Open the attribute using its name.
*/
*/
attr = H5Aopen_name(loc_id, name);
/*
@@ -239,7 +239,7 @@ attr_info(hid_t loc_id, const char *name, void *opdata)
printf("Name : ");
puts(name);
/*
/*
* Get attribute datatype, dataspace, rank, and dimensions.
*/
atype = H5Aget_type(attr);
@@ -252,7 +252,7 @@ attr_info(hid_t loc_id, const char *name, void *opdata)
*/
if(rank > 0) {
printf("Rank : %d \n", rank);
printf("Rank : %d \n", rank);
printf("Dimension sizes : ");
for (i=0; i< rank; i++) printf("%d ", (int)sdim[i]);
printf("\n");
@@ -263,12 +263,12 @@ attr_info(hid_t loc_id, const char *name, void *opdata)
*/
if (H5T_FLOAT == H5Tget_class(atype)) {
printf("Type : FLOAT \n");
printf("Type : FLOAT \n");
npoints = H5Sget_simple_extent_npoints(aspace);
float_array = (float *)malloc(sizeof(float)*(int)npoints);
float_array = (float *)malloc(sizeof(float)*(int)npoints);
ret = H5Aread(attr, atype, float_array);
printf("Values : ");
for( i = 0; i < (int)npoints; i++) printf("%f ", float_array[i]);
for( i = 0; i < (int)npoints; i++) printf("%f ", float_array[i]);
printf("\n");
free(float_array);
}
+45 -45
View File
@@ -12,50 +12,50 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
/*
* This example shows how to read data from a chunked dataset.
* We will read from the file created by h5_extend_write.c
* We will read from the file created by h5_extend_write.c
*/
#include "hdf5.h"
#define H5FILE_NAME "SDSextendible.h5"
#define DATASETNAME "ExtendibleArray"
#define DATASETNAME "ExtendibleArray"
#define RANK 2
#define RANKC 1
#define NX 10
#define NY 5
#define NY 5
int
main (void)
{
hid_t file; /* handles */
hid_t dataset;
hid_t filespace;
hid_t memspace;
hid_t cparms;
hsize_t dims[2]; /* dataset and chunk dimensions*/
hid_t dataset;
hid_t filespace;
hid_t memspace;
hid_t cparms;
hsize_t dims[2]; /* dataset and chunk dimensions*/
hsize_t chunk_dims[2];
hsize_t col_dims[1];
hsize_t count[2];
hsize_t offset[2];
herr_t status, status_n;
herr_t status, status_n;
int data_out[NX][NY]; /* buffer for dataset to be read */
int chunk_out[2][5]; /* buffer for chunk to be read */
int column[10]; /* buffer for column to be read */
int rank, rank_chunk;
hsize_t i, j;
/*
* Open the file and the dataset.
*/
file = H5Fopen(H5FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT);
dataset = H5Dopen(file, DATASETNAME);
/*
* Get dataset rank and dimension.
*/
@@ -70,7 +70,7 @@ main (void)
* Define the memory space to read dataset.
*/
memspace = H5Screate_simple(RANK,dims,NULL);
/*
* Read dataset back and display.
*/
@@ -81,7 +81,7 @@ main (void)
for (j = 0; j < dims[0]; j++) {
for (i = 0; i < dims[1]; i++) printf("%d ", data_out[j][i]);
printf("\n");
}
}
/*
* Close/release resources.
@@ -89,20 +89,20 @@ main (void)
H5Sclose(memspace);
/*
* dataset rank 2, dimensions 10 x 5
* chunk rank 2, dimensions 2 x 5
* dataset rank 2, dimensions 10 x 5
* chunk rank 2, dimensions 2 x 5
* Dataset:
* 1 1 1 3 3
* 1 1 1 3 3
* 1 1 1 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 1 1 1 3 3
* 1 1 1 3 3
* 1 1 1 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 2 0 0 0 0
*/
/*
@@ -136,17 +136,17 @@ main (void)
H5Sclose(memspace);
/*
* Third column:
* 1
* 1
* 1
* 0
* 0
* 0
* 0
* 0
* 0
* 0
* Third column:
* 1
* 1
* 1
* 0
* 0
* 0
* 0
* 0
* 0
* 0
*/
/*
@@ -175,7 +175,7 @@ main (void)
offset[1] = 0;
count[0] = chunk_dims[0];
count[1] = chunk_dims[1];
status = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL,
status = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL,
count, NULL);
/*
@@ -188,11 +188,11 @@ main (void)
for (j = 0; j < chunk_dims[0]; j++) {
for (i = 0; i < chunk_dims[1]; i++) printf("%d ", chunk_out[j][i]);
printf("\n");
}
}
/*
* Chunk:
* 1 1 1 0 0
* 2 0 0 0 0
* Chunk:
* 1 1 1 0 0
* 2 0 0 0 0
*/
/*
@@ -210,4 +210,4 @@ main (void)
H5Fclose(file);
return 0;
}
}
+8 -8
View File
@@ -33,7 +33,7 @@ main(void)
typedef struct s1_t {
int a;
float b;
double c;
double c;
} s1_t;
s1_t s1[LENGTH];
hid_t s1_tid; /* File datatype identifier */
@@ -76,20 +76,20 @@ main(void)
file = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
/*
* Create the memory data type.
* Create the memory data type.
*/
s1_tid = H5Tcreate (H5T_COMPOUND, sizeof(s1_t));
H5Tinsert(s1_tid, "a_name", HOFFSET(s1_t, a), H5T_NATIVE_INT);
H5Tinsert(s1_tid, "c_name", HOFFSET(s1_t, c), H5T_NATIVE_DOUBLE);
H5Tinsert(s1_tid, "b_name", HOFFSET(s1_t, b), H5T_NATIVE_FLOAT);
/*
/*
* Create the dataset.
*/
dataset = H5Dcreate(file, DATASETNAME, s1_tid, space, H5P_DEFAULT);
/*
* Wtite data to the dataset;
* Wtite data to the dataset;
*/
status = H5Dwrite(dataset, s1_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, s1);
@@ -100,15 +100,15 @@ main(void)
H5Sclose(space);
H5Dclose(dataset);
H5Fclose(file);
/*
* Open the file and the dataset.
*/
file = H5Fopen(H5FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT);
dataset = H5Dopen(file, DATASETNAME);
/*
/*
* Create a data type for s2
*/
s2_tid = H5Tcreate(H5T_COMPOUND, sizeof(s2_t));
@@ -135,7 +135,7 @@ main(void)
for( i = 0; i < LENGTH; i++) printf("%d ", s2[i].a);
printf("\n");
/*
/*
* Create a data type for s3.
*/
s3_tid = H5Tcreate(H5T_COMPOUND, sizeof(float));
+4 -4
View File
@@ -12,13 +12,13 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
/*
* This shows how to use the hdf5 virtual file drivers.
* The example codes here do not check return values for the
* sake of simplicity. As in all proper programs, return codes
* should be checked.
*/
#include "hdf5.h"
#include "stdlib.h"
@@ -96,8 +96,8 @@ split_file(void)
int
main (void)
{
split_file();
return(0);
}
}
+17 -17
View File
@@ -12,8 +12,8 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* This example demonstrates how the data transform features of
/*
* This example demonstrates how the data transform features of
* HDF5 works.
*
* (1)
@@ -31,7 +31,7 @@
* (4)
* Get the transform from the property using H5Pget_data_transform.
*/
#include "hdf5.h"
#define ROWS 12
@@ -63,7 +63,7 @@ const float windchillF[ROWS][COLS] =
}
int
main (void)
@@ -71,8 +71,8 @@ main (void)
hid_t file, dataset; /* file and dataset handles */
hid_t dataspace; /* handles */
hsize_t dimsf[2]; /* dataset dimensions */
herr_t status;
hid_t dxpl_id_f_to_c, dxpl_id_c_to_f; /* data transform handles */
herr_t status;
hid_t dxpl_id_f_to_c, dxpl_id_c_to_f; /* data transform handles */
const char* f_to_c = "(5/9.0)*(x-32)";
const char* c_to_f = "(9/5.0)*x + 32";
char* transform;
@@ -88,11 +88,11 @@ main (void)
/*
* Describe the size of the array and create the data space for fixed
* size dataset.
* size dataset.
*/
dimsf[0] = ROWS;
dimsf[1] = COLS;
dataspace = H5Screate_simple(2, dimsf, NULL);
dataspace = H5Screate_simple(2, dimsf, NULL);
/*
* Create a new dataset within the file using defined dataspace and
@@ -125,11 +125,11 @@ main (void)
/* Print the data from the read*/
printf("\nData with no write transform, but a read transform: \n");
PRINT(windchillC);
/**************** PART 2 **************/
/*
* Write the data to the dataset with the f_to_c transform set
* Write the data to the dataset with the f_to_c transform set
*/
status = H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL,
dxpl_id_f_to_c, windchillF);
@@ -142,8 +142,8 @@ main (void)
PRINT(windchillC);
/************** PART 3 ***************/
/* Create the dataset transfer property list */
dxpl_id_c_to_f = H5Pcreate(H5P_DATASET_XFER);
@@ -156,7 +156,7 @@ main (void)
*/
status = H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL,
dxpl_id_f_to_c, windchillF);
/* Read the data with the c_to_f data transform */
H5Dread(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_c_to_f, windchillC);
@@ -168,9 +168,9 @@ main (void)
transform_size = H5Pget_data_transform(dxpl_id_f_to_c, NULL, 0);
transform = (char*) malloc(transform_size+1);
H5Pget_data_transform(dxpl_id_f_to_c, transform, transform_size+1);
printf("\nTransform string (from dxpl_id_f_to_c) is: %s\n", transform);
/*
* Close/release resources.
*/
@@ -179,6 +179,6 @@ main (void)
H5Sclose(dataspace);
H5Dclose(dataset);
H5Fclose(file);
return 0;
}
}
+31 -31
View File
@@ -12,46 +12,46 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
/*
* This example shows how to work with extendible dataset.
* In the current version of the library dataset MUST be
* chunked.
*
*
*/
#include "hdf5.h"
#define H5FILE_NAME "SDSextendible.h5"
#define DATASETNAME "ExtendibleArray"
#define DATASETNAME "ExtendibleArray"
#define RANK 2
#define NX 10
#define NY 5
#define NY 5
int
main (void)
{
hid_t file; /* handles */
hid_t dataspace, dataset;
hid_t filespace;
hid_t cparms;
hid_t dataspace, dataset;
hid_t filespace;
hid_t cparms;
hsize_t dims[2] = { 3, 3}; /*
* dataset dimensions
* dataset dimensions
* at the creation time
*/
hsize_t dims1[2] = { 3, 3}; /* data1 dimensions */
hsize_t dims2[2] = { 7, 1}; /* data2 dimensions */
hsize_t dims3[2] = { 2, 2}; /* data3 dimensions */
hsize_t dims1[2] = { 3, 3}; /* data1 dimensions */
hsize_t dims2[2] = { 7, 1}; /* data2 dimensions */
hsize_t dims3[2] = { 2, 2}; /* data3 dimensions */
hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED};
hsize_t chunk_dims[2] ={2, 5};
hsize_t size[2];
hsize_t offset[2];
herr_t status;
herr_t status;
int data1[3][3] = { {1, 1, 1}, /* data to write */
{1, 1, 1},
{1, 1, 1} };
{1, 1, 1} };
int data2[7] = { 2, 2, 2, 2, 2, 2, 2};
@@ -60,16 +60,16 @@ main (void)
int fillvalue = 0;
/*
* Create the data space with unlimited dimensions.
* Create the data space with unlimited dimensions.
*/
dataspace = H5Screate_simple(RANK, dims, maxdims);
dataspace = H5Screate_simple(RANK, dims, maxdims);
/*
* Create a new file. If file exists its contents will be overwritten.
*/
file = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
/*
/*
* Modify dataset creation properties, i.e. enable chunking.
*/
cparms = H5Pcreate(H5P_DATASET_CREATE);
@@ -86,8 +86,8 @@ main (void)
/*
* Extend the dataset. This call assures that dataset is at least 3 x 3.
*/
size[0] = 3;
size[1] = 3;
size[0] = 3;
size[1] = 3;
status = H5Dextend (dataset, size);
/*
@@ -97,7 +97,7 @@ main (void)
offset[0] = 0;
offset[1] = 0;
status = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL,
dims1, NULL);
dims1, NULL);
/*
* Write the data to the hyperslab.
@@ -109,8 +109,8 @@ main (void)
* Extend the dataset. Dataset becomes 10 x 3.
*/
dims[0] = dims1[0] + dims2[0];
size[0] = dims[0];
size[1] = dims[1];
size[0] = dims[0];
size[1] = dims[1];
status = H5Dextend (dataset, size);
/*
@@ -120,12 +120,12 @@ main (void)
offset[0] = 3;
offset[1] = 0;
status = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL,
dims2, NULL);
dims2, NULL);
/*
* Define memory space
*/
dataspace = H5Screate_simple(RANK, dims2, NULL);
dataspace = H5Screate_simple(RANK, dims2, NULL);
/*
* Write the data to the hyperslab.
@@ -137,8 +137,8 @@ main (void)
* Extend the dataset. Dataset becomes 10 x 5.
*/
dims[1] = dims1[1] + dims3[1];
size[0] = dims[0];
size[1] = dims[1];
size[0] = dims[0];
size[1] = dims[1];
status = H5Dextend (dataset, size);
/*
@@ -147,13 +147,13 @@ main (void)
filespace = H5Dget_space (dataset);
offset[0] = 0;
offset[1] = 3;
status = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL,
dims3, NULL);
status = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL,
dims3, NULL);
/*
* Define memory space.
*/
dataspace = H5Screate_simple(RANK, dims3, NULL);
dataspace = H5Screate_simple(RANK, dims3, NULL);
/*
* Write the data to the hyperslab.
@@ -163,7 +163,7 @@ main (void)
/*
* Resulting dataset
*
*
* 3 3 3 2 2
* 3 3 3 2 2
* 3 3 3 0 0
@@ -185,4 +185,4 @@ main (void)
H5Fclose(file);
return 0;
}
}
+37 -37
View File
@@ -13,12 +13,12 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* This program creates a group in the file and two datasets in the group.
* This program creates a group in the file and two datasets in the group.
* Hard link to the group object is created and one of the datasets is accessed
* under new name.
* under new name.
* Iterator functions are used to find information about the objects
* in the root group and in the created group.
*/
* in the root group and in the created group.
*/
#include "hdf5.h"
@@ -38,12 +38,12 @@ main(void)
hid_t file;
hid_t grp;
hid_t dataset, dataspace;
hid_t plist;
hid_t plist;
herr_t status;
hsize_t dims[2];
hsize_t cdims[2];
int idx_f, idx_g;
/*
@@ -52,15 +52,15 @@ main(void)
file = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
/*
* Create a group in the file.
* Create a group in the file.
*/
grp = H5Gcreate(file, "/Data", 0);
/*
* Create dataset "Compressed Data" in the group using absolute
* name. Dataset creation property list is modified to use
* GZIP compression with the compression effort set to 6.
* Note that compression can be used only when dataset is chunked.
* name. Dataset creation property list is modified to use
* GZIP compression with the compression effort set to 6.
* Note that compression can be used only when dataset is chunked.
*/
dims[0] = 1000;
dims[1] = 20;
@@ -69,16 +69,16 @@ main(void)
dataspace = H5Screate_simple(RANK, dims, NULL);
plist = H5Pcreate(H5P_DATASET_CREATE);
H5Pset_chunk(plist, 2, cdims);
H5Pset_deflate( plist, 6);
dataset = H5Dcreate(file, "/Data/Compressed_Data", H5T_NATIVE_INT,
dataspace, plist);
/*
H5Pset_deflate( plist, 6);
dataset = H5Dcreate(file, "/Data/Compressed_Data", H5T_NATIVE_INT,
dataspace, plist);
/*
* Close the first dataset .
*/
H5Sclose(dataspace);
H5Dclose(dataset);
/*
/*
* Create the second dataset.
*/
dims[0] = 500;
@@ -87,7 +87,7 @@ main(void)
dataset = H5Dcreate(file, "/Data/Float_Data", H5T_NATIVE_FLOAT,
dataspace, H5P_DEFAULT);
/*
/*
*Close the second dataset and file.
*/
H5Sclose(dataspace);
@@ -96,13 +96,13 @@ main(void)
H5Fclose(file);
/*
* Now reopen the file and group in the file.
* Now reopen the file and group in the file.
*/
file = H5Fopen(H5FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
grp = H5Gopen(file, "Data");
/*
* Access "Compressed_Data" dataset in the group.
/*
* Access "Compressed_Data" dataset in the group.
*/
dataset = H5Dopen(grp, "Compressed_Data");
if( dataset < 0) printf(" Dataset 'Compressed-Data' is not found. \n");
@@ -118,9 +118,9 @@ main(void)
*/
status = H5Glink(file, H5G_LINK_HARD, "Data", "Data_new");
/*
/*
* We can access "Compressed_Data" dataset using created
* hard link "Data_new".
* hard link "Data_new".
*/
dataset = H5Dopen(file, "/Data_new/Compressed_Data");
if( dataset < 0) printf(" Dataset is not found. \n");
@@ -132,7 +132,7 @@ main(void)
status = H5Dclose(dataset);
/*
/*
* Use iterator to see the names of the objects in the root group.
*/
idx_f = H5Giterate(file, "/", NULL, file_info, NULL);
@@ -141,15 +141,15 @@ main(void)
* Unlink name "Data" and use iterator to see the names
* of the objects in the file root direvtory.
*/
if (H5Gunlink(file, "Data") < 0)
if (H5Gunlink(file, "Data") < 0)
printf(" H5Gunlink failed \n");
else
else
printf("\"Data\" is unlinked \n");
idx_f = H5Giterate(file, "/", NULL, file_info, NULL);
/*
* Use iterator to see the names of the objects in the group
/*
* Use iterator to see the names of the objects in the group
* /Data_new.
*/
idx_g = H5Giterate(grp, "/Data_new", NULL, group_info, NULL);
@@ -157,7 +157,7 @@ main(void)
/*
* Close the file.
*/
status = H5Fclose(file);
return 0;
@@ -173,13 +173,13 @@ herr_t file_info(hid_t loc_id, const char *name, void *opdata)
opdata = opdata;
/*
* Display group name. The name is passed to the function by
* Display group name. The name is passed to the function by
* the Library. Some magic :-)
*/
printf("\n");
printf("Name : ");
puts(name);
return 0;
}
@@ -204,20 +204,20 @@ herr_t group_info(hid_t loc_id, const char *name, void *opdata)
* Open the datasets using their names.
*/
did = H5Dopen(loc_id, name);
/*
* Display dataset name.
*/
printf("\n");
printf("Name : ");
puts(name);
/*
/*
* Display dataset information.
*/
tid = H5Dget_type(did); /* get datatype*/
pid = H5Dget_create_plist(did); /* get creation property list */
/*
* Check if dataset is chunked.
*/
@@ -226,13 +226,13 @@ herr_t group_info(hid_t loc_id, const char *name, void *opdata)
* get chunking information: rank and dimensions.
*/
rank_chunk = H5Pget_chunk(pid, 2, chunk_dims_out);
printf("chunk rank %d, dimensions %lu x %lu\n", rank_chunk,
printf("chunk rank %d, dimensions %lu x %lu\n", rank_chunk,
(unsigned long)(chunk_dims_out[0]),
(unsigned long)(chunk_dims_out[1]));
}
}
else{
t_class = H5Tget_class(tid);
if(t_class < 0){
if(t_class < 0){
puts(" Invalid datatype.\n");
}
else {
@@ -250,7 +250,7 @@ herr_t group_info(hid_t loc_id, const char *name, void *opdata)
puts(" Datatype is 'H5T_NATIVE_COMPOUND'.\n");
}
}
H5Dclose(did);
H5Pclose(pid);
+20 -20
View File
@@ -12,12 +12,12 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* This program shows the concept of "mounting files".
/*
* This program shows the concept of "mounting files".
* Program creates one file with group G in it, and another
* file with dataset D. Then second file is mounted in the first one
* under the "mounting point" G. Dataset D is accessed in the first file
* under name /G/D and data is printed out.
* under the "mounting point" G. Dataset D is accessed in the first file
* under name /G/D and data is printed out.
*/
#include "hdf5.h"
@@ -29,11 +29,11 @@
#define NX 4
#define NY 5
int main(void)
int main(void)
{
hid_t fid1, fid2, gid; /* Files and group identifiers */
hid_t did, tid, sid; /* Dataset and datatype identifiers */
hid_t did, tid, sid; /* Dataset and datatype identifiers */
herr_t status;
hsize_t dims[] = {NX,NY}; /* Dataset dimensions */
@@ -42,26 +42,26 @@ int main(void)
int bm[NX][NY], bm_out[NX][NY]; /* Data buffers */
/*
* Initialization of buffer matrix "bm"
* Initialization of buffer matrix "bm"
*/
for(i =0; i<NX; i++) {
for(j = 0; j<NY; j++)
bm[i][j] = i + j;
}
/*
/*
* Create first file and a group in it.
*/
fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
gid = H5Gcreate(fid1, "/G", 0);
/*
* Close group and file
/*
* Close group and file
*/
H5Gclose(gid);
H5Fclose(fid1);
/*
/*
* Create second file and dataset "D" in it.
*/
fid2 = H5Fcreate(FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -69,31 +69,31 @@ int main(void)
dims[1] = NY;
sid = H5Screate_simple(RANK, dims, NULL);
did = H5Dcreate(fid2, "D", H5T_NATIVE_INT, sid, H5P_DEFAULT);
/*
* Write data to the dataset.
*/
status = H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, bm);
/*
/*
* Close all identifiers.
*/
H5Sclose(sid);
H5Dclose(did);
H5Fclose(fid2);
/*
/*
* Reopen both files
*/
fid1 = H5Fopen(FILE1, H5F_ACC_RDONLY, H5P_DEFAULT);
fid2 = H5Fopen(FILE2, H5F_ACC_RDONLY, H5P_DEFAULT);
/*
/*
* Mount second file under G in the first file.
*/
H5Fmount(fid1, "/G", fid2, H5P_DEFAULT);
/*
/*
* Access dataset D in the first file under /G/D name.
*/
did = H5Dopen(fid1,"/G/D");
@@ -109,13 +109,13 @@ int main(void)
printf("\n");
}
/*
/*
* Close all identifers
*/
H5Tclose(tid);
H5Dclose(did);
/*
/*
* Unmounting second file
*/
H5Funmount(fid1, "/G");
+30 -30
View File
@@ -12,22 +12,22 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* This example reads hyperslab from the SDS.h5 file
/*
* This example reads hyperslab from the SDS.h5 file
* created by h5_write.c program into two-dimensional
* plane of the three-dimensional array.
* Information about dataset in the SDS.h5 file is obtained.
* plane of the three-dimensional array.
* Information about dataset in the SDS.h5 file is obtained.
*/
#include "hdf5.h"
#define H5FILE_NAME "SDS.h5"
#define DATASETNAME "IntArray"
#define NX_SUB 3 /* hyperslab dimensions */
#define NY_SUB 4
#define NX 7 /* output buffer dimensions */
#define NY 7
#define NZ 3
#define DATASETNAME "IntArray"
#define NX_SUB 3 /* hyperslab dimensions */
#define NY_SUB 4
#define NX 7 /* output buffer dimensions */
#define NY 7
#define NZ 3
#define RANK 2
#define RANK_OUT 3
@@ -35,20 +35,20 @@ int
main (void)
{
hid_t file, dataset; /* handles */
hid_t datatype, dataspace;
hid_t memspace;
hid_t datatype, dataspace;
hid_t memspace;
H5T_class_t t_class; /* data type class */
H5T_order_t order; /* data order */
size_t size; /*
* size of the data element
* size of the data element
* stored in file
*/
hsize_t dimsm[3]; /* memory space dimensions */
hsize_t dims_out[2]; /* dataset dimensions */
herr_t status;
hsize_t dims_out[2]; /* dataset dimensions */
herr_t status;
int data_out[NX][NY][NZ ]; /* output buffer */
hsize_t count[2]; /* size of the hyperslab in the file */
hsize_t offset[2]; /* hyperslab offset in the file */
hsize_t count_out[3]; /* size of the hyperslab in memory */
@@ -60,8 +60,8 @@ main (void)
for (k = 0; k < NZ ; k++)
data_out[j][i][k] = 0;
}
}
}
/*
* Open the file and the dataset.
*/
@@ -72,7 +72,7 @@ main (void)
* Get datatype and dataspace handles and then query
* dataset class, order, size, rank and dimensions.
*/
datatype = H5Dget_type(dataset); /* datatype handle */
datatype = H5Dget_type(dataset); /* datatype handle */
t_class = H5Tget_class(datatype);
if (t_class == H5T_INTEGER) printf("Data set has INTEGER type \n");
order = H5Tget_order(datatype);
@@ -87,14 +87,14 @@ main (void)
printf("rank %d, dimensions %lu x %lu \n", rank,
(unsigned long)(dims_out[0]), (unsigned long)(dims_out[1]));
/*
* Define hyperslab in the dataset.
/*
* Define hyperslab in the dataset.
*/
offset[0] = 1;
offset[1] = 2;
count[0] = NX_SUB;
count[1] = NY_SUB;
status = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, NULL,
status = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, NULL,
count, NULL);
/*
@@ -103,10 +103,10 @@ main (void)
dimsm[0] = NX;
dimsm[1] = NY;
dimsm[2] = NZ ;
memspace = H5Screate_simple(RANK_OUT,dimsm,NULL);
memspace = H5Screate_simple(RANK_OUT,dimsm,NULL);
/*
* Define memory hyperslab.
/*
* Define memory hyperslab.
*/
offset_out[0] = 3;
offset_out[1] = 0;
@@ -114,11 +114,11 @@ main (void)
count_out[0] = NX_SUB;
count_out[1] = NY_SUB;
count_out[2] = 1;
status = H5Sselect_hyperslab(memspace, H5S_SELECT_SET, offset_out, NULL,
status = H5Sselect_hyperslab(memspace, H5S_SELECT_SET, offset_out, NULL,
count_out, NULL);
/*
* Read data from hyperslab in the file into the hyperslab in
* Read data from hyperslab in the file into the hyperslab in
* memory and display.
*/
status = H5Dread(dataset, H5T_NATIVE_INT, memspace, dataspace,
@@ -131,7 +131,7 @@ main (void)
* 0 0 0 0 0 0 0
* 0 0 0 0 0 0 0
* 0 0 0 0 0 0 0
* 3 4 5 6 0 0 0
* 3 4 5 6 0 0 0
* 4 5 6 7 0 0 0
* 5 6 7 8 0 0 0
* 0 0 0 0 0 0 0
@@ -147,4 +147,4 @@ main (void)
H5Fclose(file);
return 0;
}
}
+33 -33
View File
@@ -12,15 +12,15 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
/*
* This program illustrates how references to objects can be used.
* Program creates a dataset and a group in a file. It also creates
* second dataset, and references to the first dataset and the group
* Program creates a dataset and a group in a file. It also creates
* second dataset, and references to the first dataset and the group
* are stored in it.
* Program reopens the file and reads dataset with the references.
* References are used to open the objects. Information about the
* objects is displayed.
*/
*/
#include <stdlib.h>
@@ -30,38 +30,38 @@
int
main(void) {
hid_t fid; /* File, group, datasets, datatypes */
hid_t fid; /* File, group, datasets, datatypes */
hid_t gid_a; /* and dataspaces identifiers */
hid_t did_b, sid_b, tid_b;
hid_t did_b, sid_b, tid_b;
hid_t did_r, tid_r, sid_r;
herr_t status;
hobj_ref_t *wbuf; /* buffer to write to disk */
hobj_ref_t *rbuf; /* buffer to read from disk */
hsize_t dim_r[1];
hsize_t dim_r[1];
hsize_t dim_b[2];
/*
/*
* Create a file using default properties.
*/
fid = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
/*
/*
* Create group "A" in the file.
*/
gid_a = H5Gcreate(fid, "A", 0);
/*
/*
* Create dataset "B" in the file.
*/
dim_b[0] = 2;
dim_b[1] = 6;
sid_b = H5Screate_simple(2, dim_b, NULL);
sid_b = H5Screate_simple(2, dim_b, NULL);
did_b = H5Dcreate(fid, "B", H5T_NATIVE_FLOAT, sid_b, H5P_DEFAULT);
/*
/*
* Create dataset "R" to store references to the objects "A" and "B".
*/
dim_r[0] = 2;
@@ -69,62 +69,62 @@ main(void) {
tid_r = H5Tcopy(H5T_STD_REF_OBJ);
did_r = H5Dcreate(fid, "R", tid_r, sid_r, H5P_DEFAULT );
/*
/*
* Allocate write and read buffers.
*/
wbuf = (hobj_ref_t *)malloc(sizeof(hobj_ref_t)*2);
rbuf = (hobj_ref_t *)malloc(sizeof(hobj_ref_t)*2);
/*
* Create references to the group "A" and dataset "B"
* and store them in the wbuf.
*/
H5Rcreate(&wbuf[0], fid, "A", H5R_OBJECT, -1);
H5Rcreate(&wbuf[0], fid, "A", H5R_OBJECT, -1);
H5Rcreate(&wbuf[1], fid, "B", H5R_OBJECT, -1);
/*
/*
* Write dataset R using default transfer properties.
*/
status = H5Dwrite(did_r, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL,
H5P_DEFAULT, wbuf);
/*
* Close all objects.
/*
* Close all objects.
*/
H5Gclose(gid_a);
H5Sclose(sid_b);
H5Dclose(did_b);
H5Tclose(tid_r);
H5Sclose(sid_r);
H5Dclose(did_r);
H5Fclose(fid);
/*
/*
* Reopen the file.
*/
fid = H5Fopen(H5FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
/*
/*
* Open and read dataset "R".
*/
did_r = H5Dopen(fid, "R");
status = H5Dread(did_r, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL,
H5P_DEFAULT, rbuf);
/*
/*
* Find the type of referenced objects.
*/
status = H5Rget_obj_type(did_r, H5R_OBJECT, &rbuf[0]);
if ( status == H5G_GROUP )
if ( status == H5G_GROUP )
printf("First dereferenced object is a group. \n");
status = H5Rget_obj_type(did_r, H5R_OBJECT, &rbuf[1]);
if ( status == H5G_DATASET )
if ( status == H5G_DATASET )
printf("Second dereferenced object is a dataset. \n");
/*
/*
* Get datatype of the dataset "B"
*/
did_b = H5Rdereference(did_r, H5R_OBJECT, &rbuf[1]);
@@ -133,7 +133,7 @@ main(void) {
printf("Datatype of the dataset is H5T_NATIVE_FLOAT.\n");
printf("\n");
/*
/*
* Close all objects and free memory buffers.
*/
H5Dclose(did_r);
+81 -81
View File
@@ -12,42 +12,42 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
/*
* This program shows how the H5Sselect_hyperslab and H5Sselect_elements
* functions are used to write selected data from memory to the file.
* Program takes 48 elements from the linear buffer and writes them into
* the matrix using 3x2 blocks, (4,3) stride and (2,4) count.
* Then four elements of the matrix are overwritten with the new values and
* file is closed. Program reopens the file and selects the union of two
* the matrix using 3x2 blocks, (4,3) stride and (2,4) count.
* Then four elements of the matrix are overwritten with the new values and
* file is closed. Program reopens the file and selects the union of two
* hyperslabs in the dataset in the file. Then it reads the selection into the
* memory dataset preserving the shape of the selection.
*/
*/
#include "hdf5.h"
#define H5FILE_NAME "Select.h5"
#define MSPACE1_RANK 1 /* Rank of the first dataset in memory */
#define MSPACE1_DIM 50 /* Dataset size in memory */
#define MSPACE1_DIM 50 /* Dataset size in memory */
#define MSPACE2_RANK 1 /* Rank of the second dataset in memory */
#define MSPACE2_DIM 4 /* Dataset size in memory */
#define MSPACE2_RANK 1 /* Rank of the second dataset in memory */
#define MSPACE2_DIM 4 /* Dataset size in memory */
#define FSPACE_RANK 2 /* Dataset rank as it is stored in the file */
#define FSPACE_DIM1 8 /* Dimension sizes of the dataset as it is
stored in the file */
#define FSPACE_DIM2 12
#define FSPACE_DIM2 12
/* We will read dataset back from the file
to the dataset in memory with these
dataspace parameters. */
dataspace parameters. */
#define MSPACE_RANK 2
#define MSPACE_DIM1 8
#define MSPACE_DIM2 9
#define MSPACE_DIM1 8
#define MSPACE_DIM2 9
#define NPOINTS 4 /* Number of points that will be selected
and overwritten */
int
#define NPOINTS 4 /* Number of points that will be selected
and overwritten */
int
main (void)
{
@@ -55,13 +55,13 @@ main (void)
hid_t mid1, mid2, mid, fid; /* Dataspace identifiers */
hid_t plist; /* Dataset property list identifier */
hsize_t dim1[] = {MSPACE1_DIM}; /* Dimension size of the first dataset
(in memory) */
hsize_t dim1[] = {MSPACE1_DIM}; /* Dimension size of the first dataset
(in memory) */
hsize_t dim2[] = {MSPACE2_DIM}; /* Dimension size of the second dataset
(in memory */
hsize_t fdim[] = {FSPACE_DIM1, FSPACE_DIM2};
(in memory */
hsize_t fdim[] = {FSPACE_DIM1, FSPACE_DIM2};
/* Dimension sizes of the dataset (on disk) */
hsize_t mdim[] = {MSPACE_DIM1, MSPACE_DIM2}; /* Dimension sizes of the
hsize_t mdim[] = {MSPACE_DIM1, MSPACE_DIM2}; /* Dimension sizes of the
dataset in memory when we
read selection from the
dataset on the disk */
@@ -71,13 +71,13 @@ main (void)
hsize_t count[2]; /* Block count */
hsize_t block[2]; /* Block sizes */
hsize_t coord[NPOINTS][FSPACE_RANK]; /* Array to store selected points
from the file dataspace */
hsize_t coord[NPOINTS][FSPACE_RANK]; /* Array to store selected points
from the file dataspace */
herr_t ret;
unsigned i,j;
int fillvalue = 0; /* Fill value for the dataset */
int matrix_out[MSPACE_DIM1][MSPACE_DIM2]; /* Buffer to read from the
int matrix_out[MSPACE_DIM1][MSPACE_DIM2]; /* Buffer to read from the
dataset */
int vector[MSPACE1_DIM];
int values[] = {53, 59, 61, 67}; /* New values to be written */
@@ -97,9 +97,9 @@ main (void)
* Create property list for a dataset and set up fill values.
*/
plist = H5Pcreate(H5P_DATASET_CREATE);
ret = H5Pset_fill_value(plist, H5T_NATIVE_INT, &fillvalue);
ret = H5Pset_fill_value(plist, H5T_NATIVE_INT, &fillvalue);
/*
/*
* Create dataspace for the dataset in the file.
*/
fid = H5Screate_simple(FSPACE_RANK, fdim, NULL);
@@ -111,12 +111,12 @@ main (void)
dataset = H5Dcreate(file, "Matrix in file", H5T_NATIVE_INT, fid, plist);
/*
* Select hyperslab for the dataset in the file, using 3x2 blocks,
* Select hyperslab for the dataset in the file, using 3x2 blocks,
* (4,3) stride and (2,4) count starting at the position (0,1).
*/
start[0] = 0; start[1] = 1;
stride[0] = 4; stride[1] = 3;
count[0] = 2; count[1] = 4;
count[0] = 2; count[1] = 4;
block[0] = 3; block[1] = 2;
ret = H5Sselect_hyperslab(fid, H5S_SELECT_SET, start, stride, count, block);
@@ -126,7 +126,7 @@ main (void)
mid1 = H5Screate_simple(MSPACE1_RANK, dim1, NULL);
/*
* Select hyperslab.
* Select hyperslab.
* We will use 48 elements of the vector buffer starting at the second element.
* Selected elements are 1 2 3 . . . 48
*/
@@ -135,12 +135,12 @@ main (void)
count[0] = 48;
block[0] = 1;
ret = H5Sselect_hyperslab(mid1, H5S_SELECT_SET, start, stride, count, block);
/*
* Write selection from the vector buffer to the dataset in the file.
*
* File dataset should look like this:
* 0 1 2 0 3 4 0 5 6 0 7 8
* File dataset should look like this:
* 0 1 2 0 3 4 0 5 6 0 7 8
* 0 9 10 0 11 12 0 13 14 0 15 16
* 0 17 18 0 19 20 0 21 22 0 23 24
* 0 0 0 0 0 0 0 0 0 0 0 0
@@ -169,17 +169,17 @@ main (void)
coord[2][0] = 3; coord[2][1] = 5;
coord[3][0] = 5; coord[3][1] = 6;
ret = H5Sselect_elements(fid, H5S_SELECT_SET, NPOINTS,
ret = H5Sselect_elements(fid, H5S_SELECT_SET, NPOINTS,
(const hsize_t **)coord);
/*
* Write new selection of points to the dataset.
*/
ret = H5Dwrite(dataset, H5T_NATIVE_INT, mid2, fid, H5P_DEFAULT, values);
ret = H5Dwrite(dataset, H5T_NATIVE_INT, mid2, fid, H5P_DEFAULT, values);
/*
* File dataset should look like this:
* 53 1 2 0 3 4 0 5 6 0 7 8
* File dataset should look like this:
* 53 1 2 0 3 4 0 5 6 0 7 8
* 0 9 10 0 11 12 0 13 14 0 15 16
* 0 17 18 0 19 20 0 21 22 0 23 24
* 0 0 0 59 0 61 0 0 0 0 0 0
@@ -187,16 +187,16 @@ main (void)
* 0 33 34 0 35 36 67 37 38 0 39 40
* 0 41 42 0 43 44 0 45 46 0 47 48
* 0 0 0 0 0 0 0 0 0 0 0 0
*
*
*/
/*
* Close memory file and memory dataspaces.
*/
ret = H5Sclose(mid1);
ret = H5Sclose(mid2);
ret = H5Sclose(fid);
ret = H5Sclose(mid1);
ret = H5Sclose(mid2);
ret = H5Sclose(fid);
/*
* Close dataset.
*/
@@ -216,8 +216,8 @@ main (void)
* Open the dataset.
*/
dataset = H5Dopen(file,"Matrix in file");
/*
/*
* Get dataspace of the open dataset.
*/
fid = H5Dget_space(dataset);
@@ -225,7 +225,7 @@ main (void)
/*
* Select first hyperslab for the dataset in the file. The following
* elements are selected:
* 10 0 11 12
* 10 0 11 12
* 18 0 19 20
* 0 59 0 61
*
@@ -233,50 +233,50 @@ main (void)
start[0] = 1; start[1] = 2;
block[0] = 1; block[1] = 1;
stride[0] = 1; stride[1] = 1;
count[0] = 3; count[1] = 4;
count[0] = 3; count[1] = 4;
ret = H5Sselect_hyperslab(fid, H5S_SELECT_SET, start, stride, count, block);
/*
* Add second selected hyperslab to the selection.
/*
* Add second selected hyperslab to the selection.
* The following elements are selected:
* 19 20 0 21 22
* 0 61 0 0 0
* 27 28 0 29 30
* 35 36 67 37 38
* 19 20 0 21 22
* 0 61 0 0 0
* 27 28 0 29 30
* 35 36 67 37 38
* 43 44 0 45 46
* 0 0 0 0 0
* Note that two hyperslabs overlap. Common elements are:
* Note that two hyperslabs overlap. Common elements are:
* 19 20
* 0 61
*/
start[0] = 2; start[1] = 4;
block[0] = 1; block[1] = 1;
start[0] = 2; start[1] = 4;
block[0] = 1; block[1] = 1;
stride[0] = 1; stride[1] = 1;
count[0] = 6; count[1] = 5;
count[0] = 6; count[1] = 5;
ret = H5Sselect_hyperslab(fid, H5S_SELECT_OR, start, stride, count, block);
/*
* Create memory dataspace.
*/
mid = H5Screate_simple(MSPACE_RANK, mdim, NULL);
/*
/*
* Select two hyperslabs in memory. Hyperslabs has the same
* size and shape as the selected hyperslabs for the file dataspace.
*/
start[0] = 0; start[1] = 0;
block[0] = 1; block[1] = 1;
start[0] = 0; start[1] = 0;
block[0] = 1; block[1] = 1;
stride[0] = 1; stride[1] = 1;
count[0] = 3; count[1] = 4;
count[0] = 3; count[1] = 4;
ret = H5Sselect_hyperslab(mid, H5S_SELECT_SET, start, stride, count, block);
start[0] = 1; start[1] = 2;
block[0] = 1; block[1] = 1;
start[0] = 1; start[1] = 2;
block[0] = 1; block[1] = 1;
stride[0] = 1; stride[1] = 1;
count[0] = 6; count[1] = 5;
count[0] = 6; count[1] = 5;
ret = H5Sselect_hyperslab(mid, H5S_SELECT_OR, start, stride, count, block);
/*
/*
* Initialize data buffer.
*/
for (i = 0; i < MSPACE_DIM1; i++) {
@@ -290,16 +290,16 @@ main (void)
H5P_DEFAULT, matrix_out);
/*
* Display the result. Memory dataset is:
*
* 10 0 11 12 0 0 0 0 0
* 18 0 19 20 0 21 22 0 0
* 0 59 0 61 0 0 0 0 0
* 0 0 27 28 0 29 30 0 0
* 0 0 35 36 67 37 38 0 0
* 0 0 43 44 0 45 46 0 0
* 0 0 0 0 0 0 0 0 0
* 0 0 0 0 0 0 0 0 0
* Display the result. Memory dataset is:
*
* 10 0 11 12 0 0 0 0 0
* 18 0 19 20 0 21 22 0 0
* 0 59 0 61 0 0 0 0 0
* 0 0 27 28 0 29 30 0 0
* 0 0 35 36 67 37 38 0 0
* 0 0 43 44 0 45 46 0 0
* 0 0 0 0 0 0 0 0 0
* 0 0 0 0 0 0 0 0 0
*/
for (i=0; i < MSPACE_DIM1; i++) {
for(j=0; j < MSPACE_DIM2; j++) printf("%3d ", matrix_out[i][j]);
@@ -308,23 +308,23 @@ main (void)
/*
* Close memory file and memory dataspaces.
*/
*/
ret = H5Sclose(mid);
ret = H5Sclose(fid);
/*
* Close dataset.
*/
*/
ret = H5Dclose(dataset);
/*
* Close property list
*/
ret = H5Pclose(plist);
/*
* Close the file.
*/
*/
ret = H5Fclose(file);
return 0;
+14 -14
View File
@@ -12,15 +12,15 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
/*
* This example writes data to the HDF5 file.
* Data conversion is performed during write operation.
* Data conversion is performed during write operation.
*/
#include "hdf5.h"
#define H5FILE_NAME "SDS.h5"
#define DATASETNAME "IntArray"
#define DATASETNAME "IntArray"
#define NX 5 /* dataset dimensions */
#define NY 6
#define RANK 2
@@ -31,19 +31,19 @@ main (void)
hid_t file, dataset; /* file and dataset handles */
hid_t datatype, dataspace; /* handles */
hsize_t dimsf[2]; /* dataset dimensions */
herr_t status;
herr_t status;
int data[NX][NY]; /* data to write */
int i, j;
/*
* Data and output buffer initialization.
/*
* Data and output buffer initialization.
*/
for (j = 0; j < NX; j++) {
for (i = 0; i < NY; i++)
data[j][i] = i + j;
}
}
/*
* 0 1 2 3 4 5
* 0 1 2 3 4 5
* 1 2 3 4 5 6
* 2 3 4 5 6 7
* 3 4 5 6 7 8
@@ -59,13 +59,13 @@ main (void)
/*
* Describe the size of the array and create the data space for fixed
* size dataset.
* size dataset.
*/
dimsf[0] = NX;
dimsf[1] = NY;
dataspace = H5Screate_simple(RANK, dimsf, NULL);
dataspace = H5Screate_simple(RANK, dimsf, NULL);
/*
/*
* Define datatype for the data in the file.
* We will store little endian INT numbers.
*/
@@ -92,6 +92,6 @@ main (void)
H5Tclose(datatype);
H5Dclose(dataset);
H5Fclose(file);
return 0;
}
}
+42 -42
View File
@@ -26,7 +26,7 @@
* each dataset in an independent mode and prints them out.
* All processes collectively close the datasets and the file.
*
* The need of requirement of parallel file prefix is that in general
* The need of requirement of parallel file prefix is that in general
* the current working directory in which compiling is done, is not suitable
* for parallel I/O and there is no standard pathname for parallel file
* systems. In some cases, the parallel file name may even needs some
@@ -250,7 +250,7 @@ phdf5writeInd(char *filename)
hsize_t count[SPACE1_RANK], stride[SPACE1_RANK]; /* for hyperslab setting */
herr_t ret; /* Generic return value */
MPI_Comm comm = MPI_COMM_WORLD;
MPI_Info info = MPI_INFO_NULL;
@@ -258,14 +258,14 @@ phdf5writeInd(char *filename)
printf("Independent write test on file %s\n", filename);
/* -------------------
* START AN HDF5 FILE
* START AN HDF5 FILE
* -------------------*/
/* setup file access template with parallel IO access. */
acc_tpl1 = H5Pcreate (H5P_FILE_ACCESS);
assert(acc_tpl1 != FAIL);
MESG("H5Pcreate access succeed");
/* set Parallel access with communicator */
ret = H5Pset_fapl_mpio(acc_tpl1, comm, info);
ret = H5Pset_fapl_mpio(acc_tpl1, comm, info);
assert(ret != FAIL);
MESG("H5Pset_fapl_mpio succeed");
@@ -288,7 +288,7 @@ phdf5writeInd(char *filename)
assert (sid1 != FAIL);
MESG("H5Screate_simple succeed");
/* create a dataset collectively */
dataset1 = H5Dcreate(fid1, DATASETNAME1, H5T_NATIVE_INT, sid1,
H5P_DEFAULT);
@@ -321,8 +321,8 @@ if (verbose)
MESG("data_array initialized");
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset1);
assert(file_dataspace != FAIL);
file_dataspace = H5Dget_space (dataset1);
assert(file_dataspace != FAIL);
MESG("H5Dget_space succeed");
ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride,
count, NULL);
@@ -334,21 +334,21 @@ if (verbose)
assert (mem_dataspace != FAIL);
/* write data independently */
ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
H5P_DEFAULT, data_array1);
ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
H5P_DEFAULT, data_array1);
assert(ret != FAIL);
MESG("H5Dwrite succeed");
/* write data independently */
ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
H5P_DEFAULT, data_array1);
ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
H5P_DEFAULT, data_array1);
assert(ret != FAIL);
MESG("H5Dwrite succeed");
/* release dataspace ID */
H5Sclose(file_dataspace);
/* close dataset collectively */
/* close dataset collectively */
ret=H5Dclose(dataset1);
assert(ret != FAIL);
MESG("H5Dclose1 succeed");
@@ -359,8 +359,8 @@ if (verbose)
/* release all IDs created */
H5Sclose(sid1);
/* close the file collectively */
H5Fclose(fid1);
/* close the file collectively */
H5Fclose(fid1);
}
/* Example of using the parallel HDF5 library to read a dataset */
@@ -390,7 +390,7 @@ phdf5readInd(char *filename)
acc_tpl1 = H5Pcreate (H5P_FILE_ACCESS);
assert(acc_tpl1 != FAIL);
/* set Parallel access with communicator */
ret = H5Pset_fapl_mpio(acc_tpl1, comm, info);
ret = H5Pset_fapl_mpio(acc_tpl1, comm, info);
assert(ret != FAIL);
@@ -497,7 +497,7 @@ phdf5writeAll(char *filename)
hsize_t count[SPACE1_RANK], stride[SPACE1_RANK]; /* for hyperslab setting */
herr_t ret; /* Generic return value */
MPI_Comm comm = MPI_COMM_WORLD;
MPI_Info info = MPI_INFO_NULL;
@@ -505,14 +505,14 @@ phdf5writeAll(char *filename)
printf("Collective write test on file %s\n", filename);
/* -------------------
* START AN HDF5 FILE
* START AN HDF5 FILE
* -------------------*/
/* setup file access template with parallel IO access. */
acc_tpl1 = H5Pcreate (H5P_FILE_ACCESS);
assert(acc_tpl1 != FAIL);
MESG("H5Pcreate access succeed");
/* set Parallel access with communicator */
ret = H5Pset_fapl_mpio(acc_tpl1, comm, info);
ret = H5Pset_fapl_mpio(acc_tpl1, comm, info);
assert(ret != FAIL);
MESG("H5Pset_fapl_mpio succeed");
@@ -535,7 +535,7 @@ phdf5writeAll(char *filename)
assert (sid1 != FAIL);
MESG("H5Screate_simple succeed");
/* create a dataset collectively */
dataset1 = H5Dcreate(fid1, DATASETNAME1, H5T_NATIVE_INT, sid1, H5P_DEFAULT);
assert(dataset1 != FAIL);
@@ -559,8 +559,8 @@ if (verbose)
(unsigned long)(count[0]*count[1]));
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset1);
assert(file_dataspace != FAIL);
file_dataspace = H5Dget_space (dataset1);
assert(file_dataspace != FAIL);
MESG("H5Dget_space succeed");
ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride,
count, NULL);
@@ -588,7 +588,7 @@ if (verbose)
/* write data collectively */
ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
xfer_plist, data_array1);
xfer_plist, data_array1);
assert(ret != FAIL);
MESG("H5Dwrite succeed");
@@ -616,8 +616,8 @@ if (verbose)
}
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset1);
assert(file_dataspace != FAIL);
file_dataspace = H5Dget_space (dataset1);
assert(file_dataspace != FAIL);
MESG("H5Dget_space succeed");
ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride,
count, NULL);
@@ -645,7 +645,7 @@ if (verbose)
/* write data independently */
ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
xfer_plist, data_array1);
xfer_plist, data_array1);
assert(ret != FAIL);
MESG("H5Dwrite succeed");
@@ -657,7 +657,7 @@ if (verbose)
/*
* All writes completed. Close datasets collectively
*/
*/
ret=H5Dclose(dataset1);
assert(ret != FAIL);
MESG("H5Dclose1 succeed");
@@ -668,8 +668,8 @@ if (verbose)
/* release all IDs created */
H5Sclose(sid1);
/* close the file collectively */
H5Fclose(fid1);
/* close the file collectively */
H5Fclose(fid1);
}
/*
@@ -705,14 +705,14 @@ phdf5readAll(char *filename)
printf("Collective read test on file %s\n", filename);
/* -------------------
* OPEN AN HDF5 FILE
* OPEN AN HDF5 FILE
* -------------------*/
/* setup file access template with parallel IO access. */
acc_tpl1 = H5Pcreate (H5P_FILE_ACCESS);
assert(acc_tpl1 != FAIL);
MESG("H5Pcreate access succeed");
/* set Parallel access with communicator */
ret = H5Pset_fapl_mpio(acc_tpl1, comm, info);
ret = H5Pset_fapl_mpio(acc_tpl1, comm, info);
assert(ret != FAIL);
MESG("H5Pset_fapl_mpio succeed");
@@ -752,8 +752,8 @@ if (verbose)
(unsigned long)(count[0]*count[1]));
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset1);
assert(file_dataspace != FAIL);
file_dataspace = H5Dget_space (dataset1);
assert(file_dataspace != FAIL);
MESG("H5Dget_space succeed");
ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride,
count, NULL);
@@ -781,7 +781,7 @@ if (verbose)
/* read data collectively */
ret = H5Dread(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
xfer_plist, data_array1);
xfer_plist, data_array1);
assert(ret != FAIL);
MESG("H5Dread succeed");
@@ -805,8 +805,8 @@ if (verbose)
(unsigned long)(count[0]*count[1]));
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset1);
assert(file_dataspace != FAIL);
file_dataspace = H5Dget_space (dataset1);
assert(file_dataspace != FAIL);
MESG("H5Dget_space succeed");
ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride,
count, NULL);
@@ -834,7 +834,7 @@ if (verbose)
/* read data independently */
ret = H5Dread(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
xfer_plist, data_array1);
xfer_plist, data_array1);
assert(ret != FAIL);
MESG("H5Dread succeed");
@@ -850,7 +850,7 @@ if (verbose)
/*
* All reads completed. Close datasets collectively
*/
*/
ret=H5Dclose(dataset1);
assert(ret != FAIL);
MESG("H5Dclose1 succeed");
@@ -858,8 +858,8 @@ if (verbose)
assert(ret != FAIL);
MESG("H5Dclose2 succeed");
/* close the file collectively */
H5Fclose(fid1);
/* close the file collectively */
H5Fclose(fid1);
}
/*
@@ -903,9 +903,9 @@ test_split_comm_access(char filenames[][PATH_MAX])
/* setup file access template */
acc_tpl = H5Pcreate (H5P_FILE_ACCESS);
assert(acc_tpl != FAIL);
/* set Parallel access with communicator */
ret = H5Pset_fapl_mpio(acc_tpl, comm, info);
ret = H5Pset_fapl_mpio(acc_tpl, comm, info);
assert(ret != FAIL);
/* create the file collectively */
@@ -1055,7 +1055,7 @@ cleanup(void)
int
main(int argc, char **argv)
{
int mpi_namelen;
int mpi_namelen;
char mpi_name[MPI_MAX_PROCESSOR_NAME];
int i, n;
+40 -40
View File
@@ -19,9 +19,9 @@
/*----------------------------------------------------------------------------
* Name: h5acreate_c
* Purpose: Call H5Acreate to create an attribute
* Inputs: obj_id - object identifier
* name - name of the attribute
* Purpose: Call H5Acreate to create an attribute
* Inputs: obj_id - object identifier
* name - name of the attribute
* namelen - name length
* type_id - datatype identifier
* space_id - dataspace identifier
@@ -53,13 +53,13 @@ nh5acreate_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *type_id, h
done:
if(c_name) HDfree(c_name);
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5aopen_name _c
* Purpose: Call H5Aopen_name to open an attribute
* Inputs: obj_id - object identifier
* name - name of the attribute
* Purpose: Call H5Aopen_name to open an attribute
* Inputs: obj_id - object identifier
* name - name of the attribute
* namelen - name length
* Outputs: attr_id - dataset identifier
* Returns: 0 on success, -1 on failure
@@ -88,12 +88,12 @@ nh5aopen_name_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *attr_id
done:
if(c_name) HDfree(c_name);
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5awritec_c
* Purpose: Call h5awrite_c to write a character attribute
* Inputs: attr_id - dataset identifier
* Inputs: attr_id - dataset identifier
* mem_type_id - memory datatype identifier
* buf - character data buffer
* dims - array to store dimensions sizes of buf; used only
@@ -115,8 +115,8 @@ nh5awritec_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims)
/*----------------------------------------------------------------------------
* Name: h5awrite_c
* Purpose: Call H5Awrite to write a attribute
* Inputs: attr_id - attribute identifier
* Purpose: Call H5Awrite to write a attribute
* Inputs: attr_id - attribute identifier
* mem_type_id - memory datatype identifier
* buf - data buffer
* dims - array to store dimensions sizes of buf; used only
@@ -125,7 +125,7 @@ nh5awritec_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims)
* Programmer: Elena Pourmal
* Thursday, August 12, 1999
* Modifications: dims parameter added
* April 4, 2001
* April 4, 2001
*---------------------------------------------------------------------------*/
int_f
nh5awrite_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims)
@@ -140,12 +140,12 @@ nh5awrite_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dim
done:
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5areadc_c
* Purpose: Call h5aread_c to read character attribute
* Inputs: dset_id - dataset identifier
* Inputs: dset_id - dataset identifier
* mem_type_id - memory datatype identifier
* dims - array to store dimensions sizes of buf; used only
* by Fortran routine.
@@ -167,8 +167,8 @@ nh5areadc_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims)
/*----------------------------------------------------------------------------
* Name: h5aread_c
* Purpose: Call H5Aread to read an attribute
* Inputs: dset_id - dataset identifier
* Purpose: Call H5Aread to read an attribute
* Inputs: dset_id - dataset identifier
* mem_type_id - memory datatype identifier
* dims - array to store dimensions sizes of buf; used only
* by Fortran routine.
@@ -196,7 +196,7 @@ done:
/*----------------------------------------------------------------------------
* Name: h5aclose_c
* Purpose: Call H5Aclose to close an attribute
* Purpose: Call H5Aclose to close an attribute
* Inputs: attr_id - identifier of an attribute to be closed
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -204,7 +204,7 @@ done:
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5aclose_c ( hid_t_f *attr_id )
{
int_f ret_value=0; /* Return value */
@@ -218,9 +218,9 @@ done:
/*----------------------------------------------------------------------------
* Name: h5adelete_c
* Purpose: Call H5Adelete to delete an attribute
* Inputs: obj_id - object identifier
* name - name of the attribute
* Purpose: Call H5Adelete to delete an attribute
* Inputs: obj_id - object identifier
* name - name of the attribute
* namelen - name length
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -248,13 +248,13 @@ nh5adelete_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen)
done:
if(c_name) HDfree(c_name);
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5aopen_idx_c
* Purpose: Call H5Aopen_idx to open an attribute
* Inputs: obj_id - object identifier
* Purpose: Call H5Aopen_idx to open an attribute
* Inputs: obj_id - object identifier
* idx - attribute index ( zero based)
* Outputs: attr_id - attribute identifier
* Returns: 0 on success, -1 on failure
@@ -275,13 +275,13 @@ nh5aopen_idx_c (hid_t_f *obj_id, int_f *idx, hid_t_f *attr_id)
done:
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5aget_space_c
* Purpose: Call H5Aget_space to get attribute's dataspace
* Inputs: attr_id - attribute identifier
* Purpose: Call H5Aget_space to get attribute's dataspace
* Inputs: attr_id - attribute identifier
* Outputs: space_id - dataspace identifier
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -301,12 +301,12 @@ nh5aget_space_c (hid_t_f *attr_id, hid_t_f *space_id)
done:
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5aget_type_c
* Purpose: Call H5Aget_space to get attribute's datatype
* Inputs: attr_id - attribute identifier
* Purpose: Call H5Aget_space to get attribute's datatype
* Inputs: attr_id - attribute identifier
* Outputs: type_id - datatype identifier
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -326,14 +326,14 @@ nh5aget_type_c (hid_t_f *attr_id, hid_t_f *type_id)
done:
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5aget_num_attrs_c
* Purpose: Call H5Aget_num_attrs to determine number of
* attributes of an object
* Inputs: obj_id - object identifier
* attr_num - number of attributes
* Purpose: Call H5Aget_num_attrs to determine number of
* attributes of an object
* Inputs: obj_id - object identifier
* attr_num - number of attributes
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Thursday, August 12, 1999
@@ -352,13 +352,13 @@ nh5aget_num_attrs_c (hid_t_f *obj_id, int_f *attr_num)
done:
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5aget_name_c
* Purpose: Call H5Aget_name to get attribute's name
* Inputs: attr_id - attribute identifier
* bufsize -size of the buffer
* Purpose: Call H5Aget_name to get attribute's name
* Inputs: attr_id - attribute identifier
* bufsize -size of the buffer
* Outputs: buf - buffer to hold the name
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -376,7 +376,7 @@ nh5aget_name_c(hid_t_f *attr_id, size_t_f *bufsize, _fcd buf)
*/
if ((c_buf = HDmalloc((size_t)*bufsize +1)) == NULL)
HGOTO_DONE(FAIL);
/*
* Call H5Aget_name function
*/
+132 -132
View File
@@ -18,9 +18,9 @@
/*----------------------------------------------------------------------------
* Name: h5dcreate_c
* Purpose: Call H5Dcreate to create a dataset
* Inputs: loc_id - file or group identifier
* name - name of the dataset
* Purpose: Call H5Dcreate to create a dataset
* Inputs: loc_id - file or group identifier
* name - name of the dataset
* namelen - name length
* type_id - datatype identifier
* space_id - dataspace identifier
@@ -42,7 +42,7 @@ nh5dcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_
hid_t c_space_id;
hid_t c_dset_id;
hid_t c_crt_prp;
/*
* Define creation property
*/
@@ -52,7 +52,7 @@ nh5dcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_
* Convert FORTRAN name to C name
*/
c_namelen = *namelen;
c_name = (char *)HD5f2cstring(name, c_namelen);
c_name = (char *)HD5f2cstring(name, c_namelen);
if (c_name == NULL) return ret_value;
/*
@@ -69,13 +69,13 @@ nh5dcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_
DONE:
HDfree(c_name);
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5dopen_c
* Purpose: Call H5Dopen to open a dataset
* Inputs: loc_id - file or group identifier
* name - name of the dataset
* Purpose: Call H5Dopen to open a dataset
* Inputs: loc_id - file or group identifier
* name - name of the dataset
* namelen - name length
* Outputs: dset_id - dataset identifier
* Returns: 0 on success, -1 on failure
@@ -99,7 +99,7 @@ nh5dopen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *dset_id)
* Convert FORTRAN name to C name
*/
c_namelen = *namelen;
c_name = (char *)HD5f2cstring(name, c_namelen);
c_name = (char *)HD5f2cstring(name, c_namelen);
if (c_name == NULL) return ret_value;
/*
@@ -115,12 +115,12 @@ nh5dopen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *dset_id)
DONE:
HDfree(c_name);
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5dwritec_c
* Purpose: Call h5dwrite_c to write a dataset of characters
* Inputs: dset_id - dataset identifier
* Purpose: Call h5dwrite_c to write a dataset of characters
* Inputs: dset_id - dataset identifier
* mem_type_id - memory datatype identifier
* mem_space_id - memory dataspace identifier
* file_space_id - memory dataspace identifier
@@ -136,7 +136,7 @@ int_f
nh5dwritec_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims)
{
int ret_value = -1;
/*
* Call h5dwrite_c function.
*/
@@ -147,8 +147,8 @@ nh5dwritec_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid
/*----------------------------------------------------------------------------
* Name: h5dwrite_c
* Purpose: Call H5Dwrite to write a dataset
* Inputs: dset_id - dataset identifier
* Purpose: Call H5Dwrite to write a dataset
* Inputs: dset_id - dataset identifier
* mem_type_id - memory datatype identifier
* mem_space_id - memory dataspace identifier
* file_space_id - memory dataspace identifier
@@ -175,7 +175,7 @@ nh5dwrite_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_
* Define transfer property
*/
c_xfer_prp = (hid_t)*xfer_prp;
/*
* Call H5Dwrite function.
*/
@@ -188,19 +188,19 @@ nh5dwrite_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_
if (ret < 0) return ret_value;
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5dwrite_ref_obj_c
* Purpose: Call H5Dwrite to write a dataset of object references
* Inputs: dset_id - dataset identifier
* Inputs: dset_id - dataset identifier
* mem_type_id - memory datatype identifier
* mem_space_id - memory dataspace identifier
* file_space_id - memory dataspace identifier
* xfer_pr - identifier of transfer property list
* buf - data buffer with references to the objects.
* n - number of references to be stored.
* n - number of references to be stored.
* Returns: 0 on success,e-1 on failure
* Programmer: Elena Pourmal
* Tuesday, May 14, 2002
@@ -233,9 +233,9 @@ nh5dwrite_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_
if ( buf_c != NULL ) {
for (i = 0; i < n; i++)
HDmemcpy(&buf_c[i], &buf[i], sizeof(haddr_t));
}
}
else return ret_value;
/*
* Call H5Dwrite function.
*/
@@ -253,13 +253,13 @@ nh5dwrite_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_
/*----------------------------------------------------------------------------
* Name: h5dwrite_ref_reg_c
* Purpose: Call H5Dwrite to write a dataset of dataset region references
* Inputs: dset_id - dataset identifier
* Inputs: dset_id - dataset identifier
* mem_type_id - memory datatype identifier
* mem_space_id - memory dataspace identifier
* file_space_id - memory dataspace identifier
* xfer_pr - identifier of transfer property list
* buf - data buffer with references to the objects.
* n - number of references to be stored.
* n - number of references to be stored.
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Tuesday, May 14, 2002
@@ -284,7 +284,7 @@ nh5dwrite_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_
* Define transfer property
*/
c_xfer_prp = (hid_t)*xfer_prp;
/*
* Allocate temporary buffer and copy references from Fortran.
*/
@@ -294,10 +294,10 @@ nh5dwrite_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_
HDmemcpy(&buf_c[i], buf, H5R_DSET_REG_REF_BUF_SIZE);
buf = buf + REF_REG_BUF_LEN_F;
}
}
}
else return ret_value;
/*
* Call H5Dwrite function.
*/
@@ -310,14 +310,14 @@ nh5dwrite_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_
if (ret < 0) return ret_value;
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5dreadc_c
* Purpose: Call h5dread_c to read a dataset of characters
* Inputs: dset_id - dataset identifier
* Purpose: Call h5dread_c to read a dataset of characters
* Inputs: dset_id - dataset identifier
* mem_type_id - memory datatype identifier
* mem_space_id - memory dataspace identifier
* file_space_id - memory dataspace identifier
@@ -333,7 +333,7 @@ int_f
nh5dreadc_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims)
{
int ret_value = -1;
/*
* Call h5dread_c function.
*/
@@ -344,8 +344,8 @@ nh5dreadc_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_
/*----------------------------------------------------------------------------
* Name: h5dread_c
* Purpose: Call H5Draed to read a dataset
* Inputs: dset_id - dataset identifier
* Purpose: Call H5Draed to read a dataset
* Inputs: dset_id - dataset identifier
* mem_type_id - memory datatype identifier
* mem_space_id - memory dataspace identifier
* file_space_id - memory dataspace identifier
@@ -372,7 +372,7 @@ nh5dread_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t
* Define transfer property
*/
c_xfer_prp = (hid_t)*xfer_prp;
/*
* Call H5Dread function.
*/
@@ -390,13 +390,13 @@ nh5dread_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t
/*----------------------------------------------------------------------------
* Name: h5dread_ref_obj_c
* Purpose: Call H5Dread to read a dataset of object references
* Inputs: dset_id - dataset identifier
* Inputs: dset_id - dataset identifier
* mem_type_id - memory datatype identifier
* mem_space_id - memory dataspace identifier
* file_space_id - memory dataspace identifier
* xfer_pr - identifier of transfer property list
* buf - data buffer to store references to the objects.
* n - number of references to be stored.
* n - number of references to be stored.
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Wednesday, May 15, 2002
@@ -420,7 +420,7 @@ nh5dread_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i
* Define transfer property
*/
c_xfer_prp = (hid_t)*xfer_prp;
/*
* Allocate temporary buffer.
*/
@@ -440,7 +440,7 @@ nh5dread_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i
HDmemcpy(&buf[i], &buf_c[i], sizeof(haddr_t));
}
if ( buf_c != NULL ) HDfree(buf_c);
}
}
if (ret < 0) return ret_value;
ret_value = 0;
return ret_value;
@@ -449,13 +449,13 @@ nh5dread_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i
/*----------------------------------------------------------------------------
* Name: h5dread_ref_reg_c
* Purpose: Call H5Dread to read a dataset of dataset region references
* Inputs: dset_id - dataset identifier
* Inputs: dset_id - dataset identifier
* mem_type_id - memory datatype identifier
* mem_space_id - memory dataspace identifier
* file_space_id - memory dataspace identifier
* xfer_pr - identifier of transfer property list
* buf - data buffer to store references to the objects.
* n - number of references to be stored.
* n - number of references to be stored.
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Wednesday, May 15, 2002
@@ -479,7 +479,7 @@ nh5dread_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i
* Define transfer property
*/
c_xfer_prp = (hid_t)*xfer_prp;
/*
* Allocate temporary buffer.
*/
@@ -497,20 +497,20 @@ nh5dread_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i
for (i = 0; i < n; i++) {
HDmemcpy(buf, &buf_c[i], H5R_DSET_REG_REF_BUF_SIZE);
buf = buf + REF_REG_BUF_LEN_F;
}
}
}
if ( buf_c != NULL ) HDfree(buf_c);
}
}
if (ret < 0) return ret_value;
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5dclose_c
* Purpose: Call H5Dclose to close a dataset
* Purpose: Call H5Dclose to close a dataset
* Inputs: dset_id - identifier of the dataset to be closed
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -530,7 +530,7 @@ nh5dclose_c ( hid_t_f *dset_id )
/*----------------------------------------------------------------------------
* Name: h5dget_space_c
* Purpose: Call H5Dget_space to obtain dataspace of a dataset
* Purpose: Call H5Dget_space to obtain dataspace of a dataset
* Inputs: dset_id - identifier of the dataset
* Outputs: space_id - identifier of the dataset's dataspace
* Returns: 0 on success, -1 on failure
@@ -539,14 +539,14 @@ nh5dclose_c ( hid_t_f *dset_id )
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5dget_space_c ( hid_t_f *dset_id , hid_t_f *space_id)
{
int ret_value = -1;
hid_t c_dset_id;
hid_t c_space_id;
c_dset_id = (hid_t)*dset_id;
c_dset_id = (hid_t)*dset_id;
c_space_id = H5Dget_space(c_dset_id);
if(c_space_id < 0 ) return ret_value;
ret_value = 0;
@@ -556,7 +556,7 @@ nh5dget_space_c ( hid_t_f *dset_id , hid_t_f *space_id)
/*----------------------------------------------------------------------------
* Name: h5dget_type_c
* Purpose: Call H5Dget_type to obtain datatype of a dataset
* Purpose: Call H5Dget_type to obtain datatype of a dataset
* Inputs: dset_id - identifier of the dataset
* Outputs: type_id - identifier of the dataset's datatype
* Returns: 0 on success, -1 on failure
@@ -565,13 +565,13 @@ nh5dget_space_c ( hid_t_f *dset_id , hid_t_f *space_id)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5dget_type_c ( hid_t_f *dset_id , hid_t_f *type_id)
{
int ret_value = -1;
hid_t c_dset_id;
hid_t c_type_id;
c_dset_id = (hid_t)*dset_id;
c_type_id = H5Dget_type(c_dset_id);
@@ -585,7 +585,7 @@ nh5dget_type_c ( hid_t_f *dset_id , hid_t_f *type_id)
/*----------------------------------------------------------------------------
* Name: h5dget_create_plist_c
* Purpose: Call H5Dget_create_plist to obtain creation property list
* of a dataset
* of a dataset
* Inputs: dset_id - identifier of the dataset
* Outputs: plist_id - identifier of he dataset creation property list
* Returns: 0 on success, -1 on failure
@@ -594,13 +594,13 @@ nh5dget_type_c ( hid_t_f *dset_id , hid_t_f *type_id)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5dget_create_plist_c ( hid_t_f *dset_id , hid_t_f *plist_id)
{
int ret_value = -1;
hid_t c_dset_id;
hid_t c_plist_id;
c_dset_id = (hid_t)*dset_id;
c_plist_id = H5Dget_create_plist(c_dset_id);
@@ -614,16 +614,16 @@ nh5dget_create_plist_c ( hid_t_f *dset_id , hid_t_f *plist_id)
/*----------------------------------------------------------------------------
* Name: h5dextend_c
* Purpose: Call H5Dextend to extend dataset with unlimited dimensions
* Inputs: dset_id - identifier of the dataset
* Outputs: dims - array with the dimension sizes
* Purpose: Call H5Dextend to extend dataset with unlimited dimensions
* Inputs: dset_id - identifier of the dataset
* Outputs: dims - array with the dimension sizes
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Thursday, August 19, 1999
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5dextend_c ( hid_t_f *dset_id , hsize_t_f *dims)
{
int ret_value = -1;
@@ -647,9 +647,9 @@ nh5dextend_c ( hid_t_f *dset_id , hsize_t_f *dims)
/*
* Reverse dimensions due to C-FORTRAN storage order.
*/
for (i=0; i < rank; i++)
for (i=0; i < rank; i++)
c_dims[i] = dims[rank - i - 1];
status = H5Dextend(c_dset_id, c_dims);
if ( status >= 0 ) ret_value = 0;
@@ -659,9 +659,9 @@ nh5dextend_c ( hid_t_f *dset_id , hsize_t_f *dims)
/*----------------------------------------------------------------------------
* Name: nh5dget_storage_size_c
* Purpose: Call H5Dget_storage_size to return the amount of storage
* Purpose: Call H5Dget_storage_size to return the amount of storage
* required for a dataset
* Inputs: dset_id - identifier of the dataset
* Inputs: dset_id - identifier of the dataset
* Outputs: size - the amount of storage required for a dataset
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -669,7 +669,7 @@ nh5dextend_c ( hid_t_f *dset_id , hsize_t_f *dims)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5dget_storage_size_c ( hid_t_f *dset_id , hsize_t_f *size)
{
int ret_value = -1;
@@ -687,9 +687,9 @@ nh5dget_storage_size_c ( hid_t_f *dset_id , hsize_t_f *size)
/*----------------------------------------------------------------------------
* Name: nh5dvlen_get_max_len_c
* Purpose: Get the maximum size of the VL dataset element
* Inputs: dset_id - identifier of the dataset
* Inputs: dset_id - identifier of the dataset
* type_id - datatype identifier
* space_id - dataspace identifier
* space_id - dataspace identifier
* Outputs: len - maximum length of the VL dataset element
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -697,7 +697,7 @@ nh5dget_storage_size_c ( hid_t_f *dset_id , hsize_t_f *size)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5dvlen_get_max_len_c ( hid_t_f *dset_id , hid_t_f *type_id, hid_t_f *space_id, size_t_f *len)
{
int ret_value = -1;
@@ -714,20 +714,20 @@ nh5dvlen_get_max_len_c ( hid_t_f *dset_id , hid_t_f *type_id, hid_t_f *space_id
c_type_id = (hid_t)*type_id;
c_space_id = (hid_t)*space_id;
num_elem = H5Sget_select_npoints(c_space_id);
num_elem = H5Sget_select_npoints(c_space_id);
if( num_elem < 0) return ret_value;
c_buf = (hvl_t *)malloc(sizeof(hvl_t)*(size_t)num_elem);
c_buf = (hvl_t *)malloc(sizeof(hvl_t)*(size_t)num_elem);
if (c_buf == NULL) return ret_value;
status = H5Dread(c_dset_id, c_type_id, H5S_ALL, c_space_id, H5P_DEFAULT, c_buf);
if(status < 0) goto DONE;
c_len = 0;
for (i=0; i < num_elem; i++) c_len = H5_MAX(c_len, c_buf[i].len);
for (i=0; i < num_elem; i++) c_len = H5_MAX(c_len, c_buf[i].len);
*len = (size_t_f)c_len;
H5Dvlen_reclaim(c_type_id, c_space_id, H5P_DEFAULT, c_buf);
ret_value = 0;
DONE:
free(c_buf);
@@ -735,11 +735,11 @@ DONE:
}
/*----------------------------------------------------------------------------
* Name: nh5dwrite_vl_integer_c
* Purpose: Write variable length dataset
* Inputs: dset_id - identifier of the dataset
* Purpose: Write variable length dataset
* Inputs: dset_id - identifier of the dataset
* mem_type_id - datatype identifier
* mem_space_id - dataspace identifier
* file_space_id - file dataspace identifier
* mem_space_id - dataspace identifier
* file_space_id - file dataspace identifier
* xfer - file transfer property
* buf - data buffer
* dims - one-demnsional array of size 2
@@ -752,7 +752,7 @@ DONE:
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5dwrite_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, int_f *buf, hsize_t_f *dims, size_t_f *len)
{
int ret_value = -1;
@@ -768,7 +768,7 @@ nh5dwrite_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_
hvl_t *c_buf;
hsize_t i;
hsize_t num_elem;
max_len = (size_t)dims[0];
num_elem = dims[1];
@@ -778,14 +778,14 @@ nh5dwrite_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_
c_file_space_id = (hid_t)*file_space_id;
c_xfer_prp = (hid_t)*xfer_prp;
c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t));
c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t));
if (c_buf == NULL) return ret_value;
tmp = (int_f *)buf;
tmp = (int_f *)buf;
for (i=0; i < num_elem; i++) {
c_buf[i].len = (size_t)len[i];
c_buf[i].len = (size_t)len[i];
c_buf[i].p = tmp;
tmp = tmp + max_len;
}
}
/*
* Call H5Dwrite function.
*/
@@ -800,11 +800,11 @@ DONE:
/*----------------------------------------------------------------------------
* Name: nh5dread_vl_integer_c
* Purpose: Read variable length dataset
* Inputs: dset_id - identifier of the dataset
* Purpose: Read variable length dataset
* Inputs: dset_id - identifier of the dataset
* mem_type_id - datatype identifier
* mem_space_id - dataspace identifier
* file_space_id - file dataspace identifier
* mem_space_id - dataspace identifier
* file_space_id - file dataspace identifier
* xfer - file transfer property
* dims - one-demnsional array of size 2
* dims[0] = MAXLENGTH
@@ -817,7 +817,7 @@ DONE:
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5dread_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, int_f *buf, hsize_t_f *dims, size_t_f *len)
{
int ret_value = -1;
@@ -832,7 +832,7 @@ nh5dread_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_s
hvl_t *c_buf;
size_t i;
hssize_t num_elem;
c_dset_id = (hid_t)*dset_id;
c_mem_type_id = (hid_t)*mem_type_id;
c_mem_space_id = (hid_t)*mem_space_id;
@@ -840,10 +840,10 @@ nh5dread_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_s
c_xfer_prp = (hid_t)*xfer_prp;
max_len = (size_t)dims[0];
num_elem = H5Sget_select_npoints(c_mem_space_id);
num_elem = H5Sget_select_npoints(c_mem_space_id);
if(num_elem != dims[1]) return ret_value;
c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t));
c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t));
if (c_buf == NULL) return ret_value;
/*
* Call H5Dread function.
@@ -851,7 +851,7 @@ nh5dread_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_s
status = H5Dread(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, c_buf);
if ( status < 0 ) goto DONE;
for (i=0; i < num_elem; i++) {
len[i] = (size_t_f)c_buf[i].len;
len[i] = (size_t_f)c_buf[i].len;
memcpy(&buf[i*max_len], c_buf[i].p, c_buf[i].len*sizeof(int_f));
}
H5Dvlen_reclaim(c_mem_type_id, c_mem_space_id, H5P_DEFAULT, c_buf);
@@ -864,13 +864,13 @@ DONE:
/*----------------------------------------------------------------------------
* Name: nh5dwrite_vl_string_c
* Purpose: Write variable length strings from Fortran program
* Inputs: dset_id - identifier of the dataset
* Inputs: dset_id - identifier of the dataset
* mem_type_id - datatype identifier
* mem_space_id - dataspace identifier
* file_space_id - file dataspace identifier
* mem_space_id - dataspace identifier
* file_space_id - file dataspace identifier
* xfer - file transfer property
* buf - data buffer
* dims - one-demnsional array of size 2
* dims - one-demnsional array of size 2
* dims[0] = number of strings of size max_len
* len - array of strings lengths
* Returns: 0 on success, -1 on failure
@@ -879,7 +879,7 @@ DONE:
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5dwrite_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims, size_t_f *len)
{
int ret_value = -1;
@@ -895,7 +895,7 @@ nh5dwrite_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_sp
char **c_buf;
hsize_t i;
hsize_t num_elem;
max_len = (size_t)dims[0];
num_elem = dims[1];
@@ -908,7 +908,7 @@ nh5dwrite_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_sp
/*
* Allocate arra of character pointers
*/
c_buf = (char **)malloc((size_t)num_elem * sizeof(char *));
c_buf = (char **)malloc((size_t)num_elem * sizeof(char *));
if (c_buf == NULL) return ret_value;
/* Copy data to long C string */
@@ -923,7 +923,7 @@ nh5dwrite_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_sp
for (i=0; i < num_elem; i++) {
c_buf[i] = (char *) malloc((size_t)len[i]+1);
memcpy(c_buf[i], tmp_p, (size_t)len[i]);
c_buf[i][len[i]] = '\0';
c_buf[i][len[i]] = '\0';
tmp_p = tmp_p + max_len;
}
@@ -943,12 +943,12 @@ DONE:
/*----------------------------------------------------------------------------
* Name: nh5dread_vl_string_c
* Purpose: Read variable length strings from Fortran program
* Inputs: dset_id - identifier of the dataset
* Inputs: dset_id - identifier of the dataset
* mem_type_id - datatype identifier
* mem_space_id - dataspace identifier
* file_space_id - file dataspace identifier
* mem_space_id - dataspace identifier
* file_space_id - file dataspace identifier
* xfer - file transfer property
* dims - one-demnsional array of size 2
* dims - one-demnsional array of size 2
* dims[0] = number of strings of size max_len
* Output: buf - data buffer
* len - array of strings lengths
@@ -958,7 +958,7 @@ DONE:
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims, size_t_f *len)
{
int ret_value = -1;
@@ -974,7 +974,7 @@ nh5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa
char **c_buf;
hsize_t i;
hsize_t num_elem;
max_len = (size_t)dims[0];
num_elem = dims[1];
@@ -987,7 +987,7 @@ nh5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa
/*
* Allocate array of character pointers
*/
c_buf = (char **)malloc((size_t)num_elem * sizeof(char *));
c_buf = (char **)malloc((size_t)num_elem * sizeof(char *));
if (c_buf == NULL) return ret_value;
/*
@@ -1017,11 +1017,11 @@ nh5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa
/*----------------------------------------------------------------------------
* Name: nh5dwrite_vl_real_c
* Purpose: Write variable length dataset
* Inputs: dset_id - identifier of the dataset
* Purpose: Write variable length dataset
* Inputs: dset_id - identifier of the dataset
* mem_type_id - datatype identifier
* mem_space_id - dataspace identifier
* file_space_id - file dataspace identifier
* mem_space_id - dataspace identifier
* file_space_id - file dataspace identifier
* xfer - file transfer property
* buf - data buffer
* dims - one-demnsional array of size 2
@@ -1034,7 +1034,7 @@ nh5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5dwrite_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, real_f *buf, hsize_t_f *dims, size_t_f *len)
{
int ret_value = -1;
@@ -1050,7 +1050,7 @@ nh5dwrite_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa
hvl_t *c_buf;
hsize_t i;
hsize_t num_elem;
max_len = (size_t)dims[0];
num_elem = dims[1];
@@ -1060,14 +1060,14 @@ nh5dwrite_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa
c_file_space_id = (hid_t)*file_space_id;
c_xfer_prp = (hid_t)*xfer_prp;
c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t));
c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t));
if (c_buf == NULL) return ret_value;
tmp = (real_f *)buf;
tmp = (real_f *)buf;
for (i=0; i < num_elem; i++) {
c_buf[i].len = (size_t)len[i];
c_buf[i].len = (size_t)len[i];
c_buf[i].p = tmp;
tmp = tmp + max_len;
}
}
/*
* Call H5Dwrite function.
*/
@@ -1082,11 +1082,11 @@ DONE:
/*----------------------------------------------------------------------------
* Name: nh5dread_vl_real_c
* Purpose: Read variable length dataset
* Inputs: dset_id - identifier of the dataset
* Purpose: Read variable length dataset
* Inputs: dset_id - identifier of the dataset
* mem_type_id - datatype identifier
* mem_space_id - dataspace identifier
* file_space_id - file dataspace identifier
* mem_space_id - dataspace identifier
* file_space_id - file dataspace identifier
* xfer - file transfer property
* dims - one-demnsional array of size 2
* dims[0] = MAXLENGTH
@@ -1099,7 +1099,7 @@ DONE:
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5dread_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, real_f *buf, hsize_t_f *dims, size_t_f *len)
{
int ret_value = -1;
@@ -1114,7 +1114,7 @@ nh5dread_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spac
hvl_t *c_buf;
size_t i;
hssize_t num_elem;
c_dset_id = (hid_t)*dset_id;
c_mem_type_id = (hid_t)*mem_type_id;
c_mem_space_id = (hid_t)*mem_space_id;
@@ -1122,10 +1122,10 @@ nh5dread_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spac
c_xfer_prp = (hid_t)*xfer_prp;
max_len = (size_t)dims[0];
num_elem = H5Sget_select_npoints(c_mem_space_id);
num_elem = H5Sget_select_npoints(c_mem_space_id);
if(num_elem != dims[1]) return ret_value;
c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t));
c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t));
if (c_buf == NULL) return ret_value;
/*
* Call H5Dread function.
@@ -1133,10 +1133,10 @@ nh5dread_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spac
status = H5Dread(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, c_buf);
if ( status <0 ) goto DONE;
for (i=0; i < num_elem; i++) {
len[i] = (size_t_f)c_buf[i].len;
len[i] = (size_t_f)c_buf[i].len;
memcpy(&buf[i*max_len], c_buf[i].p, c_buf[i].len*sizeof(real_f));
}
H5Dvlen_reclaim(c_mem_type_id, c_mem_space_id, H5P_DEFAULT, c_buf);
ret_value = 0;
DONE:
@@ -1161,7 +1161,7 @@ int_f
nh5dfillc_c (_fcd fill_value, hid_t_f *fill_type_id, hid_t_f *space_id, _fcd buf, hid_t_f *mem_type_id)
{
int ret_value = -1;
/*
* Call h5dfill_c function.
*/
@@ -1195,7 +1195,7 @@ nh5dfill_c (void * fill_value, hid_t_f *fill_type_id, hid_t_f *space_id, void *
c_fill_type_id = (hid_t)*fill_type_id;
c_mem_type_id = (hid_t)*mem_type_id;
c_space_id = (hid_t)*space_id;
/*
* Call H5Dfill function.
*/
@@ -1204,7 +1204,7 @@ nh5dfill_c (void * fill_value, hid_t_f *fill_type_id, hid_t_f *space_id, void *
if (ret < 0) return ret_value;
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5dget_space_status_c
@@ -1226,7 +1226,7 @@ nh5dget_space_status_c ( hid_t_f *dset_id, int_f *flag)
H5D_space_status_t c_flag;
c_dset_id = (hid_t)*dset_id;
/*
* Call H5Dget_space_status
*/
@@ -1236,5 +1236,5 @@ nh5dget_space_status_c ( hid_t_f *dset_id, int_f *flag)
*flag = (int_f)c_flag;
ret_value = 0;
return ret_value;
}
}
+20 -20
View File
@@ -20,15 +20,15 @@
/*----------------------------------------------------------------------------
* Name: h5eclear_c
* Purpose: Call H5Eclear to clear the error stack for the current thread
* Inputs:
* Outputs:
* Inputs:
* Outputs:
* Returns: 0 on success, -1 on failure
* Programmer: Xiangyang Su
* Wednesday, March 29, 2000
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5eclear_c( )
{
int ret_val = -1;
@@ -37,18 +37,18 @@ nh5eclear_c( )
/*
* Call H5Eclear function.
*/
status = H5Eclear_stack(H5E_DEFAULT);
status = H5Eclear_stack(H5E_DEFAULT);
if(status < 0) return ret_val;
ret_val = 0;
return ret_val;
}
}
/*----------------------------------------------------------------------------
* Name: h5eprint_c1
* Purpose: Call H5Eprint to print the error stack in a default manner.
* Inputs: name - file name
* namelen - length of name
* Outputs:
* Outputs:
* Returns: 0 on success, -1 on failure
* Programmer: Xiangyang Su
* Wednesday, March 29, 2000
@@ -76,17 +76,17 @@ nh5eprint_c1(_fcd name, int_f* namelen)
fclose(file);
DONE:
HDfree(c_name);
HDfree(c_name);
return ret_val;
}
}
/*----------------------------------------------------------------------------
* Name: h5eprint_c2
* Purpose: Call H5Eprint to print the error stack to stderr
* in a default manner.
* Inputs:
* Outputs:
* Inputs:
* Outputs:
* Returns: 0 on success, -1 on failure
* Programmer: Xiangyang Su
* Wednesday, March 29, 2000
@@ -104,11 +104,11 @@ nh5eprint_c2()
status = H5Eprint_stack(H5E_DEFAULT, NULL);
if(status >= 0) ret_val = 0;
return ret_val;
}
}
/*----------------------------------------------------------------------------
* Name: h5eget_major_c
* Purpose: Call H5Eget_major to get a character string
* Purpose: Call H5Eget_major to get a character string
* describing an error specified by a major error number.
* Inputs: error_no - Major error number
* Outputs: name - character string describing the error
@@ -133,16 +133,16 @@ nh5eget_major_c(int_f* error_no, _fcd name, size_t_f* namelen)
* Call H5Eget_major function.
*/
H5Eget_msg(c_error_no, NULL, c_name, c_namelen);
HD5packFstring((char*)c_name, _fcdtocp(name), c_namelen);
HD5packFstring((char*)c_name, _fcdtocp(name), c_namelen);
if(!strcmp(c_name, "Invalid major error number")) return ret_val;
ret_val = 0;
return ret_val;
}
}
/*----------------------------------------------------------------------------
* Name: h5eget_minor_c
* Purpose: Call H5Eget_minor to get a character string
* Purpose: Call H5Eget_minor to get a character string
* describing an error specified by a minor error number.
* Inputs: error_no - Major error number
* Outputs: name - character string describing the error
@@ -167,18 +167,18 @@ nh5eget_minor_c(int_f* error_no, _fcd name, size_t_f* namelen)
* Call H5Eget_minor function.
*/
H5Eget_msg(c_error_no, NULL, c_name, c_namelen);
HD5packFstring((char*)c_name, _fcdtocp(name), c_namelen);
HD5packFstring((char*)c_name, _fcdtocp(name), c_namelen);
if(!strcmp(c_name, "Invalid minor error number")) return ret_val;
ret_val = 0;
return ret_val;
}
}
/*----------------------------------------------------------------------------
* Name: h5eset_auto_c
* Purpose: Call H5Eset_auto to turn automatic error printing on or off.
* Inputs: printflag - flag to turn automatic error printing on or off.
* Outputs:
* Outputs:
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Friday, November 17, 2000
+40 -40
View File
@@ -15,12 +15,12 @@
/* This files contains C stubs for Parallel Fortran APIs */
#include "H5f90.h"
#include <mpi.h>
#include <mpi.h>
#include "H5public.h"
/* Support for C to Fortran translation in MPI */
#ifndef H5_HAVE_MPI_MULTI_LANG_Comm
#ifndef H5_HAVE_MPI_MULTI_LANG_Comm
#define MPI_Comm_c2f(comm) (int_f)(comm)
#define MPI_Comm_f2c(comm) (MPI_Comm)(comm)
#endif /*MPI Comm*/
@@ -31,14 +31,14 @@
/*----------------------------------------------------------------------------
* Name: h5pset_fapl_mpio_c
* Purpose: Call H5Pset_fapl_mpio to set mode for parallel I/O and the user
* supplied communicator and info object
* Purpose: Call H5Pset_fapl_mpio to set mode for parallel I/O and the user
* supplied communicator and info object
* Inputs: prp_id - property list identifier
* comm - MPI communicator
* info - MPI info object
* comm - MPI communicator
* info - MPI info object
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Thursday, October 26, 2000
* Programmer: Elena Pourmal
* Thursday, October 26, 2000
* Modifications:
*---------------------------------------------------------------------------*/
int_f
@@ -48,8 +48,8 @@ nh5pset_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info)
hid_t c_prp_id;
herr_t ret;
MPI_Comm c_comm;
MPI_Info c_info;
c_comm = MPI_Comm_f2c(*comm);
MPI_Info c_info;
c_comm = MPI_Comm_f2c(*comm);
c_info = MPI_Info_f2c(*info);
/*
@@ -60,17 +60,17 @@ nh5pset_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info)
if (ret < 0) return ret_value;
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5pget_fapl_mpio_c
* Purpose: Call H5Pget_fapl_mpio to retrieve communicator and info object
* Purpose: Call H5Pget_fapl_mpio to retrieve communicator and info object
* Inputs: prp_id - property list identifier
* comm - buffer to return MPI communicator
* info - buffer to return MPI info object
* comm - buffer to return MPI communicator
* info - buffer to return MPI info object
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Thursday, October 26, 2000
* Programmer: Elena Pourmal
* Thursday, October 26, 2000
* Modifications:
*---------------------------------------------------------------------------*/
int_f
@@ -80,7 +80,7 @@ nh5pget_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info)
hid_t c_prp_id;
herr_t ret;
MPI_Comm c_comm;
MPI_Info c_info;
MPI_Info c_info;
/*
* Call H5Pget_mpi function.
@@ -92,16 +92,16 @@ nh5pget_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info)
*info = (int_f) MPI_Info_c2f(c_info);
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5pset_dxpl_mpio_c
* Purpose: Call H5Pset_dxpl_mpio to set transfer mode of the dataset
* trasfer property list
* Purpose: Call H5Pset_dxpl_mpio to set transfer mode of the dataset
* trasfer property list
* Inputs: prp_id - property list identifier
* data_xfer_mode - transfer mode
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Thursday, October 26, 2000
* Programmer: Elena Pourmal
* Thursday, October 26, 2000
* Modifications:
*---------------------------------------------------------------------------*/
int_f
@@ -134,17 +134,17 @@ nh5pset_dxpl_mpio_c(hid_t_f *prp_id, int_f* data_xfer_mode)
if (ret < 0) return ret_value;
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5pget_dxpl_mpio_c
* Purpose: Call H5Pget_dxpl_mpio to get transfer mode of the dataset
* trasfer property list
* Purpose: Call H5Pget_dxpl_mpio to get transfer mode of the dataset
* trasfer property list
* Inputs: prp_id - property list identifier
* data_xfer_mode - buffer to retrieve transfer mode
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Thursday, June 15, 2000
* Programmer: Elena Pourmal
* Thursday, June 15, 2000
* Modifications:
*---------------------------------------------------------------------------*/
int_f
@@ -161,7 +161,7 @@ nh5pget_dxpl_mpio_c(hid_t_f *prp_id, int_f* data_xfer_mode)
c_prp_id = *prp_id;
ret = H5Pget_dxpl_mpio(c_prp_id, &c_data_xfer_mode);
if (ret < 0) return ret_value;
*data_xfer_mode = (int_f)c_data_xfer_mode;
*data_xfer_mode = (int_f)c_data_xfer_mode;
/*
switch (c_data_xfer_mode) {
@@ -179,17 +179,17 @@ nh5pget_dxpl_mpio_c(hid_t_f *prp_id, int_f* data_xfer_mode)
*/
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5pset_fapl_mpiposix_c
* Purpose: Call H5Pset_fapl_mpiposix to set mode for parallel I/O and the user
* supplied communicator
* Purpose: Call H5Pset_fapl_mpiposix to set mode for parallel I/O and the user
* supplied communicator
* Inputs: prp_id - property list identifier
* comm - MPI communicator
* comm - MPI communicator
* flag - flag to use GPFS hints
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Programmer: Elena Pourmal
* Tuesday, May 6, 2003
* Modifications:
*---------------------------------------------------------------------------*/
@@ -201,7 +201,7 @@ nh5pset_fapl_mpiposix_c(hid_t_f *prp_id, int_f* comm, int_f* flag)
herr_t ret;
hbool_t c_flag;
MPI_Comm c_comm;
c_comm = MPI_Comm_f2c(*comm);
c_comm = MPI_Comm_f2c(*comm);
c_flag = (hbool_t)*flag;
/*
* Call H5Pset_fapl_mpiposix function.
@@ -211,17 +211,17 @@ nh5pset_fapl_mpiposix_c(hid_t_f *prp_id, int_f* comm, int_f* flag)
if (ret < 0) return ret_value;
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5pget_fapl_mpiposix_c
* Purpose: Call H5Pget_fapl_mpiposix to retrieve communicator and info object
* Purpose: Call H5Pget_fapl_mpiposix to retrieve communicator and info object
* Inputs: prp_id - property list identifier
* Outputs: comm - buffer to return MPI communicator
* Outputs: comm - buffer to return MPI communicator
* flag - flag to use GPFS hints
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Tuesday, May 6, 2003
* Programmer: Elena Pourmal
* Tuesday, May 6, 2003
* Modifications:
*---------------------------------------------------------------------------*/
int_f
@@ -243,4 +243,4 @@ nh5pget_fapl_mpiposix_c(hid_t_f *prp_id, int_f* comm, int_f* flag)
*flag = (int_f) c_flag;
ret_value = 0;
return ret_value;
}
}
+38 -38
View File
@@ -20,11 +20,11 @@
/*----------------------------------------------------------------------------
* Name: h5fcreate_c
* Purpose: Call H5Fcreate to create the file
* Inputs: name - name of the file
* Inputs: name - name of the file
* namelen - name length
* access_flags - file access flags
* crt_pr - identifier of creation property list
* acc_prp - identifier of access property list
* acc_prp - identifier of access property list
* Outputs: file_id - file identifier
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -65,7 +65,7 @@ nh5fcreate_c(_fcd name, int_f *namelen, int_f *access_flags, hid_t_f* crt_prp, h
* Convert FORTRAN name to C name
*/
c_namelen = *namelen;
c_name = (char *)HD5f2cstring(name, (size_t)c_namelen);
c_name = (char *)HD5f2cstring(name, (size_t)c_namelen);
if (c_name == NULL) return ret_value;
/*
@@ -78,15 +78,15 @@ nh5fcreate_c(_fcd name, int_f *namelen, int_f *access_flags, hid_t_f* crt_prp, h
HDfree(c_name);
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5fflush_c
* Purpose: Call H5Fflush to flush the object
* Inputs: object_id - identifier of either a file, a dataset,
* a group, an attribute or a named data type
* a group, an attribute or a named data type
* scope - integer to specify the flushing action, either
* H5F_SCOPE_GLOBAL or H5F_SCOPE_LOCAL
* H5F_SCOPE_GLOBAL or H5F_SCOPE_LOCAL
* Returns: 0 on success, -1 on failure
* Programmer: Xiangyang Su
* Friday, November 5, 1999
@@ -112,17 +112,17 @@ nh5fflush_c (hid_t_f *object_id, int_f *scope)
if (status >= 0) ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5fmount_c
* Purpose: Call H5Fmount to mount the file
* Inputs: loc_id - Identifier for file or group
* dsetname - name of dataset
* dsetname - name of dataset
* namelen - dsetname length
* file_id - file identifier for the file to be mounted
* acc_prp - identifier of access property list
* acc_prp - identifier of access property list
* Returns: 0 on success, -1 on failure
* Programmer: Xiangyang Su
* Monday, October 25, 1999
@@ -153,7 +153,7 @@ nh5fmount_c (hid_t_f *loc_id, _fcd dsetname, int_f *namelen, hid_t_f *file_id, h
* Convert FORTRAN name to C name
*/
c_namelen = *namelen;
c_name = (char *)HD5f2cstring(dsetname, (size_t)c_namelen);
c_name = (char *)HD5f2cstring(dsetname, (size_t)c_namelen);
if (c_name == NULL) return ret_value;
/*
@@ -165,13 +165,13 @@ nh5fmount_c (hid_t_f *loc_id, _fcd dsetname, int_f *namelen, hid_t_f *file_id, h
HDfree(c_name);
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5funmount_c
* Purpose: Call H5Funmount to unmount the file
* Inputs: loc_id - Identifier for file or group
* dsetname - name of dataset
* dsetname - name of dataset
* namelen - dsetname length
* Returns: 0 on success, -1 on failure
* Programmer: Xiangyang Su
@@ -193,7 +193,7 @@ nh5funmount_c (hid_t_f *loc_id, _fcd dsetname, int_f *namelen)
* Convert FORTRAN name to C name
*/
c_namelen = *namelen;
c_name = (char *)HD5f2cstring(dsetname, (size_t)c_namelen);
c_name = (char *)HD5f2cstring(dsetname, (size_t)c_namelen);
if (c_name == NULL) return ret_value;
/*
@@ -205,17 +205,17 @@ nh5funmount_c (hid_t_f *loc_id, _fcd dsetname, int_f *namelen)
HDfree(c_name);
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5fopen_c
* Purpose: Call H5Fopen to open the file
* Inputs: name - name of the file
* Inputs: name - name of the file
* namelen - name length
* access_flags - file access flags
* acc_prp - identifier of access property list
* acc_prp - identifier of access property list
* Outputs: file_id - file identifier
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -249,7 +249,7 @@ nh5fopen_c (_fcd name, int_f *namelen, int_f *access_flags, hid_t_f *acc_prp, hi
* Convert FORTRAN name to C name
*/
c_namelen = *namelen;
c_name = (char *)HD5f2cstring(name, (size_t)c_namelen);
c_name = (char *)HD5f2cstring(name, (size_t)c_namelen);
if (c_name == NULL) return ret_value;
/*
@@ -263,7 +263,7 @@ nh5fopen_c (_fcd name, int_f *namelen, int_f *access_flags, hid_t_f *acc_prp, hi
HDfree(c_name);
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5freopen_c
@@ -289,7 +289,7 @@ nh5freopen_c (hid_t_f *file_id1, hid_t_f *file_id2)
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5fget_create_plist_c
@@ -315,7 +315,7 @@ nh5fget_create_plist_c (hid_t_f *file_id, hid_t_f *prop_id)
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5fget_access_plist_c
@@ -341,15 +341,15 @@ nh5fget_access_plist_c (hid_t_f *file_id, hid_t_f *access_id)
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5fis_hdf5_c
* Purpose: Call H5Fis_hdf5 to determone if the file is an HDF5 file
* Inputs: name - name of the file
* Inputs: name - name of the file
* namelen - name length
* Outputs: flag - 0 if file is not HDF5 file , positive if a file
* is an HDF5 file, and negative on failure.
* is an HDF5 file, and negative on failure.
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Tuesday, August 3, 1999
@@ -367,7 +367,7 @@ nh5fis_hdf5_c (_fcd name, int_f *namelen, int_f *flag)
* Convert FORTRAN name to C name
*/
c_namelen = *namelen;
c_name = (char *)HD5f2cstring(name, (size_t)c_namelen);
c_name = (char *)HD5f2cstring(name, (size_t)c_namelen);
if (c_name == NULL) return ret_value;
/*
@@ -379,7 +379,7 @@ nh5fis_hdf5_c (_fcd name, int_f *namelen, int_f *flag)
HDfree(c_name);
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5fclose_c
* Purpose: Call H5Fclose to close the file
@@ -390,7 +390,7 @@ nh5fis_hdf5_c (_fcd name, int_f *namelen, int_f *flag)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5fclose_c ( hid_t_f *file_id )
{
int ret_value = 0;
@@ -405,21 +405,21 @@ nh5fclose_c ( hid_t_f *file_id )
* Purpose: Call H5Fget_obj_count to get number of open objects within a file
* Inputs: file_id - identifier of the file to be closed
* obj_type - type of the object
* Returns: obj_count - number of objects
* Returns: obj_count - number of objects
* 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Monday, September 30, 2002
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5fget_obj_count_c ( hid_t_f *file_id , int_f *obj_type, int_f * obj_count)
{
int ret_value = 0;
hid_t c_file_id;
unsigned c_obj_type;
int c_obj_count;
c_file_id = (hid_t)*file_id;
c_obj_type = (unsigned) *obj_type;
@@ -439,7 +439,7 @@ nh5fget_obj_count_c ( hid_t_f *file_id , int_f *obj_type, int_f * obj_count)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5fget_obj_ids_c ( hid_t_f *file_id , int_f *obj_type, int_f *max_objs, hid_t_f *obj_ids)
{
int ret_value = 0;
@@ -464,7 +464,7 @@ nh5fget_obj_ids_c ( hid_t_f *file_id , int_f *obj_type, int_f *max_objs, hid_t_f
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5fget_freespace_c ( hid_t_f *file_id , hssize_t_f *free_space)
{
int ret_value = 0;
@@ -479,9 +479,9 @@ nh5fget_freespace_c ( hid_t_f *file_id , hssize_t_f *free_space)
/*----------------------------------------------------------------------------
* Name: h5fget_name_c
* Purpose: Call H5Fget_name to get file's name
* Inputs: obj_id - object identifier
* buflen -size of the buffer
* Purpose: Call H5Fget_name to get file's name
* Inputs: obj_id - object identifier
* buflen -size of the buffer
* Outputs: buf - buffer to hold the name
* size - size of the file's name
* Returns: 0 on success, -1 on failure
@@ -501,7 +501,7 @@ nh5fget_name_c(hid_t_f *obj_id, size_t_f *size, _fcd buf, size_t_f *buflen)
*/
if ((c_buf = HDmalloc((size_t)*buflen +1)) == NULL)
HGOTO_DONE(FAIL);
/*
* Call H5Aget_name function
*/
@@ -522,7 +522,7 @@ done:
/*----------------------------------------------------------------------------
* Name: h5fget_filesize_c
* Purpose: Call H5Fget_filesize to get file size
* Inputs: file_id - file identifier
* Inputs: file_id - file identifier
* Outputs: size - size of the file
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
+56 -56
View File
@@ -18,9 +18,9 @@
/*----------------------------------------------------------------------------
* Name: h5gcreate_c
* Purpose: Call H5Gcreate to create a group
* Inputs: loc_id - file or group identifier
* name - name of the group
* Purpose: Call H5Gcreate to create a group
* Inputs: loc_id - file or group identifier
* name - name of the group
* namelen - name length
* size_hint - length of names in the group
* Outputs: grp_id - group identifier
@@ -43,16 +43,16 @@ nh5gcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size_hint,
* Convert FORTRAN name to C name
*/
c_namelen = *namelen;
c_name = (char *)HD5f2cstring(name, c_namelen);
c_name = (char *)HD5f2cstring(name, c_namelen);
if (c_name == NULL) return ret_value;
/*
* Call H5Gcreate function.
*/
c_loc_id = *loc_id;
if ( *size_hint == OBJECT_NAMELEN_DEFAULT_F )
if ( *size_hint == OBJECT_NAMELEN_DEFAULT_F )
c_grp_id = H5Gcreate(c_loc_id, c_name, 0);
else {
c_size_hint = (size_t)*size_hint;
c_size_hint = (size_t)*size_hint;
c_grp_id = H5Gcreate(c_loc_id, c_name, c_size_hint);
}
if (c_grp_id < 0) goto DONE;
@@ -62,13 +62,13 @@ nh5gcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size_hint,
DONE:
HDfree(c_name);
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5gopen_c
* Purpose: Call H5Gopen to open a dataset
* Inputs: loc_id - file or group identifier
* name - name of the group
* Purpose: Call H5Gopen to open a dataset
* Inputs: loc_id - file or group identifier
* name - name of the group
* namelen - name length
* Outputs: grp_id - group identifier
* Returns: 0 on success, -1 on failure
@@ -89,7 +89,7 @@ nh5gopen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *grp_id)
* Convert FORTRAN name to C name
*/
c_namelen = *namelen;
c_name = (char *)HD5f2cstring(name, c_namelen);
c_name = (char *)HD5f2cstring(name, c_namelen);
if (c_name == NULL) return ret_value;
/*
@@ -105,27 +105,27 @@ nh5gopen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *grp_id)
DONE:
HDfree(c_name);
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5gget_obj_info_idx_c
* Purpose: Call H5Gget_obj_info to return name and the type of group
* member
* Inputs: loc_id - file or group identifier
* name - name of the group
* member
* Inputs: loc_id - file or group identifier
* name - name of the group
* namelen - name length
* idx - index of the group member
* Outputs: obj_name - buffer to store member's name
* obj_namelen - length of the buffer
* obj_type - type of the object
* obj_type - type of the object
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Wednesday, August 5, 1999
* Modifications:
*---------------------------------------------------------------------------*/
int_f
nh5gget_obj_info_idx_c
(hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *idx, _fcd obj_name, int_f *obj_namelen, int_f *obj_type)
nh5gget_obj_info_idx_c
(hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *idx, _fcd obj_name, int_f *obj_namelen, int_f *obj_type)
{
int ret_value = -1;
hid_t c_loc_id = (hid_t)*loc_id;
@@ -142,13 +142,13 @@ nh5gget_obj_info_idx_c
*/
c_namelen = *namelen;
c_obj_namelen = *obj_namelen;
c_name = (char *)HD5f2cstring(name, c_namelen);
c_name = (char *)HD5f2cstring(name, c_namelen);
if (c_name == NULL) return ret_value;
/*
* Allocate buffer to hold name of the object
*/
if (c_obj_namelen) c_obj_name = (char *)HDmalloc(c_obj_namelen + 1);
if (c_obj_namelen) c_obj_name = (char *)HDmalloc(c_obj_namelen + 1);
if (c_obj_name == NULL) { HDfree(c_name);
return ret_value;
}
@@ -175,15 +175,15 @@ DONE:
HDfree(c_obj_name);
HDfree(c_name);
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5gn_members_c
* Purpose: Call H5Gn_members to find number of objects in the group
* Inputs: loc_id - file or group identifier
* name - name of the group
* Purpose: Call H5Gn_members to find number of objects in the group
* Inputs: loc_id - file or group identifier
* name - name of the group
* namelen - name length
* Outputs: nmemebers - number of members
* Outputs: nmemebers - number of members
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Wednesday, August 5, 1999
@@ -196,14 +196,14 @@ nh5gn_members_c (hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *nmembers)
hid_t c_loc_id=(hid_t)*loc_id;
char *c_name;
int c_namelen;
hsize_t c_nmembers;
hsize_t c_nmembers;
hid_t gid = (-1);
/*
* Convert FORTRAN name to C name
*/
c_namelen = *namelen;
c_name = (char *)HD5f2cstring(name, c_namelen);
c_name = (char *)HD5f2cstring(name, c_namelen);
if (c_name == NULL) return ret_value;
/* Get a temporary group ID for the group to query */
@@ -221,10 +221,10 @@ DONE:
HDfree(c_name);
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5gclose_c
* Purpose: Call H5Gclose to close the group
* Purpose: Call H5Gclose to close the group
* Inputs: grp_id - identifier of the group to be closed
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -232,12 +232,12 @@ DONE:
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5gclose_c ( hid_t_f *grp_id )
{
int ret_value = 0;
hid_t c_grp_id;
c_grp_id = (hid_t)*grp_id;
if ( H5Gclose(c_grp_id) < 0 ) ret_value = -1;
return ret_value;
@@ -246,8 +246,8 @@ nh5gclose_c ( hid_t_f *grp_id )
/*----------------------------------------------------------------------------
* Name: h5glink_c
* Purpose: Call H5Glink to link the specified type
* Inputs: loc_id - identifier of file or group
* Purpose: Call H5Glink to link the specified type
* Inputs: loc_id - identifier of file or group
* link_type - link type
* current_name - name of the existing object for hard link,
* anything for the soft link
@@ -278,7 +278,7 @@ nh5glink_c(hid_t_f *loc_id, int_f *link_type, _fcd current_name, int_f *current_
if (c_current_name == NULL) return ret_value;
c_new_name = (char *)HD5f2cstring(new_name, c_new_namelen);
if(c_new_name == NULL) { HDfree(c_current_name);
if(c_new_name == NULL) { HDfree(c_current_name);
return ret_value;
}
/*
@@ -299,8 +299,8 @@ DONE:
/*----------------------------------------------------------------------------
* Name: h5glink2_c
* Purpose: Call H5Glink2 to link the specified type
* Inputs: cur_loc_id - identifier of file or group
* Purpose: Call H5Glink2 to link the specified type
* Inputs: cur_loc_id - identifier of file or group
* cur_name - name of the existing object for hard link releative
* to cur_loc_id location,
* anything for the soft link
@@ -313,7 +313,7 @@ DONE:
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Wednesday, September 25, 2002
* Modifications:
* Modifications:
*---------------------------------------------------------------------------*/
int_f
@@ -357,8 +357,8 @@ DONE:
/*----------------------------------------------------------------------------
* Name: h5gunlink_c
* Purpose: Call H5Gunlink to remove the specified name
* Inputs: loc_id - identifier of file or group
* Purpose: Call H5Gunlink to remove the specified name
* Inputs: loc_id - identifier of file or group
* name - name of the object to unlink
* Returns: 0 on success, -1 on failure
* Programmer: Mingshi Chen
@@ -396,8 +396,8 @@ DONE:
/*----------------------------------------------------------------------------
* Name: h5gmove_c
* Purpose: Call H5Gmove to rename an object within an HDF5 file
* Inputs: loc_id - identifier of file or group
* src_name - name of the original object
* Inputs: loc_id - identifier of file or group
* src_name - name of the original object
* src_namelen - original name lenghth
* dst_name - new name for the object
* dst_namelen - new name lenghth
@@ -424,7 +424,7 @@ nh5gmove_c(hid_t_f *loc_id, _fcd src_name, int_f *src_namelen, _fcd dst_name, in
if(c_src_name == NULL) return ret_value;
c_dst_name = (char *)HD5f2cstring(dst_name, c_dst_namelen);
if(c_dst_name == NULL) { HDfree(c_src_name);
if(c_dst_name == NULL) { HDfree(c_src_name);
return ret_value;
}
/*
@@ -445,7 +445,7 @@ DONE:
/*----------------------------------------------------------------------------
* Name: h5gmove2_c
* Purpose: Call H5Gmove2 to rename an object within an HDF5 file
* Inputs: src_loc_id - identifier of file or group
* Inputs: src_loc_id - identifier of file or group
* src_name - name of the original object relative to src_loc_id
* src_namelen - original name lenghth
* dst_loc_id - new location identifier
@@ -454,7 +454,7 @@ DONE:
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Wednesday, September 25, 2002
* Modifications:
* Modifications:
*---------------------------------------------------------------------------*/
int_f
@@ -475,7 +475,7 @@ nh5gmove2_c(hid_t_f *src_loc_id, _fcd src_name, int_f *src_namelen, hid_t_f *dst
if(c_src_name == NULL) return ret_value;
c_dst_name = (char *)HD5f2cstring(dst_name, c_dst_namelen);
if(c_dst_name == NULL) { HDfree(c_src_name);
if(c_dst_name == NULL) { HDfree(c_src_name);
return ret_value;
}
/*
@@ -497,8 +497,8 @@ DONE:
/*----------------------------------------------------------------------------
* Name: h5gget_linkval_c
* Purpose: Call H5Gget_linkval to return the name of object
* Inputs: loc_id - identifier of file or group
* name - name of the object that symbolic link points to
* Inputs: loc_id - identifier of file or group
* name - name of the object that symbolic link points to
* namelen - the name lenghth
* size - lenghth of retrurned value
* Outputs: value - name to be returned
@@ -530,10 +530,10 @@ nh5gget_linkval_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size, _f
*/
if(*size) c_value = (char *)HDmalloc((size_t)*size);
if(c_value == NULL) {
HDfree(c_name);
HDfree(c_name);
return ret_value;
}
/*
* Call H5Gget_linkval function
*/
@@ -542,7 +542,7 @@ nh5gget_linkval_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size, _f
c_loc_id = (hid_t)*loc_id;
c_ret_value = H5Gget_linkval(c_loc_id, c_name, c_size, c_value);
if(c_ret_value < 0) goto DONE;
/*
* Convert C name to FORTRAN and place it in the given buffer
@@ -559,8 +559,8 @@ DONE:
/*----------------------------------------------------------------------------
* Name: h5gset_comment_c
* Purpose: Call H5Gset_comment to set comments for the specified object
* Inputs: loc_id - identifier of file or group
* name - name of object whose comment is to be set or reset
* Inputs: loc_id - identifier of file or group
* name - name of object whose comment is to be set or reset
* namelen - the name lenghth
* comment - the new comment
* commentlen - new comment lenghth
@@ -608,8 +608,8 @@ DONE:
/*----------------------------------------------------------------------------
* Name: h5gget_comment_c
* Purpose: Call H5Gget_comment to retrieve comments for the specified object
* Inputs: loc_id - identifier of file or group
* name - name of object whose comment is to be set or reset
* Inputs: loc_id - identifier of file or group
* name - name of object whose comment is to be set or reset
* namelen - the name lenghth
* bufsize - at most bufsize characters
* comment - the new comment
@@ -629,7 +629,7 @@ nh5gget_comment_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *bufsize,
char *c_comment = NULL;
size_t c_bufsize;
herr_t c_ret_value;
/*
* Convert Fortran name to C name
*/
@@ -646,7 +646,7 @@ nh5gget_comment_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *bufsize,
HDfree(c_name);
return ret_value;
}
/*
* Call H5Gget_comment function
*/
+12 -12
View File
@@ -19,9 +19,9 @@
/*----------------------------------------------------------------------------
* Name: h5iget_type_c
* Purpose: Call H5Iget_type to get the type of an object
* Inputs: obj_id - object identifier
* Outputs: type - object type
* Purpose: Call H5Iget_type to get the type of an object
* Inputs: obj_id - object identifier
* Outputs: type - object type
* Returns: 0 on success, -1 on failure
* Programmer: Xiangyang Su
* Thursday, March 24, 2000
@@ -46,9 +46,9 @@ nh5iget_type_c (hid_t_f *obj_id, int_f *type)
}
/*----------------------------------------------------------------------------
* Name: h5iget_name_c
* Purpose: Call H5Iget_name to get object's name
* Inputs: obj_id - object identifier
* buf_size - size of the buffer
* Purpose: Call H5Iget_name to get object's name
* Inputs: obj_id - object identifier
* buf_size - size of the buffer
* Outputs: buf - buffer to hold the name
* Returns: length of the name on success, -1 on failure
* Programmer: Elena Pourmal
@@ -69,8 +69,8 @@ nh5iget_name_c(hid_t_f *obj_id, _fcd buf, size_t_f *buf_size, size_t_f *name_siz
*/
c_buf_size = (size_t)*buf_size;
c_buf = (char *)HDmalloc(c_buf_size +1);
if (c_buf == NULL) return ret_value;
if (c_buf == NULL) return ret_value;
/*
* Call H5IAget_name function
*/
@@ -93,7 +93,7 @@ DONE:
/*----------------------------------------------------------------------------
* Name: h5iinc_ref_c
* Purpose: Call H5Iinc_ref to increment object's reference count
* Inputs: obj_id - object identifier
* Inputs: obj_id - object identifier
* Outputs: ref_count - Reference count of ID
* Returns: current reference count on success, -1 on failure
* Programmer: Quincey Koziol
@@ -122,7 +122,7 @@ done:
/*----------------------------------------------------------------------------
* Name: h5idec_ref_c
* Purpose: Call H5Idec_ref to decrement object's reference count
* Inputs: obj_id - object identifier
* Inputs: obj_id - object identifier
* Outputs: ref_count - Reference count of ID
* Returns: current reference count on success, -1 on failure
* Programmer: Quincey Koziol
@@ -151,7 +151,7 @@ done:
/*----------------------------------------------------------------------------
* Name: h5iget_ref_c
* Purpose: Call H5Iget_ref to retrieve object's reference count
* Inputs: obj_id - object identifier
* Inputs: obj_id - object identifier
* Outputs: ref_count - Reference count of ID
* Returns: current reference count on success, -1 on failure
* Programmer: Quincey Koziol
@@ -180,7 +180,7 @@ done:
/*----------------------------------------------------------------------------
* Name: h5iget_file_id_c
* Purpose: Call H5Iget_file_id to obtain file identifier from object identifier
* Inputs: obj_id - object identifier
* Inputs: obj_id - object identifier
* Outputs: file_id - file identifier
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
+316 -316
View File
@@ -19,24 +19,24 @@
/*----------------------------------------------------------------------------
* Name: h5pcreate_c
* Purpose: Call H5Pcreate to create a property list
* Purpose: Call H5Pcreate to create a property list
* Inputs: class - property list class identifier
* Outputs: prp_id - identifier of the created property list
* Outputs: prp_id - identifier of the created property list
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Wednesday, October 9, 2002
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pcreate_c ( hid_t_f *class, hid_t_f *prp_id )
{
hid_t c_class;
int ret_value = 0;
hid_t c_prp_id;
c_class = (hid_t)*class;
c_prp_id = H5Pcreate(c_class);
c_prp_id = H5Pcreate(c_class);
if ( c_prp_id < 0 ) ret_value = -1;
*prp_id = (hid_t_f)c_prp_id;
@@ -45,7 +45,7 @@ nh5pcreate_c ( hid_t_f *class, hid_t_f *prp_id )
/*----------------------------------------------------------------------------
* Name: h5pclose_c
* Purpose: Call H5Pclose to close property lis
* Purpose: Call H5Pclose to close property lis
* Inputs: prp_id - identifier of the property list to be closed
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -53,7 +53,7 @@ nh5pcreate_c ( hid_t_f *class, hid_t_f *prp_id )
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pclose_c ( hid_t_f *prp_id )
{
int ret_value = 0;
@@ -66,16 +66,16 @@ nh5pclose_c ( hid_t_f *prp_id )
/*----------------------------------------------------------------------------
* Name: h5pcopy_c
* Purpose: Call H5Pcopy to copy property list
* Inputs: prp_id - identifier of the property list to be copied
* Outputs: new_prp_id - identifier of the new property list
* Purpose: Call H5Pcopy to copy property list
* Inputs: prp_id - identifier of the property list to be copied
* Outputs: new_prp_id - identifier of the new property list
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Saturday, August 14, 1999
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pcopy_c ( hid_t_f *prp_id , hid_t_f *new_prp_id)
{
int ret_value = 0;
@@ -83,7 +83,7 @@ nh5pcopy_c ( hid_t_f *prp_id , hid_t_f *new_prp_id)
hid_t c_new_prp_id;
c_prp_id = *prp_id;
c_new_prp_id = H5Pcopy(c_prp_id);
c_new_prp_id = H5Pcopy(c_prp_id);
if ( c_new_prp_id < 0 ) ret_value = -1;
*new_prp_id = (hid_t_f)c_new_prp_id;
return ret_value;
@@ -91,7 +91,7 @@ nh5pcopy_c ( hid_t_f *prp_id , hid_t_f *new_prp_id)
/*----------------------------------------------------------------------------
* Name: h5pequal_c
* Purpose: Call H5Pequal to check if two property lists are equal
* Purpose: Call H5Pequal to check if two property lists are equal
* Inputs: plist1_id - property list identifier
* plist2_id - property list identifier
* Outputs: c_flag - flag to indicate that lists are eqaul
@@ -101,7 +101,7 @@ nh5pcopy_c ( hid_t_f *prp_id , hid_t_f *new_prp_id)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pequal_c ( hid_t_f *plist1_id , hid_t_f *plist2_id, int_f * c_flag)
{
int ret_value = 0;
@@ -111,7 +111,7 @@ nh5pequal_c ( hid_t_f *plist1_id , hid_t_f *plist2_id, int_f * c_flag)
c_plist1_id = (hid_t)*plist1_id;
c_plist2_id = (hid_t)*plist2_id;
c_c_flag = H5Pequal(c_plist1_id, c_plist2_id);
c_c_flag = H5Pequal(c_plist1_id, c_plist2_id);
if ( c_c_flag < 0 ) ret_value = -1;
*c_flag = (int_f)c_c_flag;
return ret_value;
@@ -121,9 +121,9 @@ nh5pequal_c ( hid_t_f *plist1_id , hid_t_f *plist2_id, int_f * c_flag)
/*----------------------------------------------------------------------------
* Name: h5pget_class_c
* Purpose: Call H5Pget_class to determine property list class
* Inputs: prp_id - identifier of the dataspace
* Inputs: prp_id - identifier of the dataspace
* Outputs: classtype - class type; possible values are:
* H5P_NO_CLASS_F -1
* H5P_NO_CLASS_F -1
* H5P_FILE_CREATE_F 0
* H5P_FILE_ACCESS_F 1
* H5P_DATASET_CREATE_F 2
@@ -135,17 +135,17 @@ nh5pequal_c ( hid_t_f *plist1_id , hid_t_f *plist2_id, int_f * c_flag)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pget_class_c ( hid_t_f *prp_id , int_f *classtype)
{
int ret_value = 0;
hid_t c_prp_id;
hid_t c_classtype;
hid_t c_classtype;
c_prp_id = *prp_id;
c_classtype = H5Pget_class(c_prp_id);
if (c_classtype == H5P_NO_CLASS ) {
*classtype = H5P_NO_CLASS;
*classtype = H5P_NO_CLASS;
ret_value = -1;
return ret_value;
}
@@ -156,17 +156,17 @@ nh5pget_class_c ( hid_t_f *prp_id , int_f *classtype)
/*----------------------------------------------------------------------------
* Name: h5pset_preserve_c
* Purpose: Call H5Pset_preserve to set transfer property for compound
* Purpose: Call H5Pset_preserve to set transfer property for compound
* datatype
* Inputs: prp_id - property list identifier
* flag - TRUE/FALSE flag
* Inputs: prp_id - property list identifier
* flag - TRUE/FALSE flag
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Thursday, February 17, 2000
* Thursday, February 17, 2000
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pset_preserve_c ( hid_t_f *prp_id , int_f *flag)
{
int ret_value = 0;
@@ -184,22 +184,22 @@ nh5pset_preserve_c ( hid_t_f *prp_id , int_f *flag)
/*----------------------------------------------------------------------------
* Name: h5pget_preserve_c
* Purpose: Call H5Pget_preserve to set transfer property for compound
* Purpose: Call H5Pget_preserve to set transfer property for compound
* datatype
* Inputs: prp_id - property list identifier
* Outputs: flag - TRUE/FALSE flag
* Inputs: prp_id - property list identifier
* Outputs: flag - TRUE/FALSE flag
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Thursday, February 17, 2000
* Thursday, February 17, 2000
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pget_preserve_c ( hid_t_f *prp_id , int_f *flag)
{
int ret_value = 0;
hid_t c_prp_id;
int c_flag;
int c_flag;
c_prp_id = (hid_t)*prp_id;
c_flag = H5Pget_preserve(c_prp_id);
@@ -210,16 +210,16 @@ nh5pget_preserve_c ( hid_t_f *prp_id , int_f *flag)
/*----------------------------------------------------------------------------
* Name: h5pset_deflate_c
* Purpose: Call H5Pset_deflate to set deflate level
* Inputs: prp_id - property list identifier
* level - level of deflation
* Purpose: Call H5Pset_deflate to set deflate level
* Inputs: prp_id - property list identifier
* level - level of deflation
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Saturday, August 14, 1999
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pset_deflate_c ( hid_t_f *prp_id , int_f *level)
{
int ret_value = 0;
@@ -239,17 +239,17 @@ nh5pset_deflate_c ( hid_t_f *prp_id , int_f *level)
/*----------------------------------------------------------------------------
* Name: h5pset_chunk_c
* Purpose: Call H5Pset_chunk to set the sizes of chunks for a chunked
* layout dataset
* Inputs: prp_id - property list identifier
* rank - number of dimensions of each chunk
* dims - array of the size of each chunk
* layout dataset
* Inputs: prp_id - property list identifier
* rank - number of dimensions of each chunk
* dims - array of the size of each chunk
* Returns: 0 on success, -1 on failure
* Saturday, August 14, 1999
* Programmer: Elena Pourmal
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pset_chunk_c ( hid_t_f *prp_id, int_f *rank, hsize_t_f *dims )
{
int ret_value = -1;
@@ -278,23 +278,23 @@ nh5pset_chunk_c ( hid_t_f *prp_id, int_f *rank, hsize_t_f *dims )
DONE:
HDfree (c_dims);
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5pget_chunk_c
* Purpose: Call H5Pget_chunk to get the sizes of chunks for a chunked
* layout dataset for at list max_rank number of dimensions
* Inputs: prp_id - property list identifier
* max rank - maximum number of dimensions to return
* dims - array of the size of each chunk
* Inputs: prp_id - property list identifier
* max rank - maximum number of dimensions to return
* dims - array of the size of each chunk
* Returns: number of chunk's dimnesion on success, -1 on failure
* Saturday, August 14, 1999
* Programmer: Elena Pourmal
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pget_chunk_c ( hid_t_f *prp_id, int_f *max_rank, hsize_t_f *dims )
{
int ret_value = -1;
@@ -321,16 +321,16 @@ nh5pget_chunk_c ( hid_t_f *prp_id, int_f *max_rank, hsize_t_f *dims )
if (rank < 0) return ret_value;
ret_value = (int_f)rank;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5pset_fill_valuec_c
* Purpose: Call h5pset_fill_value_c to a character fill value
* Inputs: prp_id - property list identifier
* Inputs: prp_id - property list identifier
* type_id - datatype identifier (fill value is of type type_id)
* fillvalue - character value
* fillvalue - character value
* Returns: 0 on success, -1 on failure
* Saturday, August 14, 1999
* Programmer: Elena Pourmal
@@ -340,7 +340,7 @@ int_f
nh5pset_fill_valuec_c (hid_t_f *prp_id, hid_t_f *type_id, _fcd fillvalue)
{
int ret_value = -1;
/*
* Call h5pset_fill_value_c function.
*/
@@ -351,10 +351,10 @@ nh5pset_fill_valuec_c (hid_t_f *prp_id, hid_t_f *type_id, _fcd fillvalue)
/*----------------------------------------------------------------------------
* Name: h5pset_fill_value_c
* Purpose: Call H5Pset_fill_value to set a fillvalue for a dataset
* Inputs: prp_id - property list identifier
* Purpose: Call H5Pset_fill_value to set a fillvalue for a dataset
* Inputs: prp_id - property list identifier
* type_id - datatype identifier (fill value is of type type_id)
* fillvalue - fillvalue
* fillvalue - fillvalue
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Saturday, August 14, 1999
@@ -378,15 +378,15 @@ nh5pset_fill_value_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue)
if (ret < 0) return ret_value;
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5pget_fill_valuec_c
* Purpose: Call h5pget_fill_value_c to a character fill value
* Inputs: prp_id - property list identifier
* Inputs: prp_id - property list identifier
* type_id - datatype identifier (fill value is of type type_id)
* fillvalue - character value
* fillvalue - character value
* Returns: 0 on success, -1 on failure
* Saturday, August 14, 1999
* Programmer: Elena Pourmal
@@ -396,7 +396,7 @@ int_f
nh5pget_fill_valuec_c (hid_t_f *prp_id, hid_t_f *type_id, _fcd fillvalue)
{
int ret_value = -1;
/*
* Call h5pget_fill_value_c function.
*/
@@ -407,10 +407,10 @@ nh5pget_fill_valuec_c (hid_t_f *prp_id, hid_t_f *type_id, _fcd fillvalue)
/*----------------------------------------------------------------------------
* Name: h5pget_fill_value_c
* Purpose: Call H5Pget_fill_value to set a fillvalue for a dataset
* Inputs: prp_id - property list identifier
* Purpose: Call H5Pget_fill_value to set a fillvalue for a dataset
* Inputs: prp_id - property list identifier
* type_id - datatype identifier (fill value is of type type_id)
* fillvalue - fillvalue
* fillvalue - fillvalue
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Saturday, August 14, 1999
@@ -434,13 +434,13 @@ nh5pget_fill_value_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue)
if (ret < 0) return ret_value;
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5pget_version_c
* Purpose: Call H5Pget_version to get the version information
* of various objects for a file creation property list
* Inputs: prp_id - property list identifier
* of various objects for a file creation property list
* Inputs: prp_id - property list identifier
* Outputs: boot - array to put boot block version number
* freelist - array to put global freelist version number
* stab - array to put symbol table version number
@@ -475,13 +475,13 @@ nh5pget_version_c (hid_t_f *prp_id, int_f * boot,int_f * freelist, int_f * stab,
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5pget_userblock_c
* Purpose: Call H5Pget_userblock to get the size of a user block in
* Purpose: Call H5Pget_userblock to get the size of a user block in
* a file creation property list
* Inputs: prp_id - property list identifier
* Inputs: prp_id - property list identifier
* Outputs size - Size of the user-block in bytes
* Returns: 0 on success, -1 on failure
* Programmer: Xiangyang Su
@@ -507,13 +507,13 @@ nh5pget_userblock_c (hid_t_f *prp_id, hsize_t_f * size)
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5pset_userblock_c
* Purpose: Call H5Pset_userblock to set the size of a user block in
* Purpose: Call H5Pset_userblock to set the size of a user block in
* a file creation property list
* Inputs: prp_id - property list identifier
* Inputs: prp_id - property list identifier
* size - Size of the user-block in bytes
* Returns: 0 on success, -1 on failure
* Programmer: Xiangyang Su
@@ -538,13 +538,13 @@ nh5pset_userblock_c (hid_t_f *prp_id, hsize_t_f * size)
if (ret < 0) return ret_value;
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5pget_sizes_c
* Purpose: Call H5Pget_sizes to get the size of the offsets
* and lengths used in an HDF5 file
* Inputs: prp_id - property list identifier
* Purpose: Call H5Pget_sizes to get the size of the offsets
* and lengths used in an HDF5 file
* Inputs: prp_id - property list identifier
* Outputs sizeof_addr - Size of an object offset in bytes
* sizeof_size - Size of an object length in bytes
* Returns: 0 on success, -1 on failure
@@ -573,12 +573,12 @@ nh5pget_sizes_c (hid_t_f *prp_id, size_t_f * sizeof_addr, size_t_f * sizeof_size
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5pset_sizes_c
* Purpose: Call H5Pset_sizes to set the size of the offsets
* Inputs: prp_id - property list identifier
* Inputs: prp_id - property list identifier
* sizeof_addr - Size of an object offset in bytes
* sizeof_size - Size of an object length in bytes
* Returns: 0 on success, -1 on failure
@@ -605,15 +605,15 @@ nh5pset_sizes_c (hid_t_f *prp_id, size_t_f * sizeof_addr, size_t_f * sizeof_size
if (ret < 0) return ret_value;
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5pset_sym_k_c
* Purpose: Call H5Pset_sym_k to set the size of parameters used
* to control the symbol table node
* Purpose: Call H5Pset_sym_k to set the size of parameters used
* to control the symbol table node
* Inputs: prp_id - property list identifier
* ik - Symbol table tree rank
* lk - Symbol table node size
* lk - Symbol table node size
* Returns: 0 on success, -1 on failure
* Programmer: Xiangyang Su
* Friday, February 25, 2000
@@ -639,15 +639,15 @@ nh5pset_sym_k_c (hid_t_f *prp_id, int_f* ik, int_f* lk)
if (ret < 0) return ret_value;
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5pget_sym_k_c
* Purpose: Call H5Pget_sym_k to get the size of parameters used
* to control the symbol table node
* Purpose: Call H5Pget_sym_k to get the size of parameters used
* to control the symbol table node
* Inputs: prp_id - property list identifier
* Outputs: ik - Symbol table tree rank
* lk - Symbol table node size
* lk - Symbol table node size
* Returns: 0 on success, -1 on failure
* Programmer: Xiangyang Su
* Friday, February 25, 2000
@@ -672,7 +672,7 @@ nh5pget_sym_k_c (hid_t_f *prp_id, int_f* ik, int_f* lk)
if (ret < 0) return ret_value;
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5pset_istore_k_c
@@ -703,12 +703,12 @@ nh5pset_istore_k_c (hid_t_f *prp_id, int_f* ik)
if (ret < 0) return ret_value;
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5pget_istore_k_c
* Purpose: Call H5Pget_istore_k to get the size of parameters used
* to control the B-trees for indexing chunked datasets
* Purpose: Call H5Pget_istore_k to get the size of parameters used
* to control the B-trees for indexing chunked datasets
* Inputs: prp_id - property list identifier
* Outputs: ik - Symbol table tree rank
* Returns: 0 on success, -1 on failure
@@ -733,11 +733,11 @@ nh5pget_istore_k_c (hid_t_f *prp_id, int_f* ik)
if (ret < 0) return ret_value;
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5pget_driver_c
* Purpose: Call H5Pget_driver to get low-level file driver identifier
* Purpose: Call H5Pget_driver to get low-level file driver identifier
* Inputs: prp_id - property list identifier
* Outputs: driver - low-level file driver identifier
* Returns: 0 on success, -1 on failure
@@ -762,11 +762,11 @@ nh5pget_driver_c (hid_t_f *prp_id, hid_t_f* driver)
DONE:
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5pset_fapl_stdio_c
* Purpose: Call H5Pset_stdio to set the low level file driver to
* Purpose: Call H5Pset_stdio to set the low level file driver to
* use the functions declared in the stdio.h
* Inputs: prp_id - property list identifier
* Returns: 0 on success, -1 on failure
@@ -784,15 +784,15 @@ nh5pset_fapl_stdio_c (hid_t_f *prp_id)
* Call H5Pset_fapl_stdio function.
*/
c_prp_id = (hid_t)*prp_id;
ret = H5Pset_fapl_stdio(c_prp_id);
ret = H5Pset_fapl_stdio(c_prp_id);
if (ret < 0) return ret_value;
ret_value = 0;
return ret_value;
}
}
#ifdef NO_SUCH_F90_FUNCTION
/*----------------------------------------------------------------------------
* Name: h5pget_fapl_stdio_c
* Purpose: Call H5Pget_fapl_stdio to determine whther the low level file driver
* Purpose: Call H5Pget_fapl_stdio to determine whther the low level file driver
* uses the functions declared in the stdio.h
* Inputs: prp_id - property list identifier
* Outputs: io - value indicates whether the file driver uses
@@ -812,7 +812,7 @@ nh5pget_fapl_stdio_c (hid_t_f *prp_id, int_f* io)
* Call H5Pget_fapl_stdio function.
*/
c_prp_id = *prp_id;
ret = H5Pget_fapl_stdio(c_prp_id);
ret = H5Pget_fapl_stdio(c_prp_id);
if (ret < 0) return ret_value;
*io = (int_f)ret;
ret_value = 0;
@@ -823,7 +823,7 @@ nh5pget_fapl_stdio_c (hid_t_f *prp_id, int_f* io)
/*----------------------------------------------------------------------------
* Name: h5pset_fapl_sec2_c
* Purpose: Call H5Pset_fapl_sec2 to set the low level file driver to
* Purpose: Call H5Pset_fapl_sec2 to set the low level file driver to
* use the functions declared in the unistd.h
* Inputs: prp_id - property list identifier
* Returns: 0 on success, -1 on failure
@@ -841,16 +841,16 @@ nh5pset_fapl_sec2_c (hid_t_f *prp_id)
* Call H5Pset_fapl_sec2 function.
*/
c_prp_id = (hid_t)*prp_id;
ret = H5Pset_fapl_sec2(c_prp_id);
ret = H5Pset_fapl_sec2(c_prp_id);
if (ret < 0) return ret_value;
ret_value = 0;
return ret_value;
}
}
#ifdef NO_SUCH_F90_FUNCTION
/*----------------------------------------------------------------------------
* Name: h5pget_fapl_sec2_c
* Purpose: Call H5Pget_fapl_stdio to determine whther the low level file driver
* Purpose: Call H5Pget_fapl_stdio to determine whther the low level file driver
* uses the functions declared in the unistd.h
* Inputs: prp_id - property list identifier
* Outputs: sec2 - value indicates whether the file driver uses
@@ -870,7 +870,7 @@ nh5pget_fapl_sec2_c (hid_t_f *prp_id, int_f* sec2)
* Call H5Pget_fapl_sec2 function.
*/
c_prp_id = (hid_t)*prp_id;
ret = H5Pget_fapl_sec2(c_prp_id);
ret = H5Pget_fapl_sec2(c_prp_id);
if (ret < 0) return ret_value;
*sec2 = (int_f)ret;
ret_value = 0;
@@ -907,7 +907,7 @@ nh5pset_alignment_c (hid_t_f *prp_id, hsize_t_f* threshold, hsize_t_f* alignment
if (ret < 0) return ret_value;
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5pget_alignment_c
@@ -936,10 +936,10 @@ nh5pget_alignment_c (hid_t_f *prp_id, hsize_t_f* threshold, hsize_t_f* alignment
if (ret < 0) return ret_value;
*threshold = (hsize_t_f)c_threshold;
*alignment = (hsize_t_f)c_alignment;
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5pset_fapl_core_c
@@ -947,8 +947,8 @@ nh5pget_alignment_c (hid_t_f *prp_id, hsize_t_f* threshold, hsize_t_f* alignment
* to use malloc() and free()
* Inputs: prp_id - property list identifier
* increment - File block size in bytes
* flag - Boolean flag indicating whether to write the
* file contents to disk when the file is closed.
* flag - Boolean flag indicating whether to write the
* file contents to disk when the file is closed.
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* March 9, 2001
@@ -964,12 +964,12 @@ nh5pset_fapl_core_c (hid_t_f *prp_id, size_t_f* increment, int_f *flag)
hbool_t c_backing_store;
c_increment = (size_t)*increment;
c_backing_store = (hbool_t)*flag;
/*
* Call H5Pset_fapl_core function.
*/
c_prp_id = (hid_t)*prp_id;
ret = H5Pset_fapl_core(c_prp_id, c_increment, c_backing_store);
ret = H5Pset_fapl_core(c_prp_id, c_increment, c_backing_store);
if (ret < 0) return ret_value;
ret_value = 0;
return ret_value;
@@ -977,7 +977,7 @@ nh5pset_fapl_core_c (hid_t_f *prp_id, size_t_f* increment, int_f *flag)
/*----------------------------------------------------------------------------
* Name: h5pget_fapl_core_c
* Purpose: Call H5Pget_fapl_core to determine whether the file access
* Purpose: Call H5Pget_fapl_core to determine whether the file access
* property list is set to the core drive
* Inputs: prp_id - property list identifier
* Outputs increment - File block size in bytes
@@ -993,23 +993,23 @@ nh5pget_fapl_core_c (hid_t_f *prp_id, size_t_f* increment, int_f *flag)
hid_t c_prp_id;
herr_t ret = -1;
size_t c_increment = 0;
hbool_t c_backing_store;
*flag = 0;
hbool_t c_backing_store;
*flag = 0;
/*
* Call H5Pset_fapl_core function.
*/
c_prp_id = (hid_t)*prp_id;
ret = H5Pget_fapl_core(c_prp_id, &c_increment, &c_backing_store);
ret = H5Pget_fapl_core(c_prp_id, &c_increment, &c_backing_store);
if (ret < 0) return ret_value;
*increment = (size_t_f)c_increment;
if(c_backing_store > 0) *flag = 1;
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5pset_fapl_family_c
* Purpose: Call H5Pset_fapl_family to set the file access properties list
* Purpose: Call H5Pset_fapl_family to set the file access properties list
* to the family driver
* Inputs: prp_id - property list identifier
* memb_size - Logical size, in bytes, of each family member.
@@ -1034,15 +1034,15 @@ nh5pset_fapl_family_c(hid_t_f *prp_id, hsize_t_f* memb_size, hid_t_f* memb_plist
* Call H5Pset_fapl_family function.
*/
c_prp_id = (hid_t)*prp_id;
ret = H5Pset_fapl_family(c_prp_id, c_memb_size, c_memb_plist);
ret = H5Pset_fapl_family(c_prp_id, c_memb_size, c_memb_plist);
if (ret < 0) return ret_value;
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5pget_fapl_family_c
* Purpose: Call H5Pget_fapl_family to determine whether the file access
* Purpose: Call H5Pget_fapl_family to determine whether the file access
* property list is set to the family driver
* Inputs: prp_id - property list identifier
* memb_size - Logical size, in bytes, of each family member.
@@ -1065,18 +1065,18 @@ nh5pget_fapl_family_c(hid_t_f *prp_id, hsize_t_f* memb_size, hid_t_f* memb_plist
* Call H5Pget_fapl_family function.
*/
c_prp_id = (hid_t)*prp_id;
ret = H5Pget_fapl_family(c_prp_id, &c_memb_size, &c_memb_plist);
ret = H5Pget_fapl_family(c_prp_id, &c_memb_size, &c_memb_plist);
if (ret < 0) return ret_value;
*memb_size = (hsize_t_f)c_memb_size;
*memb_plist = (hid_t_f)c_memb_plist;
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5pset_cache_c
* Purpose: Call H5Pset_cache to set he number of elements in
* Purpose: Call H5Pset_cache to set he number of elements in
* the meta data cache and the total number of bytes in
* the raw data chunk cache
* Inputs: prp_id - property list identifier
@@ -1113,17 +1113,17 @@ nh5pset_cache_c(hid_t_f *prp_id, int_f* mdc_nelmts, size_t_f* rdcc_nelmts, size
if (ret < 0) return ret_value;
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5pget_cache_c
* Purpose: Call H5Pget_cache to get he number of elements in
* Purpose: Call H5Pget_cache to get he number of elements in
* the meta data cache and the total number of bytes in
* the raw data chunk cache
* Inputs: prp_id - property list identifier
* Outputs: mdc_nelmts - Number of elements (objects) in the
* meta data cache
* rdcc_nelmts - Number of elements in the raw data chunk
* rdcc_nelmts - Number of elements in the raw data chunk
* rdcc_nbytes - Total size of the raw data chunk cache, in bytes
* rdcc_w0 - Preemption policy
* Returns: 0 on success, -1 on failure
@@ -1131,7 +1131,7 @@ nh5pset_cache_c(hid_t_f *prp_id, int_f* mdc_nelmts, size_t_f* rdcc_nelmts, size
* Friday, February 25, 2000
* Modifications: Changed type of the rdcc_w0 parameter to be real_f instead of double
* Changed type of the rdcc_nelmts parameter to be int_f.
* EIP October 10, 2003
* EIP October 10, 2003
*---------------------------------------------------------------------------*/
int_f
nh5pget_cache_c(hid_t_f *prp_id, int_f* mdc_nelmts, size_t_f* rdcc_nelmts, size_t_f* rdcc_nbytes , real_f* rdcc_w0)
@@ -1140,9 +1140,9 @@ nh5pget_cache_c(hid_t_f *prp_id, int_f* mdc_nelmts, size_t_f* rdcc_nelmts, size_
hid_t c_prp_id;
herr_t ret;
int c_mdc_nelmts;
size_t c_rdcc_nelmts;
size_t c_rdcc_nelmts;
size_t c_rdcc_nbytes;
double c_rdcc_w0;
double c_rdcc_w0;
/*
* Call H5Pget_cache function.
*/
@@ -1153,21 +1153,21 @@ nh5pget_cache_c(hid_t_f *prp_id, int_f* mdc_nelmts, size_t_f* rdcc_nelmts, size_
*rdcc_nelmts = (size_t_f)c_rdcc_nelmts;
*rdcc_nbytes = (size_t_f)c_rdcc_nbytes;
*rdcc_w0 = (real_f)c_rdcc_w0;
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5pset_fapl_split_c
* Purpose: Call H5Pset_fapl_split to set he low-level driver to split meta data
* Purpose: Call H5Pset_fapl_split to set he low-level driver to split meta data
* from raw data
* Inputs: prp_id - property list identifier
* meta_len - Length of meta_ext
* meta_ext - Name of the extension for the metafile filename.
* meta_ext - Name of the extension for the metafile filename.
* meta_plist - Identifier of the meta file access property list
* raw_len - Length of raw _ext
* raw_ext - Name of the extension for the raw file filename.
* raw_ext - Name of the extension for the raw file filename.
* raw_plist - Identifier of the raw file access property list
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -1180,14 +1180,14 @@ nh5pset_fapl_split_c(hid_t_f *prp_id, int_f* meta_len, _fcd meta_ext, hid_t_f* m
int ret_value = -1;
hid_t c_prp_id;
hid_t c_meta_plist;
hid_t c_raw_plist;
hid_t c_raw_plist;
herr_t ret = -1;
char* c_meta_ext;
char* c_raw_ext;
c_meta_ext = (char *)HD5f2cstring(meta_ext, (int)*meta_len);
c_meta_ext = (char *)HD5f2cstring(meta_ext, (int)*meta_len);
if (c_meta_ext == NULL) return ret_value;
c_raw_ext = (char *)HD5f2cstring(raw_ext, (int)*raw_len);
c_raw_ext = (char *)HD5f2cstring(raw_ext, (int)*raw_len);
if (c_raw_ext == NULL) { HDfree(c_meta_ext);
return ret_value;
}
@@ -1197,7 +1197,7 @@ nh5pset_fapl_split_c(hid_t_f *prp_id, int_f* meta_len, _fcd meta_ext, hid_t_f* m
*/
c_prp_id = (hid_t)*prp_id;
c_meta_plist = (hid_t)*meta_plist;
c_raw_plist = (hid_t)*raw_plist;
c_raw_plist = (hid_t)*raw_plist;
ret = H5Pset_fapl_split(c_prp_id, c_meta_ext, c_meta_plist, c_raw_ext, c_raw_plist );
if (ret < 0) goto DONE;
@@ -1213,16 +1213,16 @@ DONE:
#ifdef NO_SUCH_F90_FUNCTION
/*----------------------------------------------------------------------------
* Name: h5pget_fapl_split_c
* Purpose: Call H5Pget_fapl_split to determine whether the file access
* Purpose: Call H5Pget_fapl_split to determine whether the file access
* property list is set to the split driver
* Inputs: prp_id - property list identifier
* meta_ext_size - Number of characters of the meta file extension
* to be copied to the meta_ext buffer
* raw_ext_size - Number of characters of the raw file extension
* to be copied to the raw_ext buffer
*Outputs: meta_ext - Name of the extension for the metafile filename.
*Outputs: meta_ext - Name of the extension for the metafile filename.
* meta_plist - Identifier of the meta file access property list
* raw_ext - Name of the extension for the raw file filename.
* raw_ext - Name of the extension for the raw file filename.
* raw_plist - Identifier of the raw file access property list
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -1235,9 +1235,9 @@ nh5pget_fapl_split_c(hid_t_f *prp_id, size_t_f* meta_ext_size , _fcd meta_ext, h
int ret_value = -1;
hid_t c_prp_id;
herr_t ret = -1;
size_t c_meta_ext_size, c_raw_ext_size;
size_t c_meta_ext_size, c_raw_ext_size;
hid_t c_meta_plist = -1;
hid_t c_raw_plist = -1;
hid_t c_raw_plist = -1;
char* c_meta_ext = NULL;
char* c_raw_ext = NULL;
@@ -1252,25 +1252,25 @@ nh5pget_fapl_split_c(hid_t_f *prp_id, size_t_f* meta_ext_size , _fcd meta_ext, h
* Call H5Pget_fapl_split function.
*/
c_prp_id = *prp_id;
ret = H5Pget_fapl_split(c_prp_id, c_meta_ext_size, c_meta_ext,&c_meta_plist, c_raw_ext_size, c_raw_ext, &c_raw_plist );
ret = H5Pget_fapl_split(c_prp_id, c_meta_ext_size, c_meta_ext,&c_meta_plist, c_raw_ext_size, c_raw_ext, &c_raw_plist );
if (ret < 0) return ret_value;
*meta_plist = c_meta_plist;
*raw_plist = c_raw_plist;
HD5packFstring(c_meta_ext, _fcdtocp(meta_ext), strlen(c_meta_ext));
HD5packFstring(c_raw_ext, _fcdtocp(raw_ext), strlen(c_raw_ext));
HD5packFstring(c_meta_ext, _fcdtocp(meta_ext), strlen(c_meta_ext));
HD5packFstring(c_raw_ext, _fcdtocp(raw_ext), strlen(c_raw_ext));
ret_value = 0;
return ret_value;
}
}
#endif /*NO_SUCH_F90_FUNCTION*/
/*----------------------------------------------------------------------------
* Name: h5pset_gc_references_c
* Purpose: Call H5Pset_gc_references to set garbage
* Purpose: Call H5Pset_gc_references to set garbage
* collecting references flag
* Inputs: prp_id - property list identifier
* gc_reference - flag for garbage collecting references
* gc_reference - flag for garbage collecting references
* for the file
* Returns: 0 on success, -1 on failure
* Programmer: Xiangyang Su
@@ -1295,14 +1295,14 @@ nh5pset_gc_references_c (hid_t_f *prp_id, int_f* gc_references)
if (ret < 0) return ret_value;
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5pget_gc_references_c
* Purpose: Call H5Pget_gc_references to set garbage
* Purpose: Call H5Pget_gc_references to set garbage
* collecting references flag
* Inputs: prp_id - property list identifier
* Outputs gc_reference - flag for garbage collecting references
* Outputs gc_reference - flag for garbage collecting references
* for the file
* Returns: 0 on success, -1 on failure
* Programmer: Xiangyang Su
@@ -1355,7 +1355,7 @@ nh5pset_layout_c (hid_t_f *prp_id, int_f* layout)
if (ret < 0) return ret_value;
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5pget_layout_c
@@ -1388,7 +1388,7 @@ nh5pget_layout_c (hid_t_f *prp_id, int_f* layout)
/*----------------------------------------------------------------------------
* Name: h5pset_filter_c
* Purpose: Call H5Pset_filter to add a filter to the filter pipeline.
* Inputs: prp_id - property list identifier
* Inputs: prp_id - property list identifier
* filter - Filter to be added to the pipeline.
* flags - Bit vector specifying certain general
* properties of the filter.
@@ -1410,7 +1410,7 @@ nh5pset_filter_c (hid_t_f *prp_id, int_f* filter, int_f* flags, size_t_f* cd_nel
H5Z_filter_t c_filter;
unsigned int * c_cd_values;
unsigned i;
c_filter = (H5Z_filter_t)*filter;
c_flags = (unsigned)*flags;
c_cd_nelmts = (size_t)*cd_nelmts;
@@ -1465,17 +1465,17 @@ nh5pget_nfilters_c (hid_t_f *prp_id, int_f* nfilters)
/*----------------------------------------------------------------------------
* Name: h5pget_filter_c
* Purpose: Call H5Pget_filter to get information about a filter
* Purpose: Call H5Pget_filter to get information about a filter
* in a pipeline
* Inputs: prp_id - property list identifier
* filter_number - Sequence number within the filter
* pipeline of the filter for which
* filter_number - Sequence number within the filter
* pipeline of the filter for which
* information is sought.
* namelen - Anticipated number of characters in name.
*Outputs: flags - Bit vector specifying certain general
*Outputs: flags - Bit vector specifying certain general
* properties of the filter.
* cd_nelmts - Number of elements in cd_value
* cd_values - Auxiliary data for the filter.
* cd_values - Auxiliary data for the filter.
* name - Name of the filter
* filter_id - filter identification number
* Returns: 0 on success, -1 on failure
@@ -1506,8 +1506,8 @@ nh5pget_filter_c(hid_t_f *prp_id, int_f* filter_number, int_f* flags, size_t_f*
if (!c_cd_values) {HDfree(c_name);
return ret_value;
}
/*
* Call H5Pget_filter function.
*/
@@ -1520,29 +1520,29 @@ nh5pget_filter_c(hid_t_f *prp_id, int_f* filter_number, int_f* flags, size_t_f*
*filter_id = (int_f)c_filter;
*cd_nelmts = (size_t_f)c_cd_nelmts;
*flags = (int_f)c_flags;
HD5packFstring(c_name, _fcdtocp(name), (int)strlen(c_name));
HD5packFstring(c_name, _fcdtocp(name), (int)strlen(c_name));
for (i = 0; i < c_cd_nelmts_in; i++)
cd_values[i] = (int_f)c_cd_values[i];
ret_value = 0;
DONE:
HDfree(c_name);
HDfree(c_cd_values);
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5pset_external_c
* Purpose: Call H5Pset_external to add an external file to the
* list of external files.
* Inputs: prp_id - property list identifier
* Inputs: prp_id - property list identifier
* name - Name of an external file
* namelen - length of name
* offset - Offset, in bytes, from the beginning of the file
* to the location in the file where the data starts.
* bytes - Number of bytes reserved in the file for the data.
* to the location in the file where the data starts.
* bytes - Number of bytes reserved in the file for the data.
* Returns: 0 on success, -1 on failure
* Programmer: Xiangyang Su
* Wednesday, February 23, 2000
@@ -1560,10 +1560,10 @@ nh5pset_external_c (hid_t_f *prp_id, _fcd name, int_f* namelen, int_f* offset, h
off_t c_offset;
c_bytes = (hsize_t) *bytes;
c_offset = (off_t) *offset;
c_namelen = (int)*namelen;
c_name = (char *)HD5f2cstring(name, c_namelen);
c_name = (char *)HD5f2cstring(name, c_namelen);
if (c_name == NULL) return ret_value;
/*
@@ -1610,14 +1610,14 @@ nh5pget_external_count_c (hid_t_f *prp_id, int_f* count)
/*----------------------------------------------------------------------------
* Name: h5pget_external_c
* Purpose: Call H5Pget_external to get nformation about an external file.
* Inputs: prp_id - property list identifier
* Purpose: Call H5Pget_external to get nformation about an external file.
* Inputs: prp_id - property list identifier
* name_size - length of name
* idx - External file index.
* idx - External file index.
*Outputs: name - Name of an external file
* offset - Offset, in bytes, from the beginning of the file
* to the location in the file where the data starts.
* bytes - Number of bytes reserved in the file for the data.
* to the location in the file where the data starts.
* bytes - Number of bytes reserved in the file for the data.
* Returns: 0 on success, -1 on failure
* Programmer: Xiangyang Su
* Wednesday, February 23, 2000
@@ -1641,35 +1641,35 @@ nh5pget_external_c(hid_t_f *prp_id, int_f *idx, size_t_f* name_size, _fcd name,
*/
if(c_namelen) c_name = (char*) HDmalloc(c_namelen + 1);
if (c_name == NULL) return ret_value;
/*
* Call H5Pget_external function.
*/
c_prp_id = (hid_t)*prp_id;
c_idx = (unsigned)*idx;
c_idx = (unsigned)*idx;
status = H5Pget_external(c_prp_id, c_idx, c_namelen, c_name, &c_offset, &size );
if (status < 0) goto DONE;
*offset = (int_f)c_offset;
*bytes = (hsize_t_f)size;
HD5packFstring(c_name, _fcdtocp(name), (int)strlen(c_name));
HD5packFstring(c_name, _fcdtocp(name), (int)strlen(c_name));
ret_value = 0;
DONE:
DONE:
HDfree(c_name);
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5pset_btree_ratios_c
* Purpose: Call H5Pset_btree_ratios to set B-tree split ratios for B-tree split ratios for a dataset transfer property list. a
* dataset transfer property list.
* Purpose: Call H5Pset_btree_ratios to set B-tree split ratios for B-tree split ratios for a dataset transfer property list. a
* dataset transfer property list.
* Inputs: prp_id - property list identifier
* left - The B-tree split ratio for left-most nodes.
* middle - The B-tree split ratio for all other nodes
* right - The B-tree split ratio for right-most nodes
* and lone nodes.
* left - The B-tree split ratio for left-most nodes.
* middle - The B-tree split ratio for all other nodes
* right - The B-tree split ratio for right-most nodes
* and lone nodes.
* Returns: 0 on success, -1 on failure
* Programmer: Xiangyang Su
* Friday, February 25, 2000
@@ -1696,17 +1696,17 @@ nh5pset_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* middle, real_f* ri
if (ret < 0) return ret_value;
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5pget_btree_ratios_c
* Purpose: Call H5Pget_btree_ratios to Gets B-tree split ratios
* for a dataset transfer property list.
* Purpose: Call H5Pget_btree_ratios to Gets B-tree split ratios
* for a dataset transfer property list.
* Inputs: prp_id - property list identifier
* left - The B-tree split ratio for left-most nodes.
* middle - The B-tree split ratio for all other nodes
* right - The B-tree split ratio for right-most nodes
* and lone nodes.
* left - The B-tree split ratio for left-most nodes.
* middle - The B-tree split ratio for all other nodes
* right - The B-tree split ratio for right-most nodes
* and lone nodes.
* Returns: 0 on success, -1 on failure
* Programmer: Xiangyang Su
* Friday, February 25, 2000
@@ -1731,11 +1731,11 @@ nh5pget_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* middle, real_f* ri
if (ret < 0) return ret_value;
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5pget_fclose_degree_c
* Purpose: Call H5Pget_fclose_degree to determine file close behavior
* Inputs: fapl_id - file access identifier
* Inputs: fapl_id - file access identifier
* Outputs:
* degree - possible values are:
* H5F_CLOSE_DEFAULT
@@ -1748,16 +1748,16 @@ nh5pget_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* middle, real_f* ri
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pget_fclose_degree_c ( hid_t_f *fapl_id , int_f *degree)
{
int ret_value = -1;
hid_t c_fapl_id;
H5F_close_degree_t c_degree;
H5F_close_degree_t c_degree;
c_fapl_id = (hid_t)*fapl_id;
if( H5Pget_fclose_degree(c_fapl_id, &c_degree) < 0) return ret_value;
*degree = (int_f)c_degree;
ret_value = 0;
return ret_value;
@@ -1766,7 +1766,7 @@ nh5pget_fclose_degree_c ( hid_t_f *fapl_id , int_f *degree)
/*----------------------------------------------------------------------------
* Name: h5pset_fclose_degree_c
* Purpose: Call H5Pset_fclose_degree to set file close behavior
* Inputs: fapl_id - file access identifier
* Inputs: fapl_id - file access identifier
* degree - possible values are:
* H5F_CLOSE_DEFAULT
* H5F_CLOSE_WEAK
@@ -1778,34 +1778,34 @@ nh5pget_fclose_degree_c ( hid_t_f *fapl_id , int_f *degree)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pset_fclose_degree_c ( hid_t_f *fapl_id , int_f *degree)
{
int ret_value = -1;
hid_t c_fapl_id;
H5F_close_degree_t c_degree;
H5F_close_degree_t c_degree;
c_fapl_id = (hid_t)*fapl_id;
c_degree = (H5F_close_degree_t)*degree;
if( H5Pset_fclose_degree(c_fapl_id, c_degree) < 0) return ret_value;
ret_value = 0;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5pset_buffer_c
* Purpose: Call H5Pset_buffer to set size of conversion buffer
* Purpose: Call H5Pset_buffer to set size of conversion buffer
* Inputs: prp_id - t`dataset trasfer property list identifier
* size - size of the buffer
* Outputs: NONE
* Outputs: NONE
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Wednesday, October 2, 2002
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pset_buffer_c ( hid_t_f *prp_id , hsize_t_f *size)
{
int ret_value = 0;
@@ -1820,16 +1820,16 @@ nh5pset_buffer_c ( hid_t_f *prp_id , hsize_t_f *size)
/*----------------------------------------------------------------------------
* Name: h5pget_buffer_c
* Purpose: Call H5Pget_buffer to get size of conversion buffer
* Purpose: Call H5Pget_buffer to get size of conversion buffer
* Inputs: prp_id - t`dataset trasfer property list identifier
* Outputs: size - size of conversion buffer
* Outputs: size - size of conversion buffer
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Wednesday, October 2, 2002
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pget_buffer_c ( hid_t_f *prp_id , hsize_t_f *size)
{
int ret_value = -1;
@@ -1854,7 +1854,7 @@ nh5pget_buffer_c ( hid_t_f *prp_id , hsize_t_f *size)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pfill_value_defined_c ( hid_t_f *prp_id , int_f *flag)
{
int ret_value = -1;
@@ -1869,7 +1869,7 @@ nh5pfill_value_defined_c ( hid_t_f *prp_id , int_f *flag)
}
/*----------------------------------------------------------------------------
* Name: h5pget_alloc_time_c
* Purpose: Call H5Pget_alloc_time to get space allocation
* Purpose: Call H5Pget_alloc_time to get space allocation
* time for dataset during creation
* Inputs: prp_id - dataset creation property list identifier
* Outputs: flag - allocation time flag
@@ -1879,7 +1879,7 @@ nh5pfill_value_defined_c ( hid_t_f *prp_id , int_f *flag)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pget_alloc_time_c ( hid_t_f *prp_id , int_f *flag)
{
int ret_value = -1;
@@ -1894,7 +1894,7 @@ nh5pget_alloc_time_c ( hid_t_f *prp_id , int_f *flag)
}
/*----------------------------------------------------------------------------
* Name: h5pset_alloc_time_c
* Purpose: Call H5Pset_alloc_time to get space allocation
* Purpose: Call H5Pset_alloc_time to get space allocation
* time for dataset during creation
* Inputs: prp_id - dataset creation property list identifier
* flag - allocation time flag
@@ -1904,7 +1904,7 @@ nh5pget_alloc_time_c ( hid_t_f *prp_id , int_f *flag)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pset_alloc_time_c ( hid_t_f *prp_id , int_f *flag)
{
int ret_value = -1;
@@ -1929,7 +1929,7 @@ nh5pset_alloc_time_c ( hid_t_f *prp_id , int_f *flag)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pget_fill_time_c ( hid_t_f *prp_id , int_f *flag)
{
int ret_value = -1;
@@ -1954,7 +1954,7 @@ nh5pget_fill_time_c ( hid_t_f *prp_id , int_f *flag)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pset_fill_time_c ( hid_t_f *prp_id , int_f *flag)
{
int ret_value = -1;
@@ -1972,14 +1972,14 @@ nh5pset_fill_time_c ( hid_t_f *prp_id , int_f *flag)
* Purpose: Call H5Pset_meta_block_size to set size of metadata block
* Inputs: prp_id - file access property list identifier
* size - size of the metadata block
* Outputs: NONE
* Outputs: NONE
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Monday, October 7, 2002
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pset_meta_block_size_c ( hid_t_f *prp_id , hsize_t_f *size)
{
int ret_value = 0;
@@ -1995,7 +1995,7 @@ nh5pset_meta_block_size_c ( hid_t_f *prp_id , hsize_t_f *size)
* Name: h5pget_meta_block_size_c
* Purpose: Call H5Pget_meta_block_size to get size of metadata block
* Inputs: prp_id - file access property list identifier
* Outputs:
* Outputs:
* size - size of the metadata block
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -2003,7 +2003,7 @@ nh5pset_meta_block_size_c ( hid_t_f *prp_id , hsize_t_f *size)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pget_meta_block_size_c ( hid_t_f *prp_id , hsize_t_f *size)
{
int ret_value = 0;
@@ -2020,14 +2020,14 @@ nh5pget_meta_block_size_c ( hid_t_f *prp_id , hsize_t_f *size)
* Purpose: Call H5Pset_sieve_buf_size to set size of datasieve buffer
* Inputs: prp_id - file access property list identifier
* size - size of the buffer
* Outputs: NONE
* Outputs: NONE
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Monday, October 7, 2002
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pset_sieve_buf_size_c ( hid_t_f *prp_id , size_t_f *size)
{
int ret_value = 0;
@@ -2043,7 +2043,7 @@ nh5pset_sieve_buf_size_c ( hid_t_f *prp_id , size_t_f *size)
* Name: h5pget_sieve_buf_size_c
* Purpose: Call H5Pget_sieve_buf_size to get size of datasieve buffer
* Inputs: prp_id - file access property list identifier
* Outputs:
* Outputs:
* size - size of the buffer
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -2051,7 +2051,7 @@ nh5pset_sieve_buf_size_c ( hid_t_f *prp_id , size_t_f *size)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pget_sieve_buf_size_c ( hid_t_f *prp_id , size_t_f *size)
{
int ret_value = 0;
@@ -2068,14 +2068,14 @@ nh5pget_sieve_buf_size_c ( hid_t_f *prp_id , size_t_f *size)
* Purpose: Call H5Pset_small_data_block_size to set size of raw small data block
* Inputs: prp_id - file access property list identifier
* size - size of the block
* Outputs: NONE
* Outputs: NONE
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Monday, October 7, 2002
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pset_small_data_block_size_c ( hid_t_f *prp_id , hsize_t_f *size)
{
int ret_value = 0;
@@ -2091,7 +2091,7 @@ nh5pset_small_data_block_size_c ( hid_t_f *prp_id , hsize_t_f *size)
* Name: h5pget_small_data_block_size_c
* Purpose: Call H5Pget_small_data_block_size to get size of raw small data block
* Inputs: prp_id - file access property list identifier
* Outputs:
* Outputs:
* size - size of the block
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -2099,7 +2099,7 @@ nh5pset_small_data_block_size_c ( hid_t_f *prp_id , hsize_t_f *size)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pget_small_data_block_size_c ( hid_t_f *prp_id , hsize_t_f *size)
{
int ret_value = 0;
@@ -2116,14 +2116,14 @@ nh5pget_small_data_block_size_c ( hid_t_f *prp_id , hsize_t_f *size)
* Purpose: Call H5Pset_hyper_vector_size to set size of the hyper vector
* Inputs: prp_id - dataset transfer property list identifier
* size - size of the vector
* Outputs: NONE
* Outputs: NONE
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Monday, October 7, 2002
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pset_hyper_vector_size_c ( hid_t_f *prp_id , size_t_f *size)
{
int ret_value = 0;
@@ -2139,7 +2139,7 @@ nh5pset_hyper_vector_size_c ( hid_t_f *prp_id , size_t_f *size)
* Name: h5pget_hyper_vector_size_c
* Purpose: Call H5Pget_hyper_vector_size to get size of the hyper vector
* Inputs: prp_id - dataset transfer property list identifier
* Outputs:
* Outputs:
* size - size of the vector
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -2147,7 +2147,7 @@ nh5pset_hyper_vector_size_c ( hid_t_f *prp_id , size_t_f *size)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pget_hyper_vector_size_c ( hid_t_f *prp_id , size_t_f *size)
{
int ret_value = 0;
@@ -2156,7 +2156,7 @@ nh5pget_hyper_vector_size_c ( hid_t_f *prp_id , size_t_f *size)
c_prp_id = (hid_t)*prp_id;
if ( H5Pget_hyper_vector_size(c_prp_id, &c_size) < 0 ) ret_value = -1;
*size = (size_t_f)c_size;
*size = (size_t_f)c_size;
return ret_value;
}
/*----------------------------------------------------------------------------
@@ -2179,7 +2179,7 @@ nh5pcreate_class_c(hid_t_f *parent, _fcd name, int_f *name_len, hid_t_f *class)
hid_t c_class;
char* c_name;
c_name = (char *)HD5f2cstring(name, (int)*name_len);
c_name = (char *)HD5f2cstring(name, (int)*name_len);
if (c_name == NULL) goto DONE;
c_parent = (hid_t)*parent;
@@ -2198,11 +2198,11 @@ DONE:
/*----------------------------------------------------------------------------
* Name: h5pregisterc_c
* Purpose: Call h5pregister_c to registers a permanent property
* Purpose: Call h5pregister_c to registers a permanent property
* Inputs: class - property list class identifier
* name - name of the new property
* name_len - length of the "name" buffer
* size - property size
* size - property size
* value - property value of character type
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -2213,7 +2213,7 @@ int_f
nh5pregisterc_c(hid_t_f *class, _fcd name, int_f *name_len, size_t_f *size, _fcd value, int_f *value_len)
{
int ret_value = -1;
/*
* Call h5pregister_c function
*/
@@ -2223,12 +2223,12 @@ nh5pregisterc_c(hid_t_f *class, _fcd name, int_f *name_len, size_t_f *size, _fcd
/*----------------------------------------------------------------------------
* Name: h5pregister_c
* Purpose: Call H5Pregister to registers a permanent property
* Purpose: Call H5Pregister to registers a permanent property
* Inputs: class - property list class identifier
* name - name of the new property
* name_len - length of the "name" buffer
* size - property size
* value - property value
* size - property size
* value - property value
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* October 11, 2002
@@ -2242,7 +2242,7 @@ nh5pregister_c(hid_t_f *class, _fcd name, int_f *name_len, size_t_f *size, void
char* c_name;
size_t c_size;
c_name = (char *)HD5f2cstring(name, (int)*name_len);
c_name = (char *)HD5f2cstring(name, (int)*name_len);
if (c_name == NULL) goto DONE;
c_size = (size_t)*size;
c_class = (hid_t)*class;
@@ -2259,11 +2259,11 @@ DONE:
}
/*----------------------------------------------------------------------------
* Name: h5pinsertc_c
* Purpose: Call h5pinsert_c to register a temporary property
* Purpose: Call h5pinsert_c to register a temporary property
* Inputs: plist - property list identifier
* name - name of the new property
* name_len - length of the "name" buffer
* size - property size
* size - property size
* value - property value of character type
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -2274,7 +2274,7 @@ int_f
nh5pinsertc_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, _fcd value, int_f *value_len)
{
int_f ret_value = -1;
/*
* Call h5pinsert_c function
*/
@@ -2288,8 +2288,8 @@ nh5pinsertc_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, _fcd v
* Inputs: plist - property list class identifier
* name - name of the new property
* name_len - length of the "name" buffer
* size - property size
* value - property value
* size - property size
* value - property value
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* October 11, 2002
@@ -2303,7 +2303,7 @@ nh5pinsert_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, void *v
char* c_name;
size_t c_size;
c_name = (char *)HD5f2cstring(name, (int)*name_len);
c_name = (char *)HD5f2cstring(name, (int)*name_len);
if (c_name == NULL) goto DONE;
c_size = (size_t)*size;
c_plist = (hid_t)*plist;
@@ -2321,7 +2321,7 @@ DONE:
/*----------------------------------------------------------------------------
* Name: h5pexist_c
* Purpose: Call H5Pexist to querie whether a property name exists
* Purpose: Call H5Pexist to querie whether a property name exists
* in a property list or class
* Inputs: plist - property list or property class identifier
* name - name of the new property
@@ -2339,7 +2339,7 @@ nh5pexist_c(hid_t_f *class, _fcd name, int_f *name_len)
char* c_name;
htri_t status;
c_name = (char *)HD5f2cstring(name, (int)*name_len);
c_name = (char *)HD5f2cstring(name, (int)*name_len);
if (c_name == NULL) goto DONE;
c_class = (hid_t)*class;
@@ -2355,8 +2355,8 @@ DONE:
}
/*----------------------------------------------------------------------------
* Name: h5pisa_class_c
* Purpose: Call H5Pisa_class to querie whether a property is a
* member of a class
* Purpose: Call H5Pisa_class to querie whether a property is a
* member of a class
* Inputs: plist - property list identifier
* class - property class identifier
* Returns: nonnegative on success, -1 on failure
@@ -2402,7 +2402,7 @@ nh5pget_size_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size)
char* c_name;
size_t c_size;
c_name = (char *)HD5f2cstring(name, (int)*name_len);
c_name = (char *)HD5f2cstring(name, (int)*name_len);
if (c_name == NULL) goto DONE;
c_plist = (hid_t)*plist;
@@ -2447,7 +2447,7 @@ nh5pget_nprops_c(hid_t_f *plist, size_t_f *nprops)
}
/*----------------------------------------------------------------------------
* Name: h5pget_class_parent_c
* Purpose: Call H5Pget_class_parent to get the parent class of
* Purpose: Call H5Pget_class_parent to get the parent class of
* a genereic property class
* Inputs: prp_id - property list to query
* Outputs: parent_id - parent classs identifier
@@ -2477,7 +2477,7 @@ nh5pget_class_parent_c(hid_t_f *prp_id, hid_t_f *parent_id)
}
/*----------------------------------------------------------------------------
* Name: h5pcopy_prop_c
* Purpose: Call H5Pcopy_prop to copy a property from one list or
* Purpose: Call H5Pcopy_prop to copy a property from one list or
* class to another
* Inputs: dst_id - identifier of destination property list
* src_id - identifier of source property list
@@ -2495,7 +2495,7 @@ nh5pcopy_prop_c(hid_t_f *dst_id, hid_t_f *src_id, _fcd name, int_f *name_len)
hid_t c_dst_id, c_src_id;
char* c_name;
c_name = (char *)HD5f2cstring(name, (int)*name_len);
c_name = (char *)HD5f2cstring(name, (int)*name_len);
if (c_name == NULL) goto DONE;
c_dst_id = (hid_t)*dst_id;
@@ -2528,7 +2528,7 @@ nh5premove_c(hid_t_f *plid, _fcd name, int_f *name_len)
hid_t c_plid;
char* c_name;
c_name = (char *)HD5f2cstring(name, (int)*name_len);
c_name = (char *)HD5f2cstring(name, (int)*name_len);
if (c_name == NULL) goto DONE;
c_plid = (hid_t)*plid;
@@ -2560,7 +2560,7 @@ nh5punregister_c(hid_t_f *class, _fcd name, int_f *name_len)
hid_t c_class;
char* c_name;
c_name = (char *)HD5f2cstring(name, (int)*name_len);
c_name = (char *)HD5f2cstring(name, (int)*name_len);
if (c_name == NULL) goto DONE;
c_class = (hid_t)*class;
@@ -2599,7 +2599,7 @@ nh5pclose_class_c(hid_t_f *class)
}
/*----------------------------------------------------------------------------
* Name: h5pget_class_name_c
* Purpose: Call H5Pget_class_name to get property class name
* Purpose: Call H5Pget_class_name to get property class name
* Inputs: class - identifier of property class
* name - ibuffer to retrieve name in
* name_len - length of the "name" buffer
@@ -2620,7 +2620,7 @@ nh5pget_class_name_c(hid_t_f *class, _fcd name, int_f *name_len)
/*
* Call H5Pget_class_name function.
*/
c_name = H5Pget_class_name(c_class);
c_name = H5Pget_class_name(c_class);
if( c_name == NULL) goto DONE;
HD5packFstring(c_name, _fcdtocp(name), (int)*name_len);
@@ -2646,7 +2646,7 @@ int_f
nh5psetc_c(hid_t_f *plist, _fcd name, int_f *name_len, _fcd value, int_f *value_len)
{
int_f ret_value = -1;
/*
* Call h5pset_c function
*/
@@ -2660,7 +2660,7 @@ nh5psetc_c(hid_t_f *plist, _fcd name, int_f *name_len, _fcd value, int_f *value_
* Inputs: plist - property list class identifier
* name - name of the new property
* name_len - length of the "name" buffer
* value - property value
* value - property value
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* October 11, 2002
@@ -2673,7 +2673,7 @@ nh5pset_c(hid_t_f *plist, _fcd name, int_f *name_len, void *value)
hid_t c_plist;
char* c_name;
c_name = (char *)HD5f2cstring(name, (int)*name_len);
c_name = (char *)HD5f2cstring(name, (int)*name_len);
if (c_name == NULL) goto DONE;
c_plist = (hid_t)*plist;
@@ -2703,7 +2703,7 @@ int_f
nh5pgetc_c(hid_t_f *plist, _fcd name, int_f *name_len, _fcd value, int_f *value_len)
{
int_f ret_value = -1;
/*
* Call h5pget_c function
*/
@@ -2717,7 +2717,7 @@ nh5pgetc_c(hid_t_f *plist, _fcd name, int_f *name_len, _fcd value, int_f *value_
* Inputs: plist - property list class identifier
* name - name of the new property
* name_len - length of the "name" buffer
* Output: value - property value
* Output: value - property value
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* October 11, 2002
@@ -2730,7 +2730,7 @@ nh5pget_c(hid_t_f *plist, _fcd name, int_f *name_len, void *value)
hid_t c_plist;
char* c_name;
c_name = (char *)HD5f2cstring(name, (int)*name_len);
c_name = (char *)HD5f2cstring(name, (int)*name_len);
if (c_name == NULL) goto DONE;
c_plist = (hid_t)*plist;
@@ -2746,8 +2746,8 @@ DONE:
}
/*----------------------------------------------------------------------------
* Name: h5pset_shuffle_c
* Purpose: Call H5Pset_shuffle
* Inputs: prp_id - property list identifier
* Purpose: Call H5Pset_shuffle
* Inputs: prp_id - property list identifier
* type_size - size of the datatype in bytes
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -2755,7 +2755,7 @@ DONE:
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pset_shuffle_c ( hid_t_f *prp_id )
{
int_f ret_value = 0;
@@ -2770,14 +2770,14 @@ nh5pset_shuffle_c ( hid_t_f *prp_id )
/*----------------------------------------------------------------------------
* Name: h5pset_fletcher32_c
* Purpose: Call H5Pset_fletcher32 to enable EDC
* Inputs: prp_id - dataset creation property list identifier
* Inputs: prp_id - dataset creation property list identifier
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Thursday, March 13, 2003
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pset_fletcher32_c ( hid_t_f *prp_id )
{
int_f ret_value = 0;
@@ -2793,7 +2793,7 @@ nh5pset_fletcher32_c ( hid_t_f *prp_id )
/*----------------------------------------------------------------------------
* Name: h5pset_edc_check_c
* Purpose: Call H5Pset_edc_check to enable EDC
* Inputs: prp_id - dataset transfer property list identifier
* Inputs: prp_id - dataset transfer property list identifier
* flag - EDC flag
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -2801,7 +2801,7 @@ nh5pset_fletcher32_c ( hid_t_f *prp_id )
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pset_edc_check_c ( hid_t_f *prp_id, int_f *flag )
{
int_f ret_value = 0;
@@ -2819,7 +2819,7 @@ nh5pset_edc_check_c ( hid_t_f *prp_id, int_f *flag )
/*----------------------------------------------------------------------------
* Name: h5pget_edc_check_c
* Purpose: Call H5Pget_edc_check to query EDC
* Inputs: prp_id - dataset transfer property list identifier
* Inputs: prp_id - dataset transfer property list identifier
* Outouts: flag - EDC flag
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -2827,7 +2827,7 @@ nh5pset_edc_check_c ( hid_t_f *prp_id, int_f *flag )
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pget_edc_check_c ( hid_t_f *prp_id, int_f *flag )
{
int_f ret_value = 0;
@@ -2843,7 +2843,7 @@ nh5pget_edc_check_c ( hid_t_f *prp_id, int_f *flag )
/*----------------------------------------------------------------------------
* Name: h5pset_family_offset_c
* Purpose: Call H5Pset_family_offset to set and offset for family driver
* Inputs: prp_id - property list identifier
* Inputs: prp_id - property list identifier
* offset - offset in bytes
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -2851,7 +2851,7 @@ nh5pget_edc_check_c ( hid_t_f *prp_id, int_f *flag )
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pset_family_offset_c ( hid_t_f *prp_id , hsize_t_f *offset)
{
int_f ret_value = 0;
@@ -2869,9 +2869,9 @@ nh5pset_family_offset_c ( hid_t_f *prp_id , hsize_t_f *offset)
/*----------------------------------------------------------------------------
* Name: h5pset_fapl_multi_c
* Purpose: Call H5Pset_fapl_multi to set multi file dirver
* Inputs: prp_id - file_creation property list identifier
* Inputs: prp_id - file_creation property list identifier
* mem_map - memory mapping array
* memb_fapl - property list for each memory usage type
* memb_fapl - property list for each memory usage type
* memb_name - array with members names
* len - array with the lenght of each name
* lenmax - lenght of the name a sdeclared in Fortran
@@ -2882,7 +2882,7 @@ nh5pset_family_offset_c ( hid_t_f *prp_id , hsize_t_f *offset)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
/*nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _fcd memb_name, int_f *len, int_f *lenmax, haddr_t_f *memb_addr, int_f *flag) */
nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _fcd memb_name, int_f *len, int_f *lenmax, real_f *memb_addr, int_f *flag)
{
@@ -2890,9 +2890,9 @@ nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f
hid_t c_prp_id;
H5FD_mem_t c_memb_map[H5FD_MEM_NTYPES];
hid_t c_memb_fapl[H5FD_MEM_NTYPES];
char *c_memb_name[H5FD_MEM_NTYPES];
haddr_t c_memb_addr[H5FD_MEM_NTYPES];
hbool_t relax;
char *c_memb_name[H5FD_MEM_NTYPES];
haddr_t c_memb_addr[H5FD_MEM_NTYPES];
hbool_t relax;
herr_t status;
char *tmp, *tmp_p, *tmp_pp;
int i;
@@ -2910,7 +2910,7 @@ nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f
*/
tmp = (char *)HD5f2cstring(memb_name, c_lenmax*(H5FD_MEM_NTYPES));
if (tmp ==NULL) return ret_value;
if (tmp ==NULL) return ret_value;
tmp_p = tmp;
for (i=0; i < H5FD_MEM_NTYPES; i++) {
c_memb_name[i] = malloc((size_t)len[i] + 1);
@@ -2921,11 +2921,11 @@ nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f
/* printf(" %d \n", len[i]);
printf("name %s \n", c_memb_name[i]);
*/
}
}
/*
* Take care of othe arguments
*/
c_prp_id = (hid_t)*prp_id;
for (i=0; i < H5FD_MEM_NTYPES; i++) {
c_memb_map[i] = (H5FD_mem_t)memb_map[i];
@@ -2933,9 +2933,9 @@ nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f
c_memb_fapl[i] = (hid_t)memb_fapl[i];
/*printf("fapl %d \n", c_memb_fapl[i]); */
if(memb_addr[i] < 0) c_memb_addr[i] = HADDR_UNDEF;
else c_memb_addr[i] = (haddr_t)(((float)memb_addr[i])*(HADDR_MAX));
else c_memb_addr[i] = (haddr_t)(((float)memb_addr[i])*(HADDR_MAX));
/*printf("address %Ld \n", c_memb_addr[i]); */
}
}
/*
* Call H5Pset_fapl_multi function
*/
@@ -2953,19 +2953,19 @@ DONE:
/*----------------------------------------------------------------------------
* Name: h5pset_fapl_multi_sc
* Purpose: Call H5Pset_fapl_multi to set multi file dirver
* Inputs: prp_id - file_creation property list identifier
* Inputs: prp_id - file_creation property list identifier
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* March 31 2003
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pset_fapl_multi_sc ( hid_t_f *prp_id , int_f *flag)
{
int_f ret_value = -1;
hid_t c_prp_id;
hbool_t relax;
hbool_t relax;
herr_t status;
relax = (hbool_t)*flag;
@@ -2982,10 +2982,10 @@ nh5pset_fapl_multi_sc ( hid_t_f *prp_id , int_f *flag)
/*----------------------------------------------------------------------------
* Name: h5pget_fapl_multi_c
* Purpose: Call H5Pget_fapl_multi to set multi file dirver
* Inputs: prp_id - file_creation property list identifier
* Inputs: prp_id - file_creation property list identifier
* lenmax - lenght of the name a sdeclared in Fortran
* Outputs: memb_map - memory mapping array
* memb_fapl - property list for each memory usage type
* memb_fapl - property list for each memory usage type
* memb_name - array with members names
* len - array with the lenght of each name
* flag - flag allowing partila access when one of the files is missing
@@ -2995,16 +2995,16 @@ nh5pset_fapl_multi_sc ( hid_t_f *prp_id , int_f *flag)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pget_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _fcd memb_name, int_f *len, int_f *lenmax, real_f *memb_addr, int_f *flag, int_f *maxlen_out)
{
int_f ret_value = -1;
hid_t c_prp_id;
H5FD_mem_t c_memb_map[H5FD_MEM_NTYPES];
hid_t c_memb_fapl[H5FD_MEM_NTYPES];
char *c_memb_name[H5FD_MEM_NTYPES];
char *c_memb_name[H5FD_MEM_NTYPES];
haddr_t c_memb_addr[H5FD_MEM_NTYPES];
hbool_t relax;
hbool_t relax;
herr_t status;
char *tmp, *tmp_p;
int i;
@@ -3018,7 +3018,7 @@ nh5pget_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f
*/
status = H5Pget_fapl_multi(c_prp_id, c_memb_map, c_memb_fapl, c_memb_name, c_memb_addr, &relax);
if ( status < 0 ) return ret_value;
if ( status < 0 ) return ret_value;
/*
* Take care of names array
@@ -3032,13 +3032,13 @@ nh5pget_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f
len[i] = (int_f)strlen(c_memb_name[i]);
length = H5_MAX(length, strlen(c_memb_name[i]));
tmp_p = tmp_p + c_lenmax;
}
}
HD5packFstring(tmp, _fcdtocp(memb_name), (int)(c_lenmax*H5FD_MEM_NTYPES));
/*
* Take care of other arguments
*/
for (i=0; i < H5FD_MEM_NTYPES; i++) {
memb_map[i] = (int_f)c_memb_map[i];
memb_fapl[i] = (hid_t_f)c_memb_fapl[i];
@@ -3048,8 +3048,8 @@ HD5packFstring(tmp, _fcdtocp(memb_name), (int)(c_lenmax*H5FD_MEM_NTYPES));
if(c_memb_addr[i] == HADDR_UNDEF) memb_addr[i] = -1;
else memb_addr[i] = (real_f) ((long)c_memb_addr[i]/HADDR_MAX);
#endif /*WIN32*/
}
*flag = (int_f)relax;
}
*flag = (int_f)relax;
*maxlen_out = (int_f)length;
ret_value = 0;
free(tmp);
@@ -3060,7 +3060,7 @@ HD5packFstring(tmp, _fcdtocp(memb_name), (int)(c_lenmax*H5FD_MEM_NTYPES));
/*----------------------------------------------------------------------------
* Name: h5pset_szip_c
* Purpose: Call H5Pset_szip to set szip compression
* Inputs: prp_id - dataset creation property list identifier
* Inputs: prp_id - dataset creation property list identifier
* options_mask
* pixels_per_block -szip compression parameters
* Returns: 0 on success, -1 on failure
@@ -3069,7 +3069,7 @@ HD5packFstring(tmp, _fcdtocp(memb_name), (int)(c_lenmax*H5FD_MEM_NTYPES));
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pset_szip_c ( hid_t_f *prp_id , int_f *options_mask, int_f *pixels_per_block)
{
int_f ret_value = -1;
@@ -3093,7 +3093,7 @@ nh5pset_szip_c ( hid_t_f *prp_id , int_f *options_mask, int_f *pixels_per_block)
/*----------------------------------------------------------------------------
* Name: h5pall_filters_avail_c
* Purpose: Call H5Pall_filters_avail
* Inputs: prp_id - dataset creation property list identifier
* Inputs: prp_id - dataset creation property list identifier
* Outputs: status - logical flag
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -3101,13 +3101,13 @@ nh5pset_szip_c ( hid_t_f *prp_id , int_f *options_mask, int_f *pixels_per_block)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5pall_filters_avail_c ( hid_t_f *prp_id , int_f *status)
{
int_f ret_value = -1;
hid_t c_prp_id;
htri_t c_status;
c_prp_id = (hid_t)*prp_id;
/*
@@ -3123,15 +3123,15 @@ nh5pall_filters_avail_c ( hid_t_f *prp_id , int_f *status)
}
/*----------------------------------------------------------------------------
* Name: h5pget_filter_by_id_c
* Purpose: Call H5Pget_filter_by_id to get information about a filter
* Purpose: Call H5Pget_filter_by_id to get information about a filter
* in a pipeline
* Inputs: prp_id - property list identifier
* filter_id - filter id
* namelen - Anticipated number of characters in name.
*Outputs: flags - Bit vector specifying certain general
*Outputs: flags - Bit vector specifying certain general
* properties of the filter.
* cd_nelmts - Number of elements in cd_value
* cd_values - Auxiliary data for the filter.
* cd_values - Auxiliary data for the filter.
* name - Name of the filter
* Returns: 0 on success, -1 on failure
* Programmer: Elena POurmal
@@ -3161,8 +3161,8 @@ nh5pget_filter_by_id_c(hid_t_f *prp_id, int_f* filter_id, int_f* flags, size_t_f
if (!c_cd_values) {HDfree(c_name);
return ret_value;
}
/*
* Call H5Pget_filter function.
*/
@@ -3173,23 +3173,23 @@ nh5pget_filter_by_id_c(hid_t_f *prp_id, int_f* filter_id, int_f* flags, size_t_f
*cd_nelmts = (size_t_f)c_cd_nelmts;
*flags = (int_f)c_flags;
HD5packFstring(c_name, _fcdtocp(name), (int)strlen(c_name));
HD5packFstring(c_name, _fcdtocp(name), (int)strlen(c_name));
for (i = 0; i < c_cd_nelmts_in; i++)
cd_values[i] = (int_f)c_cd_values[i];
ret_value = 0;
DONE:
HDfree(c_name);
HDfree(c_cd_values);
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5pmodify_filter_c
* Purpose: Call H5Pmodify_filter to modify a filter
* Inputs: prp_id - property list identifier
* Inputs: prp_id - property list identifier
* filter - Filter to be modified
* flags - Bit vector specifying certain general
* properties of the filter.
@@ -3211,7 +3211,7 @@ nh5pmodify_filter_c (hid_t_f *prp_id, int_f* filter, int_f* flags, size_t_f* cd_
H5Z_filter_t c_filter;
unsigned int * c_cd_values;
unsigned i;
c_filter = (H5Z_filter_t)*filter;
c_flags = (unsigned)*flags;
c_cd_nelmts = (size_t)*cd_nelmts;
@@ -3237,7 +3237,7 @@ DONE:
/*----------------------------------------------------------------------------
* Name: h5premove_filter_c
* Purpose: Call H5Premove_filter to delete one or more filters
* Inputs: prp_id - property list identifier
* Inputs: prp_id - property list identifier
* filter - Filter to be deleted
* Returns: 0 on success, -1 on failure
* Programmer: Quincey Koziol
@@ -3250,7 +3250,7 @@ nh5premove_filter_c (hid_t_f *prp_id, int_f* filter)
int_f ret_value = -1;
hid_t c_prp_id;
H5Z_filter_t c_filter;
c_filter = (H5Z_filter_t)*filter;
c_prp_id = (hid_t)*prp_id;
+33 -33
View File
@@ -19,10 +19,10 @@
/*----------------------------------------------------------------------------
* Name: h5rcreate_object_c
* Purpose: Call H5Rcreate to create a reference to an object
* Inputs: loc_id - file or group identifier
* name - name of the dataset
* Inputs: loc_id - file or group identifier
* name - name of the dataset
* namelen - name length
* Outputs: ref - reference to the object
* Outputs: ref - reference to the object
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Wednesday, December 1, 1999
@@ -42,7 +42,7 @@ nh5rcreate_object_c (haddr_t_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen)
* Convert FORTRAN name to C name
*/
c_namelen = *namelen;
c_name = (char *)HD5f2cstring(name, c_namelen);
c_name = (char *)HD5f2cstring(name, c_namelen);
if (c_name == NULL) return ret_value;
/*
@@ -56,19 +56,19 @@ nh5rcreate_object_c (haddr_t_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen)
*ref=(haddr_t_f)ref_c;
ret_value = 0;
}
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5rcreate_region_c
* Purpose: Call H5Rcreate to create a reference to dataset region
* region
* Inputs: loc_id - file or group identifier
* name - name of the dataset
* region
* Inputs: loc_id - file or group identifier
* name - name of the dataset
* namelen - name length
* space_id - dataset space identifier
* Outputs: ref - reference to the dataset region
* Outputs: ref - reference to the dataset region
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Wednesday, December 1, 1999
@@ -89,7 +89,7 @@ nh5rcreate_region_c (int_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen, hid
* Convert FORTRAN name to C name
*/
c_namelen = *namelen;
c_name = (char *)HD5f2cstring(name, c_namelen);
c_name = (char *)HD5f2cstring(name, c_namelen);
if (c_name == NULL) return ret_value;
/*
@@ -105,14 +105,14 @@ nh5rcreate_region_c (int_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen, hid
ret_value = 0;
}
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5rdereference_region_c
* Purpose: Call H5Rdereference to dereference to dataset region
* Inputs: dset_id - dataset identifier
* ref - reference to the dataset region
* Outputs: obj_id - dereferenced dataset identifier
* Inputs: dset_id - dataset identifier
* ref - reference to the dataset region
* Outputs: obj_id - dereferenced dataset identifier
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Wednesday, December 1, 1999
@@ -135,17 +135,17 @@ nh5rdereference_region_c (hid_t_f *dset_id, int_f *ref, hid_t_f *obj_id)
c_obj_id = H5Rdereference(c_dset_id, H5R_DATASET_REGION, &ref_c);
if(c_obj_id < 0) return ret_value;
*obj_id = (hid_t_f)c_obj_id;
ret_value = 0;
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5rdereference_object_c
* Purpose: Call H5Rdereference to dereference an object
* Inputs: dset_id - dataset identifier
* ref - reference to an object
* Outputs: obj_id - dereferenced object identifier
* Purpose: Call H5Rdereference to dereference an object
* Inputs: dset_id - dataset identifier
* ref - reference to an object
* Outputs: obj_id - dereferenced object identifier
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Wednesday, December 1, 1999
@@ -168,16 +168,16 @@ nh5rdereference_object_c (hid_t_f *dset_id, haddr_t_f *ref, hid_t_f *obj_id)
c_obj_id = H5Rdereference(c_dset_id, H5R_OBJECT, &ref_c);
if(c_obj_id < 0) return ret_value;
*obj_id = (hid_t_f)c_obj_id;
ret_value = 0;
ret_value = 0;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5rget_region_region_object_c
* Purpose: Call H5Rget_region to dereference dataspace region
* Inputs: dset_id - dataset identifier
* ref - reference to the dataset region
* Outputs: space_id - dereferenced dataset dataspace identifier
* Purpose: Call H5Rget_region to dereference dataspace region
* Inputs: dset_id - dataset identifier
* ref - reference to the dataset region
* Outputs: space_id - dereferenced dataset dataspace identifier
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Wednesday, December 1, 1999
@@ -200,17 +200,17 @@ nh5rget_region_region_c (hid_t_f *dset_id, int_f *ref, hid_t_f *space_id)
c_space_id = H5Rget_region(c_dset_id, H5R_DATASET_REGION, &ref_c);
if(c_space_id < 0) return ret_value;
*space_id = (hid_t_f)c_space_id;
ret_value = 0;
ret_value = 0;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5rget_object_type_obj_c
* Purpose: Call H5Rget_object_type to retrieve the type of the object reference points
* to
* Inputs: dset_id - dataset identifier
* ref - reference to the dataset region
* Outputs: obj_type - type of dereferenced object
* Purpose: Call H5Rget_object_type to retrieve the type of the object reference points
* to
* Inputs: dset_id - dataset identifier
* ref - reference to the dataset region
* Outputs: obj_type - type of dereferenced object
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Wednesday, December 1, 1999
@@ -233,6 +233,6 @@ nh5rget_object_type_obj_c (hid_t_f *dset_id, haddr_t_f *ref, int_f *obj_type)
c_obj_type = H5Rget_obj_type(c_dset_id, H5R_OBJECT, &ref_c);
if(c_obj_type < 0) return ret_value;
*obj_type = (int_f)c_obj_type;
ret_value = 0;
ret_value = 0;
return ret_value;
}
+129 -129
View File
@@ -16,7 +16,7 @@
/*----------------------------------------------------------------------------
* Name: h5screate_simple_c
* Purpose: Call H5Screate_simple to create a dataspace
* Purpose: Call H5Screate_simple to create a dataspace
* Inputs: rank - number of dimensions of dataspace
* dims - array of the size of each dimension
maxdims - an array of the maximum size of each dimension
@@ -27,7 +27,7 @@
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5screate_simple_c ( int_f *rank, hsize_t_f *dims, hsize_t_f *maxdims, hid_t_f *space_id )
{
int ret_value = -1;
@@ -46,7 +46,7 @@ nh5screate_simple_c ( int_f *rank, hsize_t_f *dims, hsize_t_f *maxdims, hid_t_f
*/
for (i = 0; i < *rank ; i++) {
c_dims[i] = dims[*rank - i - 1];
c_maxdims[i] = maxdims[*rank - i - 1];
c_maxdims[i] = maxdims[*rank - i - 1];
}
c_space_id = H5Screate_simple(*rank, c_dims, c_maxdims);
@@ -57,13 +57,13 @@ nh5screate_simple_c ( int_f *rank, hsize_t_f *dims, hsize_t_f *maxdims, hid_t_f
HDfree (c_dims);
HDfree (c_maxdims);
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5sclose_c
* Purpose: Call H5Sclose to close the dataspace
* Purpose: Call H5Sclose to close the dataspace
* Inputs: space_id - identifier of the dataspace to be closed
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -71,12 +71,12 @@ nh5screate_simple_c ( int_f *rank, hsize_t_f *dims, hsize_t_f *maxdims, hid_t_f
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5sclose_c ( hid_t_f *space_id )
{
int ret_value = 0;
hid_t c_space_id;
c_space_id = *space_id;
if ( H5Sclose(c_space_id) < 0 ) ret_value = -1;
return ret_value;
@@ -85,7 +85,7 @@ nh5sclose_c ( hid_t_f *space_id )
/*----------------------------------------------------------------------------
* Name: h5screate_c
* Purpose: Call H5Screate to create a dataspace
* Purpose: Call H5Screate to create a dataspace
* Inputs: classtype - type of the dataspace class
* Outputs: space_id - identifier of the created dataspace
* Returns: 0 on success, -1 on failure
@@ -94,14 +94,14 @@ nh5sclose_c ( hid_t_f *space_id )
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5screate_c ( int_f *classtype, hid_t_f *space_id )
{
H5S_class_t c_classtype;
int ret_value = 0;
hid_t c_space_id;
c_classtype = (H5S_class_t) *classtype;
c_space_id = H5Screate(c_classtype);
c_space_id = H5Screate(c_classtype);
if ( c_space_id < 0 ) ret_value = -1;
*space_id = (hid_t_f) c_space_id;
@@ -110,8 +110,8 @@ nh5screate_c ( int_f *classtype, hid_t_f *space_id )
/*----------------------------------------------------------------------------
* Name: h5scopy_c
* Purpose: Call H5Scopy to copy dataspace
* Inputs: space_id - identifier of the dataspace to be copied
* Purpose: Call H5Scopy to copy dataspace
* Inputs: space_id - identifier of the dataspace to be copied
* Outputs: new_space_id - identifier of the new datspace
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -119,7 +119,7 @@ nh5screate_c ( int_f *classtype, hid_t_f *space_id )
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5scopy_c( hid_t_f *space_id , hid_t_f *new_space_id)
{
int ret_value = 0;
@@ -127,7 +127,7 @@ nh5scopy_c( hid_t_f *space_id , hid_t_f *new_space_id)
hid_t c_space_id;
c_space_id = *space_id;
c_new_space_id = H5Scopy(c_space_id);
c_new_space_id = H5Scopy(c_space_id);
if ( c_new_space_id < 0 ) ret_value = -1;
*new_space_id = (hid_t_f)c_new_space_id;
@@ -136,11 +136,11 @@ nh5scopy_c( hid_t_f *space_id , hid_t_f *new_space_id)
/*----------------------------------------------------------------------------
* Name: h5sget_select_hyper_nblocks_c
* Purpose: Call H5SH5Sget_select_hyper_nblocks to
* get the the number of hyperslab blocks in
* the current dataspace selection if successful
* Purpose: Call H5SH5Sget_select_hyper_nblocks to
* get the the number of hyperslab blocks in
* the current dataspace selection if successful
* Inputs: space_id - identifier of the dataspace
* Outputs: num_blocks - number of hyperslab blocks in
* Outputs: num_blocks - number of hyperslab blocks in
* the current dataspace selection
* Returns: 0 on success, -1 on failure
* Programmer: Xiangyang Su
@@ -148,7 +148,7 @@ nh5scopy_c( hid_t_f *space_id , hid_t_f *new_space_id)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5sget_select_hyper_nblocks_c( hid_t_f *space_id , hssize_t_f * num_blocks)
{
int ret_value = 0;
@@ -165,11 +165,11 @@ nh5sget_select_hyper_nblocks_c( hid_t_f *space_id , hssize_t_f * num_blocks)
/*----------------------------------------------------------------------------
* Name: h5sget_select_elem_npoints_c
* Purpose: Call H5Sget_select_elem_npoints to
* get the the number of element points in
* the current dataspace selection if successful
* Purpose: Call H5Sget_select_elem_npoints to
* get the the number of element points in
* the current dataspace selection if successful
* Inputs: space_id - identifier of the dataspace
* Outputs: num_points - number of element points in
* Outputs: num_points - number of element points in
* the current dataspace selection
* Returns: 0 on success, -1 on failure
* Programmer: Xiangyang Su
@@ -177,7 +177,7 @@ nh5sget_select_hyper_nblocks_c( hid_t_f *space_id , hssize_t_f * num_blocks)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5sget_select_elem_npoints_c( hid_t_f *space_id , hssize_t_f * num_points)
{
int ret_value = 0;
@@ -194,26 +194,26 @@ nh5sget_select_elem_npoints_c( hid_t_f *space_id , hssize_t_f * num_points)
/*----------------------------------------------------------------------------
* Name: h5sget_select_hyper_blocklist_c
* Purpose: Call H5Sget_select_hyper_blocklist to
* get a list of the hyperslab blocks currently selected
* Purpose: Call H5Sget_select_hyper_blocklist to
* get a list of the hyperslab blocks currently selected
* Starting with the startblock-th block in the
* list of blocks, num_blocks blocks are put into the user's
* buffer. If the user's buffer fills up before numblocks
* buffer. If the user's buffer fills up before numblocks
* blocks are inserted, the buffer
* will contain only as many blocks as fit.
* will contain only as many blocks as fit.
* Inputs: space_id - identifier of the dataspace
* startblock - Hyperslab block to start with
* num_blocks - number of hyperslab blocks in
* num_blocks - number of hyperslab blocks in
* the current dataspace selection
* Outputs: buf - List of hyperslab blocks selected
* Outputs: buf - List of hyperslab blocks selected
* Returns: 0 on success, -1 on failure
* Programmer: Xiangyang Su
* Monday, November 15, 1999
* Modifications:
*---------------------------------------------------------------------------*/
int_f
nh5sget_select_hyper_blocklist_c( hid_t_f *space_id ,hsize_t_f * startblock,
int_f
nh5sget_select_hyper_blocklist_c( hid_t_f *space_id ,hsize_t_f * startblock,
hsize_t_f * num_blocks, hsize_t_f * buf)
{
int ret_value = -1;
@@ -234,7 +234,7 @@ nh5sget_select_hyper_blocklist_c( hid_t_f *space_id ,hsize_t_f * startblock,
c_buf = (hsize_t*)malloc(sizeof(hsize_t)*(size_t)(c_num_blocks*2*rank));
if (!c_buf) return ret_value;
ret_value = H5Sget_select_hyper_blocklist(c_space_id, c_startblock,
ret_value = H5Sget_select_hyper_blocklist(c_space_id, c_startblock,
c_num_blocks, c_buf);
for(i = 0; i < c_num_blocks*2*rank; i++)
{
@@ -247,20 +247,20 @@ nh5sget_select_hyper_blocklist_c( hid_t_f *space_id ,hsize_t_f * startblock,
/*----------------------------------------------------------------------------
* Name: h5sget_select_bounds_c
* Purpose: Call H5Sget_select_bounds to retrieve the coordinates
* of the bounding box containing the current selection
* Purpose: Call H5Sget_select_bounds to retrieve the coordinates
* of the bounding box containing the current selection
* and places them into user-supplied buffers
* Inputs: space_id - identifier of the dataspace
* Outputs: start - Starting coordinates of the bounding box
* end - Ending coordinates of the bounding box,
* i.e., the coordinates of the diagonally opposite corne
* i.e., the coordinates of the diagonally opposite corne
* Returns: 0 on success, -1 on failure
* Programmer: Xiangyang Su
* Wednesday, November 17, 1999
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5sget_select_bounds_c( hid_t_f *space_id , hsize_t_f * start, hsize_t_f * end)
{
int ret_value = -1;
@@ -295,25 +295,25 @@ nh5sget_select_bounds_c( hid_t_f *space_id , hsize_t_f * start, hsize_t_f * end)
/*----------------------------------------------------------------------------
* Name: h5sget_select_elem_pointlist_c
* Purpose: Call H5Sget_select_elem_pointlist
* get a list of element points in the
* current dataspace selectin.
* get a list of element points in the
* current dataspace selectin.
* Starting with the startpoint-th point in the
* list of points, numpoints points are put into the user's
* buffer. If the user's buffer fills up before numpoints
* buffer. If the user's buffer fills up before numpoints
* points are inserted, the buffer
* will contain only as many points as fit.
* will contain only as many points as fit.
* Inputs: space_id - identifier of the dataspace
* startpoint - Element point to start with
* numpoints - Number of element points to get
* Outputs: buf - List of element points selected
* numpoints - Number of element points to get
* Outputs: buf - List of element points selected
* Returns: 0 on success, -1 on failure
* Programmer: Xiangyang Su
* Wednesday, November 17, 1999
* Modifications:
*---------------------------------------------------------------------------*/
int_f
nh5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint,
int_f
nh5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint,
hsize_t_f * numpoints, hsize_t_f * buf)
{
int ret_value = -1;
@@ -328,17 +328,17 @@ nh5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint,
rank = H5Sget_simple_extent_ndims(c_space_id);
if (rank < 0 ) return ret_value;
c_startpoint = (hsize_t)*startpoint;
c_startpoint = (hsize_t)*startpoint;
c_buf = (hsize_t*)malloc(sizeof(hsize_t)*(size_t)(c_num_points*rank));
if (!c_buf) return ret_value;
ret_value = H5Sget_select_elem_pointlist(c_space_id, c_startpoint,
ret_value = H5Sget_select_elem_pointlist(c_space_id, c_startpoint,
c_num_points, c_buf);
for (i = c_num_points*rank-1; i >= 0; i--) {
buf[i] = (hsize_t_f)(c_buf[i]+1);
}
if (ret_value >= 0 ) ret_value = 0;
HDfree(c_buf);
return ret_value;
@@ -348,15 +348,15 @@ nh5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint,
/*----------------------------------------------------------------------------
* Name: h5sselect_all_c
* Purpose: Call H5Sselect_all to select entire dataspace
* Inputs: space_id - identifier of the dataspace
* Purpose: Call H5Sselect_all to select entire dataspace
* Inputs: space_id - identifier of the dataspace
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Tuesday, August 10, 1999
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5sselect_all_c ( hid_t_f *space_id )
{
int ret_value = 0;
@@ -369,15 +369,15 @@ nh5sselect_all_c ( hid_t_f *space_id )
/*----------------------------------------------------------------------------
* Name: h5sselect_none_c
* Purpose: Call H5Sselect_none to reset the selection region
* Inputs: space_id - identifier of the dataspace
* Purpose: Call H5Sselect_none to reset the selection region
* Inputs: space_id - identifier of the dataspace
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Tuesday, August 10, 1999
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5sselect_none_c ( hid_t_f *space_id )
{
int ret_value = 0;
@@ -391,8 +391,8 @@ nh5sselect_none_c ( hid_t_f *space_id )
/*----------------------------------------------------------------------------
* Name: h5sselect_valid_c
* Purpose: Call H5Sselect_valid to verify that selection
* is within dataspace extent.
* Inputs: space_id - identifier of the dataspace
* is within dataspace extent.
* Inputs: space_id - identifier of the dataspace
* Outputs: flag - 0 if not valid selection, 1 if is valid selection,
* and negative on failure.
* Returns: 0 on success, -1 on failure
@@ -401,7 +401,7 @@ nh5sselect_none_c ( hid_t_f *space_id )
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5sselect_valid_c ( hid_t_f *space_id , int_f *flag )
{
int ret_value = 0;
@@ -418,16 +418,16 @@ nh5sselect_valid_c ( hid_t_f *space_id , int_f *flag )
/*----------------------------------------------------------------------------
* Name: h5sget_simple_extent_npoints_c
* Purpose: Call H5Sget_simple_extent_npoints to determine the number
* of elements in a dataspace
* Inputs: space_id - identifier of the dataspace
* Outputs: npoints - number of points in a dataspace
* of elements in a dataspace
* Inputs: space_id - identifier of the dataspace
* Outputs: npoints - number of points in a dataspace
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Wednesday, August 11, 1999
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5sget_simple_extent_npoints_c ( hid_t_f *space_id , hsize_t_f *npoints )
{
int ret_value = 0;
@@ -444,16 +444,16 @@ nh5sget_simple_extent_npoints_c ( hid_t_f *space_id , hsize_t_f *npoints )
/*----------------------------------------------------------------------------
* Name: h5sget_select_npoints_c
* Purpose: Call H5Sget_select_npoints to determine the number
* of elements in a dataspace selection
* Inputs: space_id - identifier of the dataspace
* Outputs: npoints - number of points in a dataspace selection
* of elements in a dataspace selection
* Inputs: space_id - identifier of the dataspace
* Outputs: npoints - number of points in a dataspace selection
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Wednesday, August 11, 1999
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5sget_select_npoints_c ( hid_t_f *space_id , hssize_t_f *npoints )
{
int ret_value = 0;
@@ -470,21 +470,21 @@ nh5sget_select_npoints_c ( hid_t_f *space_id , hssize_t_f *npoints )
/*----------------------------------------------------------------------------
* Name: h5sget_simple_extent_ndims_c
* Purpose: Call H5Sget_simple_extent_ndims to determine the number
* dimensions
* Inputs: space_id - identifier of the dataspace
* Outputs: rank - number of dataspace dimensions
* dimensions
* Inputs: space_id - identifier of the dataspace
* Outputs: rank - number of dataspace dimensions
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Wednesday, August 11, 1999
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5sget_simple_extent_ndims_c ( hid_t_f *space_id , int_f *ndims )
{
int ret_value = 0;
hid_t c_space_id;
int c_ndims;
int c_ndims;
c_space_id = *space_id;
c_ndims = H5Sget_simple_extent_ndims(c_space_id);
@@ -496,22 +496,22 @@ nh5sget_simple_extent_ndims_c ( hid_t_f *space_id , int_f *ndims )
/*----------------------------------------------------------------------------
* Name: h5sget_simple_extent_type_c
* Purpose: Call H5Sget_simple_extent_type to determine the class type
* of a dataspace
* Inputs: space_id - identifier of the dataspace
* of a dataspace
* Inputs: space_id - identifier of the dataspace
* Outputs: classtype - class type; possible values are:
* H5S_SCALAR_F (0), H5S_SIMPLE_F (1), H5S_NULL_F (2)
* H5S_SCALAR_F (0), H5S_SIMPLE_F (1), H5S_NULL_F (2)
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Wednesday, August 11, 1999
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5sget_simple_extent_type_c ( hid_t_f *space_id , int_f *classtype)
{
int ret_value = 0;
hid_t c_space_id;
H5S_class_t c_classtype;
H5S_class_t c_classtype;
c_space_id = *space_id;
c_classtype = H5Sget_simple_extent_type(c_space_id);
@@ -527,17 +527,17 @@ nh5sget_simple_extent_type_c ( hid_t_f *space_id , int_f *classtype)
/*----------------------------------------------------------------------------
* Name: h5soffset_simple_c
* Purpose: Call H5Soffset_simple to set the offset of a simple
* dataspace
* Inputs: space_id - identifier of the dataspace
* offset - offset array
* Purpose: Call H5Soffset_simple to set the offset of a simple
* dataspace
* Inputs: space_id - identifier of the dataspace
* offset - offset array
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Wednesday, August 11, 1999
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5soffset_simple_c ( hid_t_f *space_id , hssize_t_f *offset)
{
int ret_value = -1;
@@ -568,10 +568,10 @@ nh5soffset_simple_c ( hid_t_f *space_id , hssize_t_f *offset)
/*----------------------------------------------------------------------------
* Name: h5sset_extent_simple_c
* Purpose: Call H5Sset_extent_simple to set or reset size of
* existing dataspace
* Inputs: space_id - identifier of the dataspace
* existing dataspace
* Inputs: space_id - identifier of the dataspace
* rank - dataspace rank
* current_size - array with the new dimension sizes
* current_size - array with the new dimension sizes
* maximum_size - aray with maximum sizes of dimensions
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -579,7 +579,7 @@ nh5soffset_simple_c ( hid_t_f *space_id , hssize_t_f *offset)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5sset_extent_simple_c ( hid_t_f *space_id , int_f *rank, hsize_t_f *current_size, hsize_t_f *maximum_size)
{
int ret_value = -1;
@@ -603,7 +603,7 @@ nh5sset_extent_simple_c ( hid_t_f *space_id , int_f *rank, hsize_t_f *current_si
c_current_size[i] = (hsize_t)current_size[*rank - i - 1];
c_maximum_size[i] = (hsize_t)maximum_size[*rank - i - 1];
}
c_space_id = *space_id;
c_rank = *rank;
status = H5Sset_extent_simple(c_space_id, c_rank, c_current_size, c_maximum_size);
@@ -615,10 +615,10 @@ nh5sset_extent_simple_c ( hid_t_f *space_id , int_f *rank, hsize_t_f *current_si
/*----------------------------------------------------------------------------
* Name: h5sget_simple_extent_dims_c
* Purpose: Call H5Sget_simple_extent_dims to retrieve sizes of an
* existing dataspace
* Inputs: space_id - identifier of the dataspace
* Outputs: dims - array with the dimension sizes
* Purpose: Call H5Sget_simple_extent_dims to retrieve sizes of an
* existing dataspace
* Inputs: space_id - identifier of the dataspace
* Outputs: dims - array with the dimension sizes
* maxdims - aray with maximum sizes of dimensions
* Returns: number of dataspace dimensions (rank) on success, -1 on failure
* Programmer: Elena Pourmal
@@ -626,7 +626,7 @@ nh5sset_extent_simple_c ( hid_t_f *space_id , int_f *rank, hsize_t_f *current_si
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5sget_simple_extent_dims_c ( hid_t_f *space_id , hsize_t_f *dims, hsize_t_f *maxdims)
{
int ret_value = -1;
@@ -664,9 +664,9 @@ nh5sget_simple_extent_dims_c ( hid_t_f *space_id , hsize_t_f *dims, hsize_t_f *m
/*----------------------------------------------------------------------------
* Name: h5sis_simple_c
* Purpose: Call H5Sis_simple to detrmine if the dataspace
* is simple.
* Inputs: space_id - identifier of the dataspace
* Purpose: Call H5Sis_simple to detrmine if the dataspace
* is simple.
* Inputs: space_id - identifier of the dataspace
* Outputs: flag - 0 if not simple, 1 if is simple,
* and negative on failure.
* Returns: 0 on success, -1 on failure
@@ -675,7 +675,7 @@ nh5sget_simple_extent_dims_c ( hid_t_f *space_id , hsize_t_f *dims, hsize_t_f *m
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5sis_simple_c ( hid_t_f *space_id , int_f *flag )
{
int ret_value = 0;
@@ -692,8 +692,8 @@ nh5sis_simple_c ( hid_t_f *space_id , int_f *flag )
/*----------------------------------------------------------------------------
* Name: h5sextent_copy_c
* Purpose: Call H5Sextent_copy to copy an extent of dataspace
* Inputs: dest_space_id - identifier of the destination dataspace
* Purpose: Call H5Sextent_copy to copy an extent of dataspace
* Inputs: dest_space_id - identifier of the destination dataspace
* source_space_id - identifier of the source dataspace
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -701,7 +701,7 @@ nh5sis_simple_c ( hid_t_f *space_id , int_f *flag )
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5sextent_copy_c ( hid_t_f *dest_space_id , hid_t_f *source_space_id)
{
int ret_value = 0;
@@ -710,22 +710,22 @@ nh5sextent_copy_c ( hid_t_f *dest_space_id , hid_t_f *source_space_id)
c_dest_space_id = *dest_space_id;
c_source_space_id = *source_space_id;
status = H5Sextent_copy(c_dest_space_id, c_source_space_id);
status = H5Sextent_copy(c_dest_space_id, c_source_space_id);
if ( status < 0 ) ret_value = -1;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5sset_extent_none_c
* Purpose: Call H5Sset_extent_none to remove extent from a dataspace
* Inputs: space_id - dataspace identifier
* Purpose: Call H5Sset_extent_none to remove extent from a dataspace
* Inputs: space_id - dataspace identifier
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Wednesday, August 11, 1999
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5sset_extent_none_c ( hid_t_f *space_id )
{
int ret_value = 0;
@@ -733,19 +733,19 @@ nh5sset_extent_none_c ( hid_t_f *space_id )
herr_t status;
c_space_id = *space_id;
status = H5Sset_extent_none(c_space_id);
status = H5Sset_extent_none(c_space_id);
if ( status < 0 ) ret_value = -1;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5sselect_hyperslab_c
* Purpose: Call H5Sselect_hyperslab to select a hyperslab
* Inputs: space_id - identifier of the dataspace
* Purpose: Call H5Sselect_hyperslab to select a hyperslab
* Inputs: space_id - identifier of the dataspace
* operator - defines how the new selection is combined
* with the previous one; current values are
* H5S_SELECT_SET_F (0) and H5S_SELECT_OR_F (1)
* start - offset of start of hyperslab
* with the previous one; current values are
* H5S_SELECT_SET_F (0) and H5S_SELECT_OR_F (1)
* start - offset of start of hyperslab
* count - number of blocks included in the hyperslab
* stride - hyperslab stride (interval between blocks)
* block - size of block in the hyperslab
@@ -755,7 +755,7 @@ nh5sset_extent_none_c ( hid_t_f *space_id )
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5sselect_hyperslab_c ( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block)
{
int ret_value = -1;
@@ -763,7 +763,7 @@ nh5sselect_hyperslab_c ( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize_
hsize_t *c_start = NULL;
hsize_t *c_count = NULL;
hsize_t *c_stride = NULL;
hsize_t *c_block = NULL;
hsize_t *c_block = NULL;
H5S_seloper_t c_op;
herr_t status;
@@ -816,10 +816,10 @@ DONE:
#ifdef NEW_HYPERSLAB_API
/*----------------------------------------------------------------------------
* Name: h5scombine_hyperslab_c
* Purpose: Call H5Scombine_hyperslab
* Inputs: space_id - identifier of the dataspace
* Purpose: Call H5Scombine_hyperslab
* Inputs: space_id - identifier of the dataspace
* operator - defines how the new selection is combined
* start - offset of start of hyperslab
* start - offset of start of hyperslab
* count - number of blocks included in the hyperslab
* stride - hyperslab stride (interval between blocks)
* block - size of block in the hyperslab
@@ -830,7 +830,7 @@ DONE:
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5scombine_hyperslab_c ( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block, hid_t_f *hyper_id)
{
int ret_value = -1;
@@ -839,7 +839,7 @@ nh5scombine_hyperslab_c ( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize
hsize_t *c_start = NULL;
hsize_t *c_count = NULL;
hsize_t *c_stride = NULL;
hsize_t *c_block = NULL;
hsize_t *c_block = NULL;
H5S_seloper_t c_op;
herr_t status;
@@ -890,9 +890,9 @@ DONE:
/*----------------------------------------------------------------------------
* Name: h5scombine_select_c
* Purpose: Call H5Scombine_ select
* Inputs: space1_id - identifier of the first dataspace
* Inputs: space1_id - identifier of the first dataspace
* operator - defines how the new selection is combined
* space2_id - identifier of the second dataspace
* space2_id - identifier of the second dataspace
* Outputs: ds_id - identifier for the new dataspace
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -900,7 +900,7 @@ DONE:
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5scombine_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id, hid_t_f *ds_id)
{
int ret_value = -1;
@@ -924,14 +924,14 @@ nh5scombine_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id, hid_t
* Purpose: Call H5Sselect_ select
* Inputs: space1_id - identifier of the first dataspace to modify
* operator - defines how the new selection is combined
* space2_id - identifier of the second dataspace
* space2_id - identifier of the second dataspace
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Monday, October 7, 2002
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5sselect_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id)
{
int ret_value = -1;
@@ -951,7 +951,7 @@ nh5sselect_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id)
/*----------------------------------------------------------------------------
* Name: h5sget_select_type_c
* Purpose: Call H5Sget_select_type
* Inputs: space_id - identifier of the dataspace
* Inputs: space_id - identifier of the dataspace
* Outputs: type - type of selection
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -959,7 +959,7 @@ nh5sselect_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5sget_select_type_c ( hid_t_f *space_id , int_f *type)
{
int ret_value = -1;
@@ -977,20 +977,20 @@ nh5sget_select_type_c ( hid_t_f *space_id , int_f *type)
/*----------------------------------------------------------------------------
* Name: h5sselect_elements_c
* Purpose: Call H5Sselect_elements to select elements of a dataspace
* Inputs: space_id - identifier of the dataspace
* Purpose: Call H5Sselect_elements to select elements of a dataspace
* Inputs: space_id - identifier of the dataspace
* operator - defines how the new selection is combined
* with the previous one; current values are
* H5S_SELECT_SET_F (0)
* nelements - number of elements in the selection
* coord - arrays with the elements coordinates
* with the previous one; current values are
* H5S_SELECT_SET_F (0)
* nelements - number of elements in the selection
* coord - arrays with the elements coordinates
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Wednesday, August 11, 1999
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *nelements, hsize_t_f *coord)
{
int ret_value = -1;
@@ -1021,7 +1021,7 @@ nh5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *nelements, hsi
c_nelements = *nelements;
status = H5Sselect_elements(c_space_id, c_op, c_nelements, (const hsize_t **)c_coord);
if ( status >= 0 ) ret_value = 0;
HDfree(c_coord);
HDfree(c_coord);
return ret_value;
}
+254 -254
View File
@@ -19,9 +19,9 @@
/*----------------------------------------------------------------------------
* Name: h5topen_c
* Purpose: Call H5Topen to open a datatype
* Inputs: loc_id - file or group identifier
* name - name of the datatype within file or group
* Purpose: Call H5Topen to open a datatype
* Inputs: loc_id - file or group identifier
* name - name of the datatype within file or group
* namelen - name length
* Outputs: type_id - dataset identifier
* Returns: 0 on success, -1 on failure
@@ -42,7 +42,7 @@ nh5topen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id)
* Convert FORTRAN name to C name
*/
c_namelen = *namelen;
c_name = (char *)HD5f2cstring(name, c_namelen);
c_name = (char *)HD5f2cstring(name, c_namelen);
if (c_name == NULL) return ret_value;
/*
@@ -56,14 +56,14 @@ nh5topen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id)
HDfree(c_name);
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5tcommit_c
* Purpose: Call H5Tcommit to commit a datatype
* Inputs: loc_id - file or group identifier
* name - name of the datatype within file or group
* Purpose: Call H5Tcommit to commit a datatype
* Inputs: loc_id - file or group identifier
* name - name of the datatype within file or group
* namelen - name length
* type_id - dataset identifier
* Returns: 0 on success, -1 on failure
@@ -85,7 +85,7 @@ nh5tcommit_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id)
* Convert FORTRAN name to C name
*/
c_namelen = *namelen;
c_name = (char *)HD5f2cstring(name, c_namelen);
c_name = (char *)HD5f2cstring(name, c_namelen);
if (c_name == NULL) return ret_value;
/*
@@ -98,11 +98,11 @@ nh5tcommit_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id)
if (status < 0) return ret_value;
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5tclose_c
* Purpose: Call H5Tclose to close the datatype
* Purpose: Call H5Tclose to close the datatype
* Inputs: type_id - identifier of the datatype to be closed
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -110,7 +110,7 @@ nh5tcommit_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tclose_c ( hid_t_f *type_id )
{
int ret_value = 0;
@@ -125,7 +125,7 @@ nh5tclose_c ( hid_t_f *type_id )
/*----------------------------------------------------------------------------
* Name: h5tcopy_c
* Purpose: Call H5Tcopy to copy a datatype
* Inputs: type_id - identifier of the datatype to be copied
* Inputs: type_id - identifier of the datatype to be copied
* Outputs: new_type_id - identifier of the new datatype
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -133,7 +133,7 @@ nh5tclose_c ( hid_t_f *type_id )
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tcopy_c ( hid_t_f *type_id , hid_t_f *new_type_id)
{
int ret_value = 0;
@@ -141,7 +141,7 @@ nh5tcopy_c ( hid_t_f *type_id , hid_t_f *new_type_id)
hid_t c_new_type_id;
c_type_id = *type_id;
c_new_type_id = H5Tcopy(c_type_id);
c_new_type_id = H5Tcopy(c_type_id);
if ( c_new_type_id < 0 ) ret_value = -1;
*new_type_id = (hid_t_f)c_new_type_id;
return ret_value;
@@ -150,16 +150,16 @@ nh5tcopy_c ( hid_t_f *type_id , hid_t_f *new_type_id)
/*----------------------------------------------------------------------------
* Name: h5tequal_c
* Purpose: Call H5Tequal to copy a datatype
* Inputs: type1_id - datatype identifier
* type2_id - datatype identifier
* Outputs: c_flag - flag; indicates if two datatypes are equal or not.
* Inputs: type1_id - datatype identifier
* type2_id - datatype identifier
* Outputs: c_flag - flag; indicates if two datatypes are equal or not.
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Tuesday, February 22, 2000
* Tuesday, February 22, 2000
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tequal_c ( hid_t_f *type1_id , hid_t_f *type2_id, int_f *c_flag)
{
int ret_value = -1;
@@ -168,9 +168,9 @@ nh5tequal_c ( hid_t_f *type1_id , hid_t_f *type2_id, int_f *c_flag)
c_type1_id = *type1_id;
c_type2_id = *type2_id;
status = H5Tequal(c_type1_id, c_type2_id);
if ( status < 0 ) return ret_value;
*c_flag = (int_f)status;
status = H5Tequal(c_type1_id, c_type2_id);
if ( status < 0 ) return ret_value;
*c_flag = (int_f)status;
ret_value = 0;
return ret_value;
}
@@ -179,7 +179,7 @@ nh5tequal_c ( hid_t_f *type1_id , hid_t_f *type2_id, int_f *c_flag)
/*----------------------------------------------------------------------------
* Name: h5tget_class_c
* Purpose: Call H5Tget_class to determine the datatype class
* Inputs: type_id - identifier of the dataspace
* Inputs: type_id - identifier of the dataspace
* Outputs: classtype - class type; possible values are:
* H5T_NO_CLASS_F (-1)
* H5T_INTEGER_F (0)
@@ -197,18 +197,18 @@ nh5tequal_c ( hid_t_f *type1_id , hid_t_f *type2_id, int_f *c_flag)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tget_class_c ( hid_t_f *type_id , int_f *classtype)
{
int ret_value = 0;
hid_t c_type_id;
H5T_class_t c_classtype;
H5T_class_t c_classtype;
c_type_id = *type_id;
c_classtype = H5Tget_class(c_type_id);
if (c_classtype == H5T_NO_CLASS ) {
/* *classtype = H5T_NO_CLASS_F; */
*classtype = (int_f)H5T_NO_CLASS;
*classtype = (int_f)H5T_NO_CLASS;
ret_value = -1;
return ret_value;
}
@@ -229,8 +229,8 @@ nh5tget_class_c ( hid_t_f *type_id , int_f *classtype)
/*----------------------------------------------------------------------------
* Name: h5tget_order_c
* Purpose: Call H5Tget_order to determine byte order
* Inputs: type_id - identifier of the dataspace
* Purpose: Call H5Tget_order to determine byte order
* Inputs: type_id - identifier of the dataspace
* Outputs: order; possible values are:
* H5T_ORDER_LE_F (0)
* H5T_ORDER_BE_F (1)
@@ -241,12 +241,12 @@ nh5tget_class_c ( hid_t_f *type_id , int_f *classtype)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tget_order_c ( hid_t_f *type_id , int_f *order)
{
int ret_value = -1;
hid_t c_type_id;
H5T_order_t c_order;
H5T_order_t c_order;
c_type_id = *type_id;
c_order = H5Tget_order(c_type_id);
@@ -264,8 +264,8 @@ nh5tget_order_c ( hid_t_f *type_id , int_f *order)
/*----------------------------------------------------------------------------
* Name: h5tset_order_c
* Purpose: Call H5Tset_order to set byte order
* Inputs: type_id - identifier of the dataspace
* Purpose: Call H5Tset_order to set byte order
* Inputs: type_id - identifier of the dataspace
* order; possible values are:
* H5T_ORDER_LE_F (0)
* H5T_ORDER_BE_F (1)
@@ -276,12 +276,12 @@ nh5tget_order_c ( hid_t_f *type_id , int_f *order)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tset_order_c ( hid_t_f *type_id , int_f *order)
{
int ret_value = 0;
hid_t c_type_id;
H5T_order_t c_order;
H5T_order_t c_order;
herr_t status;
c_order = (H5T_order_t)*order;
/*
@@ -297,47 +297,47 @@ nh5tset_order_c ( hid_t_f *type_id , int_f *order)
/*----------------------------------------------------------------------------
* Name: h5tget_size_c
* Purpose: Call H5Tget_size to get size of the datatype
* Inputs: type_id - identifier of the dataspace
* Outputs: size (in bytes)
* Purpose: Call H5Tget_size to get size of the datatype
* Inputs: type_id - identifier of the dataspace
* Outputs: size (in bytes)
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Saturday, August 14, 1999
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tget_size_c ( hid_t_f *type_id , size_t_f *size)
{
int ret_value = -1;
hid_t c_type_id;
size_t c_size;
size_t c_size;
c_type_id = *type_id;
c_size = H5Tget_size(c_type_id);
if ( c_size == 0 ) return ret_value;
*size = (size_t_f)c_size ;
ret_value = 0;
ret_value = 0;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5tset_size_c
* Purpose: Call H5Tget_size to get size of the datatype
* Inputs: type_id - identifier of the dataspace
* Outputs: size (in bytes)
* Purpose: Call H5Tget_size to get size of the datatype
* Inputs: type_id - identifier of the dataspace
* Outputs: size (in bytes)
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Saturday, August 14, 1999
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tset_size_c ( hid_t_f *type_id , size_t_f *size)
{
int ret_value = -1;
hid_t c_type_id;
size_t c_size;
size_t c_size;
herr_t status;
c_size = (size_t)*size;
@@ -350,134 +350,134 @@ nh5tset_size_c ( hid_t_f *type_id , size_t_f *size)
/*----------------------------------------------------------------------------
* Name: h5tget_precision_c
* Purpose: Call H5Tget_precision to get precision of the datatype
* Inputs: type_id - identifier of the dataspace
* Outputs: precision - number of significant bits
* Purpose: Call H5Tget_precision to get precision of the datatype
* Inputs: type_id - identifier of the dataspace
* Outputs: precision - number of significant bits
* Returns: 0 on success, -1 on failure
* Programmer: XIANGYANG SU
* Tuesday, January 25, 2000
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tget_precision_c ( hid_t_f *type_id , size_t_f *precision)
{
int ret_value = -1;
hid_t c_type_id;
size_t c_precision;
size_t c_precision;
c_type_id = *type_id;
c_precision = H5Tget_precision(c_type_id);
if ( c_precision == 0 ) return ret_value;
*precision = (size_t_f)c_precision ;
ret_value = 0;
ret_value = 0;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5tset_precision_c
* Purpose: Call H5Tset_precision to set precision of the datatype
* Inputs: type_id - identifier of the dataspace
* precision - number of significant bits
* Purpose: Call H5Tset_precision to set precision of the datatype
* Inputs: type_id - identifier of the dataspace
* precision - number of significant bits
* Returns: 0 on success, -1 on failure
* Programmer: XIANGYANG SU
* Tuesday, January 25, 2000
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tset_precision_c ( hid_t_f *type_id , size_t_f *precision)
{
int ret_value = -1;
hid_t c_type_id;
size_t c_precision;
size_t c_precision;
herr_t status;
c_type_id = *type_id;
c_precision = (size_t)*precision;
status = H5Tset_precision(c_type_id, c_precision);
if ( status < 0 ) return ret_value;
ret_value = 0;
ret_value = 0;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5tget_offset_c
* Purpose: Call H5Tget_offset to get bit offset of the first
* significant bit of the datatype
* Inputs: type_id - identifier of the dataspace
* Outputs: offset - bit offset of the first significant bit
* Purpose: Call H5Tget_offset to get bit offset of the first
* significant bit of the datatype
* Inputs: type_id - identifier of the dataspace
* Outputs: offset - bit offset of the first significant bit
* Returns: 0 on success, -1 on failure
* Programmer: XIANGYANG SU
* Tuesday, January 25, 2000
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tget_offset_c ( hid_t_f *type_id , size_t_f *offset)
{
int ret_value = -1;
hid_t c_type_id;
size_t c_offset;
size_t c_offset;
c_type_id = *type_id;
c_offset = H5Tget_offset(c_type_id);
if ( c_offset == 0 ) return ret_value;
*offset = (size_t_f)c_offset ;
ret_value = 0;
ret_value = 0;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5tset_offset_c
* Purpose: Call H5Tset_offset to set bit offset of the first
* significant bit of the datatype
* Inputs: type_id - identifier of the dataspace
* offset - bit offset of the first significant bit
* Purpose: Call H5Tset_offset to set bit offset of the first
* significant bit of the datatype
* Inputs: type_id - identifier of the dataspace
* offset - bit offset of the first significant bit
* Returns: 0 on success, -1 on failure
* Programmer: XIANGYANG SU
* Tuesday, January 25, 2000
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tset_offset_c ( hid_t_f *type_id , size_t_f *offset)
{
int ret_value = -1;
hid_t c_type_id;
size_t c_offset;
size_t c_offset;
herr_t status;
c_offset = (size_t)*offset;
c_type_id = *type_id;
status = H5Tset_offset(c_type_id, c_offset);
if ( status < 0 ) return ret_value;
ret_value = 0;
ret_value = 0;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5tget_pad_c
* Purpose: Call H5Tget_pad to get the padding type of the least and
* most-significant bit padding
*
* Inputs: type_id - identifier of the dataspace
* most-significant bit padding
*
* Inputs: type_id - identifier of the dataspace
* Outputs: lsbpad - padding type of the least significant bit
* msbpad - padding type of the least significant bit
* msbpad - padding type of the least significant bit
* Returns: 0 on success, -1 on failure
* Programmer: XIANGYANG SU
* Wednesday, January 26, 2000
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tget_pad_c ( hid_t_f *type_id , int_f * lsbpad, int_f * msbpad)
{
int ret_value = -1;
hid_t c_type_id;
herr_t status;
H5T_pad_t c_lsb, c_msb;
H5T_pad_t c_lsb, c_msb;
c_type_id = *type_id;
status = H5Tget_pad(c_type_id, &c_lsb, &c_msb);
@@ -485,85 +485,85 @@ nh5tget_pad_c ( hid_t_f *type_id , int_f * lsbpad, int_f * msbpad)
*lsbpad = (int_f) c_lsb;
*msbpad = (int_f) c_msb;
ret_value = 0;
ret_value = 0;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5tset_pad_c
* Inputs: type_id - identifier of the dataspace
* Inputs: type_id - identifier of the dataspace
* Purpose: Call H5Tset_pad to set the padding type of the least and
* most-significant bit padding
*
* Inputs: type_id - identifier of the dataspace
* most-significant bit padding
*
* Inputs: type_id - identifier of the dataspace
* lsbpad - padding type of the least significant bit
* msbpad - padding type of the least significant bit
* msbpad - padding type of the least significant bit
* Returns: 0 on success, -1 on failure
* Programmer: XIANGYANG SU
* Wednesday, January 26, 2000
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tset_pad_c ( hid_t_f *type_id, int_f * lsbpad, int_f* msbpad )
{
int ret_value = -1;
hid_t c_type_id;
herr_t status;
H5T_pad_t c_lsb, c_msb;
H5T_pad_t c_lsb, c_msb;
c_type_id = *type_id;
c_lsb = (H5T_pad_t)*lsbpad;
c_msb = (H5T_pad_t)*msbpad;
status = H5Tset_pad(c_type_id, c_lsb, c_msb);
if ( status < 0 ) return ret_value;
ret_value = 0;
ret_value = 0;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5tget_sign_c
* Purpose: Call H5Tget_sign to get sign type for an integer type
* Inputs: type_id - identifier of the dataspace
* Outputs: sign - sign type for an integer type
* Purpose: Call H5Tget_sign to get sign type for an integer type
* Inputs: type_id - identifier of the dataspace
* Outputs: sign - sign type for an integer type
* Returns: 0 on success, -1 on failure
* Programmer: XIANGYANG SU
* Wednesday, January 26, 2000
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tget_sign_c ( hid_t_f *type_id , int_f *sign)
{
int ret_value = -1;
hid_t c_type_id;
H5T_sign_t c_sign;
H5T_sign_t c_sign;
c_type_id = *type_id;
c_sign = H5Tget_sign(c_type_id);
if ( c_sign == -1 ) return ret_value;
*sign = (int_f)c_sign ;
ret_value = 0;
ret_value = 0;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5tset_sign_c
* Purpose: Call H5Tset_sign to set sign type for an integer type
* Inputs: type_id - identifier of the dataspace
* sign - sign type for an integer typ
* Purpose: Call H5Tset_sign to set sign type for an integer type
* Inputs: type_id - identifier of the dataspace
* sign - sign type for an integer typ
* Returns: 0 on success, -1 on failure
* Programmer: XIANGYANG SU
* Wednesday, January 26, 2000
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tset_sign_c ( hid_t_f *type_id , int_f* sign)
{
int ret_value = -1;
hid_t c_type_id;
H5T_sign_t c_sign;
H5T_sign_t c_sign;
herr_t status;
c_type_id = *type_id;
@@ -571,15 +571,15 @@ nh5tset_sign_c ( hid_t_f *type_id , int_f* sign)
status = H5Tset_sign(c_type_id, c_sign);
if ( status < 0 ) return ret_value;
ret_value = 0;
ret_value = 0;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5tget_fields_c
* Purpose: Call H5Tget_fields to get floating point datatype
* Purpose: Call H5Tget_fields to get floating point datatype
* bit field information
* Inputs: type_id - identifier of the dataspace
* Inputs: type_id - identifier of the dataspace
* Outputs: epos - exponent bit-position
* esize - size of exponent in bits
* mpos - mantissa bit-position
@@ -590,13 +590,13 @@ nh5tset_sign_c ( hid_t_f *type_id , int_f* sign)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tget_fields_c ( hid_t_f *type_id , size_t_f *spos, size_t_f *epos, size_t_f* esize, size_t_f* mpos, size_t_f* msize)
{
int ret_value = -1;
hid_t c_type_id;
herr_t status;
size_t c_spos, c_epos, c_esize, c_mpos, c_msize;
size_t c_spos, c_epos, c_esize, c_mpos, c_msize;
c_type_id = *type_id;
status = H5Tget_fields(c_type_id, &c_spos, &c_epos, &c_esize, &c_mpos, &c_msize);
@@ -606,15 +606,15 @@ nh5tget_fields_c ( hid_t_f *type_id , size_t_f *spos, size_t_f *epos, size_t_f*
*esize = (size_t_f) c_esize;
*mpos = (size_t_f) c_mpos;
*msize = (size_t_f) c_msize;
ret_value = 0;
ret_value = 0;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5tset_fields_c
* Purpose: Call H5Tset_fields to set floating point datatype
* Purpose: Call H5Tset_fields to set floating point datatype
* bit field information
* Inputs: type_id - identifier of the dataspace
* Inputs: type_id - identifier of the dataspace
* epos - exponent bit-position
* esize - size of exponent in bits
* mpos - mantissa bit-position
@@ -625,13 +625,13 @@ nh5tget_fields_c ( hid_t_f *type_id , size_t_f *spos, size_t_f *epos, size_t_f*
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tset_fields_c ( hid_t_f *type_id, size_t_f *spos, size_t_f *epos, size_t_f* esize, size_t_f* mpos, size_t_f* msize)
{
int ret_value = -1;
hid_t c_type_id;
herr_t status;
size_t c_spos, c_epos, c_esize, c_mpos, c_msize;
size_t c_spos, c_epos, c_esize, c_mpos, c_msize;
c_spos = (size_t)*spos;
c_epos = (size_t)*epos;
@@ -642,15 +642,15 @@ nh5tset_fields_c ( hid_t_f *type_id, size_t_f *spos, size_t_f *epos, size_t_f* e
status = H5Tset_fields(c_type_id, c_spos, c_epos, c_esize, c_mpos, c_msize);
if ( status < 0 ) return ret_value;
ret_value = 0;
ret_value = 0;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5tget_ebias_c
* Purpose: Call H5Tget_ebias to get exponent bias of a
* floating-point type of the datatype
* Inputs: type_id - identifier of the dataspace
* Purpose: Call H5Tget_ebias to get exponent bias of a
* floating-point type of the datatype
* Inputs: type_id - identifier of the dataspace
* Outputs: ebias - exponent bias of a floating-point type of the datatype
* Returns: 0 on success, -1 on failure
* Programmer: Xiangyang Su
@@ -658,40 +658,40 @@ nh5tset_fields_c ( hid_t_f *type_id, size_t_f *spos, size_t_f *epos, size_t_f* e
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tget_ebias_c ( hid_t_f *type_id , size_t_f *ebias)
{
int ret_value = -1;
hid_t c_type_id;
size_t c_ebias;
size_t c_ebias;
c_type_id = *type_id;
c_ebias = H5Tget_ebias(c_type_id);
if ( c_ebias == 0 ) return ret_value;
*ebias = (size_t_f)c_ebias;
ret_value = 0;
ret_value = 0;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5tset_ebias_c
* Purpose: Call H5Tset_ebias to set exponent bias of a
* floating-point type of the datatype
* Inputs: type_id - identifier of the dataspace
* ebias - exponent bias of a floating-point type of the datatyp
* floating-point type of the datatype
* Inputs: type_id - identifier of the dataspace
* ebias - exponent bias of a floating-point type of the datatyp
* Returns: 0 on success, -1 on failure
* Programmer: Xiangyang Su
* Friday, January 27, 2000
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tset_ebias_c ( hid_t_f *type_id , size_t_f *ebias)
{
int ret_value = -1;
hid_t c_type_id;
size_t c_ebias;
size_t c_ebias;
herr_t status;
c_type_id = *type_id;
@@ -706,8 +706,8 @@ nh5tset_ebias_c ( hid_t_f *type_id , size_t_f *ebias)
/*----------------------------------------------------------------------------
* Name: h5tget_norm_c
* Purpose: Call H5Tget_norm to get mantissa normalization
* of a floating-point datatype
* Inputs: type_id - identifier of the dataspace
* of a floating-point datatype
* Inputs: type_id - identifier of the dataspace
* Outputs: norm - mantissa normalization of a floating-point type
* Returns: 0 on success, -1 on failure
* Programmer: Xiangyang Su
@@ -715,27 +715,27 @@ nh5tset_ebias_c ( hid_t_f *type_id , size_t_f *ebias)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tget_norm_c ( hid_t_f *type_id , int_f *norm)
{
int ret_value = -1;
hid_t c_type_id;
H5T_norm_t c_norm;
H5T_norm_t c_norm;
c_type_id = *type_id;
c_norm = H5Tget_norm(c_type_id);
if ( c_norm == 0 ) return ret_value;
*norm = (int_f)c_norm;
ret_value = 0;
ret_value = 0;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5tset_norm_c
* Purpose: Call H5Tset_norm to set mantissa normalization of
* floating-point type of the datatype
* Inputs: type_id - identifier of the dataspace
* Purpose: Call H5Tset_norm to set mantissa normalization of
* floating-point type of the datatype
* Inputs: type_id - identifier of the dataspace
* norm - mantissa normalization of a floating-point type
* Returns: 0 on success, -1 on failure
* Programmer: Xiangyang Su
@@ -743,12 +743,12 @@ nh5tget_norm_c ( hid_t_f *type_id , int_f *norm)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tset_norm_c ( hid_t_f *type_id , int_f *norm)
{
int ret_value = -1;
hid_t c_type_id;
H5T_norm_t c_norm;
H5T_norm_t c_norm;
herr_t status;
c_type_id = *type_id;
@@ -764,8 +764,8 @@ nh5tset_norm_c ( hid_t_f *type_id , int_f *norm)
* Name: h5tget_inpad_c
* Purpose: Call H5Tget_inpad to get the padding type for
* unused bits in floating-point datatypes
*
* Inputs: type_id - identifier of the dataspace
*
* Inputs: type_id - identifier of the dataspace
* Outputs: padtype - padding type for
* unused bits in floating-point datatype
* Returns: 0 on success, -1 on failure
@@ -774,29 +774,29 @@ nh5tset_norm_c ( hid_t_f *type_id , int_f *norm)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tget_inpad_c ( hid_t_f *type_id , int_f * padtype)
{
int ret_value = -1;
hid_t c_type_id;
H5T_pad_t c_padtype;
H5T_pad_t c_padtype;
c_type_id = *type_id;
c_padtype = H5Tget_inpad(c_type_id);
if ( c_padtype == H5T_PAD_ERROR ) return ret_value;
*padtype = (int_f) c_padtype;
ret_value = 0;
ret_value = 0;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5tset_inpad_c
* Inputs: type_id - identifier of the dataspace
* Purpose: Call H5Tset_inpad to set the padding type
* Inputs: type_id - identifier of the dataspace
* Purpose: Call H5Tset_inpad to set the padding type
* unused bits in floating-point datatype
*
* Inputs: type_id - identifier of the dataspace
*
* Inputs: type_id - identifier of the dataspace
* padtype - padding type for unused bits
* in floating-point datatypes
* Returns: 0 on success, -1 on failure
@@ -805,29 +805,29 @@ nh5tget_inpad_c ( hid_t_f *type_id , int_f * padtype)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tset_inpad_c ( hid_t_f *type_id, int_f * padtype)
{
int ret_value = -1;
hid_t c_type_id;
herr_t status;
H5T_pad_t c_padtype;
H5T_pad_t c_padtype;
c_type_id = *type_id;
c_padtype = (H5T_pad_t)*padtype;
status = H5Tset_inpad(c_type_id, c_padtype);
if ( status < 0 ) return ret_value;
ret_value = 0;
ret_value = 0;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5tget_cset_c
* Purpose: Call H5Tget_cset to get character set
* Purpose: Call H5Tget_cset to get character set
* type of a string datatype
*
* Inputs: type_id - identifier of the dataspace
*
* Inputs: type_id - identifier of the dataspace
* Outputs: cset - character set type of a string datatype
* Returns: 0 on success, -1 on failure
* Programmer: XIANGYANG SU
@@ -835,29 +835,29 @@ nh5tset_inpad_c ( hid_t_f *type_id, int_f * padtype)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tget_cset_c ( hid_t_f *type_id , int_f * cset)
{
int ret_value = -1;
hid_t c_type_id;
H5T_cset_t c_cset;
H5T_cset_t c_cset;
c_type_id = *type_id;
c_cset = H5Tget_cset(c_type_id);
if ( c_cset == H5T_CSET_ERROR ) return ret_value;
*cset = (int_f) c_cset;
ret_value = 0;
ret_value = 0;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5tset_cset_c
* Inputs: type_id - identifier of the dataspace
* Inputs: type_id - identifier of the dataspace
* Purpose: Call H5Tset_cset to set character set
* type of a string datatype
*
* Inputs: type_id - identifier of the dataspace
*
* Inputs: type_id - identifier of the dataspace
* cset - character set type of a string datatype
* Returns: 0 on success, -1 on failure
* Programmer: XIANGYANG SU
@@ -865,20 +865,20 @@ nh5tget_cset_c ( hid_t_f *type_id , int_f * cset)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tset_cset_c ( hid_t_f *type_id, int_f * cset)
{
int ret_value = -1;
hid_t c_type_id;
herr_t status;
H5T_cset_t c_cset;
H5T_cset_t c_cset;
c_type_id = *type_id;
c_cset = (H5T_cset_t)*cset;
status = H5Tset_cset(c_type_id, c_cset);
if ( status < 0 ) return ret_value;
ret_value = 0;
ret_value = 0;
return ret_value;
}
@@ -886,7 +886,7 @@ nh5tset_cset_c ( hid_t_f *type_id, int_f * cset)
* Name: h5tget_strpad_c
* Purpose: Call H5Tget_strpad to get string padding method
* for a string datatype
* Inputs: type_id - identifier of the dataspace
* Inputs: type_id - identifier of the dataspace
* Outputs: strpad - string padding method for a string datatype
* Returns: 0 on success, -1 on failure
* Programmer: XIANGYANG SU
@@ -894,29 +894,29 @@ nh5tset_cset_c ( hid_t_f *type_id, int_f * cset)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tget_strpad_c ( hid_t_f *type_id , int_f * strpad)
{
int ret_value = -1;
hid_t c_type_id;
H5T_str_t c_strpad;
H5T_str_t c_strpad;
c_type_id = *type_id;
c_strpad = H5Tget_strpad(c_type_id);
if ( c_strpad == H5T_STR_ERROR ) return ret_value;
*strpad = (int_f) c_strpad;
ret_value = 0;
ret_value = 0;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5tset_strpad_c
* Inputs: type_id - identifier of the dataspace
* Inputs: type_id - identifier of the dataspace
* Purpose: Call H5Tset_strpad to set string padding method
* for a string datatype
*
* Inputs: type_id - identifier of the dataspace
*
* Inputs: type_id - identifier of the dataspace
* strpad - string padding method for a string datatype
* Returns: 0 on success, -1 on failure
* Programmer: XIANGYANG SU
@@ -924,28 +924,28 @@ nh5tget_strpad_c ( hid_t_f *type_id , int_f * strpad)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tset_strpad_c ( hid_t_f *type_id, int_f * strpad)
{
int ret_value = -1;
hid_t c_type_id;
herr_t status;
H5T_str_t c_strpad;
H5T_str_t c_strpad;
c_type_id = *type_id;
c_strpad = (H5T_str_t)*strpad;
status = H5Tset_strpad(c_type_id, c_strpad);
if ( status < 0 ) return ret_value;
ret_value = 0;
ret_value = 0;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5tget_nmembers_c
* Purpose: Call H5Tget_nmembers to get number of fields
* Purpose: Call H5Tget_nmembers to get number of fields
* in a compound datatype
* Inputs: type_id - identifier of the dataspace
* Inputs: type_id - identifier of the dataspace
* Outputs: num_members - number of fields in a compound datatype
* Returns: 0 on success, -1 on failure
* Programmer: XIANGYANG SU
@@ -953,7 +953,7 @@ nh5tset_strpad_c ( hid_t_f *type_id, int_f * strpad)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tget_nmembers_c ( hid_t_f *type_id , int_f * num_members)
{
int ret_value = -1;
@@ -963,16 +963,16 @@ nh5tget_nmembers_c ( hid_t_f *type_id , int_f * num_members)
*num_members = (int_f)H5Tget_nmembers(c_type_id);
if (*num_members < 0 ) return ret_value;
ret_value = 0;
ret_value = 0;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5tget_member_name_c
* Purpose: Call H5Tget_member_name to get name
* Purpose: Call H5Tget_member_name to get name
* of a compound datatype
* Inputs: type_id - identifier of the dataspace
* Outputs: member_name - name of a field of a compound datatype
* Inputs: type_id - identifier of the dataspace
* Outputs: member_name - name of a field of a compound datatype
* Returns: 0 on success, -1 on failure
* Programmer: XIANGYANG SU
* Thursday, February 3, 2000
@@ -980,7 +980,7 @@ nh5tget_nmembers_c ( hid_t_f *type_id , int_f * num_members)
* Added namelen parameter to return length of the name to Fortran user
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tget_member_name_c ( hid_t_f *type_id ,int_f* idx, _fcd member_name, int_f *namelen)
{
int ret_value = -1;
@@ -993,18 +993,18 @@ nh5tget_member_name_c ( hid_t_f *type_id ,int_f* idx, _fcd member_name, int_f *n
c_name = H5Tget_member_name(c_type_id, c_index);
if (c_name == NULL ) return ret_value;
HD5packFstring(c_name, _fcdtocp(member_name), (int)strlen(c_name));
HD5packFstring(c_name, _fcdtocp(member_name), (int)strlen(c_name));
*namelen = (int_f)strlen(c_name);
HDfree(c_name);
ret_value = 0;
ret_value = 0;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5tget_member_index_c
* Purpose: Call H5Tget_member_index to get an index of
* the specified datatype filed or member.
* Inputs: type_id - datatype identifier
* name - name of the datatype within file or group
* Inputs: type_id - datatype identifier
* name - name of the datatype within file or group
* namelen - name length
* Outputs: index - 0-based index
* Returns: 0 on success, -1 on failure
@@ -1025,7 +1025,7 @@ nh5tget_member_index_c (hid_t_f *type_id, _fcd name, int_f *namelen, int_f *idx)
* Convert FORTRAN name to C name
*/
c_namelen = *namelen;
c_name = (char *)HD5f2cstring(name, c_namelen);
c_name = (char *)HD5f2cstring(name, c_namelen);
if (c_name == NULL) return ret_value;
/*
@@ -1040,25 +1040,25 @@ DONE:
HDfree(c_name);
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5tget_member_offset_c
* Purpose: Call H5Tget_member_offset to get byte offset of the
* beginning of a field within a compound datatype with
* beginning of a field within a compound datatype with
* respect to the beginning of the compound data type datum
* Inputs: type_id - identifier of the dataspace
* Inputs: type_id - identifier of the dataspace
* member_no - Number of the field whose offset is requested
* Outputs: offset - byte offset of the the beginning of the field of
* a compound datatype
* a compound datatype
* Returns: always 0
* Programmer: XIANGYANG SU
* Thursday, February 3, 2000
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tget_member_offset_c ( hid_t_f *type_id ,int_f* member_no, size_t_f * offset)
{
int ret_value = -1;
@@ -1070,23 +1070,23 @@ nh5tget_member_offset_c ( hid_t_f *type_id ,int_f* member_no, size_t_f * offset)
c_member_no = *member_no;
c_offset = H5Tget_member_offset(c_type_id, c_member_no);
*offset = (size_t_f)c_offset;
ret_value = 0;
ret_value = 0;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5tget_array_dims_c
* Purpose: Call H5Tget_array_dims to get
* Purpose: Call H5Tget_array_dims to get
* dimensions of array datatype
* Inputs: type_id - identifier of the array datatype
* Outputs: dims - dimensions(sizes of dimensions) of the array
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Thursday, November 16, 2000
* Modifications:
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tget_array_dims_c ( hid_t_f *type_id , hsize_t_f * dims)
{
int ret_value = -1;
@@ -1112,7 +1112,7 @@ nh5tget_array_dims_c ( hid_t_f *type_id , hsize_t_f * dims)
dims[rank-i-1] = (hsize_t_f)c_dims[i];
}
ret_value = 0;
ret_value = 0;
HDfree(c_dims);
return ret_value;
@@ -1120,17 +1120,17 @@ nh5tget_array_dims_c ( hid_t_f *type_id , hsize_t_f * dims)
/*----------------------------------------------------------------------------
* Name: h5tget_array_ndims_c
* Purpose: Call H5Tget_array_ndims to get number
* Purpose: Call H5Tget_array_ndims to get number
* of dimensions of array datatype
* Inputs: type_id - identifier of the array datatype
* Outputs: ndims - number of dimensions of the array
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Thursday, November 16, 2000
* Modifications:
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tget_array_ndims_c ( hid_t_f *type_id , int_f * ndims)
{
int ret_value = -1;
@@ -1142,23 +1142,23 @@ nh5tget_array_ndims_c ( hid_t_f *type_id , int_f * ndims)
if (c_ndims < 0) return ret_value;
*ndims = (int_f)c_ndims;
ret_value = 0;
ret_value = 0;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5tget_super_c
* Purpose: Call H5Tget_super to get base datatype from which
* datatype was derived
* Purpose: Call H5Tget_super to get base datatype from which
* datatype was derived
* Inputs: type_id - identifier of the array datatype
* Outputs: base_type_id - base datatype identifier
* Outputs: base_type_id - base datatype identifier
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Thursday, November 16, 2000
* Modifications:
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tget_super_c ( hid_t_f *type_id , hid_t_f *base_type_id)
{
int ret_value = -1;
@@ -1170,7 +1170,7 @@ nh5tget_super_c ( hid_t_f *type_id , hid_t_f *base_type_id)
if (c_base_type_id < 0) return ret_value;
*base_type_id = (hid_t_f)c_base_type_id;
ret_value = 0;
ret_value = 0;
return ret_value;
}
@@ -1179,7 +1179,7 @@ nh5tget_super_c ( hid_t_f *type_id , hid_t_f *base_type_id)
* Name: h5tget_member_type_c
* Purpose: Call H5Tget_member_type to get the identifier of a copy of
* the datatype of the field
* Inputs: type_id - identifier of the datatype
* Inputs: type_id - identifier of the datatype
* field_idx - Field index (0-based) of the field type to retrieve
* Outputs: datatype - identifier of a copy of the datatype of the field
* Returns: 0 on success, -1 on failure
@@ -1188,7 +1188,7 @@ nh5tget_super_c ( hid_t_f *type_id , hid_t_f *base_type_id)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tget_member_type_c ( hid_t_f *type_id ,int_f* field_idx, hid_t_f * datatype)
{
int ret_value = -1;
@@ -1200,23 +1200,23 @@ nh5tget_member_type_c ( hid_t_f *type_id ,int_f* field_idx, hid_t_f * datatype)
*datatype = (hid_t_f)H5Tget_member_type(c_type_id, c_field_idx);
if(*datatype < 0) return ret_value;
ret_value = 0;
ret_value = 0;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5tcreate_c
* Purpose: Call H5Tcreate to create a datatype
* Inputs: class - class type
* size - size of the class memeber
* Purpose: Call H5Tcreate to create a datatype
* Inputs: class - class type
* size - size of the class memeber
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Programmer: Elena Pourmal
* Thursday, February 17, 2000
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tcreate_c(int_f *class, size_t_f *size, hid_t_f *type_id)
{
int ret_value = -1;
@@ -1229,14 +1229,14 @@ nh5tcreate_c(int_f *class, size_t_f *size, hid_t_f *type_id)
*type_id = (hid_t_f)H5Tcreate(c_class, c_size);
if(*type_id < 0) return ret_value;
ret_value = 0;
ret_value = 0;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5tinsert_c
* Purpose: Call H5Tinsert to adds another member to the compound datatype
* Inputs: type_id - identifier of the datatype
* Inputs: type_id - identifier of the datatype
* name - Name of the field to insert
* namelen - length of the name
* offset - Offset in memory structure of the field to insert
@@ -1247,7 +1247,7 @@ nh5tcreate_c(int_f *class, size_t_f *size, hid_t_f *type_id)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tinsert_c(hid_t_f *type_id, _fcd name, int_f* namelen, size_t_f *offset, hid_t_f * field_id)
{
int ret_value = -1;
@@ -1260,7 +1260,7 @@ nh5tinsert_c(hid_t_f *type_id, _fcd name, int_f* namelen, size_t_f *offset, hid_
c_offset =(size_t) *offset;
c_namelen = *namelen;
c_name = (char *)HD5f2cstring(name, c_namelen);
c_name = (char *)HD5f2cstring(name, c_namelen);
if (c_name == NULL) return ret_value;
c_type_id = *type_id;
@@ -1268,17 +1268,17 @@ nh5tinsert_c(hid_t_f *type_id, _fcd name, int_f* namelen, size_t_f *offset, hid_
error = H5Tinsert(c_type_id, c_name, c_offset, c_field_id);
HDfree(c_name);
if(error < 0) return ret_value;
ret_value = 0;
ret_value = 0;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5tpack_c
* Purpose: Call H5Tpack tor ecursively remove padding from
* within a compound datatype to make it more efficient
* Purpose: Call H5Tpack tor ecursively remove padding from
* within a compound datatype to make it more efficient
* (space-wise) to store that data
* Inputs: type_id - identifier of the datatype
* Inputs: type_id - identifier of the datatype
* Returns: 0 on success, -1 on failure
* Programmer: XIANGYANG SU
* Thursday, February 3, 2000
@@ -1298,7 +1298,7 @@ nh5tpack_c(hid_t_f * type_id)
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5tarray_create_c
@@ -1308,9 +1308,9 @@ nh5tpack_c(hid_t_f * type_id)
* dims - Size of new member array
* type_id - identifier of the array datatype
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Programmer: Elena Pourmal
* Thursday, November 16, 2000
* Modifications:
* Modifications:
*---------------------------------------------------------------------------*/
int_f
nh5tarray_create_c(hid_t_f * base_id, int_f *rank, hsize_t_f* dims, hid_t_f* type_id)
@@ -1332,7 +1332,7 @@ nh5tarray_create_c(hid_t_f * base_id, int_f *rank, hsize_t_f* dims, hid_t_f* typ
for (i = 0; i < *rank ; i++) {
c_dims[i] = (hsize_t)dims[*rank - i - 1];
}
c_base_id = (hid_t)*base_id;
c_rank = (int)*rank;
c_type_id = H5Tarray_create(c_base_id, c_rank, c_dims, NULL);
@@ -1353,8 +1353,8 @@ nh5tarray_create_c(hid_t_f * base_id, int_f *rank, hsize_t_f* dims, hid_t_f* typ
/*----------------------------------------------------------------------------
* Name: h5tenum_create_c
* Purpose: Call H5Tenum_create to create a new enumeration datatype
* Inputs: parent_id - Datatype identifier for the base datatype
* Outputs: new_type_id - datatype identifier for the new
* Inputs: parent_id - Datatype identifier for the base datatype
* Outputs: new_type_id - datatype identifier for the new
* enumeration datatype
* Returns: 0 on success, -1 on failure
* Programmer: Xiangyang Su
@@ -1362,7 +1362,7 @@ nh5tarray_create_c(hid_t_f * base_id, int_f *rank, hsize_t_f* dims, hid_t_f* typ
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tenum_create_c ( hid_t_f *parent_id , hid_t_f *new_type_id)
{
int ret_value = 0;
@@ -1370,7 +1370,7 @@ nh5tenum_create_c ( hid_t_f *parent_id , hid_t_f *new_type_id)
hid_t c_new_type_id;
c_parent_id = *parent_id;
c_new_type_id = H5Tenum_create(c_parent_id);
c_new_type_id = H5Tenum_create(c_parent_id);
if ( c_new_type_id < 0 ) ret_value = -1;
*new_type_id = (hid_t_f)c_new_type_id;
@@ -1380,7 +1380,7 @@ nh5tenum_create_c ( hid_t_f *parent_id , hid_t_f *new_type_id)
/*----------------------------------------------------------------------------
* Name: h5tenum_insert_c
* Purpose: Call H5Tenum_insert to insert a new enumeration datatype member.
* Inputs: type_id - identifier of the datatype
* Inputs: type_id - identifier of the datatype
* name - Name of the new member
* namelen - length of the name
* value - value of the new member
@@ -1390,7 +1390,7 @@ nh5tenum_create_c ( hid_t_f *parent_id , hid_t_f *new_type_id)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tenum_insert_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value)
{
int ret_value = -1;
@@ -1401,16 +1401,16 @@ nh5tenum_insert_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value)
herr_t error;
c_namelen = *namelen;
c_name = (char *)HD5f2cstring(name, c_namelen);
c_name = (char *)HD5f2cstring(name, c_namelen);
if (c_name == NULL) return ret_value;
c_type_id = (hid_t)*type_id;
c_value = (int)*value;
error = H5Tenum_insert(c_type_id, c_name, &c_value);
HDfree(c_name);
if(error < 0) return ret_value;
ret_value = 0;
ret_value = 0;
return ret_value;
}
@@ -1419,7 +1419,7 @@ nh5tenum_insert_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value)
* Name: h5tenum_nameof_c
* Purpose: Call H5Tenum_nameof to find the symbol name that corresponds to
* the specified value of the enumeration datatype type
* Inputs: type_id - identifier of the datatype
* Inputs: type_id - identifier of the datatype
* namelen - length of the name
* value - value of the enumeration datatype
* Output: name - Name of the enumeration datatype
@@ -1429,7 +1429,7 @@ nh5tenum_insert_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tenum_nameof_c(hid_t_f *type_id, int_f* value, _fcd name, size_t_f* namelen)
{
int ret_value = -1;
@@ -1443,11 +1443,11 @@ nh5tenum_nameof_c(hid_t_f *type_id, int_f* value, _fcd name, size_t_f* namelen)
c_name = (char *)malloc(sizeof(char)*c_namelen);
c_type_id = (hid_t)*type_id;
error = H5Tenum_nameof(c_type_id, &c_value, c_name, c_namelen);
HD5packFstring(c_name, _fcdtocp(name), (int)strlen(c_name));
HD5packFstring(c_name, _fcdtocp(name), (int)strlen(c_name));
HDfree(c_name);
if(error < 0) return ret_value;
ret_value = 0;
ret_value = 0;
return ret_value;
}
@@ -1455,9 +1455,9 @@ nh5tenum_nameof_c(hid_t_f *type_id, int_f* value, _fcd name, size_t_f* namelen)
* Name: h5tenum_valueof_c
* Purpose: Call H5Tenum_valueof to find the value of that corresponds to
* the specified name of the enumeration datatype type
* Inputs: type_id - identifier of the datatype
* Inputs: type_id - identifier of the datatype
* name - Name of the enumeration datatype
* namelen - length of name
* namelen - length of name
* Output: value - value of the enumeration datatype
* Returns: 0 on success, -1 on failure
* Programmer: XIANGYANG SU
@@ -1465,7 +1465,7 @@ nh5tenum_nameof_c(hid_t_f *type_id, int_f* value, _fcd name, size_t_f* namelen)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tenum_valueof_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value)
{
int ret_value = -1;
@@ -1474,7 +1474,7 @@ nh5tenum_valueof_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value)
int c_namelen;
herr_t error;
c_namelen = *namelen;
c_name = (char *)HD5f2cstring(name, c_namelen);
c_name = (char *)HD5f2cstring(name, c_namelen);
if (c_name == NULL) return ret_value;
c_type_id = *type_id;
@@ -1482,16 +1482,16 @@ nh5tenum_valueof_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value)
HDfree(c_name);
if(error < 0) return ret_value;
ret_value = 0;
ret_value = 0;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5tget_member_value_c
* Purpose: Call H5Tget_member_value to get the value of an
* Purpose: Call H5Tget_member_value to get the value of an
* enumeration datatype member
* Inputs: type_id - identifier of the datatype
* Inputs: type_id - identifier of the datatype
* member_no - Number of the enumeration datatype member.
* Output: value - value of the enumeration datatype
* Returns: 0 on success, -1 on failure
@@ -1500,7 +1500,7 @@ nh5tenum_valueof_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tget_member_value_c(hid_t_f *type_id, int_f* member_no, int_f* value)
{
int ret_value = -1;
@@ -1515,16 +1515,16 @@ nh5tget_member_value_c(hid_t_f *type_id, int_f* member_no, int_f* value)
if(error < 0) return ret_value;
*value = (int_f)c_value;
ret_value = 0;
ret_value = 0;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5tset_tag_c
* Inputs: type_id - identifier of the dataspace
* Inputs: type_id - identifier of the dataspace
* Purpose: Call H5Tset_tag to set an opaque datatype tag
* Inputs: type_id - identifier of the dataspace
* tag - Unique ASCII string with which the opaque
* Inputs: type_id - identifier of the dataspace
* tag - Unique ASCII string with which the opaque
* datatype is to be tagged
* namelen - length of tag
* Returns: 0 on success, -1 on failure
@@ -1541,23 +1541,23 @@ nh5tset_tag_c(hid_t_f* type_id, _fcd tag, int_f* namelen)
char* c_tag;
int c_namelen;
c_namelen = *namelen;
c_tag = (char *)HD5f2cstring(tag, c_namelen);
c_namelen = *namelen;
c_tag = (char *)HD5f2cstring(tag, c_namelen);
c_type_id = *type_id;
status = H5Tset_tag(c_type_id, c_tag);
HDfree(c_tag);
if ( status < 0 ) return ret_value;
ret_value = 0;
ret_value = 0;
return ret_value;
}
}
/*----------------------------------------------------------------------------
* Name: h5tget_tag_c
* Purpose: Call H5Tset_tag to set an opaque datatype tag
* Inputs: type_id - identifier of the datatype
* Outputs: tag - Unique ASCII string with which the opaque
* Outputs: tag - Unique ASCII string with which the opaque
* datatype is to be tagged
* taglen - length of tag
* Returns: 0 on success, -1 on failure
@@ -1576,10 +1576,10 @@ nh5tget_tag_c(hid_t_f* type_id, _fcd tag, int_f* taglen)
c_tag = H5Tget_tag(c_type_id);
if (c_tag == NULL ) return ret_value;
HD5packFstring(c_tag, _fcdtocp(tag), (int)strlen(c_tag));
HD5packFstring(c_tag, _fcdtocp(tag), (int)strlen(c_tag));
*taglen = (int_f)HDstrlen(c_tag);
HDfree(c_tag);
ret_value = 0;
ret_value = 0;
return ret_value;
}
/*----------------------------------------------------------------------------
@@ -1603,14 +1603,14 @@ nh5tvlen_create_c(hid_t_f* type_id, hid_t_f *vltype_id)
c_vltype_id = H5Tvlen_create(c_type_id);
if (c_vltype_id < 0 ) return ret_value;
*vltype_id = (hid_t_f)c_vltype_id;
ret_value = 0;
ret_value = 0;
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5tis_variable_str_c
* Purpose: Call H5Tis_variable_str to detrmine if the datatype
* is a variable string.
* Inputs: type_id - identifier of the dataspace
* Inputs: type_id - identifier of the dataspace
* Outputs: flag - 0 if not VL str, 1 if is not
* and negative on failure.
* Returns: 0 on success, -1 on failure
@@ -1619,7 +1619,7 @@ nh5tvlen_create_c(hid_t_f* type_id, hid_t_f *vltype_id)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag )
{
int ret_value = 0;
@@ -1636,7 +1636,7 @@ nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag )
* Name: h5tget_member_class_c
* Purpose: Call H5Tget_member_class to detrmine ithe class of the compound
* datatype member
* Inputs: type_id - identifier of the dataspace
* Inputs: type_id - identifier of the dataspace
* member_no - member's index
* Outputs: class - member's class
* and negative on failure.
@@ -1646,7 +1646,7 @@ nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag )
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5tget_member_class_c ( hid_t_f *type_id , int_f *member_no, int_f *class )
{
int ret_value = 0;
+2 -2
View File
@@ -54,7 +54,7 @@ nh5zunregister_c (int_f *filter)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5zfilter_avail_c ( int_f *filter , int_f *flag )
{
int ret_value = 0;
@@ -80,7 +80,7 @@ nh5zfilter_avail_c ( int_f *filter , int_f *flag )
* Modifications:
*---------------------------------------------------------------------------*/
int_f
int_f
nh5zget_filter_info_c ( int_f *filter , int_f *flag )
{
int ret_value = 0;
+86 -86
View File
@@ -19,21 +19,21 @@
/*---------------------------------------------------------------------------
* Name: h5init_types_c
* Purpose: Initialize predefined datatypes in Fortran
* Inputs: types - array with the predefined Native Fortran
* Inputs: types - array with the predefined Native Fortran
* type, its element and length must be the
* same as the types array defined in the
* same as the types array defined in the
* H5f90global.f90
* floatingtypes - array with the predefined Floating Fortran
* floatingtypes - array with the predefined Floating Fortran
* type, its element and length must be the
* same as the floatingtypes array defined in the
* same as the floatingtypes array defined in the
* H5f90global.f90
* integertypes - array with the predefined Integer Fortran
* integertypes - array with the predefined Integer Fortran
* type, its element and length must be the
* same as the integertypes array defined in the
* same as the integertypes array defined in the
* H5f90global.f90
* Outputs: None
* Outputs: None
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Programmer: Elena Pourmal
* Tuesday, August 3, 1999
* Modifications:
*---------------------------------------------------------------------------*/
@@ -112,49 +112,49 @@ nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertype
if ((integertypes[13] = (hid_t_f)H5Tcopy(H5T_STD_U32LE)) < 0) return ret_value;
if ((integertypes[14] = (hid_t_f)H5Tcopy(H5T_STD_U64BE)) < 0) return ret_value;
if ((integertypes[15] = (hid_t_f)H5Tcopy(H5T_STD_U64LE)) < 0) return ret_value;
/*
* Define Fortran H5T_STRING type to store non-fixed size strings
/*
* Define Fortran H5T_STRING type to store non-fixed size strings
*/
if ((c_type_id = H5Tcopy(H5T_C_S1)) < 0) return ret_value;
if(H5Tset_size(c_type_id, H5T_VARIABLE) < 0) return ret_value;
if(H5Tset_size(c_type_id, H5T_VARIABLE) < 0) return ret_value;
integertypes[16] = c_type_id;
ret_value = 0;
ret_value = 0;
return ret_value;
}
/*---------------------------------------------------------------------------
* Name: h5close_types_c
* Purpose: Closes predefined datatype in Fortran
* Inputs: types - array with the predefined Native Fortran
* Inputs: types - array with the predefined Native Fortran
* type, its element and length must be the
* same as the types array defined in the
* same as the types array defined in the
* H5f90global.f90
* lentypes - length of the types array, which must be the
* same as the length of types array defined
* same as the length of types array defined
* in the H5f90global.f90
* floatingtypes - array with the predefined Floating Fortran
* floatingtypes - array with the predefined Floating Fortran
* type, its element and length must be the
* same as the floatingtypes array defined in the
* same as the floatingtypes array defined in the
* H5f90global.f90
* floatinglen - length of the floatingtypes array, which must be the
* same as the length of floatingtypes array defined
* same as the length of floatingtypes array defined
* in the H5f90global.f90
* integertypes - array with the predefined Integer Fortran
* integertypes - array with the predefined Integer Fortran
* type, its element and length must be the
* same as the integertypes array defined in the
* same as the integertypes array defined in the
* H5f90global.f90
* integerlen - length of the floatingtypes array, which must be the
* same as the length of floatingtypes array defined
* same as the length of floatingtypes array defined
* in the H5f90global.f90
* Outputs: None
* Outputs: None
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Programmer: Elena Pourmal
* Tuesday, August 3, 1999
* Modifications:
*---------------------------------------------------------------------------*/
int_f
nh5close_types_c( hid_t_f * types, int_f *lentypes,
nh5close_types_c( hid_t_f * types, int_f *lentypes,
hid_t_f * floatingtypes, int_f* floatinglen,
hid_t_f * integertypes, int_f * integerlen )
{
@@ -175,13 +175,13 @@ nh5close_types_c( hid_t_f * types, int_f *lentypes,
c_type_id = integertypes[i];
if ( H5Tclose(c_type_id) < 0) return ret_value;
}
ret_value = 0;
ret_value = 0;
return ret_value;
}
}
/*---------------------------------------------------------------------------
* Name: h5init_flags_c
* Purpose: Initialize Fortran flags
* Inputs: h5d_flags - H5D inteface flags
* Inputs: h5d_flags - H5D inteface flags
* h5f_flags - H5F interface flags
* h5fd_flags - H5FD interface flags
* h5fd_hid_flags- H5FD interface flags of type hid_t
@@ -192,18 +192,18 @@ nh5close_types_c( hid_t_f * types, int_f *lentypes,
* h5s_flags - H5S interface flags
* h5t_flags - H5T interface flags
* h5z_flags - H5Z interface flags
* Outputs: None
* Outputs: None
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Programmer: Elena Pourmal
* Tuesday, August 3, 1999
* Modifications: Added Z flags. EIP, March 12, 2003
* Added more FD flags and new H5LIB flags
* Added more FD flags for HDF5 file driver
* EIP, April 9, 2005
* Added more FD flags for HDF5 file driver
* EIP, April 9, 2005
*---------------------------------------------------------------------------*/
int_f
nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags,
int_f *h5fd_flags, hid_t_f *h5fd_hid_flags,
int_f *h5fd_flags, hid_t_f *h5fd_hid_flags,
int_f *h5g_flags, int_f *h5i_flags,
hid_t_f *h5p_flags, int_f *h5r_flags, int_f *h5s_flags,
int_f *h5t_flags, int_f *h5z_flags)
@@ -235,7 +235,7 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags,
/*
* H5F flags
*/
h5f_flags[0] = (int_f)H5F_ACC_RDWR;
h5f_flags[0] = (int_f)H5F_ACC_RDWR;
h5f_flags[1] = (int_f)H5F_ACC_RDONLY;
h5f_flags[2] = (int_f)H5F_ACC_TRUNC;
h5f_flags[3] = (int_f)H5F_ACC_EXCL;
@@ -264,7 +264,7 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags,
h5fd_flags[6] = H5FD_MEM_DRAW;
h5fd_flags[7] = H5FD_MEM_GHEAP;
h5fd_flags[8] = H5FD_MEM_LHEAP;
h5fd_flags[9] = H5FD_MEM_OHDR;
h5fd_flags[9] = H5FD_MEM_OHDR;
h5fd_flags[10] = H5FD_MEM_NTYPES;
/*
@@ -308,8 +308,8 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags,
* H5P flags
*/
h5p_flags[0] = H5P_FILE_CREATE;
h5p_flags[1] = H5P_FILE_ACCESS;
h5p_flags[0] = H5P_FILE_CREATE;
h5p_flags[1] = H5P_FILE_ACCESS;
h5p_flags[2] = H5P_DATASET_CREATE;
h5p_flags[3] = H5P_DATASET_XFER;
h5p_flags[4] = H5P_MOUNT;
@@ -328,9 +328,9 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags,
*/
h5s_flags[0] = H5S_SCALAR;
h5s_flags[1] = H5S_SIMPLE;
h5s_flags[2] = H5S_NULL;
h5s_flags[0] = H5S_SCALAR;
h5s_flags[1] = H5S_SIMPLE;
h5s_flags[2] = H5S_NULL;
h5s_flags[3] = H5S_SELECT_SET;
h5s_flags[4] = H5S_SELECT_OR;
h5s_flags[5] = (int_f)H5S_UNLIMITED;
@@ -357,29 +357,29 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags,
*/
h5t_flags[0] = H5T_NO_CLASS;
h5t_flags[1] = H5T_INTEGER;
h5t_flags[2] = H5T_FLOAT;
h5t_flags[3] = H5T_TIME;
h5t_flags[4] = H5T_STRING;
h5t_flags[0] = H5T_NO_CLASS;
h5t_flags[1] = H5T_INTEGER;
h5t_flags[2] = H5T_FLOAT;
h5t_flags[3] = H5T_TIME;
h5t_flags[4] = H5T_STRING;
h5t_flags[5] = H5T_BITFIELD;
h5t_flags[6] = H5T_OPAQUE;
h5t_flags[7] = H5T_COMPOUND;
h5t_flags[7] = H5T_COMPOUND;
h5t_flags[8] = H5T_REFERENCE;
h5t_flags[9] = H5T_ENUM;
h5t_flags[10] = H5T_ORDER_LE;
h5t_flags[9] = H5T_ENUM;
h5t_flags[10] = H5T_ORDER_LE;
h5t_flags[11] = H5T_ORDER_BE;
h5t_flags[12] = H5T_ORDER_VAX;
h5t_flags[13] = H5T_PAD_ZERO;
h5t_flags[14] = H5T_PAD_ONE;
h5t_flags[15] = H5T_PAD_BACKGROUND;
h5t_flags[16] = H5T_PAD_ERROR;
h5t_flags[17] = H5T_SGN_NONE;
h5t_flags[18] = H5T_SGN_2;
h5t_flags[16] = H5T_PAD_ERROR;
h5t_flags[17] = H5T_SGN_NONE;
h5t_flags[18] = H5T_SGN_2;
h5t_flags[19] = H5T_SGN_ERROR;
h5t_flags[20] = H5T_NORM_IMPLIED;
h5t_flags[21] = H5T_NORM_MSBSET;
h5t_flags[22] = H5T_NORM_NONE;
h5t_flags[22] = H5T_NORM_NONE;
h5t_flags[23] = H5T_CSET_ASCII;
h5t_flags[24] = H5T_CSET_UTF8;
h5t_flags[25] = H5T_STR_NULLTERM;
@@ -407,7 +407,7 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags,
h5z_flags[12] = H5Z_FILTER_CONFIG_DECODE_ENABLED;
h5z_flags[13] = H5Z_FILTER_ALL;
ret_value = 0;
ret_value = 0;
return ret_value;
}
@@ -419,7 +419,7 @@ nh5init1_flags_c(int_f *h5lib_flags)
unsigned prm_2 = H5_SZIP_NN_OPTION_MASK;
h5lib_flags[0] = (int_f)prm_1;
h5lib_flags[1] = (int_f)prm_2;
ret_value = 0;
ret_value = 0;
return ret_value;
}
@@ -427,8 +427,8 @@ nh5init1_flags_c(int_f *h5lib_flags)
* Name: h5open_c
* Purpose: Calls H5open call to initialize C HDF5 library
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Friday, November 17, 2000
* Programmer: Elena Pourmal
* Friday, November 17, 2000
* Modifications:
*---------------------------------------------------------------------------*/
int_f
@@ -436,16 +436,16 @@ nh5open_c()
{
int ret_value = -1;
if (H5open() < 0) return ret_value;
ret_value = 0;
if (H5open() < 0) return ret_value;
ret_value = 0;
return ret_value;
}
}
/*---------------------------------------------------------------------------
* Name: h5close_c
* Purpose: Calls H5close call to close C HDF5 library
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Friday, November 17, 2000
* Programmer: Elena Pourmal
* Friday, November 17, 2000
* Modifications:
*---------------------------------------------------------------------------*/
int_f
@@ -453,24 +453,24 @@ nh5close_c()
{
int ret_value = -1;
if (H5close() < 0) return ret_value;
ret_value = 0;
if (H5close() < 0) return ret_value;
ret_value = 0;
return ret_value;
}
}
/*---------------------------------------------------------------------------
* Name: h5get_libversion_c
* Purpose: Calls H5get_libversion function
* to retrieve library version info.
* Inputs:
* to retrieve library version info.
* Inputs:
* None
* Outputs:
* Outputs:
* majnum - the major version of the library
* minnum - the minor version of the library
* relnum - the release version of the library
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Programmer: Elena Pourmal
* Tuesday, September 24, 2002
* Modifications:
*---------------------------------------------------------------------------*/
@@ -479,30 +479,30 @@ nh5get_libversion_c( int_f *majnum, int_f *minnum, int_f *relnum)
{
int ret_value = -1;
unsigned c_majnum, c_minnum, c_relnum;
unsigned c_majnum, c_minnum, c_relnum;
if (H5get_libversion(&c_majnum, &c_minnum, &c_relnum) < 0) return ret_value;
*majnum = (int_f)c_majnum;
*minnum = (int_f)c_minnum;
*relnum = (int_f)c_relnum;
ret_value = 0;
ret_value = 0;
return ret_value;
}
}
/*---------------------------------------------------------------------------
* Name: h5check_version_c
* Purpose: Calls H5check_version function
* to verify library version info.
* Inputs:
* to verify library version info.
* Inputs:
* majnum - the major version of the library
* minnum - the minor version of the library
* relnum - the release version of the library
* Outputs:
* Outputs:
* None
* Returns: 0 on success, aborts on failure
* Programmer: Elena Pourmal
* Programmer: Elena Pourmal
* Tuesday, September 24, 2002
* Modifications:
*---------------------------------------------------------------------------*/
@@ -511,22 +511,22 @@ nh5check_version_c( int_f *majnum, int_f *minnum, int_f *relnum)
{
int ret_value = -1;
unsigned c_majnum, c_minnum, c_relnum;
unsigned c_majnum, c_minnum, c_relnum;
c_majnum = (unsigned) *majnum;
c_minnum = (unsigned) *minnum;
c_relnum = (unsigned) *relnum;
H5check_version(c_majnum, c_minnum, c_relnum);
ret_value = 0;
ret_value = 0;
return ret_value;
}
}
/*---------------------------------------------------------------------------
* Name: h5garbage_collect_c
* Purpose: Calls H5garbage_collect to collect on all free-lists of all types
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Programmer: Elena Pourmal
* Tuesday, September 24, 2002
* Modifications:
*---------------------------------------------------------------------------*/
@@ -535,16 +535,16 @@ nh5garbage_collect_c()
{
int ret_value = -1;
if (H5garbage_collect() < 0) return ret_value;
ret_value = 0;
if (H5garbage_collect() < 0) return ret_value;
ret_value = 0;
return ret_value;
}
}
/*---------------------------------------------------------------------------
* Name: h5dont_atexit_c
* Purpose: Calls H5dont_atexit not to install atexit cleanup routine
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Programmer: Elena Pourmal
* Tuesday, September 24, 2002
* Modifications:
*---------------------------------------------------------------------------*/
@@ -553,7 +553,7 @@ nh5dont_atexit_c()
{
int ret_value = -1;
if (H5dont_atexit() < 0) return ret_value;
ret_value = 0;
if (H5dont_atexit() < 0) return ret_value;
ret_value = 0;
return ret_value;
}
}
+1 -1
View File
@@ -14,7 +14,7 @@
#ifndef _H5f90_H
#define _H5f90_H
#define _H5f90_H
#include "hdf5.h"
#include "H5private.h"
+1 -1
View File
@@ -14,7 +14,7 @@
#include <ctype.h>
#include <stddef.h>
#include <stddef.h>
#include "H5f90.h"
+24 -24
View File
@@ -236,14 +236,14 @@ H5_FCDLL int_f nh5awrite_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, v
H5_FCDLL int_f nh5areadc_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims);
H5_FCDLL int_f nh5aread_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims);
H5_FCDLL int_f nh5aclose_c ( hid_t_f *attr_id );
H5_FCDLL int_f nh5adelete_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen);
H5_FCDLL int_f nh5adelete_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen);
H5_FCDLL int_f nh5aopen_idx_c (hid_t_f *obj_id, int_f *idx, hid_t_f *attr_id);
H5_FCDLL int_f nh5aget_space_c (hid_t_f *attr_id, hid_t_f *space_id);
H5_FCDLL int_f nh5aget_type_c (hid_t_f *attr_id, hid_t_f *type_id);
H5_FCDLL int_f nh5aget_num_attrs_c (hid_t_f *obj_id, int_f *attr_num);
H5_FCDLL int_f nh5aget_name_c(hid_t_f *attr_id, size_t_f *size, _fcd buf);
/*
/*
* Functions form H5Tf.c file
*/
# define nh5topen_c H5_FC_FUNC_(h5topen_c, H5TOPEN_C)
@@ -361,7 +361,7 @@ H5_FCDLL int_f nh5tvlen_create_c ( hid_t_f *type_id , hid_t_f *vltype_id);
H5_FCDLL int_f nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag );
H5_FCDLL int_f nh5tget_member_class_c ( hid_t_f *type_id , int_f *member_no, int_f *class );
/*
/*
* Functions from H5Pf.c
*/
# define nh5pcreate_c H5_FC_FUNC_(h5pcreate_c, H5PCREATE_C)
@@ -463,7 +463,7 @@ H5_FCDLL int_f nh5tget_member_class_c ( hid_t_f *type_id , int_f *member_no, in
# define nh5pset_fletcher32_c H5_FC_FUNC_(h5pset_fletcher32_c, H5PSET_FLETCHER32_C)
# define nh5pset_edc_check_c H5_FC_FUNC_(h5pset_edc_check_c, H5PSET_EDC_CHECK_C)
# define nh5pget_edc_check_c H5_FC_FUNC_(h5pget_edc_check_c, H5PGET_EDC_CHECK_C)
# define nh5pset_family_offset_c H5_FC_FUNC_(h5pset_family_offset_c, H5PSET_FAMILY_OFFSET_C)
# define nh5pset_family_offset_c H5_FC_FUNC_(h5pset_family_offset_c, H5PSET_FAMILY_OFFSET_C)
# define nh5pget_fapl_multi_c H5_FC_FUNC_(h5pget_fapl_multi_c, H5PGET_FAPL_MULTI_C)
# define nh5pset_fapl_multi_c H5_FC_FUNC_(h5pset_fapl_multi_c, H5PSET_FAPL_MULTI_C)
# define nh5pset_fapl_multi_sc H5_FC_FUNC_(h5pset_fapl_multi_sc, H5PSET_FAPL_MULTI_SC)
@@ -548,23 +548,23 @@ H5_FCDLL int_f nh5pget_small_data_block_size_c(hid_t_f *plist, hsize_t_f *size);
H5_FCDLL int_f nh5pset_hyper_vector_size_c(hid_t_f *plist, size_t_f *size);
H5_FCDLL int_f nh5pget_hyper_vector_size_c(hid_t_f *plist, size_t_f *size);
H5_FCDLL int_f nh5pcreate_class_c(hid_t_f *parent, _fcd name, int_f *name_len, hid_t_f *class);
H5_FCDLL int_f nh5pregister_c(hid_t_f *class, _fcd name, int_f * name_len, size_t_f *size, void *value);
H5_FCDLL int_f nh5pregisterc_c(hid_t_f *class, _fcd name, int_f * name_len, size_t_f *size, _fcd value, int_f *value_len);
H5_FCDLL int_f nh5pinsert_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, void *value);
H5_FCDLL int_f nh5pinsertc_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, _fcd value, int_f *value_len);
H5_FCDLL int_f nh5pset_c(hid_t_f *prp_id, _fcd name, int_f *name_len, void *value);
H5_FCDLL int_f nh5psetc_c(hid_t_f *prp_id, _fcd name, int_f *name_len, _fcd value, int_f *value_len);
H5_FCDLL int_f nh5pget_c(hid_t_f *prp_id, _fcd name, int_f *name_len, void *value);
H5_FCDLL int_f nh5pregister_c(hid_t_f *class, _fcd name, int_f * name_len, size_t_f *size, void *value);
H5_FCDLL int_f nh5pregisterc_c(hid_t_f *class, _fcd name, int_f * name_len, size_t_f *size, _fcd value, int_f *value_len);
H5_FCDLL int_f nh5pinsert_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, void *value);
H5_FCDLL int_f nh5pinsertc_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, _fcd value, int_f *value_len);
H5_FCDLL int_f nh5pset_c(hid_t_f *prp_id, _fcd name, int_f *name_len, void *value);
H5_FCDLL int_f nh5psetc_c(hid_t_f *prp_id, _fcd name, int_f *name_len, _fcd value, int_f *value_len);
H5_FCDLL int_f nh5pget_c(hid_t_f *prp_id, _fcd name, int_f *name_len, void *value);
H5_FCDLL int_f nh5pgetc_c(hid_t_f *prp_id, _fcd name, int_f *name_len, _fcd value, int_f *value_len);
H5_FCDLL int_f nh5pexist_c(hid_t_f *prp_id, _fcd name, int_f *name_len);
H5_FCDLL int_f nh5pget_size_c(hid_t_f *prp_id, _fcd name, int_f *name_len, size_t_f *size);
H5_FCDLL int_f nh5pget_nprops_c(hid_t_f *prp_id, size_t_f *nprops);
H5_FCDLL int_f nh5pget_class_parent_c(hid_t_f *prp_id, hid_t_f *parent_id);
H5_FCDLL int_f nh5pisa_class_c(hid_t_f *plist, hid_t_f *pclass);
H5_FCDLL int_f nh5pexist_c(hid_t_f *prp_id, _fcd name, int_f *name_len);
H5_FCDLL int_f nh5pget_size_c(hid_t_f *prp_id, _fcd name, int_f *name_len, size_t_f *size);
H5_FCDLL int_f nh5pget_nprops_c(hid_t_f *prp_id, size_t_f *nprops);
H5_FCDLL int_f nh5pget_class_parent_c(hid_t_f *prp_id, hid_t_f *parent_id);
H5_FCDLL int_f nh5pisa_class_c(hid_t_f *plist, hid_t_f *pclass);
H5_FCDLL int_f nh5pcopy_prop_c(hid_t_f *dst_id, hid_t_f *src_id, _fcd name, int_f *name_len);
H5_FCDLL int_f nh5premove_c(hid_t_f *plid, _fcd name, int_f *name_len);
H5_FCDLL int_f nh5premove_c(hid_t_f *plid, _fcd name, int_f *name_len);
H5_FCDLL int_f nh5punregister_c(hid_t_f *class, _fcd name, int_f *name_len);
H5_FCDLL int_f nh5pclose_class_c(hid_t_f * class);
H5_FCDLL int_f nh5pclose_class_c(hid_t_f * class);
H5_FCDLL int_f nh5pget_class_name_c(hid_t_f *prp_id, _fcd name, int_f *name_len);
H5_FCDLL int_f nh5pset_shuffle_c ( hid_t_f *prp_id);
H5_FCDLL int_f nh5pset_fletcher32_c ( hid_t_f *prp_id );
@@ -575,11 +575,11 @@ H5_FCDLL int_f nh5pget_fapl_multi_c ( hid_t_f *prp_id , int_f *mem_map, hid_t_f
H5_FCDLL int_f nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *mem_map, hid_t_f *memb_fapl, _fcd memb_name, int_f *len, int_f *lenmax, real_f *memb_addr, int_f *flag);
H5_FCDLL int_f nh5pset_fapl_multi_sc ( hid_t_f *prp_id , int_f *flag);
H5_FCDLL int_f nh5pset_szip_c ( hid_t_f *prp_id , int_f *options_mask, int_f *pixels_per_block);
H5_FCDLL int_f nh5pall_filters_avail_c ( hid_t_f *prp_id , int_f *status);
H5_FCDLL int_f nh5pall_filters_avail_c ( hid_t_f *prp_id , int_f *status);
H5_FCDLL int_f nh5pfill_value_defined_c ( hid_t_f *prp_id , int_f *flag);
/*
* Functions frome H5Rf.c
* Functions frome H5Rf.c
*/
# define nh5rcreate_object_c H5_FC_FUNC_(h5rcreate_object_c, H5RCREATE_OBJECT_C)
# define nh5rcreate_region_c H5_FC_FUNC_(h5rcreate_region_c, H5RCREATE_REGION_C)
@@ -614,7 +614,7 @@ H5_FCDLL int_f nh5iget_ref_c(hid_t_f *obj_id, int_f *ref_count);
H5_FCDLL int_f nh5iget_file_id_c(hid_t_f *obj_id, hid_t_f *file_id);
/*
* Functions from H5Ef.c
* Functions from H5Ef.c
*/
# define nh5eclear_c H5_FC_FUNC_(h5eclear_c, H5ECLEAR_C)
# define nh5eprint_c1 H5_FC_FUNC_(h5eprint_c1, H5EPRINT_C1)
@@ -632,7 +632,7 @@ H5_FCDLL int_f nh5eget_minor_c(int_f* error_no, _fcd name, size_t_f* namelen);
H5_FCDLL int_f nh5eset_auto_c(int_f* printflag);
/*
* Functions from H5f.c
* Functions from H5f.c
*/
# define nh5open_c H5_FC_FUNC_(h5open_c, H5OPEN_C)
# define nh5close_c H5_FC_FUNC_(h5close_c, H5CLOSE_C)
@@ -654,8 +654,8 @@ H5_FCDLL int_f nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags,
int_f *h5fd_flags, hid_t_f *h5fd_hid_flags,
int_f *h5g_flags, int_f *h5i_flags,
hid_t_f *h5p_flags, int_f *h5r_flags, int_f *h5s_flags,
int_f *h5t_flags, int_f *h5z_flags);
H5_FCDLL int_f nh5init1_flags_c(int_f *h5lib_flags);
int_f *h5t_flags, int_f *h5z_flags);
H5_FCDLL int_f nh5init1_flags_c(int_f *h5lib_flags);
H5_FCDLL int_f nh5get_libversion_c(int_f *majnum, int_f *minnum, int_f *relnum);
H5_FCDLL int_f nh5check_version_c(int_f *majnum, int_f *minnum, int_f *relnum);
H5_FCDLL int_f nh5garbage_collect_c(void);
+4 -4
View File
@@ -221,13 +221,13 @@ int main()
#endif
/* int */
#if defined H5_FORTRAN_HAS_NATIVE_8
#if defined H5_FORTRAN_HAS_NATIVE_8
writeToFiles("INT", "int_f", 8);
#elif defined H5_FORTRAN_HAS_NATIVE_4
#elif defined H5_FORTRAN_HAS_NATIVE_4
writeToFiles("INT", "int_f", 4);
#elif defined H5_FORTRAN_HAS_NATIVE_2
#elif defined H5_FORTRAN_HAS_NATIVE_2
writeToFiles("INT", "int_f", 2);
#elif defined H5_FORTRAN_HAS_NATIVE_1
#elif defined H5_FORTRAN_HAS_NATIVE_1
writeToFiles("INT", "int_f", 1);
#else
/* Error: couldn't find a size for int */
+14 -14
View File
@@ -17,9 +17,9 @@
/*----------------------------------------------------------------------------
* Name: h5_fixname_c
* Purpose: Call h5_fixname to modify file name
* Inputs: base_name - name of the file
* Inputs: base_name - name of the file
* base_namelen - name length
* fapl - file access property list
* fapl - file access property list
* full_name - buffer to return full name
* full_namelen - name length
* Returns: 0 on success, -1 on failure
@@ -42,7 +42,7 @@ nh5_fixname_c(_fcd base_name, size_t_f *base_namelen, hid_t_f* fapl, _fcd full_n
/*
* Convert FORTRAN name to C name
*/
c_base_name = (char *)HD5f2cstring(base_name, (size_t)*base_namelen);
c_base_name = (char *)HD5f2cstring(base_name, (size_t)*base_namelen);
if (c_base_name == NULL) goto DONE;
c_full_name = (char *) HDmalloc((size_t)*full_namelen + 1);
if (c_full_name == NULL) goto DONE;
@@ -51,7 +51,7 @@ nh5_fixname_c(_fcd base_name, size_t_f *base_namelen, hid_t_f* fapl, _fcd full_n
* Call h5_fixname function.
*/
if (NULL != h5_fixname(c_base_name, c_fapl, c_full_name, (size_t)*full_namelen + 1)) {
HD5packFstring(c_full_name, _fcdtocp(full_name), (size_t)*full_namelen);
HD5packFstring(c_full_name, _fcdtocp(full_name), (size_t)*full_namelen);
ret_value = 0;
goto DONE;
}
@@ -59,15 +59,15 @@ nh5_fixname_c(_fcd base_name, size_t_f *base_namelen, hid_t_f* fapl, _fcd full_n
DONE:
if (NULL != c_base_name) HDfree(c_base_name);
if (NULL != c_full_name) HDfree(c_full_name);
return ret_value;
}
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5_cleanup_c
* Purpose: Call h5_cleanup to clean temporary files.
* Inputs: base_name - name of the file
* Inputs: base_name - name of the file
* base_namelen - name length
* fapl - file access property list
* fapl - file access property list
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Thursday, September 19, 2002
@@ -89,7 +89,7 @@ nh5_cleanup_c(_fcd base_name, size_t_f *base_namelen, hid_t_f* fapl)
/*
* Convert FORTRAN name to C name
*/
c_base_name[0] = (char *)HD5f2cstring(base_name, (size_t)*base_namelen);
c_base_name[0] = (char *)HD5f2cstring(base_name, (size_t)*base_namelen);
if (c_base_name[0] == NULL) goto DONE;
/*
@@ -100,19 +100,19 @@ nh5_cleanup_c(_fcd base_name, size_t_f *base_namelen, hid_t_f* fapl)
goto DONE;
}
*/
h5_fixname(c_base_name[0], c_fapl, filename, sizeof(filename));
h5_fixname(c_base_name[0], c_fapl, filename, sizeof(filename));
HDremove(filename);
ret_value =0;
DONE:
if (NULL != c_base_name[0]) HDfree(c_base_name[0]);
return ret_value;
}
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5_exit_c
* Purpose: Call 'exit()' to terminate application. Be careful not to
* Purpose: Call 'exit()' to terminate application. Be careful not to
* overflow the exit value range since UNIX supports a very
* small range such as 1 byte. Therefore, exit(256) may end
* up as exit(0).
+3 -3
View File
@@ -26,12 +26,12 @@ char *h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size)
# define nh5_cleanup_c H5_FC_FUNC_(h5_cleanup_c, H5_CLEANUP_C)
# define nh5_exit_c H5_FC_FUNC_(h5_exit_c, H5_EXIT_C)
H5_FCTESTDLL int_f nh5_fixname_c
H5_FCTESTDLL int_f nh5_fixname_c
(_fcd base_name, size_t_f *base_namelen, hid_t_f *fapl, _fcd full_name, size_t_f *full_namelen);
H5_FCTESTDLL int_f nh5_cleanup_c
H5_FCTESTDLL int_f nh5_cleanup_c
(_fcd base_name, size_t_f *base_namelen, hid_t_f *fapl);
H5_FCTESTDLL void nh5_exit_c
H5_FCTESTDLL void nh5_exit_c
(int_f *status);
+3 -3
View File
@@ -30,7 +30,7 @@
}
/* IsValid
* Returns true if this packet table is valid, false otherwise.
* Returns true if this packet table is valid, false otherwise.
* Use this after the constructor to ensure HDF did not have
* any trouble making or opening the packet table.
*/
@@ -89,7 +89,7 @@
/* Constructor
* Creates a packet table in which to store fixed length records.
* Takes the ID of the file the packet table will be created in, the name of
* the packet table, the ID of the datatype of the set, and the size
* the packet table, the ID of the datatype of the set, and the size
* of a memory chunk used in chunking.
*/
FL_PacketTable::FL_PacketTable(hid_t fileID, char* name, hid_t dtypeID, int chunkSize)
@@ -177,7 +177,7 @@
{
return H5PTget_next(table_id, numRecords, data);
}
/********************************/
/* Variable-Length Packet Table */
+2 -2
View File
@@ -31,7 +31,7 @@ public:
~PacketTable();
/* IsValid
* Returns true if this packet table is valid, false otherwise.
* Returns true if this packet table is valid, false otherwise.
* Use this after the constructor to ensure HDF did not have
* any trouble making or opening the packet table.
*/
@@ -78,7 +78,7 @@ public:
/* Constructor
* Creates a packet table in which to store fixed length records.
* Takes the ID of the file the packet table will be created in, the name of
* the packet table, the ID of the datatype of the set, and the size
* the packet table, the ID of the datatype of the set, and the size
* of a memory chunk used in chunking.
*/
FL_PacketTable(hid_t fileID, char* name, hid_t dtypeID, int chunkSize);
+2 -2
View File
@@ -84,7 +84,7 @@ int BasicTest()
wrapper.AppendPacket(&myRecord);
/* get number of records test */
count = wrapper.GetPacketCount();
count = wrapper.GetPacketCount();
if(count != 2)
goto out;
@@ -374,7 +374,7 @@ int SystemTest()
hid_t dtypeID1, dtypeID2;
unsigned int count;
/* Creating two inter-related datatypes. Create two datasets and put
/* Creating two inter-related datatypes. Create two datasets and put
* one datatype in each. */
typedef struct compoundType
{
+50 -50
View File
@@ -22,7 +22,7 @@
* private functions
*-------------------------------------------------------------------------
*/
herr_t H5IM_get_palette( hid_t loc_id,
herr_t H5IM_get_palette( hid_t loc_id,
const char *image_name,
int pal_number,
hid_t tid,
@@ -49,8 +49,8 @@ herr_t H5IM_get_palette( hid_t loc_id,
*-------------------------------------------------------------------------
*/
herr_t H5IMmake_image_8bitf( hid_t loc_id,
const char *dset_name,
herr_t H5IMmake_image_8bitf( hid_t loc_id,
const char *dset_name,
hsize_t width,
hsize_t height,
int_f *buf )
@@ -58,17 +58,17 @@ herr_t H5IMmake_image_8bitf( hid_t loc_id,
hid_t did; /* dataset ID */
hid_t sid; /* space ID */
hsize_t dims[IMAGE8_RANK]; /* dimensions */
/* initialize the image dimensions */
dims[0] = height;
dims[1] = width;
dims[2] = 1;
dims[0] = height;
dims[1] = width;
dims[2] = 1;
/*-------------------------------------------------------------------------
* create and write the dataset
*-------------------------------------------------------------------------
*/
/* create the data space for the dataset. */
if ((sid=H5Screate_simple(IMAGE8_RANK,dims,NULL))<0)
return -1;
@@ -80,7 +80,7 @@ herr_t H5IMmake_image_8bitf( hid_t loc_id,
/* write with memory type H5T_NATIVE_INT */
/* Use long type if Fortran integer is 8 bytes and C long long is also 8 bytes*/
/* Fail if otherwise */
if (buf)
if (buf)
{
if (sizeof(int_f) == sizeof(int)) {
if (H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
@@ -105,7 +105,7 @@ herr_t H5IMmake_image_8bitf( hid_t loc_id,
* attach the specification attributes
*-------------------------------------------------------------------------
*/
/* attach the CLASS attribute */
if ( H5LTset_attribute_string( loc_id, dset_name, "CLASS", IMAGE_CLASS ) < 0 )
return -1;
@@ -139,9 +139,9 @@ herr_t H5IMmake_image_8bitf( hid_t loc_id,
* The memory datatype is H5T_NATIVE_INT. It is supposed to be called from
* the FORTRAN interface where the image buffer is defined as type "integer"
*
* Interlace Mode Dimensions in the Dataspace
* INTERLACE_PIXEL [height][width][pixel components]
* INTERLACE_PLANE [pixel components][height][width]
* Interlace Mode Dimensions in the Dataspace
* INTERLACE_PIXEL [height][width][pixel components]
* INTERLACE_PLANE [pixel components][height][width]
*
*
* Modifications:
@@ -149,8 +149,8 @@ herr_t H5IMmake_image_8bitf( hid_t loc_id,
*-------------------------------------------------------------------------
*/
herr_t H5IMmake_image_24bitf( hid_t loc_id,
const char *dset_name,
herr_t H5IMmake_image_24bitf( hid_t loc_id,
const char *dset_name,
hsize_t width,
hsize_t height,
const char *interlace,
@@ -164,28 +164,28 @@ herr_t H5IMmake_image_24bitf( hid_t loc_id,
* attach the image dimensions according to the interlace mode
*-------------------------------------------------------------------------
*/
if ( strcmp( interlace, "INTERLACE_PIXEL" ) == 0 )
if ( strcmp( interlace, "INTERLACE_PIXEL" ) == 0 )
{
/* Number of color planes is defined as the third dimension */
dims[0] = height;
dims[1] = width;
dims[2] = IMAGE24_RANK;
dims[0] = height;
dims[1] = width;
dims[2] = IMAGE24_RANK;
}
else
if ( strcmp( interlace, "INTERLACE_PLANE" ) == 0 )
if ( strcmp( interlace, "INTERLACE_PLANE" ) == 0 )
{
/* Number of color planes is defined as the first dimension */
dims[0] = IMAGE24_RANK;
dims[1] = height;
dims[2] = width;
dims[0] = IMAGE24_RANK;
dims[1] = height;
dims[2] = width;
}
else return -1;
/*-------------------------------------------------------------------------
* create and write the dataset
*-------------------------------------------------------------------------
*/
/* create the data space for the dataset. */
if ((sid=H5Screate_simple(IMAGE24_RANK,dims,NULL))<0)
return -1;
@@ -195,7 +195,7 @@ herr_t H5IMmake_image_24bitf( hid_t loc_id,
return -1;
/* write with memory type H5T_NATIVE_INT */
if (buf)
if (buf)
{
if (sizeof(int_f) == sizeof(int)) {
if (H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
@@ -263,11 +263,11 @@ herr_t H5IMmake_image_24bitf( hid_t loc_id,
*-------------------------------------------------------------------------
*/
herr_t H5IMread_imagef( hid_t loc_id,
const char *dset_name,
herr_t H5IMread_imagef( hid_t loc_id,
const char *dset_name,
int_f *buf )
{
hid_t did;
hid_t did;
/* open the dataset */
if ( (did = H5Dopen( loc_id, dset_name )) < 0 )
@@ -314,7 +314,7 @@ out:
* The memory datatype is H5T_NATIVE_INT. It is supposed to be called from
* the FORTRAN interface where the image buffer is defined as type "integer"
*
* based on HDF5 Image and Palette Specification
* based on HDF5 Image and Palette Specification
* http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html
*
* Modifications:
@@ -322,20 +322,20 @@ out:
*-------------------------------------------------------------------------
*/
herr_t H5IMmake_palettef( hid_t loc_id,
herr_t H5IMmake_palettef( hid_t loc_id,
const char *pal_name,
const hsize_t *pal_dims,
int_f *pal_data )
int_f *pal_data )
{
{
hid_t did; /* dataset ID */
hid_t sid; /* space ID */
int has_pal;
/* Check if the dataset already exists */
has_pal = H5LTfind_dataset( loc_id, pal_name );
/* It exists. Return */
if ( has_pal == 1 )
return 0;
@@ -344,7 +344,7 @@ herr_t H5IMmake_palettef( hid_t loc_id,
* create and write the dataset
*-------------------------------------------------------------------------
*/
/* create the data space for the dataset. */
if ((sid=H5Screate_simple(2,pal_dims,NULL))<0)
return -1;
@@ -354,7 +354,7 @@ herr_t H5IMmake_palettef( hid_t loc_id,
return -1;
/* write with memory type H5T_NATIVE_INT */
if (pal_data)
if (pal_data)
{
if (sizeof(int_f) == sizeof(int)) {
if (H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,pal_data)<0)
@@ -387,7 +387,7 @@ herr_t H5IMmake_palettef( hid_t loc_id,
/* Attach the attribute "PAL_VERSION" to the >>palette<< dataset*/
if ( H5LTset_attribute_string( loc_id, pal_name, "PAL_VERSION", "1.2" ) < 0 )
return -1;
return 0;
}
@@ -409,7 +409,7 @@ herr_t H5IMmake_palettef( hid_t loc_id,
* The memory datatype is H5T_NATIVE_INT. It is supposed to be called from
* the FORTRAN interface where the image buffer is defined as type "integer"
*
* based on HDF5 Image and Palette Specification
* based on HDF5 Image and Palette Specification
* http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html
*
* Modifications:
@@ -417,7 +417,7 @@ herr_t H5IMmake_palettef( hid_t loc_id,
*-------------------------------------------------------------------------
*/
herr_t H5IMget_palettef( hid_t loc_id,
herr_t H5IMget_palettef( hid_t loc_id,
const char *image_name,
int pal_number,
int_f *pal_data )
@@ -447,19 +447,19 @@ herr_t H5IMget_palettef( hid_t loc_id,
* Comments:
* This function allows reading of an 8bit palette from disk disk
* to memory type TID
* The memory datatype can be H5T_NATIVE_INT or H5T_NATIVE_UCHAR currently.
* The memory datatype can be H5T_NATIVE_INT or H5T_NATIVE_UCHAR currently.
* the H5T_NATIVE_INT is supposed to be called from
* the FORTRAN interface where the image buffer is defined as type "integer"
*
* Comments:
* based on HDF5 Image and Palette Specification
* based on HDF5 Image and Palette Specification
* http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
herr_t H5IM_get_palette( hid_t loc_id,
herr_t H5IM_get_palette( hid_t loc_id,
const char *image_name,
int pal_number,
hid_t tid,
@@ -488,7 +488,7 @@ herr_t H5IM_get_palette( hid_t loc_id,
if ( (attr_id = H5Aopen_name( image_id, "PALETTE" )) < 0 )
goto out;
if ( (attr_type = H5Aget_type( attr_id )) < 0 )
goto out;
@@ -528,13 +528,13 @@ herr_t H5IM_get_palette( hid_t loc_id,
goto out;
free( refbuf );
} /* H5T_REFERENCE */
if ( H5Tclose( attr_type ) < 0 )
} /* H5T_REFERENCE */
if ( H5Tclose( attr_type ) < 0 )
goto out;
/* Close the attribute. */
/* Close the attribute. */
if ( H5Aclose( attr_id ) < 0 )
goto out;

Some files were not shown because too many files have changed in this diff Show More