1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  * Copyright by The HDF Group.                                               *
3  * Copyright by the Board of Trustees of the University of Illinois.         *
4  * All rights reserved.                                                      *
5  *                                                                           *
6  * This file is part of HDF5.  The full HDF5 copyright notice, including     *
7  * terms governing use, modification, and redistribution, is contained in    *
8  * the COPYING file, which can be found at the root of the source code       *
9  * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.  *
10  * If you do not have access to either file, you may request a copy from     *
11  * help@hdfgroup.org.                                                        *
12  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
13 
14 /*
15  * Programmer:  Quincey Koziol <koziol@ncsa.uiuc.edu>
16  *              Tuesday, July 15, 2003
17  *
18  * Purpose:	Create a file which will have the newer superblock format.
19  *		This program is used to create the test file `tsupern.h5' which
20  *      has the new format for superblock information.
21  *		To build the test file, this program MUST be compiled and linked with
22  *      the hdf5-1.6+ series of libraries and the generated test file must be
23  *      put into the 'test' directory in the 1.4+ branch of the library.
24  */
25 
26 #include <assert.h>
27 #include "hdf5.h"
28 
29 #define TESTFILE   "tsupern.h5"
30 #define ISTORE_IK  64
31 
32 
33 /*-------------------------------------------------------------------------
34  * Function:	main
35  *
36  * Purpose:	Create a file with a new version (>0) of the superblock
37  *
38  * Return:	Success:
39  *		Failure:
40  *
41  * Programmer:	Quincey Koziol
42  *              Tuesday, July 15, 2003
43  *
44  * Modifications:
45  *
46  *-------------------------------------------------------------------------
47  */
48 int
main(void)49 main(void)
50 {
51     hid_t       file;           /* File IDs for old & new files */
52     hid_t       fcpl;           /* File creation property list */
53     herr_t      ret;            /* Generic return value */
54 
55     /* Create a file creation property list */
56     fcpl = H5Pcreate(H5P_FILE_CREATE);
57     assert(fcpl>=0);
58 
59     ret=H5Pset_istore_k(fcpl,ISTORE_IK);
60     assert(ret>=0);
61 
62     /* Creating a file with the non-default file creation property list should
63      * create a version 1 superblock
64      */
65 
66     /* Create file with custom file creation property list */
67     file= H5Fcreate(TESTFILE, H5F_ACC_TRUNC , fcpl, H5P_DEFAULT);
68     assert(file>=0);
69 
70     /* Close FCPL */
71     ret=H5Pclose(fcpl);
72     assert(ret>=0);
73 
74     /* Close file */
75     ret=H5Fclose(file);
76     assert(ret>=0);
77 
78     return 0;
79 }
80 
81