summaryrefslogtreecommitdiffstats
path: root/tools/h5findshd.c
diff options
context:
space:
mode:
authorPatrick Lu <ptlu@hawkwind.ncsa.uiuc.edu>1999-11-03 16:46:09 (GMT)
committerPatrick Lu <ptlu@hawkwind.ncsa.uiuc.edu>1999-11-03 16:46:09 (GMT)
commitc13e76ffeec1a574697d44c40953a36bdb72eddf (patch)
treea12743fc796c44efaa2a6db004885930972e1af2 /tools/h5findshd.c
parentcc81ff713a85a439b6819e5b4f6ff21d2a2c079c (diff)
downloadhdf5-c13e76ffeec1a574697d44c40953a36bdb72eddf.zip
hdf5-c13e76ffeec1a574697d44c40953a36bdb72eddf.tar.gz
hdf5-c13e76ffeec1a574697d44c40953a36bdb72eddf.tar.bz2
[svn-r1813] moved the globals out of the tools lib(h5findshd.c) into the h5toh4 tool.
had to change some of the functions in the h5findshd.c file since we didn't have the globals anymore. these changes also affected the h5toh5.c file. passes all tests on unix
Diffstat (limited to 'tools/h5findshd.c')
-rw-r--r--tools/h5findshd.c66
1 files changed, 43 insertions, 23 deletions
diff --git a/tools/h5findshd.c b/tools/h5findshd.c
index 4361886..aceead9 100644
--- a/tools/h5findshd.c
+++ b/tools/h5findshd.c
@@ -3,22 +3,20 @@
#include <H5private.h>
#include <h5tools.h>
-int prefix_len = 1024;
-char *prefix;
-table_t group_table, dset_table, type_table;
+
typedef herr_t (*H5G_operator_t)(hid_t, const char*, void*);
-extern void init_prefix(char **temp);
+extern void init_prefix(char **temp, int length);
extern void init_table(table_t **table);
extern void free_table(table_t **table);
extern void dump_table(char *name, table_t* table);
extern herr_t find_objs(hid_t group, const char *name, void *op_data);
extern int search_obj (table_t *temp, unsigned long *);
-extern int get_table_idx(int, unsigned long *);
-extern int get_tableflag(int, int);
-extern int set_tableflag(int, int);
-extern char* get_objectname(int, int);
+extern int get_table_idx(table_t *table, unsigned long *);
+extern int get_tableflag(table_t*, int);
+extern int set_tableflag(table_t*, int);
+extern char* get_objectname(table_t*, int);
/*-------------------------------------------------------------------------
@@ -66,7 +64,7 @@ void init_table (table_t** temp){
* Modifications:
*
*-----------------------------------------------------------------------*/
-void init_prefix(char **prefix){
+void init_prefix(char **prefix, int prefix_len){
char *temp;
temp = (char *) malloc(prefix_len * sizeof (char));
*temp = '\0';
@@ -310,10 +308,10 @@ int i;
*
*-----------------------------------------------------------------------*/
int
-get_table_idx(int type, unsigned long *objno)
+get_table_idx(table_t *table, unsigned long *objno)
{
-int idx;
-
+int idx = -1;
+/*
switch (type) {
case H5G_GROUP:
@@ -336,7 +334,8 @@ int idx;
idx = -1;
}
-
+*/
+ idx = search_obj(table, objno);
return idx;
}
@@ -355,9 +354,9 @@ int idx;
*
*-----------------------------------------------------------------------*/
int
-get_tableflag(int type, int idx)
+get_tableflag(table_t *table, int idx)
{
-
+ /*
switch (type) {
case H5G_GROUP:
@@ -375,8 +374,10 @@ get_tableflag(int type, int idx)
default:
return -1;
-
- }
+}
+ */
+ return(table->objs[idx].objflag);
+
}
/*-------------------------------------------------------------------------
@@ -394,9 +395,9 @@ get_tableflag(int type, int idx)
*
*-----------------------------------------------------------------------*/
int
-set_tableflag(int type, int idx)
+set_tableflag(table_t *table, int idx)
{
-
+/*
switch (type) {
case H5G_GROUP:
@@ -417,8 +418,11 @@ set_tableflag(int type, int idx)
default:
return FAIL;
-
- }
+}
+*/
+ table->objs[idx].objflag = TRUE;
+ return(SUCCEED);
+
}
/*-------------------------------------------------------------------------
@@ -434,9 +438,9 @@ set_tableflag(int type, int idx)
*
*-----------------------------------------------------------------------*/
char *
-get_objectname(int type, int idx)
+get_objectname(table_t* table, int idx)
{
-
+ /*
switch (type) {
case H5G_GROUP:
@@ -456,5 +460,21 @@ get_objectname(int type, int idx)
return NULL;
}
+ */
+ return(strdup(table->objs[idx].objname));
}
+
+
+
+
+
+
+
+
+
+
+
+
+
+