summaryrefslogtreecommitdiffstats
path: root/src/H5F.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1997-12-10 22:41:07 (GMT)
committerRobb Matzke <matzke@llnl.gov>1997-12-10 22:41:07 (GMT)
commit082dd8cda9ef3d49be23dfce49e10dd30d0758bc (patch)
treee60a32468ba14f758849f34454fdd8722b72edaa /src/H5F.c
parent3aee91269b83b09a186d214c55873fbbfa15602d (diff)
downloadhdf5-082dd8cda9ef3d49be23dfce49e10dd30d0758bc.zip
hdf5-082dd8cda9ef3d49be23dfce49e10dd30d0758bc.tar.gz
hdf5-082dd8cda9ef3d49be23dfce49e10dd30d0758bc.tar.bz2
[svn-r139] ./src/*.[ch]
Removed the interface initialization argument from FUNC_ENTER() and made it a locally-defined preprocessor symbol, INTERFACE_INIT. Changed `offset' to `address' and `length' to `size' in documentation so it's more consistent. `Offset' still appears occassionally when it refers to a byte offset within some other data structure. Moved interface termination function prototypes from public header files to .c files and made them static. ./src/H5.c ./src/H5public.h Added H5init() because it's possible that the predefined data types are not initialized. This happens only if the first call to the hdf5 library passes a predefined data type symbol as an argument. There should be some way to fix this... ./src/H5A.c ./src/H5Aprivate.h ./src/H5Apublic.h The free_func returns SUCCEED or FAIL, although the return value is ignored by H5A. This is so we can use the various H5*_close() functions to free things. H5Ainc_ref() and H5Adec_ref() are no longer public. Many of the other atom functions should also be made private, but I'll save that for later... Added additional template groups called H5_TEMPLATE_0 through H5_TEMPLATE_7 that are used by the various template subclasses. Increased the number of bits used for atom groups to prevent negative atoms. ./src/H5AC.c ./src/H5ACprivate.h Changed H5AC_new() to H5AC_create() to make names more consistent. ./src/H5B.c ./src/H5Bprivate.h Changed H5B_new() to H5B_create() to make names more consistent. ./src/H5C.c ./src/H5Cprivate.h ./src/H5Cpublic.h Now supports multiple subclasses of templates, although it's done with big switch statements. The default values for templates are defined in the source file to which that template belongs. This got rid of lots of needless preprocessor constants. Added H5Ccreate() to create a new template. Changed H5C_release() to H5Cclose() to make the naming more consistent. ./src/H5D.c ./src/H5Dprivate.h ./src/H5Dpublic.h Enhanced to use the new dataset interface, and uses the enhanced data type and data space interfaces, which haven't been completely implemented. The dataset interface doesn't handle non-contiguous storage, compression, or data type and space conversions yet. ./src/H5F.c ./src/H5Fprivate.h ./src/H5Fpublic.h Removed H5Fflush() since just calls H5F_flush(), which doesn't do what the user would probably think it does, namely, flush everything. It only flushes those things sitting in the H5AC cache and the boot block. Changed the `file_create_parms' field of H5F_low_t to just `create_parms' since the `file' part is obvious. ./src/H5Fistore.c Added some support for external files. Mostly just in the file format and not supported much by the library yet. I need to finish some dataset functions first. Changed H5F_istore_new() to H5F_istore_create() to make names more uniform across packages. ./src/H5Flow.c Flushing a file causes the file to be physically extended to the logical eof. This prevents H5F_open() from thinking a file has been truncated. Most of the time the file will already be that large, and when it isn't Unix will often just allocate the final block anyway. ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5Gpkg.h ./src/H5Gprivate.h ./src/H5Gstab.c Removed H5G_basename() Removed (temporarily) data type information from symbol table entries and renamed H5G_CACHED_SDATA to H5G_CACHED_SDSPACE to reflect that it's a simple data space and has nothing to do with raw data. Changed H5G_node_new() to H5G_node_create() and H5G_stab_new() to H5G_stab_create() to make names more uniform across packages. Fixed an undefined address bug that happens when H5G_node_debug() program doesn't pass enough info to H5G_node_load(). ./src/H5H.c ./src/H5Hprivate.h Changed H5H_new() to H5H_create() to make the names more uniform across packages. ./src/H5M.c ./src/H5Mprivate.h ./src/H5Mpublic.h Nulled all the create functions. Most of the other callbacks are to public functions. Removed H5Mcreate(). Changed hobjtype_t to group_t since it has to be the same thing anyway. ./src/H5O.c ./src/H5Oprivate.h ./src/H5Osdim.c ./src/H5Osdtyp.c Changed H5O_SIM_DIM to H5O_SDSPACE (simple data space) since `simple data space' is its official name, not `simple dimensions'. Will eventually add H5O_CDSPACE for comples data spaces. Changed _sim_dim_ to _dspace_. Replaced H5O_SIM_DTYPE and the compound data type messages with a single H5O_DTYPE message. Changed _sim_dtype_ to _dtype_. Changed H5O_STD_STORE to H5O_CSTORE (contiguous storage) since contiguous storage is not necessarily standard. Changed _std_store_ to _cstore_ in H5Ocstore.c Added the H5O_EFL (external file list) message. Changed H5O_new() to H5O_create() to make names more uniform across packages. ./src/H5Oefl.c NEW External file list message for specifying which non-hdf5 files contain raw data for a dataset. ./src/H5P.c ./src/H5Pprivate.h ./src/H5Ppublic.h Renamed and moved data structures to make the names conform to our naming scheme. ./src/H5T.c ./src/H5Tprivate.h ./src/H5Tpublic.h ./src/H5Tpkg.h NEW Data structures redesigned to be more flexible. The interface was redesigned to make it more regular and to make some names more uniform across packages. ./src/H5detect.c Output was changed to produce a file that conforms to the hdf5 coding standard. ./src/Makefile.in Generates H5Tinit.c by running H5detect. ./src/debug.c Moved command argument processing.
Diffstat (limited to 'src/H5F.c')
-rw-r--r--src/H5F.c308
1 files changed, 137 insertions, 171 deletions
diff --git a/src/H5F.c b/src/H5F.c
index 0fa3f71..00543ad 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -62,11 +62,38 @@ static char RcsId[] = "@(#)$Revision$";
/*--------------------- Locally scoped variables -----------------------------*/
-/* Whether we've installed the library termination function yet for this interface */
+/*
+ * Define the default file creation template.
+ */
+const H5F_create_t H5F_create_dflt = {
+ 0, /* Default user-block size */
+ 4, /* Default 1/2 rank for symtab leaf nodes */
+ { /* Default 1/2 rank for btree intern nodes*/
+ 16, /* Symbol table internal nodes */
+ 32, /* Indexed storage internal nodes */
+ 0, /* unused */
+ 0, /* unused */
+ 0, /* unused */
+ 0, /* unused */
+ 0, /* unused */
+ 0, /* unused */
+ },
+ 4, /* Default offset size */
+ 4, /* Default length size */
+ HDF5_BOOTBLOCK_VERSION, /* Current Boot-Block version # */
+ HDF5_SMALLOBJECT_VERSION, /* Current Small-Object heap version # */
+ HDF5_FREESPACE_VERSION, /* Current Free-Space info version # */
+ HDF5_OBJECTDIR_VERSION, /* Current Object Directory info version # */
+ HDF5_SHAREDHEADER_VERSION, /* Current Shared-Header format version # */
+};
+
+/* Interface initialization */
static intn interface_initialize_g = FALSE;
-
-/*--------------------- Local function prototypes ----------------------------*/
+#define INTERFACE_INIT H5F_init_interface
static herr_t H5F_init_interface(void);
+static void H5F_term_interface (void);
+
+/* PRIVATE PROTOTYPES */
static H5F_t *H5F_new (H5F_file_t *shared);
static H5F_t *H5F_dest (H5F_t *f);
static herr_t H5F_flush (H5F_t *f, hbool_t invalidate);
@@ -94,7 +121,7 @@ Modifications:
static herr_t H5F_init_interface(void)
{
herr_t ret_value = SUCCEED;
- FUNC_ENTER (H5F_init_interface, NULL, FAIL);
+ FUNC_ENTER (H5F_init_interface, FAIL);
/* Initialize the atom group for the file IDs */
if((ret_value=H5Ainit_group(H5_FILE,H5A_FILEID_HASHSIZE,0,NULL))!=FAIL)
@@ -120,10 +147,11 @@ static herr_t H5F_init_interface(void)
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-void H5F_term_interface (void)
+static void
+H5F_term_interface (void)
{
H5Adestroy_group(H5_FILE);
-} /* end H5F_term_interface() */
+}
/*--------------------------------------------------------------------------
NAME
@@ -171,37 +199,6 @@ done:
/*--------------------------------------------------------------------------
NAME
- H5F_compare_files -- compare file objects for the atom API
- USAGE
- intn HPcompare_filename(obj, key)
- const VOIDP obj; IN: pointer to the file record
- const VOIDP key; IN: pointer to the search key
-
- ERRORS
-
- RETURNS
- TRUE if the key matches the obj, FALSE otherwise
- DESCRIPTION
- Look inside the file record for the atom API and compare the the
- keys.
---------------------------------------------------------------------------*/
-static intn
-H5F_compare_files (const VOIDP _obj, const VOIDP _key)
-{
- const H5F_t *obj = (const H5F_t *)_obj;
- const H5F_search_t *key = (const H5F_search_t *)_key;
- int ret_value = FALSE;
-
- FUNC_ENTER (H5F_compare_files, NULL, FALSE);
-
- ret_value = (obj->shared->key.dev == key->dev &&
- obj->shared->key.ino == key->ino);
-
- FUNC_LEAVE (ret_value);
-}
-
-/*--------------------------------------------------------------------------
- NAME
H5Fget_create_template
PURPOSE
@@ -223,36 +220,64 @@ H5F_compare_files (const VOIDP _obj, const VOIDP _key)
This function returns an atom with a copy of the template parameters
used to create a file.
--------------------------------------------------------------------------*/
-hid_t H5Fget_create_template(hid_t fid)
+hid_t
+H5Fget_create_template (hid_t fid)
{
- H5F_t *file=NULL; /* file struct for file to close */
- hid_t ret_value = FAIL;
-
- FUNC_ENTER(H5Fget_create_template, H5F_init_interface, FAIL);
+ H5F_t *file = NULL;
+ hid_t ret_value = FAIL;
+ H5F_create_t *tmpl = NULL;
- /* Clear errors and check args and all the boring stuff. */
+ FUNC_ENTER (H5Fget_create_template, FAIL);
H5ECLEAR;
- /* Get the file structure */
- if((file=H5Aatom_object(fid))==NULL)
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL); /*can't get file struct*/
+ /* check args */
+ if (H5_FILE!=H5Aatom_group (fid)) {
+ HRETURN_ERROR (H5E_ATOM, H5E_BADATOM, FAIL); /*not a file*/
+ }
+ if (NULL==(file=H5Aatom_object (fid))) {
+ HRETURN_ERROR (H5E_ATOM, H5E_BADATOM, FAIL); /*can't get file struct*/
+ }
/* Create the template object to return */
- if((ret_value=H5Mcreate(fid,H5_TEMPLATE,NULL))==FAIL)
- HGOTO_ERROR(H5E_FUNC, H5E_CANTCREATE, FAIL); /*can't create template*/
+ tmpl = H5MM_xmalloc (sizeof(H5F_create_t));
+ *tmpl = file->shared->create_parms;
+ if ((ret_value=H5C_create (H5C_FILE_CREATE, tmpl))<0) {
+ /* Can't register template */
+ HRETURN_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL);
+ }
- if(H5C_init(ret_value,&(file->shared->file_create_parms))==FAIL)
- HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL); /*can't init template*/
+ FUNC_LEAVE (ret_value);
+}
-done:
- if(ret_value == FAIL)
- { /* Error condition cleanup */
+/*--------------------------------------------------------------------------
+ NAME
+ H5F_compare_files -- compare file objects for the atom API
+ USAGE
+ intn HPcompare_filename(obj, key)
+ const VOIDP obj; IN: pointer to the file record
+ const VOIDP key; IN: pointer to the search key
- } /* end if */
+ ERRORS
- /* Normal function cleanup */
+ RETURNS
+ TRUE if the key matches the obj, FALSE otherwise
+ DESCRIPTION
+ Look inside the file record for the atom API and compare the the
+ keys.
+--------------------------------------------------------------------------*/
+static intn
+H5F_compare_files (const VOIDP _obj, const VOIDP _key)
+{
+ const H5F_t *obj = (const H5F_t *)_obj;
+ const H5F_search_t *key = (const H5F_search_t *)_key;
+ int ret_value = FALSE;
+
+ FUNC_ENTER (H5F_compare_files, FALSE);
- FUNC_LEAVE(ret_value);
+ ret_value = (obj->shared->key.dev == key->dev &&
+ obj->shared->key.ino == key->ino);
+
+ FUNC_LEAVE (ret_value);
}
@@ -282,7 +307,7 @@ H5F_locate_signature (H5F_low_t *f_handle, haddr_t *addr/*out*/)
uint8 buf[H5F_SIGNATURE_LEN];
uintn n=9;
- FUNC_ENTER (H5F_locate_signature, H5F_init_interface, FAIL);
+ FUNC_ENTER (H5F_locate_signature, FAIL);
H5F_low_size (f_handle, &max_addr);
H5F_addr_reset (addr);
@@ -327,7 +352,7 @@ hbool_t H5Fis_hdf5(const char *filename)
haddr_t addr; /* Address of file signature & header */
hbool_t ret_value = BFALSE;
- FUNC_ENTER(H5Fis_hdf5, H5F_init_interface, BFAIL);
+ FUNC_ENTER(H5Fis_hdf5, BFAIL);
/* Clear errors and check args and all the boring stuff. */
H5ECLEAR;
@@ -377,7 +402,7 @@ static H5F_t *
H5F_new (H5F_file_t *shared)
{
H5F_t *f = NULL;
- FUNC_ENTER (H5F_new, H5F_init_interface, NULL);
+ FUNC_ENTER (H5F_new, NULL);
f = H5MM_xcalloc (1, sizeof(H5F_t));
f->shared = shared;
@@ -391,7 +416,7 @@ H5F_new (H5F_file_t *shared)
H5F_addr_undef (&(f->shared->hdf5_eof));
/* Create a main cache */
- H5AC_new (f, H5AC_NSLOTS);
+ H5AC_create (f, H5AC_NSLOTS);
/* Create the shadow hash table */
f->shared->nshadows = H5G_NSHADOWS;
@@ -433,7 +458,7 @@ H5F_new (H5F_file_t *shared)
static H5F_t *
H5F_dest (H5F_t *f)
{
- FUNC_ENTER (H5F_dest, H5F_init_interface, NULL);
+ FUNC_ENTER (H5F_dest, NULL);
if (f) {
if (0 == --(f->shared->nrefs)) {
@@ -546,7 +571,7 @@ H5F_dest (H5F_t *f)
*/
H5F_t *
H5F_open (const H5F_low_class_t *type, const char *name, uintn flags,
- const file_create_temp_t *create_parms)
+ const H5F_create_t *create_parms)
{
H5F_t *f = NULL; /*return value */
H5F_t *ret_value = NULL; /*a copy of `f' */
@@ -559,11 +584,11 @@ H5F_open (const H5F_low_class_t *type, const char *name, uintn flags,
const uint8 *p=NULL; /* ..and pointer into it*/
size_t fixed_size = 24; /*size of fixed part of boot blk*/
size_t variable_size; /*variable part of boot block */
- file_create_temp_t *cp=NULL; /*file creation parameters */
+ H5F_create_t *cp=NULL; /*file creation parameters */
haddr_t addr1, addr2; /*temporary address */
const char *s = name;
- FUNC_ENTER (H5F_open, H5F_init_interface, NULL);
+ FUNC_ENTER (H5F_open, NULL);
assert (name && *name);
@@ -618,17 +643,7 @@ H5F_open (const H5F_low_class_t *type, const char *name, uintn flags,
/*
* If no file creation parameters are supplied then use defaults.
*/
- if (!create_parms) {
- hid_t create_temp = H5C_get_default_atom (H5_TEMPLATE);
- if (create_temp<0) {
- /* Can't get default file create template id */
- HRETURN_ERROR (H5E_FILE, H5E_CANTINIT, NULL);
- }
- if (NULL==(create_parms=H5Aatom_object (create_temp))) {
- /* Can't unatomize default template id */
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, NULL);
- }
- }
+ if (!create_parms) create_parms = &H5F_create_dflt;
/*
* Does the file exist? If so, get the device and i-node values so we can
@@ -742,11 +757,9 @@ H5F_open (const H5F_low_class_t *type, const char *name, uintn flags,
* first time this file is opened.
*/
if (1==f->shared->nrefs) {
- HDmemcpy (&(f->shared->file_create_parms),
- create_parms,
- sizeof(file_create_temp_t));
+ f->shared->create_parms = *create_parms;
}
- cp = &(f->shared->file_create_parms);
+ cp = &(f->shared->create_parms);
/*
* Read or write the file boot block.
@@ -760,7 +773,7 @@ H5F_open (const H5F_low_class_t *type, const char *name, uintn flags,
*/
H5F_addr_reset (&(f->shared->boot_addr));
H5F_addr_inc (&(f->shared->boot_addr),
- f->shared->file_create_parms.userblock_size);
+ f->shared->create_parms.userblock_size);
f->shared->base_addr = f->shared->boot_addr;
f->shared->consist_flags = 0x03;
@@ -786,7 +799,7 @@ H5F_open (const H5F_low_class_t *type, const char *name, uintn flags,
* user-defined data.
*/
f->shared->base_addr = f->shared->boot_addr;
- f->shared->file_create_parms.userblock_size=f->shared->base_addr.offset;
+ f->shared->create_parms.userblock_size=f->shared->base_addr.offset;
/*
* Decode the fixed size part of the boot block. For each of the
@@ -866,8 +879,8 @@ H5F_open (const H5F_low_class_t *type, const char *name, uintn flags,
assert (p-buf == fixed_size);
/* Read the variable length part of the boot block... */
- variable_size = H5F_SIZEOF_OFFSET (f) + /*global small obj heap*/
- H5F_SIZEOF_OFFSET (f) + /*global free list addr*/
+ variable_size = H5F_SIZEOF_ADDR (f) + /*global small obj heap*/
+ H5F_SIZEOF_ADDR (f) + /*global free list addr*/
H5F_SIZEOF_SIZE (f) + /*logical file size*/
H5G_SIZEOF_ENTRY (f);
assert (variable_size <= sizeof buf);
@@ -990,12 +1003,12 @@ hid_t H5Fcreate(const char *filename, uintn flags, hid_t create_temp,
hid_t access_temp)
{
H5F_t *new_file=NULL; /* file struct for new file */
- const file_create_temp_t *create_parms; /* pointer to the parameters to
+ const H5F_create_t *create_parms; /* pointer to the parameters to
* use when creating the file
*/
hid_t ret_value = FAIL;
- FUNC_ENTER(H5Fcreate, H5F_init_interface, FAIL);
+ FUNC_ENTER(H5Fcreate, FAIL);
H5ECLEAR;
/* Check/fix arguments */
@@ -1005,15 +1018,19 @@ hid_t H5Fcreate(const char *filename, uintn flags, hid_t create_temp,
HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL); /*invalid flags*/
flags = (H5F_ACC_WRITE | H5F_ACC_CREAT) |
(H5ACC_OVERWRITE==flags ? H5F_ACC_TRUNC : H5F_ACC_EXCL);
- if (0==create_temp)
- create_temp = H5C_get_default_atom (H5_TEMPLATE);
- if (NULL==(create_parms=H5Aatom_object(create_temp)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL); /*can't unatomize template*/
+
+ if (create_temp<=0) {
+ create_parms = &H5F_create_dflt;
+ } else if (NULL==(create_parms=H5Aatom_object (create_temp))) {
+ HGOTO_ERROR (H5E_ATOM, H5E_BADATOM, FAIL); /*can't unatomize template*/
+ }
+
#ifdef LATER
- if (0==access_temp)
- access_temp = H5CPget_default_atom(H5_TEMPLATE);
- if (NULL==(access_parms=H5Aatom_object(access_temp)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL); /*can't unatomize template*/
+ if (access_temp<=0) {
+ access_parms = &H5F_access_dflt;
+ } else if (NULL==(access_parms=H5Aatom_object (access_temp))) {
+ HGOTO_ERROR (H5E_ATOM, H5E_BADATOM, FAIL); /*can't unatomize template*/
+ }
#endif
/*
@@ -1086,7 +1103,7 @@ hid_t H5Fopen(const char *filename, uintn flags, hid_t access_temp)
H5F_t *new_file=NULL; /* file struct for new file */
hid_t ret_value = FAIL;
- FUNC_ENTER(H5Fopen, H5F_init_interface, FAIL);
+ FUNC_ENTER(H5Fopen, FAIL);
H5ECLEAR;
/* Check/fix arguments. */
@@ -1152,7 +1169,7 @@ H5F_flush (H5F_t *f, hbool_t invalidate)
uint8 buf[2048], *p=buf;
herr_t shadow_flush;
- FUNC_ENTER (H5F_flush, H5F_init_interface, FAIL);
+ FUNC_ENTER (H5F_flush, FAIL);
/*
* Nothing to do if the file is read only. This determination is made at
@@ -1177,16 +1194,16 @@ H5F_flush (H5F_t *f, hbool_t invalidate)
HDmemcpy (p, H5F_SIGNATURE, H5F_SIGNATURE_LEN);
p += H5F_SIGNATURE_LEN;
- *p++ = f->shared->file_create_parms.bootblock_ver;
- *p++ = f->shared->file_create_parms.smallobject_ver;
- *p++ = f->shared->file_create_parms.freespace_ver;
- *p++ = f->shared->file_create_parms.objectdir_ver;
- *p++ = f->shared->file_create_parms.sharedheader_ver;
- *p++ = H5F_SIZEOF_OFFSET (f);
+ *p++ = f->shared->create_parms.bootblock_ver;
+ *p++ = f->shared->create_parms.smallobject_ver;
+ *p++ = f->shared->create_parms.freespace_ver;
+ *p++ = f->shared->create_parms.objectdir_ver;
+ *p++ = f->shared->create_parms.sharedheader_ver;
+ *p++ = H5F_SIZEOF_ADDR (f);
*p++ = H5F_SIZEOF_SIZE (f);
*p++ = 0; /*reserved*/
- UINT16ENCODE (p, f->shared->file_create_parms.sym_leaf_k);
- UINT16ENCODE (p, f->shared->file_create_parms.btree_k[H5B_SNODE_ID]);
+ UINT16ENCODE (p, f->shared->create_parms.sym_leaf_k);
+ UINT16ENCODE (p, f->shared->create_parms.btree_k[H5B_SNODE_ID]);
UINT32ENCODE (p, f->shared->consist_flags);
H5F_addr_encode (f, &p, &(f->shared->smallobj_addr));
H5F_addr_encode (f, &p, &(f->shared->freespace_addr));
@@ -1218,58 +1235,6 @@ H5F_flush (H5F_t *f, hbool_t invalidate)
FUNC_LEAVE (SUCCEED);
}
-/*--------------------------------------------------------------------------
- NAME
- H5Fflush
-
- PURPOSE
- Flush all cached data to disk and optionally invalidates all cached
- data.
-
- USAGE
- herr_t H5Fflush(fid, invalidate)
- hid_t fid; IN: File ID of file to close.
- hbool_t invalidate; IN: Invalidate all of the cache?
-
- ERRORS
- ARGS BADTYPE Not a file atom.
- ATOM BADATOM Can't get file struct.
- CACHE CANTFLUSH Flush failed.
-
- RETURNS
- SUCCEED/FAIL
-
- DESCRIPTION
- This function flushes all cached data to disk and, if INVALIDATE
- is non-zero, removes cached objects from the cache so they must be
- re-read from the file on the next access to the object.
-
- MODIFICATIONS:
---------------------------------------------------------------------------*/
-herr_t
-H5Fflush (hid_t fid, hbool_t invalidate)
-{
- H5F_t *file = NULL;
-
- FUNC_ENTER (H5Fflush, H5F_init_interface, FAIL);
- H5ECLEAR;
-
- /* check arguments */
- if (H5_FILE!=H5Aatom_group (fid)) {
- HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL); /*not a file atom*/
- }
- if (NULL==(file=H5Aatom_object (fid))) {
- HRETURN_ERROR (H5E_ATOM, H5E_BADATOM, FAIL); /*can't get file struct*/
- }
-
- /* do work */
- if (H5F_flush (file, invalidate)<0) {
- HRETURN_ERROR (H5E_CACHE, H5E_CANTFLUSH, FAIL); /*flush failed*/
- }
-
- FUNC_LEAVE (SUCCEED);
-}
-
/*-------------------------------------------------------------------------
* Function: H5F_close
@@ -1293,7 +1258,7 @@ H5F_close (H5F_t *f)
{
herr_t ret_value = FAIL;
- FUNC_ENTER (H5F_close, H5F_init_interface, FAIL);
+ FUNC_ENTER (H5F_close, FAIL);
if (-2==(ret_value=H5F_flush (f, TRUE))) {
/*objects are still open, but don't fail yet*/
@@ -1302,6 +1267,7 @@ H5F_close (H5F_t *f)
HRETURN_ERROR (H5E_CACHE, H5E_CANTFLUSH, FAIL);
}
if (f->intent & H5F_ACC_DEBUG) H5AC_debug (f);
+
H5F_low_close (f->shared->lf);
H5F_dest (f);
@@ -1351,7 +1317,7 @@ herr_t H5Fclose(hid_t fid)
H5F_t *file=NULL; /* file struct for file to close */
herr_t ret_value = SUCCEED;
- FUNC_ENTER(H5Fclose, H5F_init_interface, FAIL);
+ FUNC_ENTER(H5Fclose, FAIL);
H5ECLEAR;
/* Check/fix arguments. */
@@ -1400,7 +1366,7 @@ H5F_block_read (H5F_t *f, const haddr_t *addr, size_t size, void *buf)
{
haddr_t abs_addr;
- FUNC_ENTER (H5F_block_read, H5F_init_interface, FAIL);
+ FUNC_ENTER (H5F_block_read, FAIL);
if (0==size) return 0;
@@ -1441,11 +1407,11 @@ H5F_block_read (H5F_t *f, const haddr_t *addr, size_t size, void *buf)
*-------------------------------------------------------------------------
*/
herr_t
-H5F_block_write (H5F_t *f, const haddr_t *addr, size_t size, void *buf)
+H5F_block_write (H5F_t *f, const haddr_t *addr, size_t size, const void *buf)
{
haddr_t abs_addr;
- FUNC_ENTER (H5F_block_write, H5F_init_interface, FAIL);
+ FUNC_ENTER (H5F_block_write, FAIL);
if (0==size) return 0;
@@ -1492,7 +1458,7 @@ herr_t
H5F_debug (H5F_t *f, const haddr_t *addr, FILE *stream, intn indent,
intn fwidth)
{
- FUNC_ENTER (H5F_debug, H5F_init_interface, FAIL);
+ FUNC_ENTER (H5F_debug, FAIL);
/* check args */
assert (f);
@@ -1544,34 +1510,34 @@ H5F_debug (H5F_t *f, const haddr_t *addr, FILE *stream, intn indent,
fprintf (stream, "%*s%-*s %lu bytes\n", indent, "", fwidth,
"Size of user block:",
- (unsigned long)(f->shared->file_create_parms.userblock_size));
+ (unsigned long)(f->shared->create_parms.userblock_size));
fprintf (stream, "%*s%-*s %u bytes\n", indent, "", fwidth,
"Size of file size_t type:",
- (unsigned)(f->shared->file_create_parms.sizeof_size));
+ (unsigned)(f->shared->create_parms.sizeof_size));
fprintf (stream, "%*s%-*s %u bytes\n", indent, "", fwidth,
"Size of file haddr_t type:",
- (unsigned)(f->shared->file_create_parms.sizeof_addr));
+ (unsigned)(f->shared->create_parms.sizeof_addr));
fprintf (stream, "%*s%-*s %u\n", indent, "", fwidth,
"Symbol table leaf node 1/2 rank:",
- (unsigned)(f->shared->file_create_parms.sym_leaf_k));
+ (unsigned)(f->shared->create_parms.sym_leaf_k));
fprintf (stream, "%*s%-*s %u\n", indent, "", fwidth,
"Symbol table internal node 1/2 rank:",
- (unsigned)(f->shared->file_create_parms.btree_k[H5B_SNODE_ID]));
+ (unsigned)(f->shared->create_parms.btree_k[H5B_SNODE_ID]));
fprintf (stream, "%*s%-*s %u\n", indent, "", fwidth,
"Boot block version number:",
- (unsigned)(f->shared->file_create_parms.bootblock_ver));
+ (unsigned)(f->shared->create_parms.bootblock_ver));
fprintf (stream, "%*s%-*s %u\n", indent, "", fwidth,
"Small object heap version number:",
- (unsigned)(f->shared->file_create_parms.smallobject_ver));
+ (unsigned)(f->shared->create_parms.smallobject_ver));
fprintf (stream, "%*s%-*s %u\n", indent, "", fwidth,
"Free list version number:",
- (unsigned)(f->shared->file_create_parms.freespace_ver));
+ (unsigned)(f->shared->create_parms.freespace_ver));
fprintf (stream, "%*s%-*s %u\n", indent, "", fwidth,
"Object directory version number:",
- (unsigned)(f->shared->file_create_parms.objectdir_ver));
+ (unsigned)(f->shared->create_parms.objectdir_ver));
fprintf (stream, "%*s%-*s %u\n", indent, "", fwidth,
"Shared header version number:",
- (unsigned)(f->shared->file_create_parms.sharedheader_ver));
+ (unsigned)(f->shared->create_parms.sharedheader_ver));
fprintf (stream, "%*sRoot symbol table entry:\n", indent, "");
H5G_ent_debug (f, f->shared->root_sym, stream, indent+3, MAX(0, fwidth-3));