34 #define HASH_SIZE_POWER_2 37 #define ATOMS_ARE_CACHED 40 #ifdef ATOMS_ARE_CACHED 41 #define ATOMS_CACHE_INLINE 44 #ifdef ATOMS_CACHE_INLINE 46 #define HAIswap_cache(i,j) \ 47 atom_id_cache[i]^=atom_id_cache[j], \ 48 atom_obj_cache[i]=(void *)((hdf_pint_t)atom_obj_cache[j]^(hdf_pint_t)atom_obj_cache[i]), \ 49 atom_id_cache[j]^=atom_id_cache[i], \ 50 atom_obj_cache[j]=(void *)((hdf_pint_t)atom_obj_cache[i]^(hdf_pint_t)atom_obj_cache[j]), \ 51 atom_id_cache[i]^=atom_id_cache[j], \ 52 atom_obj_cache[i]=(void *)((hdf_pint_t)atom_obj_cache[i]^(hdf_pint_t)atom_obj_cache[j]) 55 #define HAatom_object(atm) \ 56 (atom_id_cache[0]==atm ? atom_obj_cache[0] : \ 57 atom_id_cache[1]==atm ? (HAIswap_cache(0,1),atom_obj_cache[0]) : \ 58 atom_id_cache[2]==atm ? (HAIswap_cache(1,2),atom_obj_cache[1]) : \ 59 atom_id_cache[3]==atm ? (HAIswap_cache(2,3),atom_obj_cache[2]) : \ 85 #if defined ATOM_MASTER | defined ATOM_TESTER 89 #define GROUP_MASK 0x0F 93 #define ATOM_MASK 0x0FFFFFFF 95 #ifdef ATOMS_ARE_CACHED 97 #define ATOM_CACHE_SIZE 4 101 #define ATOM_TO_GROUP(a) ((group_t)((((atom_t)(a))>>((sizeof(atom_t)*8)-GROUP_BITS))&GROUP_MASK)) 103 #ifdef HASH_SIZE_POWER_2 105 #define ATOM_TO_LOC(a,s) ((atom_t)(a)&((s)-1)) 108 #define ATOM_TO_LOC(a,s) (((atom_t)(a)&ATOM_MASK)%(s)) 112 #define MAKE_ATOM(g,i) ((((atom_t)(g)&GROUP_MASK)<<((sizeof(atom_t)*8)-GROUP_BITS))|((atom_t)(i)&ATOM_MASK)) 115 typedef struct atom_info_struct_tag {
118 struct atom_info_struct_tag *next;
122 typedef struct atom_group_struct_tag {
127 atom_info_t **atom_list;
134 static atom_group_t *atom_group_list[
MAXGROUP]={NULL};
137 static atom_info_t *atom_free_list=NULL;
139 #ifdef ATOMS_ARE_CACHED 160 #if defined c_plusplus || defined __cplusplus 230 #ifdef ATOMS_CACHE_INLINE 298 #if defined c_plusplus || defined __cplusplus HDFFCLIBAPI intf intf intf * count
HDFLIBAPI atom_t HAregister_atom(group_t grp, VOIDP object)
intn(* HAsearch_func_t)(const void *obj, const void *key)
#define HAatom_object(atm)
HDFLIBAPI intn HAshutdown(void)
HDFLIBAPI VOIDP HAremove_atom(atom_t atm)
HDFLIBAPI intn HAdestroy_group(group_t grp)
HDFLIBAPI atom_t atom_id_cache[]
HDFLIBAPI VOIDP HAsearch_atom(group_t grp, HAsearch_func_t func, const void *key)
HDFLIBAPI VOIDP HAPatom_object(atom_t atm)
HDFLIBAPI group_t HAatom_group(atom_t atm)
HDFLIBAPI intn HAinit_group(group_t grp, intn hash_size)
HDFLIBAPI VOIDP atom_obj_cache[]