diff options
Diffstat (limited to 'src/H5Fio.c')
-rw-r--r-- | src/H5Fio.c | 61 |
1 files changed, 22 insertions, 39 deletions
diff --git a/src/H5Fio.c b/src/H5Fio.c index 4af825b..491bef3 100644 --- a/src/H5Fio.c +++ b/src/H5Fio.c @@ -6,7 +6,7 @@ * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * * the COPYING file, which can be found at the root of the source code * - * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * distribution tree, or in https://www.hdfgroup.org/licenses. * * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -15,7 +15,7 @@ * * Created: H5Fio.c * Jan 10 2008 - * Quincey Koziol <koziol@hdfgroup.org> + * Quincey Koziol * * Purpose: File I/O routines. * @@ -26,55 +26,45 @@ /* Module Setup */ /****************/ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ - +#define H5F_PACKAGE /*suppress error about including H5Fpkg */ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* File access */ -#include "H5FDprivate.h" /* File drivers */ -#include "H5Iprivate.h" /* IDs */ - +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fpkg.h" /* File access */ +#include "H5FDprivate.h" /* File drivers */ +#include "H5Iprivate.h" /* IDs */ /****************/ /* Local Macros */ /****************/ - /******************/ /* Local Typedefs */ /******************/ - /********************/ /* Package Typedefs */ /********************/ - /********************/ /* Local Prototypes */ /********************/ - /*********************/ /* Package Variables */ /*********************/ - /*****************************/ /* Library Private Variables */ /*****************************/ - /*******************/ /* Local Variables */ /*******************/ - - /*------------------------------------------------------------------------- * Function: H5F_block_read * @@ -85,43 +75,41 @@ * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 10 1997 * *------------------------------------------------------------------------- */ herr_t -H5F_block_read(const H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, - hid_t dxpl_id, void *buf/*out*/) +H5F_block_read(const H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, hid_t dxpl_id, void *buf /*out*/) { - H5F_io_info_t fio_info; /* I/O info for operation */ - herr_t ret_value = SUCCEED; /* Return value */ + H5F_io_info_t fio_info; /* I/O info for operation */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) + /* Sanity checks */ HDassert(f); HDassert(f->shared); HDassert(buf); HDassert(H5F_addr_defined(addr)); /* Check for attempting I/O on 'temporary' file address */ - if(H5F_addr_le(f->shared->tmp_addr, (addr + size))) + if (H5F_addr_le(f->shared->tmp_addr, (addr + size))) HGOTO_ERROR(H5E_IO, H5E_BADRANGE, FAIL, "attempting I/O in temporary file space") /* Set up I/O info for operation */ fio_info.f = f; - if(NULL == (fio_info.dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) + if (NULL == (fio_info.dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") /* Pass through metadata accumulator layer */ - if(H5F__accum_read(&fio_info, type, addr, size, buf) < 0) + if (H5F__accum_read(&fio_info, type, addr, size, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "read through metadata accumulator failed") done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_block_read() */ - /*------------------------------------------------------------------------- * Function: H5F_block_write * @@ -132,23 +120,19 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 10 1997 * *------------------------------------------------------------------------- */ herr_t -H5F_block_write(const H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, - hid_t dxpl_id, const void *buf) +H5F_block_write(const H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, hid_t dxpl_id, const void *buf) { - H5F_io_info_t fio_info; /* I/O info for operation */ - herr_t ret_value = SUCCEED; /* Return value */ + H5F_io_info_t fio_info; /* I/O info for operation */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) -#ifdef QAK -HDfprintf(stderr, "%s: write to addr = %a, size = %Zu\n", FUNC, addr, size); -#endif /* QAK */ + /* Sanity checks */ HDassert(f); HDassert(f->shared); HDassert(H5F_INTENT(f) & H5F_ACC_RDWR); @@ -156,19 +140,18 @@ HDfprintf(stderr, "%s: write to addr = %a, size = %Zu\n", FUNC, addr, size); HDassert(H5F_addr_defined(addr)); /* Check for attempting I/O on 'temporary' file address */ - if(H5F_addr_le(f->shared->tmp_addr, (addr + size))) + if (H5F_addr_le(f->shared->tmp_addr, (addr + size))) HGOTO_ERROR(H5E_IO, H5E_BADRANGE, FAIL, "attempting I/O in temporary file space") /* Set up I/O info for operation */ fio_info.f = f; - if(NULL == (fio_info.dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) + if (NULL == (fio_info.dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") /* Pass through metadata accumulator layer */ - if(H5F__accum_write(&fio_info, type, addr, size, buf) < 0) + if (H5F__accum_write(&fio_info, type, addr, size, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "write through metadata accumulator failed") done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_block_write() */ - |