diff options
author | Robb Matzke <matzke@llnl.gov> | 1998-01-22 16:41:32 (GMT) |
---|---|---|
committer | Robb Matzke <matzke@llnl.gov> | 1998-01-22 16:41:32 (GMT) |
commit | a0ee2c57e934c5ff2269e345238a6ee019f6c294 (patch) | |
tree | 08a553617329401737ddff6af60ccd11a13cc6a3 /src | |
parent | fdfb6dfd26410b931b4452f832b5a4aedec283e0 (diff) | |
download | hdf5-a0ee2c57e934c5ff2269e345238a6ee019f6c294.zip hdf5-a0ee2c57e934c5ff2269e345238a6ee019f6c294.tar.gz hdf5-a0ee2c57e934c5ff2269e345238a6ee019f6c294.tar.bz2 |
[svn-r164] Changes since 19980122
----------------------
./src/*.h
Fixed indentation where indent(1) screwed up. This isn't by
any means the final say, but it's better than it was.
./src/H5A.c
./src/H5Aprivate.h
./src/H5Apublic.h
./src/H5C.c
./src/H5D.c
./src/H5E.c
./src/H5F.c
./src/H5G.c
./src/H5M.c
./src/H5P.c
./src/H5T.c
./src/H5Tconv.c
./src/debug.c
./test/dtypes.c
./test/istore.c
./test/theap.c
./test/tohdr.c
./test/tstab.c
Removed some atom functions from the API and made them
library-scope. Also changed some names by removing the
redundant `atom' from the name and by adding a `_' after the
`H5A'.
Diffstat (limited to 'src')
46 files changed, 1098 insertions, 1311 deletions
@@ -39,15 +39,14 @@ static char RcsId[] = "@(#)$Revision$"; H5A_release_atom_node - Releases an atom node (uses the atom free list) EXPORTED ROUTINES Atom Functions: - H5Aregister_atom - Register an object in a group and get an atom for it - H5Aatom_object - Get the object for an atom - H5Aatom_group - Get the group for an atom - H5Aremove_atom - Remove an atom from a group - H5Asearch_atom - Search a group for a particular object - H5Ais_reserved - Check whether an atom is a reserved atom in a group + H5A_register - Register an object in a group and get an atom for it + H5A_object - Get the object for an atom + H5A_group - Get the group for an atom + H5A_remove - Remove an atom from a group + H5A_search - Search a group for a particular object Atom Group Functions: - H5Ainit_group - Initialize a group to store atoms in - H5Adestroy_group - Destroy an atomic group + H5A_init_group - Initialize a group to store atoms in + H5A_destroy_group - Destroy an atomic group Atom Group Cleanup: H5Ashutdown - Terminate various static buffers. @@ -117,7 +116,7 @@ H5A_init_interface(void) /****************************************************************************** NAME - H5Ainit_group - Initialize an atomic group + H5A_init_group - Initialize an atomic group DESCRIPTION Creates a global atomic group to store atoms in. If the group has already @@ -133,7 +132,7 @@ H5A_init_interface(void) *******************************************************************************/ intn -H5Ainit_group(group_t grp, /* IN: Group to initialize */ +H5A_init_group(group_t grp, /* IN: Group to initialize */ intn hash_size, /* IN: Minimum hash table size to use for group */ uintn reserved, /* IN: Number of hash table entries to reserve */ herr_t (*free_func) (void *) /* IN: Function to call when releasing ref counted objects */ @@ -142,7 +141,7 @@ H5Ainit_group(group_t grp, /* IN: Group to initialize */ atom_group_t *grp_ptr = NULL; /* ptr to the atomic group */ intn ret_value = SUCCEED; - FUNC_ENTER(H5Ainit_group, FAIL); + FUNC_ENTER(H5A_init_group, FAIL); if ((grp <= BADGROUP || grp >= MAXGROUP) && hash_size > 0) HGOTO_DONE(FAIL); @@ -197,11 +196,11 @@ H5Ainit_group(group_t grp, /* IN: Group to initialize */ } /* end if */ /* Normal function cleanup */ FUNC_LEAVE(ret_value); -} /* end H5Ainit_group() */ +} /* end H5A_init_group() */ /****************************************************************************** NAME - H5Adestroy_group - Destroy an atomic group + H5A_destroy_group - Destroy an atomic group DESCRIPTION Destroys an atomic group which atoms are stored in. If the group still @@ -214,13 +213,13 @@ H5Ainit_group(group_t grp, /* IN: Group to initialize */ *******************************************************************************/ intn -H5Adestroy_group(group_t grp /* IN: Group to destroy */ +H5A_destroy_group(group_t grp /* IN: Group to destroy */ ) { atom_group_t *grp_ptr = NULL; /* ptr to the atomic group */ intn ret_value = SUCCEED; - FUNC_ENTER(H5Adestroy_group, FAIL); + FUNC_ENTER(H5A_destroy_group, FAIL); if (grp <= BADGROUP || grp >= MAXGROUP) HGOTO_DONE(FAIL); @@ -253,11 +252,11 @@ H5Adestroy_group(group_t grp /* IN: Group to destroy */ } /* end if */ /* Normal function cleanup */ FUNC_LEAVE(ret_value); -} /* end H5Adestroy_group() */ +} /* end H5A_destroy_group() */ /****************************************************************************** NAME - H5Aregister_atom - Register an object in a group and get an atom for it. + H5A_register - Register an object in a group and get an atom for it. DESCRIPTION Registers an object in a group and returns an atom for it. This routine @@ -272,8 +271,8 @@ H5Adestroy_group(group_t grp /* IN: Group to destroy */ *******************************************************************************/ hid_t -H5Aregister_atom(group_t grp, /* IN: Group to register the object in */ - const void *object /* IN: Object to attach to atom */ +H5A_register(group_t grp, /* IN: Group to register the object in */ + const void *object /* IN: Object to attach to atom */ ) { atom_group_t *grp_ptr = NULL; /* ptr to the atomic group */ @@ -282,7 +281,7 @@ H5Aregister_atom(group_t grp, /* IN: Group to register the object in */ uintn hash_loc; /* new item's hash table location */ hid_t ret_value = SUCCEED; - FUNC_ENTER(H5Aregister_atom, FAIL); + FUNC_ENTER(H5A_register, FAIL); if (grp <= BADGROUP || grp >= MAXGROUP) HGOTO_DONE(FAIL); @@ -349,7 +348,7 @@ H5Aregister_atom(group_t grp, /* IN: Group to register the object in */ } /* end if */ /* Normal function cleanup */ FUNC_LEAVE(ret_value); -} /* end H5Aregister_atom() */ +} /****************************************************************************** NAME @@ -387,7 +386,7 @@ H5A_inc_ref(hid_t atm) /****************************************************************************** NAME - H5Aatom_object - Returns to the object ptr for the atom + H5A_object - Returns to the object ptr for the atom DESCRIPTION Retrieves the object ptr which is associated with the atom. @@ -397,7 +396,7 @@ H5A_inc_ref(hid_t atm) *******************************************************************************/ VOIDP -H5Aatom_object(hid_t atm /* IN: Atom to retrieve object for */ +H5A_object(hid_t atm /* IN: Atom to retrieve object for */ ) { #ifdef ATOMS_ARE_CACHED @@ -406,7 +405,7 @@ H5Aatom_object(hid_t atm /* IN: Atom to retrieve object for */ atom_info_t *atm_ptr = NULL; /* ptr to the new atom */ VOIDP ret_value = NULL; - FUNC_ENTER(H5Aatom_object, NULL); + FUNC_ENTER(H5A_object, NULL); #ifdef ATOMS_ARE_CACHED /* Look for the atom in the cache first */ @@ -440,11 +439,11 @@ H5Aatom_object(hid_t atm /* IN: Atom to retrieve object for */ } /* end if */ /* Normal function cleanup */ FUNC_LEAVE(ret_value); -} /* end H5Aatom_object() */ +} /****************************************************************************** NAME - H5Aatom_group - Returns to the group for the atom + H5A_group - Returns to the group for the atom DESCRIPTION Retrieves the group which is associated with the atom. @@ -454,12 +453,12 @@ H5Aatom_object(hid_t atm /* IN: Atom to retrieve object for */ *******************************************************************************/ group_t -H5Aatom_group(hid_t atm /* IN: Atom to retrieve group for */ +H5A_group(hid_t atm /* IN: Atom to retrieve group for */ ) { group_t ret_value = BADGROUP; - FUNC_ENTER(H5Aatom_group, FAIL); + FUNC_ENTER(H5A_group, FAIL); ret_value = ATOM_TO_GROUP(atm); if (ret_value <= BADGROUP || ret_value >= MAXGROUP) @@ -471,11 +470,11 @@ H5Aatom_group(hid_t atm /* IN: Atom to retrieve group for */ } /* end if */ /* Normal function cleanup */ FUNC_LEAVE(ret_value); -} /* end H5Aatom_group() */ +} /****************************************************************************** NAME - H5Aremove_atom - Removes an atom from a group + H5A_remove - Removes an atom from a group DESCRIPTION Removes an atom from a group. @@ -485,7 +484,7 @@ H5Aatom_group(hid_t atm /* IN: Atom to retrieve group for */ *******************************************************************************/ VOIDP -H5Aremove_atom(hid_t atm /* IN: Atom to remove */ +H5A_remove(hid_t atm /* IN: Atom to remove */ ) { atom_group_t *grp_ptr = NULL; /* ptr to the atomic group */ @@ -498,7 +497,7 @@ H5Aremove_atom(hid_t atm /* IN: Atom to remove */ #endif /* ATOMS_ARE_CACHED */ VOIDP ret_value = NULL; - FUNC_ENTER(H5Aremove_atom, NULL); + FUNC_ENTER(H5A_remove, NULL); grp = ATOM_TO_GROUP(atm); if (grp <= BADGROUP || grp >= MAXGROUP) @@ -553,7 +552,7 @@ H5Aremove_atom(hid_t atm /* IN: Atom to remove */ } /* end if */ /* Normal function cleanup */ FUNC_LEAVE(ret_value); -} /* end H5Aremove_atom() */ +} /****************************************************************************** NAME @@ -590,7 +589,7 @@ H5A_dec_ref(hid_t atm) atm_ptr->count--; /* If the reference count is zero, remove the object from the group */ - if (0 == atm_ptr->count && (obj = H5Aremove_atom(atm)) != NULL) { + if (0 == atm_ptr->count && (obj = H5A_remove(atm)) != NULL) { /* call the user's 'free' function for the atom's information */ (*grp_ptr->free_func) (obj); } @@ -601,7 +600,7 @@ H5A_dec_ref(hid_t atm) /****************************************************************************** NAME - H5Asearch_atom - Search for an object in a group and get it's pointer. + H5A_search - Search for an object in a group and get it's pointer. DESCRIPTION Searchs for an object in a group and returns the pointer to it. @@ -613,10 +612,10 @@ H5A_dec_ref(hid_t atm) Returns pointer an atom's object if successful and NULL otherwise *******************************************************************************/ -VOIDP -H5Asearch_atom(group_t grp, /* IN: Group to search for the object in */ - H5Asearch_func_t func, /* IN: Ptr to the comparison function */ - const VOIDP key /* IN: pointer to key to compare against */ +void * +H5A_search(group_t grp, /* IN: Group to search for the object in */ + H5Asearch_func_t func, /* IN: Ptr to the comparison function */ + const void *key /* IN: pointer to key to compare against */ ) { atom_group_t *grp_ptr = NULL; /* ptr to the atomic group */ @@ -624,7 +623,7 @@ H5Asearch_atom(group_t grp, /* IN: Group to search for the object in */ intn i; /* local counting variable */ VOIDP ret_value = NULL; - FUNC_ENTER(H5Asearch_atom, NULL); + FUNC_ENTER(H5A_search, NULL); if (grp <= BADGROUP || grp >= MAXGROUP) HGOTO_DONE(NULL); @@ -649,51 +648,7 @@ H5Asearch_atom(group_t grp, /* IN: Group to search for the object in */ } /* end if */ /* Normal function cleanup */ FUNC_LEAVE(ret_value); -} /* end H5Asearch_atom() */ - -/****************************************************************************** - NAME - H5Ais_reserved - Check whether an atom is a reserved atom in a group - - DESCRIPTION - Determines the group an atom belongs to and checks if the atom is a - reserved atom in the group. - - RETURNS - Returns BTRUE/BFALSE/BFAIL - -*******************************************************************************/ -intn -H5Ais_reserved(hid_t atm /* IN: Group to search for the object in */ -) -{ - atom_group_t *grp_ptr = NULL; /* ptr to the atomic group */ - group_t grp; /* atom's atomic group */ - hbool_t ret_value = BFAIL; - - FUNC_ENTER(H5Ais_reserved, FAIL); - - grp = ATOM_TO_GROUP(atm); - if (grp <= BADGROUP || grp >= MAXGROUP) - HGOTO_DONE(BFAIL); - - grp_ptr = atom_group_list[grp]; - if (grp_ptr == NULL) - HGOTO_DONE(BFAIL); - - /* Get the location in which the atom is located */ - if ((atm & ATOM_MASK) < grp_ptr->reserved) - ret_value = BTRUE; - else - ret_value = BFALSE; - - done: - if (ret_value == BFAIL) { /* Error condition cleanup */ - - } /* end if */ - /* Normal function cleanup */ - FUNC_LEAVE(ret_value); -} /* end H5Ais_reserved() */ +} /****************************************************************************** NAME diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index 2b4abe5..ba5be6d 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -11,13 +11,14 @@ * Purpose: Constants and typedefs available to the rest of the * library. * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ #ifndef _H5ACprivate_H #define _H5ACprivate_H -#include <H5ACpublic.h> /*public prototypes */ + +#include <H5ACpublic.h> /*public prototypes */ /* Pivate headers needed by this header */ #include <H5private.h> @@ -49,19 +50,19 @@ * by the LOAD method if the DEST argument is non-zero. */ typedef enum H5AC_subid_t { - H5AC_BT_ID = 0, /*B-tree nodes */ - H5AC_SNODE_ID = 1, /*symbol table nodes */ - H5AC_HEAP_ID = 2, /*object or name heap */ - H5AC_OHDR_ID = 3, /*object header */ - H5AC_NTYPES = 4 /*THIS MUST BE LAST! */ + H5AC_BT_ID = 0, /*B-tree nodes */ + H5AC_SNODE_ID = 1, /*symbol table nodes */ + H5AC_HEAP_ID = 2, /*object or name heap */ + H5AC_OHDR_ID = 3, /*object header */ + H5AC_NTYPES = 4 /*THIS MUST BE LAST! */ } H5AC_subid_t; typedef struct H5AC_class_t { - H5AC_subid_t id; - void *(*load) (H5F_t *, const haddr_t *addr, - const void *udata1, void *udata2); - herr_t (*flush) (H5F_t *, hbool_t dest, - const haddr_t *addr, void *thing); + H5AC_subid_t id; + void *(*load)(H5F_t *, const haddr_t *addr, + const void *udata1, void *udata2); + herr_t (*flush)(H5F_t *, hbool_t dest, + const haddr_t *addr, void *thing); } H5AC_class_t; /* @@ -69,58 +70,56 @@ typedef struct H5AC_class_t { * cache entry by hashing the object's file address. Each file has its * own cache, an array of slots. */ -#define H5AC_NSLOTS 10330 /*prime number tend to work best */ +#define H5AC_NSLOTS 10330 /*prime number tend to work best */ #define H5AC_HASH(F,ADDR_P) H5F_addr_hash(ADDR_P,(F)->shared->cache->nslots) typedef struct H5AC_prot_t { - const H5AC_class_t *type; /*type of protected thing */ - haddr_t addr; /*address of protected thing */ - void *thing; /*(possible) protected thing */ + const H5AC_class_t *type; /*type of protected thing */ + haddr_t addr; /*address of protected thing */ + void *thing; /*(possible) protected thing */ } H5AC_prot_t; typedef struct H5AC_slot_t { - const H5AC_class_t *type; /*type of object stored here */ - haddr_t addr; /*file address for object */ - void *thing; /*the thing which is cached */ + const H5AC_class_t *type; /*type of object stored here */ + haddr_t addr; /*file address for object */ + void *thing; /*the thing which is cached */ #ifdef H5AC_DEBUG - intn nprots; /*number of things protected */ - intn aprots; /*nelmts of `prot' array */ - H5AC_prot_t *prot; /*array of protected things */ + intn nprots; /*number of things protected */ + intn aprots; /*nelmts of `prot' array */ + H5AC_prot_t *prot; /*array of protected things */ #endif } H5AC_slot_t; typedef struct H5AC_t { - intn nslots; /*number of cache slots */ - H5AC_slot_t *slot; /*the cache slots */ - intn nprots; /*number of protected objects */ + intn nslots; /*number of cache slots */ + H5AC_slot_t *slot; /*the cache slots */ + intn nprots; /*number of protected objects */ struct { - uintn nhits; /*number of cache hits */ - uintn nmisses;/*number of cache misses */ - uintn ninits; /*number of cache inits */ - uintn nflushes;/*number of flushes to disk */ - } diagnostics[H5AC_NTYPES]; /*diagnostics for each type of object */ + uintn nhits; /*number of cache hits */ + uintn nmisses; /*number of cache misses */ + uintn ninits; /*number of cache inits */ + uintn nflushes; /*number of flushes to disk */ + } diagnostics[H5AC_NTYPES]; /*diagnostics for each type of object*/ } H5AC_t; /* * Library prototypes. */ -herr_t H5AC_dest(H5F_t *f); -void *H5AC_find_f(H5F_t *f, const H5AC_class_t *type, - const haddr_t *addr, const void *udata1, - void *udata2); -void *H5AC_protect(H5F_t *f, const H5AC_class_t *type, - const haddr_t *addr, const void *udata1, - void *udata2); -herr_t H5AC_unprotect(H5F_t *f, const H5AC_class_t *type, - const haddr_t *addr, void *thing); -herr_t H5AC_flush(H5F_t *f, const H5AC_class_t *type, const haddr_t *addr, - hbool_t destroy); -herr_t H5AC_create(H5F_t *f, intn size_hint); -herr_t H5AC_rename(H5F_t *f, const H5AC_class_t *type, - const haddr_t *old_addr, const haddr_t *new_addr); -herr_t H5AC_set(H5F_t *f, const H5AC_class_t *type, const haddr_t *addr, - void *thing); -herr_t H5AC_debug(H5F_t *f); +herr_t H5AC_dest (H5F_t *f); +void *H5AC_find_f (H5F_t *f, const H5AC_class_t *type, const haddr_t *addr, + const void *udata1, void *udata2); +void *H5AC_protect (H5F_t *f, const H5AC_class_t *type, const haddr_t *addr, + const void *udata1, void *udata2); +herr_t H5AC_unprotect (H5F_t *f, const H5AC_class_t *type, + const haddr_t *addr, void *thing); +herr_t H5AC_flush (H5F_t *f, const H5AC_class_t *type, const haddr_t *addr, + hbool_t destroy); +herr_t H5AC_create (H5F_t *f, intn size_hint); +herr_t H5AC_rename (H5F_t *f, const H5AC_class_t *type, + const haddr_t *old_addr, const haddr_t *new_addr); +herr_t H5AC_set (H5F_t *f, const H5AC_class_t *type, const haddr_t *addr, + void *thing); +herr_t H5AC_debug (H5F_t *f); #define H5AC_find(F,TYPE,ADDR_P,UDATA1,UDATA2) \ (((F)->shared->cache->slot[H5AC_HASH(F,ADDR_P)].type==(TYPE) && \ @@ -129,5 +128,5 @@ herr_t H5AC_debug(H5F_t *f); ((F)->shared->cache->diagnostics[(TYPE)->id].nhits++, \ (F)->shared->cache->slot[H5AC_HASH(F,ADDR_P)].thing) : \ H5AC_find_f (F, TYPE, ADDR_P, UDATA1, UDATA2)) - + #endif /* !_H5ACprivate_H */ diff --git a/src/H5ACpublic.h b/src/H5ACpublic.h index b827139..5f87d1d 100644 --- a/src/H5ACpublic.h +++ b/src/H5ACpublic.h @@ -10,7 +10,7 @@ * * Purpose: Public include file for cache functions. * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ @@ -21,11 +21,10 @@ #include <H5public.h> #ifdef __cplusplus -extern "C" { +extern "C" { #endif #ifdef __cplusplus } - #endif #endif diff --git a/src/H5Aprivate.h b/src/H5Aprivate.h index 5788944..01e3ffe 100644 --- a/src/H5Aprivate.h +++ b/src/H5Aprivate.h @@ -10,8 +10,6 @@ * * ****************************************************************************/ -/* $Id$ */ - /*----------------------------------------------------------------------------- * File: atom.h * Purpose: header file for atom API @@ -20,7 +18,8 @@ /* avoid re-inclusion */ #ifndef _H5Aprivate_H #define _H5Aprivate_H -#include <H5Apublic.h> /* Include Public Definitions */ + +#include <H5Apublic.h> /*include Public Definitions */ /* Private headers needed by this file */ #include <H5private.h> @@ -37,19 +36,23 @@ #define ATOMS_ARE_CACHED #ifdef ATOMS_ARE_CACHED -# define ATOM_CACHE_SIZE 4 /* # of previous atoms cached */ +# define ATOM_CACHE_SIZE 4 /*# of previous atoms cached */ #endif /* Map an atom to a Group number */ -#define ATOM_TO_GROUP(a) ((group_t)((((hid_t)(a))>>((sizeof(hid_t)*8)-GROUP_BITS))&GROUP_MASK)) +#define ATOM_TO_GROUP(a) ((group_t)((((hid_t)(a))>> \ + ((sizeof(hid_t)*8)-GROUP_BITS)) \ + &GROUP_MASK)) #ifdef HASH_SIZE_POWER_2 + /* * Map an atom to a hash location (assumes s is a power of 2 and smaller * than the ATOM_MASK constant). */ # define ATOM_TO_LOC(a,s) ((hid_t)(a)&((s)-1)) #else + /* * Map an atom to a hash location. */ @@ -57,36 +60,46 @@ #endif /* Default sizes of the hash-tables for various atom groups */ -#define H5A_ERRSTACK_HASHSIZE 64 -#define H5A_FILEID_HASHSIZE 64 -#define H5A_TEMPID_HASHSIZE 64 -#define H5A_DATATYPEID_HASHSIZE 64 -#define H5A_DATASPACEID_HASHSIZE 64 -#define H5A_DATASETID_HASHSIZE 64 -#define H5A_OID_HASHSIZE 64 -#define H5A_GROUPID_HASHSIZE 64 +#define H5A_ERRSTACK_HASHSIZE 64 +#define H5A_FILEID_HASHSIZE 64 +#define H5A_TEMPID_HASHSIZE 64 +#define H5A_DATATYPEID_HASHSIZE 64 +#define H5A_DATASPACEID_HASHSIZE 64 +#define H5A_DATASETID_HASHSIZE 64 +#define H5A_OID_HASHSIZE 64 +#define H5A_GROUPID_HASHSIZE 64 /* Atom information structure used */ typedef struct atom_info_struct_tag { - hid_t id; /* atom ID for this info */ - uintn count; /* ref. count for this atom */ - VOIDP *obj_ptr; /* pointer associated with the atom */ - struct atom_info_struct_tag *next; /* link to next atom (in case of hash-clash) */ + hid_t id; /*atom ID for this info */ + uintn count; /*ref. count for this atom */ + VOIDP *obj_ptr; /*pointer associated with the atom */ + struct atom_info_struct_tag *next;/*link to next atom (in case of hash-clash)*/ } atom_info_t; /* Atom group structure used */ typedef struct atom_group_struct_tag { - uintn count; /* # of times this group has been initialized */ - uintn reserved; /* # of atoms to reserve for constant atoms */ - uintn wrapped; /* whether the id count has wrapped around */ - intn hash_size; /* size of the hash table to store the atoms in */ - uintn atoms; /* current number of atoms held */ - uintn nextid; /* atom ID to use for the next atom */ - herr_t (*free_func) (void *); /* Pointer to function to call when releasing ref counted object */ - atom_info_t **atom_list; /* pointer to an array of ptrs to atoms */ + uintn count; /*# of times this group has been initialized*/ + uintn reserved; /*# of atoms to reserve for constant atoms*/ + uintn wrapped; /*whether the id count has wrapped around*/ + intn hash_size; /*size of the hash table to store the atoms in*/ + uintn atoms; /*current number of atoms held */ + uintn nextid; /*atom ID to use for the next atom */ + herr_t (*free_func) (void *);/*pointer to function to call when releasing ref counted object*/ + atom_info_t **atom_list; /*pointer to an array of ptrs to atoms*/ } atom_group_t; -intn H5A_dec_ref(hid_t atm); -hid_t H5A_inc_ref(hid_t atm); +/* Private Functions in H5A.c */ +intn H5A_init_group (group_t grp, intn hash_size, uintn reserved, + herr_t (*free_func)(void *)); +intn H5A_destroy_group (group_t grp); +hid_t H5A_register (group_t grp, const void *object); +void *H5A_object (hid_t atm); +group_t H5A_group (hid_t atm); +void *H5A_remove (hid_t atm); +void *H5A_search (group_t grp, H5Asearch_func_t func, const void *key); +void H5A_term_interface (void); +intn H5A_dec_ref (hid_t atm); +hid_t H5A_inc_ref (hid_t atm); #endif diff --git a/src/H5Apublic.h b/src/H5Apublic.h index 971bfc3..f34d2ee 100644 --- a/src/H5Apublic.h +++ b/src/H5Apublic.h @@ -10,8 +10,6 @@ * * ****************************************************************************/ -/* $Id$ */ - /* * This file contains function prototypes for each exported function in * the H5A module. @@ -24,33 +22,33 @@ /* Group values allowed */ typedef enum { - BADGROUP = (-1), /* Invalid Group */ - H5_ERR = 0, /* Group ID for Error stack objects */ - H5_FILE, /* Group ID for File objects */ - H5_TEMPLATE_0, /* Group ID for Template objects */ - H5_TEMPLATE_1, /* Group ID for Template objects */ - H5_TEMPLATE_2, /* Group ID for Template objects */ - H5_TEMPLATE_3, /* Group ID for Template objects */ - H5_TEMPLATE_4, /* Group ID for Template objects */ - H5_TEMPLATE_5, /* Group ID for Template objects */ - H5_TEMPLATE_6, /* Group ID for Template objects */ - H5_TEMPLATE_7, /* Group ID for Template objects */ + BADGROUP = (-1),/*invalid Group */ + H5_ERR = 0, /*group ID for Error stack objects */ + H5_FILE, /*group ID for File objects */ + H5_TEMPLATE_0, /*group ID for Template objects */ + H5_TEMPLATE_1, /*group ID for Template objects */ + H5_TEMPLATE_2, /*group ID for Template objects */ + H5_TEMPLATE_3, /*group ID for Template objects */ + H5_TEMPLATE_4, /*group ID for Template objects */ + H5_TEMPLATE_5, /*group ID for Template objects */ + H5_TEMPLATE_6, /*group ID for Template objects */ + H5_TEMPLATE_7, /*group ID for Template objects */ #ifndef NDEBUG - H5_TEMPLATE_MAX, /* Not really a group ID */ + H5_TEMPLATE_MAX, /*not really a group ID */ #endif - H5_GROUP, /* Group ID for Group objects */ - H5_DATATYPE, /* Group ID for Datatype objects */ - H5_DATASPACE, /* Group ID for Dataspace objects */ - H5_DATASET, /* Group ID for Dataset objects */ - H5_DIRECTORY, /* Group ID for Directory objects */ - MAXGROUP /* Highest group in group_t (Invalid as true group) */ + H5_GROUP, /*group ID for Group objects */ + H5_DATATYPE, /*group ID for Datatype objects */ + H5_DATASPACE, /*group ID for Dataspace objects */ + H5_DATASET, /*group ID for Dataset objects */ + H5_DIRECTORY, /*group ID for Directory objects */ + MAXGROUP /*highest group in group_t (Invalid as true group)*/ } group_t; /* Type of atoms to return to users */ typedef int32 hid_t; /* Type of the function to compare objects & keys */ -typedef intn (*H5Asearch_func_t) (const VOIDP obj, const VOIDP key); +typedef intn (*H5Asearch_func_t) (const VOIDP obj, const VOIDP key); /* # of bits to use for Group ID in each atom (change if MAXGROUP>16) */ #define GROUP_BITS 8 @@ -65,157 +63,11 @@ typedef intn (*H5Asearch_func_t) (const VOIDP obj, const VOIDP key); ((hid_t)(i)&ATOM_MASK)) #ifdef __cplusplus -extern "C" { +extern "C" { #endif -/* Functions in H5A.c */ -/****************************************************************************** - NAME - H5Ainit_group - Initialize an atomic group - - DESCRIPTION - Creates an atomic group to store atoms in. If the group has already been - initialized, this routine just increments the count of # of initializations - and returns without trying to change the size of the hash table. - - RETURNS - Returns SUCCEED if successful and FAIL otherwise - -*******************************************************************************/ - intn H5Ainit_group(group_t grp, /* IN: Group to initialize */ - intn hash_size, /* IN: Minimum hash table size to use for group */ - uintn reserved, /* IN: Number of hash table entries to reserve */ - herr_t (*free_func) (void *) /* IN: Function to call when releasing ref counted objects */ - ); - -/****************************************************************************** - NAME - H5Adestroy_group - Destroy an atomic group - - DESCRIPTION - Destroys an atomic group which atoms are stored in. If the group still - has atoms which are registered, this routine fails. If there have been - multiple initializations of the group, this routine just decrements the - count of initializations and does not check the atoms out-standing. - - RETURNS - Returns SUCCEED if successful and FAIL otherwise - -*******************************************************************************/ - intn H5Adestroy_group(group_t grp /* IN: Group to destroy */ - ); - -/****************************************************************************** - NAME - H5Aregister_atom - Register an object in a group and get an atom for it. - - DESCRIPTION - Registers an object in a group and returns an atom for it. This routine - does _not_ check for unique-ness of the objects, if you register an object - twice, you will get two different atoms for it. This routine does make - certain that each atom in a group is unique. Atoms are created by getting - a unique number for the group the atom is in and incorporating the group - into the atom which is returned to the user. - - RETURNS - Returns atom if successful and FAIL otherwise - -*******************************************************************************/ - hid_t H5Aregister_atom(group_t grp, /* IN: Group to register the object in */ - const void *object /* IN: Object to attach to atom */ - ); - -/****************************************************************************** - NAME - H5Aatom_object - Returns to the object ptr for the atom - - DESCRIPTION - Retrieves the object ptr which is associated with the atom. - - RETURNS - Returns object ptr if successful and NULL otherwise - -*******************************************************************************/ - VOIDP H5Aatom_object(hid_t atm /* IN: Atom to retrieve object for */ - ); - -/****************************************************************************** - NAME - H5Aatom_group - Returns to the group for the atom - - DESCRIPTION - Retrieves the group which is associated with the atom. - - RETURNS - Returns group if successful and FAIL otherwise - -*******************************************************************************/ - group_t H5Aatom_group(hid_t atm /* IN: Atom to retrieve group for */ - ); - -/****************************************************************************** - NAME - H5Aremove_atom - Removes an atom from a group - - DESCRIPTION - Removes an atom from a group. - - RETURNS - Returns atom's object if successful and FAIL otherwise - -*******************************************************************************/ - VOIDP H5Aremove_atom(hid_t atm /* IN: Atom to remove */ - ); - -/****************************************************************************** - NAME - H5Asearch_atom - Search for an object in a group and get it's pointer. - - DESCRIPTION - Searchs for an object in a group and returns the pointer to it. - This routine calls the function pointer passed in for each object in the - group until it finds a match. Currently there is no way to resume a - search. - - RETURNS - Returns pointer an atom's object if successful and NULL otherwise - -*******************************************************************************/ - VOIDP H5Asearch_atom(group_t grp, /* IN: Group to search for the object in */ - H5Asearch_func_t func, /* IN: Ptr to the comparison function */ - const VOIDP key /* IN: pointer to key to compare against */ - ); - -/****************************************************************************** - NAME - H5Ais_reserved - Check whether an atom is a reserved atom in a group - - DESCRIPTION - Determines the group an atom belongs to and checks if the atom is a - reserved atom in the group. - - RETURNS - Returns BTRUE/BFALSE/BFAIL - -*******************************************************************************/ - intn H5Ais_reserved(hid_t atm /* IN: Group to search for the object in */ - ); - -/****************************************************************************** - NAME - H5A_term_interface - Terminate various static buffers. - - DESCRIPTION - Free various buffers allocated in the H5A routines. - - RETURNS - Returns SUCCEED/FAIL - -*******************************************************************************/ - void H5A_term_interface(void); #ifdef __cplusplus } - #endif #endif diff --git a/src/H5Bprivate.h b/src/H5Bprivate.h index dfc29a0..c8b57b0 100644 --- a/src/H5Bprivate.h +++ b/src/H5Bprivate.h @@ -10,13 +10,14 @@ * * Purpose: Private non-prototype header. * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ #ifndef _H5Bprivate_H #define _H5Bprivate_H -#include <H5Bpublic.h> /*API prototypes */ + +#include <H5Bpublic.h> /*API prototypes */ /* Private headers needed by this file */ #include <H5private.h> @@ -31,30 +32,27 @@ #ifdef NDEBUG # undef H5B_DEBUG #endif - -#define H5B_MAGIC "TREE" /*tree node magic number */ -#define H5B_SIZEOF_MAGIC 4 /*size of magic number */ - +#define H5B_MAGIC "TREE" /*tree node magic number */ +#define H5B_SIZEOF_MAGIC 4 /*size of magic number */ #define H5B_SIZEOF_HDR(F) \ (H5B_SIZEOF_MAGIC + /*magic number */ \ 4 + /*type, level, num entries */ \ 2*H5F_SIZEOF_ADDR(F)) /*left and right sibling addresses */ - #define H5B_K(F,TYPE) /*K value given file and Btree subclass */ \ ((F)->shared->create_parms.btree_k[(TYPE)->id]) typedef enum H5B_ins_t { - H5B_INS_ERROR = -1, /*error return value */ - H5B_INS_NOOP = 0, /*insert made no changes */ - H5B_INS_LEFT = 1, /*insert new node to left of cur node */ - H5B_INS_RIGHT = 2, /*insert new node to right of cur node */ - H5B_INS_CHANGE = 3, /*change child address for cur node */ - H5B_INS_FIRST = 4 /*insert first node in (sub)tree */ + H5B_INS_ERROR = -1, /*error return value */ + H5B_INS_NOOP = 0, /*insert made no changes */ + H5B_INS_LEFT = 1, /*insert new node to left of cur node */ + H5B_INS_RIGHT = 2, /*insert new node to right of cur node */ + H5B_INS_CHANGE = 3, /*change child address for cur node */ + H5B_INS_FIRST = 4 /*insert first node in (sub)tree */ } H5B_ins_t; typedef enum H5B_subid_t { - H5B_SNODE_ID = 0, /*B-tree is for symbol table nodes */ - H5B_ISTORE_ID = 1 /*B-tree is for indexed object storage */ + H5B_SNODE_ID = 0, /*B-tree is for symbol table nodes */ + H5B_ISTORE_ID = 1 /*B-tree is for indexed object storage */ } H5B_subid_t; /* @@ -64,59 +62,65 @@ typedef enum H5B_subid_t { * has an array of K values indexed by the `id' class field below. The * array is initialized with the HDF5_BTREE_K_DEFAULT macro. */ -struct H5B_t; /*forward decl */ +struct H5B_t; /*forward decl */ + typedef struct H5B_class_t { - H5B_subid_t id; /*id as found in file */ - size_t sizeof_nkey; /*size of native (memory) key */ - size_t (*get_sizeof_rkey) (H5F_t *, const void *); /*raw key size */ - herr_t (*new) (H5F_t *, H5B_ins_t, void *, void *, void *, haddr_t *); - intn (*cmp2) (H5F_t *, void *, void *, void *); /*compare 2 keys */ - intn (*cmp3) (H5F_t *, void *, void *, void *); /*compare 3 keys */ - herr_t (*found) (H5F_t *, const haddr_t *, const void *, void *, const void *); - H5B_ins_t (*insert) (H5F_t *, const haddr_t *, void *, hbool_t *, void *, void *, - void *, hbool_t *, haddr_t *); /*insert new data */ - hbool_t follow_min; /*min insert uses min leaf, not new() */ - hbool_t follow_max; /*max insert uses max leaf, not new() */ - herr_t (*list) (H5F_t *, const haddr_t *, void *); /*walk leaf nodes */ - herr_t (*decode) (H5F_t *, struct H5B_t *, uint8 *, void *); - herr_t (*encode) (H5F_t *, struct H5B_t *, uint8 *, void *); + H5B_subid_t id; /*id as found in file*/ + size_t sizeof_nkey; /*size of native (memory) key*/ + size_t (*get_sizeof_rkey) (H5F_t *, const void *); /*raw key size */ + herr_t (*new) (H5F_t *, H5B_ins_t, void *, void *, void *, haddr_t *); + intn (*cmp2) (H5F_t *, void *, void *, void *); /*compare 2 keys */ + intn (*cmp3) (H5F_t *, void *, void *, void *); /*compare 3 keys */ + herr_t (*found) (H5F_t *, const haddr_t *, const void *, void *, + const void *); + + /* insert new data */ + H5B_ins_t (*insert) (H5F_t *, const haddr_t *, void *, hbool_t *, + void *, void *, void *, hbool_t *, haddr_t *); + + /* min insert uses min leaf, not new(), similarily for max insert */ + hbool_t follow_min; + hbool_t follow_max; + + herr_t (*list) (H5F_t *, const haddr_t *, void *); /*walk leaf nodes*/ + herr_t (*decode) (H5F_t *, struct H5B_t *, uint8 *, void *); + herr_t (*encode) (H5F_t *, struct H5B_t *, uint8 *, void *); } H5B_class_t; /* * The B-tree node as stored in memory... */ typedef struct H5B_key_t { - hbool_t dirty; /*native key is more recent than raw key */ - uint8 *rkey; /*ptr into node->page for raw key */ - void *nkey; /*null or ptr into node->native for key */ + hbool_t dirty; /*native key is more recent than raw key */ + uint8 *rkey; /*ptr into node->page for raw key */ + void *nkey; /*null or ptr into node->native for key */ } H5B_key_t; typedef struct H5B_t { - const H5B_class_t *type; /*type of tree */ - size_t sizeof_rkey; /*size of raw (disk) key */ - hbool_t dirty; /*something in the tree is dirty */ - intn ndirty; /*num child ptrs to emit */ - intn level; /*node level */ - haddr_t left; /*address of left sibling */ - haddr_t right; /*address of right sibling */ - intn nchildren; /*number of child pointers */ - uint8 *page; /*disk page */ - uint8 *native; /*array of keys in native format */ - H5B_key_t *key; /*2k+1 key entries */ - haddr_t *child; /*2k child pointers */ + const H5B_class_t *type; /*type of tree */ + size_t sizeof_rkey; /*size of raw (disk) key */ + hbool_t dirty; /*something in the tree is dirty */ + intn ndirty; /*num child ptrs to emit */ + intn level; /*node level */ + haddr_t left; /*address of left sibling */ + haddr_t right; /*address of right sibling */ + intn nchildren; /*number of child pointers */ + uint8 *page; /*disk page */ + uint8 *native; /*array of keys in native format */ + H5B_key_t *key; /*2k+1 key entries */ + haddr_t *child; /*2k child pointers */ } H5B_t; /* * Library prototypes. */ -herr_t H5B_debug(H5F_t *f, const haddr_t *addr, FILE * stream, intn indent, - intn fwidth, const H5B_class_t *type, void *udata); -herr_t H5B_create(H5F_t *f, const H5B_class_t *type, void *udata, haddr_t *); -herr_t H5B_find(H5F_t *f, const H5B_class_t *type, const haddr_t *addr, - void *udata); -herr_t H5B_insert(H5F_t *f, const H5B_class_t *type, const haddr_t *addr, - void *udata); -herr_t H5B_list(H5F_t *f, const H5B_class_t *type, const haddr_t *addr, - void *udata); - +herr_t H5B_debug (H5F_t *f, const haddr_t *addr, FILE * stream, intn indent, + intn fwidth, const H5B_class_t *type, void *udata); +herr_t H5B_create (H5F_t *f, const H5B_class_t *type, void *udata, haddr_t *); +herr_t H5B_find (H5F_t *f, const H5B_class_t *type, const haddr_t *addr, + void *udata); +herr_t H5B_insert (H5F_t *f, const H5B_class_t *type, const haddr_t *addr, + void *udata); +herr_t H5B_list (H5F_t *f, const H5B_class_t *type, const haddr_t *addr, + void *udata); #endif diff --git a/src/H5Bpublic.h b/src/H5Bpublic.h index 7fbb6c0..aab279f 100644 --- a/src/H5Bpublic.h +++ b/src/H5Bpublic.h @@ -10,7 +10,7 @@ * * Purpose: Public declarations for the H5B package. * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ @@ -21,11 +21,10 @@ #include <H5public.h> #ifdef __cplusplus -extern "C" { +extern "C" { #endif #ifdef __cplusplus } - #endif #endif @@ -66,7 +66,7 @@ H5C_init_interface(void) * atom groups aren't. */ for (i = 0; i < H5C_NCLASSES; i++) { - status = H5Ainit_group(H5_TEMPLATE_0 + i, H5A_TEMPID_HASHSIZE, 0, NULL); + status = H5A_init_group(H5_TEMPLATE_0 + i, H5A_TEMPID_HASHSIZE, 0, NULL); if (status < 0) ret_value = FAIL; } @@ -107,7 +107,7 @@ H5C_term_interface(void) intn i; for (i = 0; i < H5C_NCLASSES; i++) { - H5Adestroy_group(H5_TEMPLATE_0 + i); + H5A_destroy_group(H5_TEMPLATE_0 + i); } } @@ -202,7 +202,7 @@ H5C_create(H5C_class_t type, void *tmpl) assert(tmpl); /* Atomize the new template */ - if ((ret_value = H5Aregister_atom(H5_TEMPLATE_0 + type, tmpl)) < 0) { + if ((ret_value = H5A_register(H5_TEMPLATE_0 + type, tmpl)) < 0) { HRETURN_ERROR(H5E_ATOM, H5E_CANTINIT, FAIL, "can't register template"); } @@ -230,7 +230,7 @@ H5Cclose(hid_t tid) FUNC_ENTER(H5Cclose, FAIL); /* Chuck the object! :-) */ - if (NULL == (tmpl = H5Aremove_atom(tid))) { + if (NULL == (tmpl = H5A_remove(tid))) { HRETURN_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "unable to remove atom"); } H5MM_xfree(tmpl); @@ -262,7 +262,7 @@ H5Cget_class(hid_t tid) FUNC_ENTER(H5Cget_class, H5C_NO_CLASS); - if ((group = H5Aatom_group(tid)) < 0 || + if ((group = H5A_group(tid)) < 0 || #ifndef NDEBUG group >= H5_TEMPLATE_MAX || #endif @@ -309,7 +309,7 @@ H5Cget_version(hid_t tid, int *boot /*out */ , int *heap /*out */ , /* Check arguments */ if (H5C_FILE_CREATE != H5Cget_class(tid) || - NULL == (tmpl = H5Aatom_object(tid))) { + NULL == (tmpl = H5A_object(tid))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file creation template"); } @@ -354,7 +354,7 @@ H5Cset_userblock(hid_t tid, size_t size) /* Check arguments */ if (H5C_FILE_CREATE != H5Cget_class(tid) || - NULL == (tmpl = H5Aatom_object(tid))) { + NULL == (tmpl = H5A_object(tid))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file creation template"); } @@ -398,7 +398,7 @@ H5Cget_userblock(hid_t tid, size_t *size) /* Check args */ if (H5C_FILE_CREATE != H5Cget_class(tid) || - NULL == (tmpl = H5Aatom_object(tid))) { + NULL == (tmpl = H5A_object(tid))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file creation template"); } @@ -436,7 +436,7 @@ H5Cset_sizes(hid_t tid, size_t sizeof_addr, size_t sizeof_size) /* Check arguments */ if (H5C_FILE_CREATE != H5Cget_class(tid) || - NULL == (tmpl = H5Aatom_object(tid))) { + NULL == (tmpl = H5A_object(tid))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file creation template"); } @@ -491,7 +491,7 @@ H5Cget_sizes(hid_t tid, /* Check args */ if (H5C_FILE_CREATE != H5Cget_class(tid) || - NULL == (tmpl = H5Aatom_object(tid))) { + NULL == (tmpl = H5A_object(tid))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file creation template"); } @@ -542,7 +542,7 @@ H5Cset_sym_k(hid_t tid, int ik, int lk) /* Check arguments */ if (H5C_FILE_CREATE != H5Cget_class(tid) || - NULL == (tmpl = H5Aatom_object(tid))) { + NULL == (tmpl = H5A_object(tid))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file creation template"); } @@ -584,7 +584,7 @@ H5Cget_sym_k(hid_t tid, int *ik /*out */ , int *lk /*out */ ) /* Check arguments */ if (H5C_FILE_CREATE != H5Cget_class(tid) || - NULL == (tmpl = H5Aatom_object(tid))) { + NULL == (tmpl = H5A_object(tid))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file creation template"); } @@ -624,7 +624,7 @@ H5Cset_istore_k(hid_t tid, int ik) /* Check arguments */ if (H5C_FILE_CREATE != H5Cget_class(tid) || - NULL == (tmpl = H5Aatom_object(tid))) { + NULL == (tmpl = H5A_object(tid))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file creation template"); } @@ -665,7 +665,7 @@ H5Cget_istore_k(hid_t tid, int *ik /*out */ ) /* Check arguments */ if (H5C_FILE_CREATE != H5Cget_class(tid) || - NULL == (tmpl = H5Aatom_object(tid))) { + NULL == (tmpl = H5A_object(tid))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file creation template"); } @@ -701,7 +701,7 @@ H5Cset_layout(hid_t tid, H5D_layout_t layout) /* Check arguments */ if (H5C_DATASET_CREATE != H5Cget_class(tid) || - NULL == (tmpl = H5Aatom_object(tid))) { + NULL == (tmpl = H5A_object(tid))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation template"); } @@ -740,7 +740,7 @@ H5Cget_layout(hid_t tid) /* Check arguments */ if (H5C_DATASET_CREATE != H5Cget_class(tid) || - NULL == (tmpl = H5Aatom_object(tid))) { + NULL == (tmpl = H5A_object(tid))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, H5D_LAYOUT_ERROR, "not a dataset creation template"); } @@ -778,7 +778,7 @@ H5Cset_chunk(hid_t tid, int ndims, size_t dim[]) /* Check arguments */ if (H5C_DATASET_CREATE != H5Cget_class(tid) || - NULL == (tmpl = H5Aatom_object(tid))) { + NULL == (tmpl = H5A_object(tid))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation template"); } @@ -839,7 +839,7 @@ H5Cget_chunk(hid_t tid, int max_ndims, size_t dim[] /*out */ ) /* Check arguments */ if (H5C_DATASET_CREATE != H5Cget_class(tid) || - NULL == (tmpl = H5Aatom_object(tid))) { + NULL == (tmpl = H5A_object(tid))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation template"); } @@ -891,9 +891,9 @@ H5Ccopy(hid_t tid) H5ECLEAR; /* check args */ - if (NULL == (tmpl = H5Aatom_object(tid)) || + if (NULL == (tmpl = H5A_object(tid)) || (type = H5Cget_class(tid)) < 0 || - (group = H5Aatom_group(tid)) < 0) { + (group = H5A_group(tid)) < 0) { HRETURN_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't unatomize template"); } @@ -925,7 +925,7 @@ H5Ccopy(hid_t tid) HDmemcpy(new_tmpl, tmpl, size); /* Register the atom for the new template */ - if ((ret_value = H5Aregister_atom(group, new_tmpl)) < 0) { + if ((ret_value = H5A_register(group, new_tmpl)) < 0) { HRETURN_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize template pointer"); } diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index b6614a2..ffa93e7 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -10,20 +10,17 @@ * * ****************************************************************************/ -/* $Id$ */ - /* * This file contains private information about the H5C module */ - #ifndef _H5Cprivate_H #define _H5Cprivate_H + #include <H5Cpublic.h> /* Private headers needed by this file */ #include <H5private.h> #include <H5Fprivate.h> -hid_t H5C_create(H5C_class_t type, void *tmpl); - +hid_t H5C_create (H5C_class_t type, void *tmpl); #endif diff --git a/src/H5Cpublic.h b/src/H5Cpublic.h index a796273..e21b368 100644 --- a/src/H5Cpublic.h +++ b/src/H5Cpublic.h @@ -27,51 +27,42 @@ /* Template classes */ typedef enum H5C_class_t { - H5C_NO_CLASS = -1, /* Error return value */ - H5C_FILE_CREATE = 0, /* File creation template */ - H5C_FILE_ACCESS = 1, /* File access template */ - H5C_DATASET_CREATE = 2, /* Dataset creation template */ - H5C_DATASET_XFER = 3, /* Dataset transfer template */ + H5C_NO_CLASS = -1, /*error return value */ + H5C_FILE_CREATE = 0, /*file creation template */ + H5C_FILE_ACCESS = 1, /*file access template */ + H5C_DATASET_CREATE = 2, /*dataset creation template */ + H5C_DATASET_XFER = 3, /*dataset transfer template */ - H5C_NCLASSES = 4 /* This must be last! */ + H5C_NCLASSES = 4 /*this must be last! */ } H5C_class_t; #ifdef __cplusplus -extern "C" { +extern "C" { #endif /* Public functions */ - hid_t H5Ccreate(H5C_class_t type); - herr_t H5Cclose(hid_t tid); - hid_t H5Ccopy(hid_t tid); - - H5C_class_t H5Cget_class(hid_t tid); - - herr_t H5Cget_version(hid_t tid, int *boot /*out */ , int *heap /*out */ , - int *freelist /*out */ , int *stab /*out */ , - int *shhdr /*out */ ); - - herr_t H5Cset_userblock(hid_t tid, size_t size); - herr_t H5Cget_userblock(hid_t tid, size_t *size); - - herr_t H5Cset_sizes(hid_t tid, size_t sizeof_addr, size_t sizeof_size); - herr_t H5Cget_sizes(hid_t tid, size_t *sizeof_addr /*out */ , - size_t *sizeof_size /*out */ ); - - herr_t H5Cset_sym_k(hid_t tid, int ik, int lk); - herr_t H5Cget_sym_k(hid_t tid, int *ik /*out */ , int *lk /*out */ ); - - herr_t H5Cset_istore_k(hid_t tid, int ik); - herr_t H5Cget_istore_k(hid_t tid, int *ik /*out */ ); - - herr_t H5Cset_layout(hid_t tid, H5D_layout_t layout); - H5D_layout_t H5Cget_layout(hid_t tid); - - herr_t H5Cset_chunk(hid_t tid, int ndims, size_t dim[]); - int H5Cget_chunk(hid_t tid, int max_ndims, size_t dim[] /*out */ ); +hid_t H5Ccreate (H5C_class_t type); +herr_t H5Cclose (hid_t tid); +hid_t H5Ccopy (hid_t tid); +H5C_class_t H5Cget_class (hid_t tid); +herr_t H5Cget_version (hid_t tid, int *boot/*out*/, int *heap/*out*/, + int *freelist/*out*/, int *stab/*out*/, + int *shhdr/*out*/); +herr_t H5Cset_userblock (hid_t tid, size_t size); +herr_t H5Cget_userblock (hid_t tid, size_t *size); +herr_t H5Cset_sizes (hid_t tid, size_t sizeof_addr, size_t sizeof_size); +herr_t H5Cget_sizes (hid_t tid, size_t *sizeof_addr/*out*/, + size_t *sizeof_size/*out*/); +herr_t H5Cset_sym_k (hid_t tid, int ik, int lk); +herr_t H5Cget_sym_k (hid_t tid, int *ik/*out*/, int *lk/*out*/); +herr_t H5Cset_istore_k (hid_t tid, int ik); +herr_t H5Cget_istore_k (hid_t tid, int *ik/*out*/); +herr_t H5Cset_layout (hid_t tid, H5D_layout_t layout); +H5D_layout_t H5Cget_layout (hid_t tid); +herr_t H5Cset_chunk (hid_t tid, int ndims, size_t dim[]); +int H5Cget_chunk (hid_t tid, int max_ndims, size_t dim[]/*out*/); #ifdef __cplusplus } - #endif #endif @@ -84,9 +84,9 @@ H5D_init_interface(void) FUNC_ENTER(H5D_init_interface, FAIL); /* Initialize the atom group for the dataset IDs */ - if ((ret_value = H5Ainit_group(H5_DATASET, H5A_DATASETID_HASHSIZE, - H5D_RESERVED_ATOMS, - (herr_t (*)(void *)) H5D_close)) != FAIL) { + if ((ret_value = H5A_init_group(H5_DATASET, H5A_DATASETID_HASHSIZE, + H5D_RESERVED_ATOMS, + (herr_t (*)(void *)) H5D_close)) != FAIL) { ret_value = H5_add_exit(H5D_term_interface); } FUNC_LEAVE(ret_value); @@ -112,7 +112,7 @@ H5D_init_interface(void) static void H5D_term_interface(void) { - H5Adestroy_group(H5_DATASET); + H5A_destroy_group(H5_DATASET); } /*------------------------------------------------------------------------- @@ -170,24 +170,24 @@ H5Dcreate(hid_t file_id, const char *name, hid_t type_id, hid_t space_id, H5ECLEAR; /* check arguments */ - if (H5_FILE != H5Aatom_group(file_id) || - NULL == (f = H5Aatom_object(file_id))) { + if (H5_FILE != H5A_group(file_id) || + NULL == (f = H5A_object(file_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file"); } if (!name || !*name) { HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name"); } - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (type = H5Aatom_object(type_id))) { + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (type = H5A_object(type_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a type"); } - if (H5_DATASPACE != H5Aatom_group(space_id) || - NULL == (space = H5Aatom_object(space_id))) { + if (H5_DATASPACE != H5A_group(space_id) || + NULL == (space = H5A_object(space_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); } if (create_parms_id >= 0) { if (H5C_DATASET_CREATE != H5Cget_class(create_parms_id) || - NULL == (create_parms = H5Aatom_object(create_parms_id))) { + NULL == (create_parms = H5A_object(create_parms_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation template"); } @@ -200,7 +200,7 @@ H5Dcreate(hid_t file_id, const char *name, hid_t type_id, hid_t space_id, HRETURN_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create dataset"); } /* Register the new datatype and get an ID for it */ - if ((ret_value = H5Aregister_atom(H5_DATASET, new_dset)) < 0) { + if ((ret_value = H5A_register(H5_DATASET, new_dset)) < 0) { H5D_close(new_dset); HRETURN_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "can't register dataset"); @@ -243,8 +243,8 @@ H5Dopen(hid_t file_id, const char *name) H5ECLEAR; /* Check args */ - if (H5_FILE != H5Aatom_group(file_id) || - NULL == (file = H5Aatom_object(file_id))) { + if (H5_FILE != H5A_group(file_id) || + NULL == (file = H5A_object(file_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file"); } if (!name || !*name) { @@ -257,7 +257,7 @@ H5Dopen(hid_t file_id, const char *name) } /* Create an atom for the dataset */ - if ((ret_value = H5Aregister_atom(H5_DATASET, dataset)) < 0) { + if ((ret_value = H5A_register(H5_DATASET, dataset)) < 0) { H5D_close(dataset); HRETURN_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "can't register dataset"); @@ -296,8 +296,8 @@ H5Dclose(hid_t dataset_id) H5ECLEAR; /* Check args */ - if (H5_DATASET != H5Aatom_group(dataset_id) || - NULL == (dataset = H5Aatom_object(dataset_id)) || + if (H5_DATASET != H5A_group(dataset_id) || + NULL == (dataset = H5A_object(dataset_id)) || NULL == dataset->ent.file) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset"); } @@ -367,31 +367,31 @@ H5Dread(hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id, H5ECLEAR; /* check arguments */ - if (H5_DATASET != H5Aatom_group(dataset_id) || - NULL == (dataset = H5Aatom_object(dataset_id)) || + if (H5_DATASET != H5A_group(dataset_id) || + NULL == (dataset = H5A_object(dataset_id)) || NULL == dataset->ent.file) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset"); } - if (H5_DATATYPE != H5Aatom_group(mem_type_id) || - NULL == (mem_type = H5Aatom_object(mem_type_id))) { + if (H5_DATATYPE != H5A_group(mem_type_id) || + NULL == (mem_type = H5A_object(mem_type_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } if (H5P_ALL != mem_space_id) { - if (H5_DATASPACE != H5Aatom_group(mem_space_id) || - NULL == (mem_space = H5Aatom_object(mem_space_id))) { + if (H5_DATASPACE != H5A_group(mem_space_id) || + NULL == (mem_space = H5A_object(mem_space_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); } } if (H5P_ALL != file_space_id) { - if (H5_DATASPACE != H5Aatom_group(file_space_id) || - NULL == (file_space = H5Aatom_object(file_space_id))) { + if (H5_DATASPACE != H5A_group(file_space_id) || + NULL == (file_space = H5A_object(file_space_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); } } if (H5C_DEFAULT == xfer_parms_id) { xfer_parms = &H5D_xfer_dflt; } else if (H5C_DATASET_XFER != H5Cget_class(xfer_parms_id) || - NULL == (xfer_parms = H5Aatom_object(xfer_parms_id))) { + NULL == (xfer_parms = H5A_object(xfer_parms_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms"); } if (!buf) { @@ -457,31 +457,31 @@ H5Dwrite(hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id, H5ECLEAR; /* check arguments */ - if (H5_DATASET != H5Aatom_group(dataset_id) || - NULL == (dataset = H5Aatom_object(dataset_id)) || + if (H5_DATASET != H5A_group(dataset_id) || + NULL == (dataset = H5A_object(dataset_id)) || NULL == dataset->ent.file) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset"); } - if (H5_DATATYPE != H5Aatom_group(mem_type_id) || - NULL == (mem_type = H5Aatom_object(mem_type_id))) { + if (H5_DATATYPE != H5A_group(mem_type_id) || + NULL == (mem_type = H5A_object(mem_type_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } if (H5P_ALL != mem_space_id) { - if (H5_DATASPACE != H5Aatom_group(mem_space_id) || - NULL == (mem_space = H5Aatom_object(mem_space_id))) { + if (H5_DATASPACE != H5A_group(mem_space_id) || + NULL == (mem_space = H5A_object(mem_space_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); } } if (H5P_ALL != file_space_id) { - if (H5_DATASPACE != H5Aatom_group(file_space_id) || - NULL == (file_space = H5Aatom_object(file_space_id))) { + if (H5_DATASPACE != H5A_group(file_space_id) || + NULL == (file_space = H5A_object(file_space_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); } } if (H5C_DEFAULT == xfer_parms_id) { xfer_parms = &H5D_xfer_dflt; } else if (H5C_DATASET_XFER != H5Cget_class(xfer_parms_id) || - NULL == (xfer_parms = H5Aatom_object(xfer_parms_id))) { + NULL == (xfer_parms = H5A_object(xfer_parms_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms"); } if (!buf) { @@ -853,8 +853,8 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5P_t *mem_space, * Convert data types to atoms because the conversion functions are * application-level functions. */ - if ((src_id=H5Aregister_atom(H5_DATATYPE, H5T_copy(dataset->type))) < 0 || - (dst_id = H5Aregister_atom(H5_DATATYPE, H5T_copy(mem_type))) < 0) { + if ((src_id = H5A_register(H5_DATATYPE, H5T_copy(dataset->type))) < 0 || + (dst_id = H5A_register(H5_DATATYPE, H5T_copy(mem_type))) < 0) { HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register types for conversion"); } @@ -975,8 +975,8 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5P_t *mem_space, * Convert data types to atoms because the conversion functions are * application-level functions. */ - if ((src_id = H5Aregister_atom(H5_DATATYPE, H5T_copy(mem_type)))<0 || - (dst_id = H5Aregister_atom(H5_DATATYPE, H5T_copy(dataset->type)))<0) { + if ((src_id = H5A_register(H5_DATATYPE, H5T_copy(mem_type)))<0 || + (dst_id = H5A_register(H5_DATATYPE, H5T_copy(dataset->type)))<0) { HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register types for conversion"); } diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index 0e63a8d..f8a588f 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -10,23 +10,21 @@ * * ****************************************************************************/ -/* $Id$ */ - /* * This file contains private information about the H5D module */ - #ifndef _H5Dprivate_H #define _H5Dprivate_H + #include <H5Dpublic.h> /* Private headers needed by this file */ #include <H5private.h> -#include <H5Fprivate.h> /* for the H5F_t type */ -#include <H5Gprivate.h> /* Symbol tables */ -#include <H5Tprivate.h> /* for the H5T_t type */ -#include <H5Pprivate.h> /* for the H5P_t type */ -#include <H5Oprivate.h> /* Object Headers */ +#include <H5Fprivate.h> /*for the H5F_t type */ +#include <H5Gprivate.h> /*symbol tables */ +#include <H5Tprivate.h> /*for the H5T_t type */ +#include <H5Pprivate.h> /*for the H5P_t type */ +#include <H5Oprivate.h> /*object Headers */ #define H5D_RESERVED_ATOMS 0 @@ -35,35 +33,32 @@ /* Dataset creation template */ typedef struct H5D_create_t { - H5D_layout_t layout; - intn chunk_ndims; - size_t chunk_size[32]; + H5D_layout_t layout; + intn chunk_ndims; + size_t chunk_size[32]; } H5D_create_t; /* Dataset transfer template */ typedef struct H5D_xfer_t { - int _placeholder; /*unused--delete this later */ + int _placeholder; /*unused--delete this later */ } H5D_xfer_t; - typedef struct H5D_t H5D_t; - extern const H5D_create_t H5D_create_dflt; extern const H5D_xfer_t H5D_xfer_dflt; /* Functions defined in H5D.c */ -H5D_t *H5D_create(H5F_t *f, const char *name, const H5T_t *type, - const H5P_t *space, const H5D_create_t *create_parms); -H5D_t *H5D_open(H5F_t *f, const char *name); -herr_t H5D_close(H5D_t *dataset); -herr_t H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5P_t *mem_space, - const H5P_t *file_space, const H5D_xfer_t *xfer_parms, - void *buf /*out */ ); -herr_t H5D_write(H5D_t *dataset, const H5T_t *mem_type, - const H5P_t *mem_space, const H5P_t *file_space, - const H5D_xfer_t *xfer_parms, const void *buf); -hid_t H5D_find_name(hid_t file_id, group_t UNUSED, const char *name); +H5D_t *H5D_create (H5F_t *f, const char *name, const H5T_t *type, + const H5P_t *space, const H5D_create_t *create_parms); +H5D_t *H5D_open (H5F_t *f, const char *name); +herr_t H5D_close (H5D_t *dataset); +herr_t H5D_read (H5D_t *dataset, const H5T_t *mem_type, + const H5P_t *mem_space, const H5P_t *file_space, + const H5D_xfer_t *xfer_parms, void *buf/*out*/); +herr_t H5D_write (H5D_t *dataset, const H5T_t *mem_type, + const H5P_t *mem_space, const H5P_t *file_space, + const H5D_xfer_t *xfer_parms, const void *buf); +hid_t H5D_find_name (hid_t file_id, group_t UNUSED, const char *name); /* Functions defined in in H5Dconv.c */ -herr_t H5D_convert_buf(void *dst, const void *src, uintn len, uintn size); - +herr_t H5D_convert_buf (void *dst, const void *src, uintn len, uintn size); #endif diff --git a/src/H5Dpublic.h b/src/H5Dpublic.h index 5c6056f..a118725 100644 --- a/src/H5Dpublic.h +++ b/src/H5Dpublic.h @@ -10,12 +10,9 @@ * * ****************************************************************************/ -/* $Id$ */ - /* * This file contains public declarations for the H5D module. */ - #ifndef _H5Dpublic_H #define _H5Dpublic_H @@ -25,30 +22,29 @@ /* Values for the H5D_LAYOUT property */ typedef enum H5D_layout_t { - H5D_LAYOUT_ERROR = -1, + H5D_LAYOUT_ERROR = -1, - H5D_COMPACT = 0, /*raw data is very small */ - H5D_CONTIGUOUS = 1, /*the default */ - H5D_CHUNKED = 2, /*slow and fancy */ + H5D_COMPACT = 0, /*raw data is very small */ + H5D_CONTIGUOUS = 1, /*the default */ + H5D_CHUNKED = 2, /*slow and fancy */ - H5D_NLAYOUTS = 3 /*This one must be last! */ + H5D_NLAYOUTS = 3 /*this one must be last! */ } H5D_layout_t; #ifdef __cplusplus -extern "C" { +extern "C" { #endif - hid_t H5Dcreate(hid_t file_id, const char *name, hid_t type_id, - hid_t space_id, hid_t create_parms_id); - hid_t H5Dopen(hid_t file_id, const char *name); - herr_t H5Dclose(hid_t dataset_id); - herr_t H5Dread(hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id, - hid_t file_space_id, hid_t xfer_parms_id, void *buf /*out */ ); - herr_t H5Dwrite(hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id, +hid_t H5Dcreate (hid_t file_id, const char *name, hid_t type_id, + hid_t space_id, hid_t create_parms_id); +hid_t H5Dopen (hid_t file_id, const char *name); +herr_t H5Dclose (hid_t dataset_id); +herr_t H5Dread (hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id, + hid_t file_space_id, hid_t xfer_parms_id, void *buf/*out*/); +herr_t H5Dwrite (hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t xfer_parms_id, const void *buf); #ifdef __cplusplus } - #endif #endif @@ -133,8 +133,8 @@ H5E_init_interface(void) FUNC_ENTER(H5E_init_interface, FAIL); /* Initialize the atom group for the error stacks */ - if ((ret_value = H5Ainit_group(H5_ERR, H5A_ERRSTACK_HASHSIZE, 0, - (herr_t (*)(void *)) H5E_close)) != FAIL) { + if ((ret_value = H5A_init_group(H5_ERR, H5A_ERRSTACK_HASHSIZE, 0, + (herr_t (*)(void *)) H5E_close)) != FAIL) { ret_value = H5_add_exit(H5E_term_interface); } FUNC_LEAVE(ret_value); @@ -160,7 +160,7 @@ H5E_init_interface(void) static void H5E_term_interface(void) { - H5Adestroy_group(H5_ERR); + H5A_destroy_group(H5_ERR); } /*-------------------------------------------------------------------------- @@ -199,7 +199,7 @@ H5Ecreate(uintn initial_stack_nelmts) new_stack->push = H5E_push; /* Set the default error handler */ /* Get an atom for the error stack */ - if ((ret_value = H5Aregister_atom(H5_ERR, new_stack)) < 0) { + if ((ret_value = H5A_register(H5_ERR, new_stack)) < 0) { HRETURN_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register error stack"); } @@ -227,7 +227,7 @@ H5Eclose(hid_t estack_id) H5ECLEAR; /* check args */ - if (H5_ERR != H5Aatom_group(estack_id)) { + if (H5_ERR != H5A_group(estack_id)) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an error stack"); } /* @@ -295,8 +295,8 @@ H5Epush(hid_t estack_id, H5E_major_t maj_num, H5E_minor_t min_num, * check args, but don't call error functions if ESTACK_ID is the thread * global error handler. */ - if (H5_ERR != H5Aatom_group(estack_id) || - NULL == (estack = H5Aatom_object(estack_id))) { + if (H5_ERR != H5A_group(estack_id) || + NULL == (estack = H5A_object(estack_id))) { HRETURN(FAIL); } if (!function_name || !file_name || !desc) { @@ -342,8 +342,8 @@ H5Eclear(hid_t estack_id) H5ECLEAR; /* check args */ - if (H5_ERR != H5Aatom_group(estack_id) || - NULL == (estack = H5Aatom_object(estack_id))) { + if (H5_ERR != H5A_group(estack_id) || + NULL == (estack = H5A_object(estack_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an error stack"); } if (H5E_clear(estack) < 0) { @@ -384,8 +384,8 @@ H5Eprint(hid_t estack_id, FILE * file) H5ECLEAR; /* check args */ - if (H5_ERR != H5Aatom_group(estack_id) || - NULL == (estack = H5Aatom_object(estack_id))) { + if (H5_ERR != H5A_group(estack_id) || + NULL == (estack = H5A_object(estack_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an error stack"); } if (!file) diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h index 2b0ce4e..77bcab6 100644 --- a/src/H5Eprivate.h +++ b/src/H5Eprivate.h @@ -10,13 +10,12 @@ * * ****************************************************************************/ -/* $Id$ */ - /* * Header file for error values, etc. */ #ifndef _H5Eprivate_H #define _H5Eprivate_H + #include <H5Epublic.h> /* Private headers needed by this file */ @@ -35,14 +34,12 @@ there's a variable called FUNC which holds the function name. Assume that func and file are both stored in static space, or at least be not corrupted in the meanwhile. */ - #define HERROR(maj, min, str) H5Epush (H5E_thrdid_g, maj, min, \ FUNC, __FILE__, __LINE__, str) /* HRETURN_ERROR macro, used to facilitate error reporting. Makes same assumptions as HERROR. IN ADDITION, this macro causes a return from the calling routine */ - #define HRETURN_ERROR(maj, min, ret_val, str) { \ HERROR (maj, min, str); \ PABLO_TRACE_OFF (PABLO_MASK, pablo_func_id); \ @@ -50,7 +47,6 @@ } /* HRETURN macro, similar to HRETURN_ERROR() except for success */ - #define HRETURN(ret_val) { \ PABLO_TRACE_OFF (PABLO_MASK, pablo_func_id); \ return (ret_val); \ @@ -60,48 +56,45 @@ same assumptions as HERROR. IN ADDITION, this macro causes a jump to the label 'done' which should be in every fucntion Also there is an assumption of a variable 'ret_value' */ - #define HGOTO_ERROR(maj, min, ret_val, str) { \ HERROR (maj, min, str); \ ret_value = ret_val; \ goto done; \ } -/* HGOTO_DONE macro, used to facilitate the new error reporting model. +/* HGOTO_DONE macro, used to facilitate the new error reporting model. This macro is just a wrapper to set the return value and jump to the 'done' label. Also assumption of a variable 'ret_value' */ - #define HGOTO_DONE(ret_val) {ret_value = ret_val; goto done;} -/* H5ECLEAR macro, used to facilitate the new error reporting model. +/* H5ECLEAR macro, used to facilitate the new error reporting model. This macro is just a wrapper to clear the error stack with the thread error ID */ - #define H5ECLEAR H5Eclear(H5E_thrdid_g) /* Maximum length of function name to push onto error stack */ #define MAX_FUNC_NAME 32 -/* +/* * error_messages is the list of error messages in the system, kept as - * error_code-message pairs. + * error_code-message pairs. */ typedef struct H5E_major_mesg_t { - H5E_major_t error_code; - const char *str; + H5E_major_t error_code; + const char *str; } H5E_major_mesg_t; typedef struct H5E_minor_mesg_t { - H5E_minor_t error_code; - const char *str; + H5E_minor_t error_code; + const char *str; } H5E_minor_mesg_t; /* Function pointer to report errors through */ -struct H5E_t; /*forward decl */ -typedef herr_t (*H5E_push_t) (struct H5E_t *estack, H5E_major_t maj_num, +struct H5E_t; /*forward decl */ +typedef herr_t (*H5E_push_t)(struct H5E_t *estack, H5E_major_t maj_num, H5E_minor_t min_num, const char *function_name, - const char *file_name, intn line, - const char *desc); + const char *file_name, intn line, + const char *desc); /* * We use a stack to hold the errors plus we keep track of the function, file @@ -110,31 +103,30 @@ typedef herr_t (*H5E_push_t) (struct H5E_t *estack, H5E_major_t maj_num /* the structure of the error stack element */ typedef struct H5E_error_t { - H5E_major_t maj_num; /* Major error number */ - H5E_minor_t min_num; /* Minor error number */ - char func_name[MAX_FUNC_NAME]; /* function where error occur */ - const char *file_name; /* file where error occur */ - intn line; /* line in file where error occurs */ - char *desc; /* optional supplied description */ + H5E_major_t maj_num; /*major error number */ + H5E_minor_t min_num; /*minor error number */ + char func_name[MAX_FUNC_NAME]; /*function where error occur */ + const char *file_name; /*file where error occur */ + intn line; /*line in file where error occurs */ + char *desc; /*optional supplied description */ } H5E_error_t; /* Structure to store error information for a thread */ typedef struct H5E_t { - uintn nelmts; /* Num elements allocated in the stack */ - uintn top; /* Index of the next open stack element */ - H5E_error_t *stack; /* Pointer to the error stack */ - H5E_push_t push; /* Func that pushes new error on stack */ + uintn nelmts; /*num elements allocated in the stack */ + uintn top; /*index of the next open stack element */ + H5E_error_t *stack; /*pointer to the error stack */ + H5E_push_t push; /*func that pushes new error on stack */ } H5E_t; /* Private global variables in H5E.c */ -extern hid_t H5E_thrdid_g; /* Thread-specific "global" error-handler ID */ -extern hbool_t install_atexit; /* Whether to install the atexit routine */ - -herr_t H5E_close(H5E_t *estack); -herr_t H5E_clear(H5E_t *estack); -herr_t H5E_print(H5E_t *estack, FILE * file); -herr_t H5E_push(H5E_t *estack, H5E_major_t maj_num, H5E_minor_t min_num, - const char *function_name, const char *file_name, intn line, - const char *desc); - +extern hid_t H5E_thrdid_g; /* Thread-specific "global" error-handler ID */ +extern hbool_t install_atexit; /* Whether to install the atexit routine */ + +herr_t H5E_close (H5E_t *estack); +herr_t H5E_clear (H5E_t *estack); +herr_t H5E_print (H5E_t *estack, FILE * file); +herr_t H5E_push (H5E_t *estack, H5E_major_t maj_num, H5E_minor_t min_num, + const char *function_name, const char *file_name, intn line, + const char *desc); #endif diff --git a/src/H5Epublic.h b/src/H5Epublic.h index 570ac2f..8a4c5b7 100644 --- a/src/H5Epublic.h +++ b/src/H5Epublic.h @@ -10,16 +10,13 @@ * * ****************************************************************************/ -/* $Id$ */ - /* * This file contains public declarations for the H5E module. */ - #ifndef _H5Epublic_H #define _H5Epublic_H -#include <stdio.h> /*FILE arg of H5Eprint() */ +#include <stdio.h> /*FILE arg of H5Eprint() */ /* Public headers needed by this file */ #include <H5public.h> @@ -29,107 +26,106 @@ * Declare an enumerated type which holds all the valid major HDF error codes. */ typedef enum H5E_major_t { - H5E_NONE_MAJOR = 0, /* special zero, no error */ - H5E_ARGS, /* Invalid arguments to routine */ - H5E_RESOURCE, /* Resource unavailable */ + H5E_NONE_MAJOR = 0, /*special zero, no error */ + H5E_ARGS, /*invalid arguments to routine */ + H5E_RESOURCE, /*resource unavailable */ H5E_INTERNAL, /* Internal error (too specific to document - * in detail) + * in detail) */ - H5E_FILE, /* File Accessability */ - H5E_IO, /* Low-level I/O */ - H5E_FUNC, /* Function Entry/Exit */ - H5E_ATOM, /* Object Atom */ - H5E_CACHE, /* Object Cache */ - H5E_BTREE, /* B-Tree Node */ - H5E_SYM, /* Symbol Table */ - H5E_HEAP, /* Heap */ - H5E_OHDR, /* Object Header */ - H5E_DATATYPE, /* Datatype */ - H5E_DATASPACE, /* Dataspace */ - H5E_DATASET, /* Dataset */ - H5E_STORAGE, /* Data storage */ - H5E_TEMPLATE /* Templates */ + H5E_FILE, /*file Accessability */ + H5E_IO, /*Low-level I/O */ + H5E_FUNC, /*function Entry/Exit */ + H5E_ATOM, /*object Atom */ + H5E_CACHE, /*object Cache */ + H5E_BTREE, /*B-Tree Node */ + H5E_SYM, /*symbol Table */ + H5E_HEAP, /*Heap */ + H5E_OHDR, /*object Header */ + H5E_DATATYPE, /*Datatype */ + H5E_DATASPACE, /*Dataspace */ + H5E_DATASET, /*Dataset */ + H5E_STORAGE, /*data storage */ + H5E_TEMPLATE /*Templates */ } H5E_major_t; /* Declare an enumerated type which holds all the valid minor HDF error codes */ typedef enum H5E_minor_t { - H5E_NONE_MINOR = 0, /* special zero, no error */ + H5E_NONE_MINOR = 0, /*special zero, no error */ /* Argument errors */ - H5E_UNINITIALIZED, /* Information is unitialized */ - H5E_UNSUPPORTED, /* Feature is unsupported */ - H5E_BADTYPE, /* Incorrect type found */ - H5E_BADRANGE, /* Argument out of range */ - H5E_BADVALUE, /* Bad value for argument */ + H5E_UNINITIALIZED, /*information is unitialized */ + H5E_UNSUPPORTED, /*feature is unsupported */ + H5E_BADTYPE, /*incorrect type found */ + H5E_BADRANGE, /*argument out of range */ + H5E_BADVALUE, /*bad value for argument */ /* Resource errors */ - H5E_NOSPACE, /* No space available for allocation */ + H5E_NOSPACE, /*no space available for allocation */ /* File accessability errors */ - H5E_FILEEXISTS, /* File already exists */ - H5E_FILEOPEN, /* File already open */ - H5E_CANTCREATE, /* Can't create file */ - H5E_CANTOPENFILE, /* Can't open file */ - H5E_NOTHDF5, /* Not an HDF5 format file */ - H5E_BADFILE, /* Bad file ID accessed */ - H5E_TRUNCATED, /* File has been truncated */ + H5E_FILEEXISTS, /*file already exists */ + H5E_FILEOPEN, /*file already open */ + H5E_CANTCREATE, /*Can't create file */ + H5E_CANTOPENFILE, /*Can't open file */ + H5E_NOTHDF5, /*not an HDF5 format file */ + H5E_BADFILE, /*bad file ID accessed */ + H5E_TRUNCATED, /*file has been truncated */ /* Generic low-level file I/O errors */ - H5E_SEEKERROR, /* Seek failed */ - H5E_READERROR, /* Read failed */ - H5E_WRITEERROR, /* Write failed */ - H5E_CLOSEERROR, /* Close failed */ + H5E_SEEKERROR, /*seek failed */ + H5E_READERROR, /*read failed */ + H5E_WRITEERROR, /*write failed */ + H5E_CLOSEERROR, /*close failed */ /* Function entry/exit interface errors */ - H5E_CANTINIT, /* Can't initialize interface */ - H5E_ALREADYINIT, /* Object already initialized */ + H5E_CANTINIT, /*Can't initialize interface */ + H5E_ALREADYINIT, /*object already initialized */ /* Object atom related errors */ - H5E_BADATOM, /* Can't find atom information */ - H5E_CANTREGISTER, /* Can't register new atom */ + H5E_BADATOM, /*Can't find atom information */ + H5E_CANTREGISTER, /*Can't register new atom */ /* Cache related errors */ - H5E_CANTFLUSH, /* Can't flush object from cache */ - H5E_CANTLOAD, /* Can't load object into cache */ - H5E_PROTECT, /* Protected object error */ - H5E_NOTCACHED, /* Object not currently cached */ + H5E_CANTFLUSH, /*Can't flush object from cache */ + H5E_CANTLOAD, /*Can't load object into cache */ + H5E_PROTECT, /*protected object error */ + H5E_NOTCACHED, /*object not currently cached */ /* B-tree related errors */ - H5E_NOTFOUND, /* Object not found */ - H5E_EXISTS, /* Object already exists */ - H5E_CANTENCODE, /* Can't encode value */ - H5E_CANTDECODE, /* Can't decode value */ - H5E_CANTSPLIT, /* Can't split node */ - H5E_CANTINSERT, /* Can't insert object */ - H5E_CANTLIST, /* Can't list node */ + H5E_NOTFOUND, /*object not found */ + H5E_EXISTS, /*object already exists */ + H5E_CANTENCODE, /*Can't encode value */ + H5E_CANTDECODE, /*Can't decode value */ + H5E_CANTSPLIT, /*Can't split node */ + H5E_CANTINSERT, /*Can't insert object */ + H5E_CANTLIST, /*Can't list node */ /* Object header related errors */ - H5E_LINKCOUNT, /* Bad object header link count */ - H5E_VERSION, /* Wrong version number */ - H5E_ALIGNMENT, /* Alignment error */ - H5E_BADMESG, /* Unrecognized message */ + H5E_LINKCOUNT, /*bad object header link count */ + H5E_VERSION, /*wrong version number */ + H5E_ALIGNMENT, /*alignment error */ + H5E_BADMESG, /*unrecognized message */ /* Group related errors */ - H5E_CANTOPENOBJ, /* Can't open object */ - H5E_COMPLEN, /* Name component is too long */ - H5E_CWG, /* Problem with current working group */ - H5E_LINK /* Link count failure */ + H5E_CANTOPENOBJ, /*Can't open object */ + H5E_COMPLEN, /*name component is too long */ + H5E_CWG, /*problem with current working group */ + H5E_LINK /*link count failure */ } H5E_minor_t; #ifdef __cplusplus -extern "C" { +extern "C" { #endif - hid_t H5Ecreate(uintn initial_stack_nelmts); - herr_t H5Eclose(hid_t estack_id); - herr_t H5Epush(hid_t estack_id, H5E_major_t maj_num, H5E_minor_t min_num, +hid_t H5Ecreate (uintn initial_stack_nelmts); +herr_t H5Eclose (hid_t estack_id); +herr_t H5Epush (hid_t estack_id, H5E_major_t maj_num, H5E_minor_t min_num, const char *function_name, const char *file_name, intn line, - const char *desc); - herr_t H5Eclear(hid_t estack_id); - herr_t H5Eprint(hid_t estack_id, FILE * file); + const char *desc); +herr_t H5Eclear (hid_t estack_id); +herr_t H5Eprint (hid_t estack_id, FILE * file); #ifdef __cplusplus } - #endif #endif @@ -125,7 +125,7 @@ H5F_init_interface(void) FUNC_ENTER(H5F_init_interface, FAIL); /* Initialize the atom group for the file IDs */ - if ((ret_value = H5Ainit_group(H5_FILE, H5A_FILEID_HASHSIZE, 0, NULL)) != FAIL) + if ((ret_value = H5A_init_group(H5_FILE, H5A_FILEID_HASHSIZE, 0, NULL)) != FAIL) ret_value = H5_add_exit(&H5F_term_interface); FUNC_LEAVE(ret_value); @@ -151,7 +151,7 @@ H5F_init_interface(void) static void H5F_term_interface(void) { - H5Adestroy_group(H5_FILE); + H5A_destroy_group(H5_FILE); } /*-------------------------------------------------------------------------- @@ -232,10 +232,10 @@ H5Fget_create_template(hid_t fid) H5ECLEAR; /* check args */ - if (H5_FILE != H5Aatom_group(fid)) { + if (H5_FILE != H5A_group(fid)) { HRETURN_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "not a file"); } - if (NULL == (file = H5Aatom_object(fid))) { + if (NULL == (file = H5A_object(fid))) { HRETURN_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't get file struct"); } /* Create the template object to return */ @@ -657,7 +657,7 @@ H5F_open(const H5F_low_class_t *type, const char *name, uintn flags, HRETURN_ERROR(H5E_FILE, H5E_WRITEERROR, NULL, "file is not writable"); } - if ((old = H5Asearch_atom(H5_FILE, H5F_compare_files, &search))) { + if ((old = H5A_search(H5_FILE, H5F_compare_files, &search))) { if (flags & H5F_ACC_TRUNC) { HRETURN_ERROR(H5E_FILE, H5E_FILEOPEN, NULL, "file already open - TRUNC failed"); @@ -994,13 +994,13 @@ H5Fcreate(const char *filename, uintn flags, hid_t create_temp, if (create_temp <= 0) { create_parms = &H5F_create_dflt; - } else if (NULL == (create_parms = H5Aatom_object(create_temp))) { + } else if (NULL == (create_parms = H5A_object(create_temp))) { HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't unatomize template"); } #ifdef LATER if (access_temp <= 0) { access_parms = &H5F_access_dflt; - } else if (NULL == (access_parms = H5Aatom_object(access_temp))) { + } else if (NULL == (access_parms = H5A_object(access_temp))) { HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL); /*can't unatomize template */ } #endif @@ -1013,7 +1013,7 @@ H5Fcreate(const char *filename, uintn flags, hid_t create_temp, HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "can't create file"); } /* Get an atom for the file */ - if ((ret_value = H5Aregister_atom(H5_FILE, new_file)) < 0) + if ((ret_value = H5A_register(H5_FILE, new_file)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "can't atomize file"); done: @@ -1084,7 +1084,7 @@ H5Fopen(const char *filename, uintn flags, hid_t access_temp) #ifdef LATER if (access_temp <= 0) access_temp = H5CPget_default_atom(H5_TEMPLATE); - if (NULL == (f_access_parms = H5Aatom_object(access_temp))) + if (NULL == (f_access_parms = H5A_object(access_temp))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL); /*can't unatomize template */ #endif @@ -1093,7 +1093,7 @@ H5Fopen(const char *filename, uintn flags, hid_t access_temp) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "cant open file"); } /* Get an atom for the file */ - if ((ret_value = H5Aregister_atom(H5_FILE, new_file)) < 0) + if ((ret_value = H5A_register(H5_FILE, new_file)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "can't atomize file"); done: @@ -1289,16 +1289,16 @@ H5Fclose(hid_t fid) H5ECLEAR; /* Check/fix arguments. */ - if (H5_FILE != H5Aatom_group(fid)) + if (H5_FILE != H5A_group(fid)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file atom"); - if (NULL == (file = H5Aatom_object(fid))) + if (NULL == (file = H5A_object(fid))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't unatomize file"); /* Close the file */ ret_value = H5F_close(file); /* Remove the file atom */ - if (NULL == H5Aremove_atom(fid)) { + if (NULL == H5A_remove(fid)) { HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't remove atom"); } done: diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index 1ed15a7..885277d 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -10,12 +10,9 @@ * * ****************************************************************************/ -/* $Id$ */ - /* * This file contains public declarations for the H5F module. */ - #ifndef _H5Fpublic_H #define _H5Fpublic_H @@ -24,23 +21,23 @@ #include <H5Apublic.h> /* file access codes */ -#define H5ACC_DEFAULT 0x0000 /* Use in H5Fopen & H5Fcreate to open a file with default access */ -#define H5ACC_WRITE 0x0001 /* Use in H5Fopen to open a file with write access */ -#define H5ACC_OVERWRITE 0x0002 /* Use in H5Fcreate truncate an existing file */ +#define H5ACC_DEFAULT 0x0000/*use in H5Fopen & H5Fcreate to open a file with default access*/ +#define H5ACC_WRITE 0x0001/*use in H5Fopen to open a file with write access*/ +#define H5ACC_OVERWRITE 0x0002/*use in H5Fcreate truncate an existing file*/ #ifdef __cplusplus -extern "C" { +extern "C" { #endif /* Functions in H5F.c */ - hbool_t H5Fis_hdf5(const char *filename); - hid_t H5Fcreate(const char *filename, uintn flags, hid_t create_template, hid_t access_template); - hid_t H5Fopen(const char *filename, uintn flags, hid_t access_template); - herr_t H5Fclose(hid_t fid); - hid_t H5Fget_create_template(hid_t fid); +hbool_t H5Fis_hdf5 (const char *filename); +hid_t H5Fcreate (const char *filename, uintn flags, hid_t create_template, + hid_t access_template); +hid_t H5Fopen (const char *filename, uintn flags, hid_t access_template); +herr_t H5Fclose (hid_t fid); +hid_t H5Fget_create_template (hid_t fid); #ifdef __cplusplus } - #endif #endif @@ -95,8 +95,8 @@ H5Gcreate(hid_t file_id, const char *name, size_t size_hint) H5ECLEAR; /* Check arguments */ - if (H5_FILE != H5Aatom_group(file_id) || - NULL == (f = H5Aatom_object(file_id))) { + if (H5_FILE != H5A_group(file_id) || + NULL == (f = H5A_object(file_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file"); } if (!name || !*name) { @@ -106,7 +106,7 @@ H5Gcreate(hid_t file_id, const char *name, size_t size_hint) if (NULL == (grp = H5G_create(f, name, size_hint))) { HRETURN_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group"); } - if ((ret_value = H5Aregister_atom(H5_GROUP, grp)) < 0) { + if ((ret_value = H5A_register(H5_GROUP, grp)) < 0) { H5G_close(grp); HRETURN_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group"); @@ -144,8 +144,8 @@ H5Gopen(hid_t file_id, const char *name) H5ECLEAR; /* Check args */ - if (H5_FILE != H5Aatom_group(file_id) || - NULL == (f = H5Aatom_object(file_id))) { + if (H5_FILE != H5A_group(file_id) || + NULL == (f = H5A_object(file_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file"); } if (!name || !*name) { @@ -156,7 +156,7 @@ H5Gopen(hid_t file_id, const char *name) HRETURN_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group"); } /* Register an atom for the group */ - if ((ret_value = H5Aregister_atom(H5_GROUP, grp)) < 0) { + if ((ret_value = H5A_register(H5_GROUP, grp)) < 0) { H5G_close(grp); HRETURN_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group"); @@ -190,8 +190,8 @@ H5Gclose(hid_t grp_id) H5ECLEAR; /* Check args */ - if (H5_GROUP != H5Aatom_group(grp_id) || - NULL == (grp = H5Aatom_object(grp_id))) { + if (H5_GROUP != H5A_group(grp_id) || + NULL == (grp = H5A_object(grp_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group"); } /* @@ -241,8 +241,8 @@ H5Gset(hid_t file_id, const char *name) H5ECLEAR; /* Check/fix arguments */ - if (H5_FILE != H5Aatom_group(file_id) || - NULL == (f = H5Aatom_object(file_id))) { + if (H5_FILE != H5A_group(file_id) || + NULL == (f = H5A_object(file_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file"); } if (!name || !*name) { @@ -300,8 +300,8 @@ H5Gpush(hid_t file_id, const char *name) H5ECLEAR; /* Check arguments */ - if (H5_FILE != H5Aatom_group(file_id) || - NULL == (f = H5Aatom_object(file_id))) { + if (H5_FILE != H5A_group(file_id) || + NULL == (f = H5A_object(file_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file"); } if (!name || !*name) { @@ -360,8 +360,8 @@ H5Gpop(hid_t file_id) H5ECLEAR; /* Check arguments */ - if (H5_FILE != H5Aatom_group(file_id) || - NULL == (f = H5Aatom_object(file_id))) { + if (H5_FILE != H5A_group(file_id) || + NULL == (f = H5A_object(file_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file"); } /* pop */ @@ -402,8 +402,8 @@ H5G_init_interface(void) FUNC_ENTER(H5G_init_interface, FAIL); /* Initialize the atom group for the group IDs */ - if (H5Ainit_group(H5_GROUP, H5A_GROUPID_HASHSIZE, H5G_RESERVED_ATOMS, - (herr_t (*)(void *)) H5G_close) < 0 || + if (H5A_init_group(H5_GROUP, H5A_GROUPID_HASHSIZE, H5G_RESERVED_ATOMS, + (herr_t (*)(void *)) H5G_close) < 0 || H5_add_exit(H5G_term_interface) < 0) { HRETURN_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to initialize interface"); @@ -428,7 +428,7 @@ H5G_init_interface(void) static void H5G_term_interface(void) { - H5Adestroy_group(H5_GROUP); + H5A_destroy_group(H5_GROUP); } /*------------------------------------------------------------------------- diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h index b1aaed1..cd59aef 100644 --- a/src/H5Gpkg.h +++ b/src/H5Gpkg.h @@ -19,10 +19,11 @@ #include <H5ACprivate.h> #include <H5Gprivate.h> -#define H5G_NODE_VERS 1 /*symbol table node version number */ -#define H5G_SIZE_HINT 1024 /*default root grp size hint */ +#define H5G_NODE_VERS 1 /*symbol table node version number */ +#define H5G_SIZE_HINT 1024 /*default root grp size hint */ #define H5G_NODE_K(F) ((F)->shared->create_parms.sym_leaf_k) #define H5G_NODE_SIZEOF_HDR(F) (H5G_NODE_SIZEOF_MAGIC + 4) + #define H5G_DEFAULT_ROOT_SIZE 32 /* @@ -32,9 +33,9 @@ * table or group. */ typedef struct H5G_node_t { - hbool_t dirty; /*has cache been modified? */ - int nsyms; /*number of symbols */ - H5G_entry_t *entry; /*array of symbol table entries */ + hbool_t dirty; /*has cache been modified? */ + int nsyms; /*number of symbols */ + H5G_entry_t *entry; /*array of symbol table entries */ } H5G_node_t; /* @@ -42,7 +43,7 @@ typedef struct H5G_node_t { * nodes consists of this structure... */ typedef struct H5G_node_key_t { - size_t offset; /*offset into heap for name */ + size_t offset; /*offset into heap for name */ } H5G_node_key_t; /* @@ -50,8 +51,8 @@ typedef struct H5G_node_key_t { * above the H5G layer. */ struct H5G_t { - int nref; /*open reference count */ - H5G_entry_t ent; /*info about the group */ + int nref; /*open reference count */ + H5G_entry_t ent; /*info about the group */ }; /* @@ -60,8 +61,8 @@ struct H5G_t { * current working group is the root object. */ typedef struct H5G_cwgstk_t { - H5G_t *grp; /*a handle to an open group */ - struct H5G_cwgstk_t *next; /*next item (earlier) on stack */ + H5G_t *grp; /*a handle to an open group */ + struct H5G_cwgstk_t *next; /*next item (earlier) on stack */ } H5G_cwgstk_t; /* @@ -69,8 +70,8 @@ typedef struct H5G_cwgstk_t { * H5G_node layer through the B-tree layer. */ typedef enum H5G_oper_t { - H5G_OPER_FIND = 0, /*find a symbol */ - H5G_OPER_INSERT = 1 /*insert a new symbol */ + H5G_OPER_FIND = 0, /*find a symbol */ + H5G_OPER_INSERT = 1 /*insert a new symbol */ } H5G_oper_t; /* @@ -81,12 +82,12 @@ typedef enum H5G_oper_t { typedef struct H5G_bt_ud1_t { /* downward */ - H5G_oper_t operation; /*what operation to perform */ - const char *name; /*points to temporary memory */ - haddr_t heap_addr; /*symbol table heap address */ + H5G_oper_t operation; /*what operation to perform */ + const char *name; /*points to temporary memory */ + haddr_t heap_addr; /*symbol table heap address */ /* downward for INSERT, upward for FIND */ - H5G_entry_t ent; /*entry to insert into table */ + H5G_entry_t ent; /*entry to insert into table */ } H5G_bt_ud1_t; @@ -97,20 +98,20 @@ typedef struct H5G_bt_ud1_t { typedef struct H5G_bt_ud2_t { /* downward */ - H5G_entry_t *entry; /*array of entries, alloc'd by caller */ - char **name; /*array of string ptrs, allocd by caller */ - intn maxentries; /*size of the ADDR and NAME arrays */ - haddr_t heap_addr; /*heap address */ + H5G_entry_t *entry; /*array of entries, alloc'd by caller */ + char **name; /*array of string ptrs, allocd by caller */ + intn maxentries; /*size of the ADDR and NAME arrays */ + haddr_t heap_addr; /*heap address */ /* upward */ - intn nsyms; /*num. symbols processed */ + intn nsyms; /*num. symbols processed */ } H5G_bt_ud2_t; /* * This is the class identifier to give to the B-tree functions. */ -extern H5B_class_t H5B_SNODE[1]; +extern H5B_class_t H5B_SNODE[1]; /* The cache subclass */ extern const H5AC_class_t H5AC_SNODE[1]; @@ -120,19 +121,18 @@ extern const H5AC_class_t H5AC_SNODE[1]; * functions that understand names are exported to the rest of * the library and appear in H5Gprivate.h. */ -herr_t H5G_stab_create(H5F_t *f, size_t size_hint, H5G_entry_t *ent /*out */ ); -herr_t H5G_stab_find(H5G_entry_t *grp_ent, const char *name, - H5G_entry_t *obj_ent /*out */ ); -herr_t H5G_stab_insert(H5G_entry_t *grp_ent, const char *name, - H5G_entry_t *obj_ent); -intn H5G_stab_list(H5G_entry_t *self, intn maxentries, - char *names[] /*out */ , H5G_entry_t entries[] /*out */ ); +herr_t H5G_stab_create (H5F_t *f, size_t size_hint, H5G_entry_t *ent/*out*/); +herr_t H5G_stab_find (H5G_entry_t *grp_ent, const char *name, + H5G_entry_t *obj_ent/*out*/); +herr_t H5G_stab_insert (H5G_entry_t *grp_ent, const char *name, + H5G_entry_t *obj_ent); +intn H5G_stab_list (H5G_entry_t *self, intn maxentries, char *names[]/*out*/, + H5G_entry_t entries[]/*out*/); /* * Functions that understand symbol table entries. */ -herr_t H5G_ent_decode_vec(H5F_t *f, const uint8 **pp, H5G_entry_t *ent, - intn n); -herr_t H5G_ent_encode_vec(H5F_t *f, uint8 **pp, H5G_entry_t *ent, intn n); - +herr_t H5G_ent_decode_vec (H5F_t *f, const uint8 **pp, H5G_entry_t *ent, + intn n); +herr_t H5G_ent_encode_vec (H5F_t *f, uint8 **pp, H5G_entry_t *ent, intn n); #endif diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h index da07587..425d8a5 100644 --- a/src/H5Gprivate.h +++ b/src/H5Gprivate.h @@ -10,12 +10,13 @@ * * Purpose: Library-visible declarations. * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ #ifndef _H5Gprivate_H #define _H5Gprivate_H + #include <H5Gpublic.h> /* Private headers needed by this file */ @@ -29,10 +30,9 @@ #ifdef NDEBUG # undef H5G_DEBUG #endif - -#define H5G_NODE_MAGIC "SNOD" /*symbol table node magic number */ -#define H5G_NODE_SIZEOF_MAGIC 4 /*sizeof symbol node magic number */ -#define H5G_NO_CHANGE (-1) /*see H5G_ent_modified() */ +#define H5G_NODE_MAGIC "SNOD" /*symbol table node magic number */ +#define H5G_NODE_SIZEOF_MAGIC 4 /*sizeof symbol node magic number */ +#define H5G_NO_CHANGE (-1) /*see H5G_ent_modified() */ /* * The disk size for a symbol table entry... @@ -51,10 +51,10 @@ * symbol table entry. */ typedef enum H5G_type_t { - H5G_NOTHING_CACHED = 0, /*nothing is cached, must be 0 */ - H5G_CACHED_STAB = 1, /*symbol table, `stab' */ + H5G_NOTHING_CACHED = 0, /*nothing is cached, must be 0 */ + H5G_CACHED_STAB = 1, /*symbol table, `stab' */ - H5G_NCACHED = 2 /*THIS MUST BE LAST */ + H5G_NCACHED = 2 /*THIS MUST BE LAST */ } H5G_type_t; /* @@ -66,8 +66,8 @@ typedef enum H5G_type_t { */ typedef union H5G_cache_t { struct { - haddr_t btree_addr; /*file address of symbol table B-tree */ - haddr_t heap_addr; /*file address of stab name heap */ + haddr_t btree_addr; /*file address of symbol table B-tree*/ + haddr_t heap_addr; /*file address of stab name heap */ } stab; } H5G_cache_t; @@ -78,49 +78,47 @@ typedef union H5G_cache_t { * points. */ typedef struct H5G_entry_t { - hbool_t dirty; /*entry out-of-date? */ - size_t name_off; /*offset of name within name heap */ - haddr_t header; /*file address of object header */ - H5G_type_t type; /*type of information cached */ - H5G_cache_t cache; /*cached data from object header */ - H5F_t *file; /*file to which this obj hdr belongs */ + hbool_t dirty; /*entry out-of-date? */ + size_t name_off; /*offset of name within name heap */ + haddr_t header; /*file address of object header */ + H5G_type_t type; /*type of information cached */ + H5G_cache_t cache; /*cached data from object header */ + H5F_t *file; /*file to which this obj hdr belongs */ } H5G_entry_t; - typedef struct H5G_t H5G_t; /* * Library prototypes... These are the ones that other packages routinely * call. */ -H5G_t *H5G_create(H5F_t *f, const char *name, size_t size_hint); -H5G_t *H5G_open(H5F_t *f, const char *name); -H5G_t *H5G_reopen(H5G_t *grp); -herr_t H5G_close(H5G_t *grp); -herr_t H5G_set(H5F_t *f, H5G_t *grp); -herr_t H5G_push(H5F_t *f, H5G_t *grp); -herr_t H5G_pop(H5F_t *f); -herr_t H5G_insert(const char *name, H5G_entry_t *ent); -herr_t H5G_find(H5F_t *f, const char *name, H5G_entry_t *grp_ent /*out */ , - H5G_entry_t *ent /*out */ ); -herr_t H5G_ent_encode(H5F_t *f, uint8 **pp, H5G_entry_t *ent); -herr_t H5G_ent_decode(H5F_t *f, const uint8 **pp, H5G_entry_t *ent /*out */ ); +H5G_t *H5G_create (H5F_t *f, const char *name, size_t size_hint); +H5G_t *H5G_open (H5F_t *f, const char *name); +H5G_t *H5G_reopen (H5G_t *grp); +herr_t H5G_close (H5G_t *grp); +herr_t H5G_set (H5F_t *f, H5G_t *grp); +herr_t H5G_push (H5F_t *f, H5G_t *grp); +herr_t H5G_pop (H5F_t *f); +herr_t H5G_insert (const char *name, H5G_entry_t *ent); +herr_t H5G_find (H5F_t *f, const char *name, H5G_entry_t *grp_ent/*out*/, + H5G_entry_t *ent/*out*/); +herr_t H5G_ent_encode (H5F_t *f, uint8 **pp, H5G_entry_t *ent); +herr_t H5G_ent_decode (H5F_t *f, const uint8 **pp, H5G_entry_t *ent/*out*/); /* * These functions operate on symbol table nodes. */ -herr_t H5G_node_debug(H5F_t *f, const haddr_t *addr, FILE * stream, - intn indent, intn fwidth, const haddr_t *heap); +herr_t H5G_node_debug (H5F_t *f, const haddr_t *addr, FILE * stream, + intn indent, intn fwidth, const haddr_t *heap); /* * These functions operate on symbol table entries. They're used primarily * in the H5O package where header messages are cached in symbol table * entries. The subclasses of H5O probably don't need them though. */ -H5G_entry_t *H5G_ent_calloc(H5G_entry_t *init); -H5G_cache_t *H5G_ent_cache(H5G_entry_t *ent, H5G_type_t *cache_type); -herr_t H5G_ent_modified(H5G_entry_t *ent, H5G_type_t cache_type); -herr_t H5G_ent_debug(H5F_t *f, H5G_entry_t *ent, FILE * stream, - intn indent, intn fwidth); - +H5G_entry_t *H5G_ent_calloc (H5G_entry_t *init); +H5G_cache_t *H5G_ent_cache (H5G_entry_t *ent, H5G_type_t *cache_type); +herr_t H5G_ent_modified (H5G_entry_t *ent, H5G_type_t cache_type); +herr_t H5G_ent_debug (H5F_t *f, H5G_entry_t *ent, FILE * stream, intn indent, + intn fwidth); #endif diff --git a/src/H5Gpublic.h b/src/H5Gpublic.h index f10f33e..3ca5cd4 100644 --- a/src/H5Gpublic.h +++ b/src/H5Gpublic.h @@ -11,7 +11,7 @@ * Purpose: Public declarations for the H5G package (symbol * tables). * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ @@ -24,19 +24,17 @@ #include <H5Apublic.h> #ifdef __cplusplus -extern "C" { +extern "C" { #endif - hid_t H5Gcreate(hid_t file_id, const char *name, size_t size_hint); - hid_t H5Gopen(hid_t file_id, const char *name); - herr_t H5Gclose(hid_t grp_id); - - herr_t H5Gset(hid_t file, const char *name); - herr_t H5Gpush(hid_t file, const char *name); - herr_t H5Gpop(hid_t file); +hid_t H5Gcreate (hid_t file_id, const char *name, size_t size_hint); +hid_t H5Gopen (hid_t file_id, const char *name); +herr_t H5Gclose (hid_t grp_id); +herr_t H5Gset (hid_t file, const char *name); +herr_t H5Gpush (hid_t file, const char *name); +herr_t H5Gpop (hid_t file); #ifdef __cplusplus } - #endif #endif diff --git a/src/H5Hprivate.h b/src/H5Hprivate.h index 9a6b4d6..aef6e48 100644 --- a/src/H5Hprivate.h +++ b/src/H5Hprivate.h @@ -8,21 +8,22 @@ * Jul 16 1997 * Robb Matzke <matzke@llnl.gov> * - * Purpose: + * Purpose: * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ #ifndef _H5Hprivate_H #define _H5Hprivate_H + #include <H5Hpublic.h> /* Private headers needed by this file. */ #include <H5private.h> #include <H5Fprivate.h> -#define H5H_MAGIC "HEAP" /*heap magic number */ +#define H5H_MAGIC "HEAP" /*heap magic number */ #define H5H_SIZEOF_MAGIC 4 #define H5H_SIZEOF_HDR(F) \ @@ -36,24 +37,23 @@ H5F_SIZEOF_SIZE (F)) /*size of this free block */ typedef enum H5H_type_t { - H5H_LOCAL = 0, /*local symtab name heap */ - H5H_GLOBAL = 1 /*global small object heap */ + H5H_LOCAL = 0, /*local symtab name heap */ + H5H_GLOBAL = 1 /*global small object heap */ } H5H_type_t; /* * Library prototypes... */ -herr_t H5H_create(H5F_t *f, H5H_type_t type, size_t size_hint, - haddr_t *addr /*out */ ); -void *H5H_read(H5F_t *f, const haddr_t *addr, size_t offset, size_t size, - void *buf); -const void *H5H_peek(H5F_t *f, const haddr_t *addr, size_t offset); -size_t H5H_insert(H5F_t *f, const haddr_t *addr, size_t size, - const void *buf); -herr_t H5H_write(H5F_t *f, const haddr_t *addr, size_t offset, size_t size, - const void *buf); -herr_t H5H_remove(H5F_t *f, const haddr_t *addr, size_t offset, size_t size); -herr_t H5H_debug(H5F_t *f, const haddr_t *addr, FILE * stream, intn indent, - intn fwidth); - +herr_t H5H_create (H5F_t *f, H5H_type_t type, size_t size_hint, + haddr_t *addr/*out*/); +void *H5H_read (H5F_t *f, const haddr_t *addr, size_t offset, size_t size, + void *buf); +const void *H5H_peek (H5F_t *f, const haddr_t *addr, size_t offset); +size_t H5H_insert (H5F_t *f, const haddr_t *addr, size_t size, + const void *buf); +herr_t H5H_write (H5F_t *f, const haddr_t *addr, size_t offset, size_t size, + const void *buf); +herr_t H5H_remove (H5F_t *f, const haddr_t *addr, size_t offset, size_t size); +herr_t H5H_debug (H5F_t *f, const haddr_t *addr, FILE * stream, intn indent, + intn fwidth); #endif diff --git a/src/H5Hpublic.h b/src/H5Hpublic.h index f5f65f2..82c85e0 100644 --- a/src/H5Hpublic.h +++ b/src/H5Hpublic.h @@ -10,7 +10,7 @@ * * Purpose: Public declarations for the H5H (heap) package. * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ @@ -21,11 +21,10 @@ #include <H5public.h> #ifdef __cplusplus -extern "C" { +extern "C" { #endif #ifdef __cplusplus } - #endif #endif @@ -44,6 +44,7 @@ static char RcsId[] = "@(#)$Revision$"; + */ #include <H5private.h> /* Generic functions */ +#include <H5Aprivate.h> /* Atom interface */ #include <H5Cprivate.h> /* Template interface */ #include <H5Dprivate.h> /* Dataset interface */ #include <H5Eprivate.h> /*error handling */ @@ -224,7 +225,7 @@ H5Maccess(hid_t oid) FUNC_ENTER(H5Maccess, FAIL); /* Atom group for incoming object */ - group = H5Aatom_group(oid); + group = H5A_group(oid); /* Clear errors and check args and all the boring stuff. */ H5ECLEAR; @@ -262,7 +263,7 @@ H5Maccess(hid_t oid) hid_t H5Mcopy(hid_t oid) { - group_t group = H5Aatom_group(oid); /* Atom group for incoming object */ + group_t group = H5A_group(oid); /* Atom group for incoming object */ intn i; /* local counting variable */ herr_t ret_value = SUCCEED; @@ -306,7 +307,7 @@ hid_t H5Mfind_name(hid_t owner_id, group_t type, const char *name) { #ifdef OLD_WAY - group_t group = H5Aatom_group(owner_id); /* Atom group for incoming object */ + group_t group = H5A_group(owner_id); /* Atom group for incoming object */ #endif /* OLD_WAY */ intn i; /* local counting variable */ hid_t ret_value = SUCCEED; @@ -355,7 +356,7 @@ H5Mfind_name(hid_t owner_id, group_t type, const char *name) uint32 H5Mname_len(hid_t oid) { - group_t group = H5Aatom_group(oid); /* Atom group for incoming object */ + group_t group = H5A_group(oid); /* Atom group for incoming object */ intn i; /* local counting variable */ herr_t ret_value = SUCCEED; @@ -397,7 +398,7 @@ H5Mname_len(hid_t oid) herr_t H5Mget_name(hid_t oid, char *name) { - group_t group = H5Aatom_group(oid); /* Atom group for incoming object */ + group_t group = H5A_group(oid); /* Atom group for incoming object */ intn i; /* local counting variable */ hid_t ret_value = SUCCEED; @@ -440,7 +441,7 @@ H5Mget_name(hid_t oid, char *name) herr_t H5Mset_name(hid_t oid, const char *name) { - group_t group = H5Aatom_group(oid); /* Atom group for incoming object */ + group_t group = H5A_group(oid); /* Atom group for incoming object */ intn i; /* local counting variable */ hid_t ret_value = SUCCEED; @@ -484,7 +485,7 @@ H5Mset_name(hid_t oid, const char *name) hid_t H5Msearch(hid_t oid, group_t type, const char *name) { - group_t group = H5Aatom_group(oid); /* Atom group for incoming object */ + group_t group = H5A_group(oid); /* Atom group for incoming object */ intn i; /* local counting variable */ hid_t ret_value = SUCCEED; @@ -527,7 +528,7 @@ H5Msearch(hid_t oid, group_t type, const char *name) hid_t H5Mindex(hid_t oid, group_t type, uint32 idx) { - group_t group = H5Aatom_group(oid); /* Atom group for incoming object */ + group_t group = H5A_group(oid); /* Atom group for incoming object */ intn i; /* local counting variable */ hid_t ret_value = SUCCEED; @@ -576,7 +577,7 @@ H5Mflush(hid_t oid) /* Clear errors and check args and all the boring stuff. */ H5ECLEAR; - group = H5Aatom_group(oid); /* look up group for incoming object */ + group = H5A_group(oid); /* look up group for incoming object */ if (group <= BADGROUP || group >= MAXGROUP) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "bad group"); @@ -612,7 +613,7 @@ H5Mflush(hid_t oid) herr_t H5Mdelete(hid_t oid) { - group_t group = H5Aatom_group(oid); /* Atom group for incoming object */ + group_t group = H5A_group(oid); /* Atom group for incoming object */ intn i; /* local counting variable */ herr_t ret_value = SUCCEED; @@ -653,7 +654,7 @@ H5Mdelete(hid_t oid) hid_t H5Mget_parent(hid_t oid) { - group_t group = H5Aatom_group(oid); /* Atom group for incoming object */ + group_t group = H5A_group(oid); /* Atom group for incoming object */ intn i; /* local counting variable */ herr_t ret_value = SUCCEED; @@ -695,7 +696,7 @@ H5Mget_parent(hid_t oid) hid_t H5Mget_file(hid_t oid) { - group_t group = H5Aatom_group(oid); /* Atom group for incoming object */ + group_t group = H5A_group(oid); /* Atom group for incoming object */ intn i; /* local counting variable */ herr_t ret_value = SUCCEED; @@ -737,7 +738,7 @@ H5Mget_file(hid_t oid) herr_t H5Mclose(hid_t oid) { - group_t group = H5Aatom_group(oid); /* Atom group for incoming object */ + group_t group = H5A_group(oid); /* Atom group for incoming object */ intn i; /* local counting variable */ herr_t ret_value = SUCCEED; diff --git a/src/H5MFprivate.h b/src/H5MFprivate.h index d797780..403da90 100644 --- a/src/H5MFprivate.h +++ b/src/H5MFprivate.h @@ -10,25 +10,25 @@ * * Purpose: Private header file for file memory management. * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ #ifndef _H5MFprivate_H #define _H5MFprivate_H + #include <H5MFpublic.h> /* Private headers needed by this file */ #include <H5private.h> #include <H5Fprivate.h> -#define H5MF_META 0 /*request storage for meta data */ -#define H5MF_RAW 1 /*request storage for raw data */ +#define H5MF_META 0 /*request storage for meta data */ +#define H5MF_RAW 1 /*request storage for raw data */ /* * Library prototypes... */ -herr_t H5MF_alloc(H5F_t *f, intn, size_t size, haddr_t *addr /*out */ ); -herr_t H5MF_free(H5F_t *f, const haddr_t *addr, size_t size); - +herr_t H5MF_alloc (H5F_t *f, intn, size_t size, haddr_t *addr/*out*/); +herr_t H5MF_free (H5F_t *f, const haddr_t *addr, size_t size); #endif diff --git a/src/H5MFpublic.h b/src/H5MFpublic.h index 5b59f5f..cb3d51f 100644 --- a/src/H5MFpublic.h +++ b/src/H5MFpublic.h @@ -11,7 +11,7 @@ * Purpose: Public declarations for the H5MF (file memory * management) package. * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ @@ -22,11 +22,10 @@ #include <H5public.h> #ifdef __cplusplus -extern "C" { +extern "C" { #endif #ifdef __cplusplus } - #endif #endif diff --git a/src/H5MMprivate.h b/src/H5MMprivate.h index 5312df8..1b9975c 100644 --- a/src/H5MMprivate.h +++ b/src/H5MMprivate.h @@ -10,12 +10,13 @@ * * Purpose: Private header for memory management. * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ #ifndef _H5MMprivate_H #define _H5MMprivate_h + #include <H5MMpublic.h> /* Private headers needed by this file */ @@ -24,10 +25,9 @@ /* * Library prototypes... */ -void *H5MM_xmalloc(size_t size); -void *H5MM_xcalloc(size_t n, size_t size); -void *H5MM_xrealloc(void *mem, size_t size); -char *H5MM_xstrdup(const char *s); -void *H5MM_xfree(const void *mem); - +void *H5MM_xmalloc (size_t size); +void *H5MM_xcalloc (size_t n, size_t size); +void *H5MM_xrealloc (void *mem, size_t size); +char *H5MM_xstrdup (const char *s); +void *H5MM_xfree (const void *mem); #endif diff --git a/src/H5MMpublic.h b/src/H5MMpublic.h index d0241c9..b5cd659 100644 --- a/src/H5MMpublic.h +++ b/src/H5MMpublic.h @@ -11,7 +11,7 @@ * Purpose: Public declarations for the H5MM (memory management) * package. * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ @@ -22,11 +22,10 @@ #include <H5public.h> #ifdef __cplusplus -extern "C" { +extern "C" { #endif #ifdef __cplusplus } - #endif #endif diff --git a/src/H5Mprivate.h b/src/H5Mprivate.h index badc741..faee39a 100644 --- a/src/H5Mprivate.h +++ b/src/H5Mprivate.h @@ -10,15 +10,13 @@ * * ****************************************************************************/ -/* $Id$ */ - /* * This file contains macros & information for meta-objects */ - #ifndef _H5Mprivate_H #define _H5Mprivate_H -#include <H5Mpublic.h> /* Include Public Definitions */ + +#include <H5Mpublic.h> /*include Public Definitions */ /* Private headers needed by this file */ #include <H5private.h> @@ -28,23 +26,22 @@ * interface to create/open/close objects. */ typedef struct meta_func_t { - group_t type; /* Object type this interface is for */ - hid_t (*create) (hid_t, group_t, const char *); /* Object creation function */ - hid_t (*access) (hid_t); /* Object access function */ - hid_t (*copy) (hid_t); /* Object copy function */ - hid_t (*find_name) (hid_t, group_t, const char *); /* Find first object */ - uint32 (*name_len) (hid_t); /* Get length of object name */ - herr_t (*get_name) (hid_t, char *); /* Get object name */ - herr_t (*set_name) (hid_t, const char *); /* Set object name */ - hid_t (*search) (hid_t, group_t, const char *); /* Search for list of objects */ - hid_t (*index) (hid_t, group_t, uint32); /* Get the OID for the n'th object */ - herr_t (*flush) (hid_t); /* Flush the object to disk */ - herr_t (*delete) (hid_t); /* Delete an object from file */ - hid_t (*get_parent) (hid_t); /* Get the parent object of an object */ - hid_t (*get_file) (hid_t); /* Get the file ID of an object */ - herr_t (*close) (hid_t); /* End access to an object */ + group_t type; /*object type this interface is for*/ + hid_t (*create) (hid_t, group_t, const char *);/*object creation function*/ + hid_t (*access) (hid_t); /*object access function*/ + hid_t (*copy) (hid_t); /*object copy function*/ + hid_t (*find_name) (hid_t, group_t, const char *);/*find first object*/ + uint32 (*name_len) (hid_t); /*get length of object name*/ + herr_t (*get_name) (hid_t, char *); /*get object name*/ + herr_t (*set_name) (hid_t, const char *); /*set object name*/ + hid_t (*search) (hid_t, group_t, const char *);/*search for list of objects*/ + hid_t (*index) (hid_t, group_t, uint32);/*get the OID for the n'th object*/ + herr_t (*flush) (hid_t); /*flush the object to disk*/ + herr_t (*delete) (hid_t); /*delete an object from file*/ + hid_t (*get_parent) (hid_t); /*get the parent object of an object*/ + hid_t (*get_file) (hid_t); /*get the file ID of an object*/ + herr_t (*close) (hid_t); /*end access to an object*/ } meta_func_t; /* Private functions, not part of the publicly documented API */ - #endif diff --git a/src/H5Mpublic.h b/src/H5Mpublic.h index 93947e0..6366a1f 100644 --- a/src/H5Mpublic.h +++ b/src/H5Mpublic.h @@ -10,40 +10,36 @@ * * ****************************************************************************/ -/* $Id$ */ - /* * This file contains public declarations for the H5M module. */ - #ifndef _H5Mpublic_H #define _H5Mpublic_H /* Public headers needed by this file */ #include <H5public.h> -#include <H5Cpublic.h> /*for hobjtype_t defn */ +#include <H5Cpublic.h> /*for hobjtype_t defn */ #ifdef __cplusplus -extern "C" { +extern "C" { #endif /* Functions in H5M.c */ - hid_t H5Maccess(hid_t oid); - hid_t H5Mcopy(hid_t oid); - hid_t H5Mfind_name(hid_t oid, group_t type, const char *name); - uint32 H5Mname_len(hid_t oid); - herr_t H5Mget_name(hid_t oid, char *name); - herr_t H5Mset_name(hid_t oid, const char *name); - hid_t H5Msearch(hid_t oid, group_t type, const char *name); - hid_t H5Mindex(hid_t oid, group_t type, uint32 idx); - hid_t H5Mflush(hid_t oid); - herr_t H5Mdelete(hid_t oid); - hid_t H5Mget_file(hid_t oid); - hid_t H5Mget_parent(hid_t oid); - herr_t H5Mclose(hid_t oid); +hid_t H5Maccess (hid_t oid); +hid_t H5Mcopy (hid_t oid); +hid_t H5Mfind_name (hid_t oid, group_t type, const char *name); +uint32 H5Mname_len (hid_t oid); +herr_t H5Mget_name (hid_t oid, char *name); +herr_t H5Mset_name (hid_t oid, const char *name); +hid_t H5Msearch (hid_t oid, group_t type, const char *name); +hid_t H5Mindex (hid_t oid, group_t type, uint32 idx); +hid_t H5Mflush (hid_t oid); +herr_t H5Mdelete (hid_t oid); +hid_t H5Mget_file (hid_t oid); +hid_t H5Mget_parent (hid_t oid); +herr_t H5Mclose (hid_t oid); #ifdef __cplusplus } - #endif #endif diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index b570b30..2ad1a0a 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -10,12 +10,13 @@ * * Purpose: Object header private include file. * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ #ifndef _H5Oprivate_H #define _H5Oprivate_H + #include <H5Opublic.h> /* Private headers neede by this file */ @@ -25,67 +26,65 @@ #include <H5Tprivate.h> #include <H5Pprivate.h> -#define H5O_MIN_SIZE 32 /*min obj header data size */ -#define H5O_NMESGS 32 /*initial number of messages */ -#define H5O_NCHUNKS 8 /*initial number of chunks */ -#define H5O_NEW_MESG (-1) /*new message */ -#define H5O_ALL (-1) /*delete all messages of type */ +#define H5O_MIN_SIZE 32 /*min obj header data size */ +#define H5O_NMESGS 32 /*initial number of messages */ +#define H5O_NCHUNKS 8 /*initial number of chunks */ +#define H5O_NEW_MESG (-1) /*new message */ +#define H5O_ALL (-1) /*delete all messages of type */ /* Flags which are part of the message id */ #define H5O_FLAG_CONSTANT 0x8000 #define H5O_FLAG_BITS 0x8000 - #define H5O_VERSION 1 #define H5O_ALIGNMENT 4 #define H5O_ALIGN(X,A) ((X)=(A)*(((X)+(A)-1)/(A))) - #define H5O_SIZEOF_HDR(F) \ (1 + /*version number */ \ 1 + /*alignment */ \ 2 + /*number of messages */ \ 4 + /*reference count */ \ - 4) /*header data size */ + 4) /*header data size */ typedef struct H5O_class_t { - intn id; /*message type ID on disk */ - const char *name; /*message name for debugging */ - size_t native_size; /*size of native message */ - void *(*decode) (H5F_t *, size_t, const uint8 *); - herr_t (*encode) (H5F_t *, size_t, uint8 *, const void *); - void *(*copy) (const void *, void *); /*copy native value */ - size_t (*raw_size) (H5F_t *, const void *); /*sizeof raw val */ - herr_t (*reset) (void *); /*free nested data structures */ - herr_t (*debug) (H5F_t *, const void *, FILE *, intn, intn); + intn id; /*message type ID on disk*/ + const char *name; /*message name for debugging*/ + size_t native_size; /*size of native message*/ + void *(*decode) (H5F_t *, size_t, const uint8 *); + herr_t (*encode) (H5F_t *, size_t, uint8 *, const void *); + void *(*copy) (const void *, void *); /*copy native value */ + size_t (*raw_size) (H5F_t *, const void *); /*sizeof raw val */ + herr_t (*reset) (void *); /*free nested data structures*/ + herr_t (*debug) (H5F_t *, const void *, FILE *, intn, intn); } H5O_class_t; typedef struct H5O_mesg_t { - const H5O_class_t *type; /*type of message */ - hbool_t dirty; /*raw out of date wrt native */ - hbool_t constant; /*is message constant? */ - void *native; /*native format message */ - uint8 *raw; /*ptr to raw data */ - size_t raw_size; /*size with alignment */ - intn chunkno; /*chunk number for this mesg */ + const H5O_class_t *type; /*type of message */ + hbool_t dirty; /*raw out of date wrt native */ + hbool_t constant; /*is message constant? */ + void *native; /*native format message */ + uint8 *raw; /*ptr to raw data */ + size_t raw_size; /*size with alignment */ + intn chunkno; /*chunk number for this mesg */ } H5O_mesg_t; typedef struct H5O_chunk_t { - hbool_t dirty; /*dirty flag */ - haddr_t addr; /*chunk file address */ - size_t size; /*chunk size */ - uint8 *image; /*image of file */ + hbool_t dirty; /*dirty flag */ + haddr_t addr; /*chunk file address */ + size_t size; /*chunk size */ + uint8 *image; /*image of file */ } H5O_chunk_t; typedef struct H5O_t { - hbool_t dirty; /*out of data wrt disk */ - intn version; /*version number */ - intn alignment; /*message alignment */ - intn nlink; /*link count */ - intn nmesgs; /*number of messages */ - intn alloc_nmesgs; /*number of message slots */ - H5O_mesg_t *mesg; /*array of messages */ - intn nchunks; /*number of chunks */ - intn alloc_nchunks; /*chunks allocated */ - H5O_chunk_t *chunk; /*array of chunks */ + hbool_t dirty; /*out of data wrt disk */ + intn version; /*version number */ + intn alignment; /*message alignment */ + intn nlink; /*link count */ + intn nmesgs; /*number of messages */ + intn alloc_nmesgs; /*number of message slots */ + H5O_mesg_t *mesg; /*array of messages */ + intn nchunks; /*number of chunks */ + intn alloc_nchunks; /*chunks allocated */ + H5O_chunk_t *chunk; /*array of chunks */ } H5O_t; /* @@ -99,6 +98,7 @@ extern const H5O_class_t H5O_NULL[1]; */ #define H5O_SDSPACE_ID 0x0001 extern const H5O_class_t H5O_SDSPACE[1]; + /* operates on an H5P_simple_t struct */ /* @@ -106,6 +106,7 @@ extern const H5O_class_t H5O_SDSPACE[1]; */ #define H5O_DTYPE_ID 0x0003 extern const H5O_class_t H5O_DTYPE[1]; + /* operates on an H5T_t struct */ /* @@ -116,10 +117,10 @@ extern const H5O_class_t H5O_DTYPE[1]; extern const H5O_class_t H5O_LAYOUT[1]; typedef struct H5O_layout_t { - int type; /*type of layout, H5D_layout_t */ - haddr_t addr; /*file address of data or B-tree */ - uintn ndims; /*num dimensions in stored data */ - size_t dim[H5O_LAYOUT_NDIMS]; /*size of data or chunk */ + int type; /*type of layout, H5D_layout_t */ + haddr_t addr; /*file address of data or B-tree */ + uintn ndims; /*num dimensions in stored data */ + size_t dim[H5O_LAYOUT_NDIMS]; /*size of data or chunk */ } H5O_layout_t; /* @@ -129,10 +130,10 @@ typedef struct H5O_layout_t { extern const H5O_class_t H5O_EFL[1]; typedef struct H5O_efl_t { - haddr_t heap_addr; /*Address of name heap */ - uintn nalloc; /*Number of slots allocated */ - uintn nused; /*Number of slots used */ - size_t *offset; /*Array of name offsets in heap */ + haddr_t heap_addr; /*address of name heap */ + uintn nalloc; /*number of slots allocated */ + uintn nused; /*number of slots used */ + size_t *offset; /*array of name offsets in heap */ } H5O_efl_t; /* @@ -142,7 +143,7 @@ typedef struct H5O_efl_t { extern const H5O_class_t H5O_NAME[1]; typedef struct H5O_name_t { - const char *s; /*ptr to malloc'd memory */ + const char *s; /*ptr to malloc'd memory */ } H5O_name_t; /* @@ -152,11 +153,11 @@ typedef struct H5O_name_t { extern const H5O_class_t H5O_CONT[1]; typedef struct H5O_cont_t { - haddr_t addr; /*address of continuation block */ - size_t size; /*size of continuation block */ + haddr_t addr; /*address of continuation block */ + size_t size; /*size of continuation block */ /* the following field(s) do not appear on disk */ - intn chunkno; /*chunk this mesg refers to */ + intn chunkno; /*chunk this mesg refers to */ } H5O_cont_t; /* @@ -164,25 +165,25 @@ typedef struct H5O_cont_t { */ #define H5O_STAB_ID 0x0011 extern const H5O_class_t H5O_STAB[1]; -void *H5O_stab_fast(const H5G_cache_t *cache, const H5O_class_t *type, - void *_mesg); + +void *H5O_stab_fast (const H5G_cache_t *cache, const H5O_class_t *type, + void *_mesg); typedef struct H5O_stab_t { - haddr_t btree_addr; /*address of B-tree */ - haddr_t heap_addr; /*address of name heap */ + haddr_t btree_addr; /*address of B-tree */ + haddr_t heap_addr; /*address of name heap */ } H5O_stab_t; -herr_t H5O_create(H5F_t *f, size_t size_hint, H5G_entry_t *ent /*out */ ); -herr_t H5O_open(H5F_t *f, H5G_entry_t *ent); -herr_t H5O_close(H5G_entry_t *ent); -intn H5O_link(H5G_entry_t *ent, intn adjust); -void *H5O_read(H5G_entry_t *ent, const H5O_class_t *type, intn sequence, - void *mesg); -intn H5O_modify(H5G_entry_t *ent, const H5O_class_t *type, intn overwrite, - uintn flags, const void *mesg); -herr_t H5O_remove(H5G_entry_t *ent, const H5O_class_t *type, intn sequence); -herr_t H5O_reset(const H5O_class_t *type, void *native); -herr_t H5O_debug(H5F_t *f, const haddr_t *addr, FILE * stream, - intn indent, intn fwidth); - +herr_t H5O_create (H5F_t *f, size_t size_hint, H5G_entry_t *ent/*out*/); +herr_t H5O_open (H5F_t *f, H5G_entry_t *ent); +herr_t H5O_close (H5G_entry_t *ent); +intn H5O_link (H5G_entry_t *ent, intn adjust); +void *H5O_read (H5G_entry_t *ent, const H5O_class_t *type, intn sequence, + void *mesg); +intn H5O_modify (H5G_entry_t *ent, const H5O_class_t *type, intn overwrite, + uintn flags, const void *mesg); +herr_t H5O_remove (H5G_entry_t *ent, const H5O_class_t *type, intn sequence); +herr_t H5O_reset (const H5O_class_t *type, void *native); +herr_t H5O_debug (H5F_t *f, const haddr_t *addr, FILE * stream, intn indent, + intn fwidth); #endif diff --git a/src/H5Opublic.h b/src/H5Opublic.h index 999a1f7..4cb501e 100644 --- a/src/H5Opublic.h +++ b/src/H5Opublic.h @@ -11,7 +11,7 @@ * Purpose: Public declarations for the H5O (object header) * package. * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ @@ -22,11 +22,10 @@ #include <H5public.h> #ifdef __cplusplus -extern "C" { +extern "C" { #endif #ifdef __cplusplus } - #endif #endif @@ -50,9 +50,9 @@ H5P_init_interface(void) FUNC_ENTER(H5P_init_interface, FAIL); /* Initialize the atom group for the file IDs */ - if ((ret_value = H5Ainit_group(H5_DATASPACE, H5A_DATASPACEID_HASHSIZE, - H5P_RESERVED_ATOMS, - (herr_t (*)(void *)) H5P_close)) != FAIL) { + if ((ret_value = H5A_init_group(H5_DATASPACE, H5A_DATASPACEID_HASHSIZE, + H5P_RESERVED_ATOMS, + (herr_t (*)(void *)) H5P_close)) != FAIL) { ret_value = H5_add_exit(&H5P_term_interface); } FUNC_LEAVE(ret_value); @@ -78,7 +78,7 @@ H5P_init_interface(void) static void H5P_term_interface(void) { - H5Adestroy_group(H5_DATASPACE); + H5A_destroy_group(H5_DATASPACE); } /*------------------------------------------------------------------------- @@ -130,7 +130,7 @@ H5Pcreate(H5P_class_t type) } /* Register the new data space and get an ID for it */ - if ((ret_value = H5Aregister_atom(H5_DATASPACE, ds)) < 0) { + if ((ret_value = H5A_register(H5_DATASPACE, ds)) < 0) { HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register data space for ID"); } @@ -166,8 +166,8 @@ H5Pclose(hid_t space_id) H5ECLEAR; /* check args */ - if (H5_DATASPACE != H5Aatom_group(space_id) || - NULL == H5Aatom_object(space_id)) { + if (H5_DATASPACE != H5A_group(space_id) || + NULL == H5A_object(space_id)) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); } /* When the reference count reaches zero the resources are freed */ @@ -318,8 +318,8 @@ H5Pget_npoints(hid_t space_id) H5ECLEAR; /* check args */ - if (H5_DATASPACE != H5Aatom_group(space_id) || - NULL == (ds = H5Aatom_object(space_id))) { + if (H5_DATASPACE != H5A_group(space_id) || + NULL == (ds = H5A_object(space_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a data space"); } ret_value = H5P_get_npoints(ds); @@ -404,8 +404,8 @@ H5Pget_ndims(hid_t space_id) H5ECLEAR; /* check args */ - if (H5_DATASPACE != H5Aatom_group(space_id) || - NULL == (ds = H5Aatom_object(space_id))) { + if (H5_DATASPACE != H5A_group(space_id) || + NULL == (ds = H5A_object(space_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); } ret_value = H5P_get_ndims(ds); @@ -491,8 +491,8 @@ H5Pget_dims(hid_t space_id, size_t dims[] /*out */ ) H5ECLEAR; /* check args */ - if (H5_DATASPACE != H5Aatom_group(space_id) || - NULL == (ds = H5Aatom_object(space_id))) { + if (H5_DATASPACE != H5A_group(space_id) || + NULL == (ds = H5A_object(space_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); } if (!dims) { @@ -772,7 +772,7 @@ H5Pis_simple(hid_t sid) /* Clear errors and check args and all the boring stuff. */ H5ECLEAR; - if ((space = H5Aatom_object(sid)) == NULL) + if ((space = H5A_object(sid)) == NULL) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "not a data space"); ret_value = H5P_is_simple(space); @@ -819,7 +819,7 @@ H5Pset_space(hid_t sid, intn rank, const size_t *dims) H5ECLEAR; /* Get the object */ - if ((space = H5Aatom_object(sid)) == NULL) + if ((space = H5A_object(sid)) == NULL) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "not a data space"); if (rank > 0 && dims == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid rank"); diff --git a/src/H5Pprivate.h b/src/H5Pprivate.h index 8b323b2..bfb66da 100644 --- a/src/H5Pprivate.h +++ b/src/H5Pprivate.h @@ -49,7 +49,7 @@ typedef struct { * are numbered. */ typedef struct H5P_number_t { - int _place_holder; /*remove this field!*/ + int _place_holder; /*remove this field! */ } H5P_number_t; /* @@ -58,29 +58,29 @@ typedef struct H5P_number_t { typedef struct H5P_tconv_t { /* Initialize element numbering information */ size_t (*init)(const struct H5O_layout_t *layout, const H5P_t *mem_space, - const H5P_t *file_space, H5P_number_t *numbering/*out*/); + const H5P_t *file_space, H5P_number_t *numbering/*out*/); /* Gather elements from disk to type conversion buffer */ size_t (*fgath)(H5F_t *f, const struct H5O_layout_t *layout, - size_t elmt_size, const H5P_t *file_space, - const H5P_number_t *numbering, intn start, intn nelmts, - void *tconv_buf/*out*/); + size_t elmt_size, const H5P_t *file_space, + const H5P_number_t *numbering, intn start, intn nelmts, + void *tconv_buf/*out*/); /* Scatter elements from type conversion buffer to application buffer */ herr_t (*mscat)(const void *tconv_buf, size_t elmt_size, - const H5P_t *mem_space, const H5P_number_t *numbering, - intn start, intn nelmts, void *buf/*out*/); + const H5P_t *mem_space, const H5P_number_t *numbering, + intn start, intn nelmts, void *buf/*out*/); /* Gather elements from app buffer to type conversion buffer */ size_t (*mgath)(const void *buf, size_t elmt_size, - const H5P_t *mem_space, const H5P_number_t *numbering, - intn start, intn nelmts, void *tconv_buf/*out*/); + const H5P_t *mem_space, const H5P_number_t *numbering, + intn start, intn nelmts, void *tconv_buf/*out*/); /* Scatter elements from type conversion buffer to disk */ herr_t (*fscat)(H5F_t *f, const struct H5O_layout_t *layout, - size_t elmt_size, const H5P_t *file_space, - const H5P_number_t *numbering, intn start, intn nelmts, - const void *tconv_buf); + size_t elmt_size, const H5P_t *file_space, + const H5P_number_t *numbering, intn start, intn nelmts, + const void *tconv_buf); } H5P_conv_t; H5P_t *H5P_copy (const H5P_t *src); @@ -97,21 +97,20 @@ const H5P_conv_t *H5P_find (const H5P_t *mem_space, const H5P_t *file_space); /* Conversion functions for simple data spaces */ size_t H5P_simp_init (const struct H5O_layout_t *layout, - const H5P_t *mem_space, const H5P_t *file_space, - H5P_number_t *numbering/*out*/); + const H5P_t *mem_space, const H5P_t *file_space, + H5P_number_t *numbering/*out*/); size_t H5P_simp_fgath (H5F_t *f, const struct H5O_layout_t *layout, - size_t elmt_size, const H5P_t *file_space, - const H5P_number_t *numbering, intn start, intn nelmts, - void *tconv_buf/*out*/); + size_t elmt_size, const H5P_t *file_space, + const H5P_number_t *numbering, intn start, + intn nelmts, void *tconv_buf/*out*/); herr_t H5P_simp_mscat (const void *tconv_buf, size_t elmt_size, - const H5P_t *mem_space, const H5P_number_t *numbering, - intn start, intn nelmts, void *buf/*out*/); + const H5P_t *mem_space, const H5P_number_t *numbering, + intn start, intn nelmts, void *buf/*out*/); size_t H5P_simp_mgath (const void *buf, size_t elmt_size, - const H5P_t *mem_space, const H5P_number_t *numbering, - intn start, intn nelmts, void *tconv_buf/*out*/); + const H5P_t *mem_space, const H5P_number_t *numbering, + intn start, intn nelmts, void *tconv_buf/*out*/); herr_t H5P_simp_fscat (H5F_t *f, const struct H5O_layout_t *layout, - size_t elmt_size, const H5P_t *file_space, - const H5P_number_t *numbering, intn start, intn nelmts, - const void *tconv_buf); - + size_t elmt_size, const H5P_t *file_space, + const H5P_number_t *numbering, intn start, + intn nelmts, const void *tconv_buf); #endif diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index bbf5dc7..e7b1dab 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -10,12 +10,9 @@ * * ****************************************************************************/ -/* $Id$ */ - /* * This file contains public declarations for the H5P module. */ - #ifndef _H5pproto_H #define _H5Pproto_H @@ -28,28 +25,26 @@ /* Different types of dataspaces */ typedef enum H5P_class_t { - H5P_NO_CLASS = -1, /*error */ - H5P_SCALAR = 0, /*scalar variable */ - H5P_SIMPLE = 1, /*simple data space */ - H5P_COMPLEX = 2 /*complex data space */ + H5P_NO_CLASS = -1, /*error */ + H5P_SCALAR = 0, /*scalar variable */ + H5P_SIMPLE = 1, /*simple data space */ + H5P_COMPLEX = 2 /*complex data space */ } H5P_class_t; #ifdef __cplusplus -extern "C" { +extern "C" { #endif /* Functions in H5P.c */ - hid_t H5Pcreate(H5P_class_t type); - herr_t H5Pclose(hid_t space_id); - size_t H5Pget_npoints(hid_t space_id); - intn H5Pget_ndims(hid_t space_id); - intn H5Pget_dims(hid_t space_id, size_t dims[]); - - hbool_t H5Pis_simple(hid_t space_id); - herr_t H5Pset_space(hid_t space_id, intn rank, const size_t *dims); +hid_t H5Pcreate (H5P_class_t type); +herr_t H5Pclose (hid_t space_id); +size_t H5Pget_npoints (hid_t space_id); +intn H5Pget_ndims (hid_t space_id); +intn H5Pget_dims (hid_t space_id, size_t dims[]); +hbool_t H5Pis_simple (hid_t space_id); +herr_t H5Pset_space (hid_t space_id, intn rank, const size_t *dims); #ifdef __cplusplus } - #endif #endif @@ -93,9 +93,9 @@ H5T_init_interface(void) FUNC_ENTER(H5T_init_interface, FAIL); /* Initialize the atom group for the file IDs */ - if ((ret_value = H5Ainit_group(H5_DATATYPE, H5A_DATATYPEID_HASHSIZE, - H5T_RESERVED_ATOMS, - (herr_t (*)(void *)) H5T_close)) != FAIL) { + if ((ret_value = H5A_init_group(H5_DATATYPE, H5A_DATATYPEID_HASHSIZE, + H5T_RESERVED_ATOMS, + (herr_t (*)(void *)) H5T_close)) != FAIL) { ret_value = H5_add_exit(&H5T_term_interface); } /* @@ -170,7 +170,7 @@ H5T_init_interface(void) dt->u.atomic.prec = 8 * dt->size; dt->u.atomic.lsb_pad = H5T_PAD_ZERO; dt->u.atomic.msb_pad = H5T_PAD_ZERO; - if ((H5T_NATIVE_TIME_g = H5Aregister_atom(H5_DATATYPE, dt)) < 0) { + if ((H5T_NATIVE_TIME_g = H5A_register(H5_DATATYPE, dt)) < 0) { HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't initialize H5T layer"); } @@ -186,7 +186,7 @@ H5T_init_interface(void) dt->u.atomic.msb_pad = H5T_PAD_ZERO; dt->u.atomic.u.s.cset = H5T_CSET_ASCII; dt->u.atomic.u.s.pad = H5T_STR_NULL; - if ((H5T_NATIVE_STRING_g = H5Aregister_atom(H5_DATATYPE, dt)) < 0) { + if ((H5T_NATIVE_STRING_g = H5A_register(H5_DATATYPE, dt)) < 0) { HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't initialize H5T layer"); } @@ -200,7 +200,7 @@ H5T_init_interface(void) dt->u.atomic.prec = 8 * dt->size; dt->u.atomic.lsb_pad = H5T_PAD_ZERO; dt->u.atomic.msb_pad = H5T_PAD_ZERO; - if ((H5T_NATIVE_BITFIELD_g = H5Aregister_atom(H5_DATATYPE, dt)) < 0) { + if ((H5T_NATIVE_BITFIELD_g = H5A_register(H5_DATATYPE, dt)) < 0) { HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize H5T layer"); } @@ -214,7 +214,7 @@ H5T_init_interface(void) dt->u.atomic.prec = 8 * dt->size; dt->u.atomic.lsb_pad = H5T_PAD_ZERO; dt->u.atomic.msb_pad = H5T_PAD_ZERO; - if ((H5T_NATIVE_OPAQUE_g = H5Aregister_atom(H5_DATATYPE, dt)) < 0) { + if ((H5T_NATIVE_OPAQUE_g = H5A_register(H5_DATATYPE, dt)) < 0) { HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize H5T layer"); } @@ -263,7 +263,7 @@ H5T_init_interface(void) static void H5T_term_interface(void) { - H5Adestroy_group(H5_DATATYPE); + H5A_destroy_group(H5_DATATYPE); } /*------------------------------------------------------------------------- @@ -305,7 +305,7 @@ H5Tcreate(H5T_class_t type, size_t size) HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't create type"); } /* Make it an atom */ - if ((ret_value = H5Aregister_atom(H5_DATATYPE, dt)) < 0) { + if ((ret_value = H5A_register(H5_DATATYPE, dt)) < 0) { HRETURN_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "can't register data type atom"); } @@ -341,8 +341,8 @@ H5Tcopy(hid_t type_id) H5ECLEAR; /* check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id))) { + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } /* copy */ @@ -350,7 +350,7 @@ H5Tcopy(hid_t type_id) HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't copy"); } /* atomize result */ - if ((ret_value = H5Aregister_atom(H5_DATATYPE, new_dt)) < 0) { + if ((ret_value = H5A_register(H5_DATATYPE, new_dt)) < 0) { H5T_close(new_dt); HRETURN_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "can't register data type atom"); @@ -383,8 +383,8 @@ H5Tclose(hid_t type_id) H5ECLEAR; /* check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id))) { + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } if (dt->locked) { @@ -425,10 +425,10 @@ H5Tequal(hid_t type1_id, hid_t type2_id) FUNC_ENTER(H5Tequal, FAIL); /* check args */ - if (H5_DATATYPE != H5Aatom_group(type1_id) || - NULL == (dt1 = H5Aatom_object(type1_id)) || - H5_DATATYPE != H5Aatom_group(type2_id) || - NULL == (dt2 = H5Aatom_object(type2_id))) { + if (H5_DATATYPE != H5A_group(type1_id) || + NULL == (dt1 = H5A_object(type1_id)) || + H5_DATATYPE != H5A_group(type2_id) || + NULL == (dt2 = H5A_object(type2_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } ret_value = (0 == H5T_cmp(dt1, dt2)); @@ -465,8 +465,8 @@ H5Tlock(hid_t type_id) FUNC_ENTER(H5Tlock, FAIL); /* Check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id))) { + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } dt->locked = TRUE; @@ -499,8 +499,8 @@ H5Tget_class(hid_t type_id) H5ECLEAR; /* Check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id))) { + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_NO_CLASS, "not a data type"); } FUNC_LEAVE(dt->type); @@ -534,8 +534,8 @@ H5Tget_size(hid_t type_id) H5ECLEAR; /* Check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id))) { + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a data type"); } /* size */ @@ -582,8 +582,8 @@ H5Tset_size(hid_t type_id, size_t size) H5ECLEAR; /* Check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id)) || + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id)) || !H5T_is_atomic(dt)) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an atomic data type"); } @@ -679,8 +679,8 @@ H5Tget_order(hid_t type_id) H5ECLEAR; /* Check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id)) || + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id)) || !H5T_is_atomic(dt)) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_ORDER_ERROR, "not an atomic data type"); @@ -716,8 +716,8 @@ H5Tset_order(hid_t type_id, H5T_order_t order) H5ECLEAR; /* Check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id)) || + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id)) || !H5T_is_atomic(dt)) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an atomic data type"); } @@ -762,8 +762,8 @@ H5Tget_precision(hid_t type_id) H5ECLEAR; /* Check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id)) || + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id)) || !H5T_is_atomic(dt)) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not an atomic data type"); } @@ -813,8 +813,8 @@ H5Tset_precision(hid_t type_id, size_t prec) H5ECLEAR; /* Check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id)) || + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id)) || !H5T_is_atomic(dt)) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an atomic data type"); } @@ -920,8 +920,8 @@ H5Tget_offset(hid_t type_id) H5ECLEAR; /* Check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id)) || + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id)) || !H5T_is_atomic(dt)) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not an atomic data type"); } @@ -979,8 +979,8 @@ H5Tset_offset(hid_t type_id, size_t offset) H5ECLEAR; /* Check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id)) || + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id)) || !H5T_is_atomic(dt)) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an atomic data type"); } @@ -1028,8 +1028,8 @@ H5Tget_pad(hid_t type_id, H5T_pad_t *lsb /*out */ , H5T_pad_t *msb /*out */ ) H5ECLEAR; /* Check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id)) || + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id)) || !H5T_is_atomic(dt)) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an atomic data type"); } @@ -1067,8 +1067,8 @@ H5Tset_pad(hid_t type_id, H5T_pad_t lsb, H5T_pad_t msb) H5ECLEAR; /* Check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id)) || + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id)) || !H5T_is_atomic(dt)) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an atomic data type"); } @@ -1110,8 +1110,8 @@ H5Tget_sign(hid_t type_id) H5ECLEAR; /* Check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id)) || + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id)) || H5T_INTEGER != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_SGN_ERROR, "not an integer data type"); @@ -1147,8 +1147,8 @@ H5Tset_sign(hid_t type_id, H5T_sign_t sign) H5ECLEAR; /* Check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id)) || + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id)) || H5T_INTEGER != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an integer data type"); } @@ -1196,8 +1196,8 @@ H5Tget_fields(hid_t type_id, size_t *spos /*out */ , H5ECLEAR; /* Check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id)) || + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id)) || H5T_FLOAT != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a floating-point data type"); @@ -1249,8 +1249,8 @@ H5Tset_fields(hid_t type_id, size_t spos, size_t epos, size_t esize, H5ECLEAR; /* Check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id)) || + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id)) || H5T_FLOAT != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a floating-point data type"); @@ -1320,8 +1320,8 @@ H5Tget_ebias(hid_t type_id) H5ECLEAR; /* Check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id)) || + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id)) || H5T_FLOAT != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a floating-point data type"); @@ -1357,8 +1357,8 @@ H5Tset_ebias(hid_t type_id, size_t ebias) H5ECLEAR; /* Check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id)) || + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id)) || H5T_FLOAT != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a floating-point data type"); @@ -1398,8 +1398,8 @@ H5Tget_norm(hid_t type_id) H5ECLEAR; /* Check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id)) || + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id)) || H5T_FLOAT != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_NORM_ERROR, "not a floating-point data type"); @@ -1436,8 +1436,8 @@ H5Tset_norm(hid_t type_id, H5T_norm_t norm) H5ECLEAR; /* Check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id)) || + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id)) || H5T_FLOAT != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a floating-point data type"); @@ -1482,8 +1482,8 @@ H5Tget_inpad(hid_t type_id) H5ECLEAR; /* Check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id)) || + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id)) || H5T_FLOAT != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_PAD_ERROR, "not a floating-point data type"); @@ -1522,8 +1522,8 @@ H5Tset_inpad(hid_t type_id, H5T_pad_t pad) H5ECLEAR; /* Check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id)) || + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id)) || H5T_FLOAT != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a floating-point data type"); @@ -1568,8 +1568,8 @@ H5Tget_cset(hid_t type_id) H5ECLEAR; /* Check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id)) || + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id)) || H5T_STRING != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_CSET_ERROR, "not a string data type"); @@ -1607,8 +1607,8 @@ H5Tset_cset(hid_t type_id, H5T_cset_t cset) H5ECLEAR; /* Check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id)) || + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id)) || H5T_STRING != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a string data type"); } @@ -1653,8 +1653,8 @@ H5Tget_strpad(hid_t type_id) H5ECLEAR; /* Check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id)) || + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id)) || H5T_STRING != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_STR_ERROR, "not a string data type"); @@ -1693,8 +1693,8 @@ H5Tset_strpad(hid_t type_id, H5T_str_t strpad) H5ECLEAR; /* Check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id)) || + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id)) || H5T_STRING != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a string data type"); } @@ -1738,8 +1738,8 @@ H5Tget_nmembers(hid_t type_id) H5ECLEAR; /* Check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id)) || + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id)) || H5T_COMPOUND != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a compound data type"); } @@ -1776,8 +1776,8 @@ H5Tget_member_name(hid_t type_id, int membno) H5ECLEAR; /* Check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id)) || + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id)) || H5T_COMPOUND != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a compound data type"); } @@ -1818,8 +1818,8 @@ H5Tget_member_offset(hid_t type_id, int membno) H5ECLEAR; /* Check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id)) || + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id)) || H5T_COMPOUND != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a compound data type"); } @@ -1860,8 +1860,8 @@ H5Tget_member_dims(hid_t type_id, int membno, H5ECLEAR; /* Check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id)) || + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id)) || H5T_COMPOUND != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a compound data type"); } @@ -1909,8 +1909,8 @@ H5Tget_member_type(hid_t type_id, int membno) H5ECLEAR; /* Check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id)) || + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id)) || H5T_COMPOUND != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a compound data type"); } @@ -1922,7 +1922,7 @@ H5Tget_member_type(hid_t type_id, int membno) HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy member data type"); } - if ((memb_type_id = H5Aregister_atom(H5_DATATYPE, memb_dt)) < 0) { + if ((memb_type_id = H5A_register(H5_DATATYPE, memb_dt)) < 0) { H5T_close(memb_dt); HRETURN_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "can't register data type atom"); @@ -1968,8 +1968,8 @@ H5Tinsert(hid_t parent_id, const char *name, off_t offset, hid_t member_id) H5ECLEAR; /* Check args */ - if (H5_DATATYPE != H5Aatom_group(parent_id) || - NULL == (parent = H5Aatom_object(parent_id)) || + if (H5_DATATYPE != H5A_group(parent_id) || + NULL == (parent = H5A_object(parent_id)) || H5T_COMPOUND != parent->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a compound data type"); } @@ -1979,8 +1979,8 @@ H5Tinsert(hid_t parent_id, const char *name, off_t offset, hid_t member_id) if (!name || !*name) { HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no member name"); } - if (H5_DATATYPE != H5Aatom_group(member_id) || - NULL == (member = H5Aatom_object(member_id))) { + if (H5_DATATYPE != H5A_group(member_id) || + NULL == (member = H5A_object(member_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } if (H5T_insert(parent, name, offset, member) < 0) { @@ -2016,8 +2016,8 @@ H5Tpack(hid_t type_id) H5ECLEAR; /* Check args */ - if (H5_DATATYPE != H5Aatom_group(type_id) || - NULL == (dt = H5Aatom_object(type_id)) || + if (H5_DATATYPE != H5A_group(type_id) || + NULL == (dt = H5A_object(type_id)) || H5T_COMPOUND != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a compound data type"); } @@ -2066,10 +2066,10 @@ H5Tregister_hard(hid_t src_id, hid_t dst_id, H5T_conv_t func) FUNC_ENTER(H5Tregister_hard, FAIL); /* Check args */ - if (H5_DATATYPE != H5Aatom_group(src_id) || - NULL == (src = H5Aatom_object(src_id)) || - H5_DATATYPE != H5Aatom_group(dst_id) || - NULL == (dst = H5Aatom_object(dst_id))) { + if (H5_DATATYPE != H5A_group(src_id) || + NULL == (src = H5A_object(src_id)) || + H5_DATATYPE != H5A_group(dst_id) || + NULL == (dst = H5A_object(dst_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } /* Locate or create a new conversion path */ @@ -2139,8 +2139,8 @@ H5Tregister_soft(H5T_class_t src_cls, H5T_class_t dst_cls, H5T_conv_t func) */ if (path->src->type != src_cls || path->dst->type != dst_cls) continue; - if ((src_id = H5Aregister_atom(H5_DATATYPE, H5T_copy(path->src))) < 0 || - (dst_id = H5Aregister_atom(H5_DATATYPE, H5T_copy(path->dst))) < 0) { + if ((src_id = H5A_register(H5_DATATYPE, H5T_copy(path->src))) < 0 || + (dst_id = H5A_register(H5_DATATYPE, H5T_copy(path->dst))) < 0) { HRETURN_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register data types for conv query"); } @@ -2216,10 +2216,10 @@ H5Tunregister(H5T_conv_t func) * Conversion functions are app-level, so temporarily create * object id's for the data types. */ - if ((src_id = H5Aregister_atom(H5_DATATYPE, - H5T_copy(path->src))) < 0 || - (dst_id = H5Aregister_atom(H5_DATATYPE, - H5T_copy(path->dst))) < 0) { + if ((src_id = H5A_register(H5_DATATYPE, + H5T_copy(path->src))) < 0 || + (dst_id = H5A_register(H5_DATATYPE, + H5T_copy(path->dst))) < 0) { HRETURN_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register conv types for query"); } @@ -2262,10 +2262,10 @@ H5Tfind(hid_t src_id, hid_t dst_id) FUNC_ENTER(H5Tfind, NULL); /* Check args */ - if (H5_DATATYPE != H5Aatom_group(src_id) || - NULL == (src = H5Aatom_object(src_id)) || - H5_DATATYPE != H5Aatom_group(dst_id) || - NULL == (dst = H5Aatom_object(dst_id))) { + if (H5_DATATYPE != H5A_group(src_id) || + NULL == (src = H5A_object(src_id)) || + H5_DATATYPE != H5A_group(dst_id) || + NULL == (dst = H5A_object(dst_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type"); } /* Find it */ @@ -3044,8 +3044,8 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, hbool_t create) if (src->type != H5T_soft_g[i].src || dst->type != H5T_soft_g[i].dst) { continue; } - if ((src_id = H5Aregister_atom(H5_DATATYPE, H5T_copy(path->src))) < 0 || - (dst_id = H5Aregister_atom(H5_DATATYPE, H5T_copy(path->dst))) < 0) { + if ((src_id=H5A_register(H5_DATATYPE, H5T_copy(path->src))) < 0 || + (dst_id=H5A_register(H5_DATATYPE, H5T_copy(path->dst))) < 0) { HRETURN_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register conv types for query"); } diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 739876d..d5ad0bb 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -9,6 +9,7 @@ */ #define H5T_PACKAGE /*suppress error about including H5Tpkg */ +#include <H5Aprivate.h> #include <H5Eprivate.h> #include <H5Tpkg.h> @@ -73,10 +74,10 @@ H5T_conv_order(hid_t src_id, hid_t dst_id, size_t nelmts, FUNC_ENTER(H5T_conv_order, FAIL); /* Check args */ - if (H5_DATATYPE != H5Aatom_group(src_id) || - NULL == (src = H5Aatom_object(src_id)) || - H5_DATATYPE != H5Aatom_group(dst_id) || - NULL == (dst = H5Aatom_object(dst_id))) { + if (H5_DATATYPE != H5A_group(src_id) || + NULL == (src = H5A_object(src_id)) || + H5_DATATYPE != H5A_group(dst_id) || + NULL == (dst = H5A_object(dst_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } if (background) { @@ -132,3 +133,32 @@ H5T_conv_order(hid_t src_id, hid_t dst_id, size_t nelmts, FUNC_LEAVE(SUCCEED); } + +/*------------------------------------------------------------------------- + * Function: H5T_conv_struct + * + * Purpose: Converts between compound data types. This is a soft + * conversion function. + * + * Return: Success: SUCCEED + * + * Failure: FAIL + * + * Programmer: Robb Matzke + * Thursday, January 22, 1998 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +herr_t +H5T_conv_struct(hid_t src_id, hid_t dst_id, size_t nelmts, + void *_buf, const void *background) +{ + FUNC_ENTER (H5T_conv_struct, FAIL); + + HRETURN_ERROR (H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "not implemented yet"); + + FUNC_LEAVE (SUCCEED); +} + diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h index 73f5b55..5fc1075 100644 --- a/src/H5Tpkg.h +++ b/src/H5Tpkg.h @@ -19,80 +19,85 @@ #include <H5Tprivate.h> typedef struct H5T_atomic_t { - H5T_order_t order; /*byte order */ - size_t prec; /*precision in bits */ - size_t offset; /*bit position of lsb of value */ - intn lsb_pad; /*type of lsb padding */ - intn msb_pad; /*type of msb padding */ + H5T_order_t order; /*byte order */ + size_t prec; /*precision in bits */ + size_t offset; /*bit position of lsb of value */ + intn lsb_pad;/*type of lsb padding */ + intn msb_pad;/*type of msb padding */ union { struct { - H5T_sign_t sign; /*type of integer sign */ - } i; /*integer; integer types */ + H5T_sign_t sign; /*type of integer sign */ + } i; /*integer; integer types */ struct { - size_t sign; /*bit position of sign bit */ - size_t epos; /*position of lsb of exponent */ - size_t esize; /*size of exponent in bits */ - uint64 ebias; /*exponent bias */ - size_t mpos; /*position of lsb of mantissa */ - size_t msize; /*size of mantissa */ - H5T_norm_t norm; /*normalization */ - intn pad; /*type of padding for internal bits */ - } f; /*floating-point types */ + size_t sign; /*bit position of sign bit */ + size_t epos; /*position of lsb of exponent */ + size_t esize; /*size of exponent in bits */ + uint64 ebias; /*exponent bias */ + size_t mpos; /*position of lsb of mantissa */ + size_t msize; /*size of mantissa */ + H5T_norm_t norm; /*normalization */ + intn pad; /*type of padding for internal bits */ + } f; /*floating-point types */ struct { - H5T_cset_t cset; /*character set */ - H5T_str_t pad; /*space or null padding of extra bytes */ + H5T_cset_t cset; /*character set */ + H5T_str_t pad; /*space or null padding of extra bytes */ } s; } u; } H5T_atomic_t; typedef struct H5T_compnd_t { - intn nalloc; /*num entries allocated in MEMB array */ - intn nmembs; /*number of members defined in struct */ - struct H5T_member_t *memb; /*array of struct members */ + intn nalloc; /*num entries allocated in MEMB array*/ + intn nmembs; /*number of members defined in struct*/ + struct H5T_member_t *memb; /*array of struct members */ } H5T_compnd_t; struct H5T_t { - hbool_t locked; /*if locked, then can't be modified */ - H5T_class_t type; /*which class of type is this? */ - size_t size; /*total size of an instance of this type */ + hbool_t locked; /*if locked, then can't be modified */ + H5T_class_t type; /*which class of type is this? */ + size_t size; /*total size of an instance of this type */ union { - H5T_atomic_t atomic; /*an atomic data type */ - H5T_compnd_t compnd; /*a compound data type (struct) */ + H5T_atomic_t atomic; /*an atomic data type */ + H5T_compnd_t compnd; /*a compound data type (struct) */ } u; }; typedef struct H5T_member_t { - char *name; /*name of this member */ - size_t offset; /*offset from beginning of struct */ - intn ndims; /*member dimensionality */ - size_t dim[4]; /*size in each dimension */ - size_t perm[4]; /*index permutation */ - struct H5T_t type; /*type of this member */ + char *name; /*name of this member */ + size_t offset; /*offset from beginning of struct */ + intn ndims; /*member dimensionality */ + size_t dim[4]; /*size in each dimension */ + size_t perm[4]; /*index permutation */ + struct H5T_t type; /*type of this member */ } H5T_member_t; /* The data type conversion database */ typedef struct H5T_path_t { - H5T_t *src; /*source data type ID */ - H5T_t *dst; /*destination data type ID */ - H5T_conv_t hard; /*hard conversion function or null */ - H5T_conv_t soft; /*soft conversion function or null */ + H5T_t *src; /*source data type ID */ + H5T_t *dst; /*destination data type ID */ + H5T_conv_t hard; /*hard conversion function or null */ + H5T_conv_t soft; /*soft conversion function or null */ } H5T_path_t; /* The master list of soft conversion functions */ typedef struct H5T_soft_t { - H5T_class_t src; /*source data type class */ - H5T_class_t dst; /*destination data type class */ - H5T_conv_t func; /*the conversion function */ + H5T_class_t src; /*source data type class */ + H5T_class_t dst; /*destination data type class */ + H5T_conv_t func; /*the conversion function */ } H5T_soft_t; -H5T_path_t *H5T_path_find(const H5T_t *src, const H5T_t *dst, hbool_t create); +/* Function prototypes for H5T package scope */ +H5T_path_t *H5T_path_find (const H5T_t *src, const H5T_t *dst, + hbool_t create); /* Conversion functions */ -herr_t H5T_conv_noop(hid_t src_id, hid_t dst_id, size_t nelmts, - void *buf, const void *background); -herr_t H5T_conv_order(hid_t src_id, hid_t dst_id, size_t nelmts, - void *_buf, const void *background); +herr_t H5T_conv_noop (hid_t src_id, hid_t dst_id, size_t nelmts, void *buf, + const void *background); +herr_t H5T_conv_order (hid_t src_id, hid_t dst_id, size_t nelmts, void *_buf, + const void *background); +herr_t H5T_conv_struct (hid_t src_id, hid_t dst_id, size_t nelmts, + void *_buf, const void *background); + #endif diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h index 97528dc..c58f4c2 100644 --- a/src/H5Tprivate.h +++ b/src/H5Tprivate.h @@ -10,40 +10,35 @@ * * ****************************************************************************/ -/* $Id$ */ - /* * This file contains private information about the H5T module */ - #ifndef _H5Tprivate_H #define _H5Tprivate_H + #include <H5Tpublic.h> /* Private headers needed by this file */ #include <H5private.h> -#include <H5Gprivate.h> /*for H5G_entry_t */ +#include <H5Gprivate.h> /*for H5G_entry_t */ #define H5T_RESERVED_ATOMS 8 - typedef struct H5T_t H5T_t; -herr_t H5T_init(void); +herr_t H5T_init (void); /* Private functions */ -herr_t H5T_init_interface(void); -H5T_t *H5T_create(H5T_class_t type, size_t size); -H5T_t *H5T_copy(const H5T_t *old_dt); -herr_t H5T_close(H5T_t *dt); -size_t H5T_get_size(const H5T_t *dt); -intn H5T_cmp(const H5T_t *dt1, const H5T_t *dt2); -hbool_t H5T_is_atomic(const H5T_t *dt); - -herr_t H5T_insert(H5T_t *parent, const char *name, off_t offset, - const H5T_t *member); -herr_t H5T_sort_by_offset(H5T_t *dt); -herr_t H5T_pack(H5T_t *dt); -herr_t H5T_debug(H5T_t *dt, FILE * stream); -H5T_conv_t H5T_find(const H5T_t *src, const H5T_t *dst); - +herr_t H5T_init_interface (void); +H5T_t *H5T_create (H5T_class_t type, size_t size); +H5T_t *H5T_copy (const H5T_t *old_dt); +herr_t H5T_close (H5T_t *dt); +size_t H5T_get_size (const H5T_t *dt); +intn H5T_cmp (const H5T_t *dt1, const H5T_t *dt2); +hbool_t H5T_is_atomic (const H5T_t *dt); +herr_t H5T_insert (H5T_t *parent, const char *name, off_t offset, + const H5T_t *member); +herr_t H5T_sort_by_offset (H5T_t *dt); +herr_t H5T_pack (H5T_t *dt); +herr_t H5T_debug (H5T_t *dt, FILE * stream); +H5T_conv_t H5T_find (const H5T_t *src, const H5T_t *dst); #endif diff --git a/src/H5Tpublic.h b/src/H5Tpublic.h index f310b18..4608fe6 100644 --- a/src/H5Tpublic.h +++ b/src/H5Tpublic.h @@ -10,12 +10,9 @@ * * ****************************************************************************/ -/* $Id$ */ - /* * This file contains public declarations for the H5T module. */ - #ifndef _H5Tpublic_H #define _H5Tpublic_H @@ -25,76 +22,75 @@ /* These are the various classes of data types */ typedef enum H5T_class_t { - H5T_NO_CLASS = -1, /*error */ - H5T_INTEGER = 0, /*integer types */ - H5T_FLOAT = 1, /*floating-point types */ - H5T_TIME = 2, /*date and time types */ - H5T_STRING = 3, /*character string types */ - H5T_BITFIELD = 4, /*bit field types */ - H5T_OPAQUE = 5, /*opaque types */ - H5T_COMPOUND = 6, /*compound types */ - - H5T_NCLASSES = 7 /*This must be last */ + H5T_NO_CLASS = -1, /*error */ + H5T_INTEGER = 0, /*integer types */ + H5T_FLOAT = 1, /*floating-point types */ + H5T_TIME = 2, /*date and time types */ + H5T_STRING = 3, /*character string types */ + H5T_BITFIELD = 4, /*bit field types */ + H5T_OPAQUE = 5, /*opaque types */ + H5T_COMPOUND = 6, /*compound types */ + + H5T_NCLASSES = 7 /*this must be last */ } H5T_class_t; /* Byte orders */ typedef enum H5T_order_t { - H5T_ORDER_ERROR = -1, /*error */ - H5T_ORDER_LE = 0, /*little endian */ - H5T_ORDER_BE = 1, /*bit endian */ - H5T_ORDER_VAX = 2, /*VAX mixed endian */ - H5T_ORDER_NONE = 3 /*no particular order (strings, bits,..) */ + H5T_ORDER_ERROR = -1, /*error */ + H5T_ORDER_LE = 0, /*little endian */ + H5T_ORDER_BE = 1, /*bit endian */ + H5T_ORDER_VAX = 2, /*VAX mixed endian */ + H5T_ORDER_NONE = 3 /*no particular order (strings, bits,..) */ /*H5T_ORDER_NONE must be last */ } H5T_order_t; /* Types of integer sign schemes */ typedef enum H5T_sign_t { - H5T_SGN_ERROR = -1, /*error */ - H5T_SGN_NONE = 0, /*this is an unsigned type */ - H5T_SGN_2 = 1, /*two's complement */ + H5T_SGN_ERROR = -1, /*error */ + H5T_SGN_NONE = 0, /*this is an unsigned type */ + H5T_SGN_2 = 1, /*two's complement */ - H5T_NSGN = 2 /*this must be last! */ + H5T_NSGN = 2 /*this must be last! */ } H5T_sign_t; /* Floating-point normalization schemes */ typedef enum H5T_norm_t { - H5T_NORM_ERROR = -1, /*error */ - H5T_NORM_IMPLIED = 0, /*msb of mantissa isn't stored, always 1 */ - H5T_NORM_MSBSET = 1, /*msb of mantissa is always 1 */ - H5T_NORM_NONE = 2 /*not normalized */ + H5T_NORM_ERROR = -1, /*error */ + H5T_NORM_IMPLIED = 0, /*msb of mantissa isn't stored, always 1 */ + H5T_NORM_MSBSET = 1, /*msb of mantissa is always 1 */ + H5T_NORM_NONE = 2 /*not normalized */ /*H5T_NORM_NONE must be last */ } H5T_norm_t; /* Character set to use for text strings */ typedef enum H5T_cset_t { - H5T_CSET_ERROR = -1, /*error */ - H5T_CSET_ASCII = 0, /*US ASCII */ + H5T_CSET_ERROR = -1, /*error */ + H5T_CSET_ASCII = 0, /*US ASCII */ - H5T_NCSET = 1 /*this must be last! */ + H5T_NCSET = 1 /*this must be last! */ } H5T_cset_t; /* Type of padding to use in character strings */ typedef enum H5T_str_t { - H5T_STR_ERROR = -1, /*error */ - H5T_STR_NULL = 0, /*pad with null term like in C */ - H5T_STR_SPACE = 1, /*pad with spaces like in Fortran */ + H5T_STR_ERROR = -1, /*error */ + H5T_STR_NULL = 0, /*pad with null term like in C */ + H5T_STR_SPACE = 1, /*pad with spaces like in Fortran */ - H5T_NSTR = 2 /*this must be last! */ + H5T_NSTR = 2 /*this must be last! */ } H5T_str_t; /* Type of padding to use in other atomic types */ typedef enum H5T_pad_t { - H5T_PAD_ERROR = -1, /*error */ - H5T_PAD_ZERO = 0, /*always set to zero */ - H5T_PAD_ONE = 1, /*always set to one */ - H5T_PAD_BACKGROUND = 2, /*set to background value */ + H5T_PAD_ERROR = -1, /*error */ + H5T_PAD_ZERO = 0, /*always set to zero */ + H5T_PAD_ONE = 1, /*always set to one */ + H5T_PAD_BACKGROUND = 2, /*set to background value */ - H5T_NPAD = 3 /*THIS MUST BE LAST */ + H5T_NPAD = 3 /*THIS MUST BE LAST */ } H5T_pad_t; /* All data type conversion functions are... */ -typedef herr_t (*H5T_conv_t) (hid_t, hid_t, size_t, void *, const void *); - +typedef herr_t (*H5T_conv_t) (hid_t, hid_t, size_t, void *, const void *); #define HOFFSET(S,M) ((const char*)&S.M-(const char*)&S) #define HPOFFSET(P,M) ((const char*)&(P->M)-(const char*)P) @@ -127,95 +123,93 @@ typedef herr_t (*H5T_conv_t) (hid_t, hid_t, size_t, void *, const void #define H5T_NATIVE_OPAQUE (H5init(), H5T_NATIVE_OPAQUE_g) #ifdef __cplusplus -extern "C" { +extern "C" { #endif - - extern hid_t H5T_NATIVE_CHAR_g; - extern hid_t H5T_NATIVE_UCHAR_g; - extern hid_t H5T_NATIVE_SHORT_g; - extern hid_t H5T_NATIVE_USHORT_g; - extern hid_t H5T_NATIVE_INT_g; - extern hid_t H5T_NATIVE_UINT_g; - extern hid_t H5T_NATIVE_LONG_g; - extern hid_t H5T_NATIVE_INT8_g; - extern hid_t H5T_NATIVE_UINT8_g; - extern hid_t H5T_NATIVE_INT16_g; - extern hid_t H5T_NATIVE_UINT16_g; - extern hid_t H5T_NATIVE_INT32_g; - extern hid_t H5T_NATIVE_UINT32_g; - extern hid_t H5T_NATIVE_INT64_g; - extern hid_t H5T_NATIVE_UINT64_g; - extern hid_t H5T_NATIVE_ULONG_g; - extern hid_t H5T_NATIVE_LLONG_g; - extern hid_t H5T_NATIVE_ULLONG_g; - extern hid_t H5T_NATIVE_HYPER_g; - extern hid_t H5T_NATIVE_UHYPER_g; - extern hid_t H5T_NATIVE_FLOAT_g; - extern hid_t H5T_NATIVE_DOUBLE_g; - extern hid_t H5T_NATIVE_TIME_g; - extern hid_t H5T_NATIVE_STRING_g; - extern hid_t H5T_NATIVE_BITFIELD_g; - extern hid_t H5T_NATIVE_OPAQUE_g; +extern hid_t H5T_NATIVE_CHAR_g; +extern hid_t H5T_NATIVE_UCHAR_g; +extern hid_t H5T_NATIVE_SHORT_g; +extern hid_t H5T_NATIVE_USHORT_g; +extern hid_t H5T_NATIVE_INT_g; +extern hid_t H5T_NATIVE_UINT_g; +extern hid_t H5T_NATIVE_LONG_g; +extern hid_t H5T_NATIVE_INT8_g; +extern hid_t H5T_NATIVE_UINT8_g; +extern hid_t H5T_NATIVE_INT16_g; +extern hid_t H5T_NATIVE_UINT16_g; +extern hid_t H5T_NATIVE_INT32_g; +extern hid_t H5T_NATIVE_UINT32_g; +extern hid_t H5T_NATIVE_INT64_g; +extern hid_t H5T_NATIVE_UINT64_g; +extern hid_t H5T_NATIVE_ULONG_g; +extern hid_t H5T_NATIVE_LLONG_g; +extern hid_t H5T_NATIVE_ULLONG_g; +extern hid_t H5T_NATIVE_HYPER_g; +extern hid_t H5T_NATIVE_UHYPER_g; +extern hid_t H5T_NATIVE_FLOAT_g; +extern hid_t H5T_NATIVE_DOUBLE_g; +extern hid_t H5T_NATIVE_TIME_g; +extern hid_t H5T_NATIVE_STRING_g; +extern hid_t H5T_NATIVE_BITFIELD_g; +extern hid_t H5T_NATIVE_OPAQUE_g; /* Operations defined on all data types */ - hid_t H5Tcreate(H5T_class_t type, size_t size); - hid_t H5Tcopy(hid_t type_id); - herr_t H5Tclose(hid_t type_id); - hbool_t H5Tequal(hid_t type1_id, hid_t type2_id); - herr_t H5Tlock(hid_t type_id); +hid_t H5Tcreate (H5T_class_t type, size_t size); +hid_t H5Tcopy (hid_t type_id); +herr_t H5Tclose (hid_t type_id); +hbool_t H5Tequal (hid_t type1_id, hid_t type2_id); +herr_t H5Tlock (hid_t type_id); /* Operations defined on compound data types */ - herr_t H5Tinsert(hid_t parent_id, const char *name, off_t offset, - hid_t member_id); - herr_t H5Tpack(hid_t type_id); +herr_t H5Tinsert (hid_t parent_id, const char *name, off_t offset, + hid_t member_id); +herr_t H5Tpack (hid_t type_id); /* Querying property values */ - H5T_class_t H5Tget_class(hid_t type_id); - size_t H5Tget_size(hid_t type_id); - H5T_order_t H5Tget_order(hid_t type_id); - size_t H5Tget_precision(hid_t type_id); - size_t H5Tget_offset(hid_t type_id); - herr_t H5Tget_pad(hid_t type_id, H5T_pad_t *lsb /*out */ , - H5T_pad_t *msb /*out */ ); - H5T_sign_t H5Tget_sign(hid_t type_id); - herr_t H5Tget_fields(hid_t type_id, size_t *spos /*out */ , - size_t *epos /*out */ , size_t *esize /*out */ , - size_t *mpos /*out */ , size_t *msize /*out */ ); - size_t H5Tget_ebias(hid_t type_id); - H5T_norm_t H5Tget_norm(hid_t type_id); - H5T_pad_t H5Tget_inpad(hid_t type_id); - H5T_str_t H5Tget_strpad(hid_t type_id); - intn H5Tget_nmembers(hid_t type_id); - char *H5Tget_member_name(hid_t type_id, int membno); - size_t H5Tget_member_offset(hid_t type_id, int membno); - int H5Tget_member_dims(hid_t type_id, int membno, - int dims[] /*out */ , int perm[] /*out */ ); - hid_t H5Tget_member_type(hid_t type_id, int membno); - H5T_cset_t H5Tget_cset(hid_t type_id); +H5T_class_t H5Tget_class (hid_t type_id); +size_t H5Tget_size (hid_t type_id); +H5T_order_t H5Tget_order (hid_t type_id); +size_t H5Tget_precision (hid_t type_id); +size_t H5Tget_offset (hid_t type_id); +herr_t H5Tget_pad (hid_t type_id, H5T_pad_t *lsb/*out*/, + H5T_pad_t *msb/*out*/); +H5T_sign_t H5Tget_sign (hid_t type_id); +herr_t H5Tget_fields (hid_t type_id, size_t *spos/*out*/, + size_t *epos/*out*/, size_t *esize/*out*/, + size_t *mpos/*out*/, size_t *msize/*out*/); +size_t H5Tget_ebias (hid_t type_id); +H5T_norm_t H5Tget_norm (hid_t type_id); +H5T_pad_t H5Tget_inpad (hid_t type_id); +H5T_str_t H5Tget_strpad (hid_t type_id); +intn H5Tget_nmembers (hid_t type_id); +char *H5Tget_member_name (hid_t type_id, int membno); +size_t H5Tget_member_offset (hid_t type_id, int membno); +int H5Tget_member_dims (hid_t type_id, int membno, int dims[]/*out*/, + int perm[]/*out*/); +hid_t H5Tget_member_type (hid_t type_id, int membno); +H5T_cset_t H5Tget_cset (hid_t type_id); /* Setting property values */ - herr_t H5Tset_size(hid_t type_id, size_t size); - herr_t H5Tset_order(hid_t type_id, H5T_order_t order); - herr_t H5Tset_precision(hid_t type_id, size_t prec); - herr_t H5Tset_offset(hid_t type_id, size_t offset); - herr_t H5Tset_pad(hid_t type_id, H5T_pad_t lsb, H5T_pad_t msb); - herr_t H5Tset_sign(hid_t type_id, H5T_sign_t sign); - herr_t H5Tset_fields(hid_t type_id, size_t spos, size_t epos, size_t esize, - size_t mpos, size_t msize); - herr_t H5Tset_ebias(hid_t type_id, size_t ebias); - herr_t H5Tset_norm(hid_t type_id, H5T_norm_t norm); - herr_t H5Tset_inpad(hid_t type_id, H5T_pad_t pad); - herr_t H5Tset_cset(hid_t type_id, H5T_cset_t cset); - herr_t H5Tset_strpad(hid_t type_id, H5T_str_t strpad); +herr_t H5Tset_size (hid_t type_id, size_t size); +herr_t H5Tset_order (hid_t type_id, H5T_order_t order); +herr_t H5Tset_precision (hid_t type_id, size_t prec); +herr_t H5Tset_offset (hid_t type_id, size_t offset); +herr_t H5Tset_pad (hid_t type_id, H5T_pad_t lsb, H5T_pad_t msb); +herr_t H5Tset_sign (hid_t type_id, H5T_sign_t sign); +herr_t H5Tset_fields (hid_t type_id, size_t spos, size_t epos, size_t esize, + size_t mpos, size_t msize); +herr_t H5Tset_ebias (hid_t type_id, size_t ebias); +herr_t H5Tset_norm (hid_t type_id, H5T_norm_t norm); +herr_t H5Tset_inpad (hid_t type_id, H5T_pad_t pad); +herr_t H5Tset_cset (hid_t type_id, H5T_cset_t cset); +herr_t H5Tset_strpad (hid_t type_id, H5T_str_t strpad); /* Type conversion database */ - herr_t H5Tregister_hard(hid_t src_id, hid_t dst_id, H5T_conv_t func); - herr_t H5Tregister_soft(H5T_class_t src, H5T_class_t dst, H5T_conv_t func); - herr_t H5Tunregister(H5T_conv_t func); - H5T_conv_t H5Tfind(hid_t src_id, hid_t dst_id); +herr_t H5Tregister_hard (hid_t src_id, hid_t dst_id, H5T_conv_t func); +herr_t H5Tregister_soft (H5T_class_t src, H5T_class_t dst, H5T_conv_t func); +herr_t H5Tunregister (H5T_conv_t func); +H5T_conv_t H5Tfind (hid_t src_id, hid_t dst_id); #ifdef __cplusplus } - #endif #endif diff --git a/src/H5detect.c b/src/H5detect.c index 749618f..242613d 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -271,6 +271,7 @@ print_results(int nd, detected_t *d) #define H5T_PACKAGE /*suppress error about including H5Tpkg.h*/\n\ \n\ #include <H5private.h>\n\ +#include <H5Aprivate.h>\n\ #include <H5Eprivate.h>\n\ #include <H5MMprivate.h>\n\ #include <H5Tpkg.h>\n\ @@ -342,7 +343,7 @@ H5T_init (void)\n\ /* Atomize the type */ printf("\ - if ((H5T_NATIVE_%s_g = H5Aregister_atom (H5_DATATYPE, dt))<0) {\n\ + if ((H5T_NATIVE_%s_g = H5A_register (H5_DATATYPE, dt))<0) {\n\ HRETURN_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL,\n\ \"can't initialize type system (atom registration \"\n\ \"failure\");\n\ diff --git a/src/H5private.h b/src/H5private.h index 2bf8139..831af24 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -409,8 +409,8 @@ extern char *strdup(const char *s); * *------------------------------------------------------------------------- */ -extern hbool_t library_initialize_g; /*good thing C's lazy about extern! */ -extern hbool_t thread_initialize_g; /*don't decl interface_initialize_g */ +extern hbool_t library_initialize_g; /*good thing C's lazy about extern! */ +extern hbool_t thread_initialize_g; /*don't decl interface_initialize_g */ #define FUNC_ENTER(func_name,err) FUNC_ENTER_INIT(func_name,INTERFACE_INIT,err) @@ -478,10 +478,10 @@ extern hbool_t thread_initialize_g; /*don't decl interface_initializ #endif /* Private functions, not part of the publicly documented API */ -herr_t H5_init_library(void); -void H5_term_library(void); -herr_t H5_add_exit(void (*func) (void)); -herr_t H5_init_thread(void); -void H5_term_thread(void); +herr_t H5_init_library(void); +void H5_term_library(void); +herr_t H5_add_exit(void (*func) (void)); +herr_t H5_init_thread(void); +void H5_term_thread(void); #endif diff --git a/src/H5public.h b/src/H5public.h index b92d498..8fa0cc4 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -10,15 +10,13 @@ * * ****************************************************************************/ -/* $Id$ */ - /* * This file contains public declarations for the H5 module. */ - #ifndef _H5public_H #define _H5public_H -#include <H5config.h> /* From configure */ + +#include <H5config.h> /*from configure */ #include <sys/types.h> /* @@ -93,6 +91,7 @@ typedef unsigned uintn; * values. */ typedef intn herr_t; + #define SUCCEED 0 #define FAIL (-1) #define UFAIL (unsigned)(-1) @@ -101,22 +100,21 @@ typedef intn herr_t; * Boolean type. */ typedef enum { - BFAIL = (-1), /*error value */ - BFALSE = 0, - BTRUE = 1 + BFAIL = (-1), /*error value */ + BFALSE = 0, + BTRUE = 1 } hbool_t; #ifdef __cplusplus -extern "C" { +extern "C" { #endif /* Functions in H5.c */ - herr_t H5init(void); - herr_t H5dont_atexit(void); - herr_t H5version(uintn *majnum, uintn *minnum, uintn *relnum, uintn *patnum); +herr_t H5init (void); +herr_t H5dont_atexit (void); +herr_t H5version (uintn *majnum, uintn *minnum, uintn *relnum, uintn *patnum); #ifdef __cplusplus } - #endif #endif diff --git a/src/debug.c b/src/debug.c index 3787318..fb2b311 100644 --- a/src/debug.c +++ b/src/debug.c @@ -15,6 +15,7 @@ *------------------------------------------------------------------------- */ #include <H5private.h> +#include <H5Aprivate.h> #include <H5Bprivate.h> #include <H5Fprivate.h> #include <H5Gprivate.h> @@ -59,7 +60,7 @@ main(int argc, char *argv[]) fprintf(stderr, "cannot open file\n"); HDexit(1); } - if (NULL == (f = H5Aatom_object(fid))) { + if (NULL == (f = H5A_object(fid))) { fprintf(stderr, "cannot obtain H5F_t pointer\n"); HDexit(2); } @@ -10,8 +10,6 @@ * * ****************************************************************************/ -/* $Id$ */ - /* * This is the main public HDF5 include file. Put further information in * a particular header file and include that here, don't fill this file with @@ -36,5 +34,4 @@ #include <H5Opublic.h> #include <H5Ppublic.h> #include <H5Tpublic.h> - #endif |