summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5tools_utils.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-08-08 19:39:10 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-08-08 19:39:10 (GMT)
commit637fe3d65b95e8f73a1c66291333a5171566790c (patch)
tree1bf94fa1afaa81cc0ee19b9e1450cca0c362e006 /tools/lib/h5tools_utils.c
parent4032cbf36056c98e44b6b32d9f531087af50c881 (diff)
downloadhdf5-637fe3d65b95e8f73a1c66291333a5171566790c.zip
hdf5-637fe3d65b95e8f73a1c66291333a5171566790c.tar.gz
hdf5-637fe3d65b95e8f73a1c66291333a5171566790c.tar.bz2
[svn-r7327] Purpose:
Refactored code Description: Chase changes of 'objno' and 'fileno' fields in H5G_stat_t structure. Platforms tested: h5committested
Diffstat (limited to 'tools/lib/h5tools_utils.c')
-rw-r--r--tools/lib/h5tools_utils.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c
index 1a9882b..1f3accc 100644
--- a/tools/lib/h5tools_utils.c
+++ b/tools/lib/h5tools_utils.c
@@ -39,7 +39,7 @@ int opt_ind = 1; /*token pointer */
const char *opt_arg; /*flag argument (or value) */
/* local functions */
-static void add_obj(table_t *table, unsigned long *objno, char *objname);
+static void add_obj(table_t *table, haddr_t objno, char *objname);
/*-------------------------------------------------------------------------
@@ -325,7 +325,7 @@ init_table(table_t **tbl)
table->objs = HDmalloc(table->size * sizeof(obj_t));
for (i = 0; i < table->size; i++) {
- table->objs[i].objno[0] = table->objs[i].objno[1] = 0;
+ table->objs[i].objno = 0;
table->objs[i].displayed = 0;
table->objs[i].recorded = 0;
table->objs[i].objflag = 0;
@@ -392,12 +392,12 @@ free_table(table_t **table)
*-------------------------------------------------------------------------
*/
int
-search_obj(table_t *table, unsigned long *objno)
+search_obj(table_t *table, haddr_t objno)
{
int i;
for (i = 0; i < table->nobjs; i++)
- if (table->objs[i].objno[0] == *objno && table->objs[i].objno[1] == *(objno + 1))
+ if (table->objs[i].objno == objno)
return i;
return FAIL;
@@ -547,9 +547,8 @@ dump_table(char* tablename, table_t *table)
printf("%s: # of entries = %d\n", tablename,table->nobjs);
for (i = 0; i < table->nobjs; i++)
- printf("\t%lu %lu %s %d\n",
- table->objs[i].objno[0],
- table->objs[i].objno[1],
+ HDfprintf(stdout,"\t%a %s %d\n",
+ table->objs[i].objno,
table->objs[i].objname,
table->objs[i].objflag);
}
@@ -569,7 +568,7 @@ dump_table(char* tablename, table_t *table)
*-------------------------------------------------------------------------
*/
int
-get_table_idx(table_t *table, unsigned long *objno)
+get_table_idx(table_t *table, haddr_t objno)
{
return search_obj(table, objno);
}
@@ -649,7 +648,7 @@ get_objectname(table_t *table, int idx)
*-------------------------------------------------------------------------
*/
static void
-add_obj(table_t *table, unsigned long *objno, char *objname)
+add_obj(table_t *table, haddr_t objno, char *objname)
{
int i;
@@ -658,7 +657,7 @@ add_obj(table_t *table, unsigned long *objno, char *objname)
table->objs = HDrealloc(table->objs, table->size * sizeof(obj_t));
for (i = table->nobjs; i < table->size; i++) {
- table->objs[i].objno[0] = table->objs[i].objno[1] = 0;
+ table->objs[i].objno = 0;
table->objs[i].displayed = 0;
table->objs[i].recorded = 0;
table->objs[i].objflag = 0;
@@ -667,8 +666,7 @@ add_obj(table_t *table, unsigned long *objno, char *objname)
}
i = table->nobjs++;
- table->objs[i].objno[0] = objno[0];
- table->objs[i].objno[1] = objno[1];
+ table->objs[i].objno = objno;
free(table->objs[i].objname);
table->objs[i].objname = HDstrdup(objname);
}