2003-04-01 01:59:04 +08:00
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
2007-02-07 22:56:24 +08:00
|
|
|
* Copyright by The HDF Group. *
|
2003-04-01 01:59:04 +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-04-01 01:59:04 +08:00
|
|
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
|
|
|
1998-10-27 13:08:09 +08:00
|
|
|
/*
|
2020-08-07 08:58:07 +08:00
|
|
|
* Programmer: Robb Matzke
|
1998-10-27 13:08:09 +08:00
|
|
|
* Monday, October 26, 1998
|
|
|
|
*
|
|
|
|
* Purpose: Create a dataset with a simple data space that has the
|
|
|
|
* maximum possible number of dimensions. This program is used
|
|
|
|
* to create the test file `th5s.h5' which has a data space with
|
|
|
|
* a rank larger than what the library can handle. To build the
|
|
|
|
* test file first change the definition of H5S_MAX_RANK in
|
|
|
|
* H5Spublic.h, recompile everything, then run this program.
|
|
|
|
* Don't forget to change H5S_MAX_RANK back to its original
|
|
|
|
* value and recompile once the test file is created.
|
|
|
|
*/
|
2001-04-04 02:09:16 +08:00
|
|
|
#include "hdf5.h"
|
1998-10-27 13:08:09 +08:00
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* Function: main
|
|
|
|
*
|
2005-08-14 04:53:35 +08:00
|
|
|
* Purpose:
|
1998-10-27 13:08:09 +08:00
|
|
|
*
|
2005-08-14 04:53:35 +08:00
|
|
|
* Return: Success:
|
1998-10-27 13:08:09 +08:00
|
|
|
*
|
2005-08-14 04:53:35 +08:00
|
|
|
* Failure:
|
1998-10-27 13:08:09 +08:00
|
|
|
*
|
|
|
|
* Programmer: Robb Matzke
|
|
|
|
* Monday, October 26, 1998
|
|
|
|
*
|
|
|
|
* Modifications:
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
int
|
|
|
|
main(void)
|
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
hid_t file, space, dset;
|
|
|
|
hsize_t cur_dim[H5S_MAX_RANK];
|
|
|
|
int i;
|
1998-10-27 13:08:09 +08:00
|
|
|
|
|
|
|
file = H5Fcreate("th5s.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
|
2020-09-30 22:27:10 +08:00
|
|
|
if (file < 0)
|
2000-10-21 04:57:56 +08:00
|
|
|
printf("file<0!\n");
|
2020-09-30 22:27:10 +08:00
|
|
|
for (i = 0; i < H5S_MAX_RANK; i++)
|
2000-10-21 04:57:56 +08:00
|
|
|
cur_dim[i] = 1;
|
1998-10-27 13:08:09 +08:00
|
|
|
space = H5Screate_simple(H5S_MAX_RANK, cur_dim, NULL);
|
2020-09-30 22:27:10 +08:00
|
|
|
if (space < 0)
|
2000-10-21 04:57:56 +08:00
|
|
|
printf("space<0!\n");
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
dset = H5Dcreate2(file, "dset", H5T_NATIVE_UCHAR, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
2020-09-30 22:27:10 +08:00
|
|
|
if (dset < 0)
|
2000-10-21 04:57:56 +08:00
|
|
|
printf("dset<0!\n");
|
1998-10-27 13:08:09 +08:00
|
|
|
H5Sclose(space);
|
|
|
|
H5Dclose(dset);
|
|
|
|
H5Fclose(file);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|