summaryrefslogtreecommitdiffstats
path: root/c++
diff options
context:
space:
mode:
authorScot Breitenfeld <brtnfld@hdfgroup.org>2009-09-02 21:27:03 (GMT)
committerScot Breitenfeld <brtnfld@hdfgroup.org>2009-09-02 21:27:03 (GMT)
commit42be1460e464fc1d3d2c843ff9a2841cb9767d15 (patch)
treeef534736944298a20a076c1111c9e30bd2d8e5f5 /c++
parentc1d205d282137c93dc8f2cac757045960075ca2c (diff)
downloadhdf5-42be1460e464fc1d3d2c843ff9a2841cb9767d15.zip
hdf5-42be1460e464fc1d3d2c843ff9a2841cb9767d15.tar.gz
hdf5-42be1460e464fc1d3d2c843ff9a2841cb9767d15.tar.bz2
[svn-r17443] Description:
Merged changes from the trunk into the branch: svn merge -r17188:17442 https://svn.hdfgroup.uiuc.edu/hdf5/trunk Tested: smirom (icc, gcc)
Diffstat (limited to 'c++')
-rw-r--r--c++/Makefile.in134
-rw-r--r--c++/examples/Makefile.in48
-rw-r--r--c++/src/H5AbstractDs.cpp5
-rw-r--r--c++/src/H5AbstractDs.h3
-rw-r--r--c++/src/H5Attribute.cpp243
-rw-r--r--c++/src/H5Attribute.h8
-rw-r--r--c++/src/H5DataSet.cpp203
-rw-r--r--c++/src/H5DataSet.h9
-rw-r--r--c++/src/Makefile.in182
-rw-r--r--c++/test/Makefile.in90
-rw-r--r--c++/test/tvlstr.cpp465
11 files changed, 973 insertions, 417 deletions
diff --git a/c++/Makefile.in b/c++/Makefile.in
index 1016377..0c4531e 100644
--- a/c++/Makefile.in
+++ b/c++/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -32,8 +33,9 @@
#
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
@@ -60,6 +62,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/src/H5config.h
CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
@@ -71,9 +74,39 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
ps-recursive uninstall-recursive
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+ distdir
ETAGS = etags
CTAGS = ctags
+am__tty_colors = \
+red=; grn=; lgn=; blu=; std=
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
ACLOCAL = /home1/packages/automake/automake-1.9.6/bin/aclocal-1.9 -I /afs/ncsa/projects/hdf/packages/libtool_1.5.14/Linux_2.4/share/aclocal
ADD_PARALLEL_FILES = @ADD_PARALLEL_FILES@
AMTAR = @AMTAR@
@@ -187,6 +220,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PARALLEL = @PARALLEL@
PATH_SEPARATOR = @PATH_SEPARATOR@
@@ -278,6 +312,7 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
@@ -352,9 +387,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign c++/Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign c++/Makefile
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign c++/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign c++/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -372,6 +407,7 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
@@ -403,7 +439,7 @@ $(RECURSIVE_TARGETS):
else \
local_target="$$target"; \
fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
@@ -437,16 +473,16 @@ $(RECURSIVE_CLEAN_TARGETS):
else \
local_target="$$target"; \
fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@@ -461,7 +497,7 @@ tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
- tags=; \
+ set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
@@ -473,7 +509,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
- tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -482,29 +518,34 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
- tags=; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
+ $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -525,29 +566,44 @@ distdir: $(DISTFILES)
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
- list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
- distdir=`$(am__cd) $(distdir) && pwd`; \
- top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
- (cd $$subdir && \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$$top_distdir" \
- distdir="$$distdir/$$subdir" \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
+ am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
@@ -578,6 +634,7 @@ clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -596,6 +653,8 @@ dvi-am:
html: html-recursive
+html-am:
+
info: info-recursive
info-am:
@@ -604,18 +663,28 @@ install-data-am:
install-dvi: install-dvi-recursive
+install-dvi-am:
+
install-exec-am:
install-html: install-html-recursive
+install-html-am:
+
install-info: install-info-recursive
+install-info-am:
+
install-man:
install-pdf: install-pdf-recursive
+install-pdf-am:
+
install-ps: install-ps-recursive
+install-ps-am:
+
installcheck-am: installcheck-local
maintainer-clean: maintainer-clean-recursive
@@ -637,8 +706,8 @@ ps-am:
uninstall-am:
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
- install-strip
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) check-am \
+ ctags-recursive install-am install-strip tags-recursive
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am all-local check check-TESTS check-am clean \
@@ -877,6 +946,7 @@ check-vfd: $(LIB) $(PROGS) $(TESTS)
HDF5_DRIVER=$$vfd $(MAKE) $(AM_MAKEFLAGS) check || exit 1; \
fi; \
done
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/c++/examples/Makefile.in b/c++/examples/Makefile.in
index e5749e6..00dc185 100644
--- a/c++/examples/Makefile.in
+++ b/c++/examples/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -36,8 +37,9 @@
# This creates some extra work for us.
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
@@ -65,8 +67,11 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/src/H5config.h
CONFIG_CLEAN_FILES = testh5c++.sh
+CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
+am__tty_colors = \
+red=; grn=; lgn=; blu=; std=
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = /home1/packages/automake/automake-1.9.6/bin/aclocal-1.9 -I /afs/ncsa/projects/hdf/packages/libtool_1.5.14/Linux_2.4/share/aclocal
ADD_PARALLEL_FILES = @ADD_PARALLEL_FILES@
@@ -181,6 +186,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PARALLEL = @PARALLEL@
PATH_SEPARATOR = @PATH_SEPARATOR@
@@ -272,6 +278,7 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
@@ -369,9 +376,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign c++/examples/Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign c++/examples/Makefile
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign c++/examples/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign c++/examples/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -389,6 +396,7 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
testh5c++.sh: $(top_builddir)/config.status $(srcdir)/testh5c++.sh.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
@@ -420,13 +428,17 @@ distdir: $(DISTFILES)
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@@ -457,6 +469,7 @@ clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -475,6 +488,8 @@ dvi-am:
html: html-am
+html-am:
+
info: info-am
info-am:
@@ -483,18 +498,28 @@ install-data-am: install-data-local
install-dvi: install-dvi-am
+install-dvi-am:
+
install-exec-am:
install-html: install-html-am
+install-html-am:
+
install-info: install-info-am
+install-info-am:
+
install-man:
install-pdf: install-pdf-am
+install-pdf-am:
+
install-ps: install-ps-am
+install-ps-am:
+
installcheck-am: installcheck-local
maintainer-clean: maintainer-clean-am
@@ -516,7 +541,7 @@ ps-am:
uninstall-am: uninstall-local
-.MAKE: install-am install-strip
+.MAKE: check-am install-am install-strip
.PHONY: all all-am all-local check check-TESTS check-am clean \
clean-generic clean-libtool distclean distclean-generic \
@@ -791,6 +816,7 @@ check-vfd: $(LIB) $(PROGS) $(TESTS)
HDF5_DRIVER=$$vfd $(MAKE) $(AM_MAKEFLAGS) check || exit 1; \
fi; \
done
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/c++/src/H5AbstractDs.cpp b/c++/src/H5AbstractDs.cpp
index a61cc88..19eeb33 100644
--- a/c++/src/H5AbstractDs.cpp
+++ b/c++/src/H5AbstractDs.cpp
@@ -25,6 +25,11 @@
#include "H5CommonFG.h"
#include "H5Alltypes.h"
+#include <iostream> // remove when done
+
+ using std::cerr;
+ using std::endl;
+
#ifndef H5_NO_NAMESPACE
namespace H5 {
#endif
diff --git a/c++/src/H5AbstractDs.h b/c++/src/H5AbstractDs.h
index c98e5e1..1d04d6c 100644
--- a/c++/src/H5AbstractDs.h
+++ b/c++/src/H5AbstractDs.h
@@ -51,6 +51,9 @@ class H5_DLLCPP AbstractDs {
StrType getStrType() const;
VarLenType getVarLenType() const;
+ // Gets the size in memory of this abstract dataset.
+ virtual size_t getInMemDataSize() const = 0;
+
// Gets the dataspace of this abstract dataset - pure virtual.
virtual DataSpace getSpace() const = 0;
diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp
index a844b77..6de5e63 100644
--- a/c++/src/H5Attribute.cpp
+++ b/c++/src/H5Attribute.cpp
@@ -150,50 +150,6 @@ void Attribute::read( const DataType& mem_type, void *buf ) const
}
//--------------------------------------------------------------------------
-// Function: Attribute::getInMemDataSize
-///\brief Gets the size in memory of the attribute's data.
-///\exception H5::AttributeIException
-// Programmer Binh-Minh Ribler - 2000
-//--------------------------------------------------------------------------
-size_t Attribute::getInMemDataSize() const
-{
- // Get the data type of this attribute
- hid_t mem_type_id = H5Aget_type(id);
- if (mem_type_id <= 0)
- {
- throw AttributeIException("Attribute::getDataSize", "H5Aget_type failed");
- }
-
- // Get the data type's size
- hid_t native_type = H5Tget_native_type(mem_type_id, H5T_DIR_DEFAULT);
- if (native_type < 0)
- {
- throw AttributeIException("Attribute::read", "H5Tget_native_type failed");
- }
- size_t type_size = H5Tget_size(native_type);
- if (type_size == 0)
- {
- throw AttributeIException("Attribute::read", "H5Tget_size failed");
- }
-
- // Get number of elements of the attribute
- hid_t space_id = H5Aget_space(id);
- if (space_id < 0)
- {
- throw AttributeIException("Attribute::read", "H5Aget_space failed");
- }
- hssize_t num_elements = H5Sget_simple_extent_npoints(space_id);
- if (num_elements < 0)
- {
- throw AttributeIException("Attribute::read", "H5Sget_simple_extent_npoints failed");
- }
-
- // Calculate and return the size of the data
- size_t data_size = type_size * num_elements;
- return(data_size);
-}
-
-//--------------------------------------------------------------------------
// Function: Attribute::read
///\brief This is an overloaded member function, provided for convenience.
/// It reads a \a H5std_string from this attribute.
@@ -206,73 +162,78 @@ size_t Attribute::getInMemDataSize() const
// Corrected a misunderstanding that H5Aread would allocate
// space for the buffer. Obtained the attribute size and
// allocated memory properly. - BMR
+// Apr 2009
+// Used getInMemDataSize to get attribute data size. - BMR
+// Jul 2009
+// Divided into specific private functions for fixed- and
+// variable-len string data: p_read_fixed_len and
+// p_read_variable_len. This should improve readability.
//--------------------------------------------------------------------------
void Attribute::read(const DataType& mem_type, H5std_string& strg) const
{
-
// Check if this attribute has variable-len string or fixed-len string and
// proceed appropriately.
htri_t is_variable_len = H5Tis_variable_str(mem_type.getId());
if (is_variable_len < 0)
{
- throw AttributeIException("Attribute::write", "H5Tis_variable_str failed");
+ throw AttributeIException("Attribute::read", "H5Tis_variable_str failed");
}
- // Prepare and call C API to read attribute.
- char *strg_C;
- herr_t ret_value = 0;
- size_t attr_size;
- if (!is_variable_len) // only allocate for fixed-len string
+ if (!is_variable_len) // only allocate for fixed-len string
{
- // Get the size of the attribute's data
- attr_size = getInMemDataSize();
-
- if (attr_size > 0)
- {
- strg_C = new char [(size_t)attr_size+1];
- if (strg_C == NULL)
- {
- throw AttributeIException("Attribute::read",
- "Unable to allocate buffer to read the attribute");
- }
- ret_value = H5Aread(id, mem_type.getId(), strg_C);
- }
- else
- HDstrcpy(strg_C, "");
+ p_read_fixed_len(mem_type, strg);
}
else
{
- // no allocation for variable-len string; C library will
- ret_value = H5Aread(id, mem_type.getId(), &strg_C);
+ p_read_variable_len(mem_type, strg);
}
- if( ret_value < 0 )
+}
+
+//--------------------------------------------------------------------------
+// Function: Attribute::getInMemDataSize
+///\brief Gets the size in memory of the attribute's data.
+///\return Size of data (in memory)
+///\exception H5::AttributeIException
+// Programmer Binh-Minh Ribler - Apr 2009
+//--------------------------------------------------------------------------
+size_t Attribute::getInMemDataSize() const
+{
+ char *func = "Attribute::getInMemDataSize";
+
+ // Get the data type of this attribute
+ hid_t mem_type_id = H5Aget_type(id);
+ if( mem_type_id < 0 )
{
- if (!is_variable_len) // only de-allocate for fixed-len string
- delete []strg_C;
- throw AttributeIException("Attribute::read", "H5Aread failed");
+ throw AttributeIException(func, "H5Aget_type failed");
}
- if( ret_value < 0 )
+ // Get the data type's size
+ hid_t native_type = H5Tget_native_type(mem_type_id, H5T_DIR_DEFAULT);
+ if (native_type < 0)
{
- if (!is_variable_len) // only de-allocate for fixed-len string
- delete []strg_C;
- throw AttributeIException("Attribute::read", "H5Aread failed");
+ throw AttributeIException(func, "H5Tget_native_type failed");
+ }
+ size_t type_size = H5Tget_size(native_type);
+ if (type_size == 0)
+ {
+ throw AttributeIException(func, "H5Tget_size failed");
}
- // Get string from the C char* and release resource allocated locally
- if (!is_variable_len)
+ // Get number of elements of the attribute
+ hid_t space_id = H5Aget_space(id);
+ if (space_id < 0)
{
- if (strg_C != "")
- strg_C[attr_size] = '\0';
- strg = strg_C;
- delete []strg_C;
+ throw AttributeIException(func, "H5Aget_space failed");
}
- // Get string from the C char* and release resource allocated by C API
- else
+ hssize_t num_elements = H5Sget_simple_extent_npoints(space_id);
+ if (num_elements < 0)
{
- strg = strg_C;
- HDfree(strg_C);
+ throw AttributeIException(func, "H5Sget_simple_extent_npoints failed");
}
+
+ // Calculate and return the size of the data
+ size_t data_size = type_size * num_elements;
+ return(data_size);
}
//--------------------------------------------------------------------------
@@ -300,26 +261,6 @@ DataSpace Attribute::getSpace() const
}
//--------------------------------------------------------------------------
-// Function: Attribute::p_get_type (private)
-// Purpose Gets the datatype of this attribute.
-// Return Id of the datatype
-// Exception H5::AttributeIException
-// Description
-// This private function is used in AbstractDs.
-// Programmer Binh-Minh Ribler - 2000
-//--------------------------------------------------------------------------
-hid_t Attribute::p_get_type() const
-{
- hid_t type_id = H5Aget_type( id );
- if( type_id > 0 )
- return( type_id );
- else
- {
- throw AttributeIException("", "H5Aget_type failed");
- }
-}
-
-//--------------------------------------------------------------------------
// Function: Attribute::getFileName
///\brief Gets the name of the file, in which this attribute belongs.
///\return File name
@@ -441,6 +382,96 @@ hid_t Attribute::getId() const
}
//--------------------------------------------------------------------------
+// Function: Attribute::p_get_type (private)
+// Purpose Gets the datatype of this attribute.
+// Return Id of the datatype
+// Exception H5::AttributeIException
+// Description
+// This private function is used in AbstractDs.
+// Programmer Binh-Minh Ribler - 2000
+//--------------------------------------------------------------------------
+hid_t Attribute::p_get_type() const
+{
+ hid_t type_id = H5Aget_type( id );
+ if( type_id > 0 )
+ return( type_id );
+ else
+ {
+ throw AttributeIException("", "H5Aget_type failed");
+ }
+}
+
+//--------------------------------------------------------------------------
+// Function: Attribute::p_read_fixed_len (private)
+// brief Reads a fixed length \a H5std_string from an attribute.
+// param mem_type - IN: Attribute datatype (in memory)
+// param strg - IN: Buffer for read string
+// exception H5::AttributeIException
+// Programmer Binh-Minh Ribler - Jul, 2009
+// Modification
+// Jul 2009
+// Separated the fixed length case from the original
+// Attribute::read
+//--------------------------------------------------------------------------
+void Attribute::p_read_fixed_len(const DataType& mem_type, H5std_string& strg) const
+{
+ // Only allocate for fixed-len string.
+
+ // Get the size of the attribute's data
+ size_t attr_size = getInMemDataSize();
+
+ // If there is data, allocate buffer and read it.
+ if (attr_size > 0)
+ {
+ char *strg_C = NULL;
+
+ strg_C = new char [(size_t)attr_size+1];
+ herr_t ret_value = H5Aread(id, mem_type.getId(), strg_C);
+
+ if( ret_value < 0 )
+ {
+ delete []strg_C; // de-allocate for fixed-len string
+ throw AttributeIException("Attribute::read", "H5Aread failed");
+ }
+
+ // Get string from the C char* and release resource allocated locally
+ strg = strg_C;
+ delete []strg_C;
+ }
+}
+
+//--------------------------------------------------------------------------
+// Function: Attribute::p_read_variable_len (private)
+// brief Reads a variable length \a H5std_string from an attribute.
+// param mem_type - IN: Attribute datatype (in memory)
+// param strg - IN: Buffer for read string
+// exception H5::AttributeIException
+// Programmer Binh-Minh Ribler - Jul, 2009
+// Modification
+// Jul 2009
+// Separated the variable length case from the original
+// Attribute::read
+//--------------------------------------------------------------------------
+void Attribute::p_read_variable_len(const DataType& mem_type, H5std_string& strg) const
+{
+
+ // Prepare and call C API to read attribute.
+ char *strg_C;
+
+ // Read attribute, no allocation for variable-len string; C library will
+ herr_t ret_value = H5Aread(id, mem_type.getId(), &strg_C);
+
+ if( ret_value < 0 )
+ {
+ throw AttributeIException("Attribute::read", "H5Aread failed");
+ }
+
+ // Get string from the C char* and release resource allocated by C API
+ strg = strg_C;
+ HDfree(strg_C);
+}
+
+//--------------------------------------------------------------------------
// Function: Attribute::p_setId
///\brief Sets the identifier of this object to a new value.
///
diff --git a/c++/src/H5Attribute.h b/c++/src/H5Attribute.h
index 00a08a5..284e5bc 100644
--- a/c++/src/H5Attribute.h
+++ b/c++/src/H5Attribute.h
@@ -38,10 +38,10 @@ class H5_DLLCPP Attribute : public AbstractDs, public IdComponent {
virtual DataSpace getSpace() const;
// Returns the amount of storage size required for this attribute.
- hsize_t getStorageSize() const;
+ virtual hsize_t getStorageSize() const;
// Returns the in memory size of this attribute's data.
- size_t getInMemDataSize() const;
+ virtual size_t getInMemDataSize() const;
// Reads data from this attribute.
void read( const DataType& mem_type, void *buf ) const;
@@ -82,6 +82,10 @@ class H5_DLLCPP Attribute : public AbstractDs, public IdComponent {
// sub-types
virtual hid_t p_get_type() const;
+ // Reads variable or fixed len strings from this attribute.
+ void p_read_variable_len(const DataType& mem_type, H5std_string& strg) const;
+ void p_read_fixed_len(const DataType& mem_type, H5std_string& strg) const;
+
// do not inherit H5Object::iterateAttrs
int iterateAttrs() { return 0; }
diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp
index 494d3ea..cddb5d4 100644
--- a/c++/src/H5DataSet.cpp
+++ b/c++/src/H5DataSet.cpp
@@ -37,6 +37,7 @@
#include "H5File.h"
#include "H5Attribute.h"
#include "H5DataSet.h"
+#include "H5private.h" // for HDfree
#ifndef H5_NO_NAMESPACE
namespace H5 {
@@ -220,6 +221,53 @@ hsize_t DataSet::getStorageSize() const
}
//--------------------------------------------------------------------------
+// Function: DataSet::getInMemDataSize
+///\brief Gets the size in memory of the dataset's data.
+///\return Size of data (in memory)
+///\exception H5::DataSetIException
+// Programmer Binh-Minh Ribler - Apr 2009
+//--------------------------------------------------------------------------
+size_t DataSet::getInMemDataSize() const
+{
+ char *func = "DataSet::getInMemDataSize";
+
+ // Get the data type of this dataset
+ hid_t mem_type_id = H5Dget_type(id);
+ if( mem_type_id < 0 )
+ {
+ throw DataSetIException(func, "H5Dget_type failed");
+ }
+
+ // Get the data type's size
+ hid_t native_type = H5Tget_native_type(mem_type_id, H5T_DIR_DEFAULT);
+ if (native_type < 0)
+ {
+ throw DataSetIException(func, "H5Tget_native_type failed");
+ }
+ size_t type_size = H5Tget_size(native_type);
+ if (type_size == 0)
+ {
+ throw DataSetIException(func, "H5Tget_size failed");
+ }
+
+ // Get number of elements of the dataset
+ hid_t space_id = H5Dget_space(id); // first get its data space
+ if (space_id < 0)
+ {
+ throw DataSetIException(func, "H5Dget_space failed");
+ }
+ hssize_t num_elements = H5Sget_simple_extent_npoints(space_id);
+ if (num_elements < 0)
+ {
+ throw DataSetIException(func, "H5Sget_simple_extent_npoints failed");
+ }
+
+ // Calculate and return the size of the data
+ size_t data_size = type_size * num_elements;
+ return(data_size);
+}
+
+//--------------------------------------------------------------------------
// Function: DataSet::getOffset
///\brief Returns the address of this dataset in the file.
///\return Address of dataset
@@ -364,20 +412,45 @@ void DataSet::read( void* buf, const DataType& mem_type, const DataSpace& mem_sp
// Function: DataSet::read
///\brief This is an overloaded member function, provided for convenience.
/// It takes a reference to a \c std::string for the buffer.
+///\param buf - IN: Buffer for read data
+///\param mem_type - IN: Memory datatype
+///\param mem_space - IN: Memory dataspace
+///\param file_space - IN: Dataset's dataspace in the file
+///\param xfer_plist - IN: Transfer property list for this I/O operation
+///\exception H5::DataSetIException
// Programmer Binh-Minh Ribler - 2000
-//--------------------------------------------------------------------------
-void DataSet::read( H5std_string& strg, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist ) const
+// Modification
+// Jul 2009
+// Follow the change to Attribute::read and use the following
+// private functions to read datasets with fixed- and
+// variable-length string:
+// DataSet::p_read_fixed_len and
+// DataSet::p_read_variable_len
+//--------------------------------------------------------------------------
+void DataSet::read(H5std_string& strg, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist) const
{
- // Allocate C character string for reading
- size_t size = mem_type.getSize();
- char* strg_C = new char[size+1]; // temporary C-string for C API
+ // Check if this dataset has variable-len string or fixed-len string and
+ // proceed appropriately.
+ htri_t is_variable_len = H5Tis_variable_str(mem_type.getId());
+ if (is_variable_len < 0)
+ {
+ throw DataSetIException("DataSet::read", "H5Tis_variable_str failed");
+ }
- // Use the overloaded member to read
- read(strg_C, mem_type, mem_space, file_space, xfer_plist);
+ // Obtain identifiers for C API
+ hid_t mem_type_id = mem_type.getId();
+ hid_t mem_space_id = mem_space.getId();
+ hid_t file_space_id = file_space.getId();
+ hid_t xfer_plist_id = xfer_plist.getId();
- // Get the String and clean up
- strg = strg_C;
- delete []strg_C;
+ if (!is_variable_len) // only allocate for fixed-len string
+ {
+ p_read_fixed_len(mem_type_id, mem_space_id, file_space_id, xfer_plist_id, strg);
+ }
+ else
+ {
+ p_read_variable_len(mem_type_id, mem_space_id, file_space_id, xfer_plist_id, strg);
+ }
}
//--------------------------------------------------------------------------
@@ -416,15 +489,46 @@ void DataSet::write( const void* buf, const DataType& mem_type, const DataSpace&
///\brief This is an overloaded member function, provided for convenience.
/// It takes a reference to a \c std::string for the buffer.
// Programmer Binh-Minh Ribler - 2000
+// Modification
+// Jul 2009
+// Modified to pass the buffer into H5Dwrite properly depending
+// whether the dataset has variable- or fixed-length string.
//--------------------------------------------------------------------------
void DataSet::write( const H5std_string& strg, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist ) const
{
- // Convert string to C-string
- const char* strg_C;
- strg_C = strg.c_str(); // strg_C refers to the contents of strg as a C-str
+ // Check if this attribute has variable-len string or fixed-len string and
+ // proceed appropriately.
+ htri_t is_variable_len = H5Tis_variable_str(mem_type.getId());
+ if (is_variable_len < 0)
+ {
+ throw DataSetIException("DataSet::write", "H5Tis_variable_str failed");
+ }
+
+ // Obtain identifiers for C API
+ hid_t mem_type_id = mem_type.getId();
+ hid_t mem_space_id = mem_space.getId();
+ hid_t file_space_id = file_space.getId();
+ hid_t xfer_plist_id = xfer_plist.getId();
+
+ // Convert string to C-string
+ const char* strg_C;
+ strg_C = strg.c_str(); // strg_C refers to the contents of strg as a C-str
+ herr_t ret_value = 0;
- // Use the overloaded member
- write(strg_C, mem_type, mem_space, file_space, xfer_plist);
+ // Pass string in differently depends on variable or fixed length
+ if (!is_variable_len)
+ {
+ ret_value = H5Dwrite( id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, strg_C );
+ }
+ else
+ {
+ // passing string argument by address
+ ret_value = H5Dwrite( id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, &strg_C );
+ }
+ if (ret_value < 0)
+ {
+ throw DataSetIException("DataSet::write", "H5Dwrite failed");
+ }
}
//--------------------------------------------------------------------------
@@ -586,7 +690,74 @@ hid_t DataSet::getId() const
}
//--------------------------------------------------------------------------
-// Function: DataSet::p_setId
+// Function: DataSet::p_read_fixed_len (private)
+// brief Reads a fixed length \a H5std_string from an dataset.
+// param mem_type - IN: DataSet datatype (in memory)
+// param strg - IN: Buffer for read string
+// exception H5::DataSetIException
+// Programmer Binh-Minh Ribler - Jul, 2009
+// Modification
+// Jul 2009
+// Added in follow to the change in Attribute::read
+//--------------------------------------------------------------------------
+void DataSet::p_read_fixed_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const
+{
+ // Only allocate for fixed-len string.
+
+ // Get the size of the dataset's data
+ size_t attr_size = getInMemDataSize();
+
+ // If there is data, allocate buffer and read it.
+ if (attr_size > 0)
+ {
+ char *strg_C = NULL;
+
+ strg_C = new char [(size_t)attr_size+1];
+ herr_t ret_value = H5Dread(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, strg_C);
+
+ if( ret_value < 0 )
+ {
+ delete []strg_C; // de-allocate for fixed-len string
+ throw DataSetIException("DataSet::read", "H5Dread failed for fixed length string");
+ }
+
+ // Get string from the C char* and release resource allocated locally
+ strg = strg_C;
+ delete []strg_C;
+ }
+}
+
+//--------------------------------------------------------------------------
+// Function: DataSet::p_read_variable_len (private)
+// brief Reads a variable length \a H5std_string from an dataset.
+// param mem_type - IN: DataSet datatype (in memory)
+// param strg - IN: Buffer for read string
+// exception H5::DataSetIException
+// Programmer Binh-Minh Ribler - Jul, 2009
+// Modification
+// Jul 2009
+// Added in follow to the change in Attribute::read
+//--------------------------------------------------------------------------
+void DataSet::p_read_variable_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const
+{
+ // Prepare and call C API to read dataset.
+ char *strg_C;
+
+ // Read dataset, no allocation for variable-len string; C library will
+ herr_t ret_value = H5Dread(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, &strg_C);
+
+ if( ret_value < 0 )
+ {
+ throw DataSetIException("DataSet::read", "H5Dread failed for variable length string");
+ }
+
+ // Get string from the C char* and release resource allocated by C API
+ strg = strg_C;
+ HDfree(strg_C);
+}
+
+//--------------------------------------------------------------------------
+// Function: DataSet::p_setId (private)
///\brief Sets the identifier of this object to a new value.
///
///\exception H5::IdComponentException when the attempt to close the HDF5
diff --git a/c++/src/H5DataSet.h b/c++/src/H5DataSet.h
index f26d775..3d9183d 100644
--- a/c++/src/H5DataSet.h
+++ b/c++/src/H5DataSet.h
@@ -49,7 +49,10 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs {
void getSpaceStatus(H5D_space_status_t& status) const;
// Returns the amount of storage size required for this dataset.
- hsize_t getStorageSize() const;
+ virtual hsize_t getStorageSize() const;
+
+ // Returns the in memory size of this attribute's data.
+ virtual size_t getInMemDataSize() const;
// Returns the number of bytes required to store VL data.
hsize_t getVlenBufSize( DataType& type, DataSpace& space ) const;
@@ -113,6 +116,10 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs {
// sub-types
virtual hid_t p_get_type() const;
+ // Reads variable or fixed len strings from this dataset.
+ void p_read_fixed_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const;
+ void p_read_variable_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const;
+
protected:
// Sets the dataset id.
virtual void p_setId(const hid_t new_id);
diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in
index 49a4990..ce5ad91 100644
--- a/c++/src/Makefile.in
+++ b/c++/src/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -35,8 +36,9 @@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
@@ -65,15 +67,30 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/src/H5config.h
CONFIG_CLEAN_FILES = h5c++
+CONFIG_CLEAN_VPATH_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
-am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \
"$(DESTDIR)$(includedir)"
-libLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(lib_LTLIBRARIES)
libhdf5_cpp_la_LIBADD =
am_libhdf5_cpp_la_OBJECTS = H5Exception.lo H5IdComponent.lo \
@@ -87,11 +104,11 @@ libhdf5_cpp_la_OBJECTS = $(am_libhdf5_cpp_la_OBJECTS)
libhdf5_cpp_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
$(CXXFLAGS) $(libhdf5_cpp_la_LDFLAGS) $(LDFLAGS) -o $@
-binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
SCRIPTS = $(bin_SCRIPTS)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src
depcomp = $(SHELL) $(top_srcdir)/bin/depcomp
am__depfiles_maybe = depfiles
+am__mv = mv -f
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -103,10 +120,11 @@ CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
$(LDFLAGS) -o $@
SOURCES = $(libhdf5_cpp_la_SOURCES)
DIST_SOURCES = $(libhdf5_cpp_la_SOURCES)
-includeHEADERS_INSTALL = $(INSTALL_HEADER)
HEADERS = $(include_HEADERS)
ETAGS = etags
CTAGS = ctags
+am__tty_colors = \
+red=; grn=; lgn=; blu=; std=
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = /home1/packages/automake/automake-1.9.6/bin/aclocal-1.9 -I /afs/ncsa/projects/hdf/packages/libtool_1.5.14/Linux_2.4/share/aclocal
ADD_PARALLEL_FILES = @ADD_PARALLEL_FILES@
@@ -221,6 +239,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PARALLEL = @PARALLEL@
PATH_SEPARATOR = @PATH_SEPARATOR@
@@ -312,6 +331,7 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
@@ -360,7 +380,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog
# Add libtool shared library version numbers to the HDF5 library
# See libtool versioning documentation online.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 34
+LT_VERS_REVISION = 35
LT_VERS_AGE = 0
# Include src directory
@@ -430,9 +450,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign c++/src/Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign c++/src/Makefile
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign c++/src/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign c++/src/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -450,25 +470,30 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
h5c++: $(top_builddir)/config.status $(srcdir)/h5c++.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
- @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+ list2=; for p in $$list; do \
if test -f $$p; then \
- f=$(am__strip_dir) \
- echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
- $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
+ list2="$$list2 $$p"; \
else :; fi; \
- done
+ done; \
+ test -z "$$list2" || { \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
+ }
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
- @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
- p=$(am__strip_dir) \
- echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
- $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
+ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+ for p in $$list; do \
+ $(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
done
clean-libLTLIBRARIES:
@@ -484,22 +509,37 @@ libhdf5_cpp.la: $(libhdf5_cpp_la_OBJECTS) $(libhdf5_cpp_la_DEPENDENCIES)
install-binSCRIPTS: $(bin_SCRIPTS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
- @list='$(bin_SCRIPTS)'; for p in $$list; do \
+ @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
+ for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- if test -f $$d$$p; then \
- f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
- echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \
- $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \
- else :; fi; \
- done
+ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n' \
+ -e 'h;s|.*|.|' \
+ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+ if (++n[d] == $(am__install_max)) { \
+ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+ else { print "f", d "/" $$4, $$1 } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
uninstall-binSCRIPTS:
@$(NORMAL_UNINSTALL)
- @list='$(bin_SCRIPTS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
- echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
- rm -f "$(DESTDIR)$(bindir)/$$f"; \
- done
+ @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -536,21 +576,21 @@ distclean-compile:
.cpp.o:
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
.cpp.obj:
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.cpp.lo:
@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
@@ -563,20 +603,23 @@ clean-libtool:
install-includeHEADERS: $(include_HEADERS)
@$(NORMAL_INSTALL)
test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
- @list='$(include_HEADERS)'; for p in $$list; do \
+ @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
+ for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- f=$(am__strip_dir) \
- echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \
- $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
+ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
done
uninstall-includeHEADERS:
@$(NORMAL_UNINSTALL)
- @list='$(include_HEADERS)'; for p in $$list; do \
- f=$(am__strip_dir) \
- echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \
- rm -f "$(DESTDIR)$(includedir)/$$f"; \
- done
+ @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(includedir)" && rm -f $$files
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -590,7 +633,7 @@ tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
- tags=; \
+ set x; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
@@ -598,29 +641,34 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
- tags=; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
+ $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -641,13 +689,17 @@ distdir: $(DISTFILES)
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@@ -679,6 +731,7 @@ clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@@ -701,6 +754,8 @@ dvi-am:
html: html-am
+html-am:
+
info: info-am
info-am:
@@ -709,18 +764,28 @@ install-data-am: install-includeHEADERS
install-dvi: install-dvi-am
+install-dvi-am:
+
install-exec-am: install-binSCRIPTS install-libLTLIBRARIES
install-html: install-html-am
+install-html-am:
+
install-info: install-info-am
+install-info-am:
+
install-man:
install-pdf: install-pdf-am
+install-pdf-am:
+
install-ps: install-ps-am
+install-ps-am:
+
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -744,7 +809,7 @@ ps-am:
uninstall-am: uninstall-binSCRIPTS uninstall-includeHEADERS \
uninstall-libLTLIBRARIES
-.MAKE: install-am install-strip
+.MAKE: check-am install-am install-strip
.PHONY: CTAGS GTAGS all all-am all-local check check-TESTS check-am \
clean clean-generic clean-libLTLIBRARIES clean-libtool ctags \
@@ -990,6 +1055,7 @@ check-vfd: $(LIB) $(PROGS) $(TESTS)
HDF5_DRIVER=$$vfd $(MAKE) $(AM_MAKEFLAGS) check || exit 1; \
fi; \
done
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/c++/test/Makefile.in b/c++/test/Makefile.in
index 0452ea0..3dff900 100644
--- a/c++/test/Makefile.in
+++ b/c++/test/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -32,8 +33,9 @@
#
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
@@ -61,6 +63,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/src/H5config.h
CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
am__EXEEXT_1 = dsets$(EXEEXT) testhdf5$(EXEEXT)
am_dsets_OBJECTS = dsets.$(OBJEXT) h5cpputil.$(OBJEXT)
dsets_OBJECTS = $(am_dsets_OBJECTS)
@@ -76,6 +79,7 @@ testhdf5_DEPENDENCIES = $(LIBH5TEST) $(LIBH5CPP) $(LIBHDF5)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src
depcomp = $(SHELL) $(top_srcdir)/bin/depcomp
am__depfiles_maybe = depfiles
+am__mv = mv -f
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -89,6 +93,8 @@ SOURCES = $(dsets_SOURCES) $(testhdf5_SOURCES)
DIST_SOURCES = $(dsets_SOURCES) $(testhdf5_SOURCES)
ETAGS = etags
CTAGS = ctags
+am__tty_colors = \
+red=; grn=; lgn=; blu=; std=
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = /home1/packages/automake/automake-1.9.6/bin/aclocal-1.9 -I /afs/ncsa/projects/hdf/packages/libtool_1.5.14/Linux_2.4/share/aclocal
ADD_PARALLEL_FILES = @ADD_PARALLEL_FILES@
@@ -203,6 +209,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PARALLEL = @PARALLEL@
PATH_SEPARATOR = @PATH_SEPARATOR@
@@ -294,6 +301,7 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
@@ -387,9 +395,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign c++/test/Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign c++/test/Makefile
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign c++/test/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign c++/test/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -407,13 +415,16 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
clean-checkPROGRAMS:
- @list='$(check_PROGRAMS)'; for p in $$list; do \
- f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f $$p $$f"; \
- rm -f $$p $$f ; \
- done
+ @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
dsets$(EXEEXT): $(dsets_OBJECTS) $(dsets_DEPENDENCIES)
@rm -f dsets$(EXEEXT)
$(CXXLINK) $(dsets_OBJECTS) $(dsets_LDADD) $(LIBS)
@@ -441,21 +452,21 @@ distclean-compile:
.cpp.o:
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
.cpp.obj:
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.cpp.lo:
@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
@@ -478,7 +489,7 @@ tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
- tags=; \
+ set x; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
@@ -486,29 +497,34 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
- tags=; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
+ $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -529,13 +545,17 @@ distdir: $(DISTFILES)
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@@ -565,6 +585,7 @@ clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -586,6 +607,8 @@ dvi-am:
html: html-am
+html-am:
+
info: info-am
info-am:
@@ -594,18 +617,28 @@ install-data-am:
install-dvi: install-dvi-am
+install-dvi-am:
+
install-exec-am:
install-html: install-html-am
+install-html-am:
+
install-info: install-info-am
+install-info-am:
+
install-man:
install-pdf: install-pdf-am
+install-pdf-am:
+
install-ps: install-ps-am
+install-ps-am:
+
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -628,7 +661,7 @@ ps-am:
uninstall-am:
-.MAKE: install-am install-strip
+.MAKE: check-am install-am install-strip
.PHONY: CTAGS GTAGS all all-am all-local check check-TESTS check-am \
clean clean-checkPROGRAMS clean-generic clean-libtool ctags \
@@ -858,6 +891,7 @@ check-vfd: $(LIB) $(PROGS) $(TESTS)
HDF5_DRIVER=$$vfd $(MAKE) $(AM_MAKEFLAGS) check || exit 1; \
fi; \
done
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/c++/test/tvlstr.cpp b/c++/test/tvlstr.cpp
index 2c22903..9722331 100644
--- a/c++/test/tvlstr.cpp
+++ b/c++/test/tvlstr.cpp
@@ -18,7 +18,6 @@
tvlstr.cpp - HDF5 C++ testing the Variable-Length String functionality
EXTERNAL ROUTINES/VARIABLES:
- These routines are in the test directory of the C library:
***************************************************************************/
@@ -40,7 +39,7 @@
#include "H5Cpp.h" // C++ API header file
#ifndef H5_NO_NAMESPACE
-using namespace H5;
+ using namespace H5;
#endif
#include "h5cpputil.h" // C++ utilility header file
@@ -52,36 +51,36 @@ const H5std_string FILENAME("tvlstr.h5");
const int SPACE1_RANK = 1;
const hsize_t SPACE1_DIM1 = 4;
-// Utility functions
+// Utility functions - not used now, later though.
void *test_vlstr_alloc_custom(size_t size, void *info);
void test_vlstr_free_custom(void *mem, void *info);
/****************************************************************
**
** test_vlstr_alloc_custom(): Test VL datatype custom memory
-** allocation routines. This routine just uses malloc to
-** allocate the memory and increments the amount of memory
-** allocated. It is passed into setVlenMemManager.
+** allocation routines. This routine just uses malloc to
+** allocate the memory and increments the amount of memory
+** allocated. It is passed into setVlenMemManager.
**
** Note: exact copy from the C version.
**
****************************************************************/
void *test_vlstr_alloc_custom(size_t size, void *info)
{
- void *ret_value = NULL; // Pointer to return
- size_t *mem_used = (size_t *)info; // Get the pointer to the memory used
- size_t extra; // Extra space needed
+ void *ret_value=NULL; // Pointer to return
+ size_t *mem_used=(size_t *)info; // Get the pointer to the memory used
+ size_t extra; // Extra space needed
/*
* This weird contortion is required on the DEC Alpha to keep the
* alignment correct - QAK
*/
- extra = MAX(sizeof(void *),sizeof(size_t));
+ extra=MAX(sizeof(void *),sizeof(size_t));
- if((ret_value = HDmalloc(extra + size)) != NULL) {
- *(size_t *)ret_value = size;
- *mem_used += size;
+ if((ret_value=HDmalloc(extra+size))!=NULL) {
+ *(size_t *)ret_value=size;
+ *mem_used+=size;
} // end if
ret_value = ((unsigned char *)ret_value) + extra;
@@ -91,9 +90,9 @@ void *test_vlstr_alloc_custom(size_t size, void *info)
/****************************************************************
**
** test_vlstr_free_custom(): Test VL datatype custom memory
-** allocation routines. This routine just uses free to
-** release the memory and decrements the amount of memory
-** allocated. It is passed into setVlenMemManager.
+** allocation routines. This routine just uses free to
+** release the memory and decrements the amount of memory
+** allocated. It is passed into setVlenMemManager.
**
** Note: exact copy from the C version.
**
@@ -102,7 +101,7 @@ void test_vlstr_free_custom(void *_mem, void *info)
{
unsigned char *mem;
size_t *mem_used=(size_t *)info; // Get the pointer to the memory used
- size_t extra; // Extra space needed
+ size_t extra; // Extra space needed
/*
* This weird contortion is required on the DEC Alpha to keep the
@@ -119,9 +118,9 @@ void test_vlstr_free_custom(void *_mem, void *info)
}
/*-------------------------------------------------------------------------
- * Function: test_vlstrings_basic
+ * Function: test_vlstring_dataset
*
- * Purpose: Test simple VL string I/O.
+ * Purpose: Test writing/reading VL strings on datasets.
*
* Return: None
*
@@ -130,98 +129,171 @@ void test_vlstr_free_custom(void *_mem, void *info)
*
*-------------------------------------------------------------------------
*/
-static void test_vlstrings_basic()
+// String for testing datasets
+static char *dynstring_ds_write=NULL;
+static char stastring_ds_write[1]={'A'};
+
+// Info for a string dataset
+const H5std_string DSET1_NAME("String_ds");
+const H5std_string DSET1_DATA("String Dataset");
+
+static void test_vlstring_dataset()
+{
+ // Output message about test being performed
+ SUBTEST("Testing VL String on Datasets");
+
+ try {
+ // Open the file
+ H5File file1(FILENAME, H5F_ACC_TRUNC);
+
+ // Create a datatype to refer to.
+ StrType vlst(0, H5T_VARIABLE);
+
+ // Open the root group.
+ Group root = file1.openGroup("/");
+
+ // Create dataspace for the dataset.
+ DataSpace ds_space (H5S_SCALAR);
+
+ // Create an dataset in the root group.
+ DataSet dset1 = root.createDataSet(DSET1_NAME, vlst, ds_space);
+
+ // Write data to the dataset.
+ dset1.write(DSET1_DATA, vlst);
+
+ // Read and verify the dataset string as a string of chars.
+ char *string_ds_check;
+ dset1.read(&string_ds_check, vlst);
+ if(HDstrcmp(string_ds_check, DSET1_DATA.c_str())!=0)
+ TestErrPrintf("Line %d: Attribute data different: DSET1_DATA=%s,string_ds_check=%s\n",__LINE__, DSET1_DATA.c_str(), string_ds_check);
+
+ HDfree(string_ds_check); // note: no need for std::string test
+
+ // Read and verify the dataset string as an std::string.
+ H5std_string read_str;
+ dset1.read(read_str, vlst);
+ if (read_str != DSET1_DATA)
+ TestErrPrintf("Line %d: Attribute data different: DSET1_DATA=%s,read_str=%s\n",__LINE__, DSET1_DATA.c_str(), read_str.c_str());
+
+ // Close the dataset.
+ dset1.close();
+
+ // Test scalar type dataset with 1 value.
+ dset1 = root.createDataSet("test_scalar_small", vlst, ds_space);
+
+ dynstring_ds_write = (char*)HDcalloc(1, sizeof(char));
+ HDmemset(dynstring_ds_write, 'A', 1);
+
+ // Write data to the dataset, then read it back.
+ dset1.write(&dynstring_ds_write, vlst);
+ dset1.read(&string_ds_check, vlst);
+
+ // Verify data read.
+ if(HDstrcmp(string_ds_check,dynstring_ds_write)!=0)
+ TestErrPrintf("VL string datasets don't match!, dynstring_ds_write=%s, string_ds_check=%s\n",dynstring_ds_write,string_ds_check);
+ HDfree(string_ds_check);
+ dset1.close();
+
+ // Open dataset DSET1_NAME again.
+ dset1 = root.openDataSet(DSET1_NAME);
+
+ // Close dataset and file
+ dset1.close();
+ file1.close();
+
+ PASSED();
+ } // end try block
+
+ // Catch all exceptions.
+ catch (Exception E) {
+ issue_fail_msg("test_vlstring_dataset()", __LINE__, __FILE__, E.getCDetailMsg());
+ }
+} // test_vlstring_dataset()
+
+/*-------------------------------------------------------------------------
+ * Function: test_vlstring_array_dataset
+ *
+ * Purpose: Test writing/reading VL string array to/from datasets.
+ *
+ * Return: None
+ *
+ * Programmer: Binh-Minh Ribler
+ * July, 2009
+ *
+ *-------------------------------------------------------------------------
+ */
+const H5std_string DSSTRARR_NAME("StringArray_dset");
+static void test_vlstring_array_dataset()
{
- const char *wdata[SPACE1_DIM1]= {
- "Four score and seven years ago our forefathers brought forth on this continent a new nation,",
- "conceived in liberty and dedicated to the proposition that all men are created equal.",
- "Now we are engaged in a great civil war,",
- "testing whether that nation or any nation so conceived and so dedicated can long endure."
+ const char *string_ds_array[SPACE1_DIM1]= {
+ "Line 1", "Line 2", "Line 3", "Line 4"
}; // Information to write
// Output message about test being performed
- SUBTEST("Testing Basic VL String Functionality");
+ SUBTEST("Testing VL String Array on Datasets");
- H5File* file1 = NULL;
+ H5File* file1;
try {
// Create file.
- file1 = new H5File (FILENAME, H5F_ACC_TRUNC);
+ file1 = new H5File (FILENAME, H5F_ACC_RDWR);
- // Create dataspace for datasets.
- hsize_t dims1[] = {SPACE1_DIM1};
- DataSpace sid1(SPACE1_RANK, dims1);
+ // Create dataspace for datasets.
+ hsize_t dims1[] = {SPACE1_DIM1};
+ DataSpace ds_space(SPACE1_RANK, dims1);
// Create a datatype to refer to.
- StrType tid1(0, H5T_VARIABLE);
+ StrType vlst(0, H5T_VARIABLE);
// Create and write a dataset.
- DataSet dataset(file1->createDataSet("Dataset1", tid1, sid1));
- dataset.write(wdata, tid1);
+ DataSet dataset(file1->createDataSet(DSSTRARR_NAME, vlst, ds_space));
+ dataset.write(string_ds_array, vlst);
+
+ // Read and verify the dataset using strings of chars as buffer.
+ // Note: reading by array of H5std_string doesn't work yet.
+ char *string_ds_check[SPACE1_DIM1];
+ dataset.read(string_ds_check, vlst);
+
+ int ii;
+ for (ii = 0; ii < SPACE1_DIM1; ii++)
+ {
+ if(HDstrcmp(string_ds_check[ii], string_ds_array[ii])!=0)
+ TestErrPrintf("Line %d: Dataset data different: written=%s,read=%s\n",__LINE__, string_ds_array[ii], string_ds_check[ii]);
+
+ HDfree(string_ds_check[ii]);
+ }
+
+ // Close objects that are no longer needed.
+ dataset.close();
+ ds_space.close();
+
+ //
+ // Test with scalar data space.
+ //
// Create H5S_SCALAR data space.
DataSpace scalar_space;
// Create and write another dataset.
- DataSet dataset2(file1->createDataSet("Dataset2", tid1, scalar_space));
+ DataSet dataset2(file1->createDataSet("Dataset2", vlst, scalar_space));
char *wdata2 = (char*)HDcalloc(65534, sizeof(char));
HDmemset(wdata2, 'A', 65533);
- dataset2.write(&wdata2, tid1);
+ dataset2.write(&wdata2, vlst);
+
+ char *rdata2 = (char*)HDcalloc(65534, sizeof(char));
+ HDmemset(rdata2, 0, 65533);
+ dataset2.read(&rdata2, vlst);
+ if (HDstrcmp(wdata2, rdata2)!=0)
+ TestErrPrintf("Line %d: Dataset data different: written=%s,read=%s\n",__LINE__, wdata2, rdata2);
// Release resources from second dataset operation.
scalar_space.close();
dataset2.close();
HDfree(wdata2);
-
- // Change to the custom memory allocation routines for reading
- // VL string.
- DSetMemXferPropList xfer;
- size_t mem_used = 0; // Memory used during allocation
- xfer.setVlenMemManager(test_vlstr_alloc_custom, &mem_used, test_vlstr_free_custom, &mem_used);
-
- // Make certain the correct amount of memory will be used.
- hsize_t vlsize = dataset.getVlenBufSize(tid1, sid1);
-
- // Count the actual number of bytes used by the strings.
- size_t str_used; // String data in memory
- hsize_t i; // counting variable
- for (i=0,str_used=0; i<SPACE1_DIM1; i++)
- str_used+=HDstrlen(wdata[i])+1;
-
- // Compare against the strings actually written.
- verify_val((int)vlsize,str_used,"DataSet::getVlenBufSize", __LINE__, __FILE__);
-
- // Read dataset from disk.
- char *rdata[SPACE1_DIM1]; // Data read in
- dataset.read(rdata, tid1, DataSpace::ALL, DataSpace::ALL, xfer);
-
- // Make certain the correct amount of memory has been used.
- verify_val(mem_used, str_used, "DataSet::read", __LINE__, __FILE__);
-
- // Compare data read in.
- for(i = 0; i < SPACE1_DIM1; i++) {
- size_t wlen = HDstrlen(wdata[i]);
- size_t rlen = HDstrlen(rdata[i]);
- if(wlen != rlen) {
- TestErrPrintf("VL data lengths don't match!, strlen(wdata[%d])=%u, strlen(rdata[%d])=%u\n", (int)i, (unsigned)wlen, (int)i, (unsigned)rlen);
- continue;
- } // end if
- if(HDstrcmp(wdata[i], rdata[i]) != 0) {
- TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n", (int)i, wdata[i], (int)i, rdata[i]);
- continue;
- } // end if
- } // end for
-
- // Reclaim the read VL data.
- DataSet::vlenReclaim((void *)rdata, tid1, sid1, xfer);
-
- // Make certain the VL memory has been freed.
- verify_val(mem_used, 0, "DataSet::vlenReclaim", __LINE__, __FILE__);
+ HDfree(rdata2);
// Close objects and file.
- dataset.close();
- tid1.close();
- sid1.close();
- xfer.close();
+ dataset2.close();
+ vlst.close();
file1->close();
PASSED();
@@ -230,11 +302,10 @@ static void test_vlstrings_basic()
// Catch all exceptions.
catch (Exception E)
{
- issue_fail_msg("test_vlstrings_basic()", __LINE__, __FILE__, E.getCDetailMsg());
- if (file1 != NULL) // clean up
- delete file1;
+ issue_fail_msg("test_vlstring_array_dataset()", __LINE__, __FILE__, E.getCDetailMsg());
+ delete file1;
}
-} // end test_vlstrings_basic()
+} // end test_vlstring_array_dataset()
/*-------------------------------------------------------------------------
* Function: test_vlstrings_special
@@ -267,26 +338,26 @@ static void test_vlstrings_special()
DataSpace sid1(SPACE1_RANK, dims1);
// Create a datatype to refer to.
- StrType tid1(0, H5T_VARIABLE);
+ StrType vlst(0, H5T_VARIABLE);
// Create a dataset.
- DataSet dataset(file1.createDataSet("Dataset3", tid1, sid1));
+ DataSet dataset(file1.createDataSet("Dataset3", vlst, sid1));
// Read from the dataset before writing data.
- dataset.read(rdata, tid1);
+ dataset.read(rdata, vlst);
// Check data read in.
hsize_t i; // counting variable
- for(i = 0; i < SPACE1_DIM1; i++)
- if(rdata[i] != NULL)
+ for (i=0; i<SPACE1_DIM1; i++)
+ if(rdata[i]!=NULL)
TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n",(int)i,rdata[i]);
// Write dataset to disk, then read it back.
- dataset.write(wdata, tid1);
- dataset.read(rdata, tid1);
+ dataset.write(wdata, vlst);
+ dataset.read(rdata, vlst);
// Compare data read in.
- for(i = 0; i < SPACE1_DIM1; i++) {
+ for (i = 0; i < SPACE1_DIM1; i++) {
size_t wlen = HDstrlen(wdata[i]);
size_t rlen = HDstrlen(rdata[i]);
if(wlen != rlen) {
@@ -300,7 +371,7 @@ static void test_vlstrings_special()
} // end for
// Reclaim the read VL data.
- DataSet::vlenReclaim((void *)rdata, tid1, sid1);
+ DataSet::vlenReclaim((void *)rdata, vlst, sid1);
// Close Dataset.
dataset.close();
@@ -313,25 +384,25 @@ static void test_vlstrings_special()
// dataset.
DSetCreatPropList dcpl;
char *fill = NULL; // Fill value
- dcpl.setFillValue(tid1, &fill);
- dataset = file1.createDataSet("Dataset4", tid1, sid1, dcpl);
+ dcpl.setFillValue(vlst, &fill);
+ dataset = file1.createDataSet("Dataset4", vlst, sid1, dcpl);
// Close dataset creation property list.
dcpl.close();
// Read from dataset before writing data.
- dataset.read(rdata, tid1);
+ dataset.read(rdata, vlst);
// Check data read in.
for (i=0; i<SPACE1_DIM1; i++)
- if(rdata[i] != NULL)
- TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n",(int)i, rdata[i]);
+ if(rdata[i]!=NULL)
+ TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n",(int)i,rdata[i]);
// Try to write nil strings to disk.
- dataset.write(wdata2, tid1);
+ dataset.write(wdata2, vlst);
// Read nil strings back from disk.
- dataset.read(rdata, tid1);
+ dataset.read(rdata, vlst);
// Check data read in.
for (i=0; i<SPACE1_DIM1; i++)
@@ -340,7 +411,7 @@ static void test_vlstrings_special()
// Close objects and file.
dataset.close();
- tid1.close();
+ vlst.close();
sid1.close();
file1.close();
@@ -350,7 +421,7 @@ static void test_vlstrings_special()
// Catch all exceptions.
catch (Exception E)
{
- issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg());
+ issue_fail_msg("test_vlstrings_special()", __LINE__, __FILE__, E.getCDetailMsg());
}
} // test_vlstrings_special
@@ -370,7 +441,7 @@ const H5std_string VLSTR_TYPE("vl_string_type");
static void test_vlstring_type()
{
// Output message about test being performed.
- SUBTEST("Testing VL String type");
+ SUBTEST("Testing VL String Type");
H5File* file1 = NULL;
try {
@@ -378,55 +449,55 @@ static void test_vlstring_type()
file1 = new H5File(FILENAME, H5F_ACC_RDWR);
// Create a datatype to refer to.
- StrType vlstr_type(PredType::C_S1);
+ StrType vlst(PredType::C_S1);
// Change padding and verify it.
- vlstr_type.setStrpad(H5T_STR_NULLPAD);
- H5T_str_t pad = vlstr_type.getStrpad();
+ vlst.setStrpad(H5T_STR_NULLPAD);
+ H5T_str_t pad = vlst.getStrpad();
verify_val(pad, H5T_STR_NULLPAD, "StrType::getStrpad", __LINE__, __FILE__);
// Convert to variable-length string.
- vlstr_type.setSize(H5T_VARIABLE);
+ vlst.setSize(H5T_VARIABLE);
// Check if datatype is VL string.
- H5T_class_t type_class = vlstr_type.getClass();
+ H5T_class_t type_class = vlst.getClass();
verify_val(type_class, H5T_STRING, "DataType::getClass", __LINE__, __FILE__);
- bool is_variable_str = vlstr_type.isVariableStr();
- verify_val(is_variable_str, TRUE, "DataType::isVariableStr", __LINE__, __FILE__);
+ bool is_variable_str = vlst.isVariableStr();
+ verify_val(is_variable_str, true, "DataType::isVariableStr", __LINE__, __FILE__);
// Check default character set and padding.
- H5T_cset_t cset = vlstr_type.getCset();
+ H5T_cset_t cset = vlst.getCset();
verify_val(cset, H5T_CSET_ASCII, "StrType::getCset", __LINE__, __FILE__);
- pad = vlstr_type.getStrpad();
+ pad = vlst.getStrpad();
verify_val(pad, H5T_STR_NULLPAD, "StrType::getStrpad", __LINE__, __FILE__);
// Commit variable-length string datatype to storage.
- vlstr_type.commit(*file1, VLSTR_TYPE);
+ vlst.commit(*file1, VLSTR_TYPE);
// Close datatype.
- vlstr_type.close();
+ vlst.close();
// Try opening datatype again.
- vlstr_type = file1->openStrType(VLSTR_TYPE);
+ vlst = file1->openStrType(VLSTR_TYPE);
// Close datatype and file.
- vlstr_type.close();
+ vlst.close();
file1->close();
// Open file.
file1 = new H5File(FILENAME, H5F_ACC_RDWR);
// Open the variable-length string datatype just created
- vlstr_type = file1->openStrType(VLSTR_TYPE);
+ vlst = file1->openStrType(VLSTR_TYPE);
// Verify character set and padding
- cset = vlstr_type.getCset();
+ cset = vlst.getCset();
verify_val(cset, H5T_CSET_ASCII, "StrType::getCset", __LINE__, __FILE__);
- pad = vlstr_type.getStrpad();
+ pad = vlst.getStrpad();
verify_val(pad, H5T_STR_NULLPAD, "StrType::getStrpad", __LINE__, __FILE__);
// Close datatype and file
- vlstr_type.close();
+ vlst.close();
file1->close();
PASSED();
@@ -436,6 +507,7 @@ static void test_vlstring_type()
catch (Exception E)
{
issue_fail_msg("test_vlstring_type()", __LINE__, __FILE__, E.getCDetailMsg());
+ delete file1;
}
} // end test_vlstring_type()
@@ -454,7 +526,7 @@ static void test_vlstring_type()
static void test_compact_vlstring()
{
// Output message about test being performed
- SUBTEST("Testing VL Strings in compact dataset");
+ SUBTEST("Testing VL Strings on Compact Dataset");
try {
// Create file
@@ -465,22 +537,22 @@ static void test_compact_vlstring()
DataSpace sid1(SPACE1_RANK, dims1);
// Create a datatype to refer to
- StrType tid1(0, H5T_VARIABLE);
+ StrType vlst(0, H5T_VARIABLE);
// Create dataset create property list and set layout
DSetCreatPropList plist;
plist.setLayout(H5D_COMPACT);
// Create a dataset
- DataSet dataset(file1.createDataSet("Dataset5", tid1, sid1, plist));
+ DataSet dataset(file1.createDataSet("Dataset5", vlst, sid1, plist));
// Write dataset to disk
const char *wdata[SPACE1_DIM1] = {"one", "two", "three", "four"};
- dataset.write(wdata, tid1);
+ dataset.write(wdata, vlst);
// Read dataset from disk
char *rdata[SPACE1_DIM1]; // Information read in
- dataset.read(rdata, tid1);
+ dataset.read(rdata, vlst);
// Compare data read in
hsize_t i;
@@ -496,11 +568,11 @@ static void test_compact_vlstring()
} // end for
// Reclaim the read VL data
- DataSet::vlenReclaim((void *)rdata, tid1, sid1);
+ DataSet::vlenReclaim((void *)rdata, vlst, sid1);
// Close objects and file
dataset.close();
- tid1.close();
+ vlst.close();
sid1.close();
plist.close();
file1.close();
@@ -516,9 +588,9 @@ static void test_compact_vlstring()
} // test_compact_vlstrings
/*-------------------------------------------------------------------------
- * Function: test_write_vl_string_attribute
+ * Function: test_vlstring_attribute
*
- * Purpose: Test writing VL strings as attributes.
+ * Purpose: Test writing/reading VL strings on attributes.
*
* Return: None
*
@@ -527,24 +599,24 @@ static void test_compact_vlstring()
*
*-------------------------------------------------------------------------
*/
-// String for testing attributes
+// String for writing to attribute
static char *string_att_write=NULL;
// Info for a string attribute
const H5std_string ATTRSTR_NAME("String_attr");
const H5std_string ATTRSTR_DATA("String Attribute");
-static void test_write_vl_string_attribute()
+static void test_vlstring_attribute()
{
// Output message about test being performed
- SUBTEST("Testing writing VL String as attributes");
+ SUBTEST("Testing VL String on Attributes");
try {
// Open the file
H5File file1(FILENAME, H5F_ACC_RDWR);
// Create a datatype to refer to.
- StrType tid1(0, H5T_VARIABLE);
+ StrType vlst(0, H5T_VARIABLE);
// Open the root group.
Group root = file1.openGroup("/");
@@ -553,14 +625,14 @@ static void test_write_vl_string_attribute()
DataSpace att_space (H5S_SCALAR);
// Create an attribute for the root group.
- Attribute gr_attr = root.createAttribute(ATTRSTR_NAME, tid1, att_space);
+ Attribute gr_attr = root.createAttribute(ATTRSTR_NAME, vlst, att_space);
// Write data to the attribute.
- gr_attr.write(tid1, ATTRSTR_DATA);
+ gr_attr.write(vlst, ATTRSTR_DATA);
// Read and verify the attribute string as a string of chars.
char *string_att_check;
- gr_attr.read(tid1, &string_att_check);
+ gr_attr.read(vlst, &string_att_check);
if(HDstrcmp(string_att_check, ATTRSTR_DATA.c_str())!=0)
TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,string_att_check=%s\n",__LINE__, ATTRSTR_DATA.c_str(), string_att_check);
@@ -568,7 +640,7 @@ static void test_write_vl_string_attribute()
// Read and verify the attribute string as an std::string.
H5std_string read_str;
- gr_attr.read(tid1, read_str);
+ gr_attr.read(vlst, read_str);
if (read_str != ATTRSTR_DATA)
TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,read_str=%s\n",__LINE__, ATTRSTR_DATA.c_str(), read_str.c_str());
@@ -576,28 +648,22 @@ static void test_write_vl_string_attribute()
gr_attr.close();
// Test creating a "large" sized string attribute
- gr_attr = root.createAttribute("test_scalar_large", tid1, att_space);
+ gr_attr = root.createAttribute("test_scalar_large", vlst, att_space);
string_att_write = (char*)HDcalloc(8192, sizeof(char));
HDmemset(string_att_write, 'A', 8191);
// Write data to the attribute, then read it back.
- gr_attr.write(tid1, &string_att_write);
- gr_attr.read(tid1, &string_att_check);
+ gr_attr.write(vlst, &string_att_write);
+ gr_attr.read(vlst, &string_att_check);
// Verify data read.
if(HDstrcmp(string_att_check,string_att_write)!=0)
TestErrPrintf("VL string attributes don't match!, string_att_write=%s, string_att_check=%s\n",string_att_write,string_att_check);
- HDfree(string_att_check);
- gr_attr.close();
- // Open attribute ATTRSTR_NAME again.
- gr_attr = root.openAttribute(ATTRSTR_NAME);
-
- // The attribute string written is freed below, in the
- // test_read_vl_string_attribute() test
-
- // Close attribute and file
+ // Release resources.
+ HDfree(string_att_check);
+ HDfree(string_att_write);
gr_attr.close();
file1.close();
@@ -606,9 +672,9 @@ static void test_write_vl_string_attribute()
// Catch all exceptions.
catch (Exception E) {
- issue_fail_msg("test_string_attr()", __LINE__, __FILE__, E.getCDetailMsg());
+ issue_fail_msg("test_vlstring_attribute()", __LINE__, __FILE__, E.getCDetailMsg());
}
-} // test_string_attr()
+} // test_vlstring_attribute()
/*-------------------------------------------------------------------------
* Function: test_read_vl_string_attribute
@@ -633,7 +699,7 @@ static void test_read_vl_string_attribute()
H5File file1(FILENAME, H5F_ACC_RDONLY);
// Create a datatype to refer to.
- StrType tid1(0, H5T_VARIABLE);
+ StrType vlst(0, H5T_VARIABLE);
// Open the root group and its attribute named ATTRSTR_NAME.
Group root = file1.openGroup("/");
@@ -641,7 +707,7 @@ static void test_read_vl_string_attribute()
// Test reading "normal" sized string attribute
char *string_att_check;
- att.read(tid1, &string_att_check);
+ att.read(vlst, &string_att_check);
if(HDstrcmp(string_att_check,ATTRSTR_DATA.c_str())!=0)
TestErrPrintf("VL string attributes don't match!, string_att=%s, string_att_check=%s\n",ATTRSTR_DATA.c_str(),string_att_check);
HDfree(string_att_check);
@@ -649,7 +715,7 @@ static void test_read_vl_string_attribute()
// Test reading "large" sized string attribute
att = root.openAttribute("test_scalar_large");
- att.read(tid1, &string_att_check);
+ att.read(vlst, &string_att_check);
if(HDstrcmp(string_att_check,string_att_write)!=0)
TestErrPrintf("VL string attributes don't match!, string_att_write=%s, string_att_check=%s\n",string_att_write,string_att_check);
HDfree(string_att_check);
@@ -657,7 +723,7 @@ static void test_read_vl_string_attribute()
// Close objects and file.
att.close();
- tid1.close();
+ vlst.close();
root.close();
file1.close();
@@ -670,6 +736,76 @@ static void test_read_vl_string_attribute()
}
} // test_read_vl_string_attribute
+/*-------------------------------------------------------------------------
+ * Function: test_vlstring_array_attribute
+ *
+ * Purpose: Test writing/reading VL string array to/from attributes.
+ *
+ * Return: None
+ *
+ * Programmer: Binh-Minh Ribler
+ * July, 2009
+ *
+ *-------------------------------------------------------------------------
+ */
+const H5std_string ATTRSTRARR_NAME("StringArray_attr");
+
+static void test_vlstring_array_attribute()
+{
+ const char *string_att_array[SPACE1_DIM1]= {
+ "Line 1", "Line 2", "Line 3", "Line 4"
+ }; // Information to write
+
+ // Output message about test being performed
+ SUBTEST("Testing VL String Array on Attributes");
+
+ try {
+ // Open the file
+ H5File file1(FILENAME, H5F_ACC_RDWR);
+
+ // Create a datatype to refer to.
+ StrType vlst(0, H5T_VARIABLE);
+
+ // Open the root group.
+ Group root = file1.openGroup("/");
+
+ // Create dataspace for datasets.
+ hsize_t dims1[] = {SPACE1_DIM1};
+ DataSpace att_space(SPACE1_RANK, dims1);
+
+ // Create an attribute for the root group.
+ Attribute gr_attr = root.createAttribute(ATTRSTRARR_NAME, vlst, att_space);
+
+ // Write data to the attribute.
+ gr_attr.write(vlst, string_att_array);
+
+ // Read and verify the attribute string as a string of chars.
+ // Note: reading by array of H5std_string doesn't work yet.
+ char *string_att_check[SPACE1_DIM1];
+ gr_attr.read(vlst, &string_att_check);
+
+ int ii;
+ for (ii = 0; ii < SPACE1_DIM1; ii++)
+ {
+ if(HDstrcmp(string_att_check[ii], string_att_array[ii])!=0)
+ TestErrPrintf("Line %d: Attribute data different: written=%s,read=%s\n",__LINE__, string_att_check[ii], string_att_check[ii]);
+
+ HDfree(string_att_check[ii]); // note: no need for std::string test
+ }
+
+ // Close group's attribute.
+ gr_attr.close();
+ file1.close();
+
+ PASSED();
+ } // end try block
+
+ // Catch all exceptions.
+ catch (Exception E) {
+ issue_fail_msg("test_vlstring_array_attribute()", __LINE__, __FILE__, E.getCDetailMsg());
+ }
+} // test_vlstring_array_attribute()
+
/* Helper routine for test_vl_rewrite() */
static void write_scalar_dset(H5File& file, DataType& type, DataSpace& space,
char *name, char *data)
@@ -814,14 +950,17 @@ void test_vlstrings()
// These tests use the same file
// Test basic VL string datatype
- test_vlstrings_basic();
+ test_vlstring_dataset();
test_vlstrings_special();
test_vlstring_type();
test_compact_vlstring();
// Test using VL strings in attributes
- test_write_vl_string_attribute();
- test_read_vl_string_attribute();
+ test_vlstring_attribute();
+
+ // Test using VL string array in attributes and datasets
+ test_vlstring_array_attribute();
+ test_vlstring_array_dataset();
// Test writing VL datasets in files with lots of unlinking
test_vl_rewrite();