diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2014-07-23 13:58:00 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2014-07-23 13:58:00 (GMT) |
commit | e3964f7c160879000bebb27b1845a157f117265d (patch) | |
tree | 20e74f4794bd3cd54fbab343fd6aab5d3a4e7bff /src | |
parent | a487ca20d961937e39f7f46b183f1be1c33022d4 (diff) | |
parent | 1ebce1bfcf419ff6d0bf4cea2735cffb26b7a787 (diff) | |
download | hdf5-e3964f7c160879000bebb27b1845a157f117265d.zip hdf5-e3964f7c160879000bebb27b1845a157f117265d.tar.gz hdf5-e3964f7c160879000bebb27b1845a157f117265d.tar.bz2 |
[svn-r25471] merge from trunk and resolve conflicts.
Diffstat (limited to 'src')
-rw-r--r-- | src/H5A.c | 1 | ||||
-rw-r--r-- | src/H5Aint.c | 19 | ||||
-rw-r--r-- | src/H5D.c | 1 | ||||
-rw-r--r-- | src/H5Dint.c | 1 | ||||
-rw-r--r-- | src/H5F.c | 39 | ||||
-rw-r--r-- | src/H5Fint.c | 42 | ||||
-rw-r--r-- | src/H5Fpkg.h | 8 | ||||
-rw-r--r-- | src/H5Fprivate.h | 7 |
8 files changed, 67 insertions, 51 deletions
@@ -281,6 +281,7 @@ done: if (ret_value < 0 && attr) if(H5VL_attr_close (attr, vol_plugin, H5AC_dxpl_id, H5_EVENT_STACK_NULL) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "unable to release attr") + FUNC_LEAVE_API(ret_value) } /* H5Acreate2() */ diff --git a/src/H5Aint.c b/src/H5Aint.c index d2dbed3..b3136bd 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -768,7 +768,7 @@ H5A_get_type(H5A_t *attr) if(H5T_lock(dt, FALSE) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to lock transient datatype") - /* Create an atom */ + if(H5T_committed(dt)) { /* If this is a committed datatype, we need to recreate the two level IDs, where the VOL object is a copy of the @@ -858,7 +858,7 @@ H5A_get_name(H5A_t *attr, size_t buf_size, char *buf) size_t copy_len, nbytes; ssize_t ret_value; - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_NOAPI_NOERR /* get the real attribute length */ nbytes = HDstrlen(attr->shared->name); @@ -898,9 +898,7 @@ H5A_get_name(H5A_t *attr, size_t buf_size, char *buf) herr_t H5A_get_info(const H5A_t *attr, H5A_info_t *ainfo) { - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_NOAPI_NOERR /* Check args */ HDassert(attr); @@ -918,7 +916,7 @@ H5A_get_info(const H5A_t *attr, H5A_info_t *ainfo) ainfo->corder = attr->shared->crt_idx; } /* end else */ - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5A_get_info() */ @@ -1113,14 +1111,13 @@ H5A_oloc(H5A_t *attr) { H5O_loc_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_NOAPI_NOERR HDassert(attr); /* Set return value */ ret_value = &(attr->oloc); -done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A_oloc() */ @@ -1145,14 +1142,13 @@ H5A_nameof(H5A_t *attr) { H5G_name_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_NOAPI_NOERR HDassert(attr); /* Set return value */ ret_value=&(attr->path); -done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A_nameof() */ @@ -1175,14 +1171,13 @@ H5A_type(const H5A_t *attr) { H5T_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_NOAPI_NOERR HDassert(attr); /* Set return value */ ret_value = attr->shared->dt; -done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A_type() */ @@ -652,7 +652,6 @@ H5Dget_access_plist(hid_t dset_id) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get dataset access properties") done: - FUNC_LEAVE_API(ret_value) } /* end H5Dget_access_plist() */ diff --git a/src/H5Dint.c b/src/H5Dint.c index 1beb0a2..5623133 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -2738,6 +2738,7 @@ H5D_get_type(H5D_t *dset) if((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register datatype") } + done: if(ret_value < 0) { if(dt && H5T_close(dt) < 0) @@ -540,7 +540,7 @@ done: htri_t H5Fis_accessible(const char *name, hid_t fapl_id) { - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("t", "*si", name, fapl_id); @@ -556,6 +556,7 @@ H5Fis_accessible(const char *name, hid_t fapl_id) if(TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not file access property list") + /* Call into the VOL to check if file is accessible */ if(H5VL_file_misc(NULL, NULL, H5VL_FILE_IS_ACCESSIBLE, H5AC_dxpl_id, H5_EVENT_STACK_NULL, fapl_id, name, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get file handle") @@ -806,24 +807,6 @@ H5Fclose(hid_t file_id) if(H5I_dec_app_ref(file_id) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTCLOSEFILE, FAIL, "decrementing file ID failed") -#if 0 - void *file; /*file token from VOL plugin */ - H5VL_t *vol_plugin; /* VOL plugin information */ - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(file_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - - /* get the file object */ - if(NULL == (file = (void *)H5I_object(file_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - - /* Close the file through the VOL*/ - if((ret_value = H5VL_file_close(file, vol_plugin, H5AC_dxpl_id, H5_EVENT_STACK_NULL)) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "unable to close file") - - H5MM_free(vol_plugin); -#endif - done: FUNC_LEAVE_API(ret_value) } /* end H5Fclose() */ @@ -1085,26 +1068,22 @@ ssize_t H5Fget_file_image(hid_t file_id, void *buf_ptr, size_t buf_len) { H5VL_t *vol_plugin; - void *obj; + void *file; ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE3("Zs", "i*xz", file_id, buf_ptr, buf_len); - /* check id */ - if(H5I_FILE != H5I_get_type(file_id)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file") + /* Check args */ + if(NULL == (file = (void *)H5I_object_verify(file_id, H5I_FILE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") /* get the plugin pointer */ if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(file_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - /* get the file object */ - if(NULL == (obj = (void *)H5I_object(file_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* get image through the VOL */ - if(H5VL_file_optional(obj, vol_plugin, H5VL_FILE_GET_FILE_IMAGE, H5AC_dxpl_id, H5_EVENT_STACK_NULL, + if(H5VL_file_optional(file, vol_plugin, H5VL_FILE_GET_FILE_IMAGE, H5AC_dxpl_id, H5_EVENT_STACK_NULL, buf_ptr, &ret_value, buf_len) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get file image") @@ -1153,8 +1132,8 @@ H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr) if(NULL == (obj = (void *)H5I_object(file_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - if((ret_value = H5VL_file_optional(obj, vol_plugin, H5VL_FILE_GET_MDC_CONF, H5AC_dxpl_id, H5_EVENT_STACK_NULL, - config_ptr)) < 0) + if((ret_value = H5VL_file_optional(obj, vol_plugin, H5VL_FILE_GET_MDC_CONF, H5AC_dxpl_id, + H5_EVENT_STACK_NULL, config_ptr)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get mdc configuration") done: diff --git a/src/H5Fint.c b/src/H5Fint.c index 2d0ef4e..00ab3ec 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -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 */ @@ -37,6 +43,15 @@ #include "H5VLnative.h" /* Native Plugin */ #include "H5VLprivate.h" /* VOL plugins */ + +/****************/ +/* 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 */ @@ -53,6 +68,16 @@ typedef struct H5F_olist_t { size_t max_nobjs; /* Maximum # of IDs to put into array */ } H5F_olist_t; + +/********************/ +/* Package Typedefs */ +/********************/ + + +/********************/ +/* Local Prototypes */ +/********************/ + /* private prototypes */ static H5F_t *H5F_new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf); @@ -60,6 +85,21 @@ static herr_t H5F_build_actual_name(const H5F_t *f, const H5P_genplist_t *fapl, const char *name, char ** /*out*/ actual_name); static herr_t H5F_dest(H5F_t *f, hid_t dxpl_id, hbool_t flush); + +/*********************/ +/* Package Variables */ +/*********************/ + + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + + +/*******************/ +/* Local Variables */ +/*******************/ + /* Declare a free list to manage the H5F_t struct */ H5FL_DEFINE(H5F_t); diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index e543015..f3ae7fc 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -293,7 +293,15 @@ H5_DLLVAR const H5AC_class_t H5AC_SUPERBLOCK[1]; /* General routines */ H5_DLL herr_t H5F_init(void); H5_DLL herr_t H5F__term_deprec_interface(void); +H5_DLL H5F_t *H5F_reopen(H5F_t *f); H5_DLL herr_t H5F_flush(H5F_t *f, hid_t dxpl_id, hbool_t closing); +H5_DLL htri_t H5F_is_hdf5(const char *name); +H5_DLL 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); +H5_DLL int H5F_get_objects_cb(void *obj_ptr, hid_t obj_id, void *key); +H5_DLL int H5F_get_obj_count_cb(void *obj_ptr, hid_t obj_id, void *key); +H5_DLL int H5F_get_obj_ids_cb(void *obj_ptr, hid_t obj_id, void *key); +H5_DLL herr_t H5F_close(H5F_t *f); /* File mount related routines */ H5_DLL herr_t H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child, hid_t plist_id, hid_t dxpl_id); diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index c8cbb83..009dcd7 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -602,14 +602,7 @@ typedef struct H5F_io_info_t { /* Private functions */ H5_DLL H5F_t *H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t dxpl_id); -H5_DLL herr_t H5F_close(H5F_t *f); H5_DLL herr_t H5F_try_close(H5F_t *f); -H5_DLL H5F_t *H5F_reopen(H5F_t *f); -H5_DLL htri_t H5F_is_hdf5(const char *name); -H5_DLL 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); -H5_DLL int H5F_get_objects_cb(void *obj_ptr, hid_t obj_id, void *key); -H5_DLL int H5F_get_obj_count_cb(void *obj_ptr, hid_t obj_id, void *key); -H5_DLL int H5F_get_obj_ids_cb(void *obj_ptr, hid_t obj_id, void *key); /* Functions than retrieve values from the file struct */ H5_DLL unsigned H5F_get_intent(const H5F_t *f); |