summaryrefslogtreecommitdiffstats
path: root/src/H5HGquery.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2011-07-20 21:47:15 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2011-07-20 21:47:15 (GMT)
commit08bb61054759d30c048af7baf1ca144b93ac9ce0 (patch)
tree6267483df5703b615d7b657145fa9bbe80ee8ee7 /src/H5HGquery.c
parent0a5bcc1df0ee1008e7c967facaa8b06797b669e1 (diff)
downloadhdf5-08bb61054759d30c048af7baf1ca144b93ac9ce0.zip
hdf5-08bb61054759d30c048af7baf1ca144b93ac9ce0.tar.gz
hdf5-08bb61054759d30c048af7baf1ca144b93ac9ce0.tar.bz2
[svn-r21133] Description:
More code cleanups to reduce coupling between packages that use the H5F internal routines, but really aren't part of the H5F "package". Tested on: FreeBSD/32 8.2 (loyalty) w/gcc4.6, w/C++ & FORTRAN, in debug mode FreeBSD/64 8.2 (freedom) w/gcc4.6, w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (koala) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, w/threadsafe, in production mode Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode Mac OS X/32 10.6.8 (amazon) in debug mode
Diffstat (limited to 'src/H5HGquery.c')
-rw-r--r--src/H5HGquery.c145
1 files changed, 145 insertions, 0 deletions
diff --git a/src/H5HGquery.c b/src/H5HGquery.c
new file mode 100644
index 0000000..ae0a2b7
--- /dev/null
+++ b/src/H5HGquery.c
@@ -0,0 +1,145 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * 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://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
+ * access to either file, you may request a copy from help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Wednesday, July 20, 2011
+ *
+ * Purpose: Query routines for global heaps.
+ *
+ */
+
+/****************/
+/* Module Setup */
+/****************/
+
+#define H5HG_PACKAGE /*suppress error about including H5HGpkg */
+
+
+/***********/
+/* Headers */
+/***********/
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5HGpkg.h" /* Global heaps */
+
+
+/****************/
+/* Local Macros */
+/****************/
+
+
+/******************/
+/* Local Typedefs */
+/******************/
+
+
+/********************/
+/* Package Typedefs */
+/********************/
+
+
+/********************/
+/* Local Prototypes */
+/********************/
+
+
+/*********************/
+/* Package Variables */
+/*********************/
+
+
+/*****************************/
+/* Library Private Variables */
+/*****************************/
+
+
+/*******************/
+/* Local Variables */
+/*******************/
+
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5HG_get_addr
+ *
+ * Purpose: Query the address of a global heap object.
+ *
+ * Return: Address of heap on success/abort on failure (shouldn't fail)
+ *
+ * Programmer: Quincey Koziol
+ * Wednesday, July 20, 2011
+ *
+ *-------------------------------------------------------------------------
+ */
+haddr_t
+H5HG_get_addr(const H5HG_heap_t *heap)
+{
+ /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HG_get_addr)
+
+ HDassert(heap);
+
+ FUNC_LEAVE_NOAPI(heap->addr)
+} /* H5HG_get_addr() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5HG_get_size
+ *
+ * Purpose: Query the size of a global heap object.
+ *
+ * Return: Size of heap on success/abort on failure (shouldn't fail)
+ *
+ * Programmer: Quincey Koziol
+ * Wednesday, July 20, 2011
+ *
+ *-------------------------------------------------------------------------
+ */
+size_t
+H5HG_get_size(const H5HG_heap_t *heap)
+{
+ /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HG_get_size)
+
+ HDassert(heap);
+
+ FUNC_LEAVE_NOAPI(heap->size)
+} /* H5HG_get_size() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5HG_get_free_size
+ *
+ * Purpose: Query the free size of a global heap object.
+ *
+ * Return: Free size of heap on success/abort on failure (shouldn't fail)
+ *
+ * Programmer: Quincey Koziol
+ * Wednesday, July 20, 2011
+ *
+ *-------------------------------------------------------------------------
+ */
+size_t
+H5HG_get_free_size(const H5HG_heap_t *heap)
+{
+ /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HG_get_free_size)
+
+ HDassert(heap);
+
+ FUNC_LEAVE_NOAPI(heap->obj[0].size)
+} /* H5HG_get_free_size() */
+