summaryrefslogtreecommitdiffstats
path: root/src/H5Groot.c
Commit message (Expand)AuthorAgeFilesLines
* Add API context interface and use it throughout the library.Quincey Koziol2018-03-151-8/+8
* Merge pull request #426 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:hdf5_1_10 to hdf5...Larry Knox2017-04-251-6/+4
* [svn-r27768] Description:Quincey Koziol2015-09-141-2/+2
* [svn-r21923] Description:Quincey Koziol2012-02-101-4/+4
* [svn-r21919] Description:Quincey Koziol2012-02-091-4/+4
* [svn-r21126] Description:Quincey Koziol2011-07-191-0/+35
* [svn-r20406] Description:Quincey Koziol2011-04-041-0/+100
* [svn-r20061] Description:Quincey Koziol2011-02-081-1/+1
* [svn-r19587] Description:Quincey Koziol2010-10-131-0/+4
* [svn-r19461] Purpose: Fix bug 1864Neil Fortner2010-09-211-2/+7
* [svn-r18721] Description:Quincey Koziol2010-05-061-1/+1
* [svn-r18595] Description:Quincey Koziol2010-04-201-1/+1
* [svn-r18484] Description:Quincey Koziol2010-04-011-1/+0
* [svn-r18460] Description:Quincey Koziol2010-03-261-1/+0
* [svn-r18271] Description:Quincey Koziol2010-02-181-1/+4
* [svn-r18269] Bug fix for #1732 - The library had segmentation fault when tool...Raymond Lu2010-02-171-1/+1
* [svn-r18171] Description:Quincey Koziol2010-01-271-1/+1
* [svn-r17623] Description:Quincey Koziol2009-10-091-18/+2
* [svn-r17365] Description:Quincey Koziol2009-08-151-119/+36
* [svn-r17351] Description:Quincey Koziol2009-08-131-2/+2
* [svn-r16721] Purpose: Fix problems with "no strct format checks"Neil Fortner2009-04-091-20/+44
* [svn-r16710] Purpose: Fix bug 1423Neil Fortner2009-04-081-0/+344
hl num">3, 3}; /* data1 dimensions */ hsize_t dims2[2] = { 7, 1}; /* data2 dimensions */ hsize_t dims3[2] = { 2, 2}; /* data3 dimensions */ hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; hsize_t chunk_dims[2] ={2, 5}; hsize_t size[2]; hsize_t offset[2]; herr_t status; int data1[3][3] = { {1, 1, 1}, /* data to write */ {1, 1, 1}, {1, 1, 1} }; int data2[7] = { 2, 2, 2, 2, 2, 2, 2}; int data3[2][2] = { {3, 3}, {3, 3} }; int fillvalue = 0; /* * Create the data space with unlimited dimensions. */ dataspace = H5Screate_simple(RANK, dims, maxdims); /* * Create a new file. If file exists its contents will be overwritten. */ file = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); /* * Modify dataset creation properties, i.e. enable chunking. */ cparms = H5Pcreate(H5P_DATASET_CREATE); status = H5Pset_chunk( cparms, RANK, chunk_dims); status = H5Pset_fill_value (cparms, H5T_NATIVE_INT, &fillvalue ); /* * Create a new dataset within the file using cparms * creation properties. */ dataset = H5Dcreate2(file, DATASETNAME, H5T_NATIVE_INT, dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT); /* * Extend the dataset. This call assures that dataset is at least 3 x 3. */ size[0] = 3; size[1] = 3; status = H5Dset_extent(dataset, size); /* * Select a hyperslab. */ filespace = H5Dget_space(dataset); offset[0] = 0; offset[1] = 0; status = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL, dims1, NULL); /* * Write the data to the hyperslab. */ status = H5Dwrite(dataset, H5T_NATIVE_INT, dataspace, filespace, H5P_DEFAULT, data1); /* * Extend the dataset. Dataset becomes 10 x 3. */ dims[0] = dims1[0] + dims2[0]; size[0] = dims[0]; size[1] = dims[1]; status = H5Dset_extent(dataset, size); /* * Select a hyperslab. */ filespace = H5Dget_space(dataset); offset[0] = 3; offset[1] = 0; status = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL, dims2, NULL); /* * Define memory space */ dataspace = H5Screate_simple(RANK, dims2, NULL); /* * Write the data to the hyperslab. */ status = H5Dwrite(dataset, H5T_NATIVE_INT, dataspace, filespace, H5P_DEFAULT, data2); /* * Extend the dataset. Dataset becomes 10 x 5. */ dims[1] = dims1[1] + dims3[1]; size[0] = dims[0]; size[1] = dims[1]; status = H5Dset_extent(dataset, size); /* * Select a hyperslab */ filespace = H5Dget_space(dataset); offset[0] = 0; offset[1] = 3; status = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL, dims3, NULL); /* * Define memory space. */ dataspace = H5Screate_simple(RANK, dims3, NULL); /* * Write the data to the hyperslab. */ status = H5Dwrite(dataset, H5T_NATIVE_INT, dataspace, filespace, H5P_DEFAULT, data3); /* * Resulting dataset * * 1 1 1 3 3 * 1 1 1 3 3 * 1 1 1 0 0 * 2 0 0 0 0 * 2 0 0 0 0 * 2 0 0 0 0 * 2 0 0 0 0 * 2 0 0 0 0 * 2 0 0 0 0 * 2 0 0 0 0 */ /* * Close/release resources. */ H5Dclose(dataset); H5Sclose(dataspace); H5Sclose(filespace); H5Pclose(cparms); H5Fclose(file); return 0; }