diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-04-12 01:59:45 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-04-12 01:59:45 (GMT) |
commit | d6bb18abbc2d6e145afff18446a0814403f1a3b7 (patch) | |
tree | 8a340ebde9f0fea052c3d40b6e98f2d0ca7f7aaa /tools/h5jam/h5unjam.c | |
parent | de71a7fe74ca0954efec963066e2606d798691f4 (diff) | |
download | hdf5-d6bb18abbc2d6e145afff18446a0814403f1a3b7.zip hdf5-d6bb18abbc2d6e145afff18446a0814403f1a3b7.tar.gz hdf5-d6bb18abbc2d6e145afff18446a0814403f1a3b7.tar.bz2 |
[svn-r13648] Description:
Rename new error handling API routines from H5E<foo>_stack() to
H5E<foo>2().
Tested on:
Mac OS X/32 10.4.9 (amazon)
FreeBSD/32 6.2 (duty)
FreeBSD/64 6.2 (liberty)
Diffstat (limited to 'tools/h5jam/h5unjam.c')
-rw-r--r-- | tools/h5jam/h5unjam.c | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/tools/h5jam/h5unjam.c b/tools/h5jam/h5unjam.c index 25559e3..0edc980 100644 --- a/tools/h5jam/h5unjam.c +++ b/tools/h5jam/h5unjam.c @@ -162,7 +162,7 @@ main(int argc, const char *argv[]) int ufid; int h5fid; void *edata; - H5E_auto_stack_t func; + H5E_auto2_t func; hid_t ifile; off_t fsize; hsize_t usize; @@ -173,8 +173,8 @@ main(int argc, const char *argv[]) struct stat sbuf; /* Disable error reporting */ - H5Eget_auto_stack(H5E_DEFAULT, &func, &edata); - H5Eset_auto_stack(H5E_DEFAULT, NULL, NULL); + H5Eget_auto2(H5E_DEFAULT, &func, &edata); + H5Eset_auto2(H5E_DEFAULT, NULL, NULL); parse_command_line(argc, argv); @@ -286,33 +286,33 @@ main(int argc, const char *argv[]) * Returns the size of the output file. */ hsize_t -copy_to_file( int infid, int ofid, ssize_t where, ssize_t how_much ) { - char buf[1024]; - off_t to; - off_t from; - ssize_t nchars = -1; - - - if (how_much <= 0) { - /* nothing to copy */ - return(where); - } - from = where; - to = 0; - - while( how_much > 0) { - HDlseek(infid,from,SEEK_SET); - if (how_much > 512) { - nchars = HDread(infid,buf,(unsigned)512); - } else { - nchars = HDread(infid,buf,(unsigned)how_much); - } - HDlseek(ofid,to,SEEK_SET); - HDwrite(ofid,buf,(unsigned)nchars); - how_much -= nchars; - from += nchars; - to += nchars; - } - - return (where+how_much); +copy_to_file( int infid, int ofid, ssize_t where, ssize_t how_much ) +{ + char buf[1024]; + off_t to; + off_t from; + ssize_t nchars = -1; + + /* nothing to copy */ + if(how_much <= 0) + return(where); + + from = where; + to = 0; + + while( how_much > 0) { + HDlseek(infid,from,SEEK_SET); + if (how_much > 512) + nchars = HDread(infid,buf,(unsigned)512); + else + nchars = HDread(infid,buf,(unsigned)how_much); + HDlseek(ofid,to,SEEK_SET); + HDwrite(ofid,buf,(unsigned)nchars); + how_much -= nchars; + from += nchars; + to += nchars; + } + + return (where + how_much); } + |