~ubuntu-branches/ubuntu/quantal/xdmf/quantal

« back to all changes in this revision

Viewing changes to Utilities/hdf5/H5HGpkg.h

  • Committer: Bazaar Package Importer
  • Author(s): Alastair McKinstry
  • Date: 2011-07-09 10:33:32 UTC
  • Revision ID: james.westby@ubuntu.com-20110709103332-2w36cerw7215fzoe
Tags: upstream-2.1.dfsg.1
ImportĀ upstreamĀ versionĀ 2.1.dfsg.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 
2
 * Copyright by the Board of Trustees of the University of Illinois.         *
 
3
 * All rights reserved.                                                      *
 
4
 *                                                                           *
 
5
 * This file is part of HDF5.  The full HDF5 copyright notice, including     *
 
6
 * terms governing use, modification, and redistribution, is contained in    *
 
7
 * the files COPYING and Copyright.html.  COPYING can be found at the root   *
 
8
 * of the source code distribution tree; Copyright.html can be found at the  *
 
9
 * root level of an installed copy of the electronic HDF5 document set and   *
 
10
 * is linked from the top-level documents page.  It can also be found at     *
 
11
 * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html.  If you do not have     *
 
12
 * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
 
13
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
14
 
 
15
/*
 
16
 * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
 
17
 *             Wednesday, July 9, 2003
 
18
 *
 
19
 * Purpose:     This file contains declarations which are visible
 
20
 *              only within the H5HG package. Source files outside the
 
21
 *              H5HG package should include H5HGprivate.h instead.
 
22
 */
 
23
#ifndef H5HG_PACKAGE
 
24
#error "Do not include this file outside the H5HG package!"
 
25
#endif
 
26
 
 
27
#ifndef _H5HGpkg_H
 
28
#define _H5HGpkg_H
 
29
 
 
30
/* Get package's private header */
 
31
#include "H5HGprivate.h"
 
32
 
 
33
/* Other private headers needed by this file */
 
34
 
 
35
/*****************************/
 
36
/* Package Private Variables */
 
37
/*****************************/
 
38
 
 
39
/* The cache subclass */
 
40
H5_DLLVAR const H5AC_class_t H5AC_GHEAP[1];
 
41
 
 
42
/**************************/
 
43
/* Package Private Macros */
 
44
/**************************/
 
45
 
 
46
/*
 
47
 * Pad all global heap messages to a multiple of eight bytes so we can load
 
48
 * the entire collection into memory and operate on it there.  Eight should
 
49
 * be sufficient for machines that have alignment constraints because our
 
50
 * largest data type is eight bytes.
 
51
 */
 
52
#define H5HG_ALIGNMENT  8
 
53
#define H5HG_ALIGN(X)  (H5HG_ALIGNMENT*(((X)+H5HG_ALIGNMENT-1)/        \
 
54
           H5HG_ALIGNMENT))
 
55
#define H5HG_ISALIGNED(X) ((X)==H5HG_ALIGN(X))
 
56
 
 
57
/*
 
58
 * The overhead associated with each object in the heap, always a multiple of
 
59
 * the alignment so that the stuff that follows the header is aligned.
 
60
 */
 
61
#define H5HG_SIZEOF_OBJHDR(f)                  \
 
62
    H5HG_ALIGN(2 +      /*object id number  */        \
 
63
         2 +      /*reference count  */        \
 
64
         4 +      /*reserved    */        \
 
65
         H5F_SIZEOF_SIZE(f))  /*object data size  */
 
66
 
 
67
/****************************/
 
68
/* Package Private Typedefs */
 
69
/****************************/
 
70
 
 
71
typedef struct H5HG_obj_t {
 
72
    int    nrefs;    /*reference count    */
 
73
    size_t    size;    /*total size of object    */
 
74
    uint8_t    *begin;    /*ptr to object into heap->chunk*/
 
75
} H5HG_obj_t;
 
76
 
 
77
struct H5HG_heap_t {
 
78
    H5AC_info_t cache_info; /* Information for H5AC cache functions, _must_ be */
 
79
                            /* first field in structure */
 
80
    haddr_t    addr;    /*collection address    */
 
81
    size_t    size;    /*total size of collection  */
 
82
    uint8_t    *chunk;    /*the collection, incl. header  */
 
83
    size_t    nalloc;    /*numb object slots allocated  */
 
84
    size_t    nused;    /*number of slots used    */
 
85
                                        /* If this value is >65535 then all indices */
 
86
                                        /* have been used at some time and the */
 
87
                                        /* correct new index should be searched for */
 
88
    H5HG_obj_t  *obj;    /*array of object descriptions  */
 
89
};
 
90
 
 
91
/******************************/
 
92
/* Package Private Prototypes */
 
93
/******************************/
 
94
 
 
95
#endif
 
96