/* Position the file for /soft_one: replace link value offset in the scratch pad "32" by bad offset */
 
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * 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    *
 * 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.                                                        *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
 * Purpose: Generate an HDF5 file for testing H5FFV-10216
 */
#include "h5test.h"
#define TESTFILE    "bad_offset.h5"
#define GRP1        "group1"
#define GRP2        "group2"
#define DSET        "dsetA"
#define SOFT1       "soft_one"
#define SOFT2       "soft_two"
/*-------------------------------------------------------------------------
 * Function:    main
 *
 *              Generate an HDF5 file with groups, datasets and symbolic links. 
 *              After the file is generated, write bad offset values to 
 *              the heap at 3 locations in the file:
 *              (A) Open the file:
 *                  fd = HDopen(TESTFILE, O_RDWR, 0663);
 *              (B) Position the file at:
 *                  (1) HDlseek(fd, (HDoff_t)880, SEEK_SET);
 *                      "/group1/group2": replace heap offset "8" by bad offset
 *                  (2) HDlseek(fd, (HDoff_t)1512, SEEK_SET);
 *                      "/dsetA": replace name offset into private heap "72" by bad offset 
 *                  (3) HDlseek(fd, (HDoff_t)1616, SEEK_SET);
 *                      /soft_one: replace link value offset in the scratch pad "32" by bad offset
 *              (C) Write the bad offset value to the file for (1), (2) and (3):
 *                  write(fd, &val, sizeof(val));
 *
 *              Note: if the groups/datasets/symbolic links are changed in the file,
 *              the above locations need to be adjusted accordingly.
 *
 * Return:      EXIT_SUCCESS/EXIT_FAILURE
 *
 *-------------------------------------------------------------------------