Correct name of CMake option to HDF5_ENABLE_DEPRECATED_SYMBOLS (#5587)

This commit is contained in:
Allen Byrne
2025-06-12 18:47:01 -05:00
committed by GitHub
parent 01d61245fe
commit d6ca8411de
25 changed files with 236 additions and 71 deletions
-1
View File
@@ -52,7 +52,6 @@ jobs:
-DHDF5_BUILD_DOC=OFF \
-DLIBAEC_USE_LOCALCONTENT=OFF \
-DZLIB_USE_LOCALCONTENT=OFF \
-DH5_NO_DEPRECATED_SYMBOLS:BOOL=OFF \
-DBUILD_TESTING:BOOL=OFF \
-DDEFAULT_API_VERSION:STRING=v16 \
-DCMAKE_INSTALL_PREFIX:PATH=/usr/local \
+1 -6
View File
@@ -57,7 +57,6 @@ jobs:
-DZLIB_USE_LOCALCONTENT=OFF \
-DHDF5_ENABLE_MIRROR_VFD:BOOL=ON \
-DHDF5_ENABLE_DIRECT_VFD:BOOL=ON \
-DH5_NO_DEPRECATED_SYMBOLS:BOOL=OFF \
-DHDF5_DEFAULT_API_VERSION:STRING=v16 \
$GITHUB_WORKSPACE
shell: bash
@@ -117,7 +116,6 @@ jobs:
-DZLIB_USE_LOCALCONTENT=OFF \
-DHDF5_ENABLE_MIRROR_VFD:BOOL=ON \
-DHDF5_ENABLE_DIRECT_VFD:BOOL=ON \
-DH5_NO_DEPRECATED_SYMBOLS:BOOL=OFF \
-DHDF5_DEFAULT_API_VERSION:STRING=v18 \
$GITHUB_WORKSPACE
shell: bash
@@ -172,7 +170,6 @@ jobs:
-DZLIB_USE_LOCALCONTENT=OFF \
-DHDF5_ENABLE_MIRROR_VFD:BOOL=ON \
-DHDF5_ENABLE_DIRECT_VFD:BOOL=ON \
-DH5_NO_DEPRECATED_SYMBOLS:BOOL=OFF \
-DHDF5_DEFAULT_API_VERSION:STRING=v110 \
$GITHUB_WORKSPACE
shell: bash
@@ -227,7 +224,6 @@ jobs:
-DZLIB_USE_LOCALCONTENT=OFF \
-DHDF5_ENABLE_MIRROR_VFD:BOOL=ON \
-DHDF5_ENABLE_DIRECT_VFD:BOOL=ON \
-DH5_NO_DEPRECATED_SYMBOLS:BOOL=OFF \
-DHDF5_DEFAULT_API_VERSION:STRING=v112 \
$GITHUB_WORKSPACE
shell: bash
@@ -280,7 +276,6 @@ jobs:
-DZLIB_USE_LOCALCONTENT=OFF \
-DHDF5_ENABLE_MIRROR_VFD:BOOL=ON \
-DHDF5_ENABLE_DIRECT_VFD:BOOL=ON \
-DH5_NO_DEPRECATED_SYMBOLS:BOOL=OFF \
-DHDF5_DEFAULT_API_VERSION:STRING=v114 \
$GITHUB_WORKSPACE
shell: bash
@@ -333,7 +328,7 @@ jobs:
-DZLIB_USE_LOCALCONTENT=OFF \
-DHDF5_ENABLE_MIRROR_VFD:BOOL=ON \
-DHDF5_ENABLE_DIRECT_VFD:BOOL=ON \
-DH5_NO_DEPRECATED_SYMBOLS:BOOL=OFF \
-DHDF5_ENABLE_DEPRECATED_SYMBOLS:BOOL=OFF \
-DHDF5_DEFAULT_API_VERSION:STRING=v200 \
$GITHUB_WORKSPACE
shell: bash
-1
View File
@@ -54,7 +54,6 @@ jobs:
-DHDF5_ENABLE_ZLIB_SUPPORT:BOOL=ON \
-DZLIB_USE_LOCALCONTENT:BOOL=OFF \
-DHDF5_ENABLE_ZLIB_SUPPORT:BOOL=ON \
-DH5_NO_DEPRECATED_SYMBOLS:BOOL=OFF \
-DBUILD_TESTING:BOOL=OFF \
-DCMAKE_INSTALL_PREFIX:PATH=/usr/local \
$GITHUB_WORKSPACE
+6
View File
@@ -3,6 +3,12 @@
This example shows how to create intermediate groups with
a single call to H5Gcreate.
Note: This example includes older cases from previous versions
of HDF5 for historical reference and to illustrate how to
migrate older code to newer functions. However, readers are
encouraged to avoid using deprecated functions and earlier
schemas from those versions.
************************************************************/
#include "hdf5.h"
+6
View File
@@ -3,6 +3,12 @@
This example shows how to iterate over group members using
H5Literate.
Note: This example includes older cases from previous versions
of HDF5 for historical reference and to illustrate how to
migrate older code to newer functions. However, readers are
encouraged to avoid using deprecated functions and earlier
schemas from those versions.
************************************************************/
#include "hdf5.h"
+66 -48
View File
@@ -9,10 +9,16 @@
implements the structure described in the User's Guide,
chapter 4, figure 26.
Note: This example includes older cases from previous versions
of HDF5 for historical reference and to illustrate how to
migrate older code to newer functions. However, readers are
encouraged to avoid using deprecated functions and earlier
schemas from those versions.
************************************************************/
#include "hdf5.h"
#include <stdio.h>
#include <string.h>
#define FILENAME "h5ex_g_traverse.h5"
@@ -25,33 +31,34 @@
struct opdata {
unsigned recurs; /* Recursion level. 0=root */
struct opdata *prev; /* Pointer to previous opdata */
haddr_t addr; /* Group address */
#if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API)
H5O_token_t token; /* Group token */
#else
haddr_t addr; /* Group address */
#endif
};
/*
* Operator function to be called by H5Literate.
*/
#if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API)
herr_t op_func(hid_t loc_id, const char *name, const H5L_info1_t *info, void *operator_data);
#else
herr_t op_func(hid_t loc_id, const char *name, const H5L_info_t *info, void *operator_data);
#endif
/*
* Function to check for duplicate groups in a path.
*/
#if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API)
/* Function to check for duplicate groups in a path. */
int group_check(hid_t loc_id, struct opdata *od, H5O_token_t target_token);
#else
/* Function to check for duplicate groups in a path. */
int group_check(struct opdata *od, haddr_t target_addr);
#endif
int
main(void)
{
hid_t file; /* Handle */
herr_t status;
#if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API)
H5O_info1_t infobuf;
#else
H5O_info_t infobuf;
#endif
hid_t file; /* Handle */
herr_t status;
H5O_info_t infobuf;
struct opdata od;
/*
@@ -59,23 +66,20 @@ main(void)
*/
file = H5Fopen(FILENAME, H5F_ACC_RDONLY, H5P_DEFAULT);
#if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API)
status = H5Oget_info2(file, &infobuf, H5O_INFO_ALL);
status = H5Oget_info(file, &infobuf, H5O_INFO_ALL);
memcpy(&od.token, &infobuf.token, sizeof(H5O_token_t));
#else
status = H5Oget_info(file, &infobuf);
status = H5Oget_info(file, &infobuf);
od.addr = infobuf.addr;
#endif
od.recurs = 0;
od.prev = NULL;
od.addr = infobuf.addr;
/*
* Print the root group and formatting, begin iteration.
*/
printf("/ {\n");
#if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API)
status = H5Literate1(file, H5_INDEX_NAME, H5_ITER_NATIVE, NULL, op_func, (void *)&od);
#else
status = H5Literate(file, H5_INDEX_NAME, H5_ITER_NATIVE, NULL, op_func, (void *)&od);
#endif
printf("}\n");
/*
@@ -97,33 +101,22 @@ main(void)
circular path in the file.
************************************************************/
#if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API)
herr_t
op_func(hid_t loc_id, const char *name, const H5L_info1_t *info, void *operator_data)
#else
herr_t
op_func(hid_t loc_id, const char *name, const H5L_info_t *info, void *operator_data)
#endif
{
herr_t status, return_val = 0;
#if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API)
H5O_info1_t infobuf;
#else
H5O_info_t infobuf;
#endif
struct opdata *od = (struct opdata *)operator_data;
/* Type conversion */
unsigned spaces = 2 * (od->recurs + 1);
/* Number of whitespaces to prepend
to output */
herr_t status;
herr_t return_val = 0;
struct opdata *od = (struct opdata *)operator_data; /* Type conversion */
unsigned spaces = 2 * (od->recurs + 1); /* Number of whitespaces to prepend to output */
/*
* Get type of the object and display its name and type.
* The name of the object is passed to this function by
* the Library.
*/
H5O_info_t infobuf;
#if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API)
status = H5Oget_info_by_name2(loc_id, name, &infobuf, H5O_INFO_ALL, H5P_DEFAULT);
status = H5Oget_info_by_name(loc_id, name, &infobuf, H5O_INFO_ALL, H5P_DEFAULT);
#else
status = H5Oget_info_by_name(loc_id, name, &infobuf, H5P_DEFAULT);
#endif
@@ -133,7 +126,7 @@ op_func(hid_t loc_id, const char *name, const H5L_info_t *info, void *operator_d
printf("Group: %s {\n", name);
/*
* Check group address against linked list of operator
* Check group address/token against linked list of operator
* data structures. We will always run the check, as the
* reference count cannot be relied upon if there are
* symbolic links, and H5Oget_info_by_name always follows
@@ -143,10 +136,16 @@ op_func(hid_t loc_id, const char *name, const H5L_info_t *info, void *operator_d
* reference count was manually manipulated with
* H5Odecr_refcount.
*/
#if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API)
if (group_check(loc_id, od, infobuf.token)) {
#else
if (group_check(od, infobuf.addr)) {
#endif
printf("%*s Warning: Loop detected!\n", spaces, "");
}
else {
if (od->recurs + 1 > 7)
return -1;
/*
* Initialize new operator data structure and
@@ -157,14 +156,13 @@ op_func(hid_t loc_id, const char *name, const H5L_info_t *info, void *operator_d
struct opdata nextod;
nextod.recurs = od->recurs + 1;
nextod.prev = od;
nextod.addr = infobuf.addr;
#if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API)
return_val = H5Literate_by_name1(loc_id, name, H5_INDEX_NAME, H5_ITER_NATIVE, NULL, op_func,
(void *)&nextod, H5P_DEFAULT);
memcpy(&nextod.token, &infobuf.token, sizeof(H5O_token_t));
#else
nextod.addr = infobuf.addr;
#endif
return_val = H5Literate_by_name(loc_id, name, H5_INDEX_NAME, H5_ITER_NATIVE, NULL, op_func,
(void *)&nextod, H5P_DEFAULT);
#endif
}
printf("%*s}\n", spaces, "");
break;
@@ -184,11 +182,30 @@ op_func(hid_t loc_id, const char *name, const H5L_info_t *info, void *operator_d
/************************************************************
This function recursively searches the linked list of
opdata structures for one whose address matches
target_addr. Returns 1 if a match is found, and 0
opdata structures for one whose address/token matches
target_addr/token. Returns 1 if a match is found, and 0
otherwise.
************************************************************/
#if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API)
int
group_check(hid_t loc_id, struct opdata *od, H5O_token_t target_token)
{
int token_cmp;
if (H5Otoken_cmp(loc_id, &od->token, &target_token, &token_cmp) < 0) {
return 0;
}
if (!token_cmp) {
return 1; /* Tokens match */
}
else if (!od->recurs)
return 0; /* Root group reached with no matches */
else { /* Recursively examine the next node */
return group_check(loc_id, od->prev, target_token);
}
}
#else
int
group_check(struct opdata *od, haddr_t target_addr)
{
@@ -196,7 +213,8 @@ group_check(struct opdata *od, haddr_t target_addr)
return 1; /* Addresses match */
else if (!od->recurs)
return 0; /* Root group reached with no matches */
else
else { /* Recursively examine the next node */
return group_check(od->prev, target_addr);
/* Recursively examine the next node */
}
}
#endif
+6
View File
@@ -7,6 +7,12 @@
example implements the structure described in the User's
Guide, chapter 4, figure 26.
Note: This example includes older cases from previous versions
of HDF5 for historical reference and to illustrate how to
migrate older code to newer functions. However, readers are
encouraged to avoid using deprecated functions and earlier
schemas from those versions.
************************************************************/
#include "hdf5.h"
+10
View File
@@ -6,6 +6,12 @@
then closes the file. Next, it reopens the file, reads
back the data, and outputs it to the screen.
Note: This example includes older cases from previous versions
of HDF5 for historical reference and to illustrate how to
migrate older code to newer functions. However, readers are
encouraged to avoid using deprecated functions and earlier
schemas from those versions.
************************************************************/
#include "hdf5.h"
@@ -148,7 +154,11 @@ main(void)
* traverse the structure and free any vlen data (strings in this
* case).
*/
#if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API)
status = H5Treclaim(memtype, space, H5P_DEFAULT, rdata);
#else
status = H5Dvlen_reclaim(memtype, space, H5P_DEFAULT, rdata);
#endif
free(rdata);
status = H5Dclose(dset);
status = H5Sclose(space);
+10
View File
@@ -6,6 +6,12 @@
DIM0, then closes the file. Next, it reopens the file,
reads back the data, and outputs it to the screen.
Note: This example includes older cases from previous versions
of HDF5 for historical reference and to illustrate how to
migrate older code to newer functions. However, readers are
encouraged to avoid using deprecated functions and earlier
schemas from those versions.
************************************************************/
#include "hdf5.h"
@@ -158,7 +164,11 @@ main(void)
* traverse the structure and free any vlen data (strings in this
* case).
*/
#if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API)
status = H5Treclaim(memtype, space, H5P_DEFAULT, rdata);
#else
status = H5Dvlen_reclaim(memtype, space, H5P_DEFAULT, rdata);
#endif
free(rdata);
status = H5Aclose(attr);
status = H5Dclose(dset);
+6
View File
@@ -7,6 +7,12 @@
datatype, and outputs the names of its fields to the
screen.
Note: This example includes older cases from previous versions
of HDF5 for historical reference and to illustrate how to
migrate older code to newer functions. However, readers are
encouraged to avoid using deprecated functions and earlier
schemas from those versions.
************************************************************/
#include "hdf5.h"
+10
View File
@@ -21,6 +21,12 @@
compound type contains an int, variable-length string and
two doubles.
Note: This example includes older cases from previous versions
of HDF5 for historical reference and to illustrate how to
migrate older code to newer functions. However, readers are
encouraged to avoid using deprecated functions and earlier
schemas from those versions.
************************************************************/
#include "hdf5.h"
@@ -305,7 +311,11 @@ main(void)
* traverse the structure and free any vlen data (including
* strings).
*/
#if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API)
status = H5Treclaim(rvehicletype, space, H5P_DEFAULT, rdata);
#else
status = H5Dvlen_reclaim(rvehicletype, space, H5P_DEFAULT, rdata);
#endif
free(rdata);
status = H5Dclose(dset);
status = H5Sclose(space);
+10
View File
@@ -21,6 +21,12 @@
compound type contains an int, variable-length string and
two doubles.
Note: This example includes older cases from previous versions
of HDF5 for historical reference and to illustrate how to
migrate older code to newer functions. However, readers are
encouraged to avoid using deprecated functions and earlier
schemas from those versions.
************************************************************/
#include "hdf5.h"
@@ -316,7 +322,11 @@ main(void)
* traverse the structure and free any vlen data (including
* strings).
*/
#if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API)
status = H5Treclaim(rvehicletype, space, H5P_DEFAULT, rdata);
#else
status = H5Dvlen_reclaim(rvehicletype, space, H5P_DEFAULT, rdata);
#endif
free(rdata);
status = H5Aclose(attr);
status = H5Dclose(dset);
+6
View File
@@ -7,6 +7,12 @@
reopens the file, dereferences the references, and outputs
the names of their targets to the screen.
Note: This example includes older cases from previous versions
of HDF5 for historical reference and to illustrate how to
migrate older code to newer functions. However, readers are
encouraged to avoid using deprecated functions and earlier
schemas from those versions.
************************************************************/
#include "hdf5.h"
+6
View File
@@ -7,6 +7,12 @@
Next, it reopens the file, dereferences the references,
and outputs the names of their targets to the screen.
Note: This example includes older cases from previous versions
of HDF5 for historical reference and to illustrate how to
migrate older code to newer functions. However, readers are
encouraged to avoid using deprecated functions and earlier
schemas from those versions.
************************************************************/
#include "hdf5.h"
+6
View File
@@ -6,6 +6,12 @@
Next, it reopens the file, reads back the data, and
outputs it to the screen.
Note: This example includes older cases from previous versions
of HDF5 for historical reference and to illustrate how to
migrate older code to newer functions. However, readers are
encouraged to avoid using deprecated functions and earlier
schemas from those versions.
************************************************************/
#include "hdf5.h"
+6
View File
@@ -6,6 +6,12 @@
file. Next, it reopens the file, reads back the data, and
outputs it to the screen.
Note: This example includes older cases from previous versions
of HDF5 for historical reference and to illustrate how to
migrate older code to newer functions. However, readers are
encouraged to avoid using deprecated functions and earlier
schemas from those versions.
************************************************************/
#include "hdf5.h"
+6
View File
@@ -8,6 +8,12 @@
dereferences the references, and outputs the referenced
regions to the screen.
Note: This example includes older cases from previous versions
of HDF5 for historical reference and to illustrate how to
migrate older code to newer functions. However, readers are
encouraged to avoid using deprecated functions and earlier
schemas from those versions.
************************************************************/
#include "hdf5.h"
+6
View File
@@ -8,6 +8,12 @@
dereferences the references, and outputs the referenced
regions to the screen.
Note: This example includes older cases from previous versions
of HDF5 for historical reference and to illustrate how to
migrate older code to newer functions. However, readers are
encouraged to avoid using deprecated functions and earlier
schemas from those versions.
************************************************************/
#include "hdf5.h"
+14
View File
@@ -6,6 +6,12 @@
the file. Next, it reopens the file, reads back the data,
and outputs it to the screen.
Note: This example includes older cases from previous versions
of HDF5 for historical reference and to illustrate how to
migrate older code to newer functions. However, readers are
encouraged to avoid using deprecated functions and earlier
schemas from those versions.
************************************************************/
#include "hdf5.h"
@@ -75,7 +81,11 @@ main(void)
* removes the need to manually free() the previously malloc'ed
* data.
*/
#if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API)
status = H5Treclaim(memtype, space, H5P_DEFAULT, wdata);
#else
status = H5Dvlen_reclaim(memtype, space, H5P_DEFAULT, wdata);
#endif
status = H5Dclose(dset);
status = H5Sclose(space);
status = H5Tclose(filetype);
@@ -133,7 +143,11 @@ main(void)
* top-level pointer "rdata", as H5Dvlen_reclaim only frees the
* actual variable-length data, and not the structures themselves.
*/
#if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API)
status = H5Treclaim(memtype, space, H5P_DEFAULT, rdata);
#else
status = H5Dvlen_reclaim(memtype, space, H5P_DEFAULT, rdata);
#endif
free(rdata);
status = H5Dclose(dset);
status = H5Sclose(space);
+14
View File
@@ -6,6 +6,12 @@
closes the file. Next, it reopens the file, reads back
the data, and outputs it to the screen.
Note: This example includes older cases from previous versions
of HDF5 for historical reference and to illustrate how to
migrate older code to newer functions. However, readers are
encouraged to avoid using deprecated functions and earlier
schemas from those versions.
************************************************************/
#include "hdf5.h"
@@ -83,7 +89,11 @@ main(void)
* removes the need to manually free() the previously malloc'ed
* data.
*/
#if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API)
status = H5Treclaim(memtype, space, H5P_DEFAULT, wdata);
#else
status = H5Dvlen_reclaim(memtype, space, H5P_DEFAULT, wdata);
#endif
status = H5Aclose(attr);
status = H5Dclose(dset);
status = H5Sclose(space);
@@ -143,7 +153,11 @@ main(void)
* top-level pointer "rdata", as H5Dvlen_reclaim only frees the
* actual variable-length data, and not the structures themselves.
*/
#if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API)
status = H5Treclaim(memtype, space, H5P_DEFAULT, rdata);
#else
status = H5Dvlen_reclaim(memtype, space, H5P_DEFAULT, rdata);
#endif
free(rdata);
status = H5Aclose(attr);
status = H5Dclose(dset);
+16 -6
View File
@@ -8,6 +8,12 @@
This file is intended for use with HDF5 Library version 1.8
Note: This example includes older cases from previous versions
of HDF5 for historical reference and to illustrate how to
migrate older code to newer functions. However, readers are
encouraged to avoid using deprecated functions and earlier
schemas from those versions.
************************************************************/
#include "hdf5.h"
@@ -108,13 +114,17 @@ main(void)
for (i = 0; i < dims[0]; i++)
printf("%s[%d]: %s\n", DATASET, i, rdata[i]);
/*
* Close and release resources. Note that H5Dvlen_reclaim works
* for variable-length strings as well as variable-length arrays.
* Also note that we must still free the array of pointers stored
* in rdata, as H5Tvlen_reclaim only frees the data these point to.
*/
/*
* Close and release resources. Note that H5Dvlen_reclaim works
* for variable-length strings as well as variable-length arrays.
* Also note that we must still free the array of pointers stored
* in rdata, as H5Tvlen_reclaim only frees the data these point to.
*/
#if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API)
status = H5Treclaim(memtype, space, H5P_DEFAULT, rdata);
#else
status = H5Dvlen_reclaim(memtype, space, H5P_DEFAULT, rdata);
#endif
free(rdata);
status = H5Dclose(dset);
status = H5Sclose(space);
+16 -6
View File
@@ -9,6 +9,12 @@
This file is intended for use with HDF5 Library version 1.8
Note: This example includes older cases from previous versions
of HDF5 for historical reference and to illustrate how to
migrate older code to newer functions. However, readers are
encouraged to avoid using deprecated functions and earlier
schemas from those versions.
************************************************************/
#include "hdf5.h"
@@ -119,13 +125,17 @@ main(void)
for (i = 0; i < dims[0]; i++)
printf("%s[%d]: %s\n", ATTRIBUTE, i, rdata[i]);
/*
* Close and release resources. Note that H5Dvlen_reclaim works
* for variable-length strings as well as variable-length arrays.
* Also note that we must still free the array of pointers stored
* in rdata, as H5Tvlen_reclaim only frees the data these point to.
*/
/*
* Close and release resources. Note that H5Dvlen_reclaim works
* for variable-length strings as well as variable-length arrays.
* Also note that we must still free the array of pointers stored
* in rdata, as H5Tvlen_reclaim only frees the data these point to.
*/
#if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API)
status = H5Treclaim(memtype, space, H5P_DEFAULT, rdata);
#else
status = H5Dvlen_reclaim(memtype, space, H5P_DEFAULT, rdata);
#endif
free(rdata);
status = H5Aclose(attr);
status = H5Dclose(dset);
@@ -10,6 +10,12 @@
! implements the structure described in the User's Guide,
! chapter 4, figure 26.
!
!Note: This example includes older cases from previous versions
! of HDF5 for historical reference and to illustrate how to
! migrate older code to newer functions. However, readers are
! encouraged to avoid using deprecated functions and earlier
! schemas from those versions.
!
! ************************************************************
! An optional include to determine the correct HDF5 version
+1 -1
View File
@@ -193,7 +193,7 @@ Navigate back: \ref index "Main" / \ref TN
overrides the behavior specified by the library mapping, and can be overridden
on a function-by-function basis by the function mappings.
If the HDF5 library was configured with the \TText{--disable-deprecated-symbols} flag, then
If the HDF5 library was configured with the \TText{-DHDF5_ENABLE_DEPRECATED_SYMBOLS:BOOL=OFF} flag, then
the deprecated functions will not be available, regardless of the application mapping options.
<div align="center">Table 2: Application Mapping Options
+2 -2
View File
@@ -3,9 +3,9 @@ project (HDF5_F90_SRC C Fortran)
#-----------------------------------------------------------------------------
if (H5_NO_DEPRECATED_SYMBOLS)
set (CMAKE_NO_DEPRECATED_SYMBOLS 0)
else ()
set (CMAKE_NO_DEPRECATED_SYMBOLS 1)
else ()
set (CMAKE_NO_DEPRECATED_SYMBOLS 0)
endif ()
# configure def file for shared libs on windows