diff options
Diffstat (limited to 'src/H5FD.c')
-rw-r--r-- | src/H5FD.c | 111 |
1 files changed, 50 insertions, 61 deletions
@@ -129,7 +129,7 @@ H5FD_init(void) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_init, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* FUNC_ENTER() does all the work */ done: @@ -158,7 +158,7 @@ H5FD_init_interface(void) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FD_init_interface) + FUNC_ENTER_NOAPI_NOINIT if(H5I_register_type(H5I_VFL, (size_t)H5I_VFL_HASHSIZE, 0, (H5I_free_t)H5FD_free_cls)<H5I_FILE) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize interface") @@ -196,7 +196,7 @@ H5FD_term_interface(void) { int n = 0; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_term_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5_interface_initialize_g) { if((n=H5I_nmembers(H5I_VFL))!=0) { @@ -252,7 +252,7 @@ H5FD_term_interface(void) static herr_t H5FD_free_cls(H5FD_class_t *cls) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_free_cls) + FUNC_ENTER_NOAPI_NOINIT_NOERR H5MM_xfree(cls); @@ -290,7 +290,7 @@ H5FDregister(const H5FD_class_t *cls) hid_t ret_value; H5FD_mem_t type; - FUNC_ENTER_API(H5FDregister, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("i", "*x", cls); /* Check arguments */ @@ -352,7 +352,7 @@ H5FD_register(const void *_cls, size_t size, hbool_t app_ref) H5FD_mem_t type; hid_t ret_value; - FUNC_ENTER_NOAPI(H5FD_register, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ HDassert(cls); @@ -403,7 +403,7 @@ H5FDunregister(hid_t driver_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5FDunregister, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", driver_id); /* Check arguments */ @@ -444,7 +444,7 @@ H5FD_get_class(hid_t id) { H5FD_class_t *ret_value = NULL; - FUNC_ENTER_NOAPI(H5FD_get_class, NULL) + FUNC_ENTER_NOAPI(NULL) if(H5I_VFL == H5I_get_type(id)) ret_value = (H5FD_class_t *)H5I_object(id); @@ -497,7 +497,7 @@ H5FD_sb_size(H5FD_t *file) { hsize_t ret_value=0; - FUNC_ENTER_NOAPI(H5FD_sb_size, 0) + FUNC_ENTER_NOAPI(0) assert(file && file->cls); @@ -535,7 +535,7 @@ H5FD_sb_encode(H5FD_t *file, char *name/*out*/, uint8_t *buf) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_sb_encode, FAIL) + FUNC_ENTER_NOAPI(FAIL) assert(file && file->cls); if(file->cls->sb_encode && @@ -565,7 +565,7 @@ H5FD_sb_decode(H5FD_t *file, const char *name, const uint8_t *buf) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_sb_decode, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(file && file->cls); if(file->cls->sb_decode && (file->cls->sb_decode)(file, name, buf) < 0) @@ -602,7 +602,7 @@ H5FD_pl_copy(void *(*copy_func)(const void *), size_t pl_size, const void *old_p void *new_pl = NULL; /* Copy of property list */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FD_pl_copy) + FUNC_ENTER_NOAPI_NOINIT /* Copy old pl, if one exists */ if(old_pl) { @@ -647,7 +647,7 @@ H5FD_pl_close(hid_t driver_id, herr_t (*free_func)(void *), void *pl) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FD_pl_close) + FUNC_ENTER_NOAPI_NOINIT /* Allow driver to free or do it ourselves */ if(pl && free_func) { @@ -697,7 +697,7 @@ H5FD_fapl_get(H5FD_t *file) { void *ret_value=NULL; - FUNC_ENTER_NOAPI(H5FD_fapl_get, NULL) + FUNC_ENTER_NOAPI(NULL) assert(file); @@ -731,7 +731,7 @@ H5FD_fapl_open(H5P_genplist_t *plist, hid_t driver_id, const void *driver_info) void *copied_driver_info = NULL; /* Temporary VFL driver info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_fapl_open, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Increment the reference count on driver and copy driver info */ if(H5I_inc_ref(driver_id, FALSE) < 0) @@ -778,7 +778,7 @@ H5FD_fapl_copy(hid_t driver_id, const void *old_fapl, void **copied_fapl) H5FD_class_t *driver; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_fapl_copy, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ if(NULL == (driver = (H5FD_class_t *)H5I_object(driver_id))) @@ -814,7 +814,7 @@ H5FD_fapl_close(hid_t driver_id, void *fapl) H5FD_class_t *driver = NULL; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_fapl_close, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ if(driver_id > 0) { @@ -853,7 +853,7 @@ H5FD_dxpl_open(H5P_genplist_t *plist, hid_t driver_id, const void *driver_info) void *copied_driver_info = NULL; /* Temporary VFL driver info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_dxpl_open, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Increment the reference count on the driver and copy the driver info */ if(H5I_inc_ref(driver_id, FALSE) < 0) @@ -899,7 +899,7 @@ H5FD_dxpl_copy(hid_t driver_id, const void *old_dxpl, void **copied_dxpl) H5FD_class_t *driver; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_dxpl_copy, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ if(NULL == (driver = (H5FD_class_t *)H5I_object(driver_id))) @@ -935,7 +935,7 @@ H5FD_dxpl_close(hid_t driver_id, void *dxpl) H5FD_class_t *driver; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_dxpl_close, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ if(driver_id > 0) { @@ -1012,7 +1012,7 @@ H5FDopen(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) { H5FD_t *ret_value=NULL; - FUNC_ENTER_API(H5FDopen, NULL) + FUNC_ENTER_API(NULL) /* Check arguments */ if(H5P_DEFAULT == fapl_id) @@ -1059,7 +1059,7 @@ H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) H5P_genplist_t *plist; /* Property list pointer */ H5FD_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_open, NULL) + FUNC_ENTER_NOAPI(NULL) /* Sanity check */ if(0 == maxaddr) @@ -1145,7 +1145,7 @@ H5FDclose(H5FD_t *file) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5FDclose, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "*x", file); if(!file || !file->cls) @@ -1178,7 +1178,7 @@ H5FD_close(H5FD_t *file) const H5FD_class_t *driver; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5FD_close, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(file && file->cls); @@ -1230,7 +1230,7 @@ H5FDcmp(const H5FD_t *f1, const H5FD_t *f2) { int ret_value; - FUNC_ENTER_API(H5FDcmp, -1) /*return value is arbitrary*/ + FUNC_ENTER_API(-1) /*return value is arbitrary*/ H5TRACE2("Is", "*x*x", f1, f2); ret_value = H5FD_cmp(f1, f2); @@ -1261,7 +1261,7 @@ H5FD_cmp(const H5FD_t *f1, const H5FD_t *f2) { int ret_value; - FUNC_ENTER_NOAPI(H5FD_cmp, -1) /*return value is arbitrary*/ + FUNC_ENTER_NOAPI(-1) /*return value is arbitrary*/ if((!f1 || !f1->cls) && (!f2 || !f2->cls)) HGOTO_DONE(0) @@ -1311,7 +1311,7 @@ H5FDquery(const H5FD_t *f, unsigned long *flags/*out*/) { int ret_value; - FUNC_ENTER_API(H5FDquery, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("Is", "*xx", f, flags); assert(f); @@ -1345,7 +1345,7 @@ H5FD_query(const H5FD_t *f, unsigned long *flags/*out*/) { int ret_value=0; - FUNC_ENTER_NOAPI(H5FD_query, FAIL) + FUNC_ENTER_NOAPI(FAIL) assert(f); assert(flags); @@ -1405,7 +1405,7 @@ H5FDalloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) { haddr_t ret_value = HADDR_UNDEF; - FUNC_ENTER_API(H5FDalloc, HADDR_UNDEF) + FUNC_ENTER_API(HADDR_UNDEF) H5TRACE4("a", "*xMtih", file, type, dxpl_id, size); /* Check args */ @@ -1459,7 +1459,7 @@ H5FDfree(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t siz { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5FDfree, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE5("e", "*xMtiah", file, type, dxpl_id, addr, size); /* Check args */ @@ -1502,7 +1502,7 @@ H5FDget_eoa(H5FD_t *file, H5FD_mem_t type) { haddr_t ret_value; - FUNC_ENTER_API(H5FDget_eoa, HADDR_UNDEF) + FUNC_ENTER_API(HADDR_UNDEF) H5TRACE2("a", "*xMt", file, type); /* Check args */ @@ -1552,7 +1552,7 @@ H5FDset_eoa(H5FD_t *file, H5FD_mem_t type, haddr_t addr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5FDset_eoa, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "*xMta", file, type, addr); /* Check args */ @@ -1604,7 +1604,7 @@ H5FDget_eof(H5FD_t *file) { haddr_t ret_value; - FUNC_ENTER_API(H5FDget_eof, HADDR_UNDEF) + FUNC_ENTER_API(HADDR_UNDEF) H5TRACE1("a", "*x", file); /* Check arguments */ @@ -1641,7 +1641,7 @@ H5FD_get_maxaddr(const H5FD_t *file) { haddr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_get_maxaddr, HADDR_UNDEF) + FUNC_ENTER_NOAPI(HADDR_UNDEF) HDassert(file); @@ -1669,7 +1669,7 @@ done: herr_t H5FD_get_feature_flags(const H5FD_t *file, unsigned long *feature_flags) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_get_feature_flags) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(file); HDassert(feature_flags); @@ -1699,7 +1699,7 @@ H5FD_get_fs_type_map(const H5FD_t *file, H5FD_mem_t *type_map) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_get_fs_type_map, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(file && file->cls); @@ -1747,7 +1747,7 @@ H5FDread(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5FDread, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE6("e", "*xMtiazx", file, type, dxpl_id, addr, size, buf); /* Check args */ @@ -1798,7 +1798,7 @@ H5FDwrite(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t siz { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5FDwrite, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE6("e", "*xMtiaz*x", file, type, dxpl_id, addr, size, buf); /* Check args */ @@ -1847,7 +1847,7 @@ H5FDflush(H5FD_t *file, hid_t dxpl_id, unsigned closing) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5FDflush, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "*xiIu", file, dxpl_id, closing); /* Check args */ @@ -1886,7 +1886,7 @@ H5FD_flush(H5FD_t *file, hid_t dxpl_id, unsigned closing) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_flush, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(file && file->cls); @@ -1916,7 +1916,7 @@ H5FDtruncate(H5FD_t *file, hid_t dxpl_id, unsigned closing) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5FDtruncate, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "*xiIu", file, dxpl_id, closing); /* Check args */ @@ -1955,7 +1955,7 @@ H5FD_truncate(H5FD_t *file, hid_t dxpl_id, unsigned closing) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_truncate, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(file && file->cls); @@ -1984,9 +1984,7 @@ done: herr_t H5FD_get_fileno(const H5FD_t *file, unsigned long *filenum) { - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5FD_get_fileno, FAIL) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(file); HDassert(filenum); @@ -1994,8 +1992,7 @@ H5FD_get_fileno(const H5FD_t *file, unsigned long *filenum) /* Retrieve the file's serial number */ *filenum = file->fileno; -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5FD_get_fileno() */ @@ -2019,7 +2016,7 @@ H5FDget_vfd_handle(H5FD_t *file, hid_t fapl, void **file_handle) { herr_t ret_value; - FUNC_ENTER_API(H5FDget_vfd_handle, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "*xi**x", file, fapl, file_handle); /* Check arguments */ @@ -2050,7 +2047,7 @@ H5FD_get_vfd_handle(H5FD_t *file, hid_t fapl, void **file_handle) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5FD_get_vfd_handle, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(file); @@ -2081,9 +2078,7 @@ done: herr_t H5FD_set_base_addr(H5FD_t *file, haddr_t base_addr) { - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI(H5FD_set_base_addr, FAIL) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(file); HDassert(H5F_addr_defined(base_addr)); @@ -2091,8 +2086,7 @@ H5FD_set_base_addr(H5FD_t *file, haddr_t base_addr) /* Set the file's base address */ file->base_addr = base_addr; -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5FD_set_base_addr() */ @@ -2112,16 +2106,11 @@ done: haddr_t H5FD_get_base_addr(const H5FD_t *file) { - haddr_t ret_value; /* Return value */ - - FUNC_ENTER_NOAPI(H5FD_get_base_addr, HADDR_UNDEF) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(file); /* Return the file's base address */ - ret_value = file->base_addr; - -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(file->base_addr) } /* end H5FD_get_base_addr() */ |