summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/h5_chunk_read.c18
-rw-r--r--examples/h5_compound.c12
-rw-r--r--examples/h5_extend_write.c18
-rw-r--r--examples/h5_group.c16
-rw-r--r--examples/h5_read.c14
-rw-r--r--examples/h5_write.c6
6 files changed, 42 insertions, 42 deletions
diff --git a/examples/h5_chunk_read.c b/examples/h5_chunk_read.c
index 3460d9d..916383b 100644
--- a/examples/h5_chunk_read.c
+++ b/examples/h5_chunk_read.c
@@ -48,8 +48,8 @@ dataset = H5Dopen(file, DATASETNAME);
*/
filespace = H5Dget_space(dataset); /* Get filespace handle first. */
-rank = H5Pget_ndims(filespace);
-status_n = H5Pget_dims(filespace, dims);
+rank = H5Sget_ndims(filespace);
+status_n = H5Sget_dims(filespace, dims);
printf("dataset rank %d, dimensions %d x %d \n", rank, dims[0], dims[1]);
/*
@@ -73,7 +73,7 @@ printf("chunk rank %d, dimensions %d x %d \n", rank_chunk,
/*
* Define the memory space to read dataset.
*/
-memspace = H5Pcreate_simple(RANK,dims,NULL);
+memspace = H5Screate_simple(RANK,dims,NULL);
/*
* Read dataset back and display.
@@ -110,7 +110,7 @@ for (j = 0; j < dims[0]; j++) {
* and read it into column array.
*/
col_dims[0] = 10;
-memspace = H5Pcreate_simple(RANKC, col_dims, NULL);
+memspace = H5Screate_simple(RANKC, col_dims, NULL);
/*
* Define the column (hyperslab) to read.
@@ -119,7 +119,7 @@ offset[0] = 0;
offset[1] = 2;
count[0] = 10;
count[1] = 1;
-status = H5Pset_hyperslab(filespace, offset, count, NULL);
+status = H5Sset_hyperslab(filespace, offset, count, NULL);
status = H5Dread(dataset, H5T_NATIVE_INT, memspace, filespace,
H5C_DEFAULT, column);
printf("\n");
@@ -146,7 +146,7 @@ for (i = 0; i < 10; i++) {
/*
* Define the memory space to read a chunk.
*/
-memspace = H5Pcreate_simple(rank_chunk,chunk_dims,NULL);
+memspace = H5Screate_simple(rank_chunk,chunk_dims,NULL);
/*
* Define chunk in the file (hyperslab) to read.
@@ -155,7 +155,7 @@ offset[0] = 2;
offset[1] = 0;
count[0] = chunk_dims[0];
count[1] = chunk_dims[1];
-status = H5Pset_hyperslab(filespace, offset, count, NULL);
+status = H5Sset_hyperslab(filespace, offset, count, NULL);
/*
* Read chunk back and display.
@@ -179,8 +179,8 @@ for (j = 0; j < chunk_dims[0]; j++) {
*/
H5Cclose(cparms);
H5Dclose(dataset);
-H5Pclose(filespace);
-H5Pclose(memspace);
+H5Sclose(filespace);
+H5Sclose(memspace);
H5Fclose(file);
}
diff --git a/examples/h5_compound.c b/examples/h5_compound.c
index 05add7d..91061cf 100644
--- a/examples/h5_compound.c
+++ b/examples/h5_compound.c
@@ -57,7 +57,7 @@ size_t size;
/*
* Create the data space.
*/
-space = H5Pcreate_simple(RANK, dim, NULL);
+space = H5Screate_simple(RANK, dim, NULL);
/*
* Create the file.
@@ -80,13 +80,13 @@ dataset = H5Dcreate(file, DATASETNAME, s1_tid, space, H5C_DEFAULT);
/*
* Wtite data to the dataset;
*/
-status = H5Dwrite(dataset, s1_tid, H5P_ALL, H5P_ALL, H5C_DEFAULT, s1);
+status = H5Dwrite(dataset, s1_tid, H5S_ALL, H5S_ALL, H5C_DEFAULT, s1);
/*
* Release resources
*/
H5Tclose(s1_tid);
-H5Pclose(space);
+H5Sclose(space);
H5Dclose(dataset);
H5Fclose(file);
@@ -109,7 +109,7 @@ status = H5Tinsert(s2_tid, "a_name", HPOFFSET(s2, a), H5T_NATIVE_INT);
* Read two fields c and a from s1 dataset. Fields iin the file
* are found by their names "c_name" and "a_name".
*/
-status = H5Dread(dataset, s2_tid, H5P_ALL, H5P_ALL, H5C_DEFAULT, s2);
+status = H5Dread(dataset, s2_tid, H5S_ALL, H5S_ALL, H5C_DEFAULT, s2);
/*
* Display the fields
@@ -134,7 +134,7 @@ status = H5Tinsert(s3_tid, "b_name", 0, H5T_NATIVE_FLOAT);
/*
* Read field b from s1 dataset. Field in the file is found by its name.
*/
-status = H5Dread(dataset, s3_tid, H5P_ALL, H5P_ALL, H5C_DEFAULT, s3);
+status = H5Dread(dataset, s3_tid, H5S_ALL, H5S_ALL, H5C_DEFAULT, s3);
/*
* Display the field
@@ -150,6 +150,6 @@ printf("\n");
H5Tclose(s2_tid);
H5Tclose(s3_tid);
H5Dclose(dataset);
-H5Pclose(space);
+H5Sclose(space);
H5Fclose(file);
}
diff --git a/examples/h5_extend_write.c b/examples/h5_extend_write.c
index 69e18ad..1d0438b 100644
--- a/examples/h5_extend_write.c
+++ b/examples/h5_extend_write.c
@@ -25,7 +25,7 @@ main ()
size_t dims2[2] = { 7, 1}; /* data2 dimensions */
size_t dims3[2] = { 2, 2}; /* data3 dimensions */
- size_t maxdims[2] = {H5P_UNLIMITED, H5P_UNLIMITED};
+ size_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED};
size_t chunk_dims[2] ={2, 5};
size_t size[2];
int offset[2];
@@ -44,7 +44,7 @@ main ()
/*
* Create the data space with ulimited dimensions.
*/
-dataspace = H5Pcreate_simple(RANK, dims, maxdims);
+dataspace = H5Screate_simple(RANK, dims, maxdims);
/*
* Create a new file. If file exists its contents will be overwritten.
@@ -77,7 +77,7 @@ status = H5Dextend (dataset, size);
filespace = H5Dget_space (dataset);
offset[0] = 0;
offset[1] = 0;
-status = H5Pset_hyperslab(filespace, offset, dims1, NULL);
+status = H5Sset_hyperslab(filespace, offset, dims1, NULL);
/*
* Write the data to the hyperslab.
@@ -99,12 +99,12 @@ status = H5Dextend (dataset, size);
filespace = H5Dget_space (dataset);
offset[0] = 3;
offset[1] = 0;
-status = H5Pset_hyperslab(filespace, offset, dims2, NULL);
+status = H5Sset_hyperslab(filespace, offset, dims2, NULL);
/*
* Define memory space
*/
-dataspace = H5Pcreate_simple(RANK, dims2, NULL);
+dataspace = H5Screate_simple(RANK, dims2, NULL);
/*
* Write the data to the hyperslab.
@@ -126,12 +126,12 @@ status = H5Dextend (dataset, size);
filespace = H5Dget_space (dataset);
offset[0] = 0;
offset[1] = 3;
-status = H5Pset_hyperslab(filespace, offset, dims3, NULL);
+status = H5Sset_hyperslab(filespace, offset, dims3, NULL);
/*
* Define memory space.
*/
-dataspace = H5Pcreate_simple(RANK, dims3, NULL);
+dataspace = H5Screate_simple(RANK, dims3, NULL);
/*
* Write the data to the hyperslab.
@@ -157,8 +157,8 @@ status = H5Dwrite(dataset, H5T_NATIVE_INT, dataspace, filespace,
* Close/release resources.
*/
H5Dclose(dataset);
-H5Pclose(dataspace);
-H5Pclose(filespace);
+H5Sclose(dataspace);
+H5Sclose(filespace);
H5Fclose(file);
}
diff --git a/examples/h5_group.c b/examples/h5_group.c
index 0ff7945..303ce99 100644
--- a/examples/h5_group.c
+++ b/examples/h5_group.c
@@ -38,7 +38,7 @@ status = H5Gclose(dir);
* Create dataspace for the character string
*/
size[0] = 80;
-dataspace = H5Pcreate_simple(1, size, NULL);
+dataspace = H5Screate_simple(1, size, NULL);
/*
* Create dataset "String" in the root group.
@@ -58,7 +58,7 @@ H5Dclose(dataset);
*/
dataset = H5Dcreate(file, "/FloatData/String", H5T_NATIVE_CHAR, dataspace,
H5C_DEFAULT);
-H5Pclose(dataspace);
+H5Sclose(dataspace);
H5Dclose(dataset);
/*
@@ -66,10 +66,10 @@ H5Dclose(dataset);
*/
dims[0] = 2;
dims[1] = 3;
-dataspace = H5Pcreate_simple(RANK, dims, NULL);
+dataspace = H5Screate_simple(RANK, dims, NULL);
dataset = H5Dcreate(file, "/IntData/IntArray", H5T_NATIVE_INT, dataspace,
H5C_DEFAULT);
-H5Pclose(dataspace);
+H5Sclose(dataspace);
H5Dclose(dataset);
/*
@@ -92,17 +92,17 @@ status = H5Gset (file, "/FloatData");
dims[0] = 5;
dims[1] = 10;
-dataspace = H5Pcreate_simple(RANK, dims, NULL);
+dataspace = H5Screate_simple(RANK, dims, NULL);
dataset = H5Dcreate(file, "FloatArray", H5T_NATIVE_FLOAT, dataspace, H5C_DEFAULT);
-H5Pclose(dataspace);
+H5Sclose(dataspace);
H5Dclose(dataset);
dims[0] = 4;
dims[1] = 6;
-dataspace = H5Pcreate_simple(RANK, dims, NULL);
+dataspace = H5Screate_simple(RANK, dims, NULL);
dataset = H5Dcreate(file, "DoubleArray", H5T_NATIVE_DOUBLE, dataspace,
H5C_DEFAULT);
-H5Pclose(dataspace);
+H5Sclose(dataspace);
H5Dclose(dataset);
/*
diff --git a/examples/h5_read.c b/examples/h5_read.c
index a7813c0..d95dbe2 100644
--- a/examples/h5_read.c
+++ b/examples/h5_read.c
@@ -66,8 +66,8 @@ size = H5Tget_size(datatype);
printf(" Data size is %d \n", size);
dataspace = H5Dget_space(dataset); /* dataspace handle */
-rank = H5Pget_ndims(dataspace);
-status_n = H5Pget_dims(dataspace, dims_out);
+rank = H5Sget_ndims(dataspace);
+status_n = H5Sget_dims(dataspace, dims_out);
printf("rank %d, dimensions %d x %d \n", rank, dims_out[0], dims_out[1]);
/*
@@ -77,7 +77,7 @@ offset[0] = 1;
offset[1] = 2;
count[0] = NX_SUB;
count[1] = NY_SUB;
-status = H5Pset_hyperslab(dataspace, offset, count, NULL);
+status = H5Sset_hyperslab(dataspace, offset, count, NULL);
/*
* Define the memory dataspace.
@@ -85,7 +85,7 @@ status = H5Pset_hyperslab(dataspace, offset, count, NULL);
dimsm[0] = NX;
dimsm[1] = NY;
dimsm[2] = NZ ;
-memspace = H5Pcreate_simple(RANK_OUT,dimsm,NULL);
+memspace = H5Screate_simple(RANK_OUT,dimsm,NULL);
/*
* Define memory hyperslab.
@@ -96,7 +96,7 @@ offset_out[2] = 0;
count_out[0] = NX_SUB;
count_out[1] = NY_SUB;
count_out[2] = 1;
-status = H5Pset_hyperslab(memspace, offset_out, count_out, NULL);
+status = H5Sset_hyperslab(memspace, offset_out, count_out, NULL);
/*
* Read data from hyperslab in the file into the hyperslab in
@@ -121,8 +121,8 @@ for (j = 0; j < NX; j++) {
*/
H5Tclose(datatype);
H5Dclose(dataset);
-H5Pclose(dataspace);
-H5Pclose(memspace);
+H5Sclose(dataspace);
+H5Sclose(memspace);
H5Fclose(file);
}
diff --git a/examples/h5_write.c b/examples/h5_write.c
index 5d631d3..088810d 100644
--- a/examples/h5_write.c
+++ b/examples/h5_write.c
@@ -47,7 +47,7 @@ file = H5Fcreate(FILE, H5F_ACC_TRUNC, H5C_DEFAULT, H5C_DEFAULT);
*/
dimsf[0] = NX;
dimsf[1] = NY;
-dataspace = H5Pcreate_simple(RANK, dimsf, NULL);
+dataspace = H5Screate_simple(RANK, dimsf, NULL);
/*
* Define datatype for the data in the file.
@@ -65,13 +65,13 @@ dataset = H5Dcreate(file, DATASETNAME, datatype, dataspace,
/*
* Write the data to the dataset using default transfer properties.
*/
-status = H5Dwrite(dataset, H5T_NATIVE_INT32, H5P_ALL, H5P_ALL,
+status = H5Dwrite(dataset, H5T_NATIVE_INT32, H5S_ALL, H5S_ALL,
H5C_DEFAULT, data);
/*
* Close/release resources.
*/
-H5Pclose(dataspace);
+H5Sclose(dataspace);
H5Tclose(datatype);
H5Dclose(dataset);
H5Fclose(file);