summaryrefslogtreecommitdiffstats
path: root/hl/examples/ex_table_04.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2007-02-05 21:15:57 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2007-02-05 21:15:57 (GMT)
commit51875fc8881cdfa0c939fba82b7a00012a2c611e (patch)
tree1ae643e19692541d5e53070a522cc19d1a60784a /hl/examples/ex_table_04.c
parenta82e85c2d408386b14859f40c572a3911aaaa682 (diff)
downloadhdf5-51875fc8881cdfa0c939fba82b7a00012a2c611e.zip
hdf5-51875fc8881cdfa0c939fba82b7a00012a2c611e.tar.gz
hdf5-51875fc8881cdfa0c939fba82b7a00012a2c611e.tar.bz2
[svn-r13239]
bug fix on H5TBwrite_fields_index and name functions, the space on the H5Dwrite call was all selected
Diffstat (limited to 'hl/examples/ex_table_04.c')
-rw-r--r--hl/examples/ex_table_04.c33
1 files changed, 12 insertions, 21 deletions
diff --git a/hl/examples/ex_table_04.c b/hl/examples/ex_table_04.c
index 55f4ee8..072d640 100644
--- a/hl/examples/ex_table_04.c
+++ b/hl/examples/ex_table_04.c
@@ -24,9 +24,10 @@
*-------------------------------------------------------------------------
*/
-#define NFIELDS (hsize_t) 5
-#define NRECORDS (hsize_t) 8
-#define TABLE_NAME "table"
+#define NFIELDS (hsize_t) 5
+#define NRECORDS (hsize_t) 8
+#define NRECORDS_ADD (hsize_t) 3
+#define TABLE_NAME "table"
int main( void )
{
@@ -84,27 +85,17 @@ int main( void )
herr_t status;
int i;
Particle *p_data = NULL; /* Initially no data */
- float pressure_in [NRECORDS] = /* Define new values for the field "Pressure" */
- { 0.0f,1.0f,2.0f,3.0f,4.0f,5.0f,6.0f,7.0f };
- Position position_in[NRECORDS] = { /* Define new values for "Latitude,Longitude" */
+ float pressure_in [NRECORDS_ADD] = /* Define new values for the field "Pressure" */
+ { 0.0f,1.0f,2.0f};
+ Position position_in[NRECORDS_ADD] = {/* Define new values for "Latitude,Longitude" */
{0,0},
{10,10},
- {20,20},
- {30,30},
- {40,40},
- {50,50},
- {60,60},
- {70,70} };
- NamePressure namepre_in[NRECORDS] = /* Define new values for "Name,Pressure" */
+ {20,20}};
+ NamePressure namepre_in[NRECORDS_ADD] =/* Define new values for "Name,Pressure" */
{ {"zero",0.0f},
{"one", 1.0f},
{"two", 2.0f},
- {"three", 3.0f},
- {"four", 4.0f},
- {"five", 5.0f},
- {"six", 6.0f},
- {"seven", 7.0f},
- };
+ };
size_t field_sizes_pos[2]=
{
sizeof(position_in[0].longi),
@@ -139,13 +130,13 @@ int main( void )
/* Write the pressure field starting at record 2 */
start = 2;
- nrecords = 3;
+ nrecords = NRECORDS_ADD;
status=H5TBwrite_fields_name( file_id, TABLE_NAME, "Pressure", start, nrecords,
sizeof( float ), 0, field_sizes_pre, pressure_in );
/* Write the new longitude and latitude information starting at record 2 */
start = 2;
- nrecords = 3;
+ nrecords = NRECORDS_ADD;
status=H5TBwrite_fields_name( file_id, TABLE_NAME, "Latitude,Longitude", start, nrecords,
sizeof( Position ), field_offset_pos, field_sizes_pos, position_in );