summaryrefslogtreecommitdiffstats
path: root/src/H5R.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2012-07-16 19:54:26 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2012-07-16 19:54:26 (GMT)
commit75f4e51a1a076ea2f1602619e2a7d7bcce13c2f1 (patch)
treeb6e08ce3ecbd535ffe74269d7e44c905e19b137d /src/H5R.c
parent2e3ab09a520ff87ec709b5997273ce7f3b99d9ed (diff)
downloadhdf5-75f4e51a1a076ea2f1602619e2a7d7bcce13c2f1.zip
hdf5-75f4e51a1a076ea2f1602619e2a7d7bcce13c2f1.tar.gz
hdf5-75f4e51a1a076ea2f1602619e2a7d7bcce13c2f1.tar.bz2
[svn-r22582] Description:
Refactor ID class registration to be more like how other "class"s in the library are registered, and clean up compiler warnings. Tested on: Mac OSX/64 10.7.4 (amazon) w/debug (Too minor to require h5comittest)
Diffstat (limited to 'src/H5R.c')
-rw-r--r--src/H5R.c51
1 files changed, 46 insertions, 5 deletions
diff --git a/src/H5R.c b/src/H5R.c
index 57eab83..8fac4bf 100644
--- a/src/H5R.c
+++ b/src/H5R.c
@@ -13,12 +13,19 @@
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/****************/
+/* Module Setup */
+/****************/
+
#define H5R_PACKAGE /*suppress error about including H5Rpkg */
/* Interface initialization */
#define H5_INTERFACE_INIT_FUNC H5R_init_interface
+/***********/
+/* Headers */
+/***********/
#include "H5private.h" /* Generic Functions */
#include "H5ACprivate.h" /* Metadata cache */
#include "H5Dprivate.h" /* Datasets */
@@ -30,18 +37,52 @@
#include "H5Rpkg.h" /* References */
#include "H5Sprivate.h" /* Dataspaces */
-/* Local macro definitions */
-/* Number of reserved IDs in ID group */
-#define H5R_RESERVED_ATOMS 0
+/****************/
+/* Local Macros */
+/****************/
+
+
+/******************/
+/* Local Typedefs */
+/******************/
+
+
+/********************/
+/* Local Prototypes */
+/********************/
-/* Static functions */
static herr_t H5R_create(void *ref, H5G_loc_t *loc, const char *name,
H5R_type_t ref_type, H5S_t *space, hid_t dxpl_id);
static H5S_t * H5R_get_region(H5F_t *file, hid_t dxpl_id, const void *_ref);
static ssize_t H5R_get_name(H5F_t *file, hid_t lapl_id, hid_t dxpl_id, hid_t id,
H5R_type_t ref_type, const void *_ref, char *name, size_t size);
+
+/*********************/
+/* Package Variables */
+/*********************/
+
+
+/*****************************/
+/* Library Private Variables */
+/*****************************/
+
+
+/*******************/
+/* Local Variables */
+/*******************/
+
+/* Reference ID class */
+static const H5I_class_t H5I_REFERENCE_CLS[1] = {{
+ H5I_REFERENCE, /* ID class value */
+ 0, /* Class flags */
+ 64, /* Minimum hash size for class */
+ 0, /* # of reserved IDs for class */
+ NULL /* Callback routine for closing objects of this class */
+}};
+
+
/*-------------------------------------------------------------------------
* Function: H5R_init
@@ -89,7 +130,7 @@ H5R_init_interface(void)
FUNC_ENTER_NOAPI_NOINIT
/* Initialize the atom group for the file IDs */
- if(H5I_register_type(H5I_REFERENCE, (size_t)H5I_REFID_HASHSIZE, H5R_RESERVED_ATOMS, (H5I_free_t)NULL) < 0)
+ if(H5I_register_type(H5I_REFERENCE_CLS) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable to initialize interface");
done: