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 #include "H5ACprivate.h"        /* Metadata cache                       */
00036 #include "H5FLprivate.h"        /* Free Lists                           */
00037 #include "H5RCprivate.h"        /* Reference counted objects            */
00038 
00039 
00040 /**************************/
00041 /* Package Private Macros */
00042 /**************************/
00043 
00044 /* Get the native key at a given index */
00045 #define H5B_NKEY(b, shared, idx)  ((b)->native + (shared)->nkey[(idx)])
00046 
00047 
00048 /****************************/
00049 /* Package Private Typedefs */
00050 /****************************/
00051 
00052 /* The B-tree node as stored in memory...  */
00053 typedef struct H5B_t {
00054     H5AC_info_t cache_info; /* Information for H5AC cache functions */
00055                             /* _must_ be first field in structure */
00056     H5RC_t              *rc_shared;     /*ref-counted shared info            */
00057     unsigned            level;          /*node level                         */
00058     unsigned            nchildren;      /*number of child pointers           */
00059     haddr_t             left;           /*address of left sibling            */
00060     haddr_t             right;          /*address of right sibling           */
00061     uint8_t             *native;        /*array of keys in native format     */
00062     haddr_t             *child;         /*2k child pointers                  */
00063 } H5B_t;
00064 
00065 /*****************************/
00066 /* Package Private Variables */
00067 /*****************************/
00068 
00069 /* H5B header inherits cache-like properties from H5AC */
00070 H5_DLLVAR const H5AC_class_t H5AC_BT[1];
00071 
00072 /* Declare a free list to manage the haddr_t sequence information */
00073 H5FL_SEQ_EXTERN(haddr_t);
00074 
00075 /* Declare a PQ free list to manage the native block information */
00076 H5FL_BLK_EXTERN(native_block);
00077 
00078 /* Declare a free list to manage the H5B_t struct */
00079 H5FL_EXTERN(H5B_t);
00080 
00081 
00082 /******************************/
00083 /* Package Private Prototypes */
00084 /******************************/
00085 H5_DLL herr_t H5B_dest(H5F_t *f, H5B_t *b);
00086 #ifdef H5B_DEBUG
00087 herr_t H5B_assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type,
00088                          void *udata);
00089 #endif
00090 
00091 #endif /*_H5Bpkg_H*/
00092