src/H5VLcallback.c
/*-------------------------------------------------------------------------
 * Function:	H5VL_file_specific
 *
 * Purpose:	Perform file specific operations through the VOL
 *
 * Return:      Success:    Non-negative
 *              Failure:    Negative
 *
 *-------------------------------------------------------------------------
 */
H5VL_file_specific
Purpose:     Perform file specific operations through the VOL

Non-negative
Failure:    Negative
H5VL_file_specific Purpose : Perform file specific operations through the VOL Non - negative Failure : Negative
herr_t
H5VL_file_specific(const H5VL_object_t *vol_obj, H5VL_file_specific_t specific_type, hid_t dxpl_id,
                   void **req, ...)
{
    const H5VL_class_t *cls;                       
    va_list             arguments;                 
    hbool_t             arg_started     = FALSE;   
    hbool_t             vol_wrapper_set = FALSE;   
    herr_t              ret_value       = SUCCEED; 
    FUNC_ENTER_NOAPI(FAIL)
    HDva_start(arguments, req);
    arg_started = TRUE;
    if (specific_type == H5VL_FILE_IS_ACCESSIBLE || specific_type == H5VL_FILE_DELETE) {
        H5P_genplist_t *      plist;          
        H5VL_connector_prop_t connector_prop; 
        va_list               tmp_args;       
        hid_t                 fapl_id;        
        HDva_copy(tmp_args, arguments);
        fapl_id = HDva_arg(tmp_args, hid_t);
        HDva_end(tmp_args);
        if (NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id)))
            HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, FAIL, "not a file access property list")
        if (H5P_peek(plist, H5F_ACS_VOL_CONN_NAME, &connector_prop) < 0)
            HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get VOL connector info")
        if (NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_prop.connector_id, H5I_VOL)))
            HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, FAIL, "not a VOL connector ID")
    } 
    else {
        HDassert(vol_obj);
        if (H5VL_set_vol_wrapper(vol_obj) < 0)
            HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info")
        vol_wrapper_set = TRUE;
        cls = vol_obj->connector->cls;
    } 
    if (H5VL__file_specific(vol_obj ? vol_obj->data : NULL, cls, specific_type, dxpl_id, req, arguments) < 0)
        HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "file specific failed")
done:
    if (arg_started)
        HDva_end(arguments);
    if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
        HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
    FUNC_LEAVE_NOAPI(ret_value)
}
herr_t H5VL_file_specific ( const H5VL_object_t * vol_obj , H5VL_file_specific_t specific_type , hid_t dxpl_id , void * * req , ... ) { const H5VL_class_t * cls ; va_list arguments ; hbool_t arg_started = FALSE ; hbool_t vol_wrapper_set = FALSE ; herr_t ret_value = SUCCEED ; FUNC_ENTER_NOAPI ( FAIL ) HDva_start ( arguments , req ) ; arg_started = TRUE ; if ( specific_type == H5VL_FILE_IS_ACCESSIBLE || specific_type == H5VL_FILE_DELETE ) { H5P_genplist_t * plist ; H5VL_connector_prop_t connector_prop ; va_list tmp_args ; hid_t fapl_id ; HDva_copy ( tmp_args , arguments ) ; fapl_id = HDva_arg ( tmp_args , hid_t ) ; HDva_end ( tmp_args ) ; if ( NULL == ( plist = ( H5P_genplist_t * ) H5I_object ( fapl_id ) ) ) HGOTO_ERROR ( H5E_VOL , H5E_BADTYPE , FAIL , " " ) if ( H5P_peek ( plist , H5F_ACS_VOL_CONN_NAME , & connector_prop ) < 0 ) HGOTO_ERROR ( H5E_VOL , H5E_CANTGET , FAIL , " " ) if ( NULL == ( cls = ( H5VL_class_t * ) H5I_object_verify ( connector_prop . connector_id , H5I_VOL ) ) ) HGOTO_ERROR ( H5E_VOL , H5E_BADTYPE , FAIL , " " ) } else { HDassert ( vol_obj ) ; if ( H5VL_set_vol_wrapper ( vol_obj ) < 0 ) HGOTO_ERROR ( H5E_VOL , H5E_CANTSET , FAIL , " " ) vol_wrapper_set = TRUE ; cls = vol_obj -> connector -> cls ; } if ( H5VL__file_specific ( vol_obj ? vol_obj -> data : NULL , cls , specific_type , dxpl_id , req , arguments ) < 0 ) HGOTO_ERROR ( H5E_VOL , H5E_CANTOPERATE , FAIL , " " ) done : if ( arg_started ) HDva_end ( arguments ) ; if ( vol_wrapper_set && H5VL_reset_vol_wrapper ( ) < 0 ) HDONE_ERROR ( H5E_VOL , H5E_CANTRESET , FAIL , " " ) FUNC_LEAVE_NOAPI ( ret_value ) }
Function:    H5VL_file_specific
 Purpose:     Perform file specific operations through the VOL
Function : H5VL_file_specific Purpose : Perform file specific operations through the VOL
/* VOL connector's class struct */ /* Argument list passed from the API call */ /* Whether the va_list has been started */ /* Whether the VOL object wrapping context was set up */ /* Return value */ /* Start access to the varargs, so they are available in all situations below */ /* Special treatment of file access check & delete operations */ /* (Retrieve the VOL connector from the FAPL, since the file isn't open) */ /* Property list pointer */ /* Property for VOL connector ID & info */ /* argument list passed from the API call */ /* File access property list for accessing the file */ /* Get the file access property list to access the file */ /* Get the VOL info from the FAPL */ /* Get class pointer */ /* end if */ /* Set wrapper info in API context, for all other operations */ /* Sanity check */ /* Set the VOL connector class pointer */ /* end else */ /* Call the corresponding internal VOL routine */ /* End access to the va_list, if we started it */ /* Reset object wrapping info in API context */