summaryrefslogtreecommitdiffstats
path: root/tools/h5repack/h5repack_copy.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2006-10-05 14:35:40 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2006-10-05 14:35:40 (GMT)
commit5df5ee8956c9613793908169676de0fb47582c71 (patch)
treea48346c4a0d1e6284ad916807030e288a6979577 /tools/h5repack/h5repack_copy.c
parent4d8a0f4c54b95c5b865ebdee6e82cf42c7b44c5a (diff)
downloadhdf5-5df5ee8956c9613793908169676de0fb47582c71.zip
hdf5-5df5ee8956c9613793908169676de0fb47582c71.tar.gz
hdf5-5df5ee8956c9613793908169676de0fb47582c71.tar.bz2
[svn-r12720]
added output of error messages using the tools library function error_msg, that prints the program name and error on the message tested: kagiso
Diffstat (limited to 'tools/h5repack/h5repack_copy.c')
-rw-r--r--tools/h5repack/h5repack_copy.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c
index c62407f..b2c375c 100644
--- a/tools/h5repack/h5repack_copy.c
+++ b/tools/h5repack/h5repack_copy.c
@@ -12,13 +12,16 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "H5private.h"
+#include "h5tools_utils.h"
#include "h5repack.h"
+extern char *progname;
+
+
#define PER(A,B) { per = 0; \
if (A!=0) \
per = (float)fabs(1-( (float)B / (float)A )); \
@@ -178,11 +181,11 @@ int copy_objects(const char* fnamein,
*-------------------------------------------------------------------------
*/
if ((fidin=h5tools_fopen(fnamein, NULL, NULL, 0))<0 ){
- printf("<%s>: %s\n", fnamein, H5FOPENERROR );
+ error_msg(progname, "<%s>: %s\n", fnamein, H5FOPENERROR );
goto out;
}
if ((fidout=H5Fcreate(fnameout,H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT))<0 ){
- printf("<%s>: Could not create file\n", fnameout );
+ error_msg(progname, "<%s>: Could not create file\n", fnameout );
goto out;
}
@@ -201,7 +204,7 @@ int copy_objects(const char* fnamein,
*-------------------------------------------------------------------------
*/
if(do_copy_objects(fidin,fidout,travt,options)<0) {
- printf("<%s>: Could not copy data to: %s\n", fnamein, fnameout);
+ error_msg(progname, "<%s>: Could not copy data to: %s\n", fnamein, fnameout);
goto out;
}
@@ -211,7 +214,7 @@ int copy_objects(const char* fnamein,
*-------------------------------------------------------------------------
*/
if(do_copy_refobjs(fidin,fidout,travt,options)<0) {
- printf("<%s>: Could not copy data to: %s\n", fnamein, fnameout);
+ error_msg(progname, "<%s>: Could not copy data to: %s\n", fnamein, fnameout);
goto out;
}
@@ -409,7 +412,7 @@ int do_copy_objects(hid_t fidin,
{
buf=(void *) HDmalloc((unsigned)(nelmts*msize));
if ( buf==NULL){
- printf( "cannot read into memory\n" );
+ error_msg(progname, "cannot read into memory\n" );
goto error;
}
if (H5Dread(dset_in,mtype_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
@@ -735,7 +738,7 @@ int copy_attr(hid_t loc_in,
buf=(void *) HDmalloc((unsigned)(nelmts*msize));
if ( buf==NULL){
- printf( "cannot read into memory\n" );
+ error_msg(progname, "cannot read into memory\n" );
goto error;
}
if (H5Aread(attr_id,mtype_id,buf)<0)