diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2012-07-16 20:28:44 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2012-07-16 20:28:44 (GMT) |
commit | 43995f12ac694455b3ca42292eb8cea15c08817e (patch) | |
tree | aec930ca82315c1dec81579aff20bc12c1db67db /src/H5F.c | |
parent | 0f43d84b3c7292bfb7d51218f02738028f818ff0 (diff) | |
download | hdf5-43995f12ac694455b3ca42292eb8cea15c08817e.zip hdf5-43995f12ac694455b3ca42292eb8cea15c08817e.tar.gz hdf5-43995f12ac694455b3ca42292eb8cea15c08817e.tar.bz2 |
[svn-r22583] Description:
Bring r22582 from trunk to 1.8 branch:
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/H5F.c')
-rw-r--r-- | src/H5F.c | 55 |
1 files changed, 52 insertions, 3 deletions
@@ -13,13 +13,19 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/****************/ +/* Module Setup */ +/****************/ + #define H5F_PACKAGE /*suppress error about including H5Fpkg */ /* Interface initialization */ #define H5_INTERFACE_INIT_FUNC H5F_init_interface -/* Packages needed by this file... */ +/***********/ +/* Headers */ +/***********/ #include "H5private.h" /* Generic Functions */ #include "H5Aprivate.h" /* Attributes */ #include "H5ACprivate.h" /* Metadata cache */ @@ -48,6 +54,16 @@ #endif #include "H5FDdirect.h" /*Linux direct I/O */ + +/****************/ +/* Local Macros */ +/****************/ + + +/******************/ +/* Local Typedefs */ +/******************/ + /* Struct only used by functions H5F_get_objects and H5F_get_objects_cb */ typedef struct H5F_olist_t { H5I_type_t obj_type; /* Type of object to look for */ @@ -64,7 +80,15 @@ typedef struct H5F_olist_t { size_t max_index; /* Maximum # of IDs to put into array */ } H5F_olist_t; -/* PRIVATE PROTOTYPES */ + +/********************/ +/* Package Typedefs */ +/********************/ + + +/********************/ +/* Local Prototypes */ +/********************/ static herr_t H5F_get_objects(const H5F_t *f, unsigned types, size_t max_index, hid_t *obj_id_list, hbool_t app_ref, size_t *obj_id_count_ptr); static int H5F_get_objects_cb(void *obj_ptr, hid_t obj_id, void *key); static H5F_t *H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id, @@ -74,12 +98,37 @@ static herr_t H5F_build_actual_name(const H5F_t *f, const H5P_genplist_t *fapl, static herr_t H5F_dest(H5F_t *f, hid_t dxpl_id, hbool_t flush); static herr_t H5F_close(H5F_t *f); + +/*********************/ +/* Package Variables */ +/*********************/ + + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + + +/*******************/ +/* Local Variables */ +/*******************/ + /* Declare a free list to manage the H5F_t struct */ H5FL_DEFINE(H5F_t); /* Declare a free list to manage the H5F_file_t struct */ H5FL_DEFINE(H5F_file_t); +/* File ID class */ +static const H5I_class_t H5I_FILE_CLS[1] = {{ + H5I_FILE, /* ID class value */ + 0, /* Class flags */ + 64, /* Minimum hash size for class */ + 0, /* # of reserved IDs for class */ + (H5I_free_t)H5F_close /* Callback routine for closing objects of this class */ +}}; + + /*------------------------------------------------------------------------- * Function: H5F_init @@ -130,7 +179,7 @@ H5F_init_interface(void) /* * Initialize the atom group for the file IDs. */ - if(H5I_register_type(H5I_FILE, (size_t)H5I_FILEID_HASHSIZE, 0, (H5I_free_t)H5F_close)<H5I_FILE) + if(H5I_register_type(H5I_FILE_CLS) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to initialize interface") done: |