summaryrefslogtreecommitdiffstats
path: root/tools/h5ls
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-08-30 13:55:10 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-08-30 13:55:10 (GMT)
commitc50c23d387121f2acaf364fa3c1f5d407c4ffb43 (patch)
tree70719be38921637a74c90894d837973017bc68f0 /tools/h5ls
parent926a033b139974a8a9fd6ddec7150bcbdb556675 (diff)
downloadhdf5-c50c23d387121f2acaf364fa3c1f5d407c4ffb43.zip
hdf5-c50c23d387121f2acaf364fa3c1f5d407c4ffb43.tar.gz
hdf5-c50c23d387121f2acaf364fa3c1f5d407c4ffb43.tar.bz2
[svn-r14129] Description:
Add H5O{set|get}_comment routines, which were overlooked before. Move H5G{set|get}_comment routines to deprecated code section, replacing internal calls with H5O{set|get}_comment. Tested on: FreeBSD/32 6.2 (duty) FreeBSD/64 6.2 (liberty) Linux/32 2.6 (kagiso) Linux/64 2.6 (smirom) Solaris/32 5.10 (linew) AIX/32 5.3 (copper) Mac OS X/32 10.4.10 (amazon)
Diffstat (limited to 'tools/h5ls')
-rw-r--r--tools/h5ls/h5ls.c44
1 files changed, 23 insertions, 21 deletions
diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c
index f127f3f..9dce3f9 100644
--- a/tools/h5ls/h5ls.c
+++ b/tools/h5ls/h5ls.c
@@ -1894,40 +1894,42 @@ list (hid_t group, const char *name, void *_iter)
/* Show detailed information about the object, beginning with information
* which is common to all objects. */
- if (verbose_g>0 && H5G_LINK!=sb.type && H5G_UDLINK!=sb.type) {
- if (sb.type>=0)
+ if(verbose_g > 0 && H5G_LINK != sb.type && H5G_UDLINK != sb.type) {
+ if(sb.type >= 0)
H5Aiterate(obj, NULL, list_attr, NULL);
printf(" %-10s %lu:"H5_PRINTF_HADDR_FMT"\n", "Location:", sb.fileno[0], objno);
printf(" %-10s %u\n", "Links:", sb.nlink);
- if (sb.mtime>0) {
- if (simple_output_g) tm=gmtime(&(sb.mtime));
- else tm=localtime(&(sb.mtime));
- if (tm) {
- strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S %Z", tm);
+ if(sb.mtime > 0) {
+ if(simple_output_g)
+ tm = HDgmtime(&(sb.mtime));
+ else
+ tm = HDlocaltime(&(sb.mtime));
+ if(tm) {
+ HDstrftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S %Z", tm);
printf(" %-10s %s\n", "Modified:", buf);
- }
- }
+ } /* end if */
+ } /* end if */
comment[0] = '\0';
- H5Gget_comment(group, name, sizeof(comment), comment);
- strcpy(comment+sizeof(comment)-4, "...");
- if (comment[0]) {
+ H5Oget_comment(group, name, comment, sizeof(comment), H5P_DEFAULT);
+ HDstrcpy(comment + sizeof(comment) - 4, "...");
+ if(comment[0]) {
printf(" %-10s \"", "Comment:");
display_string(stdout, comment, FALSE);
puts("\"");
- }
- }
- if (sb.type>=0 && dispatch_g[sb.type].list2) {
+ } /* end if */
+ } /* end if */
+ if(sb.type>=0 && dispatch_g[sb.type].list2)
(dispatch_g[sb.type].list2)(obj, fullname);
- }
- /* Close the object. */
done:
- if (sb.type>=0 && obj>=0 && dispatch_g[sb.type].close) {
+ /* Close the object. */
+ if(sb.type >= 0 && obj >= 0 && dispatch_g[sb.type].close)
(dispatch_g[sb.type].close)(obj);
- }
- if (fullname) free(fullname);
+
+ if (fullname)
+ free(fullname);
return 0;
-}
+} /* end list() */
/*-------------------------------------------------------------------------