summaryrefslogtreecommitdiffstats
path: root/hl/src/H5TB.c
diff options
context:
space:
mode:
authorJames Laird <jlaird@hdfgroup.org>2005-03-18 17:19:36 (GMT)
committerJames Laird <jlaird@hdfgroup.org>2005-03-18 17:19:36 (GMT)
commit349ca8daa9a1d0f094d716ea603d7d41ac14b862 (patch)
treed5180e62e013724f1c8972c018963bfe4da74e17 /hl/src/H5TB.c
parentf7ee415cdb4e6000636a55ff017c516d65ed64c1 (diff)
downloadhdf5-349ca8daa9a1d0f094d716ea603d7d41ac14b862.zip
hdf5-349ca8daa9a1d0f094d716ea603d7d41ac14b862.tar.gz
hdf5-349ca8daa9a1d0f094d716ea603d7d41ac14b862.tar.bz2
[svn-r10234] Purpose:
Added Packet Table to high-level APIs Description: The Packet Table is an API that allows the user to append records ("packets") to a table, and read the back again. It supports fixed-length records with a defined datatype and variable-length records. It also supports a "current record" index to track the user's position in the table. Solution: The Packet Table code lives in hl/src, and its tests in hl/test. Some code is shared between the H5TB table and the H5PT Packet Table in the form of functions in H5HL_private.c. Some documentation exists for a previous version of the API. Updated documentation and C++ wrapper API coming soon. Platforms tested: sleipnir, eirene, copper, modi4
Diffstat (limited to 'hl/src/H5TB.c')
-rw-r--r--hl/src/H5TB.c43
1 files changed, 8 insertions, 35 deletions
diff --git a/hl/src/H5TB.c b/hl/src/H5TB.c
index 6b58c0f..84f626e 100644
--- a/hl/src/H5TB.c
+++ b/hl/src/H5TB.c
@@ -11,6 +11,7 @@
****************************************************************************/
#include "H5TB.h"
+#include "H5HL_private.h"
#include <stdlib.h>
#include <string.h>
@@ -328,42 +329,10 @@ herr_t H5TBappend_records( hid_t loc_id,
if ((mem_type_id=H5TB_create_type(loc_id,dset_name,dst_size,dst_offset,dst_sizes,tid))<0)
goto out;
- /* Extend the dataset */
- dims[0] = nrecords_orig;
- dims[0] += nrecords;
-
- if ( H5Dextend ( did, dims ) < 0 )
- goto out;
-
- /* Create a simple memory data space */
- mem_dims[0]=nrecords;
- if ( (mem_space_id = H5Screate_simple( 1, mem_dims, NULL )) < 0 )
- return -1;
-
- /* Get the file data space */
- if ( (sid = H5Dget_space( did )) < 0 )
- return -1;
-
- /* Get the dimensions */
- if ( H5Sget_simple_extent_dims( sid, dims, NULL ) != 1 )
- goto out;
-
- /* Define a hyperslab in the dataset */
- offset[0] = nrecords_orig;
- count[0] = nrecords;
- if ( H5Sselect_hyperslab( sid, H5S_SELECT_SET, offset, NULL, count, NULL) < 0 )
- goto out;
-
- if ( H5Dwrite( did, mem_type_id, mem_space_id, sid, H5P_DEFAULT, data ) < 0 )
- goto out;
-
- /* Terminate access to the dataspace */
- if ( H5Sclose( mem_space_id ) < 0 )
- goto out;
+ /* Append the records */
+ if ((H5TBcommon_append_records(did, mem_type_id, nrecords, nrecords_orig, data))<0)
+ goto out;
- if ( H5Sclose( sid ) < 0 )
- goto out;
-
/* Release the datatype. */
if ( H5Tclose( tid ) < 0 )
return -1;
@@ -975,6 +944,10 @@ herr_t H5TBread_records( hid_t loc_id,
if ((mem_type_id=H5TB_create_type(loc_id,dset_name,dst_size,dst_offset,dst_sizes,ftype_id))<0)
goto out;
+ /* Read the records */
+ if ((H5TBcommon_read_records(did, mem_type_id, start, nrecords, nrecords_orig, data)) < 0)
+ goto out;
+
/* get the dataspace handle */
if ( (sid = H5Dget_space( did )) < 0 )
goto out;