H5Bpkg.h

00001 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00002  * Copyright by The HDF Group.                                               *
00003  * Copyright by the Board of Trustees of the University of Illinois.         *
00004  * All rights reserved.                                                      *
00005  *                                                                           *
00006  * This file is part of HDF5.  The full HDF5 copyright notice, including     *
00007  * terms governing use, modification, and redistribution, is contained in    *
00008  * the files COPYING and Copyright.html.  COPYING can be found at the root   *
00009  * of the source code distribution tree; Copyright.html can be found at the  *
00010  * root level of an installed copy of the electronic HDF5 document set and   *
00011  * is linked from the top-level documents page.  It can also be found at     *
00012  * http://hdfgroup.org/HDF5/doc/Copyright.html.  If you do not have          *
00013  * access to either file, you may request a copy from help@hdfgroup.org.     *
00014  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
00015 
00016 /*
00017  * Programmer:  Quincey Koziol <koziol@ncsa.uiuc.edu>
00018  *              Thursday, May 15, 2003
00019  *
00020  * Purpose:     This file contains declarations which are visible only within
00021  *              the H5B package.  Source files outside the H5B package should
00022  *              include H5Bprivate.h instead.
00023  */
00024 #ifndef H5B_PACKAGE
00025 #error "Do not include this file outside the H5B package!"
00026 #endif
00027 
00028 #ifndef _H5Bpkg_H
00029 #define _H5Bpkg_H
00030 
00031 /* Get package's private header */
00032 #include "H5Bprivate.h"
00033 
00034 /* Other private headers needed by this file */
00035 
00036 /**************************/
00037 /* Package Private Macros */
00038 /**************************/
00039 
00040 /* Get the native key at a given index */
00041 #define H5B_NKEY(b, shared, idx)  ((b)->native + (shared)->nkey[(idx)])
00042 
00043 
00044 /****************************/
00045 /* Package Private Typedefs */
00046 /****************************/
00047 
00048 /* The B-tree node as stored in memory...  */
00049 struct H5B_t {
00050     H5AC_info_t cache_info; /* Information for H5AC cache functions, _must_ be */
00051                             /* first field in structure */
00052     H5RC_t              *rc_shared;     /*ref-counted shared info            */
00053     unsigned            level;          /*node level                         */
00054     unsigned            nchildren;      /*number of child pointers           */
00055     haddr_t             left;           /*address of left sibling            */
00056     haddr_t             right;          /*address of right sibling           */
00057     uint8_t             *native;        /*array of keys in native format     */
00058     haddr_t             *child;         /*2k child pointers                  */
00059 };
00060 
00061 /*****************************/
00062 /* Package Private Variables */
00063 /*****************************/
00064 
00065 /* H5B header inherits cache-like properties from H5AC */
00066 H5_DLLVAR const H5AC_class_t H5AC_BT[1];
00067 
00068 /* Declare a free list to manage the haddr_t sequence information */
00069 H5FL_SEQ_EXTERN(haddr_t);
00070 
00071 /* Declare a PQ free list to manage the native block information */
00072 H5FL_BLK_EXTERN(native_block);
00073 
00074 /* Declare a free list to manage the H5B_t struct */
00075 H5FL_EXTERN(H5B_t);
00076 
00077 /******************************/
00078 /* Package Private Prototypes */
00079 /******************************/
00080 H5_DLL herr_t H5B_dest(H5F_t *f, H5B_t *b);
00081 #ifdef H5B_DEBUG
00082 herr_t H5B_assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type,
00083                          void *udata);
00084 #endif
00085 
00086 #endif /*_H5Bpkg_H*/
00087