summaryrefslogtreecommitdiffstats
path: root/tools/h5repack/testh5repack_make.c
diff options
context:
space:
mode:
authorJames Laird <jlaird@hdfgroup.org>2006-08-02 23:41:53 (GMT)
committerJames Laird <jlaird@hdfgroup.org>2006-08-02 23:41:53 (GMT)
commit3e755623cb24eb37c19fa645d74dc46948318253 (patch)
tree66e0a3807f37d50a8d6e5f3469864c604cd837c6 /tools/h5repack/testh5repack_make.c
parent71a4d0e9c48c4e02e5384cd3f6e38a2a530e9d22 (diff)
downloadhdf5-3e755623cb24eb37c19fa645d74dc46948318253.zip
hdf5-3e755623cb24eb37c19fa645d74dc46948318253.tar.gz
hdf5-3e755623cb24eb37c19fa645d74dc46948318253.tar.bz2
[svn-r12528] Added User-Defined links to the library.
Users can create external links using H5L_create_external(). These links point to an object in another HDF5 file. Users can alter the behavior of external links or create new kinds of links by registering callbacks using the H5L interface. Added tests, tools support, etc. Also a number of other, minor changes have been made (some restructuring of the H5L interface, for instance). Additional documentation and examples are forthcoming.
Diffstat (limited to 'tools/h5repack/testh5repack_make.c')
-rw-r--r--tools/h5repack/testh5repack_make.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/tools/h5repack/testh5repack_make.c b/tools/h5repack/testh5repack_make.c
index 43b68b1..a74d466 100644
--- a/tools/h5repack/testh5repack_make.c
+++ b/tools/h5repack/testh5repack_make.c
@@ -259,7 +259,14 @@ int make_all_objects(hid_t loc_id)
*-------------------------------------------------------------------------
*/
- H5Glink(loc_id, H5G_LINK_SOFT, "dset", "link");
+ H5Glink(loc_id, H5L_LINK_SOFT, "dset", "link");
+
+/*-------------------------------------------------------------------------
+ * H5G_UDLINK
+ *-------------------------------------------------------------------------
+ */
+ /* Create an external link. Other UD links are not supported by h5repack */
+ H5Lcreate_external("file", "path", loc_id, "ext_link", H5P_DEFAULT, H5P_DEFAULT);
/*-------------------------------------------------------------------------
* write a series of datasetes
@@ -350,11 +357,11 @@ int make_hlinks(hid_t loc_id)
if (write_dset(loc_id,2,dims,"dset",H5T_NATIVE_INT,buf)<0)
return -1;
- if (H5Glink(loc_id, H5G_LINK_HARD, "dset", "link1 to dset")<0)
+ if (H5Glink(loc_id, H5L_LINK_HARD, "dset", "link1 to dset")<0)
return -1;
- if (H5Glink(loc_id, H5G_LINK_HARD, "dset", "link2 to dset")<0)
+ if (H5Glink(loc_id, H5L_LINK_HARD, "dset", "link2 to dset")<0)
return -1;
- if (H5Glink(loc_id, H5G_LINK_HARD, "dset", "link3 to dset")<0)
+ if (H5Glink(loc_id, H5L_LINK_HARD, "dset", "link3 to dset")<0)
return -1;
@@ -370,9 +377,9 @@ int make_hlinks(hid_t loc_id)
if ((group3_id = H5Gcreate(group2_id,"g3",0))<0)
return -1;
- if (H5Glink2(loc_id, "g1", H5G_LINK_HARD, group2_id, "link1 to g1")<0)
+ if (H5Glink2(loc_id, "g1", H5L_LINK_HARD, group2_id, "link1 to g1")<0)
return -1;
- if (H5Glink2(group1_id, "g2", H5G_LINK_HARD, group3_id, "link1 to g2")<0)
+ if (H5Glink2(group1_id, "g2", H5L_LINK_HARD, group3_id, "link1 to g2")<0)
return -1;
H5Gclose(group1_id);