2003-07-16 22:56:58 +08:00
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
2007-02-07 22:56:24 +08:00
|
|
|
* Copyright by The HDF Group. *
|
2003-07-16 22:56:58 +08:00
|
|
|
* 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 *
|
2021-02-17 22:52:04 +08:00
|
|
|
* distribution tree, or in https://www.hdfgroup.org/licenses. *
|
2017-04-18 03:32:16 +08:00
|
|
|
* If you do not have access to either file, you may request a copy from *
|
|
|
|
* help@hdfgroup.org. *
|
2003-07-16 22:56:58 +08:00
|
|
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
|
|
|
|
|
|
/*
|
2020-08-07 08:58:07 +08:00
|
|
|
* Programmer: Quincey Koziol
|
2003-07-16 22:56:58 +08:00
|
|
|
* Tuesday, July 15, 2003
|
|
|
|
*
|
|
|
|
* Purpose: Create a file which will have the newer superblock format.
|
|
|
|
* This program is used to create the test file `tsupern.h5' which
|
|
|
|
* has the new format for superblock information.
|
|
|
|
* To build the test file, this program MUST be compiled and linked with
|
|
|
|
* the hdf5-1.6+ series of libraries and the generated test file must be
|
|
|
|
* put into the 'test' directory in the 1.4+ branch of the library.
|
|
|
|
*/
|
|
|
|
|
2020-08-01 02:40:29 +08:00
|
|
|
#include "h5test.h"
|
2003-07-16 22:56:58 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
#define TESTFILE "tsupern.h5"
|
|
|
|
#define ISTORE_IK 64
|
2003-07-16 22:56:58 +08:00
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2020-08-01 02:40:29 +08:00
|
|
|
* Function: main
|
2003-07-16 22:56:58 +08:00
|
|
|
*
|
2020-08-01 02:40:29 +08:00
|
|
|
* Purpose: Create a file with a new version (>0) of the superblock
|
2003-07-16 22:56:58 +08:00
|
|
|
*
|
2020-08-01 02:40:29 +08:00
|
|
|
* Return: EXIT_SUCCESS
|
2003-07-16 22:56:58 +08:00
|
|
|
*
|
2020-08-01 02:40:29 +08:00
|
|
|
* Programmer: Quincey Koziol
|
2003-07-16 22:56:58 +08:00
|
|
|
* Tuesday, July 15, 2003
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
int
|
|
|
|
main(void)
|
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
hid_t file; /* File IDs for old & new files */
|
|
|
|
hid_t fcpl; /* File creation property list */
|
|
|
|
herr_t H5_ATTR_NDEBUG_UNUSED ret;
|
2003-07-16 22:56:58 +08:00
|
|
|
|
|
|
|
/* Create a file creation property list */
|
|
|
|
fcpl = H5Pcreate(H5P_FILE_CREATE);
|
2020-08-01 02:40:29 +08:00
|
|
|
HDassert(fcpl >= 0);
|
2003-07-16 22:56:58 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
ret = H5Pset_istore_k(fcpl, ISTORE_IK);
|
2020-08-01 02:40:29 +08:00
|
|
|
HDassert(ret >= 0);
|
2003-07-16 22:56:58 +08:00
|
|
|
|
|
|
|
/* Creating a file with the non-default file creation property list should
|
|
|
|
* create a version 1 superblock
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Create file with custom file creation property list */
|
2020-09-30 22:27:10 +08:00
|
|
|
file = H5Fcreate(TESTFILE, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT);
|
2020-08-01 02:40:29 +08:00
|
|
|
HDassert(file >= 0);
|
2003-07-16 22:56:58 +08:00
|
|
|
|
|
|
|
/* Close FCPL */
|
2020-08-01 02:40:29 +08:00
|
|
|
ret = H5Pclose(fcpl);
|
|
|
|
HDassert(ret >= 0);
|
2003-07-16 22:56:58 +08:00
|
|
|
|
|
|
|
/* Close file */
|
2020-08-01 02:40:29 +08:00
|
|
|
ret = H5Fclose(file);
|
|
|
|
HDassert(ret >= 0);
|
2003-07-16 22:56:58 +08:00
|
|
|
|
2020-08-01 02:40:29 +08:00
|
|
|
return EXIT_SUCCESS;
|
2003-07-16 22:56:58 +08:00
|
|
|
}
|