diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-08-23 20:25:25 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-08-23 20:25:25 (GMT) |
commit | 63eb5b9ebbf4b9d63ee9173fec73027a0da1e33e (patch) | |
tree | f0947a1f2d2d60d55935f092cbb7071b4e62b301 /tools/h5import | |
parent | 3183d38231c3d2de3dd9e18abac1e753ca727013 (diff) | |
download | hdf5-63eb5b9ebbf4b9d63ee9173fec73027a0da1e33e.zip hdf5-63eb5b9ebbf4b9d63ee9173fec73027a0da1e33e.tar.gz hdf5-63eb5b9ebbf4b9d63ee9173fec73027a0da1e33e.tar.bz2 |
[svn-r14104] Description:
Pursue calls to H5Gcreate() relentlessly and ruthlessly exterminate
them, leaving only a few tame specimens in text files and comments. ;-)
Tested on:
Mac OS X/32 10.4.10 (amazon)
FreeBSD/32 6.2 (duty)
FreeBSD/64 6.2 (liberty)
Linux/32 2.6 (kagiso)
Linux/64 2.6 (smirom)
Solaris/32 5.10 (linew)
Diffstat (limited to 'tools/h5import')
-rwxr-xr-x | tools/h5import/h5import.c | 63 |
1 files changed, 27 insertions, 36 deletions
diff --git a/tools/h5import/h5import.c b/tools/h5import/h5import.c index cd99ce0..b494a67 100755 --- a/tools/h5import/h5import.c +++ b/tools/h5import/h5import.c @@ -848,17 +848,14 @@ processStrData(FILE **strm, struct Input *in, hid_t file_id) { /* create parent groups */ - if (in->path.count > 1) - { + if(in->path.count > 1) { j = 0; handle = file_id; - while (j<in->path.count-1) - { - if ((group_id = H5Gopen(handle, in->path.group[j])) < 0) - { - group_id = H5Gcreate(handle, in->path.group[j++], 0); - for (; j<in->path.count-1; j++) - group_id = H5Gcreate(group_id, in->path.group[j], 0); + while(j < in->path.count - 1) { + if((group_id = H5Gopen(handle, in->path.group[j])) < 0) { + group_id = H5Gcreate2(handle, in->path.group[j++], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + for(; j < in->path.count - 1; j++) + group_id = H5Gcreate2(group_id, in->path.group[j], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); handle = group_id; break; } @@ -866,10 +863,9 @@ processStrData(FILE **strm, struct Input *in, hid_t file_id) j++; } } - else - { + else { handle = file_id; - j=0; + j = 0; } /*enable error reporting */ @@ -2443,31 +2439,26 @@ process(struct Options *opt) /* disable error reporting */ H5E_BEGIN_TRY { - - /* create parent groups */ - if (in->path.count > 1) - { - j = 0; - handle = file_id; - while (j<in->path.count-1) - { - if ((group_id = H5Gopen(handle, in->path.group[j])) < 0) - { - group_id = H5Gcreate(handle, in->path.group[j++], 0); - for (; j<in->path.count-1; j++) - group_id = H5Gcreate(group_id, in->path.group[j], 0); - handle = group_id; - break; + /* create parent groups */ + if(in->path.count > 1) { + j = 0; + handle = file_id; + while(j < in->path.count - 1) { + if((group_id = H5Gopen(handle, in->path.group[j])) < 0) { + group_id = H5Gcreate2(handle, in->path.group[j++], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + for (; j < in->path.count - 1; j++) + group_id = H5Gcreate2(group_id, in->path.group[j], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + handle = group_id; + break; + } + handle = group_id; + j++; + } + } + else { + handle = file_id; + j=0; } - handle = group_id; - j++; - } - } - else - { - handle = file_id; - j=0; - } /*enable error reporting */ } H5E_END_TRY; |