/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * * the files COPYING and Copyright.html. COPYING can be found at the root * * of the source code distribution tree; Copyright.html can be found at the * * root level of an installed copy of the electronic HDF5 document set and * * is linked from the top-level documents page. It can also be found at * * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*----------------------------------------------------------------------------- * File: H5Iprivate.h * Purpose: header file for ID API *---------------------------------------------------------------------------*/ /* avoid re-inclusion */ #ifndef _H5Iprivate_H #define _H5Iprivate_H #include "H5Ipublic.h" /*include Public Definitions */ /* Private headers needed by this file */ #include "H5private.h" /* Default sizes of the hash-tables for various atom groups */ #define H5I_ERRSTACK_HASHSIZE 64 #define H5I_FILEID_HASHSIZE 64 #define H5I_TEMPID_HASHSIZE 64 #define H5I_DATATYPEID_HASHSIZE 64 #define H5I_DATASPACEID_HASHSIZE 64 #define H5I_DATASETID_HASHSIZE 64 #define H5I_OID_HASHSIZE 64 #define H5I_GROUPID_HASHSIZE 64 #define H5I_ATTRID_HASHSIZE 64 #define H5I_TEMPBUFID_HASHSIZE 64 #define H5I_REFID_HASHSIZE 64 #define H5I_VFL_HASHSIZE 64 #define H5I_GENPROPCLS_HASHSIZE 64 #define H5I_GENPROPOBJ_HASHSIZE 128 /* * Define the following macro for fast hash calculations (but limited * hash sizes) */ #define HASH_SIZE_POWER_2 /* Define the following macro for atom caching over all the atoms */ #define IDS_ARE_CACHED #ifdef IDS_ARE_CACHED # define ID_CACHE_SIZE 4 /*# of previous atoms cached */ #endif /* * Number of bits to use for Group ID in each atom. Increase if H5I_NGROUPS * becomes too large (an assertion would fail in H5I_init_interface). This is * the only number that must be changed since all other bit field sizes and * masks are calculated from GROUP_BITS. */ #define GROUP_BITS 5 #define GROUP_MASK ((1<>ID_BITS) & GROUP_MASK)) #ifdef HASH_SIZE_POWER_2 /* * Map an ID to a hash location (assumes s is a power of 2 and smaller * than the ID_MASK constant). */ # define H5I_LOC(a,s) ((hid_t)((size_t)(a)&((s)-1))) # define POWER_OF_TWO(n) ((((n) - 1) & (n)) == 0 && (n) > 0) #else /* * Map an ID to a hash location. */ # define H5I_LOC(a,s) (((hid_t)(a)&ID_MASK)%(s)) #endif /* Combine a Group number and an atom index into an atom */ #define H5I_MAKE(g,i) ((((hid_t)(g)&GROUP_MASK)<