diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2004-05-26 19:43:56 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2004-05-26 19:43:56 (GMT) |
commit | 6223a679ce610d98a7735c426c76162a3ecd34b1 (patch) | |
tree | 2520cb26ace7d6f6e4e9ab5698764162623d2a15 /tools/h5repack/testh5repack_attr.c | |
parent | dd03ef3f27627a0f482bb847b23664879df736fc (diff) | |
download | hdf5-6223a679ce610d98a7735c426c76162a3ecd34b1.zip hdf5-6223a679ce610d98a7735c426c76162a3ecd34b1.tar.gz hdf5-6223a679ce610d98a7735c426c76162a3ecd34b1.tar.bz2 |
[svn-r8582] *** empty log message ***
Diffstat (limited to 'tools/h5repack/testh5repack_attr.c')
-rw-r--r-- | tools/h5repack/testh5repack_attr.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/tools/h5repack/testh5repack_attr.c b/tools/h5repack/testh5repack_attr.c index a1dad92..135d15b 100644 --- a/tools/h5repack/testh5repack_attr.c +++ b/tools/h5repack/testh5repack_attr.c @@ -1028,5 +1028,30 @@ etc make_attr(loc_id,3,dims3,"float3D",H5T_NATIVE_FLOAT,buf83); } - - +/*------------------------------------------------------------------------- + * Function: write_null_attr + * + * Purpose: write null attribute in LOC_ID (dataset, group, named datatype) + * + * Programmer: Raymond Lu, slu@ncsa.uiuc.edu + * + * Date: May 24, 2004 + * + *------------------------------------------------------------------------- + */ +void write_null_attr(hid_t loc_id) +{ + hid_t sid, attr_id; + int val = 2; + + /* Create the null attribute */ + sid = H5Screate(H5S_NULL); + attr_id = H5Acreate(loc_id, "null_attr", H5T_NATIVE_INT, sid, H5P_DEFAULT); + + /* Not supposed to write anything */ + H5Awrite(attr_id, H5T_NATIVE_INT, &val); + + /* Close */ + H5Aclose(attr_id); + H5Sclose(sid); +} |