diff options
author | Robb Matzke <matzke@llnl.gov> | 1997-12-11 21:35:46 (GMT) |
---|---|---|
committer | Robb Matzke <matzke@llnl.gov> | 1997-12-11 21:35:46 (GMT) |
commit | faca6fbaa8c557b18d6b264841fc8717d1e73816 (patch) | |
tree | 2123e6290a24e6ad94c776e45283800cc6917f92 /src/H5Gstab.c | |
parent | 3c16901751f40fcbbf36878fe13b0237a3753bc9 (diff) | |
download | hdf5-faca6fbaa8c557b18d6b264841fc8717d1e73816.zip hdf5-faca6fbaa8c557b18d6b264841fc8717d1e73816.tar.gz hdf5-faca6fbaa8c557b18d6b264841fc8717d1e73816.tar.bz2 |
[svn-r145] ./src/H5Osdtyp.c -> H5Odtype.c
./src/H5Osdim.c -> H5Osdspace.c
./src/Makefile.in
Changed the names of these files to better reflect what they
actually do.
./src/H5.c
./src/H5AC.c
./src/H5B.c
./src/H5C.c
./src/H5D.c
./src/H5E.c
./src/H5Eprivate.h
./src/H5Epublic.h
./src/H5F.c
./src/H5Fcore.c
./src/H5Ffamily.c
./src/H5Fistore.c
./src/H5Flow.c
./src/H5Fsec2.c
./src/H5Fsplit.c
./src/H5Fstdio.c
./src/H5G.c
./src/H5Gent.c
./src/H5Gnode.c
./src/H5Gshad.c
./src/H5Gstab.c
./src/H5H.c
./src/H5M.c
./src/H5MF.c
./src/H5O.c
./src/H5Osdtyp.c (./src/H5Odtype.c)
./src/H5P.c
./src/H5T.c
./src/H5detect.c
./src/H5private.h
Added an argument to the HRETURN_ERROR(), HGOTO_ERROR(), and
HERROR() macros which is a string error message. This allows
us to give extra information which can't be represented by the
major and minor error numbers. This information was
previously in comments just before or after the macro call.
The string isn't currently used, but I'm planning to change
the test files so they print an error trace when something
fails. This should make debugging a little faster since it's
often obvious what's wrong if we could just see the error
stack without even having to start a debugger.
Diffstat (limited to 'src/H5Gstab.c')
-rw-r--r-- | src/H5Gstab.c | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/src/H5Gstab.c b/src/H5Gstab.c index 30bca74..a607e5e 100644 --- a/src/H5Gstab.c +++ b/src/H5Gstab.c @@ -72,22 +72,23 @@ H5G_stab_create (H5F_t *f, H5G_entry_t *self, size_t init) /* Create symbol table private heap */ if (H5H_create (f, H5H_LOCAL, init, &(stab.heap_addr)/*out*/)<0) { - HRETURN_ERROR (H5E_SYM, H5E_CANTINIT, FAIL); /*can't create heap*/ + HRETURN_ERROR (H5E_SYM, H5E_CANTINIT, FAIL, "can't create heap"); } if ((name = H5H_insert (f, &(stab.heap_addr), 1, "")<0)) { - HRETURN_ERROR (H5E_SYM, H5E_CANTINIT, FAIL); /*can't initialize heap*/ + HRETURN_ERROR (H5E_SYM, H5E_CANTINIT, FAIL, "can't initialize heap"); } if (0!=name) { /* * B-tree's won't work if the first name isn't at the beginning * of the heap. */ - HRETURN_ERROR (H5E_INTERNAL, H5E_CANTINIT, FAIL); + HRETURN_ERROR (H5E_INTERNAL, H5E_CANTINIT, FAIL, + "internal error (heap doesn't begin at zero)"); } /* Create the B-tree */ if (H5B_create (f, H5B_SNODE, NULL, &(stab.btree_addr)/*out*/)<0) { - HRETURN_ERROR (H5E_SYM, H5E_CANTINIT, FAIL); /*can't create B-tree*/ + HRETURN_ERROR (H5E_SYM, H5E_CANTINIT, FAIL, "can't create B-tree"); } /* @@ -96,14 +97,14 @@ H5G_stab_create (H5F_t *f, H5G_entry_t *self, size_t init) * incremented if the object is added to the group directed graph. */ if (H5O_create (f, 0, 4+2*H5F_SIZEOF_ADDR(f), &addr/*out*/)<0) { - HRETURN_ERROR (H5E_SYM, H5E_CANTINIT, FAIL); /*can't create header*/ + HRETURN_ERROR (H5E_SYM, H5E_CANTINIT, FAIL, "can't create header"); } /* insert the symbol table message */ memset (self, 0, sizeof(H5G_entry_t)); self->header = addr; if (H5O_modify(f, NO_ADDR, self, H5O_STAB, H5O_NEW_MESG, &stab)<0) { - HRETURN_ERROR (H5E_SYM, H5E_CANTINIT, FAIL); /*can't create message*/ + HRETURN_ERROR (H5E_SYM, H5E_CANTINIT, FAIL, "can't create message"); } FUNC_LEAVE (SUCCEED); @@ -153,16 +154,16 @@ H5G_stab_find (H5F_t *f, const haddr_t *addr, H5G_entry_t *self, assert (f); assert (!addr || H5F_addr_defined (addr)); if (!addr && (!self || !H5F_addr_defined (&(self->header)))) { - HRETURN_ERROR (H5E_SYM, H5E_NOTFOUND, NULL); + HRETURN_ERROR (H5E_SYM, H5E_NOTFOUND, NULL, "bad address"); } if (!name || !*name) { - HRETURN_ERROR (H5E_SYM, H5E_NOTFOUND, NULL); + HRETURN_ERROR (H5E_SYM, H5E_NOTFOUND, NULL, "no name"); } if (!addr) addr = &(self->header); /* set up the udata */ if (NULL==H5O_read (f, addr, self, H5O_STAB, 0, &stab)) { - HRETURN_ERROR (H5E_SYM, H5E_BADMESG, NULL); /*can't read message*/ + HRETURN_ERROR (H5E_SYM, H5E_BADMESG, NULL, "can't read message"); } udata.operation = H5G_OPER_FIND; udata.name = name; @@ -175,14 +176,15 @@ H5G_stab_find (H5F_t *f, const haddr_t *addr, H5G_entry_t *self, if (udata.node_ptr) { H5AC_unprotect (f, H5AC_SNODE, &(udata.node_addr), udata.node_ptr); } - HRETURN_ERROR (H5E_SYM, H5E_NOTFOUND, NULL); /*not found*/ + HRETURN_ERROR (H5E_SYM, H5E_NOTFOUND, NULL, "not found"); } /* Unprotect the symbol table node */ if (udata.node_ptr) { if (H5AC_unprotect (f, H5AC_SNODE, &(udata.node_addr), udata.node_ptr)<0) { - HRETURN_ERROR (H5E_SYM, H5E_PROTECT, NULL); + HRETURN_ERROR (H5E_SYM, H5E_PROTECT, NULL, + "unable to release symbol table node"); } } @@ -238,7 +240,7 @@ H5G_stab_insert (H5F_t *f, H5G_entry_t *self, const char *name, /* initialize data to pass through B-tree */ if (NULL==H5O_read (f, &(self->header), self, H5O_STAB, 0, &stab)) { - HRETURN_ERROR (H5E_SYM, H5E_BADMESG, NULL); /*can't read message*/ + HRETURN_ERROR (H5E_SYM, H5E_BADMESG, NULL, "can't read message"); } udata.operation = H5G_OPER_INSERT; @@ -254,7 +256,7 @@ H5G_stab_insert (H5F_t *f, H5G_entry_t *self, const char *name, if (udata.node_ptr) { H5AC_unprotect (f, H5AC_SNODE, &(udata.node_addr), udata.node_ptr); } - HRETURN_ERROR (H5E_SYM, H5E_CANTINSERT, NULL); /*can't insert entry*/ + HRETURN_ERROR (H5E_SYM, H5E_CANTINSERT, NULL, "can't insert entry"); } /* @@ -264,7 +266,7 @@ H5G_stab_insert (H5F_t *f, H5G_entry_t *self, const char *name, * until the next call to H5AC. */ if (H5AC_unprotect (f, H5AC_SNODE, &(udata.node_addr), udata.node_ptr)<0) { - HRETURN_ERROR (H5E_SYM, H5E_PROTECT, NULL); /*can't unprotect*/ + HRETURN_ERROR (H5E_SYM, H5E_PROTECT, NULL, "can't unprotect"); } /* update the name offset in the entry */ @@ -321,7 +323,7 @@ H5G_stab_list (H5F_t *f, H5G_entry_t *self, intn maxentries, /* initialize data to pass through B-tree */ if (NULL==H5O_read (f, &(self->header), self, H5O_STAB, 0, &stab)) { - HRETURN_ERROR (H5E_SYM, H5E_BADMESG, FAIL); /*not a symbol table*/ + HRETURN_ERROR (H5E_SYM, H5E_BADMESG, FAIL, "not a symbol table"); } udata.entry = entries; udata.name = names; @@ -336,7 +338,7 @@ H5G_stab_list (H5F_t *f, H5G_entry_t *self, intn maxentries, if (names) { for (i=0; i<maxentries; i++) H5MM_xfree (names[i]); } - HRETURN_ERROR (H5E_SYM, H5E_CANTLIST, FAIL); /*B-tree list failure*/ + HRETURN_ERROR (H5E_SYM, H5E_CANTLIST, FAIL, "b-tree list failure"); } FUNC_LEAVE (udata.nsyms); |