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 | |
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')
-rw-r--r-- | tools/h5jam/h5jam.c | 32 | ||||
-rw-r--r-- | tools/h5jam/h5unjam.c | 64 | ||||
-rw-r--r-- | tools/h5jam/tellub.c | 7 |
3 files changed, 52 insertions, 51 deletions
diff --git a/tools/h5jam/h5jam.c b/tools/h5jam/h5jam.c index 559054e..120cde4 100644 --- a/tools/h5jam/h5jam.c +++ b/tools/h5jam/h5jam.c @@ -159,7 +159,7 @@ main (int argc, const char *argv[]) int h5fid; int ofid; void *edata; - H5E_auto_stack_t func; + H5E_auto2_t func; hid_t ifile; hid_t plist; herr_t status; @@ -175,8 +175,8 @@ main (int argc, const char *argv[]) int res; /* 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); @@ -517,22 +517,22 @@ compute_user_block_size (hsize_t ublock_size) * Returns the size of the padded file. */ hsize_t -write_pad (int ofile, hsize_t where) +write_pad(int ofile, hsize_t where) { - unsigned int i; - char buf[1]; - hsize_t psize; + unsigned int i; + char buf[1]; + hsize_t psize; - buf[0] = '\0'; + buf[0] = '\0'; - HDlseek (ofile, (off_t) where, SEEK_SET); + HDlseek(ofile, (off_t) where, SEEK_SET); - psize = compute_user_block_size (where); - psize -= where; + psize = compute_user_block_size (where); + psize -= where; - for (i = 0; i < psize; i++) - { - HDwrite (ofile, buf, 1); - } - return (where + psize); /* the new size of the file. */ + for(i = 0; i < psize; i++) + HDwrite (ofile, buf, 1); + + return(where + psize); /* the new size of the file. */ } + 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); } + diff --git a/tools/h5jam/tellub.c b/tools/h5jam/tellub.c index e71d4ba..a5d8bbd 100644 --- a/tools/h5jam/tellub.c +++ b/tools/h5jam/tellub.c @@ -128,7 +128,7 @@ main (int argc, const char *argv[]) { char *ifname; void *edata; - H5E_auto_stack_t func; + H5E_auto2_t func; hid_t ifile; hsize_t usize; htri_t testval; @@ -136,8 +136,8 @@ main (int argc, const char *argv[]) hid_t plist; /* 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); @@ -188,3 +188,4 @@ main (int argc, const char *argv[]) return (EXIT_SUCCESS); } + |