summaryrefslogtreecommitdiffstats
path: root/hl/examples/ptExampleFL.c
diff options
context:
space:
mode:
Diffstat (limited to 'hl/examples/ptExampleFL.c')
-rw-r--r--hl/examples/ptExampleFL.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/hl/examples/ptExampleFL.c b/hl/examples/ptExampleFL.c
index 1596f7a..e3eba74 100644
--- a/hl/examples/ptExampleFL.c
+++ b/hl/examples/ptExampleFL.c
@@ -37,6 +37,8 @@ int main(void)
/* Buffers to hold data */
int writeBuffer[5];
int readBuffer[5];
+ hsize_t nrecords;
+ hsize_t chunk_size=1;
/* Initialize buffers */
for(x=0; x<5; x++)
@@ -50,17 +52,21 @@ int main(void)
/* Create a fixed-length packet table within the file */
/* This table's "packets" will be simple integers. */
- ptable = H5PTcreate_fl(fid, "Packet Test Dataset", H5T_NATIVE_INT, 1);
+ ptable = H5PTcreate_fl(fid, "Packet Test Dataset", H5T_NATIVE_INT, chunk_size);
if(ptable == H5I_INVALID_HID)
goto out;
+ nrecords=1;
+
/* Write one packet to the packet table */
- err = H5PTappend(ptable, 1, &(writeBuffer[0]) );
+ err = H5PTappend(ptable, nrecords, &(writeBuffer[0]) );
if(err < 0)
goto out;
+ nrecords=4;
+
/* Write several packets to the packet table */
- err = H5PTappend(ptable, 4, &(writeBuffer[1]) );
+ err = H5PTappend(ptable, nrecords, &(writeBuffer[1]) );
if(err < 0)
goto out;
@@ -76,10 +82,11 @@ int main(void)
if(err < 0)
goto out;
+ nrecords=1;
/* Iterate through packets, read each one back */
for(x=0; x<5; x++)
{
- err = H5PTget_next(ptable, 1, &(readBuffer[x]) );
+ err = H5PTget_next(ptable, nrecords, &(readBuffer[x]) );
if(err < 0)
goto out;