summaryrefslogtreecommitdiffstats
path: root/tools/h5dump.c
diff options
context:
space:
mode:
authorPatrick Lu <ptlu@hawkwind.ncsa.uiuc.edu>1999-11-02 17:11:37 (GMT)
committerPatrick Lu <ptlu@hawkwind.ncsa.uiuc.edu>1999-11-02 17:11:37 (GMT)
commitcf316348843f202a0c3b192241ba9deec5896b91 (patch)
tree7f7ba37ad66ebfd4dcf9a6cf79ec73dd3c46db61 /tools/h5dump.c
parent08482c22b788493509941665b1bf5f46d5d0e29e (diff)
downloadhdf5-cf316348843f202a0c3b192241ba9deec5896b91.zip
hdf5-cf316348843f202a0c3b192241ba9deec5896b91.tar.gz
hdf5-cf316348843f202a0c3b192241ba9deec5896b91.tar.bz2
[svn-r1805] more changes. I found some duplicate functions in the library and the dumper.
so i moved the dumper stuff out to the libary. Had to change some functions in h5findshd so they would stop using globals that shouldn't be defined in the lib. I will remove the globals next. also the h5findshd.c has an extra member to the struct for that objects in the table so i added that into the appropriate place. the dumper is working ok now but the h5toh4 is still broken.
Diffstat (limited to 'tools/h5dump.c')
-rw-r--r--tools/h5dump.c57
1 files changed, 4 insertions, 53 deletions
diff --git a/tools/h5dump.c b/tools/h5dump.c
index bac225c..c38a87c 100644
--- a/tools/h5dump.c
+++ b/tools/h5dump.c
@@ -974,57 +974,6 @@ hid_t type, space;
}
-/*-------------------------------------------------------------------------
- * Function: init_table
- *
- * Purpose: allocate and initialize tables for shared groups, datasets,
- * and committed types
- *
- * Return: void
- *
- * Programmer: Ruey-Hsia Li
- *
- * Modifications:
- *
- *-----------------------------------------------------------------------*/
-static void
-init_table (void){
-int i;
-
- group_table = malloc(sizeof(table_t));
- type_table = malloc(sizeof(table_t));
- dset_table = malloc(sizeof(table_t));
-
- group_table->size = dset_table->size = type_table->size = 20;
- group_table->nobjs = dset_table->nobjs = type_table->nobjs = 0;
-
- group_table->objs = (obj_t*) malloc(group_table->size*sizeof(obj_t));
- dset_table->objs = (obj_t*) malloc(dset_table->size*sizeof(obj_t));
- type_table->objs = (obj_t*) malloc(type_table->size*sizeof(obj_t));
-
- for (i = 0; i < group_table->size; i++) {
- group_table->objs[i].objno[0] = group_table->objs[i].objno[1] = 0;
- group_table->objs[i].displayed = 0;
- group_table->objs[i].recorded = 0;
- }
-
- for (i = 0; i < dset_table->size; i++) {
- dset_table->objs[i].objno[0] = dset_table->objs[i].objno[1] = 0;
- dset_table->objs[i].displayed = 0;
- dset_table->objs[i].recorded = 0;
- }
-
- for (i = 0; i < type_table->size; i++) {
- type_table->objs[i].objno[0] = type_table->objs[i].objno[1] = 0;
- type_table->objs[i].displayed = 0;
- type_table->objs[i].recorded = 0;
- }
-
- prefix = (char *) malloc(prefix_len * sizeof (char));
- *prefix = '\0';
-}
-
-
#if H5DUMP_DEBUG
/*-------------------------------------------------------------------------
@@ -1244,8 +1193,10 @@ main(int argc, char *argv[])
}
/* allocate and initialize internal data structure */
- init_table();
-
+ init_table(&group_table);
+ init_table(&type_table);
+ init_table(&dset_table);
+ init_prefix(&prefix);
/*init the find_objs_t*/
info->threshold = 0;