2016-12-03 00:07:04 +08:00
|
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
|
|
|
* Copyright by The HDF Group. *
|
|
|
|
|
* Copyright by the Board of Trustees of the University of Illinois. *
|
|
|
|
|
* All rights reserved. *
|
|
|
|
|
* *
|
|
|
|
|
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
|
|
|
|
* terms governing use, modification, and redistribution, is contained in *
|
2017-04-18 03:32:16 +08:00
|
|
|
|
* 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. *
|
|
|
|
|
* If you do not have access to either file, you may request a copy from *
|
|
|
|
|
* help@hdfgroup.org. *
|
2016-12-03 00:07:04 +08:00
|
|
|
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
*
|
|
|
|
|
* Created: H5FDtest.c
|
|
|
|
|
* Fall 2014
|
|
|
|
|
*
|
|
|
|
|
* Purpose: File driver testing routines.
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/****************/
|
|
|
|
|
/* Module Setup */
|
|
|
|
|
/****************/
|
|
|
|
|
|
|
|
|
|
#include "H5FDmodule.h" /* This source code file is part of the H5FD module */
|
|
|
|
|
#define H5FD_TESTING /* Suppress warning about H5FD testing funcs */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***********/
|
|
|
|
|
/* Headers */
|
|
|
|
|
/***********/
|
|
|
|
|
#include "H5private.h" /* Generic Functions */
|
|
|
|
|
#include "H5FDpkg.h" /* File Drivers */
|
|
|
|
|
|
|
|
|
|
/****************/
|
|
|
|
|
/* Local Macros */
|
|
|
|
|
/****************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/******************/
|
|
|
|
|
/* Local Typedefs */
|
|
|
|
|
/******************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/********************/
|
|
|
|
|
/* Package Typedefs */
|
|
|
|
|
/********************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/********************/
|
|
|
|
|
/* Local Prototypes */
|
|
|
|
|
/********************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*********************/
|
|
|
|
|
/* Package Variables */
|
|
|
|
|
/*********************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************/
|
|
|
|
|
/* Library Private Variables */
|
|
|
|
|
/*****************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*******************/
|
|
|
|
|
/* Local Variables */
|
|
|
|
|
/*******************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2018-09-19 13:57:37 +08:00
|
|
|
|
* Function: H5FD__supports_swmr_test()
|
2016-12-03 00:07:04 +08:00
|
|
|
|
*
|
|
|
|
|
* Purpose: Determines if a VFD supports SWMR.
|
|
|
|
|
*
|
|
|
|
|
* The function determines SWMR support by inspecting the
|
|
|
|
|
* HDF5_DRIVER environment variable, not by checking the
|
|
|
|
|
* VFD feature flags (which do not exist until the driver
|
|
|
|
|
* is instantiated).
|
|
|
|
|
*
|
|
|
|
|
* See test/Makefile.am for a list of the VFD strings.
|
|
|
|
|
*
|
|
|
|
|
* This function is only intended for use in the test code.
|
|
|
|
|
*
|
|
|
|
|
* Return: TRUE (1) if the VFD supports SWMR I/O or vfd_name is
|
|
|
|
|
* NULL or the empty string (which implies the default VFD).
|
|
|
|
|
*
|
|
|
|
|
* FALSE (0) if it does not
|
|
|
|
|
*
|
|
|
|
|
* This function cannot fail at this time so there is no
|
|
|
|
|
* error return value.
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Dana Robinson
|
|
|
|
|
* Fall 2014
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
hbool_t
|
2018-09-19 13:57:37 +08:00
|
|
|
|
H5FD__supports_swmr_test(const char *vfd_name)
|
2016-12-03 00:07:04 +08:00
|
|
|
|
{
|
|
|
|
|
hbool_t ret_value = FALSE;
|
|
|
|
|
|
|
|
|
|
FUNC_ENTER_NOAPI_NOINIT_NOERR
|
|
|
|
|
|
2018-10-25 12:52:47 +08:00
|
|
|
|
if(!vfd_name || !HDstrcmp(vfd_name, "") || !HDstrcmp(vfd_name, "nomatch"))
|
2016-12-03 00:07:04 +08:00
|
|
|
|
ret_value = TRUE;
|
|
|
|
|
else
|
2018-10-25 12:52:47 +08:00
|
|
|
|
ret_value = !HDstrcmp(vfd_name, "log") || !HDstrcmp(vfd_name, "sec2");
|
2016-12-03 00:07:04 +08:00
|
|
|
|
|
|
|
|
|
FUNC_LEAVE_NOAPI(ret_value)
|
|
|
|
|
|
2018-09-19 13:57:37 +08:00
|
|
|
|
} /* end H5FD__supports_swmr_test() */
|
2016-12-03 00:07:04 +08:00
|
|
|
|
|