H5HLprivate.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  *
00018  * Created:             H5HLprivate.h
00019  *                      Jul 16 1997
00020  *                      Robb Matzke <matzke@llnl.gov>
00021  *
00022  * Purpose:
00023  *
00024  * Modifications:
00025  *
00026  *-------------------------------------------------------------------------
00027  */
00028 #ifndef _H5HLprivate_H
00029 #define _H5HLprivate_H
00030 
00031 /* Include package's public header */
00032 #include "H5HLpublic.h"
00033 
00034 /* Private headers needed by this file. */
00035 #include "H5private.h"          /* Generic Functions                    */
00036 #include "H5ACprivate.h"        /* Metadata cache                       */
00037 #include "H5Fprivate.h"         /* File access                          */
00038 
00039 /*
00040  * Feature: Define H5HL_DEBUG on the compiler command line if you want to
00041  *          diagnostic messages from this layer.
00042  */
00043 #ifdef NDEBUG
00044 #  undef H5HL_DEBUG
00045 #endif
00046 
00047 #define H5HL_ALIGN(X)   (((X)+7)&(unsigned)(~0x07)) /*align on 8-byte boundary  */
00048 
00049 #define H5HL_SIZEOF_FREE(F)                                                   \
00050     H5HL_ALIGN(H5F_SIZEOF_SIZE (F) +    /*ptr to next free block        */    \
00051                H5F_SIZEOF_SIZE (F))     /*size of this free block       */
00052 
00053 /****************************/
00054 /* Library Private Typedefs */
00055 /****************************/
00056 
00057 /* Typedef for local heap in memory (defined in H5HLpkg.h) */
00058 typedef struct H5HL_t H5HL_t;
00059 
00060 /*
00061  * Library prototypes...
00062  */
00063 H5_DLL herr_t H5HL_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, haddr_t *addr/*out*/);
00064 H5_DLL H5HL_t *H5HL_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5AC_protect_t rw);
00065 H5_DLL void *H5HL_offset_into(const H5HL_t *heap, size_t offset);
00066 H5_DLL herr_t H5HL_remove(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t offset,
00067     size_t size);
00068 H5_DLL herr_t H5HL_unprotect(H5HL_t *heap);
00069 H5_DLL size_t H5HL_insert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t size,
00070     const void *buf);
00071 H5_DLL herr_t H5HL_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr);
00072 H5_DLL herr_t H5HL_get_size(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t *size);
00073 H5_DLL herr_t H5HL_heapsize(H5F_t *f, hid_t dxpl_id, haddr_t addr, hsize_t *heap_size);
00074 
00075 /* Debugging functions */
00076 H5_DLL herr_t H5HL_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent,
00077                           int fwidth);
00078 #endif
00079