summaryrefslogtreecommitdiffstats
path: root/PC/VS7.1/readme.txt
diff options
context:
space:
mode:
Diffstat (limited to 'PC/VS7.1/readme.txt')
-rw-r--r--PC/VS7.1/readme.txt4
1 files changed, 2 insertions, 2 deletions
diff --git a/PC/VS7.1/readme.txt b/PC/VS7.1/readme.txt
index 9b78e6d..fdd3050 100644
--- a/PC/VS7.1/readme.txt
+++ b/PC/VS7.1/readme.txt
@@ -12,7 +12,7 @@ the "Standard" toolbar"), and build the projects.
The proper order to build subprojects:
1) pythoncore (this builds the main Python DLL and library files,
- python26.{dll, lib} in Release mode)
+ python27.{dll, lib} in Release mode)
NOTE: in previous releases, this subproject was
named after the release number, e.g. python20.
@@ -26,7 +26,7 @@ The proper order to build subprojects:
test slave; see SUBPROJECTS below)
When using the Debug setting, the output files have a _d added to
-their name: python26_d.dll, python_d.exe, parser_d.pyd, and so on.
+their name: python27_d.dll, python_d.exe, parser_d.pyd, and so on.
SUBPROJECTS
-----------
| 42 +- hl/tools/gif2h5/gifread.c | 50 +- hl/tools/gif2h5/hdf2gif.c | 16 +- hl/tools/gif2h5/hdfgifwr.c | 18 +- hl/tools/gif2h5/readhdf.c | 12 +- hl/tools/gif2h5/writehdf.c | 12 +- perform/benchpar.c | 4 +- perform/chunk.c | 14 +- perform/iopipe.c | 88 +- perform/mpi-perf.c | 48 +- perform/overhead.c | 28 +- perform/perf.c | 66 +- perform/perf_meta.c | 154 +-- perform/pio_engine.c | 14 +- perform/pio_perf.c | 6 +- perform/pio_standalone.h | 8 +- src/H5.c | 68 +- src/H5A.c | 122 +- src/H5AC.c | 172 +-- src/H5ACprivate.h | 10 +- src/H5ACpublic.h | 2 +- src/H5B.c | 72 +- src/H5B2.c | 86 +- src/H5B2cache.c | 12 +- src/H5B2private.h | 2 +- src/H5BP.c | 4 +- src/H5BPcache.c | 8 +- src/H5BPprivate.h | 2 +- src/H5BT.c | 18 +- src/H5BTcache.c | 4 +- src/H5BTprivate.h | 2 +- src/H5Bprivate.h | 6 +- src/H5C.c | 894 +++++++------- src/H5CS.c | 16 +- src/H5Cpkg.h | 190 +-- src/H5Cprivate.h | 204 +-- src/H5D.c | 262 ++-- src/H5Dcompact.c | 58 +- src/H5Dcontig.c | 16 +- src/H5Defl.c | 24 +- src/H5Dio.c | 14 +- src/H5Distore.c | 154 +-- src/H5Dmpio.c | 4 +- src/H5Dprivate.h | 12 +- src/H5Dpublic.h | 4 +- src/H5Dselect.c | 8 +- src/H5E.c | 296 ++--- src/H5Eprivate.h | 2 +- src/H5Epublic.h | 10 +- src/H5Eterm.h | 242 ++-- src/H5F.c | 312 ++--- src/H5FD.c | 106 +- src/H5FDcore.c | 44 +- src/H5FDfamily.c | 94 +- src/H5FDfphdf5.c | 20 +- src/H5FDlog.c | 52 +- src/H5FDmpi.c | 16 +- src/H5FDmpio.c | 54 +- src/H5FDmpiposix.c | 42 +- src/H5FDmulti.c | 76 +- src/H5FDpublic.h | 4 +- src/H5FDsec2.c | 36 +- src/H5FDstdio.c | 54 +- src/H5FDstream.c | 14 +- src/H5FDstream.h | 2 +- src/H5FL.c | 92 +- src/H5FLprivate.h | 2 +- src/H5FP.c | 2 +- src/H5FPclient.c | 36 +- src/H5FPprivate.h | 4 +- src/H5FPserver.c | 96 +- src/H5FS.c | 16 +- src/H5Fdbg.c | 2 +- src/H5Fmount.c | 34 +- src/H5Fpkg.h | 2 +- src/H5Fprivate.h | 22 +- src/H5Fpublic.h | 4 +- src/H5Fsfile.c | 6 +- src/H5Fsuper.c | 30 +- src/H5G.c | 240 ++-- src/H5Gent.c | 12 +- src/H5Gnode.c | 44 +- src/H5Gpkg.h | 2 +- src/H5Gpublic.h | 8 +- src/H5Gstab.c | 16 +- src/H5HG.c | 78 +- src/H5HL.c | 16 +- src/H5HLprivate.h | 2 +- src/H5I.c | 80 +- src/H5Ipublic.h | 2 +- src/H5MF.c | 10 +- src/H5MM.c | 2 +- src/H5MP.c | 2 +- src/H5MPtest.c | 2 +- src/H5O.c | 142 +-- src/H5Oattr.c | 22 +- src/H5Obogus.c | 2 +- src/H5Ocont.c | 2 +- src/H5Odtype.c | 28 +- src/H5Oefl.c | 20 +- src/H5Ofill.c | 64 +- src/H5Olayout.c | 38 +- src/H5Omtime.c | 22 +- src/H5Oname.c | 4 +- src/H5Onull.c | 2 +- src/H5Opkg.h | 4 +- src/H5Opline.c | 16 +- src/H5Oprivate.h | 22 +- src/H5Osdspace.c | 26 +- src/H5Oshared.c | 12 +- src/H5Ostab.c | 4 +- src/H5P.c | 104 +- src/H5Pdcpl.c | 160 +-- src/H5Pdxpl.c | 74 +- src/H5Pfapl.c | 300 ++--- src/H5Pfcpl.c | 16 +- src/H5Pocpl.c | 14 +- src/H5Pprivate.h | 2 +- src/H5Ppublic.h | 20 +- src/H5R.c | 26 +- src/H5S.c | 76 +- src/H5SH.c | 6 +- src/H5SHcache.c | 4 +- src/H5SHprivate.h | 2 +- src/H5SL.c | 2 +- src/H5ST.c | 14 +- src/H5Sall.c | 4 +- src/H5Shyper.c | 72 +- src/H5Smpio.c | 2 +- src/H5Snone.c | 2 +- src/H5Spkg.h | 6 +- src/H5Spoint.c | 14 +- src/H5Sprivate.h | 2 +- src/H5T.c | 246 ++-- src/H5TS.c | 14 +- src/H5Tarray.c | 20 +- src/H5Tbit.c | 62 +- src/H5Tcommit.c | 18 +- src/H5Tcompound.c | 24 +- src/H5Tconv.c | 652 +++++----- src/H5Tcset.c | 12 +- src/H5Tenum.c | 28 +- src/H5Tfields.c | 36 +- src/H5Tfixed.c | 10 +- src/H5Tfloat.c | 22 +- src/H5Tnative.c | 298 ++--- src/H5Toffset.c | 10 +- src/H5Topaque.c | 4 +- src/H5Torder.c | 2 +- src/H5Tpad.c | 6 +- src/H5Tpkg.h | 4 +- src/H5Tprecis.c | 8 +- src/H5Tpublic.h | 2 +- src/H5Tstrpad.c | 8 +- src/H5Tvlen.c | 34 +- src/H5V.c | 6 +- src/H5Z.c | 44 +- src/H5Zdeflate.c | 8 +- src/H5Zfletcher32.c | 50 +- src/H5Znbit.c | 330 ++--- src/H5Zprivate.h | 2 +- src/H5Zpublic.h | 18 +- src/H5Zscaleoffset.c | 426 +++---- src/H5Zshuffle.c | 8 +- src/H5Zszip.c | 18 +- src/H5Ztrans.c | 162 +-- src/H5api_adpt.h | 2 +- src/H5detect.c | 46 +- src/H5private.h | 34 +- src/H5public.h | 4 +- test/b+tree.c | 8 +- test/big.c | 32 +- test/bittests.c | 50 +- test/blocktrack.c | 30 +- test/btree2.c | 162 +-- test/cache.c | 1912 ++++++++++++++--------------- test/cmpd_dset.c | 48 +- test/createnoenc.c | 2 +- test/dangle.c | 32 +- test/dsets.c | 648 +++++----- test/dt_arith.c | 404 +++--- test/dtransform.c | 108 +- test/dtypes.c | 204 +-- test/enum.c | 56 +- test/err_compat.c | 46 +- test/error_test.c | 90 +- test/extend.c | 6 +- test/external.c | 20 +- test/fillval.c | 148 +-- test/flush1.c | 2 +- test/flush2.c | 8 +- test/gen_deflate.c | 6 +- test/gen_filters.c | 10 +- test/gen_new_array.c | 6 +- test/gen_new_fill.c | 12 +- test/gen_new_mtime.c | 6 +- test/gen_new_super.c | 4 +- test/gen_nullspace.c | 16 +- test/gen_old_array.c | 6 +- test/gen_old_layout.c | 6 +- test/gen_old_mtime.c | 6 +- test/getname.c | 246 ++-- test/gheap.c | 16 +- test/h5test.c | 54 +- test/h5test.h | 12 +- test/hyperslab.c | 20 +- test/istore.c | 4 +- test/lheap.c | 2 +- test/links.c | 30 +- test/mount.c | 142 +-- test/mtime.c | 18 +- test/ntypes.c | 414 +++---- test/ohdr.c | 10 +- test/pool.c | 4 +- test/reserved.c | 24 +- test/set_extent.c | 16 +- test/sheap.c | 8 +- test/space_overflow.c | 6 +- test/stab.c | 10 +- test/tarray.c | 148 +-- test/tattr.c | 84 +- test/tconfig.c | 4 +- test/testframe.c | 8 +- test/testhdf5.c | 2 +- test/testmeta.c | 60 +- test/tfile.c | 202 +-- test/tgenprop.c | 112 +- test/th5s.c | 80 +- test/theap.c | 70 +- test/tid.c | 4 +- test/titerate.c | 106 +- test/tmeta.c | 4 +- test/tmisc.c | 202 +-- test/trefer.c | 44 +- test/trefstr.c | 34 +- test/tselect.c | 438 +++---- test/tskiplist.c | 76 +- test/ttime.c | 36 +- test/ttsafe.c | 2 +- test/ttsafe_acreate.c | 2 +- test/ttsafe_cancel.c | 2 +- test/ttsafe_dcreate.c | 2 +- test/ttsafe_error.c | 18 +- test/ttst.c | 26 +- test/tunicode.c | 8 +- test/tvlstr.c | 78 +- test/tvltypes.c | 92 +- test/unlink.c | 42 +- test/vfd.c | 142 +-- testpar/t_coll_chunk.c | 48 +- testpar/t_dset.c | 2 +- testpar/t_fphdf5.c | 118 +- testpar/t_mdset.c | 298 ++--- testpar/t_mpi.c | 60 +- testpar/t_ph5basic.c | 6 +- testpar/t_span_tree.c | 290 ++--- testpar/testphdf5.c | 58 +- testpar/testphdf5.h | 170 +-- tools/gifconv/decompress.c | 30 +- tools/gifconv/gif.h | 12 +- tools/gifconv/gif2mem.c | 42 +- tools/gifconv/gifread.c | 50 +- tools/gifconv/hdf2gif.c | 16 +- tools/gifconv/hdfgifwr.c | 18 +- tools/gifconv/readhdf.c | 12 +- tools/gifconv/writehdf.c | 12 +- tools/h5diff/h5diff_common.c | 38 +- tools/h5diff/h5diff_main.c | 8 +- tools/h5diff/ph5diff_main.c | 38 +- tools/h5diff/testh5diff.h | 24 +- tools/h5diff/testh5diff_attr.c | 96 +- tools/h5diff/testh5diff_basic.c | 64 +- tools/h5diff/testh5diff_dset.c | 60 +- tools/h5diff/testh5diff_main.c | 8 +- tools/h5diff/testh5diff_util.c | 26 +- tools/h5dump/h5dump.c | 266 ++-- tools/h5dump/h5dumpgentest.c | 318 ++--- tools/h5import/h5import.c | 702 +++++------ tools/h5import/h5import.h | 24 +- tools/h5import/h5importtest.c | 52 +- tools/h5jam/getub.c | 8 +- tools/h5jam/h5jam.c | 20 +- tools/h5jam/h5jamgentest.c | 18 +- tools/h5jam/h5unjam.c | 26 +- tools/h5jam/tellub.c | 10 +- tools/h5ls/h5ls.c | 96 +- tools/h5repack/h5repack.c | 86 +- tools/h5repack/h5repack.h | 76 +- tools/h5repack/h5repack_copy.c | 268 ++-- tools/h5repack/h5repack_filters.c | 186 +-- tools/h5repack/h5repack_list.c | 44 +- tools/h5repack/h5repack_main.c | 34 +- tools/h5repack/h5repack_opttable.c | 100 +- tools/h5repack/h5repack_parse.c | 90 +- tools/h5repack/h5repack_refs.c | 268 ++-- tools/h5repack/h5repack_verify.c | 154 +-- tools/h5repack/testh5repack_attr.c | 92 +- tools/h5repack/testh5repack_detect_szip.c | 8 +- tools/h5repack/testh5repack_dset.c | 88 +- tools/h5repack/testh5repack_main.c | 140 +-- tools/h5repack/testh5repack_make.c | 208 ++-- tools/h5repack/testh5repack_util.c | 46 +- tools/lib/h5diff.c | 60 +- tools/lib/h5diff.h | 240 ++-- tools/lib/h5diff_array.c | 928 +++++++------- tools/lib/h5diff_attr.c | 80 +- tools/lib/h5diff_dset.c | 132 +- tools/lib/h5diff_util.c | 72 +- tools/lib/h5tools.c | 50 +- tools/lib/h5tools.h | 24 +- tools/lib/h5tools_filters.c | 46 +- tools/lib/h5tools_str.c | 28 +- tools/lib/h5tools_utils.c | 28 +- tools/lib/h5tools_utils.h | 4 +- tools/lib/h5trav.c | 134 +- tools/lib/h5trav.h | 28 +- tools/lib/h5trav_table.c | 50 +- tools/lib/ph5diff.h | 6 +- tools/misc/h5debug.c | 16 +- tools/misc/h5import.c | 8 +- tools/misc/h5repart.c | 36 +- tools/misc/h5repart_gentest.c | 16 +- tools/misc/pdb2hdf.c | 38 +- tools/misc/repart_test.c | 30 +- 449 files changed, 16825 insertions(+), 16825 deletions(-) diff --git a/c++/examples/chunks.cpp b/c++/examples/chunks.cpp index 0efd95d..b6db2ad 100644 --- a/c++/examples/chunks.cpp +++ b/c++/examples/chunks.cpp @@ -12,11 +12,11 @@ * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* +/* * This example shows how to read data from a chunked dataset. - * We will read from the file created by extend.C + * We will read from the file created by extend.C */ - + #include #ifdef OLD_HEADER_FILENAME @@ -55,7 +55,7 @@ int main (void) */ H5File file( FILE_NAME, H5F_ACC_RDONLY ); DataSet dataset = file.openDataSet( DATASET_NAME ); - + /* * Get filespace for rank and dimension */ @@ -69,18 +69,18 @@ int main (void) /* * Get and print the dimension sizes of the file dataspace */ - hsize_t dims[2]; // dataset dimensions + hsize_t dims[2]; // dataset dimensions rank = filespace.getSimpleExtentDims( dims ); - cout << "dataset rank = " << rank << ", dimensions " + cout << "dataset rank = " << rank << ", dimensions " << (unsigned long)(dims[0]) << " x " << (unsigned long)(dims[1]) << endl; /* * Get creation properties list. */ - DSetCreatPropList cparms = dataset.getCreatePlist(); + DSetCreatPropList cparms = dataset.getCreatePlist(); - /* + /* * Check if dataset is chunked. */ hsize_t chunk_dims[2]; @@ -91,16 +91,16 @@ int main (void) * Get chunking information: rank and dimensions */ rank_chunk = cparms.getChunk( 2, chunk_dims); - cout << "chunk rank " << rank_chunk << "dimensions " - << (unsigned long)(chunk_dims[0]) << " x " + cout << "chunk rank " << rank_chunk << "dimensions " + << (unsigned long)(chunk_dims[0]) << " x " << (unsigned long)(chunk_dims[1]) << endl; } - + /* * Define the memory space to read dataset. */ DataSpace mspace1( RANK, dims ); - + /* * Read dataset back and display. */ @@ -113,23 +113,23 @@ int main (void) for (i = 0; i < dims[1]; i++) cout << data_out[j][i] << " "; cout << endl; - } + } /* - * dataset rank 2, dimensions 10 x 5 - * chunk rank 2, dimensions 2 x 5 + * dataset rank 2, dimensions 10 x 5 + * chunk rank 2, dimensions 2 x 5 * Dataset: - * 1 1 1 3 3 - * 1 1 1 3 3 - * 1 1 1 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 + * 1 1 1 3 3 + * 1 1 1 3 3 + * 1 1 1 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 */ /* @@ -157,17 +157,17 @@ int main (void) cout << column[i] << endl; /* - * Third column: - * 1 - * 1 - * 1 - * 0 - * 0 - * 0 - * 0 - * 0 - * 0 - * 0 + * Third column: + * 1 + * 1 + * 1 + * 0 + * 0 + * 0 + * 0 + * 0 + * 0 + * 0 */ /* @@ -196,11 +196,11 @@ int main (void) for (i = 0; i < chunk_dims[1]; i++) cout << chunk_out[j][i] << " "; cout << endl; - } + } /* - * Chunk: - * 1 1 1 0 0 - * 2 0 0 0 0 + * Chunk: + * 1 1 1 0 0 + * 2 0 0 0 0 */ } // end of try block diff --git a/c++/examples/compound.cpp b/c++/examples/compound.cpp index d3163d6..dfbd544 100644 --- a/c++/examples/compound.cpp +++ b/c++/examples/compound.cpp @@ -45,7 +45,7 @@ int main(void) typedef struct s1_t { int a; float b; - double c; + double c; } s1_t; /* Second structure (subset of s1_t) and dataset*/ @@ -87,21 +87,21 @@ int main(void) H5File* file = new H5File( FILE_NAME, H5F_ACC_TRUNC ); /* - * Create the memory datatype. + * Create the memory datatype. */ CompType mtype1( sizeof(s1_t) ); mtype1.insertMember( MEMBER1, HOFFSET(s1_t, a), PredType::NATIVE_INT); mtype1.insertMember( MEMBER3, HOFFSET(s1_t, c), PredType::NATIVE_DOUBLE); mtype1.insertMember( MEMBER2, HOFFSET(s1_t, b), PredType::NATIVE_FLOAT); - /* + /* * Create the dataset. */ DataSet* dataset; dataset = new DataSet( file->createDataSet( DATASET_NAME, mtype1, space )); /* - * Wtite data to the dataset; + * Wtite data to the dataset; */ dataset->write( s1, mtype1 ); @@ -110,7 +110,7 @@ int main(void) */ delete dataset; delete file; - + // Get the class of the first member in mtype1, then get its type H5T_class_t member1_class = mtype1.getMemberClass( 2 ); if( member1_class == H5T_FLOAT ) @@ -127,7 +127,7 @@ int main(void) file = new H5File( FILE_NAME, H5F_ACC_RDONLY ); dataset = new DataSet (file->openDataSet( DATASET_NAME )); - /* + /* * Create a datatype for s2 */ CompType mtype2( sizeof(s2_t) ); @@ -151,11 +151,11 @@ int main(void) cout << endl; cout << endl << "Field a : " << endl; - for( i = 0; i < LENGTH; i++) + for( i = 0; i < LENGTH; i++) cout << s2[i].a << " "; cout << endl; - /* + /* * Create a datatype for s3. */ CompType mtype3( sizeof(float) ); diff --git a/c++/examples/create.cpp b/c++/examples/create.cpp index 06d5d4d..3e93cb4 100644 --- a/c++/examples/create.cpp +++ b/c++/examples/create.cpp @@ -12,10 +12,10 @@ * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* +/* * This example writes a dataset to a new HDF5 file. */ - + #include #ifdef OLD_HEADER_FILENAME @@ -37,8 +37,8 @@ const int RANK = 2; int main (void) { - /* - * Data initialization. + /* + * Data initialization. */ int i, j; int data[NX][NY]; // buffer for data to write @@ -46,9 +46,9 @@ int main (void) { for (i = 0; i < NY; i++) data[j][i] = i + j; - } + } /* - * 0 1 2 3 4 5 + * 0 1 2 3 4 5 * 1 2 3 4 5 6 * 2 3 4 5 6 7 * 3 4 5 6 7 8 @@ -73,12 +73,12 @@ int main (void) /* * Define the size of the array and create the data space for fixed - * size dataset. + * size dataset. */ hsize_t dimsf[2]; // dataset dimensions dimsf[0] = NX; dimsf[1] = NY; - DataSpace dataspace( RANK, dimsf ); + DataSpace dataspace( RANK, dimsf ); /* * Define datatype for the data in the file. @@ -129,5 +129,5 @@ int main (void) } return 0; // successfully terminated -} +} diff --git a/c++/examples/extend_ds.cpp b/c++/examples/extend_ds.cpp index 9c12304..614a2b1 100644 --- a/c++/examples/extend_ds.cpp +++ b/c++/examples/extend_ds.cpp @@ -12,13 +12,13 @@ * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* +/* * This example shows how to work with extendible dataset. * In the current version of the library dataset MUST be * chunked. - * + * */ - + #include #ifdef OLD_HEADER_FILENAME @@ -52,18 +52,18 @@ int main (void) Exception::dontPrint(); /* - * Create the data space with unlimited dimensions. + * Create the data space with unlimited dimensions. */ - hsize_t dims[2] = { 3, 3}; // dataset dimensions at creation + hsize_t dims[2] = { 3, 3}; // dataset dimensions at creation hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; - DataSpace mspace1( RANK, dims, maxdims); + DataSpace mspace1( RANK, dims, maxdims); /* * Create a new file. If file exists its contents will be overwritten. */ H5File file( FILE_NAME, H5F_ACC_TRUNC ); - /* + /* * Modify dataset creation properties, i.e. enable chunking. */ DSetCreatPropList cparms; @@ -87,8 +87,8 @@ int main (void) * Extend the dataset. This call assures that dataset is at least 3 x 3. */ hsize_t size[2]; - size[0] = 3; - size[1] = 3; + size[0] = 3; + size[1] = 3; dataset.extend( size ); /* @@ -98,24 +98,24 @@ int main (void) hsize_t offset[2]; offset[0] = 0; offset[1] = 0; - hsize_t dims1[2] = { 3, 3}; /* data1 dimensions */ - fspace1.selectHyperslab( H5S_SELECT_SET, dims1, offset ); + hsize_t dims1[2] = { 3, 3}; /* data1 dimensions */ + fspace1.selectHyperslab( H5S_SELECT_SET, dims1, offset ); /* * Write the data to the hyperslab. */ int data1[3][3] = { {1, 1, 1}, /* data to write */ {1, 1, 1}, - {1, 1, 1} }; + {1, 1, 1} }; dataset.write( data1, PredType::NATIVE_INT, mspace1, fspace1 ); /* * Extend the dataset. Dataset becomes 10 x 3. */ - hsize_t dims2[2] = { 7, 1}; /* data2 dimensions */ + hsize_t dims2[2] = { 7, 1}; /* data2 dimensions */ dims[0] = dims1[0] + dims2[0]; - size[0] = dims[0]; - size[1] = dims[1]; + size[0] = dims[0]; + size[1] = dims[1]; dataset.extend( size ); /* @@ -124,12 +124,12 @@ int main (void) DataSpace fspace2 = dataset.getSpace (); offset[0] = 3; offset[1] = 0; - fspace2.selectHyperslab( H5S_SELECT_SET, dims2, offset ); + fspace2.selectHyperslab( H5S_SELECT_SET, dims2, offset ); /* * Define memory space */ - DataSpace mspace2( RANK, dims2 ); + DataSpace mspace2( RANK, dims2 ); /* * Write the data to the hyperslab. @@ -140,10 +140,10 @@ int main (void) /* * Extend the dataset. Dataset becomes 10 x 5. */ - hsize_t dims3[2] = { 2, 2}; /* data3 dimensions */ + hsize_t dims3[2] = { 2, 2}; /* data3 dimensions */ dims[1] = dims1[1] + dims3[1]; - size[0] = dims[0]; - size[1] = dims[1]; + size[0] = dims[0]; + size[1] = dims[1]; dataset.extend( size ); /* @@ -152,12 +152,12 @@ int main (void) DataSpace fspace3 = dataset.getSpace (); offset[0] = 0; offset[1] = 3; - fspace3.selectHyperslab( H5S_SELECT_SET, dims3, offset ); + fspace3.selectHyperslab( H5S_SELECT_SET, dims3, offset ); /* * Define memory space. */ - DataSpace mspace3( RANK, dims3 ); + DataSpace mspace3( RANK, dims3 ); /* * Write the data to the hyperslab. @@ -178,7 +178,7 @@ int main (void) dataset.read( data_out, PredType::NATIVE_INT ); /* * Resulting dataset - * + * * 1 1 1 3 3 * 1 1 1 3 3 * 1 1 1 0 0 @@ -229,4 +229,4 @@ int main (void) return -1; } return 0; -} +} diff --git a/c++/examples/h5group.cpp b/c++/examples/h5group.cpp index d7f3c66..a69f2f4 100644 --- a/c++/examples/h5group.cpp +++ b/c++/examples/h5group.cpp @@ -13,13 +13,13 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * This example creates a group in the file and dataset in the group. + * This example creates a group in the file and dataset in the group. * Hard link to the group object is created and the dataset is accessed - * under different names. + * under different names. * Iterator function is used to find the object names in the root group. * Note that the C++ API iterator function is not completed yet, thus * the C version is used in this example. - */ + */ #include #ifdef OLD_HEADER_FILENAME @@ -67,9 +67,9 @@ int main(void) /* * Create dataset "Compressed Data" in the group using absolute - * name. Dataset creation property list is modified to use - * GZIP compression with the compression effort set to 6. - * Note that compression can be used only when dataset is chunked. + * name. Dataset creation property list is modified to use + * GZIP compression with the compression effort set to 6. + * Note that compression can be used only when dataset is chunked. */ dims[0] = 1000; dims[1] = 20; @@ -92,13 +92,13 @@ int main(void) delete file; /* - * Now reopen the file and group in the file. + * Now reopen the file and group in the file. */ file = new H5File( FILE_NAME, H5F_ACC_RDWR ); group = new Group( file->openGroup( "Data" )); /* - * Access "Compressed_Data" dataset in the group. + * Access "Compressed_Data" dataset in the group. */ try { // to determine if the dataset exists in the group dataset = new DataSet( group->openDataSet( "Compressed_Data" )); @@ -121,11 +121,11 @@ int main(void) /* * We can access "Compressed_Data" dataset using created - * hard link "Data_new". + * hard link "Data_new". */ try { // to determine if the dataset exists in the file dataset = new DataSet( file->openDataSet( "/Data_new/Compressed_Data" )); - } + } catch( FileIException not_found_error ) { cout << " Dataset is not found." << endl; @@ -150,9 +150,9 @@ int main(void) * of the objects in the file root direvtory. */ cout << "Unlinking..." << endl; - try { // attempt to unlink the dataset + try { // attempt to unlink the dataset file->unlink( "Data" ); - } + } catch( FileIException unlink_error ) { cout << " unlink failed." << endl; @@ -211,12 +211,12 @@ file_info(hid_t loc_id, const char *name, void *opdata) * Open the group using its name. */ group = H5Gopen(loc_id, name); - + /* * Display group name. */ cout << "Name : " << name << endl; - + H5Gclose(group); return 0; } diff --git a/c++/examples/readdata.cpp b/c++/examples/readdata.cpp index 7e5b195..5a1ec51 100644 --- a/c++/examples/readdata.cpp +++ b/c++/examples/readdata.cpp @@ -12,10 +12,10 @@ * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -// +// // This example reads hyperslab from the SDS.h5 file into -// two-dimensional plane of a three-dimensional array. Various -// information about the dataset in the SDS.h5 file is obtained. +// two-dimensional plane of a three-dimensional array. Various +// information about the dataset in the SDS.h5 file is obtained. // #include @@ -54,7 +54,7 @@ int main (void) for (k = 0; k < NZ ; k++) data_out[j][i][k] = 0; } - } + } /* * Try block to detect exceptions raised by any of the calls inside it @@ -125,7 +125,7 @@ int main (void) (unsigned long)(dims_out[1]) << endl; /* - * Define hyperslab in the dataset; implicitly giving strike and + * Define hyperslab in the dataset; implicitly giving strike and * block NULL. */ hsize_t offset[2]; // hyperslab offset in the file @@ -143,10 +143,10 @@ int main (void) dimsm[0] = NX; dimsm[1] = NY; dimsm[2] = NZ ; - DataSpace memspace( RANK_OUT, dimsm ); + DataSpace memspace( RANK_OUT, dimsm ); /* - * Define memory hyperslab. + * Define memory hyperslab. */ hsize_t offset_out[3]; // hyperslab offset in memory hsize_t count_out[3]; // size of the hyperslab in memory @@ -159,7 +159,7 @@ int main (void) memspace.selectHyperslab( H5S_SELECT_SET, count_out, offset_out ); /* - * Read data from hyperslab in the file into the hyperslab in + * Read data from hyperslab in the file into the hyperslab in * memory and display the data. */ dataset.read( data_out, PredType::NATIVE_INT, memspace, dataspace ); @@ -174,7 +174,7 @@ int main (void) * 0 0 0 0 0 0 0 * 0 0 0 0 0 0 0 * 0 0 0 0 0 0 0 - * 3 4 5 6 0 0 0 + * 3 4 5 6 0 0 0 * 4 5 6 7 0 0 0 * 5 6 7 8 0 0 0 * 0 0 0 0 0 0 0 @@ -210,5 +210,5 @@ int main (void) } return 0; // successfully terminated -} +} diff --git a/c++/examples/writedata.cpp b/c++/examples/writedata.cpp index 0bed680..f50927d 100644 --- a/c++/examples/writedata.cpp +++ b/c++/examples/writedata.cpp @@ -12,15 +12,15 @@ * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* +/* * This program shows how the select_hyperslab and select_elements * functions are used to write selected data from memory to the file. * Program takes 48 elements from the linear buffer and writes them into - * the matrix using 3x2 blocks, (4,3) stride and (2,4) count. - * Then four elements of the matrix are overwritten with the new values and + * the matrix using 3x2 blocks, (4,3) stride and (2,4) count. + * Then four elements of the matrix are overwritten with the new values and * file is closed. Program reopens the file and reads and displays the result. - */ - + */ + #include #ifdef OLD_HEADER_FILENAME @@ -29,7 +29,7 @@ #include #endif #include "H5Cpp.h" - + #ifndef H5_NO_NAMESPACE using namespace H5; #endif @@ -42,7 +42,7 @@ const int MSPACE2_RANK = 1; // Rank of the second dataset in memory const int MSPACE2_DIM = 4; // Dataset size in memory const int FSPACE_RANK = 2; // Dataset rank as it is stored in the file const int FSPACE_DIM1 = 8; // Dimension sizes of the dataset as it is... -const int FSPACE_DIM2 = 12; // ...stored in the file +const int FSPACE_DIM2 = 12; // ...stored in the file const int MSPACE_DIM1 = 8; // We will read dataset back from the file... const int MSPACE_DIM2 = 12; // ...to the dataset in memory with these ... // ...dataspace parameters @@ -90,12 +90,12 @@ int main (void) /* * Create dataset and write it into the file. */ - DataSet* dataset = new DataSet( + DataSet* dataset = new DataSet( file->createDataSet( DATASET_NAME, PredType::NATIVE_INT, fspace )); dataset->write( matrix, PredType::NATIVE_INT ); /* - * Select hyperslab for the dataset in the file, using 3x2 blocks, + * Select hyperslab for the dataset in the file, using 3x2 blocks, * (4,3) stride and (2,4) count starting at the position (0,1). */ hsize_t start[2]; // Start of hyperslab @@ -104,20 +104,20 @@ int main (void) hsize_t block[2]; // Block sizes start[0] = 0; start[1] = 1; stride[0] = 4; stride[1] = 3; - count[0] = 2; count[1] = 4; + count[0] = 2; count[1] = 4; block[0] = 3; block[1] = 2; fspace.selectHyperslab( H5S_SELECT_SET, count, start, stride, block); /* * Create dataspace for the first dataset. */ - hsize_t dim1[] = {MSPACE1_DIM}; /* Dimension size of the first dataset - (in memory) */ + hsize_t dim1[] = {MSPACE1_DIM}; /* Dimension size of the first dataset + (in memory) */ DataSpace mspace1( MSPACE1_RANK, dim1 ); /* - * Select hyperslab. - * We will use 48 elements of the vector buffer starting at the + * Select hyperslab. + * We will use 48 elements of the vector buffer starting at the * second element. Selected elements are 1 2 3 . . . 48 */ start[0] = 1; @@ -125,12 +125,12 @@ int main (void) count[0] = 48; block[0] = 1; mspace1.selectHyperslab( H5S_SELECT_SET, count, start, stride, block); - + /* * Write selection from the vector buffer to the dataset in the file. * - * File dataset should look like this: - * 0 1 2 0 3 4 0 5 6 0 7 8 + * File dataset should look like this: + * 0 1 2 0 3 4 0 5 6 0 7 8 * 0 9 10 0 11 12 0 13 14 0 15 16 * 0 17 18 0 19 20 0 21 22 0 23 24 * 0 0 0 0 0 0 0 0 0 0 0 0 @@ -150,14 +150,14 @@ int main (void) * Create dataspace for the second dataset. */ hsize_t dim2[] = {MSPACE2_DIM}; /* Dimension size of the second dataset - (in memory */ + (in memory */ DataSpace mspace2( MSPACE2_RANK, dim2 ); /* * Select sequence of NPOINTS points in the file dataspace. */ - hsize_t coord[NPOINTS][FSPACE_RANK]; /* Array to store selected points - from the file dataspace */ + hsize_t coord[NPOINTS][FSPACE_RANK]; /* Array to store selected points + from the file dataspace */ coord[0][0] = 0; coord[0][1] = 0; coord[1][0] = 3; coord[1][1] = 3; coord[2][0] = 3; coord[2][1] = 5; @@ -169,11 +169,11 @@ int main (void) * Write new selection of points to the dataset. */ int values[] = {53, 59, 61, 67}; /* New values to be written */ - dataset->write( values, PredType::NATIVE_INT, mspace2, fspace ); + dataset->write( values, PredType::NATIVE_INT, mspace2, fspace ); /* - * File dataset should look like this: - * 53 1 2 0 3 4 0 5 6 0 7 8 + * File dataset should look like this: + * 53 1 2 0 3 4 0 5 6 0 7 8 * 0 9 10 0 11 12 0 13 14 0 15 16 * 0 17 18 0 19 20 0 21 22 0 23 24 * 0 0 0 59 0 61 0 0 0 0 0 0 @@ -181,7 +181,7 @@ int main (void) * 0 33 34 0 35 36 67 37 38 0 39 40 * 0 41 42 0 43 44 0 45 46 0 47 48 * 0 0 0 0 0 0 0 0 0 0 0 0 - * + * */ /* diff --git a/c++/src/H5AbstractDs.cpp b/c++/src/H5AbstractDs.cpp index 9e02181..e3bbd79 100644 --- a/c++/src/H5AbstractDs.cpp +++ b/c++/src/H5AbstractDs.cpp @@ -51,7 +51,7 @@ AbstractDs::AbstractDs( const AbstractDs& original ) : H5Object( original ) {} //-------------------------------------------------------------------------- // Function: AbstractDs::getTypeClass -///\brief Returns the class of the datatype that is used by this +///\brief Returns the class of the datatype that is used by this /// object, which can be a dataset or an attribute. ///\return Datatype class identifier ///\exception H5::DataTypeIException @@ -60,7 +60,7 @@ AbstractDs::AbstractDs( const AbstractDs& original ) : H5Object( original ) {} H5T_class_t AbstractDs::getTypeClass() const { // Gets the datatype used by this dataset or attribute. - // p_get_type calls either H5Dget_type or H5Aget_type depending on + // p_get_type calls either H5Dget_type or H5Aget_type depending on // which object invokes getTypeClass hid_t datatype_id; try { @@ -79,7 +79,7 @@ H5T_class_t AbstractDs::getTypeClass() const return( type_class ); else { - throw DataTypeIException(inMemFunc("getTypeClass"), + throw DataTypeIException(inMemFunc("getTypeClass"), "H5Tget_class returns H5T_NO_CLASS"); } } @@ -95,8 +95,8 @@ H5T_class_t AbstractDs::getTypeClass() const DataType AbstractDs::getDataType() const { // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getDataType. Then, create and + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getDataType. Then, create and // return the DataType object try { DataType datatype(p_get_type()); @@ -121,8 +121,8 @@ DataType AbstractDs::getDataType() const ArrayType AbstractDs::getArrayType() const { // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getArrayType. Then, create and + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getArrayType. Then, create and // return the ArrayType object try { ArrayType arraytype(p_get_type()); @@ -138,7 +138,7 @@ ArrayType AbstractDs::getArrayType() const //-------------------------------------------------------------------------- // Function: AbstractDs::getCompType -///\brief Returns the compound datatype of this abstract dataset which +///\brief Returns the compound datatype of this abstract dataset which /// can be a dataset or an attribute. ///\return CompType instance ///\exception H5::DataTypeIException @@ -147,8 +147,8 @@ ArrayType AbstractDs::getArrayType() const CompType AbstractDs::getCompType() const { // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getCompType. Then, create and + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getCompType. Then, create and // return the CompType object try { CompType comptype(p_get_type()); @@ -164,7 +164,7 @@ CompType AbstractDs::getCompType() const //-------------------------------------------------------------------------- // Function: AbstractDs::getEnumType -///\brief Returns the enumeration datatype of this abstract dataset which +///\brief Returns the enumeration datatype of this abstract dataset which /// can be a dataset or an attribute. ///\return EnumType instance ///\exception H5::DataTypeIException @@ -173,8 +173,8 @@ CompType AbstractDs::getCompType() const EnumType AbstractDs::getEnumType() const { // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getEnumType. Then, create and + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getEnumType. Then, create and // return the EnumType object try { EnumType enumtype(p_get_type()); @@ -190,7 +190,7 @@ EnumType AbstractDs::getEnumType() const //-------------------------------------------------------------------------- // Function: AbstractDs::getIntType -///\brief Returns the integer datatype of this abstract dataset which +///\brief Returns the integer datatype of this abstract dataset which /// can be a dataset or an attribute. ///\return IntType instance ///\exception H5::DataTypeIException @@ -199,8 +199,8 @@ EnumType AbstractDs::getEnumType() const IntType AbstractDs::getIntType() const { // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getIntType. Then, create and + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getIntType. Then, create and // return the IntType object try { IntType inttype(p_get_type()); @@ -225,8 +225,8 @@ IntType AbstractDs::getIntType() const FloatType AbstractDs::getFloatType() const { // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getFloatType. Then, create and + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getFloatType. Then, create and // return the FloatType object try { FloatType floatype(p_get_type()); @@ -242,7 +242,7 @@ FloatType AbstractDs::getFloatType() const //-------------------------------------------------------------------------- // Function: AbstractDs::getStrType -///\brief Returns the string datatype of this abstract dataset which +///\brief Returns the string datatype of this abstract dataset which /// can be a dataset or an attribute. ///\return StrType instance ///\exception H5::DataTypeIException @@ -251,8 +251,8 @@ FloatType AbstractDs::getFloatType() const StrType AbstractDs::getStrType() const { // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getStrType. Then, create and + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getStrType. Then, create and // return the StrType object try { StrType strtype(p_get_type()); @@ -277,8 +277,8 @@ StrType AbstractDs::getStrType() const VarLenType AbstractDs::getVarLenType() const { // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getVarLenType. Then, create and + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getVarLenType. Then, create and // return the VarLenType object try { VarLenType varlentype(p_get_type()); diff --git a/c++/src/H5AbstractDs.h b/c++/src/H5AbstractDs.h index 03b87ec..de086a3 100644 --- a/c++/src/H5AbstractDs.h +++ b/c++/src/H5AbstractDs.h @@ -35,9 +35,9 @@ class VarLenType; class H5_DLLCPP AbstractDs : public H5Object { public: // Gets a copy the datatype of that this abstract dataset uses. - // Note that this datatype is a generic one and can only be accessed - // via generic member functions, i.e., member functions belong - // to DataType. To get specific datatype, i.e. EnumType, FloatType, + // Note that this datatype is a generic one and can only be accessed + // via generic member functions, i.e., member functions belong + // to DataType. To get specific datatype, i.e. EnumType, FloatType, // etc..., use the specific functions, that follow, instead. DataType getDataType() const; @@ -53,11 +53,11 @@ class H5_DLLCPP AbstractDs : public H5Object { // Gets the dataspace of this abstract dataset - pure virtual. virtual DataSpace getSpace() const = 0; - // Gets the class of the datatype that is used by this abstract + // Gets the class of the datatype that is used by this abstract // dataset. H5T_class_t getTypeClass() const; - // Returns the amount of storage size required for this abstract + // Returns the amount of storage size required for this abstract // dataset - pure virtual. virtual hsize_t getStorageSize() const = 0; @@ -65,7 +65,7 @@ class H5_DLLCPP AbstractDs : public H5Object { AbstractDs( const AbstractDs& original ); // Destructor - virtual ~AbstractDs(); + virtual ~AbstractDs(); protected: // Default constructor diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp index 6366752..b23877c 100644 --- a/c++/src/H5ArrayType.cpp +++ b/c++/src/H5ArrayType.cpp @@ -33,11 +33,11 @@ namespace H5 { ///\brief Default constructor: Creates a stub ArrayType // Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- -ArrayType::ArrayType() : DataType() +ArrayType::ArrayType() : DataType() { // Initialize members rank = -1; - dimensions = NULL; + dimensions = NULL; } //-------------------------------------------------------------------------- @@ -47,7 +47,7 @@ ArrayType::ArrayType() : DataType() ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- -ArrayType::ArrayType( const hid_t existing_id ) : DataType( existing_id ) +ArrayType::ArrayType( const hid_t existing_id ) : DataType( existing_id ) { // Get the rank of the existing array and store it in this array rank = H5Tget_array_ndims(existing_id); @@ -71,17 +71,17 @@ ArrayType::ArrayType( const hid_t existing_id ) : DataType( existing_id ) ///\brief Copy constructor: makes a copy of the original ArrayType object. // Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- -ArrayType::ArrayType( const ArrayType& original ) : DataType( original ) +ArrayType::ArrayType( const ArrayType& original ) : DataType( original ) { rank = original.rank; dimensions = new hsize_t[rank]; for (int i = 0; i < rank; i++) - dimensions[i] = original.dimensions[i]; + dimensions[i] = original.dimensions[i]; } //-------------------------------------------------------------------------- // Function: ArrayType overloaded constructor -///\brief Creates a new array data type based on the specified +///\brief Creates a new array data type based on the specified /// \a base_type. ///\param base_type - IN: Existing datatype ///\param ndims - IN: Rank of the array, [0..H5S_MAX_RANK] @@ -100,7 +100,7 @@ ArrayType::ArrayType(const DataType& base_type, int ndims, const hsize_t* dims) rank = ndims; dimensions = new hsize_t[rank]; for (int i = 0; i < rank; i++) - dimensions[i] = dims[i]; + dimensions[i] = dims[i]; } //-------------------------------------------------------------------------- @@ -147,11 +147,11 @@ int ArrayType::getArrayDims(hsize_t* dims) rank = ndims; dimensions = new hsize_t[rank]; for (int i = 0; i < rank; i++) - dimensions[i] = dims[i]; + dimensions[i] = dims[i]; } // otherwise, simply copy what's in 'dimensions' to 'dims' for (int i = 0; i < rank; i++) - dims[i] = dimensions[i]; + dims[i] = dimensions[i]; return(rank); } @@ -160,7 +160,7 @@ int ArrayType::getArrayDims(hsize_t* dims) ///\brief Properly terminates access to this array datatype. // Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- -ArrayType::~ArrayType() +ArrayType::~ArrayType() { // Free allocated memory if (dimensions != NULL) diff --git a/c++/src/H5ArrayType.h b/c++/src/H5ArrayType.h index 023998d..faf738a 100644 --- a/c++/src/H5ArrayType.h +++ b/c++/src/H5ArrayType.h @@ -24,7 +24,7 @@ namespace H5 { #endif class H5_DLLCPP ArrayType : public DataType { public: - // Constructor that creates a new array data type based on the + // Constructor that creates a new array data type based on the // specified base type. ArrayType(const DataType& base_type, int ndims, const hsize_t* dims); diff --git a/c++/src/H5AtomType.cpp b/c++/src/H5AtomType.cpp index 56bb6eb..c58f2e7 100644 --- a/c++/src/H5AtomType.cpp +++ b/c++/src/H5AtomType.cpp @@ -55,7 +55,7 @@ AtomType::AtomType( const AtomType& original ) : DataType( original ) {} //-------------------------------------------------------------------------- // Function: AtomType::setSize -///\brief Sets the total size for an atomic datatype. +///\brief Sets the total size for an atomic datatype. ///\param size - IN: Size to set ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 @@ -88,7 +88,7 @@ H5T_order_t AtomType::getOrder() const // return a byte order constant if successful if( type_order == H5T_ORDER_ERROR ) { - throw DataTypeIException(inMemFunc("getOrder"), + throw DataTypeIException(inMemFunc("getOrder"), "H5Tget_order returns H5T_ORDER_ERROR"); } return( type_order ); @@ -148,12 +148,12 @@ void AtomType::setOrder( H5T_order_t order ) const //-------------------------------------------------------------------------- // Function: AtomType::getPrecision -///\brief Returns the precision of an atomic datatype. -///\return Number of significant bits +///\brief Returns the precision of an atomic datatype. +///\return Number of significant bits ///\exception H5::DataTypeIException ///\par Description -/// The precision is the number of significant bits which, -/// unless padding is present, is 8 times larger than the +/// The precision is the number of significant bits which, +/// unless padding is present, is 8 times larger than the /// value returned by \c DataType::getSize(). // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -172,7 +172,7 @@ size_t AtomType::getPrecision() const //-------------------------------------------------------------------------- // Function: AtomType::setPrecision -///\brief Sets the precision of an atomic datatype. +///\brief Sets the precision of an atomic datatype. ///\param precision - IN: Number of bits of precision ///\exception H5::DataTypeIException ///\par Description @@ -192,7 +192,7 @@ void AtomType::setPrecision( size_t precision ) const //-------------------------------------------------------------------------- // Function: AtomType::getOffset -///\brief Retrieves the bit offset of the first significant bit. +///\brief Retrieves the bit offset of the first significant bit. ///\return Offset value ///\exception H5::DataTypeIException ///\par Description @@ -219,7 +219,7 @@ int AtomType::getOffset() const //-------------------------------------------------------------------------- // Function: AtomType::setOffset -///\brief Sets the bit offset of the first significant bit. +///\brief Sets the bit offset of the first significant bit. ///\param offset - IN: Offset of first significant bit ///\exception H5::DataTypeIException ///\par Description @@ -239,16 +239,16 @@ void AtomType::setOffset( size_t offset ) const //-------------------------------------------------------------------------- // Function: AtomType::getPad -///\brief Retrieves the padding type of the least and most-significant -/// bit padding. +///\brief Retrieves the padding type of the least and most-significant +/// bit padding. ///\param lsb - OUT: Least-significant bit padding type ///\param msb - OUT: Most-significant bit padding type ///\exception H5::DataTypeIException ///\par Description /// Possible values for \a lsb and \a msb include: -/// \li \c H5T_PAD_ZERO (0) - Set background to zeros. -/// \li \c H5T_PAD_ONE (1) - Set background to ones. -/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone. +/// \li \c H5T_PAD_ZERO (0) - Set background to zeros. +/// \li \c H5T_PAD_ONE (1) - Set background to ones. +/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void AtomType::getPad( H5T_pad_t& lsb, H5T_pad_t& msb ) const @@ -269,9 +269,9 @@ void AtomType::getPad( H5T_pad_t& lsb, H5T_pad_t& msb ) const ///\exception H5::DataTypeIException ///\par Description /// Valid values for \a lsb and \a msb include: -/// \li \c H5T_PAD_ZERO (0) - Set background to zeros. -/// \li \c H5T_PAD_ONE (1) - Set background to ones. -/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone. +/// \li \c H5T_PAD_ZERO (0) - Set background to zeros. +/// \li \c H5T_PAD_ONE (1) - Set background to ones. +/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void AtomType::setPad( H5T_pad_t lsb, H5T_pad_t msb ) const diff --git a/c++/src/H5AtomType.h b/c++/src/H5AtomType.h index 9cca02c..b9a583c 100644 --- a/c++/src/H5AtomType.h +++ b/c++/src/H5AtomType.h @@ -26,33 +26,33 @@ namespace H5 { #endif class H5_DLLCPP AtomType : public DataType { public: - // Returns the byte order of an atomic datatype. + // Returns the byte order of an atomic datatype. H5T_order_t getOrder( string& order_string ) const; H5T_order_t getOrder() const; - // Sets the byte ordering of an atomic datatype. + // Sets the byte ordering of an atomic datatype. void setOrder( H5T_order_t order ) const; - // Retrieves the bit offset of the first significant bit. + // Retrieves the bit offset of the first significant bit. // 12/05/00 - changed return type to int from size_t - C API int getOffset() const; - // Sets the bit offset of the first significant bit. + // Sets the bit offset of the first significant bit. void setOffset( size_t offset ) const; - // Retrieves the padding type of the least and most-significant bit padding. + // Retrieves the padding type of the least and most-significant bit padding. void getPad( H5T_pad_t& lsb, H5T_pad_t& msb ) const; // Sets the least and most-significant bits padding types void setPad( H5T_pad_t lsb, H5T_pad_t msb ) const; - // Returns the precision of an atomic datatype. + // Returns the precision of an atomic datatype. size_t getPrecision() const; - // Sets the precision of an atomic datatype. + // Sets the precision of an atomic datatype. void setPrecision( size_t precision ) const; - // Sets the total size for an atomic datatype. + // Sets the total size for an atomic datatype. void setSize( size_t size ) const; // Returns this class name diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index ccfdd4c..9a177b9 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -52,7 +52,7 @@ Attribute::Attribute( const Attribute& original ) : AbstractDs( original ) {} //-------------------------------------------------------------------------- // Function: Attribute overloaded constructor -///\brief Creates an Attribute object using the id of an existing +///\brief Creates an Attribute object using the id of an existing /// attribute. ///\param existing_id - IN: Id of an existing attribute ///\exception H5::AttributeIException @@ -203,7 +203,7 @@ ssize_t Attribute::getName( size_t buf_size, string& attr_name ) const { throw AttributeIException("Attribute::getName", "H5Aget_name failed"); } - // otherwise, convert the C attribute name and return + // otherwise, convert the C attribute name and return attr_name = name_C; delete []name_C; return( name_size ); @@ -212,7 +212,7 @@ ssize_t Attribute::getName( size_t buf_size, string& attr_name ) const //-------------------------------------------------------------------------- // Function: Attribute::getName ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it returns the +/// It differs from the above function in that it returns the /// attribute's name, not the length. ///\return Name of the attribute ///\param buf_size - IN: Desired length of the name @@ -223,7 +223,7 @@ string Attribute::getName( size_t buf_size ) const { string attr_name; ssize_t name_size = getName( buf_size, attr_name ); - return( attr_name ); + return( attr_name ); // let caller catch exception if any } @@ -238,8 +238,8 @@ string Attribute::getName( size_t buf_size ) const //-------------------------------------------------------------------------- string Attribute::getName() const { - // Try with 256 characters for the name first, if the name's length - // returned is more than that then, read the name again with the + // Try with 256 characters for the name first, if the name's length + // returned is more than that then, read the name again with the // appropriate space allocation char* name_C = new char[256]; // temporary C-string for C API ssize_t name_size = H5Aget_name(id, 255, name_C); @@ -248,12 +248,12 @@ string Attribute::getName() const if (name_size >= 256) name_size = getName(name_size, attr_name); - // otherwise, convert the C attribute name and return + // otherwise, convert the C attribute name and return else attr_name = name_C; delete []name_C; - return( attr_name ); + return( attr_name ); } //-------------------------------------------------------------------------- diff --git a/c++/src/H5Attribute.h b/c++/src/H5Attribute.h index 73a5612..9eeab98 100644 --- a/c++/src/H5Attribute.h +++ b/c++/src/H5Attribute.h @@ -57,9 +57,9 @@ class H5_DLLCPP Attribute : public AbstractDs { virtual ~Attribute(); private: - // This function contains the common code that is used by - // getTypeClass and various API functions getXxxType - // defined in AbstractDs for generic datatype and specific + // This function contains the common code that is used by + // getTypeClass and various API functions getXxxType + // defined in AbstractDs for generic datatype and specific // sub-types virtual hid_t p_get_type() const; diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index 767286e..de46889 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -50,10 +50,10 @@ namespace H5 { //-------------------------------------------------------------------------- // Function: CommonFG::createGroup -///\brief Creates a new group at this location which can be a file +///\brief Creates a new group at this location which can be a file /// or another group. ///\param name - IN: Name of the group to create -///\param size_hint - IN: Indicates the number of bytes to reserve for +///\param size_hint - IN: Indicates the number of bytes to reserve for /// the names that will appear in the group ///\return Group instance ///\exception H5::GroupIException @@ -66,7 +66,7 @@ namespace H5 { //-------------------------------------------------------------------------- Group CommonFG::createGroup( const char* name, size_t size_hint ) const { - // Call C routine H5Gcreate to create the named group, giving the + // Call C routine H5Gcreate to create the named group, giving the // location id which can be a file id or a group id hid_t group_id = H5Gcreate( getLocId(), name, size_hint ); @@ -84,7 +84,7 @@ Group CommonFG::createGroup( const char* name, size_t size_hint ) const //-------------------------------------------------------------------------- // Function: CommonFG::createGroup ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -95,7 +95,7 @@ Group CommonFG::createGroup( const string& name, size_t size_hint ) const //-------------------------------------------------------------------------- // Function: CommonFG::openGroup -///\brief Opens an existing group in a location which can be a file +///\brief Opens an existing group in a location which can be a file /// or another group. ///\param name - IN: Name of the group to open ///\return Group instance @@ -104,11 +104,11 @@ Group CommonFG::createGroup( const string& name, size_t size_hint ) const //-------------------------------------------------------------------------- Group CommonFG::openGroup( const char* name ) const { - // Call C routine H5Gopen to open the named group, giving the + // Call C routine H5Gopen to open the named group, giving the // location id which can be a file id or a group id hid_t group_id = H5Gopen( getLocId(), name ); - // If the opening of the group failed, throw an exception + // If the opening of the group failed, throw an exception if( group_id < 0 ) { throwException("openGroup", "H5Gopen failed"); @@ -122,7 +122,7 @@ Group CommonFG::openGroup( const char* name ) const //-------------------------------------------------------------------------- // Function: CommonFG::openGroup ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -152,7 +152,7 @@ DataSet CommonFG::createDataSet( const char* name, const DataType& data_type, co // Call C routine H5Dcreate to create the named dataset hid_t dataset_id = H5Dcreate( getLocId(), name, type_id, space_id, create_plist_id ); - // If the creation of the dataset failed, throw an exception + // If the creation of the dataset failed, throw an exception if( dataset_id < 0 ) { throwException("createDataSet", "H5Dcreate failed"); @@ -166,7 +166,7 @@ DataSet CommonFG::createDataSet( const char* name, const DataType& data_type, co //-------------------------------------------------------------------------- // Function: CommonFG::createDataSet ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -186,7 +186,7 @@ DataSet CommonFG::createDataSet( const string& name, const DataType& data_type, DataSet CommonFG::openDataSet( const char* name ) const { // Call C function H5Dopen to open the specified dataset, giving - // the location id and the dataset's name + // the location id and the dataset's name hid_t dataset_id = H5Dopen( getLocId(), name ); // If the dataset's opening failed, throw an exception @@ -203,7 +203,7 @@ DataSet CommonFG::openDataSet( const char* name ) const //-------------------------------------------------------------------------- // Function: CommonFG::openDataSet ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -214,17 +214,17 @@ DataSet CommonFG::openDataSet( const string& name ) const //-------------------------------------------------------------------------- // Function: CommonFG::link -///\brief Creates a link of the specified type from \a new_name to +///\brief Creates a link of the specified type from \a new_name to /// \a curr_name. -///\param link_type - IN: Link type; possible values are +///\param link_type - IN: Link type; possible values are /// \li \c H5G_LINK_HARD /// \li \c H5G_LINK_SOFT -///\param curr_name - IN: Name of the existing object if link is a hard +///\param curr_name - IN: Name of the existing object if link is a hard /// link; can be anything for the soft link ///\param new_name - IN: New name for the object ///\exception H5::FileIException or H5::GroupIException ///\par Description -/// Note that both names are interpreted relative to the +/// Note that both names are interpreted relative to the /// specified location. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -240,7 +240,7 @@ void CommonFG::link( H5G_link_t link_type, const char* curr_name, const char* ne //-------------------------------------------------------------------------- // Function: CommonFG::link ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a curr_name and \a new_name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -268,7 +268,7 @@ void CommonFG::unlink( const char* name ) const //-------------------------------------------------------------------------- // Function: CommonFG::unlink ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -284,7 +284,7 @@ void CommonFG::unlink( const string& name ) const ///\param dst - IN: Object's new name ///\exception H5::FileIException or H5::GroupIException ///\note -/// Exercise care in moving groups as it is possible to render +/// Exercise care in moving groups as it is possible to render /// data in a file inaccessible with Group::move. Please refer /// to the Group Interface in the HDF5 User's Guide at: /// http://hdf.ncsa.uiuc.edu/HDF5/doc/Groups.html @@ -302,7 +302,7 @@ void CommonFG::move( const char* src, const char* dst ) const //-------------------------------------------------------------------------- // Function: CommonFG::move ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a src and \a dst. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -336,7 +336,7 @@ void CommonFG::getObjinfo( const char* name, hbool_t follow_link, H5G_stat_t& st //-------------------------------------------------------------------------- // Function: CommonFG::getObjinfo ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -348,7 +348,7 @@ void CommonFG::getObjinfo( const string& name, hbool_t follow_link, H5G_stat_t& //-------------------------------------------------------------------------- // Function: CommonFG::getLinkval ///\brief Returns the name of the object that the symbolic link points to. -///\param name - IN: Symbolic link to the object +///\param name - IN: Symbolic link to the object ///\param size - IN: Maximum number of characters of value to be returned ///\return Name of the object ///\exception H5::FileIException or H5::GroupIException @@ -371,7 +371,7 @@ string CommonFG::getLinkval( const char* name, size_t size ) const //-------------------------------------------------------------------------- // Function: CommonFG::getLinkval ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -387,11 +387,11 @@ string CommonFG::getLinkval( const string& name, size_t size ) const ///\param comment - IN: New comment ///\exception H5::FileIException or H5::GroupIException ///\par Description -/// If \a comment is an empty string or a null pointer, the comment -/// message is removed from the object. -/// Comments should be relatively short, null-terminated, ASCII -/// strings. They can be attached to any object that has an -/// object header, e.g., data sets, groups, named data types, +/// If \a comment is an empty string or a null pointer, the comment +/// message is removed from the object. +/// Comments should be relatively short, null-terminated, ASCII +/// strings. They can be attached to any object that has an +/// object header, e.g., data sets, groups, named data types, /// and data spaces, but not symbolic links. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -407,7 +407,7 @@ void CommonFG::setComment( const char* name, const char* comment ) const //-------------------------------------------------------------------------- // Function: CommonFG::setComment ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name and \a comment. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -495,7 +495,7 @@ string CommonFG::getComment (const string& name) const string CommonFG::getComment( const char* name, size_t bufsize ) const { // temporary C-string for the object's comment - char* comment_C = new char[bufsize+1]; + char* comment_C = new char[bufsize+1]; herr_t ret_value = H5Gget_comment( getLocId(), name, bufsize, comment_C ); @@ -512,7 +512,7 @@ string CommonFG::getComment( const char* name, size_t bufsize ) const //-------------------------------------------------------------------------- // Function: CommonFG::getComment ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -549,7 +549,7 @@ void CommonFG::mount( const char* name, H5File& child, PropList& plist ) const //-------------------------------------------------------------------------- // Function: CommonFG::mount ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -580,7 +580,7 @@ void CommonFG::unmount( const char* name ) const //-------------------------------------------------------------------------- // Function: CommonFG::unmount ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -600,14 +600,14 @@ void CommonFG::unmount( const string& name ) const DataType CommonFG::openDataType( const char* name ) const { // Call C function H5Topen to open the named datatype in this group, - // given either the file or group id + // given either the file or group id hid_t type_id = H5Topen(getLocId(), name); - + // If the datatype's opening failed, throw an exception - if( type_id < 0 ) - { + if( type_id < 0 ) + { throwException("openDataType", "H5Topen failed"); - } + } // No failure, create and return the DataType object DataType data_type(type_id); return(data_type); @@ -616,7 +616,7 @@ DataType CommonFG::openDataType( const char* name ) const //-------------------------------------------------------------------------- // Function: CommonFG::openDataType ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -636,14 +636,14 @@ DataType CommonFG::openDataType( const string& name ) const ArrayType CommonFG::openArrayType( const char* name ) const { // Call C function H5Topen to open the named datatype in this group, - // given either the file or group id + // given either the file or group id hid_t type_id = H5Topen(getLocId(), name); - + // If the datatype's opening failed, throw an exception - if( type_id < 0 ) - { + if( type_id < 0 ) + { throwException("openArrayType", "H5Topen failed"); - } + } // No failure, create and return the ArrayType object ArrayType array_type (type_id); return(array_type); @@ -672,14 +672,14 @@ ArrayType CommonFG::openArrayType( const string& name ) const CompType CommonFG::openCompType( const char* name ) const { // Call C function H5Topen to open the named datatype in this group, - // given either the file or group id + // given either the file or group id hid_t type_id = H5Topen(getLocId(), name); - + // If the datatype's opening failed, throw an exception - if( type_id < 0 ) - { + if( type_id < 0 ) + { throwException("openCompType", "H5Topen failed"); - } + } // No failure, create and return the CompType object CompType comp_type(type_id); return(comp_type); @@ -688,7 +688,7 @@ CompType CommonFG::openCompType( const char* name ) const //-------------------------------------------------------------------------- // Function: CommonFG::openCompType ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -708,30 +708,30 @@ CompType CommonFG::openCompType( const string& name ) const EnumType CommonFG::openEnumType( const char* name ) const { // Call C function H5Topen to open the named datatype in this group, - // given either the file or group id + // given either the file or group id hid_t type_id = H5Topen(getLocId(), name); - + // If the datatype's opening failed, throw an exception - if( type_id < 0 ) - { + if( type_id < 0 ) + { throwException("openEnumType", "H5Topen failed"); - } + } // No failure, create and return the EnumType object EnumType enum_type(type_id); return(enum_type); -} +} //-------------------------------------------------------------------------- // Function: CommonFG::openEnumType ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- EnumType CommonFG::openEnumType( const string& name ) const { return( openEnumType( name.c_str()) ); -} +} //-------------------------------------------------------------------------- // Function: CommonFG::openIntType @@ -742,16 +742,16 @@ EnumType CommonFG::openEnumType( const string& name ) const // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IntType CommonFG::openIntType( const char* name ) const -{ +{ // Call C function H5Topen to open the named datatype in this group, - // given either the file or group id + // given either the file or group id hid_t type_id = H5Topen(getLocId(), name); - + // If the datatype's opening failed, throw an exception - if( type_id < 0 ) - { + if( type_id < 0 ) + { throwException("openIntType", "H5Topen failed"); - } + } // No failure, create and return the IntType object IntType int_type(type_id); return(int_type); @@ -760,12 +760,12 @@ IntType CommonFG::openIntType( const char* name ) const //-------------------------------------------------------------------------- // Function: CommonFG::openIntType ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IntType CommonFG::openIntType( const string& name ) const -{ +{ return( openIntType( name.c_str()) ); } @@ -778,16 +778,16 @@ IntType CommonFG::openIntType( const string& name ) const // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FloatType CommonFG::openFloatType( const char* name ) const -{ +{ // Call C function H5Topen to open the named datatype in this group, - // given either the file or group id + // given either the file or group id hid_t type_id = H5Topen(getLocId(), name); - + // If the datatype's opening failed, throw an exception - if( type_id < 0 ) - { + if( type_id < 0 ) + { throwException("openFloatType", "H5Topen failed"); - } + } // No failure, create and return the FloatType object FloatType float_type(type_id); return(float_type); @@ -796,12 +796,12 @@ FloatType CommonFG::openFloatType( const char* name ) const //-------------------------------------------------------------------------- // Function: CommonFG::openFloatType ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FloatType CommonFG::openFloatType( const string& name ) const -{ +{ return( openFloatType( name.c_str()) ); } @@ -816,14 +816,14 @@ FloatType CommonFG::openFloatType( const string& name ) const StrType CommonFG::openStrType( const char* name ) const { // Call C function H5Topen to open the named datatype in this group, - // given either the file or group id + // given either the file or group id hid_t type_id = H5Topen(getLocId(), name); - + // If the datatype's opening failed, throw an exception - if( type_id < 0 ) - { + if( type_id < 0 ) + { throwException("openStrType", "H5Topen failed"); - } + } // No failure, create and return the StrType object StrType str_type(type_id); return(str_type); @@ -832,7 +832,7 @@ StrType CommonFG::openStrType( const char* name ) const //-------------------------------------------------------------------------- // Function: CommonFG::openStrType ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -852,14 +852,14 @@ StrType CommonFG::openStrType( const string& name ) const VarLenType CommonFG::openVarLenType( const char* name ) const { // Call C function H5Topen to open the named datatype in this group, - // given either the file or group id + // given either the file or group id hid_t type_id = H5Topen(getLocId(), name); - + // If the datatype's opening failed, throw an exception - if( type_id < 0 ) - { + if( type_id < 0 ) + { throwException("openVarLenType", "H5Topen failed"); - } + } // No failure, create and return the VarLenType object VarLenType varlen_type(type_id); return(varlen_type); @@ -884,8 +884,8 @@ VarLenType CommonFG::openVarLenType( const string& name ) const ///\param idx - IN/OUT: Starting (IN) and ending (OUT) entry indices ///\param op - IN : User's function to operate on each entry ///\param op_data - IN/OUT: Data associated with the operation -///\return The return value of the first operator that returns non-zero, -/// or zero if all members were processed with no operator +///\return The return value of the first operator that returns non-zero, +/// or zero if all members were processed with no operator /// returning non-zero. ///\exception H5::FileIException or H5::GroupIException // Programmer Binh-Minh Ribler - 2000 @@ -903,7 +903,7 @@ int CommonFG::iterateElems( const char* name, int *idx, H5G_iterate_t op , void* //-------------------------------------------------------------------------- // Function: CommonFG::iterateElems ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- diff --git a/c++/src/H5CommonFG.h b/c++/src/H5CommonFG.h index 0bb8e67..c2934b1 100644 --- a/c++/src/H5CommonFG.h +++ b/c++/src/H5CommonFG.h @@ -30,12 +30,12 @@ class ArrayType; class VarLenType; class H5_DLLCPP CommonFG { public: - // Creates a new group at this location which can be a file + // Creates a new group at this location which can be a file // or another group. Group createGroup(const char* name, size_t size_hint = 0) const; Group createGroup(const string& name, size_t size_hint = 0) const; - // Opens an existing group in a location which can be a file + // Opens an existing group in a location which can be a file // or another group. Group openGroup(const char* name) const; Group openGroup(const string& name) const; @@ -68,7 +68,7 @@ class H5_DLLCPP CommonFG { // Returns the number of objects in this group. hsize_t getNumObjs() const; - // Returns information about an HDF5 object, given by its name, + // Returns information about an HDF5 object, given by its name, // at this location. void getObjinfo(const char* name, hbool_t follow_link, H5G_stat_t& statbuf) const; void getObjinfo(const string& name, hbool_t follow_link, H5G_stat_t& statbuf) const; @@ -142,9 +142,9 @@ class H5_DLLCPP CommonFG { VarLenType openVarLenType(const string& name) const; #ifndef DOXYGEN_SHOULD_SKIP_THIS - /// For subclasses, H5File and Group, to return the correct + /// For subclasses, H5File and Group, to return the correct /// object id, i.e. file or group id. - virtual hid_t getLocId() const = 0; + virtual hid_t getLocId() const = 0; #endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp index aed4b58..9990087 100644 --- a/c++/src/H5CompType.cpp +++ b/c++/src/H5CompType.cpp @@ -89,7 +89,7 @@ CompType::CompType( const DataSet& dataset ) : DataType() //-------------------------------------------------------------------------- // Function: CompType::getNmembers -///\brief Returns the number of members in this compound datatype. +///\brief Returns the number of members in this compound datatype. ///\return Number of members ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 @@ -99,7 +99,7 @@ int CompType::getNmembers() const int num_members = H5Tget_nmembers( id ); if( num_members < 0 ) { - throw DataTypeIException("CompType::getNmembers", + throw DataTypeIException("CompType::getNmembers", "H5Tget_nmembers returns negative number of members"); } return( num_members ); @@ -107,7 +107,7 @@ int CompType::getNmembers() const //-------------------------------------------------------------------------- // Function: CompType::getMemberName -///\brief Returns the name of a member in this compound datatype. +///\brief Returns the name of a member in this compound datatype. ///\param member_num - IN: Zero-based index of the member ///\return Name of member ///\exception H5::DataTypeIException @@ -118,23 +118,23 @@ string CompType::getMemberName( unsigned member_num ) const char* member_name_C = H5Tget_member_name( id, member_num ); if( member_name_C == NULL ) // NULL means failure { - throw DataTypeIException("CompType::getMemberName", + throw DataTypeIException("CompType::getMemberName", "H5Tget_member_name returns NULL for member name"); } - string member_name = string(member_name_C); // convert C string to string - HDfree(member_name_C); // free the C string + string member_name = string(member_name_C); // convert C string to string + HDfree(member_name_C); // free the C string return( member_name ); // return the member name string } //-------------------------------------------------------------------------- // Function: CompType::getMemberIndex -///\brief Returns the index of a member in this compound datatype. +///\brief Returns the index of a member in this compound datatype. ///\param name - IN: Name of the member ///\return Index of member ///\exception H5::DataTypeIException ///\par Description -/// Members are stored in no particular order with numbers 0 -/// through N-1, where N is the value returned by the member +/// Members are stored in no particular order with numbers 0 +/// through N-1, where N is the value returned by the member /// function \c CompType::getNmembers. // Programmer Binh-Minh Ribler - May 16, 2002 //-------------------------------------------------------------------------- @@ -143,7 +143,7 @@ int CompType::getMemberIndex(const char* name) const int member_index = H5Tget_member_index(id, name); if( member_index < 0 ) { - throw DataTypeIException("CompType::getMemberIndex", + throw DataTypeIException("CompType::getMemberIndex", "H5Tget_member_index returns negative value"); } return( member_index ); @@ -162,8 +162,8 @@ int CompType::getMemberIndex(const string& name) const ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 // Description -/// Members are stored in no particular order with numbers 0 -/// through N-1, where N is the value returned by the member +/// Members are stored in no particular order with numbers 0 +/// through N-1, where N is the value returned by the member /// function \c CompType::getNmembers. // // Note that byte offset being returned as 0 doesn't indicate @@ -175,11 +175,11 @@ size_t CompType::getMemberOffset( unsigned member_num ) const return( offset ); } -// Returns the dimensionality of the member. +// Returns the dimensionality of the member. int CompType::getMemberDims( unsigned member_num, size_t* dims, int* perm ) const { throw DataTypeIException( "Error: getMemberDims is no longer supported." ); - return (-1); // unreachable statement; but without it, the compiler + return (-1); // unreachable statement; but without it, the compiler // will complain } @@ -204,7 +204,7 @@ H5T_class_t CompType::getMemberClass( unsigned member_num ) const return(member_class); } -// This private member function calls the C API to get the identifier +// This private member function calls the C API to get the identifier // of the specified member. It provides the id to construct appropriate // sub-types in the functions getMemberXxxType below, where Xxx indicates // the sub-types. @@ -224,8 +224,8 @@ hid_t CompType::p_get_member_type(unsigned member_num) const //-------------------------------------------------------------------------- // Function: CompType::getMemberDataType -///\brief Returns the generic datatype of the specified member in this -/// compound datatype. +///\brief Returns the generic datatype of the specified member in this +/// compound datatype. ///\param member_num - IN: Zero-based index of the member ///\return DataType instance ///\exception H5::DataTypeIException @@ -234,7 +234,7 @@ hid_t CompType::p_get_member_type(unsigned member_num) const DataType CompType::getMemberDataType( unsigned member_num ) const { try { - DataType datatype(p_get_member_type(member_num)); + DataType datatype(p_get_member_type(member_num)); return(datatype); } catch (DataTypeIException E) { @@ -264,8 +264,8 @@ ArrayType CompType::getMemberArrayType( unsigned member_num ) const //-------------------------------------------------------------------------- // Function: CompType::getMemberEnumType -///\brief Returns the enumeration datatype of the specified member in -/// this compound datatype. +///\brief Returns the enumeration datatype of the specified member in +/// this compound datatype. ///\param member_num - IN: Zero-based index of the member ///\return EnumType instance ///\exception H5::DataTypeIException @@ -274,7 +274,7 @@ ArrayType CompType::getMemberArrayType( unsigned member_num ) const EnumType CompType::getMemberEnumType( unsigned member_num ) const { try { - EnumType enumtype(p_get_member_type(member_num)); + EnumType enumtype(p_get_member_type(member_num)); return(enumtype); } catch (DataTypeIException E) { @@ -284,8 +284,8 @@ EnumType CompType::getMemberEnumType( unsigned member_num ) const //-------------------------------------------------------------------------- // Function: CompType::getMemberCompType -///\brief Returns the compound datatype of the specified member in this -/// compound datatype. +///\brief Returns the compound datatype of the specified member in this +/// compound datatype. ///\param member_num - IN: Zero-based index of the member ///\return CompType instance ///\exception H5::DataTypeIException @@ -294,7 +294,7 @@ EnumType CompType::getMemberEnumType( unsigned member_num ) const CompType CompType::getMemberCompType( unsigned member_num ) const { try { - CompType comptype(p_get_member_type(member_num)); + CompType comptype(p_get_member_type(member_num)); return(comptype); } catch (DataTypeIException E) { @@ -304,8 +304,8 @@ CompType CompType::getMemberCompType( unsigned member_num ) const //-------------------------------------------------------------------------- // Function: CompType::getMemberIntType -///\brief Returns the integer datatype of the specified member in this -/// compound datatype. +///\brief Returns the integer datatype of the specified member in this +/// compound datatype. ///\param member_num - IN: Zero-based index of the member ///\return IntType instance ///\exception H5::DataTypeIException @@ -314,7 +314,7 @@ CompType CompType::getMemberCompType( unsigned member_num ) const IntType CompType::getMemberIntType( unsigned member_num ) const { try { - IntType inttype(p_get_member_type(member_num)); + IntType inttype(p_get_member_type(member_num)); return(inttype); } catch (DataTypeIException E) { @@ -324,8 +324,8 @@ IntType CompType::getMemberIntType( unsigned member_num ) const //-------------------------------------------------------------------------- // Function: CompType::getMemberFloatType -///\brief Returns the floating-point datatype of the specified member -/// in this compound datatype. +///\brief Returns the floating-point datatype of the specified member +/// in this compound datatype. ///\param member_num - IN: Zero-based index of the member ///\return FloatType instance ///\exception H5::DataTypeIException @@ -334,7 +334,7 @@ IntType CompType::getMemberIntType( unsigned member_num ) const FloatType CompType::getMemberFloatType( unsigned member_num ) const { try { - FloatType floatype(p_get_member_type(member_num)); + FloatType floatype(p_get_member_type(member_num)); return(floatype); } catch (DataTypeIException E) { @@ -344,8 +344,8 @@ FloatType CompType::getMemberFloatType( unsigned member_num ) const //-------------------------------------------------------------------------- // Function: CompType::getMemberStrType -///\brief Returns the string datatype of the specified member in this -/// compound datatype. +///\brief Returns the string datatype of the specified member in this +/// compound datatype. ///\param member_num - IN: Zero-based index of the member ///\return StrType instance ///\exception H5::DataTypeIException @@ -354,13 +354,13 @@ FloatType CompType::getMemberFloatType( unsigned member_num ) const StrType CompType::getMemberStrType( unsigned member_num ) const { try { - StrType strtype(p_get_member_type(member_num)); + StrType strtype(p_get_member_type(member_num)); return(strtype); } catch (DataTypeIException E) { throw DataTypeIException("CompType::getMemberStrType", E.getDetailMsg()); } -} +} //-------------------------------------------------------------------------- // Function: CompType::getMemberVarLenType @@ -382,35 +382,35 @@ VarLenType CompType::getMemberVarLenType( unsigned member_num ) const } } -/* old style of getMemberType - using overloads; new style above +/* old style of getMemberType - using overloads; new style above returns the appropriate datatypes but has different named functions. In the old style, a datatype must be passed into the function. May, 2004: These should be reconsidered to provide more convenience. -// Returns the datatype of the specified member in this compound datatype. +// Returns the datatype of the specified member in this compound datatype. // Several overloading of getMemberType are for different datatypes void CompType::getMemberType( unsigned member_num, EnumType& enumtype ) const { - p_get_member_type(member_num, enumtype); + p_get_member_type(member_num, enumtype); } void CompType::getMemberType( unsigned member_num, CompType& comptype ) const { - p_get_member_type(member_num, comptype); + p_get_member_type(member_num, comptype); } void CompType::getMemberType( unsigned member_num, IntType& inttype ) const { - p_get_member_type(member_num, inttype); + p_get_member_type(member_num, inttype); } void CompType::getMemberType( unsigned member_num, FloatType& floatype ) const { - p_get_member_type(member_num, floatype); + p_get_member_type(member_num, floatype); } void CompType::getMemberType( unsigned member_num, StrType& strtype ) const { - p_get_member_type(member_num, strtype); + p_get_member_type(member_num, strtype); } // end of overloading of getMemberType */ @@ -442,7 +442,7 @@ void CompType::insertMember( const string& name, size_t offset, const DataType& //-------------------------------------------------------------------------- // Function: CompType::pack -///\brief Recursively removes padding from within a compound datatype. +///\brief Recursively removes padding from within a compound datatype. /// ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 diff --git a/c++/src/H5CompType.h b/c++/src/H5CompType.h index d548043..401ed6b 100644 --- a/c++/src/H5CompType.h +++ b/c++/src/H5CompType.h @@ -36,58 +36,58 @@ class H5_DLLCPP CompType : public DataType { // to create another datatype of the same class H5T_class_t getMemberClass( unsigned member_num ) const; - // Returns the dimensionality of the specified member. + // Returns the dimensionality of the specified member. int getMemberDims( unsigned member_num, size_t* dims, int* perm ) const; // Returns the index of a member in this compound data type. int getMemberIndex(const char* name) const; int getMemberIndex(const string& name) const; - // Returns the offset of a member of this compound datatype. + // Returns the offset of a member of this compound datatype. size_t getMemberOffset( unsigned memb_no ) const; - // Returns the name of a member of this compound datatype. + // Returns the name of a member of this compound datatype. string getMemberName( unsigned member_num ) const; - // Returns the generic datatype of the specified member in + // Returns the generic datatype of the specified member in // this compound datatype. DataType getMemberDataType( unsigned member_num ) const; - // Returns the array datatype of the specified member in + // Returns the array datatype of the specified member in // this compound datatype. ArrayType getMemberArrayType( unsigned member_num ) const; - // Returns the compound datatype of the specified member in + // Returns the compound datatype of the specified member in // this compound datatype. CompType getMemberCompType( unsigned member_num ) const; - // Returns the enumeration datatype of the specified member in + // Returns the enumeration datatype of the specified member in // this compound datatype. EnumType getMemberEnumType( unsigned member_num ) const; - // Returns the integer datatype of the specified member in + // Returns the integer datatype of the specified member in // this compound datatype. IntType getMemberIntType( unsigned member_num ) const; - // Returns the floating-point datatype of the specified member in + // Returns the floating-point datatype of the specified member in // this compound datatype. FloatType getMemberFloatType( unsigned member_num ) const; - // Returns the string datatype of the specified member in + // Returns the string datatype of the specified member in // this compound datatype. StrType getMemberStrType( unsigned member_num ) const; - // Returns the variable length datatype of the specified member in + // Returns the variable length datatype of the specified member in // this compound datatype. VarLenType getMemberVarLenType( unsigned member_num ) const; - // Returns the number of members in this compound datatype. + // Returns the number of members in this compound datatype. int getNmembers() const; // Adds a new member to this compound datatype. void insertMember( const string& name, size_t offset, const DataType& new_member ) const; - // Recursively removes padding from within this compound datatype. + // Recursively removes padding from within this compound datatype. void pack() const; // Returns this class name @@ -108,7 +108,7 @@ class H5_DLLCPP CompType : public DataType { private: // Contains common code that is used by the member functions // getMemberXxxType - hid_t p_get_member_type(unsigned member_num) const; + hid_t p_get_member_type(unsigned member_num) const; }; #ifndef H5_NO_NAMESPACE } diff --git a/c++/src/H5CppDoc.h b/c++/src/H5CppDoc.h index f451d56..d215f19 100644 --- a/c++/src/H5CppDoc.h +++ b/c++/src/H5CppDoc.h @@ -17,7 +17,7 @@ #define _H5CPPDOC_H //------------------------------------------------------------------------- -// The following section will be used to generate the 'Mainpage' +// The following section will be used to generate the 'Mainpage' // and the 'Examples' for the RM. // ------------------------------------------------------------------------ @@ -26,15 +26,15 @@ * \section intro_sec Introduction * * The C++ API provides C++ wrappers for the HDF5 C library. - * It is assumed that the user has knowledge of the HDF5 file format + * It is assumed that the user has knowledge of the HDF5 file format * and its components. If you are not familiar with HDF5 file format, * and would like to find out more, please refer to the HDF5 documentation * at http://hdf.ncsa.uiuc.edu/HDF5/doc/H5.intro.html * - * Because the HDF5 library maps very well to - * the object oriented design approach, classes in the C++ API can + * Because the HDF5 library maps very well to + * the object oriented design approach, classes in the C++ API can * closely represent the interfaces of the HDF5 APIs, as followed: - * + * * \verbatim HDF5 C APIs C++ Classes ----------- ----------- @@ -54,7 +54,7 @@ * under the top directory for information about installing, building, * and testing the C++ API. * - * + * */ /// This example shows how to create datasets. diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index 7ab5179..34a87d7 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -82,7 +82,7 @@ DataSpace DataSet::getSpace() const return( data_space ); } -// This private member function calls the C API to get the identifier +// This private member function calls the C API to get the identifier // of the datatype that is used by this dataset. It is used // by the various AbstractDs functions to get the specific datatype. hid_t DataSet::p_get_type() const @@ -110,7 +110,7 @@ DSetCreatPropList DataSet::getCreatePlist() const { throw DataSetIException("DataSet::getCreatePlist", "H5Dget_create_plist failed"); } - // create and return the DSetCreatPropList object + // create and return the DSetCreatPropList object DSetCreatPropList create_plist( create_plist_id ); return( create_plist ); } @@ -190,9 +190,9 @@ hsize_t DataSet::getVlenBufSize( DataType& type, DataSpace& space ) const //-------------------------------------------------------------------------- // Function: DataSet::vlenReclaim -///\brief Reclaims VL datatype memory buffers. +///\brief Reclaims VL datatype memory buffers. ///\param type - IN: Datatype, which is the datatype stored in the buffer -///\param space - IN: Selection for the memory buffer to free the +///\param space - IN: Selection for the memory buffer to free the /// VL datatypes within ///\param xfer_plist - IN: Property list used to create the buffer ///\param buf - IN: Pointer to the buffer to be reclaimed @@ -223,9 +223,9 @@ void DataSet::vlenReclaim( DataType& type, DataSpace& space, DSetMemXferPropList ///\param xfer_plist - IN: Transfer property list for this I/O operation ///\exception H5::DataSetIException ///\par Description -/// This function reads raw data from this dataset into the -/// buffer \a buf, converting from file datatype and dataspace -/// to memory datatype \a mem_type and dataspace \a mem_space. +/// This function reads raw data from this dataset into the +/// buffer \a buf, converting from file datatype and dataspace +/// to memory datatype \a mem_type and dataspace \a mem_space. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSet::read( void* buf, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist ) const @@ -273,9 +273,9 @@ void DataSet::read( string& strg, const DataType& mem_type, const DataSpace& mem ///\param xfer_plist - IN: Transfer property list for this I/O operation ///\exception H5::DataSetIException ///\par Description -/// This function writes raw data from an application buffer -/// \a buf to a dataset, converting from memory datatype -/// \a mem_type and dataspace \a mem_space to file datatype +/// This function writes raw data from an application buffer +/// \a buf to a dataset, converting from memory datatype +/// \a mem_type and dataspace \a mem_space to file datatype /// and dataspace. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -312,18 +312,18 @@ void DataSet::write( const string& strg, const DataType& mem_type, const DataSpa //-------------------------------------------------------------------------- // Function: DataSet::iterateElems -///\brief Iterates over all selected elements in a dataspace. -///\param buf - IN/OUT: Pointer to the buffer in memory containing the +///\brief Iterates over all selected elements in a dataspace. +///\param buf - IN/OUT: Pointer to the buffer in memory containing the /// elements to iterate over ///\param type - IN: Datatype for the elements stored in \a buf -///\param space - IN: Dataspace for \a buf. Also contains the selection +///\param space - IN: Dataspace for \a buf. Also contains the selection /// to iterate over. -///\param op - IN: Function pointer to the routine to be called for +///\param op - IN: Function pointer to the routine to be called for /// each element in \a buf iterated over -///\param op_data - IN/OUT: Pointer to any user-defined data associated +///\param op_data - IN/OUT: Pointer to any user-defined data associated /// with the operation ///\exception H5::DataSetIException -///\note This function may not work correctly yet - it's still +///\note This function may not work correctly yet - it's still /// under development. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -436,7 +436,7 @@ void* DataSet::Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_ ///\return A reference ///\exception H5::DataSetIException ///\par Description -// This function passes H5R_OBJECT and -1 to the protected +// This function passes H5R_OBJECT and -1 to the protected // function for it to pass to the C API H5Rcreate // to create a reference to the named object. // Programmer Binh-Minh Ribler - May, 2004 @@ -454,7 +454,7 @@ void* DataSet::Reference(const char* name) const //-------------------------------------------------------------------------- // Function: DataSet::Reference ///\brief This is an overloaded function, provided for your convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for the object's name. ///\param name - IN: Name of the object to be referenced - \c std::string // Programmer Binh-Minh Ribler - May, 2004 @@ -470,10 +470,10 @@ void* DataSet::Reference(const string& name) const ///\param ref_type - IN: Type of reference to query ///\param ref - IN: Reference to query ///\return An object type, which can be one of the following: -// H5G_LINK Object is a symbolic link. -// H5G_GROUP Object is a group. -// H5G_DATASET Object is a dataset. -// H5G_TYPE Object is a named datatype +// H5G_LINK Object is a symbolic link. +// H5G_GROUP Object is a group. +// H5G_DATASET Object is a dataset. +// H5G_TYPE Object is a named datatype ///\exception H5::DataSetIException // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- diff --git a/c++/src/H5DataSet.h b/c++/src/H5DataSet.h index 24e88a7..453a60e 100644 --- a/c++/src/H5DataSet.h +++ b/c++/src/H5DataSet.h @@ -32,7 +32,7 @@ class H5_DLLCPP DataSet : public AbstractDs { // Fills a selection in memory with a value void fillMemBuf(const void *fill, DataType& fill_type, void *buf, DataType& buf_type, DataSpace& space); - // Fills a selection in memory with zero + // Fills a selection in memory with zero void fillMemBuf(void *buf, DataType& buf_type, DataSpace& space); // Gets the creation property list of this dataset. @@ -40,7 +40,7 @@ class H5_DLLCPP DataSet : public AbstractDs { // Returns the address of this dataset in the file. haddr_t getOffset() const; - + // Gets the dataspace of this dataset. virtual DataSpace getSpace() const; @@ -100,7 +100,7 @@ class H5_DLLCPP DataSet : public AbstractDs { private: // This function contains the common code that is used by - // getTypeClass and various API functions getXxxType + // getTypeClass and various API functions getXxxType // defined in AbstractDs for generic datatype and specific // sub-types virtual hid_t p_get_type() const; diff --git a/c++/src/H5DataSpace.cpp b/c++/src/H5DataSpace.cpp index d29ba20..7ed6ae2 100644 --- a/c++/src/H5DataSpace.cpp +++ b/c++/src/H5DataSpace.cpp @@ -36,7 +36,7 @@ const DataSpace DataSpace::ALL( H5S_ALL ); //-------------------------------------------------------------------------- // Function: DataSpace constructor ///\brief Creates a new dataspace given a dataspace type. -///\param type - IN: Type of the dataspace to be created, which +///\param type - IN: Type of the dataspace to be created, which /// currently can be either \c H5S_SCALAR or \c H5S_SIMPLE; /// default to \c H5S_SCALAR. ///\exception H5::DataSpaceIException @@ -54,9 +54,9 @@ DataSpace::DataSpace( H5S_class_t type ) : IdComponent() //-------------------------------------------------------------------------- // Function: DataSpace overloaded constructor ///\brief Creates a new simple dataspace. -///\param rank - IN: Number of dimensions of dataspace. -///\param dims - IN: An array of the size of each dimension. -///\param maxdims - IN: An array of the maximum size of each dimension. +///\param rank - IN: Number of dimensions of dataspace. +///\param dims - IN: An array of the size of each dimension. +///\param maxdims - IN: An array of the maximum size of each dimension. ///\exception H5::DataSpaceIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -71,7 +71,7 @@ DataSpace::DataSpace( int rank, const hsize_t * dims, const hsize_t * maxdims) : //-------------------------------------------------------------------------- // Function: DataSpace overloaded constructor -///\brief Creates a DataSpace object using the id of an existing +///\brief Creates a DataSpace object using the id of an existing /// dataspace. ///\param existing_id - IN: Id of an existing dataspace ///\exception H5::DataSpaceIException @@ -101,7 +101,7 @@ void DataSpace::copy( const DataSpace& like_space ) { // If this object has a valid id, appropriately decrement reference // counter and close the id. - if( id != H5S_ALL ) { + if( id != H5S_ALL ) { try { decRefCount(); } @@ -110,7 +110,7 @@ void DataSpace::copy( const DataSpace& like_space ) } } // if - // call C routine to copy the dataspace + // call C routine to copy the dataspace id = H5Scopy( like_space.getId() ); if( id < 0 ) @@ -137,7 +137,7 @@ DataSpace& DataSpace::operator=( const DataSpace& rhs ) //-------------------------------------------------------------------------- // Function: DataSpace::isSimple ///\brief Determines whether this dataspace is a simple dataspace. -///\return \c true if the dataspace is a simple dataspace, and \c false, +///\return \c true if the dataspace is a simple dataspace, and \c false, /// otherwise ///\exception H5::DataSpaceIException // Programmer Binh-Minh Ribler - 2000 @@ -151,7 +151,7 @@ bool DataSpace::isSimple () const return false; else { - throw DataSpaceIException("DataSpace::isSimple", + throw DataSpaceIException("DataSpace::isSimple", "H5Sis_simple returns negative value"); } } @@ -162,9 +162,9 @@ bool DataSpace::isSimple () const ///\param offset - IN: Offset to position the selection at ///\exception H5::DataSpaceIException ///\par Description -/// This function creates an offset for the selection within -/// an extent, allowing the same shaped selection to be moved -/// to different locations within a dataspace without requiring +/// This function creates an offset for the selection within +/// an extent, allowing the same shaped selection to be moved +/// to different locations within a dataspace without requiring /// it to be re-defined. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -182,7 +182,7 @@ void DataSpace::offsetSimple ( const hssize_t* offset ) const ///\brief Retrieves dataspace dimension size and maximum size. ///\param dims - IN: Name of the new member ///\param maxdims - IN: Pointer to the value of the new member -///\return Number of dimensions, the same value as returned by +///\return Number of dimensions, the same value as returned by /// \c DataSpace::getSimpleExtentNdims() ///\exception H5::DataSpaceIException // Programmer Binh-Minh Ribler - 2000 @@ -192,7 +192,7 @@ int DataSpace::getSimpleExtentDims ( hsize_t *dims, hsize_t *maxdims ) const int ndims = H5Sget_simple_extent_dims( id, dims, maxdims ); if( ndims < 0 ) { - throw DataSpaceIException("DataSpace::getSimpleExtentDims", + throw DataSpaceIException("DataSpace::getSimpleExtentDims", "H5Sget_simple_extent_dims returns negative number of dimensions"); } return( ndims ); @@ -210,7 +210,7 @@ int DataSpace::getSimpleExtentNdims () const int ndims = H5Sget_simple_extent_ndims( id ); if( ndims < 0 ) { - throw DataSpaceIException("DataSpace::getSimpleExtentNdims", + throw DataSpaceIException("DataSpace::getSimpleExtentNdims", "H5Sget_simple_extent_ndims returns negative value for dimensionality of the dataspace"); } return( ndims ); @@ -235,7 +235,7 @@ hssize_t DataSpace::getSimpleExtentNpoints () const return( num_elements ); else { - throw DataSpaceIException("DataSpace::getSimpleExtentNpoints", + throw DataSpaceIException("DataSpace::getSimpleExtentNpoints", "H5Sget_simple_extent_npoints returns negative value for the number of elements in the dataspace"); } } @@ -252,7 +252,7 @@ H5S_class_t DataSpace::getSimpleExtentType () const H5S_class_t class_name = H5Sget_simple_extent_type( id ); if( class_name == H5S_NO_CLASS ) { - throw DataSpaceIException("DataSpace::getSimpleExtentType", + throw DataSpaceIException("DataSpace::getSimpleExtentType", "H5Sget_simple_extent_type returns H5S_NO_CLASS"); } return( class_name ); @@ -322,7 +322,7 @@ hssize_t DataSpace::getSelectNpoints () const hssize_t num_elements = H5Sget_select_npoints( id ); if( num_elements < 0 ) { - throw DataSpaceIException("DataSpace::getSelectNpoints", + throw DataSpaceIException("DataSpace::getSelectNpoints", "H5Sget_select_npoints returns negative value for number of elements in the dataspace selection"); } return( num_elements ); @@ -340,7 +340,7 @@ hssize_t DataSpace::getSelectHyperNblocks () const hssize_t num_blocks = H5Sget_select_hyper_nblocks( id ); if( num_blocks < 0 ) { - throw DataSpaceIException("DataSpace::getSelectHyperNblocks", + throw DataSpaceIException("DataSpace::getSelectHyperNblocks", "H5Sget_select_hyper_nblocks returns negative value for the number of hyperslab blocks"); } return( num_blocks ); @@ -361,7 +361,7 @@ void DataSpace::getSelectHyperBlocklist( hsize_t startblock, hsize_t numblocks, ret_value = H5Sget_select_hyper_blocklist( id, startblock, numblocks, buf ); if( ret_value < 0 ) { - throw DataSpaceIException("DataSpace::getSelectHyperBlocklist", + throw DataSpaceIException("DataSpace::getSelectHyperBlocklist", "H5Sget_select_hyper_blocklist failed"); } } @@ -378,7 +378,7 @@ hssize_t DataSpace::getSelectElemNpoints () const hssize_t num_points = H5Sget_select_elem_npoints( id ); if( num_points < 0 ) { - throw DataSpaceIException("DataSpace::getSelectElemNpoints", + throw DataSpaceIException("DataSpace::getSelectElemNpoints", "H5Sget_select_elem_npoints failed"); } return( num_points ); @@ -412,7 +412,7 @@ void DataSpace::getSelectElemPointlist ( hsize_t startpoint, hsize_t numpoints, // Function: DataSpace::getSelectBounds ///\brief Gets the bounding box containing the current selection. ///\param start - IN: Starting coordinates of the bounding box -///\param end - IN: Ending coordinates of the bounding box, i.e., +///\param end - IN: Ending coordinates of the bounding box, i.e., /// the coordinates of the diagonally opposite corner ///\exception H5::DataSpaceIException ///\par Description @@ -433,12 +433,12 @@ void DataSpace::getSelectBounds ( hsize_t* start, hsize_t* end ) const //-------------------------------------------------------------------------- // Function: DataSpace::H5Sselect_elements -///\brief Selects array elements to be included in the selection for +///\brief Selects array elements to be included in the selection for /// this dataspace. -///\param op - IN: Operator specifying how the new selection is to be +///\param op - IN: Operator specifying how the new selection is to be /// combined with the existing selection for the dataspace ///\param num_elements - IN: Number of elements to be selected -///\param coord - IN: A 2-dimensional array of 0-based values +///\param coord - IN: A 2-dimensional array of 0-based values /// specifying the coordinates of the elements being selected ///\exception H5::DataSpaceIException ///\par Description @@ -493,7 +493,7 @@ void DataSpace::selectNone () const //-------------------------------------------------------------------------- // Function: DataSpace::selectValid -///\brief Verifies that the selection is within the extent of the +///\brief Verifies that the selection is within the extent of the /// dataspace. ///\return \c true if the selection is within the extent of the /// dataspace, and \c false, otherwise @@ -525,7 +525,7 @@ bool DataSpace::selectValid () const ///\exception H5::DataSpaceIException ///\par Description /// For more information, please refer to the C layer Reference -/// Manual at: +/// Manual at: /// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5S.html#Dataspace-SelectHyperslab // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -572,10 +572,10 @@ void DataSpace::close() // ID reference counting mechanism - June 1, 2004 //-------------------------------------------------------------------------- DataSpace::~DataSpace() -{ +{ // If this object has a valid id, appropriately decrement reference // counter and close the id. - if( id != H5S_ALL ) { + if( id != H5S_ALL ) { try { decRefCount(); } @@ -583,7 +583,7 @@ DataSpace::~DataSpace() cerr << "DataSpace::~DataSpace - " << close_error.getDetailMsg() << endl; } } // if -} +} #ifndef H5_NO_NAMESPACE } // end namespace diff --git a/c++/src/H5DataSpace.h b/c++/src/H5DataSpace.h index 46c620e..3510a19 100644 --- a/c++/src/H5DataSpace.h +++ b/c++/src/H5DataSpace.h @@ -68,7 +68,7 @@ class H5_DLLCPP DataSpace : public IdComponent { int getSimpleExtentNdims() const; // Gets the number of elements in this dataspace. - // 12/05/00 - changed return type to hssize_t from hsize_t - C API + // 12/05/00 - changed return type to hssize_t from hsize_t - C API hssize_t getSimpleExtentNpoints() const; // Gets the current class of this dataspace. @@ -83,7 +83,7 @@ class H5_DLLCPP DataSpace : public IdComponent { // Selects the entire dataspace. void selectAll() const; - // Selects array elements to be included in the selection for + // Selects array elements to be included in the selection for // this dataspace. void selectElements( H5S_seloper_t op, const size_t num_elements, const hsize_t *coord[ ] ) const; diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index 28668a46..62dca0f 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -43,11 +43,11 @@ namespace H5 { ///\param predefined - IN: Indicates whether or not this datatype is /// a predefined datatype; default to \c false // Description -// Constructor creates a copy of an existing DataType using -// its id. The argument "predefined" is default to false; -// when a default datatype is created, this argument is set -// to true so H5Tclose will not be called on it later. - need -// a reassessment after changing to the new ref counting mech. +// Constructor creates a copy of an existing DataType using +// its id. The argument "predefined" is default to false; +// when a default datatype is created, this argument is set +// to true so H5Tclose will not be called on it later. - need +// a reassessment after changing to the new ref counting mech. // - BMR 5/2004 // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -125,8 +125,8 @@ void DataType::copy( const DataType& like_type ) ///\return Reference to DataType instance ///\exception H5::DataTypeIException // Description -// Makes a copy of the type on the right hand side and stores -// the new id in the left hand side object. +// Makes a copy of the type on the right hand side and stores +// the new id in the left hand side object. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataType& DataType::operator=( const DataType& rhs ) @@ -137,7 +137,7 @@ DataType& DataType::operator=( const DataType& rhs ) //-------------------------------------------------------------------------- // Function: DataType::operator== -///\brief Compares this DataType against the given one to determines +///\brief Compares this DataType against the given one to determines /// whether the two objects refer to the same actual datatype. ///\param compared_type - IN: Reference to the datatype to compare ///\return true if the datatypes are equal, and false, otherwise. @@ -146,7 +146,7 @@ DataType& DataType::operator=( const DataType& rhs ) //-------------------------------------------------------------------------- bool DataType::operator==(const DataType& compared_type ) const { - // Call C routine H5Tequal to determines whether two datatype + // Call C routine H5Tequal to determines whether two datatype // identifiers refer to the same datatype htri_t ret_value = H5Tequal( id, compared_type.getId() ); if( ret_value > 0 ) @@ -161,7 +161,7 @@ bool DataType::operator==(const DataType& compared_type ) const //-------------------------------------------------------------------------- // Function: DataType::commit -///\brief Commits a transient datatype to a file, creating a new +///\brief Commits a transient datatype to a file, creating a new /// named datatype ///\param loc - IN: Either a file or a group ///\param name - IN: Name of the datatype @@ -172,7 +172,7 @@ void DataType::commit(CommonFG& loc, const char* name) const { hid_t loc_id = loc.getLocId(); // get location id for C API - // Call C routine to commit the transient datatype + // Call C routine to commit the transient datatype herr_t ret_value = H5Tcommit( loc_id, name, id ); if( ret_value < 0 ) { @@ -183,7 +183,7 @@ void DataType::commit(CommonFG& loc, const char* name) const //-------------------------------------------------------------------------- // Function: DataType::commit ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of the +/// It differs from the above function only in the type of the /// argument \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -194,8 +194,8 @@ void DataType::commit(CommonFG& loc, const string& name) const //-------------------------------------------------------------------------- // Function: DataType::committed -///\brief Determines whether a datatype is a named type or a -/// transient type. +///\brief Determines whether a datatype is a named type or a +/// transient type. ///\return true if the datatype is a named type, and false, otherwise. ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 @@ -216,11 +216,11 @@ bool DataType::committed() const //-------------------------------------------------------------------------- // Function: DataType::find -///\brief Finds a conversion function that can handle a conversion +///\brief Finds a conversion function that can handle a conversion /// from this datatype to the specified datatype, \a dest. ///\param dest - IN: Destination datatype ///\param pcdata - IN: Pointer to type conversion data -///\return Pointer to a suitable conversion function +///\return Pointer to a suitable conversion function ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -237,14 +237,14 @@ H5T_conv_t DataType::find( const DataType& dest, H5T_cdata_t **pcdata ) const //-------------------------------------------------------------------------- // Function: DataType::convert -///\brief Converts data from this datatype to the specified datatypes. +///\brief Converts data from this datatype to the specified datatypes. ///\param dest - IN: Destination datatype ///\param nelmts - IN: Size of array \a buf -///\param buf - IN/OUT: Array containing pre- and post-conversion +///\param buf - IN/OUT: Array containing pre- and post-conversion /// values ///\param background - IN: Optional backgroud buffer ///\param plist - IN: Dataset transfer property list -///\return Pointer to a suitable conversion function +///\return Pointer to a suitable conversion function ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -269,8 +269,8 @@ void DataType::convert( const DataType& dest, size_t nelmts, void *buf, void *ba /// ///\exception H5::DataTypeIException ///\par Descrition -/// This is normally done by the library for predefined data -/// types so the application doesn't inadvertently change or +/// This is normally done by the library for predefined data +/// types so the application doesn't inadvertently change or /// delete a predefined type. /// /// Once a data type is locked it can never be unlocked unless @@ -289,7 +289,7 @@ void DataType::lock() const //-------------------------------------------------------------------------- // Function: DataType::getClass -///\brief Returns the datatype class identifier. +///\brief Returns the datatype class identifier. ///\return Datatype class identifier ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 @@ -308,7 +308,7 @@ H5T_class_t DataType::getClass() const //-------------------------------------------------------------------------- // Function: DataType::getSize -///\brief Returns the size of a datatype. +///\brief Returns the size of a datatype. ///\return Datatype size in bytes ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 @@ -326,7 +326,7 @@ size_t DataType::getSize() const //-------------------------------------------------------------------------- // Function: DataType::getSuper -///\brief Returns the base datatype from which a datatype is derived. +///\brief Returns the base datatype from which a datatype is derived. ///\return DataType object ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 @@ -334,7 +334,7 @@ size_t DataType::getSize() const DataType DataType::getSuper() const { // Call C routine to get the base datatype from which the specified - // datatype is derived. + // datatype is derived. hid_t base_type_id = H5Tget_super( id ); // If H5Tget_super returns a valid datatype id, create and return @@ -352,14 +352,14 @@ DataType DataType::getSuper() const //-------------------------------------------------------------------------- // Function: DataType::registerFunc -///\brief Registers the specified conversion function. +///\brief Registers the specified conversion function. ///\param pers - IN: Conversion option /// \li \c H5T_PERS_HARD for hard conversion functions -/// \li \c H5T_PERS_SOFT for soft conversion functions. -///\param name - IN: Name displayed in diagnostic output. +/// \li \c H5T_PERS_SOFT for soft conversion functions. +///\param name - IN: Name displayed in diagnostic output. ///\param dest - IN: Destination datatype. -///\param func - IN: Function to convert between source and -/// destination datatypes. +///\param func - IN: Function to convert between source and +/// destination datatypes. ///\exception H5::DataTypeIException ///\par Description /// For more information, please see: @@ -381,7 +381,7 @@ void DataType::registerFunc( H5T_pers_t pers, const char* name, const DataType& //-------------------------------------------------------------------------- // Function: DataType::registerFunc ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of the +/// It differs from the above function only in the type of the /// argument \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -392,14 +392,14 @@ void DataType::registerFunc( H5T_pers_t pers, const string& name, const DataType //-------------------------------------------------------------------------- // Function: DataType::unregister -///\brief Removes a conversion function from all conversion paths. +///\brief Removes a conversion function from all conversion paths. ///\param pers - IN: Conversion option /// \li \c H5T_PERS_HARD for hard conversion functions -/// \li \c H5T_PERS_SOFT for soft conversion functions. -///\param name - IN: Name displayed in diagnostic output. +/// \li \c H5T_PERS_SOFT for soft conversion functions. +///\param name - IN: Name displayed in diagnostic output. ///\param dest - IN: Destination datatype. -///\param func - IN: Function to convert between source and -/// destination datatypes. +///\param func - IN: Function to convert between source and +/// destination datatypes. ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -407,7 +407,7 @@ void DataType::unregister( H5T_pers_t pers, const char* name, const DataType& de { hid_t dest_id = dest.getId(); // get id of the dest datatype for C API - // Call C routine H5Tunregister to remove the conversion function + // Call C routine H5Tunregister to remove the conversion function herr_t ret_value = H5Tunregister( pers, name, id, dest_id, func ); if( ret_value < 0 ) { @@ -418,7 +418,7 @@ void DataType::unregister( H5T_pers_t pers, const char* name, const DataType& de //-------------------------------------------------------------------------- // Function: DataType::unregister ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of the +/// It differs from the above function only in the type of the /// argument \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -429,15 +429,15 @@ void DataType::unregister( H5T_pers_t pers, const string& name, const DataType& //-------------------------------------------------------------------------- // Function: DataType::setTag -///\brief Tags an opaque datatype. -///\param tag - IN: Descriptive ASCII string with which the opaque -/// datatype is to be tagged. +///\brief Tags an opaque datatype. +///\param tag - IN: Descriptive ASCII string with which the opaque +/// datatype is to be tagged. ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataType::setTag( const char* tag ) const { - // Call C routine H5Tset_tag to tag an opaque datatype. + // Call C routine H5Tset_tag to tag an opaque datatype. herr_t ret_value = H5Tset_tag( id, tag ); if( ret_value < 0 ) { @@ -448,7 +448,7 @@ void DataType::setTag( const char* tag ) const //-------------------------------------------------------------------------- // Function: DataType::setTag ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of the +/// It differs from the above function only in the type of the /// argument \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -459,7 +459,7 @@ void DataType::setTag( const string& tag ) const //-------------------------------------------------------------------------- // Function: DataType::getTag -///\brief Gets the tag associated with an opaque datatype. +///\brief Gets the tag associated with an opaque datatype. ///\return Tag associated with the opaque datatype ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 @@ -473,8 +473,8 @@ string DataType::getTag() const if( tag_Cstr != NULL ) { string tag = string(tag_Cstr); // convert C string to string object - HDfree(tag_Cstr); // free the C string - return (tag); // return the tag + HDfree(tag_Cstr); // free the C string + return (tag); // return the tag } else { @@ -486,7 +486,7 @@ string DataType::getTag() const // Function: DataType::detectClass ///\brief Checks whether a datatype contains (or is) a certain type of /// datatype. -///\return true if this datatype contains or is the specified type, +///\return true if this datatype contains or is the specified type, /// and false, otherwise. ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - May, 2004 @@ -507,7 +507,7 @@ bool DataType::detectClass(H5T_class_t cls) const //-------------------------------------------------------------------------- // Function: DataType::isVariableStr ///\brief Check whether this datatype is a variable-length string. -///\return true if this datatype is a variable-length string, and +///\return true if this datatype is a variable-length string, and /// false, otherwise. ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - May, 2004 @@ -554,7 +554,7 @@ void* DataType::Reference(const char* name, DataSpace& dataspace, H5R_type_t ref ///\return A reference ///\exception H5::DataTypeIException ///\par Description -// This function passes H5R_OBJECT and -1 to the protected +// This function passes H5R_OBJECT and -1 to the protected // function for it to pass to the C API H5Rcreate // to create a reference to the named object. // Programmer Binh-Minh Ribler - May, 2004 @@ -589,10 +589,10 @@ void* DataType::Reference(const string& name) const ///\param ref - IN: Reference to query ///\param ref_type - IN: Type of reference to query ///\return Object type, which can be one of the following: -/// \li \c H5G_LINK Object is a symbolic link. -/// \li \c H5G_GROUP Object is a group. -/// \li \c H5G_DATASET Object is a dataset. -/// \li \c H5G_TYPE Object is a named datatype +/// \li \c H5G_LINK Object is a symbolic link. +/// \li \c H5G_GROUP Object is a group. +/// \li \c H5G_DATASET Object is a dataset. +/// \li \c H5G_TYPE Object is a named datatype ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- @@ -659,7 +659,7 @@ void DataType::close() // ID reference counting mechanism - June 1, 2004 //-------------------------------------------------------------------------- DataType::~DataType() -{ +{ // The datatype id will be closed properly if( is_predtype == false ) { try { @@ -669,7 +669,7 @@ DataType::~DataType() cerr << inMemFunc("~DataType - ") << close_error.getDetailMsg() << endl; } } -} +} #ifndef H5_NO_NAMESPACE } // end namespace diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h index c135845..d685e9d 100644 --- a/c++/src/H5DataType.h +++ b/c++/src/H5DataType.h @@ -34,23 +34,23 @@ class H5_DLLCPP DataType : public H5Object { // Copies an existing datatype to this datatype object void copy( const DataType& like_type ); - // Returns the datatype class identifier. + // Returns the datatype class identifier. H5T_class_t getClass() const; - // Commits a transient datatype to a file; this datatype becomes + // Commits a transient datatype to a file; this datatype becomes // a named datatype which can be accessed from the location. void commit( CommonFG& loc, const string& name ) const; void commit( CommonFG& loc, const char* name ) const; - // Determines whether this datatype is a named datatype or - // a transient datatype. + // Determines whether this datatype is a named datatype or + // a transient datatype. bool committed() const; - // Finds a conversion function that can handle the conversion + // Finds a conversion function that can handle the conversion // this datatype to the given datatype, dest. H5T_conv_t find( const DataType& dest, H5T_cdata_t **pcdata ) const; - // Converts data from between specified datatypes. + // Converts data from between specified datatypes. void convert( const DataType& dest, size_t nelmts, void *buf, void *background, PropList& plist ) const; // Assignment operator @@ -59,29 +59,29 @@ class H5_DLLCPP DataType : public H5Object { // Determines whether two datatypes are the same. bool operator==(const DataType& compared_type ) const; - // Locks a datatype. + // Locks a datatype. void lock() const; - // Returns the size of a datatype. + // Returns the size of a datatype. size_t getSize() const; - // Returns the base datatype from which a datatype is derived. + // Returns the base datatype from which a datatype is derived. // Note: not quite right for specific types yet??? DataType getSuper() const; - // Registers a conversion function. + // Registers a conversion function. void registerFunc(H5T_pers_t pers, const string& name, const DataType& dest, H5T_conv_t func ) const; void registerFunc(H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const; - // Removes a conversion function from all conversion paths. + // Removes a conversion function from all conversion paths. void unregister( H5T_pers_t pers, const string& name, const DataType& dest, H5T_conv_t func ) const; void unregister( H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const; - // Tags an opaque datatype. + // Tags an opaque datatype. void setTag( const string& tag ) const; void setTag( const char* tag ) const; - // Gets the tag associated with an opaque datatype. + // Gets the tag associated with an opaque datatype. string getTag() const; // Checks whether this datatype contains (or is) a certain type class. @@ -106,7 +106,7 @@ class H5_DLLCPP DataType : public H5Object { virtual string fromClass () const { return ("DataType"); } - // Creates a copy of an existing DataType using its id + // Creates a copy of an existing DataType using its id DataType( const hid_t type_id, bool predtype = false ); // Default constructor diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp index 9ecc9a3..74bb19e 100644 --- a/c++/src/H5DcreatProp.cpp +++ b/c++/src/H5DcreatProp.cpp @@ -49,7 +49,7 @@ DSetCreatPropList::DSetCreatPropList( const DSetCreatPropList& orig ) : PropList //-------------------------------------------------------------------------- // Function: DSetCreatPropList overloaded constructor -///\brief Creates a DSetCreatPropList object using the id of an +///\brief Creates a DSetCreatPropList object using the id of an /// existing dataset creation property list. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -93,7 +93,7 @@ int DSetCreatPropList::getChunk( int max_ndims, hsize_t* dim ) const int chunk_size = H5Pget_chunk( id, max_ndims, dim ); if( chunk_size < 0 ) { - throw PropListIException("DSetCreatPropList::getChunk", + throw PropListIException("DSetCreatPropList::getChunk", "H5Pget_chunk returns negative chunk size"); } return( chunk_size ); @@ -140,7 +140,7 @@ H5D_layout_t DSetCreatPropList::getLayout() const H5D_layout_t layout = H5Pget_layout( id ); if( layout == H5D_LAYOUT_ERROR ) { - throw PropListIException("DSetCreatPropList::getLayout", + throw PropListIException("DSetCreatPropList::getLayout", "H5Pget_layout returns H5D_LAYOUT_ERROR"); } return( layout ); @@ -314,10 +314,10 @@ int DSetCreatPropList::getNfilters() const //-------------------------------------------------------------------------- // Function: DSetCreatPropList::getFilter ///\brief Returns information about a filter in a pipeline -///\param filter_number - IN: Filter to get, range [0..N-1], where +///\param filter_number - IN: Filter to get, range [0..N-1], where /// N is returned by H5Pget_nfilters() ///\param flags - OUT: General properties of the filter -///\param cd_nelmts - IN/OUT: Number of elements in \a cd_values /Number +///\param cd_nelmts - IN/OUT: Number of elements in \a cd_values /Number /// of values defined by the filter ///\param cd_values - OUT: Array to hold the data; allocated by the user ///\param namelen - OUT: Length of \a name @@ -333,7 +333,7 @@ H5Z_filter_t DSetCreatPropList::getFilter(int filter_number, unsigned int &flags unsigned int& filter_config) const { H5Z_filter_t filter_id; - filter_id = H5Pget_filter( id, filter_number, &flags, &cd_nelmts, + filter_id = H5Pget_filter( id, filter_number, &flags, &cd_nelmts, cd_values, namelen, name, &filter_config); if( filter_id == H5Z_FILTER_ERROR ) { @@ -350,7 +350,7 @@ H5Z_filter_t DSetCreatPropList::getFilter(int filter_number, unsigned int &flags /// filter id ///\param filter_id - IN: Filter to get ///\param flags - OUT: General properties of the filter -///\param cd_nelmts - IN/OUT: Number of elements in \a cd_values /Number +///\param cd_nelmts - IN/OUT: Number of elements in \a cd_values /Number /// of values defined by the filter ///\param cd_values - OUT: Array to hold the data; allocated by the user ///\param namelen - IN: Length of \a name @@ -363,7 +363,7 @@ void DSetCreatPropList::getFilterById(H5Z_filter_t filter_id, unsigned int &flag unsigned int* cd_values, size_t namelen, char name[], unsigned int &filter_config) const { - herr_t ret_value = H5Pget_filter_by_id(id, filter_id, &flags, &cd_nelmts, + herr_t ret_value = H5Pget_filter_by_id(id, filter_id, &flags, &cd_nelmts, cd_values, namelen, name, &filter_config ); if (ret_value < 0) { diff --git a/c++/src/H5DcreatProp.h b/c++/src/H5DcreatProp.h index fabadc6..b040abf 100644 --- a/c++/src/H5DcreatProp.h +++ b/c++/src/H5DcreatProp.h @@ -21,11 +21,11 @@ namespace H5 { #endif class H5_DLLCPP DSetCreatPropList : public PropList { - public: + public: // Default dataset creation property list. static const DSetCreatPropList DEFAULT; - // Queries whether all the filters set in this property list are + // Queries whether all the filters set in this property list are // available currently. bool allFiltersAvail(); @@ -69,7 +69,7 @@ class H5_DLLCPP DSetCreatPropList : public PropList { // property list. H5D_layout_t getLayout() const; - // Sets the type of storage used to store the raw data for the + // Sets the type of storage used to store the raw data for the // dataset that uses this property list. void setLayout(H5D_layout_t layout) const; @@ -109,7 +109,7 @@ class H5_DLLCPP DSetCreatPropList : public PropList { // Copy constructor: creates a copy of a DSetCreatPropList object. DSetCreatPropList(const DSetCreatPropList& orig); - // Creates a copy of an existing dataset creation property list + // Creates a copy of an existing dataset creation property list // using the property list id. DSetCreatPropList(const hid_t plist_id); diff --git a/c++/src/H5DxferProp.cpp b/c++/src/H5DxferProp.cpp index 379e02e..d6d279d 100644 --- a/c++/src/H5DxferProp.cpp +++ b/c++/src/H5DxferProp.cpp @@ -41,7 +41,7 @@ DSetMemXferPropList::DSetMemXferPropList() : PropList(H5P_DATASET_XFER) {} // Function DSetMemXferPropList copy constructor ///\brief Copy constructor: makes a copy of the original /// DSetMemXferPropList object -///\param orig - IN: The original dataset memory and transfer property +///\param orig - IN: The original dataset memory and transfer property /// list object to copy // Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -222,7 +222,7 @@ void DSetMemXferPropList::getTypeConvCB( H5T_conv_except_func_t *op, void **user //-------------------------------------------------------------------------- void DSetMemXferPropList::setVlenMemManager( H5MM_allocate_t alloc_func, void* alloc_info, H5MM_free_t free_func, void* free_info ) const { - herr_t ret_value = H5Pset_vlen_mem_manager( id, alloc_func, alloc_info, + herr_t ret_value = H5Pset_vlen_mem_manager( id, alloc_func, alloc_info, free_func, free_info ); if( ret_value < 0 ) { @@ -233,7 +233,7 @@ void DSetMemXferPropList::setVlenMemManager( H5MM_allocate_t alloc_func, void* a //-------------------------------------------------------------------------- // Function: DSetMemXferPropList::setVlenMemManager -///\brief Sets the memory manager for variable-length datatype +///\brief Sets the memory manager for variable-length datatype /// allocation - system \c malloc and \c free will be used. /// ///\exception H5::PropListIException @@ -246,7 +246,7 @@ void DSetMemXferPropList::setVlenMemManager() const //-------------------------------------------------------------------------- // Function: DSetMemXferPropList::getVlenMemManager -///\brief Gets the memory manager for variable-length datatype allocation +///\brief Gets the memory manager for variable-length datatype allocation ///\param alloc_func - OUT: User's allocate routine ///\param alloc_info - OUT: User's allocation parameters ///\param free_func - OUT: User's free routine @@ -270,7 +270,7 @@ void DSetMemXferPropList::getVlenMemManager( H5MM_allocate_t& alloc_func, void** ///\param memb_dxpl - OUT: Array of data access property lists ///\exception H5::PropListIException ///\par Description -/// This function can only be used after the member map has +/// This function can only be used after the member map has /// been set with FileAccPropList::setMulti (not done - BMR.) // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- @@ -304,7 +304,7 @@ void DSetMemXferPropList::getMulti(hid_t *memb_dxpl) //-------------------------------------------------------------------------- // Function: DSetMemXferPropList::setSmallDataBlockSize ///\brief Sets the size of a contiguous block reserved for small data. -///\param size - IN: Maximum size, in bytes, of the small data block. +///\param size - IN: Maximum size, in bytes, of the small data block. ///\exception H5::PropListIException ///\par Description /// For detail, please refer to the C layer Reference Manual at: @@ -363,7 +363,7 @@ void DSetMemXferPropList::setHyperVectorSize(size_t vector_size) //-------------------------------------------------------------------------- // Function: DSetMemXferPropList::getSmallDataBlockSize -///\brief Returns the number of I/O vectors to be read/written in +///\brief Returns the number of I/O vectors to be read/written in /// hyperslab I/O. ///\return Number of I/O vectors ///\exception H5::PropListIException @@ -389,14 +389,14 @@ size_t DSetMemXferPropList::getHyperVectorSize() /// disabled ///\exception H5::PropListIException ///\par Description -/// The error detection algorithm used is the algorithm previously -/// specified in the corresponding dataset creation property -/// list. This function does not affect the use of error +/// The error detection algorithm used is the algorithm previously +/// specified in the corresponding dataset creation property +/// list. This function does not affect the use of error /// detection in the writing process. ///\par /// Valid values are as follows: -/// \li \c H5Z_ENABLE_EDC (default) -/// \li \c H5Z_DISABLE_EDC +/// \li \c H5Z_ENABLE_EDC (default) +/// \li \c H5Z_DISABLE_EDC // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void DSetMemXferPropList::setEDCCheck(H5Z_EDC_t check) diff --git a/c++/src/H5DxferProp.h b/c++/src/H5DxferProp.h index 2d00a5b..30dfc73 100644 --- a/c++/src/H5DxferProp.h +++ b/c++/src/H5DxferProp.h @@ -42,7 +42,7 @@ class H5_DLLCPP DSetMemXferPropList : public PropList { // Checks status of the dataset transfer property list bool getPreserve() const; - // Sets B-tree split ratios for a dataset transfer property list + // Sets B-tree split ratios for a dataset transfer property list void setBtreeRatios( double left, double middle, double right ) const; // Gets B-tree split ratios for a dataset transfer property list @@ -54,18 +54,18 @@ class H5_DLLCPP DSetMemXferPropList : public PropList { // Gets the exception handling callback for datatype conversion void getTypeConvCB( H5T_conv_except_func_t *op, void **user_data) const; - // Sets the memory manager for variable-length datatype + // Sets the memory manager for variable-length datatype // allocation in H5Dread and H5Dvlen_reclaim - void setVlenMemManager( H5MM_allocate_t alloc, void* alloc_info, + void setVlenMemManager( H5MM_allocate_t alloc, void* alloc_info, H5MM_free_t free, void* free_info ) const; - // alloc and free are set to NULL, indicating that system + // alloc and free are set to NULL, indicating that system // malloc and free are to be used void setVlenMemManager() const; - // Gets the memory manager for variable-length datatype + // Gets the memory manager for variable-length datatype // allocation in H5Dread and H5Tvlen_reclaim - void getVlenMemManager( H5MM_allocate_t& alloc, void** alloc_info, + void getVlenMemManager( H5MM_allocate_t& alloc, void** alloc_info, H5MM_free_t& free, void** free_info ) const; // Sets the data transfer property list for the multi-file driver. @@ -97,7 +97,7 @@ class H5_DLLCPP DSetMemXferPropList : public PropList { // Returns this class name virtual string fromClass () const { return ("DSetMemXferPropList"); } - // Creates a copy of an existing dataset memory and transfer + // Creates a copy of an existing dataset memory and transfer // property list using the property list id. DSetMemXferPropList (const hid_t plist_id); diff --git a/c++/src/H5EnumType.cpp b/c++/src/H5EnumType.cpp index abd9c51..14ba706 100644 --- a/c++/src/H5EnumType.cpp +++ b/c++/src/H5EnumType.cpp @@ -117,7 +117,7 @@ EnumType::EnumType( const IntType& data_type ) : DataType() //-------------------------------------------------------------------------- void EnumType::insert( const char* name, void *value ) const { - // Calls C routine H5Tenum_insert to insert the new enum datatype member. + // Calls C routine H5Tenum_insert to insert the new enum datatype member. herr_t ret_value = H5Tenum_insert( id, name, value ); if( ret_value < 0 ) { @@ -128,7 +128,7 @@ void EnumType::insert( const char* name, void *value ) const //-------------------------------------------------------------------------- // Function: EnumType::insert ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of +/// It differs from the above function only in the type of /// argument \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -139,8 +139,8 @@ void EnumType::insert( const string& name, void *value ) const //-------------------------------------------------------------------------- // Function: EnumType::nameOf -///\brief Returns the symbol name corresponding to a specified member -/// of this enumeration datatype. +///\brief Returns the symbol name corresponding to a specified member +/// of this enumeration datatype. ///\param value - IN: Pointer to the value of the enum datatype ///\param size - IN: Size for the name ///\exception H5::DataTypeIException @@ -166,8 +166,8 @@ string EnumType::nameOf( void *value, size_t size ) const //-------------------------------------------------------------------------- // Function: EnumType::valueOf -///\brief Retrieves the value corresponding to a member of this -/// enumeration datatype, given the member's name. +///\brief Retrieves the value corresponding to a member of this +/// enumeration datatype, given the member's name. ///\param name - IN: Name of the queried member ///\param value - OUT: Pointer to the retrieved value ///\exception H5::DataTypeIException @@ -186,7 +186,7 @@ void EnumType::valueOf( const char* name, void *value ) const //-------------------------------------------------------------------------- // Function: EnumType::valueOf ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of +/// It differs from the above function only in the type of /// argument \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -200,7 +200,7 @@ void EnumType::valueOf( const string& name, void *value ) const ///\brief Returns the index of a member in this enumeration datatype. ///\param name - IN: Name of the queried member ///\return Index of the member if it exists. Index will have the value -/// between 0 and \c N-1, where \c N is the value returned by the +/// between 0 and \c N-1, where \c N is the value returned by the /// member function \c EnumType::getNmembers. ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - May 16, 2002 @@ -219,7 +219,7 @@ int EnumType::getMemberIndex(const char *name) const //-------------------------------------------------------------------------- // Function: EnumType::getMemberIndex ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of +/// It differs from the above function only in the type of /// argument \a name. // Programmer Binh-Minh Ribler - May 16, 2002 //-------------------------------------------------------------------------- @@ -248,7 +248,7 @@ int EnumType::getNmembers() const //-------------------------------------------------------------------------- // Function: EnumType::getMemberValue -///\brief Retrieves the value of a member in this enumeration datatype, +///\brief Retrieves the value of a member in this enumeration datatype, /// given the member's index. ///\param memb_no - IN: Index of the queried member ///\param value - OUT: Pointer to the retrieved value diff --git a/c++/src/H5EnumType.h b/c++/src/H5EnumType.h index 0313acb..58199db 100644 --- a/c++/src/H5EnumType.h +++ b/c++/src/H5EnumType.h @@ -23,7 +23,7 @@ namespace H5 { class H5_DLLCPP EnumType : public DataType { public: - // Creates an empty enumeration datatype based on a native signed + // Creates an empty enumeration datatype based on a native signed // integer type, whose size is given by size. EnumType( size_t size ); @@ -43,16 +43,16 @@ class H5_DLLCPP EnumType : public DataType { // Returns the value of an enumeration datatype member void getMemberValue( unsigned memb_no, void *value ) const; - // Inserts a new member to this enumeration type. + // Inserts a new member to this enumeration type. void insert( const char* name, void *value ) const; void insert( const string& name, void *value ) const; - // Returns the symbol name corresponding to a specified member - // of this enumeration datatype. + // Returns the symbol name corresponding to a specified member + // of this enumeration datatype. string nameOf( void *value, size_t size ) const; - // Returns the value corresponding to a specified member of this - // enumeration datatype. + // Returns the value corresponding to a specified member of this + // enumeration datatype. void valueOf( const char* name, void *value ) const; void valueOf( const string& name, void *value ) const; diff --git a/c++/src/H5Exception.cpp b/c++/src/H5Exception.cpp index 37d0da5..074d734 100644 --- a/c++/src/H5Exception.cpp +++ b/c++/src/H5Exception.cpp @@ -33,7 +33,7 @@ Exception::Exception() : detail_message(""), func_name("") {} //-------------------------------------------------------------------------- // Function: Exception overloaded constructor -///\brief Creates an exception with the name of the function, +///\brief Creates an exception with the name of the function, /// in which the failure occurs, and an optional detailed message. ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure @@ -71,7 +71,7 @@ string Exception::getMajorString( hid_t err_major ) const // If H5Eget_msg() returns a negative value, raise an exception, if( mesg_size < 0 ) - throw IdComponentException("Exception::getMajorString", + throw IdComponentException("Exception::getMajorString", "H5Eget_msg failed"); // Call H5Eget_msg again to get the actual message @@ -80,7 +80,7 @@ string Exception::getMajorString( hid_t err_major ) const // Check for failure again if( mesg_size < 0 ) - throw IdComponentException("Exception::getMajorString", + throw IdComponentException("Exception::getMajorString", "H5Eget_msg failed"); // Convert the C error description and return @@ -107,7 +107,7 @@ string Exception::getMinorString( hid_t err_minor ) const // If H5Eget_msg() returns a negative value, raise an exception, if( mesg_size < 0 ) - throw IdComponentException("Exception::getMinorString", + throw IdComponentException("Exception::getMinorString", "H5Eget_msg failed"); // Call H5Eget_msg again to get the actual message @@ -116,7 +116,7 @@ string Exception::getMinorString( hid_t err_minor ) const // Check for failure again if( mesg_size < 0 ) - throw IdComponentException("Exception::getMinorString", + throw IdComponentException("Exception::getMinorString", "H5Eget_msg failed"); // Convert the C error description and return @@ -132,7 +132,7 @@ string Exception::getMinorString( hid_t err_minor ) const ///\param client_data - IN: Data passed to the error function ///\par Description /// When the library is first initialized the auto printing -/// function, \a func, is set to the C API \c H5Eprint and +/// function, \a func, is set to the C API \c H5Eprint and /// \a client_data is the standard error stream pointer, \c stderr. /// Automatic stack traversal is always in the \c H5E_WALK_DOWNWARD /// direction. @@ -168,16 +168,16 @@ void Exception::dontPrint() // Function: Exception::getAutoPrint ///\brief Retrieves the current settings for the automatic error /// stack traversal function and its data. -///\param func - OUT: Current setting for the function to be +///\param func - OUT: Current setting for the function to be /// called upon an error condition -///\param client_data - OUT: Current setting for the data passed to +///\param client_data - OUT: Current setting for the data passed to /// the error function // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void Exception::getAutoPrint( H5E_auto_stack_t& func, void** client_data ) { // calls the C API routine H5Eget_auto to get the current setting of - // the automatic error printing + // the automatic error printing herr_t ret_value = H5Eget_auto_stack( H5E_DEFAULT, &func, client_data ); if( ret_value < 0 ) throw Exception( "Exception::getAutoPrint", "H5Eget_auto failed" ); @@ -325,7 +325,7 @@ Exception::~Exception() {} FileIException::FileIException():Exception(){} //-------------------------------------------------------------------------- // Function: FileIException overloaded constructor -///\brief Creates a FileIException with the name of the function, +///\brief Creates a FileIException with the name of the function, /// in which the failure occurs, and an optional detailed message. ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure @@ -348,7 +348,7 @@ FileIException::~FileIException() {} GroupIException::GroupIException():Exception(){} //-------------------------------------------------------------------------- // Function: GroupIException overloaded constructor -///\brief Creates a GroupIException with the name of the function, +///\brief Creates a GroupIException with the name of the function, /// in which the failure occurs, and an optional detailed message. ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure @@ -371,7 +371,7 @@ GroupIException::~GroupIException() {} DataSpaceIException::DataSpaceIException():Exception(){} //-------------------------------------------------------------------------- // Function: DataSpaceIException overloaded constructor -///\brief Creates a DataSpaceIException with the name of the function, +///\brief Creates a DataSpaceIException with the name of the function, /// in which the failure occurs, and an optional detailed message. ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure @@ -394,7 +394,7 @@ DataSpaceIException::~DataSpaceIException() {} DataTypeIException::DataTypeIException():Exception(){} //-------------------------------------------------------------------------- // Function: DataTypeIException overloaded constructor -///\brief Creates a DataTypeIException with the name of the function, +///\brief Creates a DataTypeIException with the name of the function, /// in which the failure occurs, and an optional detailed message. ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure @@ -417,7 +417,7 @@ DataTypeIException::~DataTypeIException() {} PropListIException::PropListIException():Exception(){} //-------------------------------------------------------------------------- // Function: PropListIException overloaded constructor -///\brief Creates a PropListIException with the name of the function, +///\brief Creates a PropListIException with the name of the function, /// in which the failure occurs, and an optional detailed message. ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure @@ -440,7 +440,7 @@ PropListIException::~PropListIException() {} DataSetIException::DataSetIException():Exception(){} //-------------------------------------------------------------------------- // Function: DataSetIException overloaded constructor -///\brief Creates a DataSetIException with the name of the function, +///\brief Creates a DataSetIException with the name of the function, /// in which the failure occurs, and an optional detailed message. ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure @@ -463,7 +463,7 @@ DataSetIException::~DataSetIException() {} AttributeIException::AttributeIException():Exception(){} //-------------------------------------------------------------------------- // Function: AttributeIException overloaded constructor -///\brief Creates an AttributeIException with the name of the function, +///\brief Creates an AttributeIException with the name of the function, /// in which the failure occurs, and an optional detailed message. ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure @@ -486,7 +486,7 @@ AttributeIException::~AttributeIException() {} ReferenceException::ReferenceException():Exception(){} //-------------------------------------------------------------------------- // Function: ReferenceException overloaded constructor -///\brief Creates a ReferenceException with the name of the function, +///\brief Creates a ReferenceException with the name of the function, /// in which the failure occurs, and an optional detailed message. ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure @@ -509,7 +509,7 @@ ReferenceException::~ReferenceException() {} LibraryIException::LibraryIException():Exception(){} //-------------------------------------------------------------------------- // Function: LibraryIException overloaded constructor -///\brief Creates a LibraryIException with the name of the function, +///\brief Creates a LibraryIException with the name of the function, /// in which the failure occurs, and an optional detailed message. ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure @@ -532,7 +532,7 @@ LibraryIException::~LibraryIException() {} IdComponentException::IdComponentException(): Exception() {} //-------------------------------------------------------------------------- // Function: IdComponentException overloaded constructor -///\brief Creates a IdComponentException with the name of the function, +///\brief Creates a IdComponentException with the name of the function, /// in which the failure occurs, and an optional detailed message. ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure diff --git a/c++/src/H5Exception.h b/c++/src/H5Exception.h index 4a5bf37..41a6e24 100644 --- a/c++/src/H5Exception.h +++ b/c++/src/H5Exception.h @@ -43,7 +43,7 @@ class H5_DLLCPP Exception { string getDetailMsg() const; const char* getCDetailMsg() const; // C string of detailed message string getFuncName() const; // function name as a string object - const char* getCFuncName() const; // function name as a char string + const char* getCFuncName() const; // function name as a char string // Turns on the automatic error printing. static void setAutoPrint( H5E_auto_stack_t& func, void* client_data); @@ -51,16 +51,16 @@ class H5_DLLCPP Exception { // Turns off the automatic error printing. static void dontPrint(); - // Retrieves the current settings for the automatic error stack + // Retrieves the current settings for the automatic error stack // traversal function and its data. static void getAutoPrint( H5E_auto_stack_t& func, void** client_data); // Clears the error stack for the current thread. static void clearErrorStack(); - // Walks the error stack for the current thread, calling the + // Walks the error stack for the current thread, calling the // specified function. - static void walkErrorStack( H5E_direction_t direction, + static void walkErrorStack( H5E_direction_t direction, H5E_walk_t func, void* client_data); // Prints the error stack in a default manner. @@ -77,7 +77,7 @@ class H5_DLLCPP Exception { private: // Because 'string' is not instantiated at compilation time, this -// warning is displayed when building DLL; but the class is exported +// warning is displayed when building DLL; but the class is exported // so the warning is harmless #if defined(WIN32) #pragma warning(disable: 4251) diff --git a/c++/src/H5FaccProp.cpp b/c++/src/H5FaccProp.cpp index 7e96bc0..4dede63 100644 --- a/c++/src/H5FaccProp.cpp +++ b/c++/src/H5FaccProp.cpp @@ -71,7 +71,7 @@ void FileAccPropList::setStdio() const //-------------------------------------------------------------------------- // Function: FileAccPropList::getDriver ///\brief Return the ID of the low-level file driver. -///\return A low-level driver ID which is the same ID used when the +///\return A low-level driver ID which is the same ID used when the /// driver was set for the property list. The driver ID is /// only valid as long as the file driver remains registered. /// Valid driver identifiers can be found at: @@ -96,7 +96,7 @@ hid_t FileAccPropList::getDriver() const ///\param new_driver_info - IN: Struct containing the driver-specific properites ///\exception H5::PropListIException ///\par Description -/// For a list of valid driver identifiers, please see the C +/// For a list of valid driver identifiers, please see the C /// layer Reference Manual at: /// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-GetDriver // Programmer: Binh-Minh Ribler - April, 2004 @@ -148,13 +148,13 @@ hsize_t FileAccPropList::getFamilyOffset() const // Function: FileAccPropList::setCore ///\brief Modifies this file access property list to use the \c H5FD_CORE /// driver. -///\param increment - IN: Specifies how much memory to increase each +///\param increment - IN: Specifies how much memory to increase each /// time more memory is needed, in bytes -///\param backing_store - IN: Indicating whether to write the file +///\param backing_store - IN: Indicating whether to write the file /// contents to disk when the file is closed ///\exception H5::PropListIException ///\par Description -/// For more details on the use of \c H5FD_CORE driver, please +/// For more details on the use of \c H5FD_CORE driver, please /// refer to /// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetFaplCore // Programmer: Binh-Minh Ribler - April, 2004 @@ -172,7 +172,7 @@ void FileAccPropList::setCore (size_t increment, hbool_t backing_store) const // Function: FileAccPropList::getCore ///\brief Queries core file driver properties. ///\param increment - OUT: Size of memory increment, in bytes -///\param backing_store - OUT: Indicating whether to write the file +///\param backing_store - OUT: Indicating whether to write the file /// contents to disk when the file is closed ///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 @@ -251,7 +251,7 @@ FileAccPropList FileAccPropList::getFamily(hsize_t& memb_size) const //-------------------------------------------------------------------------- // Function: FileAccPropList::setSplit -///\brief Emulates the old split file driver, which stored meta data +///\brief Emulates the old split file driver, which stored meta data /// in one file and raw data in another file. ///\param meta_plist - IN: File access plist for the metadata file ///\param raw_plist - IN: File access plist for the raw data file @@ -374,7 +374,7 @@ void FileAccPropList::setSieveBufSize(size_t bufsize) const //-------------------------------------------------------------------------- // Function: FileAccPropList::setMetaBlockSize ///\brief Sets the minimum size of metadata block allocations. -///\param block_size - IN: Minimum size, in bytes, of metadata +///\param block_size - IN: Minimum size, in bytes, of metadata /// block allocations ///\exception H5::PropListIException ///\par Description @@ -470,9 +470,9 @@ void FileAccPropList::setSec2() const ///\param alignment - IN: Alignment value ///\exception H5::PropListIException ///\par Description -/// The parameter \a threshold must have a non-negative value. -/// Note that setting the threshold value to 0 (zero) has the -/// effect of a special case, forcing everything to be aligned. +/// The parameter \a threshold must have a non-negative value. +/// Note that setting the threshold value to 0 (zero) has the +/// effect of a special case, forcing everything to be aligned. /// The parameter \a alignment must have a positive value. /// /// For detail on \a setting alignment, please refer to @@ -490,7 +490,7 @@ void FileAccPropList::setAlignment( hsize_t threshold, hsize_t alignment ) const //-------------------------------------------------------------------------- // Function: FileAccPropList::getAlignment -///\brief Returns the current settings for alignment properties from +///\brief Returns the current settings for alignment properties from /// this property list. ///\param threshold - OUT: Retrieved threshold value for file object size ///\param alignment - OUT: Retrieved alignment value @@ -555,12 +555,12 @@ H5FD_mem_t FileAccPropList::getMultiType() const ///\param rdcc_w0 - IN: Preemption policy ///\exception H5::PropListIException ///\par Description -/// The argument \a rdcc_w0 should hold a value between 0 and 1 -/// inclusive. This value indicates how much chunks that have -/// been fully read are favored for preemption. A value of zero -/// means fully read chunks are treated no differently than other -/// chunks (the preemption is strictly LRU) while a value of one -/// means fully read chunks are always preempted before other chunks. +/// The argument \a rdcc_w0 should hold a value between 0 and 1 +/// inclusive. This value indicates how much chunks that have +/// been fully read are favored for preemption. A value of zero +/// means fully read chunks are treated no differently than other +/// chunks (the preemption is strictly LRU) while a value of one +/// means fully read chunks are always preempted before other chunks. // Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileAccPropList::setCache( int mdc_nelmts, size_t rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0 ) const @@ -594,7 +594,7 @@ void FileAccPropList::getCache( int& mdc_nelmts, size_t& rdcc_nelmts, size_t& rd //-------------------------------------------------------------------------- // Function: FileAccPropList::setFcloseDegree ///\brief Sets the degree for the file close behavior. -///\param degree - IN: +///\param degree - IN: ///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- @@ -628,8 +628,8 @@ H5F_close_degree_t FileAccPropList::getFcloseDegree() //-------------------------------------------------------------------------- // Function: FileAccPropList::setGcReferences ///\brief Sets garbage collecting references flag. -///\param gc_ref - IN: Flag setting reference garbage collection to -/// on (1) or off (0). +///\param gc_ref - IN: Flag setting reference garbage collection to +/// on (1) or off (0). ///\exception H5::PropListIException ///\par Description /// For detail on \a fapl, please refer to diff --git a/c++/src/H5FaccProp.h b/c++/src/H5FaccProp.h index d77fa49..143c3ab 100644 --- a/c++/src/H5FaccProp.h +++ b/c++/src/H5FaccProp.h @@ -58,9 +58,9 @@ class H5_DLLCPP FileAccPropList : public PropList { FileAccPropList getFamily(hsize_t& memb_size) const; // Emulates the old split file driver, - void setSplit( FileAccPropList& meta_plist, FileAccPropList& raw_plist, + void setSplit( FileAccPropList& meta_plist, FileAccPropList& raw_plist, const char* meta_ext = ".meta", const char* raw_ext = ".raw" ) const; - void setSplit( FileAccPropList& meta_plist, FileAccPropList& raw_plist, + void setSplit( FileAccPropList& meta_plist, FileAccPropList& raw_plist, const string& meta_ext, const string& raw_ext ) const; #ifdef H5_HAVE_STREAM // for Stream Virtual File Driver diff --git a/c++/src/H5FcreatProp.cpp b/c++/src/H5FcreatProp.cpp index 0eb9462..b776f6a 100644 --- a/c++/src/H5FcreatProp.cpp +++ b/c++/src/H5FcreatProp.cpp @@ -38,7 +38,7 @@ FileCreatPropList::FileCreatPropList() : PropList( H5P_FILE_CREATE ) {} //-------------------------------------------------------------------------- // Function: FileCreatPropList copy constructor -///\brief Copy constructor: makes a copy of the original +///\brief Copy constructor: makes a copy of the original /// FileCreatPropList object. ///\param original - IN: FileCreatPropList instance to copy // Programmer Binh-Minh Ribler - 2000 @@ -71,7 +71,7 @@ void FileCreatPropList::getVersion(unsigned& super, unsigned& freelist, unsigned herr_t ret_value = H5Pget_version( id, &super, &freelist, &stab, &shhdr ); if( ret_value < 0 ) { - throw PropListIException("FileCreatPropList::getVersion", + throw PropListIException("FileCreatPropList::getVersion", "H5Pget_version failed"); } } @@ -82,7 +82,7 @@ void FileCreatPropList::getVersion(unsigned& super, unsigned& freelist, unsigned ///\param size - IN: User block size to be set, in bytes ///\exception H5::PropListIException ///\par Description -/// The default user block size is 0; it may be set to any power +/// The default user block size is 0; it may be set to any power /// of 2 equal to 512 or greater (512, 1024, 2048, etc.) // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -91,7 +91,7 @@ void FileCreatPropList::setUserblock( hsize_t size ) const herr_t ret_value = H5Pset_userblock( id, size); if( ret_value < 0 ) { - throw PropListIException("FileCreatPropList::setUserblock", + throw PropListIException("FileCreatPropList::setUserblock", "H5Pset_userblock failed"); } } @@ -109,7 +109,7 @@ hsize_t FileCreatPropList::getUserblock() const herr_t ret_value = H5Pget_userblock( id, &userblock_size ); if( ret_value < 0 ) { - throw PropListIException("FileCreatPropList::getUserblock", + throw PropListIException("FileCreatPropList::getUserblock", "H5Pget_userblock failed"); } return( userblock_size ); @@ -117,10 +117,10 @@ hsize_t FileCreatPropList::getUserblock() const //-------------------------------------------------------------------------- // Function: FileCreatPropList::setSizes -///\brief Sets the byte size of the offsets and lengths used to +///\brief Sets the byte size of the offsets and lengths used to /// address objects in an HDF5 file. ///\param sizeof_addr - IN: Size of an object offset in bytes -///\param sizeof_size - IN: Size of an object length in bytes. +///\param sizeof_size - IN: Size of an object length in bytes. ///\exception H5::PropListIException ///\par Description /// For information on setting sizes, please refer to the @@ -133,14 +133,14 @@ void FileCreatPropList::setSizes( size_t sizeof_addr, size_t sizeof_size ) const herr_t ret_value = H5Pset_sizes( id, sizeof_addr, sizeof_size ); if( ret_value < 0 ) { - throw PropListIException("FileCreatPropList::setSizes", + throw PropListIException("FileCreatPropList::setSizes", "H5Pset_sizes failed"); } } //-------------------------------------------------------------------------- // Function: FileCreatPropList::getSizes -///\brief Retrieves the size of the offsets and lengths used in an +///\brief Retrieves the size of the offsets and lengths used in an /// HDF5 file. /// ///\exception H5::PropListIException @@ -151,14 +151,14 @@ void FileCreatPropList::getSizes( size_t& sizeof_addr, size_t& sizeof_size ) con herr_t ret_value = H5Pget_sizes( id, &sizeof_addr, &sizeof_size ); if( ret_value < 0 ) { - throw PropListIException("FileCreatPropList::getSizes", + throw PropListIException("FileCreatPropList::getSizes", "H5Pget_sizes failed"); } } //-------------------------------------------------------------------------- // Function: FileCreatPropList::setSymk -///\brief Sets the size of parameters used to control the symbol table +///\brief Sets the size of parameters used to control the symbol table /// nodes. ///\param ik - IN: Symbol table tree rank ///\param lk - IN: Symbol table node size @@ -173,14 +173,14 @@ void FileCreatPropList::setSymk( unsigned ik, unsigned lk ) const herr_t ret_value = H5Pset_sym_k( id, ik, lk ); if( ret_value < 0 ) { - throw PropListIException("FileCreatPropList::setSymk", + throw PropListIException("FileCreatPropList::setSymk", "H5Pset_sym_k failed"); } } //-------------------------------------------------------------------------- // Function: FileCreatPropList::getSymk -///\brief Retrieves the size of the symbol table B-tree 1/2 rank and +///\brief Retrieves the size of the symbol table B-tree 1/2 rank and /// the symbol table leaf node 1/2 size. /// ///\exception H5::PropListIException @@ -194,14 +194,14 @@ void FileCreatPropList::getSymk( unsigned& ik, unsigned& lk ) const herr_t ret_value = H5Pget_sym_k( id, &ik, &lk ); if( ret_value < 0 ) { - throw PropListIException("FileCreatPropList::getSymk", + throw PropListIException("FileCreatPropList::getSymk", "H5Pget_sym_k failed"); } } //-------------------------------------------------------------------------- // Function: FileCreatPropList::setIstorek -///\brief Sets the size of the parameter used to control the B-trees +///\brief Sets the size of the parameter used to control the B-trees /// for indexing chunked datasets. ///\param ik - IN: 1/2 rank of chunked storage B-tree ///\exception H5::PropListIException @@ -215,7 +215,7 @@ void FileCreatPropList::setIstorek( unsigned ik ) const herr_t ret_value = H5Pset_istore_k( id, ik ); if( ret_value < 0 ) { - throw PropListIException("FileCreatPropList::setIstorek", + throw PropListIException("FileCreatPropList::setIstorek", "H5Pset_istore_k failed"); } } @@ -236,7 +236,7 @@ unsigned FileCreatPropList::getIstorek() const herr_t ret_value = H5Pget_istore_k( id, &ik ); if( ret_value < 0 ) { - throw PropListIException("FileCreatPropList::getIstorek", + throw PropListIException("FileCreatPropList::getIstorek", "H5Pget_istore_k failed"); } return( ik ); diff --git a/c++/src/H5FcreatProp.h b/c++/src/H5FcreatProp.h index 6b7bfcc..4ed8868 100644 --- a/c++/src/H5FcreatProp.h +++ b/c++/src/H5FcreatProp.h @@ -25,7 +25,7 @@ class H5_DLLCPP FileCreatPropList : public PropList { public: // Default file creation property list. static const FileCreatPropList DEFAULT; - + // Retrieves version information for various parts of a file. void getVersion( unsigned& super, unsigned& freelist, unsigned& stab, unsigned& shhdr ) const; @@ -35,7 +35,7 @@ class H5_DLLCPP FileCreatPropList : public PropList { // Gets the size of a user block in this file creation property list. hsize_t getUserblock() const; - // Retrieves the size-of address and size quantities stored in a + // Retrieves the size-of address and size quantities stored in a // file according to this file creation property list. void getSizes( size_t& sizeof_addr, size_t& sizeof_size ) const; diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index 361d448..54c4f6d 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -52,21 +52,21 @@ H5File::H5File() : IdComponent() {} ///\brief Creates or opens an HDF5 file depending on the parameter flags. ///\param name - IN: Name of the file ///\param flags - IN: File access flags -///\param create_plist - IN: File creation property list, used when -/// modifying default file meta-data. Default to +///\param create_plist - IN: File creation property list, used when +/// modifying default file meta-data. Default to /// FileCreatPropList::DEFAULT -///\param access_plist - IN: File access property list. Default to +///\param access_plist - IN: File access property list. Default to /// FileCreatPropList::DEFAULT ///\par Description /// Valid values of \a flags include: -/// \li \c H5F_ACC_TRUNC - Truncate file, if it already exists, -/// erasing all data previously stored in -/// the file. -/// \li \c H5F_ACC_EXCL - Fail if file already exists. +/// \li \c H5F_ACC_TRUNC - Truncate file, if it already exists, +/// erasing all data previously stored in +/// the file. +/// \li \c H5F_ACC_EXCL - Fail if file already exists. /// \c H5F_ACC_TRUNC and \c H5F_ACC_EXCL are mutually exclusive -/// \li \c H5F_ACC_DEBUG - print debug information. This flag is -/// used only by HDF5 library developers; it is neither -/// tested nor supported for use in applications. +/// \li \c H5F_ACC_DEBUG - print debug information. This flag is +/// used only by HDF5 library developers; it is neither +/// tested nor supported for use in applications. ///\par /// For info on file creation in the case of an already-open file, /// please refer to the \b Special \b case section in the C layer @@ -81,14 +81,14 @@ H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& c //-------------------------------------------------------------------------- // Function: H5File overloaded constructor -///\brief This is another overloaded constructor. It differs from the +///\brief This is another overloaded constructor. It differs from the /// above constructor only in the type of the \a name argument. ///\param name - IN: Name of the file - \c std::string ///\param flags - IN: File access flags -///\param create_plist - IN: File creation property list, used when -/// modifying default file meta-data. Default to +///\param create_plist - IN: File creation property list, used when +/// modifying default file meta-data. Default to /// FileCreatPropList::DEFAULT -///\param access_plist - IN: File access property list. Default to +///\param access_plist - IN: File access property list. Default to /// FileCreatPropList::DEFAULT // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -98,7 +98,7 @@ H5File::H5File( const string& name, unsigned int flags, const FileCreatPropList& } //-------------------------------------------------------------------------- -// This function is private and contains common code between the +// This function is private and contains common code between the // constructors taking a string or a char* // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -145,16 +145,16 @@ H5File::H5File( const H5File& original ) : IdComponent( original ) {} ///\exception H5::FileIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -bool H5File::isHdf5(const char* name ) +bool H5File::isHdf5(const char* name ) { - // Calls C routine H5Fis_hdf5 to determine whether the file is in + // Calls C routine H5Fis_hdf5 to determine whether the file is in // HDF5 format. It returns positive value, 0, or negative value htri_t ret_value = H5Fis_hdf5( name ); if( ret_value > 0 ) return true; else if( ret_value == 0 ) return false; - else // Raise exception when H5Fis_hdf5 returns a negative value + else // Raise exception when H5Fis_hdf5 returns a negative value { throw FileIException("H5File::isHdf5", "H5Fis_hdf5 returned negative value"); } @@ -167,7 +167,7 @@ bool H5File::isHdf5(const char* name ) ///\param name - IN: Name of the file - \c std::string // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -bool H5File::isHdf5(const string& name ) +bool H5File::isHdf5(const string& name ) { return( isHdf5( name.c_str()) ); } @@ -288,21 +288,21 @@ hssize_t H5File::getFreeSpace() const //-------------------------------------------------------------------------- // Function: H5File::getObjCount -///\brief Returns the number of opened object IDs (files, datasets, +///\brief Returns the number of opened object IDs (files, datasets, /// groups and datatypes) in the same file. -///\param types - Type of object to retrieve the count +///\param types - Type of object to retrieve the count ///\return Number of opened object IDs ///\exception H5::FileIException ///\par Description /// The valid values for \a types include: -/// \li \c H5F_OBJ_FILE - Files only -/// \li \c H5F_OBJ_DATASET - Datasets only -/// \li \c H5F_OBJ_GROUP - Groups only -/// \li \c H5F_OBJ_DATATYPE - Named datatypes only -/// \li \c H5F_OBJ_ATTR - Attributes only -/// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE -/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP -/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR +/// \li \c H5F_OBJ_FILE - Files only +/// \li \c H5F_OBJ_DATASET - Datasets only +/// \li \c H5F_OBJ_GROUP - Groups only +/// \li \c H5F_OBJ_DATATYPE - Named datatypes only +/// \li \c H5F_OBJ_ATTR - Attributes only +/// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE +/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP +/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR ///\par /// Multiple object types can be combined with the logical OR operator (|). // Programmer Binh-Minh Ribler - May 2004 @@ -320,7 +320,7 @@ int H5File::getObjCount(unsigned types) const //-------------------------------------------------------------------------- // Function: H5File::getObjCount ///\brief This is an overloaded member function, provided for convenience. -/// It takes no parameter and returns the object count of all +/// It takes no parameter and returns the object count of all /// object types. ///\return Number of opened object IDs ///\exception H5::FileIException @@ -338,23 +338,23 @@ int H5File::getObjCount() const //-------------------------------------------------------------------------- // Function: H5File::getObjIDs -///\brief Retrieves a list of opened object IDs (files, datasets, +///\brief Retrieves a list of opened object IDs (files, datasets, /// groups and datatypes) in the same file. -///\param types - Type of object to retrieve the count -///\param max_objs - Maximum number of object identifiers to place +///\param types - Type of object to retrieve the count +///\param max_objs - Maximum number of object identifiers to place /// into obj_id_list. ///\param oid_list - List of open object identifiers ///\exception H5::FileIException ///\par Description /// The valid values for \a types include: -/// \li \c H5F_OBJ_FILE - Files only -/// \li \c H5F_OBJ_DATASET - Datasets only -/// \li \c H5F_OBJ_GROUP - Groups only -/// \li \c H5F_OBJ_DATATYPE - Named datatypes only -/// \li \c H5F_OBJ_ATTR - Attributes only -/// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE -/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP -/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR +/// \li \c H5F_OBJ_FILE - Files only +/// \li \c H5F_OBJ_DATASET - Datasets only +/// \li \c H5F_OBJ_GROUP - Groups only +/// \li \c H5F_OBJ_DATATYPE - Named datatypes only +/// \li \c H5F_OBJ_ATTR - Attributes only +/// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE +/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP +/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR ///\par /// Multiple object types can be combined with the logical OR operator (|). // @@ -379,13 +379,13 @@ void H5File::getObjIDs(unsigned types, int max_objs, hid_t *oid_list) const /// the low-level virtual file driver ///\exception H5::FileIException ///\par Description -/// For the \c FAMILY or \c MULTI drivers, \a fapl should be -/// defined through the property list functions: -/// \c FileAccPropList::setFamilyOffset for the \c FAMILY driver +/// For the \c FAMILY or \c MULTI drivers, \a fapl should be +/// defined through the property list functions: +/// \c FileAccPropList::setFamilyOffset for the \c FAMILY driver /// and \c FileAccPropList::setMultiType for the \c MULTI driver. /// -/// The obtained file handle is dynamic and is valid only while -/// the file remains open; it will be invalid if the file is +/// The obtained file handle is dynamic and is valid only while +/// the file remains open; it will be invalid if the file is /// closed and reopened or opened during a subsequent session. // Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- @@ -466,11 +466,11 @@ void* H5File::Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_t ///\return A reference ///\exception H5::IdComponentException ///\par Description -// This function passes H5R_OBJECT and -1 to the protected +// This function passes H5R_OBJECT and -1 to the protected // function for it to pass to the C API H5Rcreate // to create a reference to the named object. ///\par -/// Note that, for H5File, name must be an absolute path to the +/// Note that, for H5File, name must be an absolute path to the /// object in the file. // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- @@ -503,10 +503,10 @@ void* H5File::Reference(const string& name) const ///\param ref - IN: Reference to query ///\param ref_type - IN: Type of reference to query ///\return Object type, which can be one of the following: -/// \li \c H5G_LINK - Object is a symbolic link. -/// \li \c H5G_GROUP - Object is a group. -/// \li \c H5G_DATASET - Object is a dataset. -/// \li \c H5G_TYPE - Object is a named datatype +/// \li \c H5G_LINK - Object is a symbolic link. +/// \li \c H5G_GROUP - Object is a group. +/// \li \c H5G_DATASET - Object is a dataset. +/// \li \c H5G_TYPE - Object is a named datatype ///\exception H5::IdComponentException // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- @@ -546,7 +546,7 @@ DataSpace H5File::getRegion(void *ref, H5R_type_t ref_type) const ///\return File size ///\exception H5::FileIException ///\par Description -/// This function is called after an existing file is opened in +/// This function is called after an existing file is opened in /// order to learn the true size of the underlying file. // Programmer Raymond Lu - June 24, 2004 //-------------------------------------------------------------------------- @@ -599,30 +599,30 @@ void H5File::close() ///\param msg - Message describing the failure ///\exception H5::FileIException // Description -// This function is used in CommonFG implementation so that -// proper exception can be thrown for file or group. The -// argument func_name is a member of CommonFG and "H5File::" -// will be inserted to indicate the function called is an +// This function is used in CommonFG implementation so that +// proper exception can be thrown for file or group. The +// argument func_name is a member of CommonFG and "H5File::" +// will be inserted to indicate the function called is an // implementation of H5File. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5File::throwException(const string func_name, const string msg) const { string full_name = func_name; - full_name.insert(0, "H5File::"); + full_name.insert(0, "H5File::"); throw FileIException(full_name, msg); } //-------------------------------------------------------------------------- // Function: H5File destructor -///\brief Properly terminates access to this file. +///\brief Properly terminates access to this file. // Programmer Binh-Minh Ribler - 2000 // Modification // Replaced resetIdComponent with decRefCount to use C library // ID reference counting mechanism - June 1, 2004 //-------------------------------------------------------------------------- -H5File::~H5File() -{ +H5File::~H5File() +{ // The HDF5 file id will be closed properly try { decRefCount(); @@ -630,7 +630,7 @@ H5File::~H5File() catch (Exception close_error) { cerr << "H5File::~H5File - " << close_error.getDetailMsg() << endl; } -} +} #ifndef H5_NO_NAMESPACE } // end namespace diff --git a/c++/src/H5File.h b/c++/src/H5File.h index 3b7ffaf..0aad671 100644 --- a/c++/src/H5File.h +++ b/c++/src/H5File.h @@ -48,12 +48,12 @@ class H5_DLLCPP H5File : public IdComponent, public CommonFG { // Returns the amount of free space in the file. hssize_t getFreeSpace() const; - // Returns the number of opened object IDs (files, datasets, groups + // Returns the number of opened object IDs (files, datasets, groups // and datatypes) in the same file. int getObjCount(unsigned types) const; int getObjCount() const; - // Retrieves a list of opened object IDs (files, datasets, groups + // Retrieves a list of opened object IDs (files, datasets, groups // and datatypes) in the same file. void getObjIDs(unsigned types, int max_objs, hid_t *oid_list) const; @@ -75,7 +75,7 @@ class H5_DLLCPP H5File : public IdComponent, public CommonFG { void reOpen(); // added for better name void reopen(); - // Creates a reference to a named Hdf5 object or to a dataset region + // Creates a reference to a named Hdf5 object or to a dataset region // in this object. void* Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_type = H5R_DATASET_REGION) const; diff --git a/c++/src/H5FloatType.cpp b/c++/src/H5FloatType.cpp index a5b1c51..530868f 100644 --- a/c++/src/H5FloatType.cpp +++ b/c++/src/H5FloatType.cpp @@ -56,7 +56,7 @@ FloatType::FloatType( const PredType& pred_type ) : AtomType() //-------------------------------------------------------------------------- // Function: FloatType overloaded constructor -///\brief Creates an FloatType object using the id of an existing +///\brief Creates an FloatType object using the id of an existing /// datatype. ///\param existing_id - IN: Id of an existing datatype ///\exception H5::DataTypeIException @@ -74,7 +74,7 @@ FloatType::FloatType( const FloatType& original ) : AtomType( original ){} //-------------------------------------------------------------------------- // Function: EnumType overloaded constructor ///\brief Gets the floating-point datatype of the specified dataset -///\param dataset - IN: Dataset that this floating-point datatype +///\param dataset - IN: Dataset that this floating-point datatype /// associates with ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 @@ -92,7 +92,7 @@ FloatType::FloatType( const DataSet& dataset ) : AtomType() //-------------------------------------------------------------------------- // Function: FloatType::getFields -///\brief Retrieves floating point datatype bit field information. +///\brief Retrieves floating point datatype bit field information. ///\param spos - OUT: Retrieved floating-point sign bit ///\param epos - OUT: Retrieved exponent bit-position ///\param esize - OUT: Retrieved size of exponent, in bits @@ -112,8 +112,8 @@ void FloatType::getFields( size_t& spos, size_t& epos, size_t& esize, size_t& mp //-------------------------------------------------------------------------- // Function: FloatType::setFields -///\brief Sets locations and sizes of floating point bit fields. -///\param spos - OUT: Sign position, i.e., the bit offset of the +///\brief Sets locations and sizes of floating point bit fields. +///\param spos - OUT: Sign position, i.e., the bit offset of the /// floating-point sign bit. ///\param epos - OUT: Exponent bit position ///\param esize - OUT: Size of exponent, in bits @@ -133,7 +133,7 @@ void FloatType::setFields( size_t spos, size_t epos, size_t esize, size_t mpos, //-------------------------------------------------------------------------- // Function: FloatType::getEbias -///\brief Retrieves the exponent bias of a floating-point type. +///\brief Retrieves the exponent bias of a floating-point type. ///\return Exponent bias ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 @@ -151,7 +151,7 @@ size_t FloatType::getEbias() const //-------------------------------------------------------------------------- // Function: FloatType::setEbias -///\brief Sets the exponent bias of a floating-point type. +///\brief Sets the exponent bias of a floating-point type. ///\param ebias - Exponent bias value ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 @@ -167,16 +167,16 @@ void FloatType::setEbias( size_t ebias ) const //-------------------------------------------------------------------------- // Function: FloatType::getNorm -///\brief Retrieves mantissa normalization of a floating-point datatype. +///\brief Retrieves mantissa normalization of a floating-point datatype. ///\param norm_string - OUT: Text string of the normalization type ///\return Valid normalization type, which can be: /// \li \c H5T_NORM_IMPLIED (0) - MSB of mantissa is not stored -/// \li \c H5T_NORM_MSBSET (1) - MSB of mantissa is always 1 -/// \li \c H5T_NORM_NONE (2) - Mantissa is not normalized +/// \li \c H5T_NORM_MSBSET (1) - MSB of mantissa is always 1 +/// \li \c H5T_NORM_NONE (2) - Mantissa is not normalized ///\exception H5::DataTypeIException ///\par Description -/// For your convenience, this function also provides the text -/// string of the returned normalization type, via parameter +/// For your convenience, this function also provides the text +/// string of the returned normalization type, via parameter /// \a norm_string. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -199,14 +199,14 @@ H5T_norm_t FloatType::getNorm( string& norm_string ) const //-------------------------------------------------------------------------- // Function: FloatType::setNorm -///\brief Sets the mantissa normalization of a floating-point datatype. +///\brief Sets the mantissa normalization of a floating-point datatype. ///\param norm - IN: Mantissa normalization type ///\exception H5::DataTypeIException ///\par Description /// Valid values for normalization type include: /// \li \c H5T_NORM_IMPLIED (0) - MSB of mantissa is not stored -/// \li \c H5T_NORM_MSBSET (1) - MSB of mantissa is always 1 -/// \li \c H5T_NORM_NONE (2) - Mantissa is not normalized +/// \li \c H5T_NORM_MSBSET (1) - MSB of mantissa is always 1 +/// \li \c H5T_NORM_NONE (2) - Mantissa is not normalized // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FloatType::setNorm( H5T_norm_t norm ) const @@ -220,16 +220,16 @@ void FloatType::setNorm( H5T_norm_t norm ) const //-------------------------------------------------------------------------- // Function: FloatType::getInpad -///\brief Retrieves the internal padding type for unused bits in -/// this floating-point datatypes. +///\brief Retrieves the internal padding type for unused bits in +/// this floating-point datatypes. ///\return Internal padding type, which can be: /// \li \c H5T_PAD_ZERO (0) - Set background to zeros /// \li \c H5T_PAD_ONE (1) - Set background to ones /// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone ///\exception H5::DataTypeIException ///\par Description -/// For your convenience, this function also provides the text -/// string of the returned internal padding type, via parameter +/// For your convenience, this function also provides the text +/// string of the returned internal padding type, via parameter /// \a pad_string. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -252,14 +252,14 @@ H5T_pad_t FloatType::getInpad( string& pad_string ) const //-------------------------------------------------------------------------- // Function: FloatType::setInpad -///\brief Fills unused internal floating point bits. +///\brief Fills unused internal floating point bits. ///\param inpad - IN: Internal padding type ///\exception H5::DataTypeIException ///\par Description -/// If any internal bits of a floating point type are unused -/// (that is, those significant bits which are not part of the -/// sign, exponent, or mantissa), then they will be filled -/// according to the padding value provided by \a inpad. +/// If any internal bits of a floating point type are unused +/// (that is, those significant bits which are not part of the +/// sign, exponent, or mantissa), then they will be filled +/// according to the padding value provided by \a inpad. ///\par /// Valid values for normalization type include: /// \li \c H5T_PAD_ZERO (0) - Set background to zeros diff --git a/c++/src/H5FloatType.h b/c++/src/H5FloatType.h index bc30963..45c992e 100644 --- a/c++/src/H5FloatType.h +++ b/c++/src/H5FloatType.h @@ -25,31 +25,31 @@ class H5_DLLCPP FloatType : public AtomType { // Creates a floating-point type using a predefined type FloatType( const PredType& pred_type ); - // Gets the floating-point datatype of the specified dataset + // Gets the floating-point datatype of the specified dataset FloatType( const DataSet& dataset ); - // Retrieves the exponent bias of a floating-point type. + // Retrieves the exponent bias of a floating-point type. size_t getEbias() const; - // Sets the exponent bias of a floating-point type. + // Sets the exponent bias of a floating-point type. void setEbias( size_t ebias ) const; - // Retrieves floating point datatype bit field information. + // Retrieves floating point datatype bit field information. void getFields( size_t& spos, size_t& epos, size_t& esize, size_t& mpos, size_t& msize ) const; - // Sets locations and sizes of floating point bit fields. + // Sets locations and sizes of floating point bit fields. void setFields( size_t spos, size_t epos, size_t esize, size_t mpos, size_t msize ) const; - // Retrieves the internal padding type for unused bits in floating-point datatypes. + // Retrieves the internal padding type for unused bits in floating-point datatypes. H5T_pad_t getInpad( string& pad_string ) const; - - // Fills unused internal floating point bits. + + // Fills unused internal floating point bits. void setInpad( H5T_pad_t inpad ) const; - // Retrieves mantissa normalization of a floating-point datatype. + // Retrieves mantissa normalization of a floating-point datatype. H5T_norm_t getNorm( string& norm_string ) const; - // Sets the mantissa normalization of a floating-point datatype. + // Sets the mantissa normalization of a floating-point datatype. void setNorm( H5T_norm_t norm ) const; // Returns this class name diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index 1d587c8..6bf25a1 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -103,7 +103,7 @@ void* Group::Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_ty ///\return A reference ///\exception H5::GroupIException ///\par Description -// This function passes H5R_OBJECT and -1 to the protected +// This function passes H5R_OBJECT and -1 to the protected // function for it to pass to the C API H5Rcreate // to create a reference to the named object. // Programmer Binh-Minh Ribler - May, 2004 @@ -137,10 +137,10 @@ void* Group::Reference(const string& name) const ///\param ref - IN: Reference to query ///\param ref_type - IN: Type of reference to query ///\return An object type, which can be one of the following: -// H5G_LINK Object is a symbolic link. -// H5G_GROUP Object is a group. -// H5G_DATASET Object is a dataset. -// H5G_TYPE Object is a named datatype +// H5G_LINK Object is a symbolic link. +// H5G_GROUP Object is a group. +// H5G_DATASET Object is a dataset. +// H5G_TYPE Object is a named datatype ///\exception H5::GroupIException // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- @@ -222,16 +222,16 @@ void Group::throwException(const string func_name, const string msg) const // ID reference counting mechanism - June 1, 2004 //-------------------------------------------------------------------------- Group::~Group() -{ +{ // The group id will be closed properly try { decRefCount(); } - catch (Exception close_error) { + catch (Exception close_error) { cerr << "Group::~Group - " << close_error.getDetailMsg() << endl; } -} +} #ifndef H5_NO_NAMESPACE } // end namespace diff --git a/c++/src/H5IdComponent.cpp b/c++/src/H5IdComponent.cpp index 51bdc02..ee6ea49 100644 --- a/c++/src/H5IdComponent.cpp +++ b/c++/src/H5IdComponent.cpp @@ -79,10 +79,10 @@ void IdComponent::decRefCount(const hid_t obj_id) const if (p_valid_id(obj_id)) if (H5Idec_ref(obj_id) < 0) if (H5Iget_ref(obj_id) <= 0) - throw IdComponentException(inMemFunc("decRefCount"), + throw IdComponentException(inMemFunc("decRefCount"), "object ref count is 0 or negative"); else - throw IdComponentException(inMemFunc("decRefCount"), + throw IdComponentException(inMemFunc("decRefCount"), "decrementing object ref count failed"); } @@ -158,8 +158,8 @@ H5I_type_t IdComponent::getHDFObjType(const hid_t obj_id) // Description // The underlaying reference counting in the C library ensures // that the current valid id of this object is properly closed. -// Copy the id from rhs to this object, then increment the -// reference counter of the id to indicate that another object +// Copy the id from rhs to this object, then increment the +// reference counter of the id to indicate that another object // is referencing it. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -200,7 +200,7 @@ void IdComponent::setId(const hid_t new_id) //-------------------------------------------------------------------------- // Function: IdComponent::getId -///\brief Returns the id of this object +///\brief Returns the id of this object ///\return HDF5 id // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -216,8 +216,8 @@ hid_t IdComponent::getId () const //-------------------------------------------------------------------------- IdComponent::~IdComponent() { -/* uncomment this block and complete it when deciding to use dontAtExit - unless the atexit/global destructor problem is fixed, then +/* uncomment this block and complete it when deciding to use dontAtExit + unless the atexit/global destructor problem is fixed, then remove it- BMR 11/14/00 if( id == NOTATEXIT ) @@ -242,7 +242,7 @@ IdComponent::~IdComponent() { // // Implementation of protected functions for HDF5 Reference Interface. -// +// #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- @@ -250,9 +250,9 @@ IdComponent::~IdComponent() { ///\brief Makes and returns string "::" ///\param func_name - Name of the function where failure occurs // Description -/// Concatenates the class name of this object with the -/// passed-in function name to create a string that indicates -/// where the failure occurs. The class-name is provided by +/// Concatenates the class name of this object with the +/// passed-in function name to create a string that indicates +/// where the failure occurs. The class-name is provided by /// fromClass(). This string will be used by a base class when /// an exception is thrown. // Programmer Binh-Minh Ribler - Aug 6, 2005 @@ -278,7 +278,7 @@ IdComponent::IdComponent() : id(-1) {} // Exception: H5::IdComponentException // Description: // This function is protected so that the user applications can -// only have access to its code via allowable classes, namely, +// only have access to its code via allowable classes, namely, // H5File and H5Object subclasses. // Programmer Binh-Minh Ribler - Jul, 2004 //-------------------------------------------------------------------------- @@ -338,10 +338,10 @@ void* IdComponent::p_reference(const char* name, hid_t space_id, H5R_type_t ref_ // ref - IN: Reference to query // ref_type - IN: Type of reference to query // Return An object type, which can be one of the following: -// H5G_LINK Object is a symbolic link. -// H5G_GROUP Object is a group. -// H5G_DATASET Object is a dataset. -// H5G_TYPE Object is a named datatype +// H5G_LINK Object is a symbolic link. +// H5G_GROUP Object is a group. +// H5G_DATASET Object is a dataset. +// H5G_TYPE Object is a named datatype // Exception H5::IdComponentException // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- @@ -378,7 +378,7 @@ hid_t IdComponent::p_get_region(void *ref, H5R_type_t ref_type) const // // Local functions used in this class -// +// //-------------------------------------------------------------------------- // Function: p_valid_id diff --git a/c++/src/H5IntType.cpp b/c++/src/H5IntType.cpp index f161c13..868785b 100644 --- a/c++/src/H5IntType.cpp +++ b/c++/src/H5IntType.cpp @@ -64,7 +64,7 @@ IntType::IntType( const PredType& pred_type ) : AtomType() //-------------------------------------------------------------------------- // Function: IntType overloaded constructor -///\brief Creates an integer datatype using the id of an existing +///\brief Creates an integer datatype using the id of an existing /// datatype. ///\param existing_id - IN: Id of an existing datatype ///\exception H5::DataTypeIException @@ -80,7 +80,7 @@ IntType::IntType( const hid_t existing_id ) : AtomType( existing_id ) {} // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IntType::IntType( const DataSet& dataset ) : AtomType() -{ +{ // Calls C function H5Dget_type to get the id of the datatype id = H5Dget_type( dataset.getId() ); @@ -88,7 +88,7 @@ IntType::IntType( const DataSet& dataset ) : AtomType() { throw DataSetIException("IntType constructor", "H5Dget_type failed"); } -} +} //-------------------------------------------------------------------------- // Function: IntType::getSign @@ -104,7 +104,7 @@ H5T_sign_t IntType::getSign() const // Returns a valid sign type if no errors if( type_sign == H5T_SGN_ERROR ) { - throw DataTypeIException("IntType::getSign", + throw DataTypeIException("IntType::getSign", "H5Tget_sign failed - returned H5T_SGN_ERROR for the sign type"); } return( type_sign ); @@ -112,7 +112,7 @@ H5T_sign_t IntType::getSign() const //-------------------------------------------------------------------------- // Function: IntType::getSign -///\brief Sets the sign property for an integer type. +///\brief Sets the sign property for an integer type. ///\param sign - IN: Sign type ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 diff --git a/c++/src/H5IntType.h b/c++/src/H5IntType.h index ab43d0f..6178e3f 100644 --- a/c++/src/H5IntType.h +++ b/c++/src/H5IntType.h @@ -30,7 +30,7 @@ class H5_DLLCPP IntType : public AtomType { // Retrieves the sign type for an integer type H5T_sign_t getSign() const; - // Sets the sign proprety for an integer type. + // Sets the sign proprety for an integer type. void setSign( H5T_sign_t sign ) const; // Returns this class name diff --git a/c++/src/H5Library.cpp b/c++/src/H5Library.cpp index 8c0aace..71fdc7a 100644 --- a/c++/src/H5Library.cpp +++ b/c++/src/H5Library.cpp @@ -14,7 +14,7 @@ #include -#include "H5CppDoc.h" // included only for Doxygen to generate part of RM +#include "H5CppDoc.h" // included only for Doxygen to generate part of RM #include "H5Include.h" #include "H5Exception.h" #include "H5Library.h" @@ -30,7 +30,7 @@ bool H5Library::need_cleanup = false; //-------------------------------------------------------------------------- // Function: H5Library::open -///\brief Initializes the HDF5 library. +///\brief Initializes the HDF5 library. /// ///\exception H5::LibraryIException // Programmer Binh-Minh Ribler - 2000 @@ -46,7 +46,7 @@ void H5Library::open() //-------------------------------------------------------------------------- // Function: H5Library::close -///\brief Flushes all data to disk, closes files, and cleans up memory. +///\brief Flushes all data to disk, closes files, and cleans up memory. /// ///\exception H5::LibraryIException // Programmer Binh-Minh Ribler - 2000 @@ -78,7 +78,7 @@ void H5Library::dontAtExit() //-------------------------------------------------------------------------- // Function: H5Library::getLibVersion -///\brief Returns the HDF library release number. +///\brief Returns the HDF library release number. ///\param majnum - OUT: Major version of the library ///\param minnum - OUT: Minor version of the library ///\param relnum - OUT: Release number of the library @@ -96,7 +96,7 @@ void H5Library::getLibVersion( unsigned& majnum, unsigned& minnum, unsigned& rel //-------------------------------------------------------------------------- // Function: H5Library::checkVersion -///\brief Verifies that the arguments match the version numbers +///\brief Verifies that the arguments match the version numbers /// compiled into the library ///\param majnum - IN: Major version of the library ///\param minnum - IN: Minor version of the library @@ -120,21 +120,21 @@ void H5Library::checkVersion(unsigned majnum, unsigned minnum, unsigned relnum) //-------------------------------------------------------------------------- // Function: H5Library::garbageCollect ///\brief Walks through all the garbage collection routines for the -/// library, which are supposed to free any unused memory they +/// library, which are supposed to free any unused memory they /// have allocated. /// ///\exception H5::LibraryIException ///\par Description -/// It is not required that H5Library::garbageCollect be called -/// at any particular time; it is only necessary in certain -/// situations, such as when the application has performed actions -/// that cause the library to allocate many objects. The -/// application should call H5Library::garbageCollect if it -/// eventually releases those objects and wants to reduce the -/// memory used by the library from the peak usage required. +/// It is not required that H5Library::garbageCollect be called +/// at any particular time; it is only necessary in certain +/// situations, such as when the application has performed actions +/// that cause the library to allocate many objects. The +/// application should call H5Library::garbageCollect if it +/// eventually releases those objects and wants to reduce the +/// memory used by the library from the peak usage required. ///\par -/// The library automatically garbage collects all the free -/// lists when the application ends. +/// The library automatically garbage collects all the free +/// lists when the application ends. // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- void H5Library::garbageCollect() @@ -158,13 +158,13 @@ void H5Library::garbageCollect() ///\exception H5::LibraryIException ///\par Description /// Setting a value of -1 for a limit means no limit of that type. -/// For more information on free list limits, please refer to C +/// For more information on free list limits, please refer to C /// layer Reference Manual at: /// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5.html#Library-SetFreeListLimits // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- -void H5Library::setFreeListLimits(int reg_global_lim, int reg_list_lim, - int arr_global_lim, int arr_list_lim, int blk_global_lim, +void H5Library::setFreeListLimits(int reg_global_lim, int reg_list_lim, + int arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim) { herr_t ret_value = H5set_free_list_limits(reg_global_lim, reg_list_lim, arr_global_lim, arr_list_lim, blk_global_lim, blk_list_lim); diff --git a/c++/src/H5Library.h b/c++/src/H5Library.h index 4208cfb..58a53ad 100644 --- a/c++/src/H5Library.h +++ b/c++/src/H5Library.h @@ -23,7 +23,7 @@ namespace H5 { #ifndef DOXYGEN_SHOULD_SKIP_THIS #define NOTATEXIT (-10) // just in case the HDF5 library use more // negative constants. Note: the solution used for the atexit/global - // destructors is not reliable, and desperately needs improvement + // destructors is not reliable, and desperately needs improvement // It is not even working, inifiteloop message still printed when // calling H5close #endif // DOXYGEN_SHOULD_SKIP_THIS @@ -34,30 +34,30 @@ class H5_DLLCPP H5Library { static bool need_cleanup; // indicates if H5close should be called #endif // DOXYGEN_SHOULD_SKIP_THIS - // Initializes the HDF5 library. - static void open(); + // Initializes the HDF5 library. + static void open(); - // Flushes all data to disk, closes files, and cleans up memory. - static void close(); + // Flushes all data to disk, closes files, and cleans up memory. + static void close(); // Instructs library not to install atexit cleanup routine - static void dontAtExit(); + static void dontAtExit(); - // Returns the HDF library release number. - static void getLibVersion( unsigned& majnum, unsigned& minnum, unsigned& relnum ); + // Returns the HDF library release number. + static void getLibVersion( unsigned& majnum, unsigned& minnum, unsigned& relnum ); // Verifies that the arguments match the version numbers compiled // into the library - static void checkVersion( unsigned majnum, unsigned minnum, unsigned relnum ); + static void checkVersion( unsigned majnum, unsigned minnum, unsigned relnum ); - // Walks through all the garbage collection routines for the library, + // Walks through all the garbage collection routines for the library, // which are supposed to free any unused memory they have allocated. static void garbageCollect(); // Sets limits on the different kinds of free lists. static void setFreeListLimits(int reg_global_lim, int reg_list_lim, int arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim); - + private: // Default constructor - no instance ever created H5Library() {}; diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp index 27c62ad..7e477ea 100644 --- a/c++/src/H5Object.cpp +++ b/c++/src/H5Object.cpp @@ -32,7 +32,7 @@ namespace H5 { #ifndef DOXYGEN_SHOULD_SKIP_THIS // userAttrOpWrpr simply interfaces between the user's function and the -// C library function H5Aiterate; used to resolve the different prototype +// C library function H5Aiterate; used to resolve the different prototype // problem. May be moved to Iterator later. extern "C" herr_t userAttrOpWrpr( hid_t loc_id, const char* attr_name, void* op_data ) { @@ -49,7 +49,7 @@ extern "C" herr_t userAttrOpWrpr( hid_t loc_id, const char* attr_name, void* op_ //-------------------------------------------------------------------------- // Function: H5Object default constructor (protected) // Description -// The id is set by IdComponent() but subclass constructor will +// The id is set by IdComponent() but subclass constructor will // set it to a valid HDF5 id. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -57,7 +57,7 @@ H5Object::H5Object() : IdComponent() {} //-------------------------------------------------------------------------- // Function: H5Object overloaded constructor (protected) -// Purpose Creates an H5Object object using the id of an existing HDF5 +// Purpose Creates an H5Object object using the id of an existing HDF5 // object. // Parameters object_id - IN: Id of an existing HDF5 object // Programmer Binh-Minh Ribler - 2000 @@ -68,7 +68,7 @@ H5Object::H5Object( const hid_t object_id ) : IdComponent( object_id ) {} //-------------------------------------------------------------------------- // Function: H5Object copy constructor -///\brief Copy constructor: makes a copy of the original H5Object +///\brief Copy constructor: makes a copy of the original H5Object /// instance. ///\param original - IN: H5Object instance to copy // Programmer Binh-Minh Ribler - 2000 @@ -80,18 +80,18 @@ H5Object::H5Object( const H5Object& original ) : IdComponent( original ) {} ///\brief Creates an attribute for a group, dataset, or named datatype. ///\param name - IN: Name of the attribute ///\param data_type - IN: Datatype for the attribute -///\param data_space - IN: Dataspace for the attribute - only simple +///\param data_space - IN: Dataspace for the attribute - only simple /// dataspaces are allowed at this time -///\param create_plist - IN: Creation property list - default to +///\param create_plist - IN: Creation property list - default to /// PropList::DEFAULT ///\return Attribute instance ///\exception H5::AttributeIException ///\par Description -/// The attribute name specified in \a name must be unique. -/// Attempting to create an attribute with the same name as an -/// existing attribute will raise an exception, leaving the -/// pre-existing attribute intact. To overwrite an existing -/// attribute with a new attribute of the same name, first +/// The attribute name specified in \a name must be unique. +/// Attempting to create an attribute with the same name as an +/// existing attribute will raise an exception, leaving the +/// pre-existing attribute intact. To overwrite an existing +/// attribute with a new attribute of the same name, first /// delete the existing one with \c H5Object::removeAttr, then /// recreate it with this function. // Programmer Binh-Minh Ribler - 2000 @@ -118,7 +118,7 @@ Attribute H5Object::createAttribute( const char* name, const DataType& data_type //-------------------------------------------------------------------------- // Function: H5Object::createAttribute ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes +/// It differs from the above function in that it takes /// a reference to an \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -152,7 +152,7 @@ Attribute H5Object::openAttribute( const char* name ) const //-------------------------------------------------------------------------- // Function: H5Object::openAttribute ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes +/// It differs from the above function in that it takes /// a reference to an \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -189,7 +189,7 @@ Attribute H5Object::openAttribute( const unsigned int idx ) const /// object, which may be a group, dataset or named datatype. ///\param user_op - IN: User's function to operate on each attribute ///\param idx - IN/OUT: Starting (IN) and ending (OUT) attribute indices -///\param op_data - IN: User's data to pass to user's operator function +///\param op_data - IN: User's data to pass to user's operator function ///\return Returned value of the last operator if it was non-zero, or /// zero if all attributes were processed ///\exception H5::AttributeIException @@ -233,7 +233,7 @@ int H5Object::getNumAttrs() const int num_attrs = H5Aget_num_attrs( id ); if( num_attrs < 0 ) { - throw AttributeIException(inMemFunc("getNumAttrs"), + throw AttributeIException(inMemFunc("getNumAttrs"), "H5Aget_num_attrs failed - returned negative number of attributes"); } else @@ -259,7 +259,7 @@ void H5Object::removeAttr( const char* name ) const //-------------------------------------------------------------------------- // Function: H5Object::removeAttr ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes +/// It differs from the above function in that it takes /// a reference to an \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -288,7 +288,7 @@ void H5Object::renameAttr(const char* oldname, const char* newname) const //-------------------------------------------------------------------------- // Function: H5Object::renameAttr ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes +/// It differs from the above function in that it takes /// a reference to an \c std::string for the names. // Programmer Binh-Minh Ribler - Mar, 2005 //-------------------------------------------------------------------------- diff --git a/c++/src/H5Object.h b/c++/src/H5Object.h index 6b0d0fd..405193f 100644 --- a/c++/src/H5Object.h +++ b/c++/src/H5Object.h @@ -18,8 +18,8 @@ #include "H5Classes.h" // constains forward class declarations -// H5Object is a baseclass. It has these subclasses: -// Group, AbstractDs, and DataType. +// H5Object is a baseclass. It has these subclasses: +// Group, AbstractDs, and DataType. // AbstractDs, in turn, has subclasses DataSet and Attribute. // DataType, in turn, has several specific datatypes as subclasses. @@ -31,8 +31,8 @@ namespace H5 { class H5_DLLCPP H5Object; // forward declaration for UserData4Aiterate // Define the operator function pointer for H5Aiterate(). -typedef void (*attr_operator_t)( H5Object& loc/*in*/, - const string attr_name/*in*/, +typedef void (*attr_operator_t)( H5Object& loc/*in*/, + const string attr_name/*in*/, void *operator_data/*in,out*/); class UserData4Aiterate { // user data for attribute iteration diff --git a/c++/src/H5PredType.cpp b/c++/src/H5PredType.cpp index 183c7d2..d16933c 100644 --- a/c++/src/H5PredType.cpp +++ b/c++/src/H5PredType.cpp @@ -33,17 +33,17 @@ namespace H5 { #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: PredType overloaded constructor -///\brief Creates a PredType object using the id of an existing +///\brief Creates a PredType object using the id of an existing /// predefined datatype. ///\param predtype_id - IN: Id of a predefined datatype // Description -// This constructor creates a predefined datatype, so it sets +// This constructor creates a predefined datatype, so it sets // DataType::is_predtype to true. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- PredType::PredType( const hid_t predtype_id ) : AtomType( predtype_id ) -{ - is_predtype = true; +{ + is_predtype = true; } //-------------------------------------------------------------------------- @@ -64,7 +64,7 @@ PredType::PredType( const PredType& original ) : AtomType( original ) {} const PredType PredType::NotAtexit; // only for atexit/global dest. problem // Definition of pre-defined types -// Note: the parameter E_xxxx_yyyy is the enum value that represents +// Note: the parameter E_xxxx_yyyy is the enum value that represents // the corresponding HDF5 predefined type H5T_xxxx_yyyy. This enum value // is stored in PredType::id since it is a PredType object id, in a way. // In addition, this storage makes things safely simpler. When a PredType @@ -514,18 +514,18 @@ hid_t PredType::getId() const void PredType::commit( H5Object& loc, const char* name ) { throw DataTypeIException("PredType::commit", "Attempting to commit a predefined datatype. This operation is invalid" ); -} +} void PredType::commit( H5Object& loc, const string& name ) { commit( loc, name.c_str()); -} +} bool PredType::committed() { throw DataTypeIException("PredType::committed", "Error: Attempting to check for commit status on a predefined datatype." ); return (0); -} +} #endif // DOXYGEN_SHOULD_SKIP_THIS // Default destructor diff --git a/c++/src/H5PredType.h b/c++/src/H5PredType.h index d444b52..28b1d32 100644 --- a/c++/src/H5PredType.h +++ b/c++/src/H5PredType.h @@ -28,7 +28,7 @@ namespace H5 { class H5_DLLCPP PredType : public AtomType { public: // Makes a copy of the predefined type and stores the new - // id in the left hand side object. + // id in the left hand side object. PredType& operator=( const PredType& rhs ); // Copy constructor - makes copy of the original object @@ -191,7 +191,7 @@ class H5_DLLCPP PredType : public AtomType { #endif // DOXYGEN_SHOULD_SKIP_THIS private: - // added this to work around the atexit/global destructor problem + // added this to work around the atexit/global destructor problem // temporarily - it'll prevent the use of atexit to clean up static const PredType NotAtexit; // not working yet @@ -207,7 +207,7 @@ class H5_DLLCPP PredType : public AtomType { E_STD_I8BE, E_STD_I8LE, E_STD_I16BE, E_STD_I16LE, E_STD_I32BE, E_STD_I32LE, E_STD_I64BE, E_STD_I64LE, E_STD_U8BE, E_STD_U8LE, E_STD_U16BE, E_STD_U16LE, E_STD_U32BE, E_STD_U32LE, E_STD_U64BE, - E_STD_U64LE, E_STD_B8BE, E_STD_B8LE, E_STD_B16BE, E_STD_B16LE, + E_STD_U64LE, E_STD_B8BE, E_STD_B8LE, E_STD_B16BE, E_STD_B16LE, E_STD_B32BE, E_STD_B32LE, E_STD_B64BE, E_STD_B64LE, E_STD_REF_OBJ, E_STD_REF_DSETREG, @@ -223,8 +223,8 @@ class H5_DLLCPP PredType : public AtomType { E_ALPHA_U16, E_ALPHA_U32, E_ALPHA_U64, E_ALPHA_B8, E_ALPHA_B16, E_ALPHA_B32, E_ALPHA_B64, E_ALPHA_F32, E_ALPHA_F64, - E_MIPS_I8, E_MIPS_I16, E_MIPS_I32, E_MIPS_I64, E_MIPS_U8, - E_MIPS_U16, E_MIPS_U32, E_MIPS_U64, E_MIPS_B8, E_MIPS_B16, + E_MIPS_I8, E_MIPS_I16, E_MIPS_I32, E_MIPS_I64, E_MIPS_U8, + E_MIPS_U16, E_MIPS_U32, E_MIPS_U64, E_MIPS_B8, E_MIPS_B16, E_MIPS_B32, E_MIPS_B64, E_MIPS_F32, E_MIPS_F64, E_NATIVE_CHAR, E_NATIVE_INT, E_NATIVE_FLOAT, E_NATIVE_SCHAR, diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp index dc9cfc3..ff46e29 100644 --- a/c++/src/H5PropList.cpp +++ b/c++/src/H5PropList.cpp @@ -54,11 +54,11 @@ PropList::PropList( const PropList& original ) : IdComponent( original ) {} ///\param plist_id - IN: Id of the existing property list ///\exception H5::PropListIException // Description -// This function calls H5Pcreate to create a new property list -// if the given id, plist_id, is that of a property class. If -// the given id is equal to H5P_NO_CLASS, then set this -// property's id to H5P_DEFAULT, otherwise, to the given id. -// Note: someone else added this code without comments and this +// This function calls H5Pcreate to create a new property list +// if the given id, plist_id, is that of a property class. If +// the given id is equal to H5P_NO_CLASS, then set this +// property's id to H5P_DEFAULT, otherwise, to the given id. +// Note: someone else added this code without comments and this // description was what I came up with from reading the code. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -115,7 +115,7 @@ void PropList::copy( const PropList& like_plist ) ///\return Reference to PropList instance ///\exception H5::PropListIException // Description -// Makes a copy of the property list on the right hand side +// Makes a copy of the property list on the right hand side // and stores the new id in the left hand side object. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -146,7 +146,7 @@ void PropList::copyProp(PropList& dest, const char *name) const //-------------------------------------------------------------------------- // Function: PropList::copyProp ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it +/// It differs from the above function only in what arguments it /// accepts. ///\param dest - IN: Destination property list or class ///\param name - IN: Name of the property to copy - \c std::string @@ -182,7 +182,7 @@ void PropList::copyProp( PropList& dest, PropList& src, const char *name ) const //-------------------------------------------------------------------------- // Function: PropList::copyProp ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it +/// It differs from the above function only in what arguments it /// accepts. - Obsolete ///\param dest - IN: Destination property list or class ///\param src - IN: Source property list or class @@ -229,7 +229,7 @@ hid_t PropList::getClass() const hid_t plist_class = H5Pget_class( id ); if( plist_class == H5P_NO_CLASS ) { - throw PropListIException(inMemFunc("getClass"), + throw PropListIException(inMemFunc("getClass"), "H5Pget_class failed - returned H5P_NO_CLASS"); } return( plist_class ); @@ -243,14 +243,14 @@ hid_t PropList::getClass() const /// false, otherwise. ///\exception H5::PropListIException ///\par Description -/// This routine checks if a property exists within a property +/// This routine checks if a property exists within a property /// list or class. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- bool PropList::propExist(const char* name ) const { - // Calls C routine H5Pexist to determine whether a property exists - // within a property list or class. It returns a positive value, 0, + // Calls C routine H5Pexist to determine whether a property exists + // within a property list or class. It returns a positive value, 0, // or a negative value htri_t ret_value = H5Pexist(id, name); if( ret_value > 0 ) @@ -265,7 +265,7 @@ bool PropList::propExist(const char* name ) const //-------------------------------------------------------------------------- // Function: PropList::propExist ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it +/// It differs from the above function only in what arguments it /// accepts. ///\param name - IN: Name of property to check for - \c std::string // Programmer: Binh-Minh Ribler - April, 2004 @@ -281,7 +281,7 @@ bool PropList::propExist(const string& name ) const /// ///\exception H5::PropListIException ///\par Description -/// Releases memory and detaches a class from the property +/// Releases memory and detaches a class from the property /// list class hierarchy. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- @@ -301,8 +301,8 @@ void PropList::closeClass() const ///\param value - OUT: Pointer to the buffer for the property value ///\exception H5::PropListIException ///\par Description -/// Retrieves a copy of the value for a property in a property -/// list. The property name must exist or this routine will +/// Retrieves a copy of the value for a property in a property +/// list. The property name must exist or this routine will /// throw an exception. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- @@ -317,7 +317,7 @@ void PropList::getProperty(const char* name, void* value) const //-------------------------------------------------------------------------- // Function: PropList::getProperty ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it +/// It differs from the above function only in what arguments it /// accepts. ///\param name - IN: Name of property to query - \c char pointer ///\return The property that is a \c std::string. @@ -344,7 +344,7 @@ string PropList::getProperty(const char* name) const //-------------------------------------------------------------------------- // Function: PropList::getProperty ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it +/// It differs from the above function only in what arguments it /// accepts. ///\param name - IN: Name of property to query - \c std::string ///\param value - OUT: Pointer to the buffer for the property value @@ -357,7 +357,7 @@ void PropList::getProperty(const string& name, void* value) const //-------------------------------------------------------------------------- // Function: PropList::getProperty ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it +/// It differs from the above function only in what arguments it /// accepts. ///\param name - IN: Name of property to query - \c std::string ///\return The property that is a \c std::string. @@ -375,9 +375,9 @@ string PropList::getProperty(const string& name) const ///\return Size of the property ///\exception H5::PropListIException ///\par Description -/// This routine retrieves the size of a property's value -/// in bytes. Zero-sized properties are allowed and the return -/// value will be of 0. This function works for both property +/// This routine retrieves the size of a property's value +/// in bytes. Zero-sized properties are allowed and the return +/// value will be of 0. This function works for both property /// lists and classes. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- @@ -394,7 +394,7 @@ size_t PropList::getPropSize(const char *name) const //-------------------------------------------------------------------------- // Function: PropList::getPropSize ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it +/// It differs from the above function only in what arguments it /// accepts. ///\param name - IN: Name of property to query - \c std::string /// @@ -463,7 +463,7 @@ void PropList::setProperty(const char* name, void* value) const //-------------------------------------------------------------------------- // Function: PropList::setProperty ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it +/// It differs from the above function only in what arguments it /// accepts. ///\param name - IN: Name of property to set - \c char pointer ///\param charptr - IN: Char pointer to the value for the property @@ -480,7 +480,7 @@ void PropList::setProperty(const char* name, const char* charptr) const //-------------------------------------------------------------------------- // Function: PropList::setProperty ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it +/// It differs from the above function only in what arguments it /// accepts. ///\param name - IN: Name of property to set - \c char pointer ///\param strg - IN: Value for the property is a \c std::string @@ -494,7 +494,7 @@ void PropList::setProperty(const char* name, string& strg) const //-------------------------------------------------------------------------- // Function: PropList::setProperty ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it +/// It differs from the above function only in what arguments it /// accepts. ///\param name - IN: Name of property to set - \c std::string ///\param value - IN: Void pointer to the value for the property @@ -508,7 +508,7 @@ void PropList::setProperty(const string& name, void* value) const //-------------------------------------------------------------------------- // Function: PropList::setProperty ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it +/// It differs from the above function only in what arguments it /// accepts. ///\param name - IN: Name of property to set - \c std::string ///\param strg - IN: Value for the property is a \c std::string @@ -523,7 +523,7 @@ void PropList::setProperty(const string& name, string& strg) const // Function: PropList::isAClass ///\brief Determines whether a property list is a certain class. ///\param prop_class - IN: Property class to query -///\return true if the property list is a member of the property list +///\return true if the property list is a member of the property list /// class, and false, otherwise. ///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 @@ -561,7 +561,7 @@ void PropList::removeProp(const char *name) const //-------------------------------------------------------------------------- // Function: PropList::removeProp ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it +/// It differs from the above function only in what arguments it /// accepts. ///\param name - IN: Name of property to remove - \c std::string // Programmer: Binh-Minh Ribler - April, 2004 @@ -575,7 +575,7 @@ void PropList::removeProp(const string& name) const // Function: PropList::operator== ///\brief Compares this property list or class against the given list or class. ///\param rhs - IN: Reference to the property list to compare -///\return true if the property lists or classes are equal, and +///\return true if the property lists or classes are equal, and /// false, otherwise. ///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 @@ -620,7 +620,7 @@ PropList PropList::getClassParent() const // ID reference counting mechanism - June 1, 2004 //-------------------------------------------------------------------------- PropList::~PropList() -{ +{ // The property list id will be closed properly try { decRefCount(); @@ -628,7 +628,7 @@ PropList::~PropList() catch (Exception close_error) { cerr << "PropList::~PropList - " << close_error.getDetailMsg() << endl; } -} +} #ifndef H5_NO_NAMESPACE } // end namespace diff --git a/c++/src/H5PropList.h b/c++/src/H5PropList.h index 84883ad..35087a0 100644 --- a/c++/src/H5PropList.h +++ b/c++/src/H5PropList.h @@ -25,7 +25,7 @@ class H5_DLLCPP PropList : public IdComponent { // Default property list static const PropList DEFAULT; - // Creates a property list of a given type or creates a copy of an + // Creates a property list of a given type or creates a copy of an // existing property list giving the property list id. PropList(const hid_t plist_id); diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp index 4bd946d..04fb147 100644 --- a/c++/src/H5StrType.cpp +++ b/c++/src/H5StrType.cpp @@ -60,18 +60,18 @@ StrType::StrType( const PredType& pred_type ) : AtomType() ///\param existing_id - IN: Id of an existing datatype ///\exception H5::DataTypeIException // Description -// The 1st argument could have been skipped, but this -// constructor will collide with the one that takes an +// The 1st argument could have been skipped, but this +// constructor will collide with the one that takes an // existing id. // // Update: by passing 'size' by reference will avoid the // clashing problem, so the 1st argument can actually be -// omitted. This constructor should be replaced by the +// omitted. This constructor should be replaced by the // other after announcing. - May, 2004 -///\note +///\note /// This constructor will be obsolete in later releases, /// please use StrType( const size_t& size ) instead. -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- StrType::StrType( const PredType& pred_type, const size_t size ) : AtomType() { @@ -124,7 +124,7 @@ StrType::StrType( const DataSet& dataset ) : AtomType () //-------------------------------------------------------------------------- // Function: StrType::getCset -///\brief Retrieves the character set type of this string datatype. +///\brief Retrieves the character set type of this string datatype. ///\return Character set type, which can be: /// \li \c H5T_CSET_ASCII (0) - Character set is US ASCII. ///\exception H5::DataTypeIException @@ -144,7 +144,7 @@ H5T_cset_t StrType::getCset() const //-------------------------------------------------------------------------- // Function: StrType::setCset -///\brief Sets character set to be used. +///\brief Sets character set to be used. ///\param cset - IN: character set type ///\exception H5::DataTypeIException /// \li \c H5T_CSET_ASCII (0) - Character set is US ASCII. @@ -162,7 +162,7 @@ void StrType::setCset( H5T_cset_t cset ) const //-------------------------------------------------------------------------- // Function: StrType::getCset -///\brief Retrieves the storage mechanism for of this string datatype. +///\brief Retrieves the storage mechanism for of this string datatype. ///\return String storage mechanism, which can be: /// \li \c H5T_STR_NULLTERM (0) - Null terminate (as C does) /// \li \c H5T_STR_NULLPAD (0) - Pad with zeros @@ -177,7 +177,7 @@ H5T_str_t StrType::getStrpad() const // Returns a valid string padding type if successful if( strpad == H5T_STR_ERROR ) { - throw DataTypeIException("StrType::getStrpad", + throw DataTypeIException("StrType::getStrpad", "H5Tget_strpad failed - returned H5T_STR_ERROR"); } return( strpad ); diff --git a/c++/src/H5StrType.h b/c++/src/H5StrType.h index fbf4ac4..aef797d 100644 --- a/c++/src/H5StrType.h +++ b/c++/src/H5StrType.h @@ -31,25 +31,25 @@ class H5_DLLCPP StrType : public AtomType { // Creates a string type with specified length - will be obsolete StrType(const PredType& pred_type, const size_t size); - // Gets the string datatype of the specified dataset + // Gets the string datatype of the specified dataset StrType(const DataSet& dataset); - // Retrieves the character set type of this string datatype. + // Retrieves the character set type of this string datatype. H5T_cset_t getCset() const; - // Sets character set to be used. + // Sets character set to be used. void setCset(H5T_cset_t cset) const; - // Retrieves the string padding method for this string datatype. + // Retrieves the string padding method for this string datatype. H5T_str_t getStrpad() const; - // Defines the storage mechanism for character strings. + // Defines the storage mechanism for character strings. void setStrpad(H5T_str_t strpad) const; // Returns this class name virtual string fromClass () const { return ("StrType"); } - // default constructor + // default constructor StrType(); // Creates a string datatype using an existing id diff --git a/c++/src/H5VarLenType.cpp b/c++/src/H5VarLenType.cpp index 076ba12..547bc8a 100644 --- a/c++/src/H5VarLenType.cpp +++ b/c++/src/H5VarLenType.cpp @@ -58,7 +58,7 @@ VarLenType::VarLenType(const VarLenType& original) : DataType(original) {} ///\param base_type - IN: Pointer to existing datatype ///\exception H5::DataTypeIException // Description -// DataType passed by pointer to avoid clashing with copy +// DataType passed by pointer to avoid clashing with copy // constructor. // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp index f721ea1..c0249c5 100644 --- a/c++/test/dsets.cpp +++ b/c++/test/dsets.cpp @@ -50,7 +50,7 @@ const string DSET_BOGUS_NAME ("bogus"); const int H5Z_FILTER_BOGUS = 305; // Local prototypes -static size_t bogus(unsigned int flags, size_t cd_nelmts, +static size_t bogus(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); void cleanup_dsets(void); @@ -85,7 +85,7 @@ test_create( H5File& file) dims[1] = 512; DataSpace space (2, dims, NULL); - // Create a dataset using the default dataset creation properties. + // Create a dataset using the default dataset creation properties. // We're not sure what they are, so we won't check. dataset = new DataSet (file.createDataSet (DSET_DEFAULT_NAME, PredType::NATIVE_DOUBLE, space)); @@ -101,7 +101,7 @@ test_create( H5File& file) // dataset can only be created once. If an exception is not thrown for // this action by createDataSet, then throw an invalid action exception. try { - dataset = new DataSet (file.createDataSet + dataset = new DataSet (file.createDataSet (DSET_DEFAULT_NAME, PredType::NATIVE_DOUBLE, space)); // continuation here, that means no exception has been thrown @@ -140,7 +140,7 @@ test_create( H5File& file) csize[1] = 100; create_parms.setChunk( 2, csize ); - dataset = new DataSet (file.createDataSet + dataset = new DataSet (file.createDataSet (DSET_CHUNKED_NAME, PredType::NATIVE_DOUBLE, space, create_parms)); // Note: this one has no error message in C when failure occurs? @@ -176,7 +176,7 @@ test_create( H5File& file) /*------------------------------------------------------------------------- * Function: check_values * - * Purpose: Checks a read value against the written value. If they are + * Purpose: Checks a read value against the written value. If they are * different, the function will print out a message and the * different values. This function is made to reuse the code * segment that is used in various places throughout @@ -195,13 +195,13 @@ test_create( H5File& file) * *------------------------------------------------------------------------- */ -static int +static int check_values (hsize_t i, hsize_t j, int apoint, int acheck) { if (apoint != acheck) { cerr << " Read different values than written.\n" << endl; - cerr << " At index " << (unsigned long)i << "," << + cerr << " At index " << (unsigned long)i << "," << (unsigned long)j << endl; return -1; } @@ -245,7 +245,7 @@ test_simple_io( H5File& file) } char* tconv_buf = new char [1000]; - try + try { // Create the data space hsize_t dims[2]; @@ -322,7 +322,7 @@ test_tconv( H5File& file) //assert (in); TESTING("data type conversion"); - + // Initialize the dataset for (int i = 0; i < 1000000; i++) { out[i*4+0] = 0x11; @@ -352,7 +352,7 @@ test_tconv( H5File& file) if (in[4*i+0]!=out[4*i+3] || in[4*i+1]!=out[4*i+2] || in[4*i+2]!=out[4*i+1] || - in[4*i+3]!=out[4*i+0]) + in[4*i+3]!=out[4*i+0]) { throw Exception("DataSet::read", "Read with byte order conversion failed"); } @@ -455,7 +455,7 @@ test_compression(H5File& file) } char* tconv_buf = new char [1000]; DataSet* dataset = NULL; - try + try { const hsize_t size[2] = {100, 200}; // Create the data space @@ -465,37 +465,37 @@ test_compression(H5File& file) DSetMemXferPropList xfer; xfer.setBuffer (1000, tconv_buf, NULL); - + // Use chunked storage with compression DSetCreatPropList dscreatplist; const hsize_t chunk_size[2] = {2, 25}; dscreatplist.setChunk (2, chunk_size); dscreatplist.setDeflate (6); - + #ifdef H5_HAVE_FILTER_DEFLATE TESTING("compression (setup)"); - + // Create the dataset - dataset = new DataSet (file.createDataSet + dataset = new DataSet (file.createDataSet (DSET_COMPRESS_NAME, PredType::NATIVE_INT, space1, dscreatplist)); - + PASSED(); /*---------------------------------------------------------------------- * STEP 1: Read uninitialized data. It should be zero. - *---------------------------------------------------------------------- + *---------------------------------------------------------------------- */ TESTING("compression (uninitialized read)"); - + dataset->read ((void*) check, PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - + for (i=0; iread ((void*)check, PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); @@ -598,13 +598,13 @@ test_compression(H5File& file) } PASSED(); - + /*---------------------------------------------------------------------- * STEP 6: Test partial I/O by writing to and then reading from a * hyperslab of the dataset. The hyperslab does not line up on chunk * boundaries (we know that case already works from above tests). - *---------------------------------------------------------------------- + *---------------------------------------------------------------------- */ TESTING("compression (partial I/O)"); @@ -618,7 +618,7 @@ test_compression(H5File& file) space1.selectHyperslab( H5S_SELECT_SET, hs_size, hs_offset ); dataset->write ((void*)points, PredType::NATIVE_INT, space1, space1, xfer); dataset->read ((void*)check, PredType::NATIVE_INT, space1, space1, xfer); - + // Check that the values read are the same as the values written for (i=0; iwrite ((void*)points, PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); dataset->read ((void*)check, PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - + // Check that the values read are the same as the values written for (i = 0; i < size[0]; i++) for (j = 0; j < size[1]; j++) { int status = check_values (i, j, points[i][j], check[i][j]); - if (status == -1) + if (status == -1) throw Exception("test_compression", "Failed in app-defined method"); } PASSED(); - + /*---------------------------------------------------------------------- * Cleanup - *---------------------------------------------------------------------- + *---------------------------------------------------------------------- */ delete dataset; delete [] tconv_buf; @@ -742,7 +742,7 @@ test_multiopen (H5File& file) // Create first dataset DataSet dset1 = file.createDataSet ("multiopen", PredType::NATIVE_INT, *space, dcpl); - + // Open again the first dataset from the file to another DataSet object. DataSet dset2 = file.openDataSet ("multiopen"); @@ -759,13 +759,13 @@ test_multiopen (H5File& file) hsize_t tmp_size[1]; space->getSimpleExtentDims (tmp_size); - if (cur_size[0]!=tmp_size[0]) + if (cur_size[0]!=tmp_size[0]) { - cerr << " Got " << (int)tmp_size[0] << " instead of " + cerr << " Got " << (int)tmp_size[0] << " instead of " << (int)cur_size[0] << "!" << endl; throw Exception("test_multiopen", "Failed in multi-open with extending"); } - + // clean up and return with success delete space; PASSED(); @@ -846,7 +846,7 @@ test_types(H5File& file) dset = new DataSet(grp.createDataSet("bitfield_1", type, space)); // Fill buffer - for (i=0; i=VERBO_HI) @@ -105,11 +105,11 @@ InvalidActionException::InvalidActionException():Exception(){} // Function: InvalidActionException overloaded constructor // // Purpose: Creates an InvalidActionException with the name of the function, -// which the failure should have occurred but didn't, and a +// which the failure should have occurred but didn't, and a // message explaining why it should fail. // Parameters // func_name - IN: Name of the function where failure should occur -// message - IN: Message +// message - IN: Message //-------------------------------------------------------------------------- InvalidActionException::InvalidActionException(const string func_name, const string message) : Exception(func_name, message) {} diff --git a/c++/test/h5cpputil.h b/c++/test/h5cpputil.h index 38ecbcb..5918afb 100644 --- a/c++/test/h5cpputil.h +++ b/c++/test/h5cpputil.h @@ -62,8 +62,8 @@ template { if (x != value) { - cerr << "*** UNEXPECTED VALUE: " << file_name << ":line " << line - << ":" << msg << " different: " << x << ", should be " << value + cerr << "*** UNEXPECTED VALUE: " << file_name << ":line " << line + << ":" << msg << " different: " << x << ", should be " << value << endl; IncTestNumErrs(); } diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp index ae1d986..64e2ad1 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -103,9 +103,9 @@ int attr_data1a[ATTR1_DIM1]={256,11945,-22107}; ** ** test_attr_basic_write(): Test basic write attribute. ** Tests integer attributes on both datasets and groups -** +** ****************************************************************/ -static void +static void test_attr_basic_write(void) { hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; @@ -114,10 +114,10 @@ test_attr_basic_write(void) int read_data1[ATTR1_DIM1]={0}; // Buffer for reading 1st attribute int i; - // Output message about test being performed + // Output message about test being performed MESSAGE(5, ("Testing Basic Attribute Writing Functions\n")); - try { + try { // Create file H5File fid1 (FILENAME, H5F_ACC_TRUNC); @@ -133,12 +133,12 @@ test_attr_basic_write(void) // Create an attribute for the dataset Attribute ds_attr1 = dataset.createAttribute (ATTR1_NAME, PredType::NATIVE_INT, att_space); - // Try creating an attribute that already exists. This should fail - // since two attributes cannot have the same name. If an exception - // is not thrown for this action by createAttribute, then throw an + // Try creating an attribute that already exists. This should fail + // since two attributes cannot have the same name. If an exception + // is not thrown for this action by createAttribute, then throw an // invalid action exception. try { - Attribute invalid_attr = dataset.createAttribute (ATTR1_NAME, PredType::NATIVE_INT, att_space); + Attribute invalid_attr = dataset.createAttribute (ATTR1_NAME, PredType::NATIVE_INT, att_space); // continuation here, that means no exception has been thrown throw InvalidActionException("H5File::createDataSet", "Library allowed overwrite of existing dataset"); @@ -197,7 +197,7 @@ test_attr_basic_write(void) try { Attribute invalid_attr = group.createAttribute (ATTR2_NAME, PredType::NATIVE_INT, sid3); // continuation here, that means no exception has been thrown - throw InvalidActionException("H5Group::createAttribute", + throw InvalidActionException("H5Group::createAttribute", "Attempting to create an existing attribute"); } catch (AttributeIException E) // catching invalid creating attribute @@ -208,7 +208,7 @@ test_attr_basic_write(void) // Check storage size for attribute attr_size = gr_attr.getStorageSize(); - verify_val((long)attr_size, (long)(ATTR2_DIM1*ATTR2_DIM2*sizeof(int)), + verify_val((long)attr_size, (long)(ATTR2_DIM1*ATTR2_DIM2*sizeof(int)), "Attribute::getStorageSize", __LINE__, __FILE__); } // end try block @@ -220,9 +220,9 @@ test_attr_basic_write(void) /**************************************************************** ** ** test_attr_rename(): Test renaming attribute function. -** +** ****************************************************************/ -static void +static void test_attr_rename(void) { int read_data1[ATTR1_DIM1]={0}; // Buffer for reading the attribute @@ -276,7 +276,7 @@ test_attr_rename(void) if(attr_data1a[i]!=read_data1[i]) TestErrPrintf("%d: attribute data different: attr_data1a[%d]=%d,read_data1[%d]=%d\n",__LINE__,i,attr_data1a[i],i,read_data1[i]); - // Close attribute + // Close attribute attr2.close(); // Change first attribute back to the original name @@ -291,9 +291,9 @@ test_attr_rename(void) /******************************************************************** ** ** test_attr_basic_read(): Test basic read attribute. -** +** ********************************************************************/ -static void +static void test_attr_basic_read(void) { int i, j; @@ -301,7 +301,7 @@ test_attr_basic_read(void) // Output message about test being performed MESSAGE(5, ("Testing Basic Attribute Reading Functions\n")); - try { + try { // Open file H5File fid1(FILENAME, H5F_ACC_RDWR); @@ -321,7 +321,7 @@ test_attr_basic_read(void) // Verify values read in for(i=0; i>>" << endl << endl; } // catch all other exceptions - catch (Exception E) + catch (Exception E) { issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg()); } } // test_h5s_basic() /*------------------------------------------------------------------------- - * + * * Function: test_h5s_scalar_write * * Purpose: Test scalar H5S (dataspace) writing code @@ -259,7 +259,7 @@ test_h5s_basic(void) * with a special routine. *------------------------------------------------------------------------- */ -static void +static void test_h5s_scalar_write(void) { // Output message about test being performed @@ -305,7 +305,7 @@ test_h5s_scalar_write(void) } // test_h5s_scalar_write() /*------------------------------------------------------------------------- - * + * * Function: test_h5s_scalar_read * * Purpose: Test scalar H5S (dataspace) reading code @@ -324,7 +324,7 @@ test_h5s_scalar_write(void) * with a special routine. *------------------------------------------------------------------------- */ -static void +static void test_h5s_scalar_read(void) { hsize_t tdims[4]; // Dimension array to test with @@ -362,11 +362,11 @@ test_h5s_scalar_read(void) // all the exceptions caused by negative returned values by C APIs issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg()); } - + } // test_h5s_scalar_read() /*------------------------------------------------------------------------- - * + * * Function: test_h5s_null * * Purpose: Test null H5S (dataspace) code @@ -385,7 +385,7 @@ test_h5s_scalar_read(void) * with a special routine. *------------------------------------------------------------------------- */ -static void +static void test_h5s_null(void) { // Output message about test being performed @@ -403,7 +403,7 @@ test_h5s_null(void) n = sid1.getSimpleExtentNpoints(); verify_val((long)n, 0, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); - // Create a dataset + // Create a dataset DataSet dataset = fid1.createDataSet("Dataset1", PredType::NATIVE_UINT,sid1); // Try to write nothing to the dataset @@ -420,10 +420,10 @@ test_h5s_null(void) } // test_h5s_null() /*------------------------------------------------------------------------- - * + * * Function: test_h5s_compound_scalar_write * - * Purpose: Test scalar H5S (dataspace) writing for compound + * Purpose: Test scalar H5S (dataspace) writing for compound * datatypes * * Return: none @@ -440,7 +440,7 @@ test_h5s_null(void) * with a special routine. *------------------------------------------------------------------------- */ -static void +static void test_h5s_compound_scalar_write(void) { // Output message about test being performed @@ -494,10 +494,10 @@ test_h5s_compound_scalar_write(void) } // test_h5s_compound_scalar_write() /*------------------------------------------------------------------------- - * + * * Function: test_h5s_compound_scalar_read * - * Purpose: Test scalar H5S (dataspace) reading for compound + * Purpose: Test scalar H5S (dataspace) reading for compound * datatypes * * Return: none @@ -514,7 +514,7 @@ test_h5s_compound_scalar_write(void) * with a special routine. *------------------------------------------------------------------------- */ -static void +static void test_h5s_compound_scalar_read(void) { hsize_t tdims[4]; // Dimension array to test with @@ -544,14 +544,14 @@ test_h5s_compound_scalar_read(void) // Get the datatype of this dataset. CompType type(dataset); - + struct space4_struct rdata; // Scalar data read in dataset.read(&rdata, type); // Verify read data if(HDmemcmp(&space4_data,&rdata,sizeof(struct space4_struct))) { - cerr << "scalar data different: space4_data.c1=" + cerr << "scalar data different: space4_data.c1=" << space4_data.c1 << ", read_data4.c1=" << rdata.c1 << endl; cerr << "scalar data different: space4_data.u=" << space4_data.u << ", read_data4.u=" << rdata.u << endl; @@ -569,7 +569,7 @@ test_h5s_compound_scalar_read(void) } // test_h5s_compound_scalar_read() /*------------------------------------------------------------------------- - * + * * Function: test_h5s * * Purpose: Main dataspace testing routine @@ -582,7 +582,7 @@ test_h5s_compound_scalar_read(void) * Modifications: *------------------------------------------------------------------------- */ -void +void test_h5s(void) { // Output message about test being performed diff --git a/examples/h5_attribute.c b/examples/h5_attribute.c index 76609ec..6857236 100644 --- a/examples/h5_attribute.c +++ b/examples/h5_attribute.c @@ -12,52 +12,52 @@ * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* +/* * This program illustrates the usage of the H5A Interface functions. * It creates and writes a dataset, and then creates and writes array, - * scalar, and string attributes of the dataset. + * scalar, and string attributes of the dataset. * Program reopens the file, attaches to the scalar attribute using * attribute name and reads and displays its value. Then index of the * third attribute is used to read and display attribute values. * The H5Aiterate function is used to iterate through the dataset attributes, - * and display their names. The function is also reads and displays the values - * of the array attribute. - */ - + * and display their names. The function is also reads and displays the values + * of the array attribute. + */ + #include #include "hdf5.h" #define H5FILE_NAME "Attributes.h5" -#define RANK 1 /* Rank and size of the dataset */ +#define RANK 1 /* Rank and size of the dataset */ #define SIZE 7 #define ARANK 2 /* Rank and dimension sizes of the first dataset attribute */ #define ADIM1 2 -#define ADIM2 3 +#define ADIM2 3 #define ANAME "Float attribute" /* Name of the array attribute */ #define ANAMES "Character attribute" /* Name of the string attribute */ -herr_t attr_info(hid_t loc_id, const char *name, void *opdata); +herr_t attr_info(hid_t loc_id, const char *name, void *opdata); /* Operator function */ -int +int main (void) { hid_t file, dataset; /* File and dataset identifiers */ - + hid_t fid; /* Dataspace identifier */ hid_t attr1, attr2, attr3; /* Attribute identifiers */ hid_t attr; - hid_t aid1, aid2, aid3; /* Attribute dataspace identifiers */ + hid_t aid1, aid2, aid3; /* Attribute dataspace identifiers */ hid_t atype; /* Attribute type */ hsize_t fdim[] = {SIZE}; hsize_t adim[] = {ADIM1, ADIM2}; /* Dimensions of the first attribute */ - - float matrix[ADIM1][ADIM2]; /* Attribute data */ + + float matrix[ADIM1][ADIM2]; /* Attribute data */ herr_t ret; /* Return value */ unsigned i,j; /* Counters */ @@ -69,10 +69,10 @@ main (void) * Data initialization. */ int vector[] = {1, 2, 3, 4, 5, 6, 7}; /* Dataset data */ - int point = 1; /* Value of the scalar attribute */ + int point = 1; /* Value of the scalar attribute */ char string[] = "ABCD"; /* Value of the string attribute */ - + for (i=0; i < ADIM1; i++) { /* Values of the array attribute */ for (j=0; j < ADIM2; j++) matrix[i][j] = -1.; @@ -83,7 +83,7 @@ main (void) */ file = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - /* + /* * Create the dataspace for the dataset in the file. */ fid = H5Screate(H5S_SIMPLE); @@ -100,7 +100,7 @@ main (void) ret = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL , H5S_ALL, H5P_DEFAULT, vector); /* - * Create dataspace for the first attribute. + * Create dataspace for the first attribute. */ aid1 = H5Screate(H5S_SIMPLE); ret = H5Sset_extent_simple(aid1, ARANK, adim, NULL); @@ -125,7 +125,7 @@ main (void) /* * Write scalar attribute. */ - ret = H5Awrite(attr2, H5T_NATIVE_INT, &point); + ret = H5Awrite(attr2, H5T_NATIVE_INT, &point); /* * Create string attribute. @@ -139,23 +139,23 @@ main (void) /* * Write string attribute. */ - ret = H5Awrite(attr3, atype, string); + ret = H5Awrite(attr3, atype, string); /* * Close attribute and file dataspaces. */ - ret = H5Sclose(aid1); - ret = H5Sclose(aid2); - ret = H5Sclose(aid3); - ret = H5Sclose(fid); + ret = H5Sclose(aid1); + ret = H5Sclose(aid2); + ret = H5Sclose(aid3); + ret = H5Sclose(fid); /* * Close the attributes. - */ + */ ret = H5Aclose(attr1); ret = H5Aclose(attr2); ret = H5Aclose(attr3); - + /* * Close the dataset. */ @@ -177,12 +177,12 @@ main (void) dataset = H5Dopen(file,"Dataset"); /* - * Attach to the scalar attribute using attribute name, then read and + * Attach to the scalar attribute using attribute name, then read and * display its value. */ attr = H5Aopen_name(dataset,"Integer attribute"); ret = H5Aread(attr, H5T_NATIVE_INT, &point_out); - printf("The value of the attribute \"Integer attribute\" is %d \n", point_out); + printf("The value of the attribute \"Integer attribute\" is %d \n", point_out); ret = H5Aclose(attr); /* @@ -197,7 +197,7 @@ main (void) ret = H5Tclose(atype); /* - * Get attribute info using iteration function. + * Get attribute info using iteration function. */ idx = H5Aiterate(dataset, NULL, attr_info, NULL); @@ -207,21 +207,21 @@ main (void) H5Dclose(dataset); H5Fclose(file); - return 0; + return 0; } /* * Operator function. */ -herr_t +herr_t attr_info(hid_t loc_id, const char *name, void *opdata) { hid_t attr, atype, aspace; /* Attribute, datatype and dataspace identifiers */ int rank; - hsize_t sdim[64]; + hsize_t sdim[64]; herr_t ret; int i; - size_t npoints; /* Number of elements in the array attribute. */ + size_t npoints; /* Number of elements in the array attribute. */ float *float_array; /* Pointer to the array attribute. */ /* avoid warnings */ @@ -229,7 +229,7 @@ attr_info(hid_t loc_id, const char *name, void *opdata) /* * Open the attribute using its name. - */ + */ attr = H5Aopen_name(loc_id, name); /* @@ -239,7 +239,7 @@ attr_info(hid_t loc_id, const char *name, void *opdata) printf("Name : "); puts(name); - /* + /* * Get attribute datatype, dataspace, rank, and dimensions. */ atype = H5Aget_type(attr); @@ -252,7 +252,7 @@ attr_info(hid_t loc_id, const char *name, void *opdata) */ if(rank > 0) { - printf("Rank : %d \n", rank); + printf("Rank : %d \n", rank); printf("Dimension sizes : "); for (i=0; i< rank; i++) printf("%d ", (int)sdim[i]); printf("\n"); @@ -263,12 +263,12 @@ attr_info(hid_t loc_id, const char *name, void *opdata) */ if (H5T_FLOAT == H5Tget_class(atype)) { - printf("Type : FLOAT \n"); + printf("Type : FLOAT \n"); npoints = H5Sget_simple_extent_npoints(aspace); - float_array = (float *)malloc(sizeof(float)*(int)npoints); + float_array = (float *)malloc(sizeof(float)*(int)npoints); ret = H5Aread(attr, atype, float_array); printf("Values : "); - for( i = 0; i < (int)npoints; i++) printf("%f ", float_array[i]); + for( i = 0; i < (int)npoints; i++) printf("%f ", float_array[i]); printf("\n"); free(float_array); } diff --git a/examples/h5_chunk_read.c b/examples/h5_chunk_read.c index af87c10..7bc7324 100644 --- a/examples/h5_chunk_read.c +++ b/examples/h5_chunk_read.c @@ -12,50 +12,50 @@ * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* +/* * This example shows how to read data from a chunked dataset. - * We will read from the file created by h5_extend_write.c + * We will read from the file created by h5_extend_write.c */ - + #include "hdf5.h" #define H5FILE_NAME "SDSextendible.h5" -#define DATASETNAME "ExtendibleArray" +#define DATASETNAME "ExtendibleArray" #define RANK 2 #define RANKC 1 #define NX 10 -#define NY 5 +#define NY 5 int main (void) { hid_t file; /* handles */ - hid_t dataset; - hid_t filespace; - hid_t memspace; - hid_t cparms; - hsize_t dims[2]; /* dataset and chunk dimensions*/ + hid_t dataset; + hid_t filespace; + hid_t memspace; + hid_t cparms; + hsize_t dims[2]; /* dataset and chunk dimensions*/ hsize_t chunk_dims[2]; hsize_t col_dims[1]; hsize_t count[2]; hsize_t offset[2]; - herr_t status, status_n; + herr_t status, status_n; int data_out[NX][NY]; /* buffer for dataset to be read */ int chunk_out[2][5]; /* buffer for chunk to be read */ int column[10]; /* buffer for column to be read */ int rank, rank_chunk; hsize_t i, j; - - + + /* * Open the file and the dataset. */ file = H5Fopen(H5FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT); dataset = H5Dopen(file, DATASETNAME); - + /* * Get dataset rank and dimension. */ @@ -70,7 +70,7 @@ main (void) * Define the memory space to read dataset. */ memspace = H5Screate_simple(RANK,dims,NULL); - + /* * Read dataset back and display. */ @@ -81,7 +81,7 @@ main (void) for (j = 0; j < dims[0]; j++) { for (i = 0; i < dims[1]; i++) printf("%d ", data_out[j][i]); printf("\n"); - } + } /* * Close/release resources. @@ -89,20 +89,20 @@ main (void) H5Sclose(memspace); /* - * dataset rank 2, dimensions 10 x 5 - * chunk rank 2, dimensions 2 x 5 + * dataset rank 2, dimensions 10 x 5 + * chunk rank 2, dimensions 2 x 5 * Dataset: - * 1 1 1 3 3 - * 1 1 1 3 3 - * 1 1 1 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 + * 1 1 1 3 3 + * 1 1 1 3 3 + * 1 1 1 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 */ /* @@ -136,17 +136,17 @@ main (void) H5Sclose(memspace); /* - * Third column: - * 1 - * 1 - * 1 - * 0 - * 0 - * 0 - * 0 - * 0 - * 0 - * 0 + * Third column: + * 1 + * 1 + * 1 + * 0 + * 0 + * 0 + * 0 + * 0 + * 0 + * 0 */ /* @@ -175,7 +175,7 @@ main (void) offset[1] = 0; count[0] = chunk_dims[0]; count[1] = chunk_dims[1]; - status = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL, + status = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL, count, NULL); /* @@ -188,11 +188,11 @@ main (void) for (j = 0; j < chunk_dims[0]; j++) { for (i = 0; i < chunk_dims[1]; i++) printf("%d ", chunk_out[j][i]); printf("\n"); - } + } /* - * Chunk: - * 1 1 1 0 0 - * 2 0 0 0 0 + * Chunk: + * 1 1 1 0 0 + * 2 0 0 0 0 */ /* @@ -210,4 +210,4 @@ main (void) H5Fclose(file); return 0; -} +} diff --git a/examples/h5_compound.c b/examples/h5_compound.c index 1819734..6a88448 100644 --- a/examples/h5_compound.c +++ b/examples/h5_compound.c @@ -33,7 +33,7 @@ main(void) typedef struct s1_t { int a; float b; - double c; + double c; } s1_t; s1_t s1[LENGTH]; hid_t s1_tid; /* File datatype identifier */ @@ -76,20 +76,20 @@ main(void) file = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); /* - * Create the memory data type. + * Create the memory data type. */ s1_tid = H5Tcreate (H5T_COMPOUND, sizeof(s1_t)); H5Tinsert(s1_tid, "a_name", HOFFSET(s1_t, a), H5T_NATIVE_INT); H5Tinsert(s1_tid, "c_name", HOFFSET(s1_t, c), H5T_NATIVE_DOUBLE); H5Tinsert(s1_tid, "b_name", HOFFSET(s1_t, b), H5T_NATIVE_FLOAT); - /* + /* * Create the dataset. */ dataset = H5Dcreate(file, DATASETNAME, s1_tid, space, H5P_DEFAULT); /* - * Wtite data to the dataset; + * Wtite data to the dataset; */ status = H5Dwrite(dataset, s1_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, s1); @@ -100,15 +100,15 @@ main(void) H5Sclose(space); H5Dclose(dataset); H5Fclose(file); - + /* * Open the file and the dataset. */ file = H5Fopen(H5FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT); - + dataset = H5Dopen(file, DATASETNAME); - /* + /* * Create a data type for s2 */ s2_tid = H5Tcreate(H5T_COMPOUND, sizeof(s2_t)); @@ -135,7 +135,7 @@ main(void) for( i = 0; i < LENGTH; i++) printf("%d ", s2[i].a); printf("\n"); - /* + /* * Create a data type for s3. */ s3_tid = H5Tcreate(H5T_COMPOUND, sizeof(float)); diff --git a/examples/h5_drivers.c b/examples/h5_drivers.c index ebe870b..5dea143 100644 --- a/examples/h5_drivers.c +++ b/examples/h5_drivers.c @@ -12,13 +12,13 @@ * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* +/* * This shows how to use the hdf5 virtual file drivers. * The example codes here do not check return values for the * sake of simplicity. As in all proper programs, return codes * should be checked. */ - + #include "hdf5.h" #include "stdlib.h" @@ -96,8 +96,8 @@ split_file(void) int main (void) { - + split_file(); return(0); -} +} diff --git a/examples/h5_dtransform.c b/examples/h5_dtransform.c index 3c15eec..2208e7e 100644 --- a/examples/h5_dtransform.c +++ b/examples/h5_dtransform.c @@ -12,8 +12,8 @@ * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* - * This example demonstrates how the data transform features of +/* + * This example demonstrates how the data transform features of * HDF5 works. * * (1) @@ -31,7 +31,7 @@ * (4) * Get the transform from the property using H5Pget_data_transform. */ - + #include "hdf5.h" #define ROWS 12 @@ -63,7 +63,7 @@ const float windchillF[ROWS][COLS] = } - + int main (void) @@ -71,8 +71,8 @@ main (void) hid_t file, dataset; /* file and dataset handles */ hid_t dataspace; /* handles */ hsize_t dimsf[2]; /* dataset dimensions */ - herr_t status; - hid_t dxpl_id_f_to_c, dxpl_id_c_to_f; /* data transform handles */ + herr_t status; + hid_t dxpl_id_f_to_c, dxpl_id_c_to_f; /* data transform handles */ const char* f_to_c = "(5/9.0)*(x-32)"; const char* c_to_f = "(9/5.0)*x + 32"; char* transform; @@ -88,11 +88,11 @@ main (void) /* * Describe the size of the array and create the data space for fixed - * size dataset. + * size dataset. */ dimsf[0] = ROWS; dimsf[1] = COLS; - dataspace = H5Screate_simple(2, dimsf, NULL); + dataspace = H5Screate_simple(2, dimsf, NULL); /* * Create a new dataset within the file using defined dataspace and @@ -125,11 +125,11 @@ main (void) /* Print the data from the read*/ printf("\nData with no write transform, but a read transform: \n"); PRINT(windchillC); - + /**************** PART 2 **************/ /* - * Write the data to the dataset with the f_to_c transform set + * Write the data to the dataset with the f_to_c transform set */ status = H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillF); @@ -142,8 +142,8 @@ main (void) PRINT(windchillC); /************** PART 3 ***************/ - - + + /* Create the dataset transfer property list */ dxpl_id_c_to_f = H5Pcreate(H5P_DATASET_XFER); @@ -156,7 +156,7 @@ main (void) */ status = H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillF); - + /* Read the data with the c_to_f data transform */ H5Dread(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_c_to_f, windchillC); @@ -168,9 +168,9 @@ main (void) transform_size = H5Pget_data_transform(dxpl_id_f_to_c, NULL, 0); transform = (char*) malloc(transform_size+1); H5Pget_data_transform(dxpl_id_f_to_c, transform, transform_size+1); - + printf("\nTransform string (from dxpl_id_f_to_c) is: %s\n", transform); - + /* * Close/release resources. */ @@ -179,6 +179,6 @@ main (void) H5Sclose(dataspace); H5Dclose(dataset); H5Fclose(file); - + return 0; -} +} diff --git a/examples/h5_extend_write.c b/examples/h5_extend_write.c index bcb9949..9a30d46 100644 --- a/examples/h5_extend_write.c +++ b/examples/h5_extend_write.c @@ -12,46 +12,46 @@ * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* +/* * This example shows how to work with extendible dataset. * In the current version of the library dataset MUST be * chunked. - * + * */ - + #include "hdf5.h" #define H5FILE_NAME "SDSextendible.h5" -#define DATASETNAME "ExtendibleArray" +#define DATASETNAME "ExtendibleArray" #define RANK 2 #define NX 10 -#define NY 5 +#define NY 5 int main (void) { hid_t file; /* handles */ - hid_t dataspace, dataset; - hid_t filespace; - hid_t cparms; + hid_t dataspace, dataset; + hid_t filespace; + hid_t cparms; hsize_t dims[2] = { 3, 3}; /* - * dataset dimensions + * dataset dimensions * at the creation time */ - hsize_t dims1[2] = { 3, 3}; /* data1 dimensions */ - hsize_t dims2[2] = { 7, 1}; /* data2 dimensions */ - hsize_t dims3[2] = { 2, 2}; /* data3 dimensions */ + hsize_t dims1[2] = { 3, 3}; /* data1 dimensions */ + hsize_t dims2[2] = { 7, 1}; /* data2 dimensions */ + hsize_t dims3[2] = { 2, 2}; /* data3 dimensions */ hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; hsize_t chunk_dims[2] ={2, 5}; hsize_t size[2]; hsize_t offset[2]; - herr_t status; + herr_t status; int data1[3][3] = { {1, 1, 1}, /* data to write */ {1, 1, 1}, - {1, 1, 1} }; + {1, 1, 1} }; int data2[7] = { 2, 2, 2, 2, 2, 2, 2}; @@ -60,16 +60,16 @@ main (void) int fillvalue = 0; /* - * Create the data space with unlimited dimensions. + * Create the data space with unlimited dimensions. */ - dataspace = H5Screate_simple(RANK, dims, maxdims); + dataspace = H5Screate_simple(RANK, dims, maxdims); /* * Create a new file. If file exists its contents will be overwritten. */ file = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - /* + /* * Modify dataset creation properties, i.e. enable chunking. */ cparms = H5Pcreate(H5P_DATASET_CREATE); @@ -86,8 +86,8 @@ main (void) /* * Extend the dataset. This call assures that dataset is at least 3 x 3. */ - size[0] = 3; - size[1] = 3; + size[0] = 3; + size[1] = 3; status = H5Dextend (dataset, size); /* @@ -97,7 +97,7 @@ main (void) offset[0] = 0; offset[1] = 0; status = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL, - dims1, NULL); + dims1, NULL); /* * Write the data to the hyperslab. @@ -109,8 +109,8 @@ main (void) * Extend the dataset. Dataset becomes 10 x 3. */ dims[0] = dims1[0] + dims2[0]; - size[0] = dims[0]; - size[1] = dims[1]; + size[0] = dims[0]; + size[1] = dims[1]; status = H5Dextend (dataset, size); /* @@ -120,12 +120,12 @@ main (void) offset[0] = 3; offset[1] = 0; status = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL, - dims2, NULL); + dims2, NULL); /* * Define memory space */ - dataspace = H5Screate_simple(RANK, dims2, NULL); + dataspace = H5Screate_simple(RANK, dims2, NULL); /* * Write the data to the hyperslab. @@ -137,8 +137,8 @@ main (void) * Extend the dataset. Dataset becomes 10 x 5. */ dims[1] = dims1[1] + dims3[1]; - size[0] = dims[0]; - size[1] = dims[1]; + size[0] = dims[0]; + size[1] = dims[1]; status = H5Dextend (dataset, size); /* @@ -147,13 +147,13 @@ main (void) filespace = H5Dget_space (dataset); offset[0] = 0; offset[1] = 3; - status = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL, - dims3, NULL); + status = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL, + dims3, NULL); /* * Define memory space. */ - dataspace = H5Screate_simple(RANK, dims3, NULL); + dataspace = H5Screate_simple(RANK, dims3, NULL); /* * Write the data to the hyperslab. @@ -163,7 +163,7 @@ main (void) /* * Resulting dataset - * + * * 3 3 3 2 2 * 3 3 3 2 2 * 3 3 3 0 0 @@ -185,4 +185,4 @@ main (void) H5Fclose(file); return 0; -} +} diff --git a/examples/h5_group.c b/examples/h5_group.c index 4e3eac1..7afe19b 100644 --- a/examples/h5_group.c +++ b/examples/h5_group.c @@ -13,12 +13,12 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * This program creates a group in the file and two datasets in the group. + * This program creates a group in the file and two datasets in the group. * Hard link to the group object is created and one of the datasets is accessed - * under new name. + * under new name. * Iterator functions are used to find information about the objects - * in the root group and in the created group. - */ + * in the root group and in the created group. + */ #include "hdf5.h" @@ -38,12 +38,12 @@ main(void) hid_t file; hid_t grp; hid_t dataset, dataspace; - hid_t plist; + hid_t plist; herr_t status; hsize_t dims[2]; hsize_t cdims[2]; - + int idx_f, idx_g; /* @@ -52,15 +52,15 @@ main(void) file = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); /* - * Create a group in the file. + * Create a group in the file. */ grp = H5Gcreate(file, "/Data", 0); /* * Create dataset "Compressed Data" in the group using absolute - * name. Dataset creation property list is modified to use - * GZIP compression with the compression effort set to 6. - * Note that compression can be used only when dataset is chunked. + * name. Dataset creation property list is modified to use + * GZIP compression with the compression effort set to 6. + * Note that compression can be used only when dataset is chunked. */ dims[0] = 1000; dims[1] = 20; @@ -69,16 +69,16 @@ main(void) dataspace = H5Screate_simple(RANK, dims, NULL); plist = H5Pcreate(H5P_DATASET_CREATE); H5Pset_chunk(plist, 2, cdims); - H5Pset_deflate( plist, 6); - dataset = H5Dcreate(file, "/Data/Compressed_Data", H5T_NATIVE_INT, - dataspace, plist); - /* + H5Pset_deflate( plist, 6); + dataset = H5Dcreate(file, "/Data/Compressed_Data", H5T_NATIVE_INT, + dataspace, plist); + /* * Close the first dataset . */ H5Sclose(dataspace); H5Dclose(dataset); - /* + /* * Create the second dataset. */ dims[0] = 500; @@ -87,7 +87,7 @@ main(void) dataset = H5Dcreate(file, "/Data/Float_Data", H5T_NATIVE_FLOAT, dataspace, H5P_DEFAULT); - /* + /* *Close the second dataset and file. */ H5Sclose(dataspace); @@ -96,13 +96,13 @@ main(void) H5Fclose(file); /* - * Now reopen the file and group in the file. + * Now reopen the file and group in the file. */ file = H5Fopen(H5FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT); grp = H5Gopen(file, "Data"); - /* - * Access "Compressed_Data" dataset in the group. + /* + * Access "Compressed_Data" dataset in the group. */ dataset = H5Dopen(grp, "Compressed_Data"); if( dataset < 0) printf(" Dataset 'Compressed-Data' is not found. \n"); @@ -118,9 +118,9 @@ main(void) */ status = H5Glink(file, H5G_LINK_HARD, "Data", "Data_new"); - /* + /* * We can access "Compressed_Data" dataset using created - * hard link "Data_new". + * hard link "Data_new". */ dataset = H5Dopen(file, "/Data_new/Compressed_Data"); if( dataset < 0) printf(" Dataset is not found. \n"); @@ -132,7 +132,7 @@ main(void) status = H5Dclose(dataset); - /* + /* * Use iterator to see the names of the objects in the root group. */ idx_f = H5Giterate(file, "/", NULL, file_info, NULL); @@ -141,15 +141,15 @@ main(void) * Unlink name "Data" and use iterator to see the names * of the objects in the file root direvtory. */ - if (H5Gunlink(file, "Data") < 0) + if (H5Gunlink(file, "Data") < 0) printf(" H5Gunlink failed \n"); - else + else printf("\"Data\" is unlinked \n"); idx_f = H5Giterate(file, "/", NULL, file_info, NULL); - /* - * Use iterator to see the names of the objects in the group + /* + * Use iterator to see the names of the objects in the group * /Data_new. */ idx_g = H5Giterate(grp, "/Data_new", NULL, group_info, NULL); @@ -157,7 +157,7 @@ main(void) /* * Close the file. */ - + status = H5Fclose(file); return 0; @@ -173,13 +173,13 @@ herr_t file_info(hid_t loc_id, const char *name, void *opdata) opdata = opdata; /* - * Display group name. The name is passed to the function by + * Display group name. The name is passed to the function by * the Library. Some magic :-) */ printf("\n"); printf("Name : "); puts(name); - + return 0; } @@ -204,20 +204,20 @@ herr_t group_info(hid_t loc_id, const char *name, void *opdata) * Open the datasets using their names. */ did = H5Dopen(loc_id, name); - + /* * Display dataset name. */ printf("\n"); printf("Name : "); puts(name); - - /* + + /* * Display dataset information. */ tid = H5Dget_type(did); /* get datatype*/ pid = H5Dget_create_plist(did); /* get creation property list */ - + /* * Check if dataset is chunked. */ @@ -226,13 +226,13 @@ herr_t group_info(hid_t loc_id, const char *name, void *opdata) * get chunking information: rank and dimensions. */ rank_chunk = H5Pget_chunk(pid, 2, chunk_dims_out); - printf("chunk rank %d, dimensions %lu x %lu\n", rank_chunk, + printf("chunk rank %d, dimensions %lu x %lu\n", rank_chunk, (unsigned long)(chunk_dims_out[0]), (unsigned long)(chunk_dims_out[1])); - } + } else{ t_class = H5Tget_class(tid); - if(t_class < 0){ + if(t_class < 0){ puts(" Invalid datatype.\n"); } else { @@ -250,7 +250,7 @@ herr_t group_info(hid_t loc_id, const char *name, void *opdata) puts(" Datatype is 'H5T_NATIVE_COMPOUND'.\n"); } } - + H5Dclose(did); H5Pclose(pid); diff --git a/examples/h5_mount.c b/examples/h5_mount.c index 7075201..00927ff 100644 --- a/examples/h5_mount.c +++ b/examples/h5_mount.c @@ -12,12 +12,12 @@ * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* - * This program shows the concept of "mounting files". +/* + * This program shows the concept of "mounting files". * Program creates one file with group G in it, and another * file with dataset D. Then second file is mounted in the first one - * under the "mounting point" G. Dataset D is accessed in the first file - * under name /G/D and data is printed out. + * under the "mounting point" G. Dataset D is accessed in the first file + * under name /G/D and data is printed out. */ #include "hdf5.h" @@ -29,11 +29,11 @@ #define NX 4 #define NY 5 -int main(void) +int main(void) { hid_t fid1, fid2, gid; /* Files and group identifiers */ - hid_t did, tid, sid; /* Dataset and datatype identifiers */ + hid_t did, tid, sid; /* Dataset and datatype identifiers */ herr_t status; hsize_t dims[] = {NX,NY}; /* Dataset dimensions */ @@ -42,26 +42,26 @@ int main(void) int bm[NX][NY], bm_out[NX][NY]; /* Data buffers */ /* - * Initialization of buffer matrix "bm" + * Initialization of buffer matrix "bm" */ for(i =0; i @@ -30,38 +30,38 @@ int main(void) { - hid_t fid; /* File, group, datasets, datatypes */ + hid_t fid; /* File, group, datasets, datatypes */ hid_t gid_a; /* and dataspaces identifiers */ - hid_t did_b, sid_b, tid_b; + hid_t did_b, sid_b, tid_b; hid_t did_r, tid_r, sid_r; herr_t status; hobj_ref_t *wbuf; /* buffer to write to disk */ hobj_ref_t *rbuf; /* buffer to read from disk */ - - hsize_t dim_r[1]; + + hsize_t dim_r[1]; hsize_t dim_b[2]; - - /* + + /* * Create a file using default properties. */ fid = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - /* + /* * Create group "A" in the file. */ gid_a = H5Gcreate(fid, "A", 0); - - /* + + /* * Create dataset "B" in the file. */ dim_b[0] = 2; dim_b[1] = 6; - sid_b = H5Screate_simple(2, dim_b, NULL); + sid_b = H5Screate_simple(2, dim_b, NULL); did_b = H5Dcreate(fid, "B", H5T_NATIVE_FLOAT, sid_b, H5P_DEFAULT); - - /* + + /* * Create dataset "R" to store references to the objects "A" and "B". */ dim_r[0] = 2; @@ -69,62 +69,62 @@ main(void) { tid_r = H5Tcopy(H5T_STD_REF_OBJ); did_r = H5Dcreate(fid, "R", tid_r, sid_r, H5P_DEFAULT ); - /* + /* * Allocate write and read buffers. */ wbuf = (hobj_ref_t *)malloc(sizeof(hobj_ref_t)*2); rbuf = (hobj_ref_t *)malloc(sizeof(hobj_ref_t)*2); - + /* * Create references to the group "A" and dataset "B" * and store them in the wbuf. */ - H5Rcreate(&wbuf[0], fid, "A", H5R_OBJECT, -1); + H5Rcreate(&wbuf[0], fid, "A", H5R_OBJECT, -1); H5Rcreate(&wbuf[1], fid, "B", H5R_OBJECT, -1); - - /* + + /* * Write dataset R using default transfer properties. */ status = H5Dwrite(did_r, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf); - /* - * Close all objects. + /* + * Close all objects. */ H5Gclose(gid_a); - + H5Sclose(sid_b); H5Dclose(did_b); H5Tclose(tid_r); H5Sclose(sid_r); H5Dclose(did_r); - + H5Fclose(fid); - - /* + + /* * Reopen the file. */ fid = H5Fopen(H5FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT); - /* + /* * Open and read dataset "R". */ did_r = H5Dopen(fid, "R"); status = H5Dread(did_r, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf); - /* + /* * Find the type of referenced objects. */ status = H5Rget_obj_type(did_r, H5R_OBJECT, &rbuf[0]); - if ( status == H5G_GROUP ) + if ( status == H5G_GROUP ) printf("First dereferenced object is a group. \n"); status = H5Rget_obj_type(did_r, H5R_OBJECT, &rbuf[1]); - if ( status == H5G_DATASET ) + if ( status == H5G_DATASET ) printf("Second dereferenced object is a dataset. \n"); - /* + /* * Get datatype of the dataset "B" */ did_b = H5Rdereference(did_r, H5R_OBJECT, &rbuf[1]); @@ -133,7 +133,7 @@ main(void) { printf("Datatype of the dataset is H5T_NATIVE_FLOAT.\n"); printf("\n"); - /* + /* * Close all objects and free memory buffers. */ H5Dclose(did_r); diff --git a/examples/h5_select.c b/examples/h5_select.c index 0c34b1a..c3bdb2a 100644 --- a/examples/h5_select.c +++ b/examples/h5_select.c @@ -12,42 +12,42 @@ * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* +/* * This program shows how the H5Sselect_hyperslab and H5Sselect_elements * functions are used to write selected data from memory to the file. * Program takes 48 elements from the linear buffer and writes them into - * the matrix using 3x2 blocks, (4,3) stride and (2,4) count. - * Then four elements of the matrix are overwritten with the new values and - * file is closed. Program reopens the file and selects the union of two + * the matrix using 3x2 blocks, (4,3) stride and (2,4) count. + * Then four elements of the matrix are overwritten with the new values and + * file is closed. Program reopens the file and selects the union of two * hyperslabs in the dataset in the file. Then it reads the selection into the * memory dataset preserving the shape of the selection. - */ - + */ + #include "hdf5.h" #define H5FILE_NAME "Select.h5" #define MSPACE1_RANK 1 /* Rank of the first dataset in memory */ -#define MSPACE1_DIM 50 /* Dataset size in memory */ +#define MSPACE1_DIM 50 /* Dataset size in memory */ -#define MSPACE2_RANK 1 /* Rank of the second dataset in memory */ -#define MSPACE2_DIM 4 /* Dataset size in memory */ +#define MSPACE2_RANK 1 /* Rank of the second dataset in memory */ +#define MSPACE2_DIM 4 /* Dataset size in memory */ #define FSPACE_RANK 2 /* Dataset rank as it is stored in the file */ #define FSPACE_DIM1 8 /* Dimension sizes of the dataset as it is stored in the file */ -#define FSPACE_DIM2 12 +#define FSPACE_DIM2 12 /* We will read dataset back from the file to the dataset in memory with these - dataspace parameters. */ + dataspace parameters. */ #define MSPACE_RANK 2 -#define MSPACE_DIM1 8 -#define MSPACE_DIM2 9 +#define MSPACE_DIM1 8 +#define MSPACE_DIM2 9 -#define NPOINTS 4 /* Number of points that will be selected - and overwritten */ -int +#define NPOINTS 4 /* Number of points that will be selected + and overwritten */ +int main (void) { @@ -55,13 +55,13 @@ main (void) hid_t mid1, mid2, mid, fid; /* Dataspace identifiers */ hid_t plist; /* Dataset property list identifier */ - hsize_t dim1[] = {MSPACE1_DIM}; /* Dimension size of the first dataset - (in memory) */ + hsize_t dim1[] = {MSPACE1_DIM}; /* Dimension size of the first dataset + (in memory) */ hsize_t dim2[] = {MSPACE2_DIM}; /* Dimension size of the second dataset - (in memory */ - hsize_t fdim[] = {FSPACE_DIM1, FSPACE_DIM2}; + (in memory */ + hsize_t fdim[] = {FSPACE_DIM1, FSPACE_DIM2}; /* Dimension sizes of the dataset (on disk) */ - hsize_t mdim[] = {MSPACE_DIM1, MSPACE_DIM2}; /* Dimension sizes of the + hsize_t mdim[] = {MSPACE_DIM1, MSPACE_DIM2}; /* Dimension sizes of the dataset in memory when we read selection from the dataset on the disk */ @@ -71,13 +71,13 @@ main (void) hsize_t count[2]; /* Block count */ hsize_t block[2]; /* Block sizes */ - hsize_t coord[NPOINTS][FSPACE_RANK]; /* Array to store selected points - from the file dataspace */ + hsize_t coord[NPOINTS][FSPACE_RANK]; /* Array to store selected points + from the file dataspace */ herr_t ret; unsigned i,j; int fillvalue = 0; /* Fill value for the dataset */ - int matrix_out[MSPACE_DIM1][MSPACE_DIM2]; /* Buffer to read from the + int matrix_out[MSPACE_DIM1][MSPACE_DIM2]; /* Buffer to read from the dataset */ int vector[MSPACE1_DIM]; int values[] = {53, 59, 61, 67}; /* New values to be written */ @@ -97,9 +97,9 @@ main (void) * Create property list for a dataset and set up fill values. */ plist = H5Pcreate(H5P_DATASET_CREATE); - ret = H5Pset_fill_value(plist, H5T_NATIVE_INT, &fillvalue); + ret = H5Pset_fill_value(plist, H5T_NATIVE_INT, &fillvalue); - /* + /* * Create dataspace for the dataset in the file. */ fid = H5Screate_simple(FSPACE_RANK, fdim, NULL); @@ -111,12 +111,12 @@ main (void) dataset = H5Dcreate(file, "Matrix in file", H5T_NATIVE_INT, fid, plist); /* - * Select hyperslab for the dataset in the file, using 3x2 blocks, + * Select hyperslab for the dataset in the file, using 3x2 blocks, * (4,3) stride and (2,4) count starting at the position (0,1). */ start[0] = 0; start[1] = 1; stride[0] = 4; stride[1] = 3; - count[0] = 2; count[1] = 4; + count[0] = 2; count[1] = 4; block[0] = 3; block[1] = 2; ret = H5Sselect_hyperslab(fid, H5S_SELECT_SET, start, stride, count, block); @@ -126,7 +126,7 @@ main (void) mid1 = H5Screate_simple(MSPACE1_RANK, dim1, NULL); /* - * Select hyperslab. + * Select hyperslab. * We will use 48 elements of the vector buffer starting at the second element. * Selected elements are 1 2 3 . . . 48 */ @@ -135,12 +135,12 @@ main (void) count[0] = 48; block[0] = 1; ret = H5Sselect_hyperslab(mid1, H5S_SELECT_SET, start, stride, count, block); - + /* * Write selection from the vector buffer to the dataset in the file. * - * File dataset should look like this: - * 0 1 2 0 3 4 0 5 6 0 7 8 + * File dataset should look like this: + * 0 1 2 0 3 4 0 5 6 0 7 8 * 0 9 10 0 11 12 0 13 14 0 15 16 * 0 17 18 0 19 20 0 21 22 0 23 24 * 0 0 0 0 0 0 0 0 0 0 0 0 @@ -169,17 +169,17 @@ main (void) coord[2][0] = 3; coord[2][1] = 5; coord[3][0] = 5; coord[3][1] = 6; - ret = H5Sselect_elements(fid, H5S_SELECT_SET, NPOINTS, + ret = H5Sselect_elements(fid, H5S_SELECT_SET, NPOINTS, (const hsize_t **)coord); /* * Write new selection of points to the dataset. */ - ret = H5Dwrite(dataset, H5T_NATIVE_INT, mid2, fid, H5P_DEFAULT, values); + ret = H5Dwrite(dataset, H5T_NATIVE_INT, mid2, fid, H5P_DEFAULT, values); /* - * File dataset should look like this: - * 53 1 2 0 3 4 0 5 6 0 7 8 + * File dataset should look like this: + * 53 1 2 0 3 4 0 5 6 0 7 8 * 0 9 10 0 11 12 0 13 14 0 15 16 * 0 17 18 0 19 20 0 21 22 0 23 24 * 0 0 0 59 0 61 0 0 0 0 0 0 @@ -187,16 +187,16 @@ main (void) * 0 33 34 0 35 36 67 37 38 0 39 40 * 0 41 42 0 43 44 0 45 46 0 47 48 * 0 0 0 0 0 0 0 0 0 0 0 0 - * + * */ - + /* * Close memory file and memory dataspaces. */ - ret = H5Sclose(mid1); - ret = H5Sclose(mid2); - ret = H5Sclose(fid); - + ret = H5Sclose(mid1); + ret = H5Sclose(mid2); + ret = H5Sclose(fid); + /* * Close dataset. */ @@ -216,8 +216,8 @@ main (void) * Open the dataset. */ dataset = H5Dopen(file,"Matrix in file"); - - /* + + /* * Get dataspace of the open dataset. */ fid = H5Dget_space(dataset); @@ -225,7 +225,7 @@ main (void) /* * Select first hyperslab for the dataset in the file. The following * elements are selected: - * 10 0 11 12 + * 10 0 11 12 * 18 0 19 20 * 0 59 0 61 * @@ -233,50 +233,50 @@ main (void) start[0] = 1; start[1] = 2; block[0] = 1; block[1] = 1; stride[0] = 1; stride[1] = 1; - count[0] = 3; count[1] = 4; + count[0] = 3; count[1] = 4; ret = H5Sselect_hyperslab(fid, H5S_SELECT_SET, start, stride, count, block); - /* - * Add second selected hyperslab to the selection. + /* + * Add second selected hyperslab to the selection. * The following elements are selected: - * 19 20 0 21 22 - * 0 61 0 0 0 - * 27 28 0 29 30 - * 35 36 67 37 38 + * 19 20 0 21 22 + * 0 61 0 0 0 + * 27 28 0 29 30 + * 35 36 67 37 38 * 43 44 0 45 46 * 0 0 0 0 0 - * Note that two hyperslabs overlap. Common elements are: + * Note that two hyperslabs overlap. Common elements are: * 19 20 * 0 61 */ - start[0] = 2; start[1] = 4; - block[0] = 1; block[1] = 1; + start[0] = 2; start[1] = 4; + block[0] = 1; block[1] = 1; stride[0] = 1; stride[1] = 1; - count[0] = 6; count[1] = 5; + count[0] = 6; count[1] = 5; ret = H5Sselect_hyperslab(fid, H5S_SELECT_OR, start, stride, count, block); - + /* * Create memory dataspace. */ mid = H5Screate_simple(MSPACE_RANK, mdim, NULL); - /* + /* * Select two hyperslabs in memory. Hyperslabs has the same * size and shape as the selected hyperslabs for the file dataspace. */ - start[0] = 0; start[1] = 0; - block[0] = 1; block[1] = 1; + start[0] = 0; start[1] = 0; + block[0] = 1; block[1] = 1; stride[0] = 1; stride[1] = 1; - count[0] = 3; count[1] = 4; + count[0] = 3; count[1] = 4; ret = H5Sselect_hyperslab(mid, H5S_SELECT_SET, start, stride, count, block); - start[0] = 1; start[1] = 2; - block[0] = 1; block[1] = 1; + start[0] = 1; start[1] = 2; + block[0] = 1; block[1] = 1; stride[0] = 1; stride[1] = 1; - count[0] = 6; count[1] = 5; + count[0] = 6; count[1] = 5; ret = H5Sselect_hyperslab(mid, H5S_SELECT_OR, start, stride, count, block); - - /* + + /* * Initialize data buffer. */ for (i = 0; i < MSPACE_DIM1; i++) { @@ -290,16 +290,16 @@ main (void) H5P_DEFAULT, matrix_out); /* - * Display the result. Memory dataset is: - * - * 10 0 11 12 0 0 0 0 0 - * 18 0 19 20 0 21 22 0 0 - * 0 59 0 61 0 0 0 0 0 - * 0 0 27 28 0 29 30 0 0 - * 0 0 35 36 67 37 38 0 0 - * 0 0 43 44 0 45 46 0 0 - * 0 0 0 0 0 0 0 0 0 - * 0 0 0 0 0 0 0 0 0 + * Display the result. Memory dataset is: + * + * 10 0 11 12 0 0 0 0 0 + * 18 0 19 20 0 21 22 0 0 + * 0 59 0 61 0 0 0 0 0 + * 0 0 27 28 0 29 30 0 0 + * 0 0 35 36 67 37 38 0 0 + * 0 0 43 44 0 45 46 0 0 + * 0 0 0 0 0 0 0 0 0 + * 0 0 0 0 0 0 0 0 0 */ for (i=0; i < MSPACE_DIM1; i++) { for(j=0; j < MSPACE_DIM2; j++) printf("%3d ", matrix_out[i][j]); @@ -308,23 +308,23 @@ main (void) /* * Close memory file and memory dataspaces. - */ + */ ret = H5Sclose(mid); ret = H5Sclose(fid); - + /* * Close dataset. - */ + */ ret = H5Dclose(dataset); /* * Close property list */ ret = H5Pclose(plist); - + /* * Close the file. - */ + */ ret = H5Fclose(file); return 0; diff --git a/examples/h5_write.c b/examples/h5_write.c index 8cc4b8f..c3a8d35 100644 --- a/examples/h5_write.c +++ b/examples/h5_write.c @@ -12,15 +12,15 @@ * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* +/* * This example writes data to the HDF5 file. - * Data conversion is performed during write operation. + * Data conversion is performed during write operation. */ - + #include "hdf5.h" #define H5FILE_NAME "SDS.h5" -#define DATASETNAME "IntArray" +#define DATASETNAME "IntArray" #define NX 5 /* dataset dimensions */ #define NY 6 #define RANK 2 @@ -31,19 +31,19 @@ main (void) hid_t file, dataset; /* file and dataset handles */ hid_t datatype, dataspace; /* handles */ hsize_t dimsf[2]; /* dataset dimensions */ - herr_t status; + herr_t status; int data[NX][NY]; /* data to write */ int i, j; - /* - * Data and output buffer initialization. + /* + * Data and output buffer initialization. */ for (j = 0; j < NX; j++) { for (i = 0; i < NY; i++) data[j][i] = i + j; - } + } /* - * 0 1 2 3 4 5 + * 0 1 2 3 4 5 * 1 2 3 4 5 6 * 2 3 4 5 6 7 * 3 4 5 6 7 8 @@ -59,13 +59,13 @@ main (void) /* * Describe the size of the array and create the data space for fixed - * size dataset. + * size dataset. */ dimsf[0] = NX; dimsf[1] = NY; - dataspace = H5Screate_simple(RANK, dimsf, NULL); + dataspace = H5Screate_simple(RANK, dimsf, NULL); - /* + /* * Define datatype for the data in the file. * We will store little endian INT numbers. */ @@ -92,6 +92,6 @@ main (void) H5Tclose(datatype); H5Dclose(dataset); H5Fclose(file); - + return 0; -} +} diff --git a/examples/ph5example.c b/examples/ph5example.c index b2929ab..09ad7c2 100644 --- a/examples/ph5example.c +++ b/examples/ph5example.c @@ -26,7 +26,7 @@ * each dataset in an independent mode and prints them out. * All processes collectively close the datasets and the file. * - * The need of requirement of parallel file prefix is that in general + * The need of requirement of parallel file prefix is that in general * the current working directory in which compiling is done, is not suitable * for parallel I/O and there is no standard pathname for parallel file * systems. In some cases, the parallel file name may even needs some @@ -250,7 +250,7 @@ phdf5writeInd(char *filename) hsize_t count[SPACE1_RANK], stride[SPACE1_RANK]; /* for hyperslab setting */ herr_t ret; /* Generic return value */ - + MPI_Comm comm = MPI_COMM_WORLD; MPI_Info info = MPI_INFO_NULL; @@ -258,14 +258,14 @@ phdf5writeInd(char *filename) printf("Independent write test on file %s\n", filename); /* ------------------- - * START AN HDF5 FILE + * START AN HDF5 FILE * -------------------*/ /* setup file access template with parallel IO access. */ acc_tpl1 = H5Pcreate (H5P_FILE_ACCESS); assert(acc_tpl1 != FAIL); MESG("H5Pcreate access succeed"); /* set Parallel access with communicator */ - ret = H5Pset_fapl_mpio(acc_tpl1, comm, info); + ret = H5Pset_fapl_mpio(acc_tpl1, comm, info); assert(ret != FAIL); MESG("H5Pset_fapl_mpio succeed"); @@ -288,7 +288,7 @@ phdf5writeInd(char *filename) assert (sid1 != FAIL); MESG("H5Screate_simple succeed"); - + /* create a dataset collectively */ dataset1 = H5Dcreate(fid1, DATASETNAME1, H5T_NATIVE_INT, sid1, H5P_DEFAULT); @@ -321,8 +321,8 @@ if (verbose) MESG("data_array initialized"); /* create a file dataspace independently */ - file_dataspace = H5Dget_space (dataset1); - assert(file_dataspace != FAIL); + file_dataspace = H5Dget_space (dataset1); + assert(file_dataspace != FAIL); MESG("H5Dget_space succeed"); ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, NULL); @@ -334,21 +334,21 @@ if (verbose) assert (mem_dataspace != FAIL); /* write data independently */ - ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace, - H5P_DEFAULT, data_array1); + ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace, + H5P_DEFAULT, data_array1); assert(ret != FAIL); MESG("H5Dwrite succeed"); /* write data independently */ - ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace, - H5P_DEFAULT, data_array1); + ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace, + H5P_DEFAULT, data_array1); assert(ret != FAIL); MESG("H5Dwrite succeed"); /* release dataspace ID */ H5Sclose(file_dataspace); - /* close dataset collectively */ + /* close dataset collectively */ ret=H5Dclose(dataset1); assert(ret != FAIL); MESG("H5Dclose1 succeed"); @@ -359,8 +359,8 @@ if (verbose) /* release all IDs created */ H5Sclose(sid1); - /* close the file collectively */ - H5Fclose(fid1); + /* close the file collectively */ + H5Fclose(fid1); } /* Example of using the parallel HDF5 library to read a dataset */ @@ -390,7 +390,7 @@ phdf5readInd(char *filename) acc_tpl1 = H5Pcreate (H5P_FILE_ACCESS); assert(acc_tpl1 != FAIL); /* set Parallel access with communicator */ - ret = H5Pset_fapl_mpio(acc_tpl1, comm, info); + ret = H5Pset_fapl_mpio(acc_tpl1, comm, info); assert(ret != FAIL); @@ -497,7 +497,7 @@ phdf5writeAll(char *filename) hsize_t count[SPACE1_RANK], stride[SPACE1_RANK]; /* for hyperslab setting */ herr_t ret; /* Generic return value */ - + MPI_Comm comm = MPI_COMM_WORLD; MPI_Info info = MPI_INFO_NULL; @@ -505,14 +505,14 @@ phdf5writeAll(char *filename) printf("Collective write test on file %s\n", filename); /* ------------------- - * START AN HDF5 FILE + * START AN HDF5 FILE * -------------------*/ /* setup file access template with parallel IO access. */ acc_tpl1 = H5Pcreate (H5P_FILE_ACCESS); assert(acc_tpl1 != FAIL); MESG("H5Pcreate access succeed"); /* set Parallel access with communicator */ - ret = H5Pset_fapl_mpio(acc_tpl1, comm, info); + ret = H5Pset_fapl_mpio(acc_tpl1, comm, info); assert(ret != FAIL); MESG("H5Pset_fapl_mpio succeed"); @@ -535,7 +535,7 @@ phdf5writeAll(char *filename) assert (sid1 != FAIL); MESG("H5Screate_simple succeed"); - + /* create a dataset collectively */ dataset1 = H5Dcreate(fid1, DATASETNAME1, H5T_NATIVE_INT, sid1, H5P_DEFAULT); assert(dataset1 != FAIL); @@ -559,8 +559,8 @@ if (verbose) (unsigned long)(count[0]*count[1])); /* create a file dataspace independently */ - file_dataspace = H5Dget_space (dataset1); - assert(file_dataspace != FAIL); + file_dataspace = H5Dget_space (dataset1); + assert(file_dataspace != FAIL); MESG("H5Dget_space succeed"); ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, NULL); @@ -588,7 +588,7 @@ if (verbose) /* write data collectively */ ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace, - xfer_plist, data_array1); + xfer_plist, data_array1); assert(ret != FAIL); MESG("H5Dwrite succeed"); @@ -616,8 +616,8 @@ if (verbose) } /* create a file dataspace independently */ - file_dataspace = H5Dget_space (dataset1); - assert(file_dataspace != FAIL); + file_dataspace = H5Dget_space (dataset1); + assert(file_dataspace != FAIL); MESG("H5Dget_space succeed"); ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, NULL); @@ -645,7 +645,7 @@ if (verbose) /* write data independently */ ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace, - xfer_plist, data_array1); + xfer_plist, data_array1); assert(ret != FAIL); MESG("H5Dwrite succeed"); @@ -657,7 +657,7 @@ if (verbose) /* * All writes completed. Close datasets collectively - */ + */ ret=H5Dclose(dataset1); assert(ret != FAIL); MESG("H5Dclose1 succeed"); @@ -668,8 +668,8 @@ if (verbose) /* release all IDs created */ H5Sclose(sid1); - /* close the file collectively */ - H5Fclose(fid1); + /* close the file collectively */ + H5Fclose(fid1); } /* @@ -705,14 +705,14 @@ phdf5readAll(char *filename) printf("Collective read test on file %s\n", filename); /* ------------------- - * OPEN AN HDF5 FILE + * OPEN AN HDF5 FILE * -------------------*/ /* setup file access template with parallel IO access. */ acc_tpl1 = H5Pcreate (H5P_FILE_ACCESS); assert(acc_tpl1 != FAIL); MESG("H5Pcreate access succeed"); /* set Parallel access with communicator */ - ret = H5Pset_fapl_mpio(acc_tpl1, comm, info); + ret = H5Pset_fapl_mpio(acc_tpl1, comm, info); assert(ret != FAIL); MESG("H5Pset_fapl_mpio succeed"); @@ -752,8 +752,8 @@ if (verbose) (unsigned long)(count[0]*count[1])); /* create a file dataspace independently */ - file_dataspace = H5Dget_space (dataset1); - assert(file_dataspace != FAIL); + file_dataspace = H5Dget_space (dataset1); + assert(file_dataspace != FAIL); MESG("H5Dget_space succeed"); ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, NULL); @@ -781,7 +781,7 @@ if (verbose) /* read data collectively */ ret = H5Dread(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace, - xfer_plist, data_array1); + xfer_plist, data_array1); assert(ret != FAIL); MESG("H5Dread succeed"); @@ -805,8 +805,8 @@ if (verbose) (unsigned long)(count[0]*count[1])); /* create a file dataspace independently */ - file_dataspace = H5Dget_space (dataset1); - assert(file_dataspace != FAIL); + file_dataspace = H5Dget_space (dataset1); + assert(file_dataspace != FAIL); MESG("H5Dget_space succeed"); ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, NULL); @@ -834,7 +834,7 @@ if (verbose) /* read data independently */ ret = H5Dread(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace, - xfer_plist, data_array1); + xfer_plist, data_array1); assert(ret != FAIL); MESG("H5Dread succeed"); @@ -850,7 +850,7 @@ if (verbose) /* * All reads completed. Close datasets collectively - */ + */ ret=H5Dclose(dataset1); assert(ret != FAIL); MESG("H5Dclose1 succeed"); @@ -858,8 +858,8 @@ if (verbose) assert(ret != FAIL); MESG("H5Dclose2 succeed"); - /* close the file collectively */ - H5Fclose(fid1); + /* close the file collectively */ + H5Fclose(fid1); } /* @@ -903,9 +903,9 @@ test_split_comm_access(char filenames[][PATH_MAX]) /* setup file access template */ acc_tpl = H5Pcreate (H5P_FILE_ACCESS); assert(acc_tpl != FAIL); - + /* set Parallel access with communicator */ - ret = H5Pset_fapl_mpio(acc_tpl, comm, info); + ret = H5Pset_fapl_mpio(acc_tpl, comm, info); assert(ret != FAIL); /* create the file collectively */ @@ -1055,7 +1055,7 @@ cleanup(void) int main(int argc, char **argv) { - int mpi_namelen; + int mpi_namelen; char mpi_name[MPI_MAX_PROCESSOR_NAME]; int i, n; diff --git a/fortran/src/H5Af.c b/fortran/src/H5Af.c index 1541626..f19e206 100644 --- a/fortran/src/H5Af.c +++ b/fortran/src/H5Af.c @@ -19,9 +19,9 @@ /*---------------------------------------------------------------------------- * Name: h5acreate_c - * Purpose: Call H5Acreate to create an attribute - * Inputs: obj_id - object identifier - * name - name of the attribute + * Purpose: Call H5Acreate to create an attribute + * Inputs: obj_id - object identifier + * name - name of the attribute * namelen - name length * type_id - datatype identifier * space_id - dataspace identifier @@ -53,13 +53,13 @@ nh5acreate_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *type_id, h done: if(c_name) HDfree(c_name); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5aopen_name _c - * Purpose: Call H5Aopen_name to open an attribute - * Inputs: obj_id - object identifier - * name - name of the attribute + * Purpose: Call H5Aopen_name to open an attribute + * Inputs: obj_id - object identifier + * name - name of the attribute * namelen - name length * Outputs: attr_id - dataset identifier * Returns: 0 on success, -1 on failure @@ -88,12 +88,12 @@ nh5aopen_name_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *attr_id done: if(c_name) HDfree(c_name); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5awritec_c * Purpose: Call h5awrite_c to write a character attribute - * Inputs: attr_id - dataset identifier + * Inputs: attr_id - dataset identifier * mem_type_id - memory datatype identifier * buf - character data buffer * dims - array to store dimensions sizes of buf; used only @@ -115,8 +115,8 @@ nh5awritec_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) /*---------------------------------------------------------------------------- * Name: h5awrite_c - * Purpose: Call H5Awrite to write a attribute - * Inputs: attr_id - attribute identifier + * Purpose: Call H5Awrite to write a attribute + * Inputs: attr_id - attribute identifier * mem_type_id - memory datatype identifier * buf - data buffer * dims - array to store dimensions sizes of buf; used only @@ -125,7 +125,7 @@ nh5awritec_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) * Programmer: Elena Pourmal * Thursday, August 12, 1999 * Modifications: dims parameter added - * April 4, 2001 + * April 4, 2001 *---------------------------------------------------------------------------*/ int_f nh5awrite_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) @@ -140,12 +140,12 @@ nh5awrite_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dim done: return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5areadc_c * Purpose: Call h5aread_c to read character attribute - * Inputs: dset_id - dataset identifier + * Inputs: dset_id - dataset identifier * mem_type_id - memory datatype identifier * dims - array to store dimensions sizes of buf; used only * by Fortran routine. @@ -167,8 +167,8 @@ nh5areadc_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) /*---------------------------------------------------------------------------- * Name: h5aread_c - * Purpose: Call H5Aread to read an attribute - * Inputs: dset_id - dataset identifier + * Purpose: Call H5Aread to read an attribute + * Inputs: dset_id - dataset identifier * mem_type_id - memory datatype identifier * dims - array to store dimensions sizes of buf; used only * by Fortran routine. @@ -196,7 +196,7 @@ done: /*---------------------------------------------------------------------------- * Name: h5aclose_c - * Purpose: Call H5Aclose to close an attribute + * Purpose: Call H5Aclose to close an attribute * Inputs: attr_id - identifier of an attribute to be closed * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -204,7 +204,7 @@ done: * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5aclose_c ( hid_t_f *attr_id ) { int_f ret_value=0; /* Return value */ @@ -218,9 +218,9 @@ done: /*---------------------------------------------------------------------------- * Name: h5adelete_c - * Purpose: Call H5Adelete to delete an attribute - * Inputs: obj_id - object identifier - * name - name of the attribute + * Purpose: Call H5Adelete to delete an attribute + * Inputs: obj_id - object identifier + * name - name of the attribute * namelen - name length * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -248,13 +248,13 @@ nh5adelete_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen) done: if(c_name) HDfree(c_name); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5aopen_idx_c - * Purpose: Call H5Aopen_idx to open an attribute - * Inputs: obj_id - object identifier + * Purpose: Call H5Aopen_idx to open an attribute + * Inputs: obj_id - object identifier * idx - attribute index ( zero based) * Outputs: attr_id - attribute identifier * Returns: 0 on success, -1 on failure @@ -275,13 +275,13 @@ nh5aopen_idx_c (hid_t_f *obj_id, int_f *idx, hid_t_f *attr_id) done: return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5aget_space_c - * Purpose: Call H5Aget_space to get attribute's dataspace - * Inputs: attr_id - attribute identifier + * Purpose: Call H5Aget_space to get attribute's dataspace + * Inputs: attr_id - attribute identifier * Outputs: space_id - dataspace identifier * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -301,12 +301,12 @@ nh5aget_space_c (hid_t_f *attr_id, hid_t_f *space_id) done: return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5aget_type_c - * Purpose: Call H5Aget_space to get attribute's datatype - * Inputs: attr_id - attribute identifier + * Purpose: Call H5Aget_space to get attribute's datatype + * Inputs: attr_id - attribute identifier * Outputs: type_id - datatype identifier * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -326,14 +326,14 @@ nh5aget_type_c (hid_t_f *attr_id, hid_t_f *type_id) done: return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5aget_num_attrs_c - * Purpose: Call H5Aget_num_attrs to determine number of - * attributes of an object - * Inputs: obj_id - object identifier - * attr_num - number of attributes + * Purpose: Call H5Aget_num_attrs to determine number of + * attributes of an object + * Inputs: obj_id - object identifier + * attr_num - number of attributes * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Thursday, August 12, 1999 @@ -352,13 +352,13 @@ nh5aget_num_attrs_c (hid_t_f *obj_id, int_f *attr_num) done: return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5aget_name_c - * Purpose: Call H5Aget_name to get attribute's name - * Inputs: attr_id - attribute identifier - * bufsize -size of the buffer + * Purpose: Call H5Aget_name to get attribute's name + * Inputs: attr_id - attribute identifier + * bufsize -size of the buffer * Outputs: buf - buffer to hold the name * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -376,7 +376,7 @@ nh5aget_name_c(hid_t_f *attr_id, size_t_f *bufsize, _fcd buf) */ if ((c_buf = HDmalloc((size_t)*bufsize +1)) == NULL) HGOTO_DONE(FAIL); - + /* * Call H5Aget_name function */ diff --git a/fortran/src/H5Df.c b/fortran/src/H5Df.c index d8abc88..68ff852 100644 --- a/fortran/src/H5Df.c +++ b/fortran/src/H5Df.c @@ -18,9 +18,9 @@ /*---------------------------------------------------------------------------- * Name: h5dcreate_c - * Purpose: Call H5Dcreate to create a dataset - * Inputs: loc_id - file or group identifier - * name - name of the dataset + * Purpose: Call H5Dcreate to create a dataset + * Inputs: loc_id - file or group identifier + * name - name of the dataset * namelen - name length * type_id - datatype identifier * space_id - dataspace identifier @@ -42,7 +42,7 @@ nh5dcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_ hid_t c_space_id; hid_t c_dset_id; hid_t c_crt_prp; - + /* * Define creation property */ @@ -52,7 +52,7 @@ nh5dcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_ * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -69,13 +69,13 @@ nh5dcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_ DONE: HDfree(c_name); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5dopen_c - * Purpose: Call H5Dopen to open a dataset - * Inputs: loc_id - file or group identifier - * name - name of the dataset + * Purpose: Call H5Dopen to open a dataset + * Inputs: loc_id - file or group identifier + * name - name of the dataset * namelen - name length * Outputs: dset_id - dataset identifier * Returns: 0 on success, -1 on failure @@ -99,7 +99,7 @@ nh5dopen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *dset_id) * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -115,12 +115,12 @@ nh5dopen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *dset_id) DONE: HDfree(c_name); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5dwritec_c - * Purpose: Call h5dwrite_c to write a dataset of characters - * Inputs: dset_id - dataset identifier + * Purpose: Call h5dwrite_c to write a dataset of characters + * Inputs: dset_id - dataset identifier * mem_type_id - memory datatype identifier * mem_space_id - memory dataspace identifier * file_space_id - memory dataspace identifier @@ -136,7 +136,7 @@ int_f nh5dwritec_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims) { int ret_value = -1; - + /* * Call h5dwrite_c function. */ @@ -147,8 +147,8 @@ nh5dwritec_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid /*---------------------------------------------------------------------------- * Name: h5dwrite_c - * Purpose: Call H5Dwrite to write a dataset - * Inputs: dset_id - dataset identifier + * Purpose: Call H5Dwrite to write a dataset + * Inputs: dset_id - dataset identifier * mem_type_id - memory datatype identifier * mem_space_id - memory dataspace identifier * file_space_id - memory dataspace identifier @@ -175,7 +175,7 @@ nh5dwrite_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_ * Define transfer property */ c_xfer_prp = (hid_t)*xfer_prp; - + /* * Call H5Dwrite function. */ @@ -188,19 +188,19 @@ nh5dwrite_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_ if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5dwrite_ref_obj_c * Purpose: Call H5Dwrite to write a dataset of object references - * Inputs: dset_id - dataset identifier + * Inputs: dset_id - dataset identifier * mem_type_id - memory datatype identifier * mem_space_id - memory dataspace identifier * file_space_id - memory dataspace identifier * xfer_pr - identifier of transfer property list * buf - data buffer with references to the objects. - * n - number of references to be stored. + * n - number of references to be stored. * Returns: 0 on success,e-1 on failure * Programmer: Elena Pourmal * Tuesday, May 14, 2002 @@ -233,9 +233,9 @@ nh5dwrite_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_ if ( buf_c != NULL ) { for (i = 0; i < n; i++) HDmemcpy(&buf_c[i], &buf[i], sizeof(haddr_t)); - } + } else return ret_value; - + /* * Call H5Dwrite function. */ @@ -253,13 +253,13 @@ nh5dwrite_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_ /*---------------------------------------------------------------------------- * Name: h5dwrite_ref_reg_c * Purpose: Call H5Dwrite to write a dataset of dataset region references - * Inputs: dset_id - dataset identifier + * Inputs: dset_id - dataset identifier * mem_type_id - memory datatype identifier * mem_space_id - memory dataspace identifier * file_space_id - memory dataspace identifier * xfer_pr - identifier of transfer property list * buf - data buffer with references to the objects. - * n - number of references to be stored. + * n - number of references to be stored. * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Tuesday, May 14, 2002 @@ -284,7 +284,7 @@ nh5dwrite_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_ * Define transfer property */ c_xfer_prp = (hid_t)*xfer_prp; - + /* * Allocate temporary buffer and copy references from Fortran. */ @@ -294,10 +294,10 @@ nh5dwrite_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_ HDmemcpy(&buf_c[i], buf, H5R_DSET_REG_REF_BUF_SIZE); buf = buf + REF_REG_BUF_LEN_F; } - } + } else return ret_value; - - + + /* * Call H5Dwrite function. */ @@ -310,14 +310,14 @@ nh5dwrite_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_ if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5dreadc_c - * Purpose: Call h5dread_c to read a dataset of characters - * Inputs: dset_id - dataset identifier + * Purpose: Call h5dread_c to read a dataset of characters + * Inputs: dset_id - dataset identifier * mem_type_id - memory datatype identifier * mem_space_id - memory dataspace identifier * file_space_id - memory dataspace identifier @@ -333,7 +333,7 @@ int_f nh5dreadc_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims) { int ret_value = -1; - + /* * Call h5dread_c function. */ @@ -344,8 +344,8 @@ nh5dreadc_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_ /*---------------------------------------------------------------------------- * Name: h5dread_c - * Purpose: Call H5Draed to read a dataset - * Inputs: dset_id - dataset identifier + * Purpose: Call H5Draed to read a dataset + * Inputs: dset_id - dataset identifier * mem_type_id - memory datatype identifier * mem_space_id - memory dataspace identifier * file_space_id - memory dataspace identifier @@ -372,7 +372,7 @@ nh5dread_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t * Define transfer property */ c_xfer_prp = (hid_t)*xfer_prp; - + /* * Call H5Dread function. */ @@ -390,13 +390,13 @@ nh5dread_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t /*---------------------------------------------------------------------------- * Name: h5dread_ref_obj_c * Purpose: Call H5Dread to read a dataset of object references - * Inputs: dset_id - dataset identifier + * Inputs: dset_id - dataset identifier * mem_type_id - memory datatype identifier * mem_space_id - memory dataspace identifier * file_space_id - memory dataspace identifier * xfer_pr - identifier of transfer property list * buf - data buffer to store references to the objects. - * n - number of references to be stored. + * n - number of references to be stored. * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, May 15, 2002 @@ -420,7 +420,7 @@ nh5dread_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i * Define transfer property */ c_xfer_prp = (hid_t)*xfer_prp; - + /* * Allocate temporary buffer. */ @@ -440,7 +440,7 @@ nh5dread_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i HDmemcpy(&buf[i], &buf_c[i], sizeof(haddr_t)); } if ( buf_c != NULL ) HDfree(buf_c); - } + } if (ret < 0) return ret_value; ret_value = 0; return ret_value; @@ -449,13 +449,13 @@ nh5dread_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i /*---------------------------------------------------------------------------- * Name: h5dread_ref_reg_c * Purpose: Call H5Dread to read a dataset of dataset region references - * Inputs: dset_id - dataset identifier + * Inputs: dset_id - dataset identifier * mem_type_id - memory datatype identifier * mem_space_id - memory dataspace identifier * file_space_id - memory dataspace identifier * xfer_pr - identifier of transfer property list * buf - data buffer to store references to the objects. - * n - number of references to be stored. + * n - number of references to be stored. * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, May 15, 2002 @@ -479,7 +479,7 @@ nh5dread_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i * Define transfer property */ c_xfer_prp = (hid_t)*xfer_prp; - + /* * Allocate temporary buffer. */ @@ -497,20 +497,20 @@ nh5dread_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i for (i = 0; i < n; i++) { HDmemcpy(buf, &buf_c[i], H5R_DSET_REG_REF_BUF_SIZE); buf = buf + REF_REG_BUF_LEN_F; - } + } } if ( buf_c != NULL ) HDfree(buf_c); - } + } if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5dclose_c - * Purpose: Call H5Dclose to close a dataset + * Purpose: Call H5Dclose to close a dataset * Inputs: dset_id - identifier of the dataset to be closed * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -530,7 +530,7 @@ nh5dclose_c ( hid_t_f *dset_id ) /*---------------------------------------------------------------------------- * Name: h5dget_space_c - * Purpose: Call H5Dget_space to obtain dataspace of a dataset + * Purpose: Call H5Dget_space to obtain dataspace of a dataset * Inputs: dset_id - identifier of the dataset * Outputs: space_id - identifier of the dataset's dataspace * Returns: 0 on success, -1 on failure @@ -539,14 +539,14 @@ nh5dclose_c ( hid_t_f *dset_id ) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5dget_space_c ( hid_t_f *dset_id , hid_t_f *space_id) { int ret_value = -1; hid_t c_dset_id; hid_t c_space_id; - - c_dset_id = (hid_t)*dset_id; + + c_dset_id = (hid_t)*dset_id; c_space_id = H5Dget_space(c_dset_id); if(c_space_id < 0 ) return ret_value; ret_value = 0; @@ -556,7 +556,7 @@ nh5dget_space_c ( hid_t_f *dset_id , hid_t_f *space_id) /*---------------------------------------------------------------------------- * Name: h5dget_type_c - * Purpose: Call H5Dget_type to obtain datatype of a dataset + * Purpose: Call H5Dget_type to obtain datatype of a dataset * Inputs: dset_id - identifier of the dataset * Outputs: type_id - identifier of the dataset's datatype * Returns: 0 on success, -1 on failure @@ -565,13 +565,13 @@ nh5dget_space_c ( hid_t_f *dset_id , hid_t_f *space_id) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5dget_type_c ( hid_t_f *dset_id , hid_t_f *type_id) { int ret_value = -1; hid_t c_dset_id; hid_t c_type_id; - + c_dset_id = (hid_t)*dset_id; c_type_id = H5Dget_type(c_dset_id); @@ -585,7 +585,7 @@ nh5dget_type_c ( hid_t_f *dset_id , hid_t_f *type_id) /*---------------------------------------------------------------------------- * Name: h5dget_create_plist_c * Purpose: Call H5Dget_create_plist to obtain creation property list - * of a dataset + * of a dataset * Inputs: dset_id - identifier of the dataset * Outputs: plist_id - identifier of he dataset creation property list * Returns: 0 on success, -1 on failure @@ -594,13 +594,13 @@ nh5dget_type_c ( hid_t_f *dset_id , hid_t_f *type_id) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5dget_create_plist_c ( hid_t_f *dset_id , hid_t_f *plist_id) { int ret_value = -1; hid_t c_dset_id; hid_t c_plist_id; - + c_dset_id = (hid_t)*dset_id; c_plist_id = H5Dget_create_plist(c_dset_id); @@ -614,16 +614,16 @@ nh5dget_create_plist_c ( hid_t_f *dset_id , hid_t_f *plist_id) /*---------------------------------------------------------------------------- * Name: h5dextend_c - * Purpose: Call H5Dextend to extend dataset with unlimited dimensions - * Inputs: dset_id - identifier of the dataset - * Outputs: dims - array with the dimension sizes + * Purpose: Call H5Dextend to extend dataset with unlimited dimensions + * Inputs: dset_id - identifier of the dataset + * Outputs: dims - array with the dimension sizes * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Thursday, August 19, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5dextend_c ( hid_t_f *dset_id , hsize_t_f *dims) { int ret_value = -1; @@ -647,9 +647,9 @@ nh5dextend_c ( hid_t_f *dset_id , hsize_t_f *dims) /* * Reverse dimensions due to C-FORTRAN storage order. */ - for (i=0; i < rank; i++) + for (i=0; i < rank; i++) c_dims[i] = dims[rank - i - 1]; - + status = H5Dextend(c_dset_id, c_dims); if ( status >= 0 ) ret_value = 0; @@ -659,9 +659,9 @@ nh5dextend_c ( hid_t_f *dset_id , hsize_t_f *dims) /*---------------------------------------------------------------------------- * Name: nh5dget_storage_size_c - * Purpose: Call H5Dget_storage_size to return the amount of storage + * Purpose: Call H5Dget_storage_size to return the amount of storage * required for a dataset - * Inputs: dset_id - identifier of the dataset + * Inputs: dset_id - identifier of the dataset * Outputs: size - the amount of storage required for a dataset * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -669,7 +669,7 @@ nh5dextend_c ( hid_t_f *dset_id , hsize_t_f *dims) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5dget_storage_size_c ( hid_t_f *dset_id , hsize_t_f *size) { int ret_value = -1; @@ -687,9 +687,9 @@ nh5dget_storage_size_c ( hid_t_f *dset_id , hsize_t_f *size) /*---------------------------------------------------------------------------- * Name: nh5dvlen_get_max_len_c * Purpose: Get the maximum size of the VL dataset element - * Inputs: dset_id - identifier of the dataset + * Inputs: dset_id - identifier of the dataset * type_id - datatype identifier - * space_id - dataspace identifier + * space_id - dataspace identifier * Outputs: len - maximum length of the VL dataset element * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -697,7 +697,7 @@ nh5dget_storage_size_c ( hid_t_f *dset_id , hsize_t_f *size) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5dvlen_get_max_len_c ( hid_t_f *dset_id , hid_t_f *type_id, hid_t_f *space_id, size_t_f *len) { int ret_value = -1; @@ -714,20 +714,20 @@ nh5dvlen_get_max_len_c ( hid_t_f *dset_id , hid_t_f *type_id, hid_t_f *space_id c_type_id = (hid_t)*type_id; c_space_id = (hid_t)*space_id; - num_elem = H5Sget_select_npoints(c_space_id); + num_elem = H5Sget_select_npoints(c_space_id); if( num_elem < 0) return ret_value; - c_buf = (hvl_t *)malloc(sizeof(hvl_t)*(size_t)num_elem); + c_buf = (hvl_t *)malloc(sizeof(hvl_t)*(size_t)num_elem); if (c_buf == NULL) return ret_value; status = H5Dread(c_dset_id, c_type_id, H5S_ALL, c_space_id, H5P_DEFAULT, c_buf); if(status < 0) goto DONE; - + c_len = 0; - for (i=0; i < num_elem; i++) c_len = H5_MAX(c_len, c_buf[i].len); + for (i=0; i < num_elem; i++) c_len = H5_MAX(c_len, c_buf[i].len); *len = (size_t_f)c_len; H5Dvlen_reclaim(c_type_id, c_space_id, H5P_DEFAULT, c_buf); ret_value = 0; - + DONE: free(c_buf); @@ -735,11 +735,11 @@ DONE: } /*---------------------------------------------------------------------------- * Name: nh5dwrite_vl_integer_c - * Purpose: Write variable length dataset - * Inputs: dset_id - identifier of the dataset + * Purpose: Write variable length dataset + * Inputs: dset_id - identifier of the dataset * mem_type_id - datatype identifier - * mem_space_id - dataspace identifier - * file_space_id - file dataspace identifier + * mem_space_id - dataspace identifier + * file_space_id - file dataspace identifier * xfer - file transfer property * buf - data buffer * dims - one-demnsional array of size 2 @@ -752,7 +752,7 @@ DONE: * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5dwrite_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, int_f *buf, hsize_t_f *dims, size_t_f *len) { int ret_value = -1; @@ -768,7 +768,7 @@ nh5dwrite_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_ hvl_t *c_buf; hsize_t i; hsize_t num_elem; - + max_len = (size_t)dims[0]; num_elem = dims[1]; @@ -778,14 +778,14 @@ nh5dwrite_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_ c_file_space_id = (hid_t)*file_space_id; c_xfer_prp = (hid_t)*xfer_prp; - c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t)); + c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t)); if (c_buf == NULL) return ret_value; - tmp = (int_f *)buf; + tmp = (int_f *)buf; for (i=0; i < num_elem; i++) { - c_buf[i].len = (size_t)len[i]; + c_buf[i].len = (size_t)len[i]; c_buf[i].p = tmp; tmp = tmp + max_len; - } + } /* * Call H5Dwrite function. */ @@ -800,11 +800,11 @@ DONE: /*---------------------------------------------------------------------------- * Name: nh5dread_vl_integer_c - * Purpose: Read variable length dataset - * Inputs: dset_id - identifier of the dataset + * Purpose: Read variable length dataset + * Inputs: dset_id - identifier of the dataset * mem_type_id - datatype identifier - * mem_space_id - dataspace identifier - * file_space_id - file dataspace identifier + * mem_space_id - dataspace identifier + * file_space_id - file dataspace identifier * xfer - file transfer property * dims - one-demnsional array of size 2 * dims[0] = MAXLENGTH @@ -817,7 +817,7 @@ DONE: * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5dread_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, int_f *buf, hsize_t_f *dims, size_t_f *len) { int ret_value = -1; @@ -832,7 +832,7 @@ nh5dread_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_s hvl_t *c_buf; size_t i; hssize_t num_elem; - + c_dset_id = (hid_t)*dset_id; c_mem_type_id = (hid_t)*mem_type_id; c_mem_space_id = (hid_t)*mem_space_id; @@ -840,10 +840,10 @@ nh5dread_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_s c_xfer_prp = (hid_t)*xfer_prp; max_len = (size_t)dims[0]; - num_elem = H5Sget_select_npoints(c_mem_space_id); + num_elem = H5Sget_select_npoints(c_mem_space_id); if(num_elem != dims[1]) return ret_value; - c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t)); + c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t)); if (c_buf == NULL) return ret_value; /* * Call H5Dread function. @@ -851,7 +851,7 @@ nh5dread_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_s status = H5Dread(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, c_buf); if ( status < 0 ) goto DONE; for (i=0; i < num_elem; i++) { - len[i] = (size_t_f)c_buf[i].len; + len[i] = (size_t_f)c_buf[i].len; memcpy(&buf[i*max_len], c_buf[i].p, c_buf[i].len*sizeof(int_f)); } H5Dvlen_reclaim(c_mem_type_id, c_mem_space_id, H5P_DEFAULT, c_buf); @@ -864,13 +864,13 @@ DONE: /*---------------------------------------------------------------------------- * Name: nh5dwrite_vl_string_c * Purpose: Write variable length strings from Fortran program - * Inputs: dset_id - identifier of the dataset + * Inputs: dset_id - identifier of the dataset * mem_type_id - datatype identifier - * mem_space_id - dataspace identifier - * file_space_id - file dataspace identifier + * mem_space_id - dataspace identifier + * file_space_id - file dataspace identifier * xfer - file transfer property * buf - data buffer - * dims - one-demnsional array of size 2 + * dims - one-demnsional array of size 2 * dims[0] = number of strings of size max_len * len - array of strings lengths * Returns: 0 on success, -1 on failure @@ -879,7 +879,7 @@ DONE: * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5dwrite_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims, size_t_f *len) { int ret_value = -1; @@ -895,7 +895,7 @@ nh5dwrite_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_sp char **c_buf; hsize_t i; hsize_t num_elem; - + max_len = (size_t)dims[0]; num_elem = dims[1]; @@ -908,7 +908,7 @@ nh5dwrite_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_sp /* * Allocate arra of character pointers */ - c_buf = (char **)malloc((size_t)num_elem * sizeof(char *)); + c_buf = (char **)malloc((size_t)num_elem * sizeof(char *)); if (c_buf == NULL) return ret_value; /* Copy data to long C string */ @@ -923,7 +923,7 @@ nh5dwrite_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_sp for (i=0; i < num_elem; i++) { c_buf[i] = (char *) malloc((size_t)len[i]+1); memcpy(c_buf[i], tmp_p, (size_t)len[i]); - c_buf[i][len[i]] = '\0'; + c_buf[i][len[i]] = '\0'; tmp_p = tmp_p + max_len; } @@ -943,12 +943,12 @@ DONE: /*---------------------------------------------------------------------------- * Name: nh5dread_vl_string_c * Purpose: Read variable length strings from Fortran program - * Inputs: dset_id - identifier of the dataset + * Inputs: dset_id - identifier of the dataset * mem_type_id - datatype identifier - * mem_space_id - dataspace identifier - * file_space_id - file dataspace identifier + * mem_space_id - dataspace identifier + * file_space_id - file dataspace identifier * xfer - file transfer property - * dims - one-demnsional array of size 2 + * dims - one-demnsional array of size 2 * dims[0] = number of strings of size max_len * Output: buf - data buffer * len - array of strings lengths @@ -958,7 +958,7 @@ DONE: * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims, size_t_f *len) { int ret_value = -1; @@ -974,7 +974,7 @@ nh5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa char **c_buf; hsize_t i; hsize_t num_elem; - + max_len = (size_t)dims[0]; num_elem = dims[1]; @@ -987,7 +987,7 @@ nh5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa /* * Allocate array of character pointers */ - c_buf = (char **)malloc((size_t)num_elem * sizeof(char *)); + c_buf = (char **)malloc((size_t)num_elem * sizeof(char *)); if (c_buf == NULL) return ret_value; /* @@ -1017,11 +1017,11 @@ nh5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa /*---------------------------------------------------------------------------- * Name: nh5dwrite_vl_real_c - * Purpose: Write variable length dataset - * Inputs: dset_id - identifier of the dataset + * Purpose: Write variable length dataset + * Inputs: dset_id - identifier of the dataset * mem_type_id - datatype identifier - * mem_space_id - dataspace identifier - * file_space_id - file dataspace identifier + * mem_space_id - dataspace identifier + * file_space_id - file dataspace identifier * xfer - file transfer property * buf - data buffer * dims - one-demnsional array of size 2 @@ -1034,7 +1034,7 @@ nh5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5dwrite_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, real_f *buf, hsize_t_f *dims, size_t_f *len) { int ret_value = -1; @@ -1050,7 +1050,7 @@ nh5dwrite_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa hvl_t *c_buf; hsize_t i; hsize_t num_elem; - + max_len = (size_t)dims[0]; num_elem = dims[1]; @@ -1060,14 +1060,14 @@ nh5dwrite_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa c_file_space_id = (hid_t)*file_space_id; c_xfer_prp = (hid_t)*xfer_prp; - c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t)); + c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t)); if (c_buf == NULL) return ret_value; - tmp = (real_f *)buf; + tmp = (real_f *)buf; for (i=0; i < num_elem; i++) { - c_buf[i].len = (size_t)len[i]; + c_buf[i].len = (size_t)len[i]; c_buf[i].p = tmp; tmp = tmp + max_len; - } + } /* * Call H5Dwrite function. */ @@ -1082,11 +1082,11 @@ DONE: /*---------------------------------------------------------------------------- * Name: nh5dread_vl_real_c - * Purpose: Read variable length dataset - * Inputs: dset_id - identifier of the dataset + * Purpose: Read variable length dataset + * Inputs: dset_id - identifier of the dataset * mem_type_id - datatype identifier - * mem_space_id - dataspace identifier - * file_space_id - file dataspace identifier + * mem_space_id - dataspace identifier + * file_space_id - file dataspace identifier * xfer - file transfer property * dims - one-demnsional array of size 2 * dims[0] = MAXLENGTH @@ -1099,7 +1099,7 @@ DONE: * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5dread_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, real_f *buf, hsize_t_f *dims, size_t_f *len) { int ret_value = -1; @@ -1114,7 +1114,7 @@ nh5dread_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spac hvl_t *c_buf; size_t i; hssize_t num_elem; - + c_dset_id = (hid_t)*dset_id; c_mem_type_id = (hid_t)*mem_type_id; c_mem_space_id = (hid_t)*mem_space_id; @@ -1122,10 +1122,10 @@ nh5dread_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spac c_xfer_prp = (hid_t)*xfer_prp; max_len = (size_t)dims[0]; - num_elem = H5Sget_select_npoints(c_mem_space_id); + num_elem = H5Sget_select_npoints(c_mem_space_id); if(num_elem != dims[1]) return ret_value; - c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t)); + c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t)); if (c_buf == NULL) return ret_value; /* * Call H5Dread function. @@ -1133,10 +1133,10 @@ nh5dread_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spac status = H5Dread(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, c_buf); if ( status <0 ) goto DONE; for (i=0; i < num_elem; i++) { - len[i] = (size_t_f)c_buf[i].len; + len[i] = (size_t_f)c_buf[i].len; memcpy(&buf[i*max_len], c_buf[i].p, c_buf[i].len*sizeof(real_f)); } - + H5Dvlen_reclaim(c_mem_type_id, c_mem_space_id, H5P_DEFAULT, c_buf); ret_value = 0; DONE: @@ -1161,7 +1161,7 @@ int_f nh5dfillc_c (_fcd fill_value, hid_t_f *fill_type_id, hid_t_f *space_id, _fcd buf, hid_t_f *mem_type_id) { int ret_value = -1; - + /* * Call h5dfill_c function. */ @@ -1195,7 +1195,7 @@ nh5dfill_c (void * fill_value, hid_t_f *fill_type_id, hid_t_f *space_id, void * c_fill_type_id = (hid_t)*fill_type_id; c_mem_type_id = (hid_t)*mem_type_id; c_space_id = (hid_t)*space_id; - + /* * Call H5Dfill function. */ @@ -1204,7 +1204,7 @@ nh5dfill_c (void * fill_value, hid_t_f *fill_type_id, hid_t_f *space_id, void * if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5dget_space_status_c @@ -1226,7 +1226,7 @@ nh5dget_space_status_c ( hid_t_f *dset_id, int_f *flag) H5D_space_status_t c_flag; c_dset_id = (hid_t)*dset_id; - + /* * Call H5Dget_space_status */ @@ -1236,5 +1236,5 @@ nh5dget_space_status_c ( hid_t_f *dset_id, int_f *flag) *flag = (int_f)c_flag; ret_value = 0; return ret_value; -} +} diff --git a/fortran/src/H5Ef.c b/fortran/src/H5Ef.c index 6bd6d74..3c47ee2 100644 --- a/fortran/src/H5Ef.c +++ b/fortran/src/H5Ef.c @@ -20,15 +20,15 @@ /*---------------------------------------------------------------------------- * Name: h5eclear_c * Purpose: Call H5Eclear to clear the error stack for the current thread - * Inputs: - * Outputs: + * Inputs: + * Outputs: * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Wednesday, March 29, 2000 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5eclear_c( ) { int ret_val = -1; @@ -37,18 +37,18 @@ nh5eclear_c( ) /* * Call H5Eclear function. */ - status = H5Eclear_stack(H5E_DEFAULT); + status = H5Eclear_stack(H5E_DEFAULT); if(status < 0) return ret_val; ret_val = 0; return ret_val; -} +} /*---------------------------------------------------------------------------- * Name: h5eprint_c1 * Purpose: Call H5Eprint to print the error stack in a default manner. * Inputs: name - file name * namelen - length of name - * Outputs: + * Outputs: * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Wednesday, March 29, 2000 @@ -76,17 +76,17 @@ nh5eprint_c1(_fcd name, int_f* namelen) fclose(file); DONE: - HDfree(c_name); + HDfree(c_name); return ret_val; -} +} /*---------------------------------------------------------------------------- * Name: h5eprint_c2 * Purpose: Call H5Eprint to print the error stack to stderr * in a default manner. - * Inputs: - * Outputs: + * Inputs: + * Outputs: * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Wednesday, March 29, 2000 @@ -104,11 +104,11 @@ nh5eprint_c2() status = H5Eprint_stack(H5E_DEFAULT, NULL); if(status >= 0) ret_val = 0; return ret_val; -} +} /*---------------------------------------------------------------------------- * Name: h5eget_major_c - * Purpose: Call H5Eget_major to get a character string + * Purpose: Call H5Eget_major to get a character string * describing an error specified by a major error number. * Inputs: error_no - Major error number * Outputs: name - character string describing the error @@ -133,16 +133,16 @@ nh5eget_major_c(int_f* error_no, _fcd name, size_t_f* namelen) * Call H5Eget_major function. */ H5Eget_msg(c_error_no, NULL, c_name, c_namelen); - HD5packFstring((char*)c_name, _fcdtocp(name), c_namelen); - + HD5packFstring((char*)c_name, _fcdtocp(name), c_namelen); + if(!strcmp(c_name, "Invalid major error number")) return ret_val; ret_val = 0; return ret_val; -} +} /*---------------------------------------------------------------------------- * Name: h5eget_minor_c - * Purpose: Call H5Eget_minor to get a character string + * Purpose: Call H5Eget_minor to get a character string * describing an error specified by a minor error number. * Inputs: error_no - Major error number * Outputs: name - character string describing the error @@ -167,18 +167,18 @@ nh5eget_minor_c(int_f* error_no, _fcd name, size_t_f* namelen) * Call H5Eget_minor function. */ H5Eget_msg(c_error_no, NULL, c_name, c_namelen); - HD5packFstring((char*)c_name, _fcdtocp(name), c_namelen); - + HD5packFstring((char*)c_name, _fcdtocp(name), c_namelen); + if(!strcmp(c_name, "Invalid minor error number")) return ret_val; ret_val = 0; return ret_val; -} +} /*---------------------------------------------------------------------------- * Name: h5eset_auto_c * Purpose: Call H5Eset_auto to turn automatic error printing on or off. * Inputs: printflag - flag to turn automatic error printing on or off. - * Outputs: + * Outputs: * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Friday, November 17, 2000 diff --git a/fortran/src/H5FDmpiof.c b/fortran/src/H5FDmpiof.c index 1a8aa13..6803674 100644 --- a/fortran/src/H5FDmpiof.c +++ b/fortran/src/H5FDmpiof.c @@ -15,12 +15,12 @@ /* This files contains C stubs for Parallel Fortran APIs */ #include "H5f90.h" -#include +#include #include "H5public.h" /* Support for C to Fortran translation in MPI */ -#ifndef H5_HAVE_MPI_MULTI_LANG_Comm +#ifndef H5_HAVE_MPI_MULTI_LANG_Comm #define MPI_Comm_c2f(comm) (int_f)(comm) #define MPI_Comm_f2c(comm) (MPI_Comm)(comm) #endif /*MPI Comm*/ @@ -31,14 +31,14 @@ /*---------------------------------------------------------------------------- * Name: h5pset_fapl_mpio_c - * Purpose: Call H5Pset_fapl_mpio to set mode for parallel I/O and the user - * supplied communicator and info object + * Purpose: Call H5Pset_fapl_mpio to set mode for parallel I/O and the user + * supplied communicator and info object * Inputs: prp_id - property list identifier - * comm - MPI communicator - * info - MPI info object + * comm - MPI communicator + * info - MPI info object * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Thursday, October 26, 2000 + * Programmer: Elena Pourmal + * Thursday, October 26, 2000 * Modifications: *---------------------------------------------------------------------------*/ int_f @@ -48,8 +48,8 @@ nh5pset_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info) hid_t c_prp_id; herr_t ret; MPI_Comm c_comm; - MPI_Info c_info; - c_comm = MPI_Comm_f2c(*comm); + MPI_Info c_info; + c_comm = MPI_Comm_f2c(*comm); c_info = MPI_Info_f2c(*info); /* @@ -60,17 +60,17 @@ nh5pset_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info) if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_fapl_mpio_c - * Purpose: Call H5Pget_fapl_mpio to retrieve communicator and info object + * Purpose: Call H5Pget_fapl_mpio to retrieve communicator and info object * Inputs: prp_id - property list identifier - * comm - buffer to return MPI communicator - * info - buffer to return MPI info object + * comm - buffer to return MPI communicator + * info - buffer to return MPI info object * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Thursday, October 26, 2000 + * Programmer: Elena Pourmal + * Thursday, October 26, 2000 * Modifications: *---------------------------------------------------------------------------*/ int_f @@ -80,7 +80,7 @@ nh5pget_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info) hid_t c_prp_id; herr_t ret; MPI_Comm c_comm; - MPI_Info c_info; + MPI_Info c_info; /* * Call H5Pget_mpi function. @@ -92,16 +92,16 @@ nh5pget_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info) *info = (int_f) MPI_Info_c2f(c_info); ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pset_dxpl_mpio_c - * Purpose: Call H5Pset_dxpl_mpio to set transfer mode of the dataset - * trasfer property list + * Purpose: Call H5Pset_dxpl_mpio to set transfer mode of the dataset + * trasfer property list * Inputs: prp_id - property list identifier * data_xfer_mode - transfer mode * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Thursday, October 26, 2000 + * Programmer: Elena Pourmal + * Thursday, October 26, 2000 * Modifications: *---------------------------------------------------------------------------*/ int_f @@ -134,17 +134,17 @@ nh5pset_dxpl_mpio_c(hid_t_f *prp_id, int_f* data_xfer_mode) if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_dxpl_mpio_c - * Purpose: Call H5Pget_dxpl_mpio to get transfer mode of the dataset - * trasfer property list + * Purpose: Call H5Pget_dxpl_mpio to get transfer mode of the dataset + * trasfer property list * Inputs: prp_id - property list identifier * data_xfer_mode - buffer to retrieve transfer mode * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Thursday, June 15, 2000 + * Programmer: Elena Pourmal + * Thursday, June 15, 2000 * Modifications: *---------------------------------------------------------------------------*/ int_f @@ -161,7 +161,7 @@ nh5pget_dxpl_mpio_c(hid_t_f *prp_id, int_f* data_xfer_mode) c_prp_id = *prp_id; ret = H5Pget_dxpl_mpio(c_prp_id, &c_data_xfer_mode); if (ret < 0) return ret_value; - *data_xfer_mode = (int_f)c_data_xfer_mode; + *data_xfer_mode = (int_f)c_data_xfer_mode; /* switch (c_data_xfer_mode) { @@ -179,17 +179,17 @@ nh5pget_dxpl_mpio_c(hid_t_f *prp_id, int_f* data_xfer_mode) */ ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pset_fapl_mpiposix_c - * Purpose: Call H5Pset_fapl_mpiposix to set mode for parallel I/O and the user - * supplied communicator + * Purpose: Call H5Pset_fapl_mpiposix to set mode for parallel I/O and the user + * supplied communicator * Inputs: prp_id - property list identifier - * comm - MPI communicator + * comm - MPI communicator * flag - flag to use GPFS hints * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * Programmer: Elena Pourmal * Tuesday, May 6, 2003 * Modifications: *---------------------------------------------------------------------------*/ @@ -201,7 +201,7 @@ nh5pset_fapl_mpiposix_c(hid_t_f *prp_id, int_f* comm, int_f* flag) herr_t ret; hbool_t c_flag; MPI_Comm c_comm; - c_comm = MPI_Comm_f2c(*comm); + c_comm = MPI_Comm_f2c(*comm); c_flag = (hbool_t)*flag; /* * Call H5Pset_fapl_mpiposix function. @@ -211,17 +211,17 @@ nh5pset_fapl_mpiposix_c(hid_t_f *prp_id, int_f* comm, int_f* flag) if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_fapl_mpiposix_c - * Purpose: Call H5Pget_fapl_mpiposix to retrieve communicator and info object + * Purpose: Call H5Pget_fapl_mpiposix to retrieve communicator and info object * Inputs: prp_id - property list identifier - * Outputs: comm - buffer to return MPI communicator + * Outputs: comm - buffer to return MPI communicator * flag - flag to use GPFS hints * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Tuesday, May 6, 2003 + * Programmer: Elena Pourmal + * Tuesday, May 6, 2003 * Modifications: *---------------------------------------------------------------------------*/ int_f @@ -243,4 +243,4 @@ nh5pget_fapl_mpiposix_c(hid_t_f *prp_id, int_f* comm, int_f* flag) *flag = (int_f) c_flag; ret_value = 0; return ret_value; -} +} diff --git a/fortran/src/H5Ff.c b/fortran/src/H5Ff.c index cc3fb36..4b21b45 100644 --- a/fortran/src/H5Ff.c +++ b/fortran/src/H5Ff.c @@ -20,11 +20,11 @@ /*---------------------------------------------------------------------------- * Name: h5fcreate_c * Purpose: Call H5Fcreate to create the file - * Inputs: name - name of the file + * Inputs: name - name of the file * namelen - name length * access_flags - file access flags * crt_pr - identifier of creation property list - * acc_prp - identifier of access property list + * acc_prp - identifier of access property list * Outputs: file_id - file identifier * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -65,7 +65,7 @@ nh5fcreate_c(_fcd name, int_f *namelen, int_f *access_flags, hid_t_f* crt_prp, h * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, (size_t)c_namelen); + c_name = (char *)HD5f2cstring(name, (size_t)c_namelen); if (c_name == NULL) return ret_value; /* @@ -78,15 +78,15 @@ nh5fcreate_c(_fcd name, int_f *namelen, int_f *access_flags, hid_t_f* crt_prp, h HDfree(c_name); ret_value = 0; return ret_value; -} - +} + /*---------------------------------------------------------------------------- * Name: h5fflush_c * Purpose: Call H5Fflush to flush the object * Inputs: object_id - identifier of either a file, a dataset, - * a group, an attribute or a named data type + * a group, an attribute or a named data type * scope - integer to specify the flushing action, either - * H5F_SCOPE_GLOBAL or H5F_SCOPE_LOCAL + * H5F_SCOPE_GLOBAL or H5F_SCOPE_LOCAL * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Friday, November 5, 1999 @@ -112,17 +112,17 @@ nh5fflush_c (hid_t_f *object_id, int_f *scope) if (status >= 0) ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5fmount_c * Purpose: Call H5Fmount to mount the file * Inputs: loc_id - Identifier for file or group - * dsetname - name of dataset + * dsetname - name of dataset * namelen - dsetname length * file_id - file identifier for the file to be mounted - * acc_prp - identifier of access property list + * acc_prp - identifier of access property list * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Monday, October 25, 1999 @@ -153,7 +153,7 @@ nh5fmount_c (hid_t_f *loc_id, _fcd dsetname, int_f *namelen, hid_t_f *file_id, h * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(dsetname, (size_t)c_namelen); + c_name = (char *)HD5f2cstring(dsetname, (size_t)c_namelen); if (c_name == NULL) return ret_value; /* @@ -165,13 +165,13 @@ nh5fmount_c (hid_t_f *loc_id, _fcd dsetname, int_f *namelen, hid_t_f *file_id, h HDfree(c_name); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5funmount_c * Purpose: Call H5Funmount to unmount the file * Inputs: loc_id - Identifier for file or group - * dsetname - name of dataset + * dsetname - name of dataset * namelen - dsetname length * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su @@ -193,7 +193,7 @@ nh5funmount_c (hid_t_f *loc_id, _fcd dsetname, int_f *namelen) * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(dsetname, (size_t)c_namelen); + c_name = (char *)HD5f2cstring(dsetname, (size_t)c_namelen); if (c_name == NULL) return ret_value; /* @@ -205,17 +205,17 @@ nh5funmount_c (hid_t_f *loc_id, _fcd dsetname, int_f *namelen) HDfree(c_name); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5fopen_c * Purpose: Call H5Fopen to open the file - * Inputs: name - name of the file + * Inputs: name - name of the file * namelen - name length * access_flags - file access flags - * acc_prp - identifier of access property list + * acc_prp - identifier of access property list * Outputs: file_id - file identifier * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -249,7 +249,7 @@ nh5fopen_c (_fcd name, int_f *namelen, int_f *access_flags, hid_t_f *acc_prp, hi * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, (size_t)c_namelen); + c_name = (char *)HD5f2cstring(name, (size_t)c_namelen); if (c_name == NULL) return ret_value; /* @@ -263,7 +263,7 @@ nh5fopen_c (_fcd name, int_f *namelen, int_f *access_flags, hid_t_f *acc_prp, hi HDfree(c_name); ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5freopen_c @@ -289,7 +289,7 @@ nh5freopen_c (hid_t_f *file_id1, hid_t_f *file_id2) ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5fget_create_plist_c @@ -315,7 +315,7 @@ nh5fget_create_plist_c (hid_t_f *file_id, hid_t_f *prop_id) ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5fget_access_plist_c @@ -341,15 +341,15 @@ nh5fget_access_plist_c (hid_t_f *file_id, hid_t_f *access_id) ret_value = 0; return ret_value; -} - +} + /*---------------------------------------------------------------------------- * Name: h5fis_hdf5_c * Purpose: Call H5Fis_hdf5 to determone if the file is an HDF5 file - * Inputs: name - name of the file + * Inputs: name - name of the file * namelen - name length * Outputs: flag - 0 if file is not HDF5 file , positive if a file - * is an HDF5 file, and negative on failure. + * is an HDF5 file, and negative on failure. * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Tuesday, August 3, 1999 @@ -367,7 +367,7 @@ nh5fis_hdf5_c (_fcd name, int_f *namelen, int_f *flag) * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, (size_t)c_namelen); + c_name = (char *)HD5f2cstring(name, (size_t)c_namelen); if (c_name == NULL) return ret_value; /* @@ -379,7 +379,7 @@ nh5fis_hdf5_c (_fcd name, int_f *namelen, int_f *flag) HDfree(c_name); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5fclose_c * Purpose: Call H5Fclose to close the file @@ -390,7 +390,7 @@ nh5fis_hdf5_c (_fcd name, int_f *namelen, int_f *flag) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5fclose_c ( hid_t_f *file_id ) { int ret_value = 0; @@ -405,21 +405,21 @@ nh5fclose_c ( hid_t_f *file_id ) * Purpose: Call H5Fget_obj_count to get number of open objects within a file * Inputs: file_id - identifier of the file to be closed * obj_type - type of the object - * Returns: obj_count - number of objects + * Returns: obj_count - number of objects * 0 on success, -1 on failure * Programmer: Elena Pourmal * Monday, September 30, 2002 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5fget_obj_count_c ( hid_t_f *file_id , int_f *obj_type, int_f * obj_count) { int ret_value = 0; hid_t c_file_id; unsigned c_obj_type; int c_obj_count; - + c_file_id = (hid_t)*file_id; c_obj_type = (unsigned) *obj_type; @@ -439,7 +439,7 @@ nh5fget_obj_count_c ( hid_t_f *file_id , int_f *obj_type, int_f * obj_count) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5fget_obj_ids_c ( hid_t_f *file_id , int_f *obj_type, int_f *max_objs, hid_t_f *obj_ids) { int ret_value = 0; @@ -464,7 +464,7 @@ nh5fget_obj_ids_c ( hid_t_f *file_id , int_f *obj_type, int_f *max_objs, hid_t_f * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5fget_freespace_c ( hid_t_f *file_id , hssize_t_f *free_space) { int ret_value = 0; @@ -479,9 +479,9 @@ nh5fget_freespace_c ( hid_t_f *file_id , hssize_t_f *free_space) /*---------------------------------------------------------------------------- * Name: h5fget_name_c - * Purpose: Call H5Fget_name to get file's name - * Inputs: obj_id - object identifier - * buflen -size of the buffer + * Purpose: Call H5Fget_name to get file's name + * Inputs: obj_id - object identifier + * buflen -size of the buffer * Outputs: buf - buffer to hold the name * size - size of the file's name * Returns: 0 on success, -1 on failure @@ -501,7 +501,7 @@ nh5fget_name_c(hid_t_f *obj_id, size_t_f *size, _fcd buf, size_t_f *buflen) */ if ((c_buf = HDmalloc((size_t)*buflen +1)) == NULL) HGOTO_DONE(FAIL); - + /* * Call H5Aget_name function */ @@ -522,7 +522,7 @@ done: /*---------------------------------------------------------------------------- * Name: h5fget_filesize_c * Purpose: Call H5Fget_filesize to get file size - * Inputs: file_id - file identifier + * Inputs: file_id - file identifier * Outputs: size - size of the file * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal diff --git a/fortran/src/H5Gf.c b/fortran/src/H5Gf.c index 42f5658..fdce19f 100644 --- a/fortran/src/H5Gf.c +++ b/fortran/src/H5Gf.c @@ -18,9 +18,9 @@ /*---------------------------------------------------------------------------- * Name: h5gcreate_c - * Purpose: Call H5Gcreate to create a group - * Inputs: loc_id - file or group identifier - * name - name of the group + * Purpose: Call H5Gcreate to create a group + * Inputs: loc_id - file or group identifier + * name - name of the group * namelen - name length * size_hint - length of names in the group * Outputs: grp_id - group identifier @@ -43,16 +43,16 @@ nh5gcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size_hint, * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* * Call H5Gcreate function. */ c_loc_id = *loc_id; - if ( *size_hint == OBJECT_NAMELEN_DEFAULT_F ) + if ( *size_hint == OBJECT_NAMELEN_DEFAULT_F ) c_grp_id = H5Gcreate(c_loc_id, c_name, 0); else { - c_size_hint = (size_t)*size_hint; + c_size_hint = (size_t)*size_hint; c_grp_id = H5Gcreate(c_loc_id, c_name, c_size_hint); } if (c_grp_id < 0) goto DONE; @@ -62,13 +62,13 @@ nh5gcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size_hint, DONE: HDfree(c_name); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5gopen_c - * Purpose: Call H5Gopen to open a dataset - * Inputs: loc_id - file or group identifier - * name - name of the group + * Purpose: Call H5Gopen to open a dataset + * Inputs: loc_id - file or group identifier + * name - name of the group * namelen - name length * Outputs: grp_id - group identifier * Returns: 0 on success, -1 on failure @@ -89,7 +89,7 @@ nh5gopen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *grp_id) * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -105,27 +105,27 @@ nh5gopen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *grp_id) DONE: HDfree(c_name); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5gget_obj_info_idx_c * Purpose: Call H5Gget_obj_info to return name and the type of group - * member - * Inputs: loc_id - file or group identifier - * name - name of the group + * member + * Inputs: loc_id - file or group identifier + * name - name of the group * namelen - name length * idx - index of the group member * Outputs: obj_name - buffer to store member's name * obj_namelen - length of the buffer - * obj_type - type of the object + * obj_type - type of the object * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, August 5, 1999 * Modifications: *---------------------------------------------------------------------------*/ int_f -nh5gget_obj_info_idx_c -(hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *idx, _fcd obj_name, int_f *obj_namelen, int_f *obj_type) +nh5gget_obj_info_idx_c +(hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *idx, _fcd obj_name, int_f *obj_namelen, int_f *obj_type) { int ret_value = -1; hid_t c_loc_id = (hid_t)*loc_id; @@ -142,13 +142,13 @@ nh5gget_obj_info_idx_c */ c_namelen = *namelen; c_obj_namelen = *obj_namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* * Allocate buffer to hold name of the object */ - if (c_obj_namelen) c_obj_name = (char *)HDmalloc(c_obj_namelen + 1); + if (c_obj_namelen) c_obj_name = (char *)HDmalloc(c_obj_namelen + 1); if (c_obj_name == NULL) { HDfree(c_name); return ret_value; } @@ -175,15 +175,15 @@ DONE: HDfree(c_obj_name); HDfree(c_name); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5gn_members_c - * Purpose: Call H5Gn_members to find number of objects in the group - * Inputs: loc_id - file or group identifier - * name - name of the group + * Purpose: Call H5Gn_members to find number of objects in the group + * Inputs: loc_id - file or group identifier + * name - name of the group * namelen - name length - * Outputs: nmemebers - number of members + * Outputs: nmemebers - number of members * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, August 5, 1999 @@ -196,14 +196,14 @@ nh5gn_members_c (hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *nmembers) hid_t c_loc_id=(hid_t)*loc_id; char *c_name; int c_namelen; - hsize_t c_nmembers; + hsize_t c_nmembers; hid_t gid = (-1); /* * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* Get a temporary group ID for the group to query */ @@ -221,10 +221,10 @@ DONE: HDfree(c_name); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5gclose_c - * Purpose: Call H5Gclose to close the group + * Purpose: Call H5Gclose to close the group * Inputs: grp_id - identifier of the group to be closed * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -232,12 +232,12 @@ DONE: * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5gclose_c ( hid_t_f *grp_id ) { int ret_value = 0; hid_t c_grp_id; - + c_grp_id = (hid_t)*grp_id; if ( H5Gclose(c_grp_id) < 0 ) ret_value = -1; return ret_value; @@ -246,8 +246,8 @@ nh5gclose_c ( hid_t_f *grp_id ) /*---------------------------------------------------------------------------- * Name: h5glink_c - * Purpose: Call H5Glink to link the specified type - * Inputs: loc_id - identifier of file or group + * Purpose: Call H5Glink to link the specified type + * Inputs: loc_id - identifier of file or group * link_type - link type * current_name - name of the existing object for hard link, * anything for the soft link @@ -278,7 +278,7 @@ nh5glink_c(hid_t_f *loc_id, int_f *link_type, _fcd current_name, int_f *current_ if (c_current_name == NULL) return ret_value; c_new_name = (char *)HD5f2cstring(new_name, c_new_namelen); - if(c_new_name == NULL) { HDfree(c_current_name); + if(c_new_name == NULL) { HDfree(c_current_name); return ret_value; } /* @@ -299,8 +299,8 @@ DONE: /*---------------------------------------------------------------------------- * Name: h5glink2_c - * Purpose: Call H5Glink2 to link the specified type - * Inputs: cur_loc_id - identifier of file or group + * Purpose: Call H5Glink2 to link the specified type + * Inputs: cur_loc_id - identifier of file or group * cur_name - name of the existing object for hard link releative * to cur_loc_id location, * anything for the soft link @@ -313,7 +313,7 @@ DONE: * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, September 25, 2002 - * Modifications: + * Modifications: *---------------------------------------------------------------------------*/ int_f @@ -357,8 +357,8 @@ DONE: /*---------------------------------------------------------------------------- * Name: h5gunlink_c - * Purpose: Call H5Gunlink to remove the specified name - * Inputs: loc_id - identifier of file or group + * Purpose: Call H5Gunlink to remove the specified name + * Inputs: loc_id - identifier of file or group * name - name of the object to unlink * Returns: 0 on success, -1 on failure * Programmer: Mingshi Chen @@ -396,8 +396,8 @@ DONE: /*---------------------------------------------------------------------------- * Name: h5gmove_c * Purpose: Call H5Gmove to rename an object within an HDF5 file - * Inputs: loc_id - identifier of file or group - * src_name - name of the original object + * Inputs: loc_id - identifier of file or group + * src_name - name of the original object * src_namelen - original name lenghth * dst_name - new name for the object * dst_namelen - new name lenghth @@ -424,7 +424,7 @@ nh5gmove_c(hid_t_f *loc_id, _fcd src_name, int_f *src_namelen, _fcd dst_name, in if(c_src_name == NULL) return ret_value; c_dst_name = (char *)HD5f2cstring(dst_name, c_dst_namelen); - if(c_dst_name == NULL) { HDfree(c_src_name); + if(c_dst_name == NULL) { HDfree(c_src_name); return ret_value; } /* @@ -445,7 +445,7 @@ DONE: /*---------------------------------------------------------------------------- * Name: h5gmove2_c * Purpose: Call H5Gmove2 to rename an object within an HDF5 file - * Inputs: src_loc_id - identifier of file or group + * Inputs: src_loc_id - identifier of file or group * src_name - name of the original object relative to src_loc_id * src_namelen - original name lenghth * dst_loc_id - new location identifier @@ -454,7 +454,7 @@ DONE: * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, September 25, 2002 - * Modifications: + * Modifications: *---------------------------------------------------------------------------*/ int_f @@ -475,7 +475,7 @@ nh5gmove2_c(hid_t_f *src_loc_id, _fcd src_name, int_f *src_namelen, hid_t_f *dst if(c_src_name == NULL) return ret_value; c_dst_name = (char *)HD5f2cstring(dst_name, c_dst_namelen); - if(c_dst_name == NULL) { HDfree(c_src_name); + if(c_dst_name == NULL) { HDfree(c_src_name); return ret_value; } /* @@ -497,8 +497,8 @@ DONE: /*---------------------------------------------------------------------------- * Name: h5gget_linkval_c * Purpose: Call H5Gget_linkval to return the name of object - * Inputs: loc_id - identifier of file or group - * name - name of the object that symbolic link points to + * Inputs: loc_id - identifier of file or group + * name - name of the object that symbolic link points to * namelen - the name lenghth * size - lenghth of retrurned value * Outputs: value - name to be returned @@ -530,10 +530,10 @@ nh5gget_linkval_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size, _f */ if(*size) c_value = (char *)HDmalloc((size_t)*size); if(c_value == NULL) { - HDfree(c_name); + HDfree(c_name); return ret_value; } - + /* * Call H5Gget_linkval function */ @@ -542,7 +542,7 @@ nh5gget_linkval_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size, _f c_loc_id = (hid_t)*loc_id; c_ret_value = H5Gget_linkval(c_loc_id, c_name, c_size, c_value); if(c_ret_value < 0) goto DONE; - + /* * Convert C name to FORTRAN and place it in the given buffer @@ -559,8 +559,8 @@ DONE: /*---------------------------------------------------------------------------- * Name: h5gset_comment_c * Purpose: Call H5Gset_comment to set comments for the specified object - * Inputs: loc_id - identifier of file or group - * name - name of object whose comment is to be set or reset + * Inputs: loc_id - identifier of file or group + * name - name of object whose comment is to be set or reset * namelen - the name lenghth * comment - the new comment * commentlen - new comment lenghth @@ -608,8 +608,8 @@ DONE: /*---------------------------------------------------------------------------- * Name: h5gget_comment_c * Purpose: Call H5Gget_comment to retrieve comments for the specified object - * Inputs: loc_id - identifier of file or group - * name - name of object whose comment is to be set or reset + * Inputs: loc_id - identifier of file or group + * name - name of object whose comment is to be set or reset * namelen - the name lenghth * bufsize - at most bufsize characters * comment - the new comment @@ -629,7 +629,7 @@ nh5gget_comment_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *bufsize, char *c_comment = NULL; size_t c_bufsize; herr_t c_ret_value; - + /* * Convert Fortran name to C name */ @@ -646,7 +646,7 @@ nh5gget_comment_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *bufsize, HDfree(c_name); return ret_value; } - + /* * Call H5Gget_comment function */ diff --git a/fortran/src/H5If.c b/fortran/src/H5If.c index e739508..6931066 100644 --- a/fortran/src/H5If.c +++ b/fortran/src/H5If.c @@ -19,9 +19,9 @@ /*---------------------------------------------------------------------------- * Name: h5iget_type_c - * Purpose: Call H5Iget_type to get the type of an object - * Inputs: obj_id - object identifier - * Outputs: type - object type + * Purpose: Call H5Iget_type to get the type of an object + * Inputs: obj_id - object identifier + * Outputs: type - object type * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Thursday, March 24, 2000 @@ -46,9 +46,9 @@ nh5iget_type_c (hid_t_f *obj_id, int_f *type) } /*---------------------------------------------------------------------------- * Name: h5iget_name_c - * Purpose: Call H5Iget_name to get object's name - * Inputs: obj_id - object identifier - * buf_size - size of the buffer + * Purpose: Call H5Iget_name to get object's name + * Inputs: obj_id - object identifier + * buf_size - size of the buffer * Outputs: buf - buffer to hold the name * Returns: length of the name on success, -1 on failure * Programmer: Elena Pourmal @@ -69,8 +69,8 @@ nh5iget_name_c(hid_t_f *obj_id, _fcd buf, size_t_f *buf_size, size_t_f *name_siz */ c_buf_size = (size_t)*buf_size; c_buf = (char *)HDmalloc(c_buf_size +1); - if (c_buf == NULL) return ret_value; - + if (c_buf == NULL) return ret_value; + /* * Call H5IAget_name function */ @@ -93,7 +93,7 @@ DONE: /*---------------------------------------------------------------------------- * Name: h5iinc_ref_c * Purpose: Call H5Iinc_ref to increment object's reference count - * Inputs: obj_id - object identifier + * Inputs: obj_id - object identifier * Outputs: ref_count - Reference count of ID * Returns: current reference count on success, -1 on failure * Programmer: Quincey Koziol @@ -122,7 +122,7 @@ done: /*---------------------------------------------------------------------------- * Name: h5idec_ref_c * Purpose: Call H5Idec_ref to decrement object's reference count - * Inputs: obj_id - object identifier + * Inputs: obj_id - object identifier * Outputs: ref_count - Reference count of ID * Returns: current reference count on success, -1 on failure * Programmer: Quincey Koziol @@ -151,7 +151,7 @@ done: /*---------------------------------------------------------------------------- * Name: h5iget_ref_c * Purpose: Call H5Iget_ref to retrieve object's reference count - * Inputs: obj_id - object identifier + * Inputs: obj_id - object identifier * Outputs: ref_count - Reference count of ID * Returns: current reference count on success, -1 on failure * Programmer: Quincey Koziol @@ -180,7 +180,7 @@ done: /*---------------------------------------------------------------------------- * Name: h5iget_file_id_c * Purpose: Call H5Iget_file_id to obtain file identifier from object identifier - * Inputs: obj_id - object identifier + * Inputs: obj_id - object identifier * Outputs: file_id - file identifier * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index 2b6e8be..91508c0 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -19,24 +19,24 @@ /*---------------------------------------------------------------------------- * Name: h5pcreate_c - * Purpose: Call H5Pcreate to create a property list + * Purpose: Call H5Pcreate to create a property list * Inputs: class - property list class identifier - * Outputs: prp_id - identifier of the created property list + * Outputs: prp_id - identifier of the created property list * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, October 9, 2002 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pcreate_c ( hid_t_f *class, hid_t_f *prp_id ) { hid_t c_class; int ret_value = 0; hid_t c_prp_id; - + c_class = (hid_t)*class; - c_prp_id = H5Pcreate(c_class); + c_prp_id = H5Pcreate(c_class); if ( c_prp_id < 0 ) ret_value = -1; *prp_id = (hid_t_f)c_prp_id; @@ -45,7 +45,7 @@ nh5pcreate_c ( hid_t_f *class, hid_t_f *prp_id ) /*---------------------------------------------------------------------------- * Name: h5pclose_c - * Purpose: Call H5Pclose to close property lis + * Purpose: Call H5Pclose to close property lis * Inputs: prp_id - identifier of the property list to be closed * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -53,7 +53,7 @@ nh5pcreate_c ( hid_t_f *class, hid_t_f *prp_id ) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pclose_c ( hid_t_f *prp_id ) { int ret_value = 0; @@ -66,16 +66,16 @@ nh5pclose_c ( hid_t_f *prp_id ) /*---------------------------------------------------------------------------- * Name: h5pcopy_c - * Purpose: Call H5Pcopy to copy property list - * Inputs: prp_id - identifier of the property list to be copied - * Outputs: new_prp_id - identifier of the new property list + * Purpose: Call H5Pcopy to copy property list + * Inputs: prp_id - identifier of the property list to be copied + * Outputs: new_prp_id - identifier of the new property list * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Saturday, August 14, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pcopy_c ( hid_t_f *prp_id , hid_t_f *new_prp_id) { int ret_value = 0; @@ -83,7 +83,7 @@ nh5pcopy_c ( hid_t_f *prp_id , hid_t_f *new_prp_id) hid_t c_new_prp_id; c_prp_id = *prp_id; - c_new_prp_id = H5Pcopy(c_prp_id); + c_new_prp_id = H5Pcopy(c_prp_id); if ( c_new_prp_id < 0 ) ret_value = -1; *new_prp_id = (hid_t_f)c_new_prp_id; return ret_value; @@ -91,7 +91,7 @@ nh5pcopy_c ( hid_t_f *prp_id , hid_t_f *new_prp_id) /*---------------------------------------------------------------------------- * Name: h5pequal_c - * Purpose: Call H5Pequal to check if two property lists are equal + * Purpose: Call H5Pequal to check if two property lists are equal * Inputs: plist1_id - property list identifier * plist2_id - property list identifier * Outputs: c_flag - flag to indicate that lists are eqaul @@ -101,7 +101,7 @@ nh5pcopy_c ( hid_t_f *prp_id , hid_t_f *new_prp_id) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pequal_c ( hid_t_f *plist1_id , hid_t_f *plist2_id, int_f * c_flag) { int ret_value = 0; @@ -111,7 +111,7 @@ nh5pequal_c ( hid_t_f *plist1_id , hid_t_f *plist2_id, int_f * c_flag) c_plist1_id = (hid_t)*plist1_id; c_plist2_id = (hid_t)*plist2_id; - c_c_flag = H5Pequal(c_plist1_id, c_plist2_id); + c_c_flag = H5Pequal(c_plist1_id, c_plist2_id); if ( c_c_flag < 0 ) ret_value = -1; *c_flag = (int_f)c_c_flag; return ret_value; @@ -121,9 +121,9 @@ nh5pequal_c ( hid_t_f *plist1_id , hid_t_f *plist2_id, int_f * c_flag) /*---------------------------------------------------------------------------- * Name: h5pget_class_c * Purpose: Call H5Pget_class to determine property list class - * Inputs: prp_id - identifier of the dataspace + * Inputs: prp_id - identifier of the dataspace * Outputs: classtype - class type; possible values are: - * H5P_NO_CLASS_F -1 + * H5P_NO_CLASS_F -1 * H5P_FILE_CREATE_F 0 * H5P_FILE_ACCESS_F 1 * H5P_DATASET_CREATE_F 2 @@ -135,17 +135,17 @@ nh5pequal_c ( hid_t_f *plist1_id , hid_t_f *plist2_id, int_f * c_flag) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pget_class_c ( hid_t_f *prp_id , int_f *classtype) { int ret_value = 0; hid_t c_prp_id; - hid_t c_classtype; + hid_t c_classtype; c_prp_id = *prp_id; c_classtype = H5Pget_class(c_prp_id); if (c_classtype == H5P_NO_CLASS ) { - *classtype = H5P_NO_CLASS; + *classtype = H5P_NO_CLASS; ret_value = -1; return ret_value; } @@ -156,17 +156,17 @@ nh5pget_class_c ( hid_t_f *prp_id , int_f *classtype) /*---------------------------------------------------------------------------- * Name: h5pset_preserve_c - * Purpose: Call H5Pset_preserve to set transfer property for compound + * Purpose: Call H5Pset_preserve to set transfer property for compound * datatype - * Inputs: prp_id - property list identifier - * flag - TRUE/FALSE flag + * Inputs: prp_id - property list identifier + * flag - TRUE/FALSE flag * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal - * Thursday, February 17, 2000 + * Thursday, February 17, 2000 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_preserve_c ( hid_t_f *prp_id , int_f *flag) { int ret_value = 0; @@ -184,22 +184,22 @@ nh5pset_preserve_c ( hid_t_f *prp_id , int_f *flag) /*---------------------------------------------------------------------------- * Name: h5pget_preserve_c - * Purpose: Call H5Pget_preserve to set transfer property for compound + * Purpose: Call H5Pget_preserve to set transfer property for compound * datatype - * Inputs: prp_id - property list identifier - * Outputs: flag - TRUE/FALSE flag + * Inputs: prp_id - property list identifier + * Outputs: flag - TRUE/FALSE flag * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal - * Thursday, February 17, 2000 + * Thursday, February 17, 2000 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pget_preserve_c ( hid_t_f *prp_id , int_f *flag) { int ret_value = 0; hid_t c_prp_id; - int c_flag; + int c_flag; c_prp_id = (hid_t)*prp_id; c_flag = H5Pget_preserve(c_prp_id); @@ -210,16 +210,16 @@ nh5pget_preserve_c ( hid_t_f *prp_id , int_f *flag) /*---------------------------------------------------------------------------- * Name: h5pset_deflate_c - * Purpose: Call H5Pset_deflate to set deflate level - * Inputs: prp_id - property list identifier - * level - level of deflation + * Purpose: Call H5Pset_deflate to set deflate level + * Inputs: prp_id - property list identifier + * level - level of deflation * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Saturday, August 14, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_deflate_c ( hid_t_f *prp_id , int_f *level) { int ret_value = 0; @@ -239,17 +239,17 @@ nh5pset_deflate_c ( hid_t_f *prp_id , int_f *level) /*---------------------------------------------------------------------------- * Name: h5pset_chunk_c * Purpose: Call H5Pset_chunk to set the sizes of chunks for a chunked - * layout dataset - * Inputs: prp_id - property list identifier - * rank - number of dimensions of each chunk - * dims - array of the size of each chunk + * layout dataset + * Inputs: prp_id - property list identifier + * rank - number of dimensions of each chunk + * dims - array of the size of each chunk * Returns: 0 on success, -1 on failure * Saturday, August 14, 1999 * Programmer: Elena Pourmal * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_chunk_c ( hid_t_f *prp_id, int_f *rank, hsize_t_f *dims ) { int ret_value = -1; @@ -278,23 +278,23 @@ nh5pset_chunk_c ( hid_t_f *prp_id, int_f *rank, hsize_t_f *dims ) DONE: HDfree (c_dims); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_chunk_c * Purpose: Call H5Pget_chunk to get the sizes of chunks for a chunked * layout dataset for at list max_rank number of dimensions - * Inputs: prp_id - property list identifier - * max rank - maximum number of dimensions to return - * dims - array of the size of each chunk + * Inputs: prp_id - property list identifier + * max rank - maximum number of dimensions to return + * dims - array of the size of each chunk * Returns: number of chunk's dimnesion on success, -1 on failure * Saturday, August 14, 1999 * Programmer: Elena Pourmal * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pget_chunk_c ( hid_t_f *prp_id, int_f *max_rank, hsize_t_f *dims ) { int ret_value = -1; @@ -321,16 +321,16 @@ nh5pget_chunk_c ( hid_t_f *prp_id, int_f *max_rank, hsize_t_f *dims ) if (rank < 0) return ret_value; ret_value = (int_f)rank; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pset_fill_valuec_c * Purpose: Call h5pset_fill_value_c to a character fill value - * Inputs: prp_id - property list identifier + * Inputs: prp_id - property list identifier * type_id - datatype identifier (fill value is of type type_id) - * fillvalue - character value + * fillvalue - character value * Returns: 0 on success, -1 on failure * Saturday, August 14, 1999 * Programmer: Elena Pourmal @@ -340,7 +340,7 @@ int_f nh5pset_fill_valuec_c (hid_t_f *prp_id, hid_t_f *type_id, _fcd fillvalue) { int ret_value = -1; - + /* * Call h5pset_fill_value_c function. */ @@ -351,10 +351,10 @@ nh5pset_fill_valuec_c (hid_t_f *prp_id, hid_t_f *type_id, _fcd fillvalue) /*---------------------------------------------------------------------------- * Name: h5pset_fill_value_c - * Purpose: Call H5Pset_fill_value to set a fillvalue for a dataset - * Inputs: prp_id - property list identifier + * Purpose: Call H5Pset_fill_value to set a fillvalue for a dataset + * Inputs: prp_id - property list identifier * type_id - datatype identifier (fill value is of type type_id) - * fillvalue - fillvalue + * fillvalue - fillvalue * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Saturday, August 14, 1999 @@ -378,15 +378,15 @@ nh5pset_fill_value_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue) if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_fill_valuec_c * Purpose: Call h5pget_fill_value_c to a character fill value - * Inputs: prp_id - property list identifier + * Inputs: prp_id - property list identifier * type_id - datatype identifier (fill value is of type type_id) - * fillvalue - character value + * fillvalue - character value * Returns: 0 on success, -1 on failure * Saturday, August 14, 1999 * Programmer: Elena Pourmal @@ -396,7 +396,7 @@ int_f nh5pget_fill_valuec_c (hid_t_f *prp_id, hid_t_f *type_id, _fcd fillvalue) { int ret_value = -1; - + /* * Call h5pget_fill_value_c function. */ @@ -407,10 +407,10 @@ nh5pget_fill_valuec_c (hid_t_f *prp_id, hid_t_f *type_id, _fcd fillvalue) /*---------------------------------------------------------------------------- * Name: h5pget_fill_value_c - * Purpose: Call H5Pget_fill_value to set a fillvalue for a dataset - * Inputs: prp_id - property list identifier + * Purpose: Call H5Pget_fill_value to set a fillvalue for a dataset + * Inputs: prp_id - property list identifier * type_id - datatype identifier (fill value is of type type_id) - * fillvalue - fillvalue + * fillvalue - fillvalue * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Saturday, August 14, 1999 @@ -434,13 +434,13 @@ nh5pget_fill_value_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue) if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_version_c * Purpose: Call H5Pget_version to get the version information - * of various objects for a file creation property list - * Inputs: prp_id - property list identifier + * of various objects for a file creation property list + * Inputs: prp_id - property list identifier * Outputs: boot - array to put boot block version number * freelist - array to put global freelist version number * stab - array to put symbol table version number @@ -475,13 +475,13 @@ nh5pget_version_c (hid_t_f *prp_id, int_f * boot,int_f * freelist, int_f * stab, ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_userblock_c - * Purpose: Call H5Pget_userblock to get the size of a user block in + * Purpose: Call H5Pget_userblock to get the size of a user block in * a file creation property list - * Inputs: prp_id - property list identifier + * Inputs: prp_id - property list identifier * Outputs size - Size of the user-block in bytes * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su @@ -507,13 +507,13 @@ nh5pget_userblock_c (hid_t_f *prp_id, hsize_t_f * size) ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pset_userblock_c - * Purpose: Call H5Pset_userblock to set the size of a user block in + * Purpose: Call H5Pset_userblock to set the size of a user block in * a file creation property list - * Inputs: prp_id - property list identifier + * Inputs: prp_id - property list identifier * size - Size of the user-block in bytes * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su @@ -538,13 +538,13 @@ nh5pset_userblock_c (hid_t_f *prp_id, hsize_t_f * size) if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_sizes_c - * Purpose: Call H5Pget_sizes to get the size of the offsets - * and lengths used in an HDF5 file - * Inputs: prp_id - property list identifier + * Purpose: Call H5Pget_sizes to get the size of the offsets + * and lengths used in an HDF5 file + * Inputs: prp_id - property list identifier * Outputs sizeof_addr - Size of an object offset in bytes * sizeof_size - Size of an object length in bytes * Returns: 0 on success, -1 on failure @@ -573,12 +573,12 @@ nh5pget_sizes_c (hid_t_f *prp_id, size_t_f * sizeof_addr, size_t_f * sizeof_size ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pset_sizes_c * Purpose: Call H5Pset_sizes to set the size of the offsets - * Inputs: prp_id - property list identifier + * Inputs: prp_id - property list identifier * sizeof_addr - Size of an object offset in bytes * sizeof_size - Size of an object length in bytes * Returns: 0 on success, -1 on failure @@ -605,15 +605,15 @@ nh5pset_sizes_c (hid_t_f *prp_id, size_t_f * sizeof_addr, size_t_f * sizeof_size if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pset_sym_k_c - * Purpose: Call H5Pset_sym_k to set the size of parameters used - * to control the symbol table node + * Purpose: Call H5Pset_sym_k to set the size of parameters used + * to control the symbol table node * Inputs: prp_id - property list identifier * ik - Symbol table tree rank - * lk - Symbol table node size + * lk - Symbol table node size * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Friday, February 25, 2000 @@ -639,15 +639,15 @@ nh5pset_sym_k_c (hid_t_f *prp_id, int_f* ik, int_f* lk) if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_sym_k_c - * Purpose: Call H5Pget_sym_k to get the size of parameters used - * to control the symbol table node + * Purpose: Call H5Pget_sym_k to get the size of parameters used + * to control the symbol table node * Inputs: prp_id - property list identifier * Outputs: ik - Symbol table tree rank - * lk - Symbol table node size + * lk - Symbol table node size * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Friday, February 25, 2000 @@ -672,7 +672,7 @@ nh5pget_sym_k_c (hid_t_f *prp_id, int_f* ik, int_f* lk) if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pset_istore_k_c @@ -703,12 +703,12 @@ nh5pset_istore_k_c (hid_t_f *prp_id, int_f* ik) if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_istore_k_c - * Purpose: Call H5Pget_istore_k to get the size of parameters used - * to control the B-trees for indexing chunked datasets + * Purpose: Call H5Pget_istore_k to get the size of parameters used + * to control the B-trees for indexing chunked datasets * Inputs: prp_id - property list identifier * Outputs: ik - Symbol table tree rank * Returns: 0 on success, -1 on failure @@ -733,11 +733,11 @@ nh5pget_istore_k_c (hid_t_f *prp_id, int_f* ik) if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_driver_c - * Purpose: Call H5Pget_driver to get low-level file driver identifier + * Purpose: Call H5Pget_driver to get low-level file driver identifier * Inputs: prp_id - property list identifier * Outputs: driver - low-level file driver identifier * Returns: 0 on success, -1 on failure @@ -762,11 +762,11 @@ nh5pget_driver_c (hid_t_f *prp_id, hid_t_f* driver) DONE: return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pset_fapl_stdio_c - * Purpose: Call H5Pset_stdio to set the low level file driver to + * Purpose: Call H5Pset_stdio to set the low level file driver to * use the functions declared in the stdio.h * Inputs: prp_id - property list identifier * Returns: 0 on success, -1 on failure @@ -784,15 +784,15 @@ nh5pset_fapl_stdio_c (hid_t_f *prp_id) * Call H5Pset_fapl_stdio function. */ c_prp_id = (hid_t)*prp_id; - ret = H5Pset_fapl_stdio(c_prp_id); + ret = H5Pset_fapl_stdio(c_prp_id); if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} #ifdef NO_SUCH_F90_FUNCTION /*---------------------------------------------------------------------------- * Name: h5pget_fapl_stdio_c - * Purpose: Call H5Pget_fapl_stdio to determine whther the low level file driver + * Purpose: Call H5Pget_fapl_stdio to determine whther the low level file driver * uses the functions declared in the stdio.h * Inputs: prp_id - property list identifier * Outputs: io - value indicates whether the file driver uses @@ -812,7 +812,7 @@ nh5pget_fapl_stdio_c (hid_t_f *prp_id, int_f* io) * Call H5Pget_fapl_stdio function. */ c_prp_id = *prp_id; - ret = H5Pget_fapl_stdio(c_prp_id); + ret = H5Pget_fapl_stdio(c_prp_id); if (ret < 0) return ret_value; *io = (int_f)ret; ret_value = 0; @@ -823,7 +823,7 @@ nh5pget_fapl_stdio_c (hid_t_f *prp_id, int_f* io) /*---------------------------------------------------------------------------- * Name: h5pset_fapl_sec2_c - * Purpose: Call H5Pset_fapl_sec2 to set the low level file driver to + * Purpose: Call H5Pset_fapl_sec2 to set the low level file driver to * use the functions declared in the unistd.h * Inputs: prp_id - property list identifier * Returns: 0 on success, -1 on failure @@ -841,16 +841,16 @@ nh5pset_fapl_sec2_c (hid_t_f *prp_id) * Call H5Pset_fapl_sec2 function. */ c_prp_id = (hid_t)*prp_id; - ret = H5Pset_fapl_sec2(c_prp_id); + ret = H5Pset_fapl_sec2(c_prp_id); if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} #ifdef NO_SUCH_F90_FUNCTION /*---------------------------------------------------------------------------- * Name: h5pget_fapl_sec2_c - * Purpose: Call H5Pget_fapl_stdio to determine whther the low level file driver + * Purpose: Call H5Pget_fapl_stdio to determine whther the low level file driver * uses the functions declared in the unistd.h * Inputs: prp_id - property list identifier * Outputs: sec2 - value indicates whether the file driver uses @@ -870,7 +870,7 @@ nh5pget_fapl_sec2_c (hid_t_f *prp_id, int_f* sec2) * Call H5Pget_fapl_sec2 function. */ c_prp_id = (hid_t)*prp_id; - ret = H5Pget_fapl_sec2(c_prp_id); + ret = H5Pget_fapl_sec2(c_prp_id); if (ret < 0) return ret_value; *sec2 = (int_f)ret; ret_value = 0; @@ -907,7 +907,7 @@ nh5pset_alignment_c (hid_t_f *prp_id, hsize_t_f* threshold, hsize_t_f* alignment if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_alignment_c @@ -936,10 +936,10 @@ nh5pget_alignment_c (hid_t_f *prp_id, hsize_t_f* threshold, hsize_t_f* alignment if (ret < 0) return ret_value; *threshold = (hsize_t_f)c_threshold; *alignment = (hsize_t_f)c_alignment; - + ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pset_fapl_core_c @@ -947,8 +947,8 @@ nh5pget_alignment_c (hid_t_f *prp_id, hsize_t_f* threshold, hsize_t_f* alignment * to use malloc() and free() * Inputs: prp_id - property list identifier * increment - File block size in bytes - * flag - Boolean flag indicating whether to write the - * file contents to disk when the file is closed. + * flag - Boolean flag indicating whether to write the + * file contents to disk when the file is closed. * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * March 9, 2001 @@ -964,12 +964,12 @@ nh5pset_fapl_core_c (hid_t_f *prp_id, size_t_f* increment, int_f *flag) hbool_t c_backing_store; c_increment = (size_t)*increment; c_backing_store = (hbool_t)*flag; - + /* * Call H5Pset_fapl_core function. */ c_prp_id = (hid_t)*prp_id; - ret = H5Pset_fapl_core(c_prp_id, c_increment, c_backing_store); + ret = H5Pset_fapl_core(c_prp_id, c_increment, c_backing_store); if (ret < 0) return ret_value; ret_value = 0; return ret_value; @@ -977,7 +977,7 @@ nh5pset_fapl_core_c (hid_t_f *prp_id, size_t_f* increment, int_f *flag) /*---------------------------------------------------------------------------- * Name: h5pget_fapl_core_c - * Purpose: Call H5Pget_fapl_core to determine whether the file access + * Purpose: Call H5Pget_fapl_core to determine whether the file access * property list is set to the core drive * Inputs: prp_id - property list identifier * Outputs increment - File block size in bytes @@ -993,23 +993,23 @@ nh5pget_fapl_core_c (hid_t_f *prp_id, size_t_f* increment, int_f *flag) hid_t c_prp_id; herr_t ret = -1; size_t c_increment = 0; - hbool_t c_backing_store; - *flag = 0; + hbool_t c_backing_store; + *flag = 0; /* * Call H5Pset_fapl_core function. */ c_prp_id = (hid_t)*prp_id; - ret = H5Pget_fapl_core(c_prp_id, &c_increment, &c_backing_store); + ret = H5Pget_fapl_core(c_prp_id, &c_increment, &c_backing_store); if (ret < 0) return ret_value; *increment = (size_t_f)c_increment; if(c_backing_store > 0) *flag = 1; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pset_fapl_family_c - * Purpose: Call H5Pset_fapl_family to set the file access properties list + * Purpose: Call H5Pset_fapl_family to set the file access properties list * to the family driver * Inputs: prp_id - property list identifier * memb_size - Logical size, in bytes, of each family member. @@ -1034,15 +1034,15 @@ nh5pset_fapl_family_c(hid_t_f *prp_id, hsize_t_f* memb_size, hid_t_f* memb_plist * Call H5Pset_fapl_family function. */ c_prp_id = (hid_t)*prp_id; - ret = H5Pset_fapl_family(c_prp_id, c_memb_size, c_memb_plist); + ret = H5Pset_fapl_family(c_prp_id, c_memb_size, c_memb_plist); if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_fapl_family_c - * Purpose: Call H5Pget_fapl_family to determine whether the file access + * Purpose: Call H5Pget_fapl_family to determine whether the file access * property list is set to the family driver * Inputs: prp_id - property list identifier * memb_size - Logical size, in bytes, of each family member. @@ -1065,18 +1065,18 @@ nh5pget_fapl_family_c(hid_t_f *prp_id, hsize_t_f* memb_size, hid_t_f* memb_plist * Call H5Pget_fapl_family function. */ c_prp_id = (hid_t)*prp_id; - ret = H5Pget_fapl_family(c_prp_id, &c_memb_size, &c_memb_plist); + ret = H5Pget_fapl_family(c_prp_id, &c_memb_size, &c_memb_plist); if (ret < 0) return ret_value; *memb_size = (hsize_t_f)c_memb_size; *memb_plist = (hid_t_f)c_memb_plist; - + ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pset_cache_c - * Purpose: Call H5Pset_cache to set he number of elements in + * Purpose: Call H5Pset_cache to set he number of elements in * the meta data cache and the total number of bytes in * the raw data chunk cache * Inputs: prp_id - property list identifier @@ -1113,17 +1113,17 @@ nh5pset_cache_c(hid_t_f *prp_id, int_f* mdc_nelmts, size_t_f* rdcc_nelmts, size if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_cache_c - * Purpose: Call H5Pget_cache to get he number of elements in + * Purpose: Call H5Pget_cache to get he number of elements in * the meta data cache and the total number of bytes in * the raw data chunk cache * Inputs: prp_id - property list identifier * Outputs: mdc_nelmts - Number of elements (objects) in the * meta data cache - * rdcc_nelmts - Number of elements in the raw data chunk + * rdcc_nelmts - Number of elements in the raw data chunk * rdcc_nbytes - Total size of the raw data chunk cache, in bytes * rdcc_w0 - Preemption policy * Returns: 0 on success, -1 on failure @@ -1131,7 +1131,7 @@ nh5pset_cache_c(hid_t_f *prp_id, int_f* mdc_nelmts, size_t_f* rdcc_nelmts, size * Friday, February 25, 2000 * Modifications: Changed type of the rdcc_w0 parameter to be real_f instead of double * Changed type of the rdcc_nelmts parameter to be int_f. - * EIP October 10, 2003 + * EIP October 10, 2003 *---------------------------------------------------------------------------*/ int_f nh5pget_cache_c(hid_t_f *prp_id, int_f* mdc_nelmts, size_t_f* rdcc_nelmts, size_t_f* rdcc_nbytes , real_f* rdcc_w0) @@ -1140,9 +1140,9 @@ nh5pget_cache_c(hid_t_f *prp_id, int_f* mdc_nelmts, size_t_f* rdcc_nelmts, size_ hid_t c_prp_id; herr_t ret; int c_mdc_nelmts; - size_t c_rdcc_nelmts; + size_t c_rdcc_nelmts; size_t c_rdcc_nbytes; - double c_rdcc_w0; + double c_rdcc_w0; /* * Call H5Pget_cache function. */ @@ -1153,21 +1153,21 @@ nh5pget_cache_c(hid_t_f *prp_id, int_f* mdc_nelmts, size_t_f* rdcc_nelmts, size_ *rdcc_nelmts = (size_t_f)c_rdcc_nelmts; *rdcc_nbytes = (size_t_f)c_rdcc_nbytes; *rdcc_w0 = (real_f)c_rdcc_w0; - + ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pset_fapl_split_c - * Purpose: Call H5Pset_fapl_split to set he low-level driver to split meta data + * Purpose: Call H5Pset_fapl_split to set he low-level driver to split meta data * from raw data * Inputs: prp_id - property list identifier * meta_len - Length of meta_ext - * meta_ext - Name of the extension for the metafile filename. + * meta_ext - Name of the extension for the metafile filename. * meta_plist - Identifier of the meta file access property list * raw_len - Length of raw _ext - * raw_ext - Name of the extension for the raw file filename. + * raw_ext - Name of the extension for the raw file filename. * raw_plist - Identifier of the raw file access property list * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -1180,14 +1180,14 @@ nh5pset_fapl_split_c(hid_t_f *prp_id, int_f* meta_len, _fcd meta_ext, hid_t_f* m int ret_value = -1; hid_t c_prp_id; hid_t c_meta_plist; - hid_t c_raw_plist; + hid_t c_raw_plist; herr_t ret = -1; char* c_meta_ext; char* c_raw_ext; - c_meta_ext = (char *)HD5f2cstring(meta_ext, (int)*meta_len); + c_meta_ext = (char *)HD5f2cstring(meta_ext, (int)*meta_len); if (c_meta_ext == NULL) return ret_value; - c_raw_ext = (char *)HD5f2cstring(raw_ext, (int)*raw_len); + c_raw_ext = (char *)HD5f2cstring(raw_ext, (int)*raw_len); if (c_raw_ext == NULL) { HDfree(c_meta_ext); return ret_value; } @@ -1197,7 +1197,7 @@ nh5pset_fapl_split_c(hid_t_f *prp_id, int_f* meta_len, _fcd meta_ext, hid_t_f* m */ c_prp_id = (hid_t)*prp_id; c_meta_plist = (hid_t)*meta_plist; - c_raw_plist = (hid_t)*raw_plist; + c_raw_plist = (hid_t)*raw_plist; ret = H5Pset_fapl_split(c_prp_id, c_meta_ext, c_meta_plist, c_raw_ext, c_raw_plist ); if (ret < 0) goto DONE; @@ -1213,16 +1213,16 @@ DONE: #ifdef NO_SUCH_F90_FUNCTION /*---------------------------------------------------------------------------- * Name: h5pget_fapl_split_c - * Purpose: Call H5Pget_fapl_split to determine whether the file access + * Purpose: Call H5Pget_fapl_split to determine whether the file access * property list is set to the split driver * Inputs: prp_id - property list identifier * meta_ext_size - Number of characters of the meta file extension * to be copied to the meta_ext buffer * raw_ext_size - Number of characters of the raw file extension * to be copied to the raw_ext buffer - *Outputs: meta_ext - Name of the extension for the metafile filename. + *Outputs: meta_ext - Name of the extension for the metafile filename. * meta_plist - Identifier of the meta file access property list - * raw_ext - Name of the extension for the raw file filename. + * raw_ext - Name of the extension for the raw file filename. * raw_plist - Identifier of the raw file access property list * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -1235,9 +1235,9 @@ nh5pget_fapl_split_c(hid_t_f *prp_id, size_t_f* meta_ext_size , _fcd meta_ext, h int ret_value = -1; hid_t c_prp_id; herr_t ret = -1; - size_t c_meta_ext_size, c_raw_ext_size; + size_t c_meta_ext_size, c_raw_ext_size; hid_t c_meta_plist = -1; - hid_t c_raw_plist = -1; + hid_t c_raw_plist = -1; char* c_meta_ext = NULL; char* c_raw_ext = NULL; @@ -1252,25 +1252,25 @@ nh5pget_fapl_split_c(hid_t_f *prp_id, size_t_f* meta_ext_size , _fcd meta_ext, h * Call H5Pget_fapl_split function. */ c_prp_id = *prp_id; - ret = H5Pget_fapl_split(c_prp_id, c_meta_ext_size, c_meta_ext,&c_meta_plist, c_raw_ext_size, c_raw_ext, &c_raw_plist ); + ret = H5Pget_fapl_split(c_prp_id, c_meta_ext_size, c_meta_ext,&c_meta_plist, c_raw_ext_size, c_raw_ext, &c_raw_plist ); if (ret < 0) return ret_value; *meta_plist = c_meta_plist; *raw_plist = c_raw_plist; - HD5packFstring(c_meta_ext, _fcdtocp(meta_ext), strlen(c_meta_ext)); - HD5packFstring(c_raw_ext, _fcdtocp(raw_ext), strlen(c_raw_ext)); - + HD5packFstring(c_meta_ext, _fcdtocp(meta_ext), strlen(c_meta_ext)); + HD5packFstring(c_raw_ext, _fcdtocp(raw_ext), strlen(c_raw_ext)); + ret_value = 0; return ret_value; -} +} #endif /*NO_SUCH_F90_FUNCTION*/ /*---------------------------------------------------------------------------- * Name: h5pset_gc_references_c - * Purpose: Call H5Pset_gc_references to set garbage + * Purpose: Call H5Pset_gc_references to set garbage * collecting references flag * Inputs: prp_id - property list identifier - * gc_reference - flag for garbage collecting references + * gc_reference - flag for garbage collecting references * for the file * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su @@ -1295,14 +1295,14 @@ nh5pset_gc_references_c (hid_t_f *prp_id, int_f* gc_references) if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_gc_references_c - * Purpose: Call H5Pget_gc_references to set garbage + * Purpose: Call H5Pget_gc_references to set garbage * collecting references flag * Inputs: prp_id - property list identifier - * Outputs gc_reference - flag for garbage collecting references + * Outputs gc_reference - flag for garbage collecting references * for the file * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su @@ -1355,7 +1355,7 @@ nh5pset_layout_c (hid_t_f *prp_id, int_f* layout) if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_layout_c @@ -1388,7 +1388,7 @@ nh5pget_layout_c (hid_t_f *prp_id, int_f* layout) /*---------------------------------------------------------------------------- * Name: h5pset_filter_c * Purpose: Call H5Pset_filter to add a filter to the filter pipeline. - * Inputs: prp_id - property list identifier + * Inputs: prp_id - property list identifier * filter - Filter to be added to the pipeline. * flags - Bit vector specifying certain general * properties of the filter. @@ -1410,7 +1410,7 @@ nh5pset_filter_c (hid_t_f *prp_id, int_f* filter, int_f* flags, size_t_f* cd_nel H5Z_filter_t c_filter; unsigned int * c_cd_values; unsigned i; - + c_filter = (H5Z_filter_t)*filter; c_flags = (unsigned)*flags; c_cd_nelmts = (size_t)*cd_nelmts; @@ -1465,17 +1465,17 @@ nh5pget_nfilters_c (hid_t_f *prp_id, int_f* nfilters) /*---------------------------------------------------------------------------- * Name: h5pget_filter_c - * Purpose: Call H5Pget_filter to get information about a filter + * Purpose: Call H5Pget_filter to get information about a filter * in a pipeline * Inputs: prp_id - property list identifier - * filter_number - Sequence number within the filter - * pipeline of the filter for which + * filter_number - Sequence number within the filter + * pipeline of the filter for which * information is sought. * namelen - Anticipated number of characters in name. - *Outputs: flags - Bit vector specifying certain general + *Outputs: flags - Bit vector specifying certain general * properties of the filter. * cd_nelmts - Number of elements in cd_value - * cd_values - Auxiliary data for the filter. + * cd_values - Auxiliary data for the filter. * name - Name of the filter * filter_id - filter identification number * Returns: 0 on success, -1 on failure @@ -1506,8 +1506,8 @@ nh5pget_filter_c(hid_t_f *prp_id, int_f* filter_number, int_f* flags, size_t_f* if (!c_cd_values) {HDfree(c_name); return ret_value; } - - + + /* * Call H5Pget_filter function. */ @@ -1520,29 +1520,29 @@ nh5pget_filter_c(hid_t_f *prp_id, int_f* filter_number, int_f* flags, size_t_f* *filter_id = (int_f)c_filter; *cd_nelmts = (size_t_f)c_cd_nelmts; *flags = (int_f)c_flags; - HD5packFstring(c_name, _fcdtocp(name), (int)strlen(c_name)); - + HD5packFstring(c_name, _fcdtocp(name), (int)strlen(c_name)); + for (i = 0; i < c_cd_nelmts_in; i++) cd_values[i] = (int_f)c_cd_values[i]; - + ret_value = 0; DONE: HDfree(c_name); HDfree(c_cd_values); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pset_external_c * Purpose: Call H5Pset_external to add an external file to the * list of external files. - * Inputs: prp_id - property list identifier + * Inputs: prp_id - property list identifier * name - Name of an external file * namelen - length of name * offset - Offset, in bytes, from the beginning of the file - * to the location in the file where the data starts. - * bytes - Number of bytes reserved in the file for the data. + * to the location in the file where the data starts. + * bytes - Number of bytes reserved in the file for the data. * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Wednesday, February 23, 2000 @@ -1560,10 +1560,10 @@ nh5pset_external_c (hid_t_f *prp_id, _fcd name, int_f* namelen, int_f* offset, h off_t c_offset; c_bytes = (hsize_t) *bytes; c_offset = (off_t) *offset; - - + + c_namelen = (int)*namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -1610,14 +1610,14 @@ nh5pget_external_count_c (hid_t_f *prp_id, int_f* count) /*---------------------------------------------------------------------------- * Name: h5pget_external_c - * Purpose: Call H5Pget_external to get nformation about an external file. - * Inputs: prp_id - property list identifier + * Purpose: Call H5Pget_external to get nformation about an external file. + * Inputs: prp_id - property list identifier * name_size - length of name - * idx - External file index. + * idx - External file index. *Outputs: name - Name of an external file * offset - Offset, in bytes, from the beginning of the file - * to the location in the file where the data starts. - * bytes - Number of bytes reserved in the file for the data. + * to the location in the file where the data starts. + * bytes - Number of bytes reserved in the file for the data. * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Wednesday, February 23, 2000 @@ -1641,35 +1641,35 @@ nh5pget_external_c(hid_t_f *prp_id, int_f *idx, size_t_f* name_size, _fcd name, */ if(c_namelen) c_name = (char*) HDmalloc(c_namelen + 1); if (c_name == NULL) return ret_value; - + /* * Call H5Pget_external function. */ c_prp_id = (hid_t)*prp_id; - c_idx = (unsigned)*idx; + c_idx = (unsigned)*idx; status = H5Pget_external(c_prp_id, c_idx, c_namelen, c_name, &c_offset, &size ); if (status < 0) goto DONE; *offset = (int_f)c_offset; *bytes = (hsize_t_f)size; - HD5packFstring(c_name, _fcdtocp(name), (int)strlen(c_name)); + HD5packFstring(c_name, _fcdtocp(name), (int)strlen(c_name)); ret_value = 0; -DONE: +DONE: HDfree(c_name); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pset_btree_ratios_c - * Purpose: Call H5Pset_btree_ratios to set B-tree split ratios for B-tree split ratios for a dataset transfer property list. a - * dataset transfer property list. + * Purpose: Call H5Pset_btree_ratios to set B-tree split ratios for B-tree split ratios for a dataset transfer property list. a + * dataset transfer property list. * Inputs: prp_id - property list identifier - * left - The B-tree split ratio for left-most nodes. - * middle - The B-tree split ratio for all other nodes - * right - The B-tree split ratio for right-most nodes - * and lone nodes. + * left - The B-tree split ratio for left-most nodes. + * middle - The B-tree split ratio for all other nodes + * right - The B-tree split ratio for right-most nodes + * and lone nodes. * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Friday, February 25, 2000 @@ -1696,17 +1696,17 @@ nh5pset_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* middle, real_f* ri if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_btree_ratios_c - * Purpose: Call H5Pget_btree_ratios to Gets B-tree split ratios - * for a dataset transfer property list. + * Purpose: Call H5Pget_btree_ratios to Gets B-tree split ratios + * for a dataset transfer property list. * Inputs: prp_id - property list identifier - * left - The B-tree split ratio for left-most nodes. - * middle - The B-tree split ratio for all other nodes - * right - The B-tree split ratio for right-most nodes - * and lone nodes. + * left - The B-tree split ratio for left-most nodes. + * middle - The B-tree split ratio for all other nodes + * right - The B-tree split ratio for right-most nodes + * and lone nodes. * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Friday, February 25, 2000 @@ -1731,11 +1731,11 @@ nh5pget_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* middle, real_f* ri if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_fclose_degree_c * Purpose: Call H5Pget_fclose_degree to determine file close behavior - * Inputs: fapl_id - file access identifier + * Inputs: fapl_id - file access identifier * Outputs: * degree - possible values are: * H5F_CLOSE_DEFAULT @@ -1748,16 +1748,16 @@ nh5pget_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* middle, real_f* ri * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pget_fclose_degree_c ( hid_t_f *fapl_id , int_f *degree) { int ret_value = -1; hid_t c_fapl_id; - H5F_close_degree_t c_degree; + H5F_close_degree_t c_degree; c_fapl_id = (hid_t)*fapl_id; if( H5Pget_fclose_degree(c_fapl_id, &c_degree) < 0) return ret_value; - + *degree = (int_f)c_degree; ret_value = 0; return ret_value; @@ -1766,7 +1766,7 @@ nh5pget_fclose_degree_c ( hid_t_f *fapl_id , int_f *degree) /*---------------------------------------------------------------------------- * Name: h5pset_fclose_degree_c * Purpose: Call H5Pset_fclose_degree to set file close behavior - * Inputs: fapl_id - file access identifier + * Inputs: fapl_id - file access identifier * degree - possible values are: * H5F_CLOSE_DEFAULT * H5F_CLOSE_WEAK @@ -1778,34 +1778,34 @@ nh5pget_fclose_degree_c ( hid_t_f *fapl_id , int_f *degree) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_fclose_degree_c ( hid_t_f *fapl_id , int_f *degree) { int ret_value = -1; hid_t c_fapl_id; - H5F_close_degree_t c_degree; + H5F_close_degree_t c_degree; c_fapl_id = (hid_t)*fapl_id; c_degree = (H5F_close_degree_t)*degree; if( H5Pset_fclose_degree(c_fapl_id, c_degree) < 0) return ret_value; - + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5pset_buffer_c - * Purpose: Call H5Pset_buffer to set size of conversion buffer + * Purpose: Call H5Pset_buffer to set size of conversion buffer * Inputs: prp_id - t`dataset trasfer property list identifier * size - size of the buffer - * Outputs: NONE + * Outputs: NONE * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, October 2, 2002 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_buffer_c ( hid_t_f *prp_id , hsize_t_f *size) { int ret_value = 0; @@ -1820,16 +1820,16 @@ nh5pset_buffer_c ( hid_t_f *prp_id , hsize_t_f *size) /*---------------------------------------------------------------------------- * Name: h5pget_buffer_c - * Purpose: Call H5Pget_buffer to get size of conversion buffer + * Purpose: Call H5Pget_buffer to get size of conversion buffer * Inputs: prp_id - t`dataset trasfer property list identifier - * Outputs: size - size of conversion buffer + * Outputs: size - size of conversion buffer * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, October 2, 2002 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pget_buffer_c ( hid_t_f *prp_id , hsize_t_f *size) { int ret_value = -1; @@ -1854,7 +1854,7 @@ nh5pget_buffer_c ( hid_t_f *prp_id , hsize_t_f *size) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pfill_value_defined_c ( hid_t_f *prp_id , int_f *flag) { int ret_value = -1; @@ -1869,7 +1869,7 @@ nh5pfill_value_defined_c ( hid_t_f *prp_id , int_f *flag) } /*---------------------------------------------------------------------------- * Name: h5pget_alloc_time_c - * Purpose: Call H5Pget_alloc_time to get space allocation + * Purpose: Call H5Pget_alloc_time to get space allocation * time for dataset during creation * Inputs: prp_id - dataset creation property list identifier * Outputs: flag - allocation time flag @@ -1879,7 +1879,7 @@ nh5pfill_value_defined_c ( hid_t_f *prp_id , int_f *flag) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pget_alloc_time_c ( hid_t_f *prp_id , int_f *flag) { int ret_value = -1; @@ -1894,7 +1894,7 @@ nh5pget_alloc_time_c ( hid_t_f *prp_id , int_f *flag) } /*---------------------------------------------------------------------------- * Name: h5pset_alloc_time_c - * Purpose: Call H5Pset_alloc_time to get space allocation + * Purpose: Call H5Pset_alloc_time to get space allocation * time for dataset during creation * Inputs: prp_id - dataset creation property list identifier * flag - allocation time flag @@ -1904,7 +1904,7 @@ nh5pget_alloc_time_c ( hid_t_f *prp_id , int_f *flag) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_alloc_time_c ( hid_t_f *prp_id , int_f *flag) { int ret_value = -1; @@ -1929,7 +1929,7 @@ nh5pset_alloc_time_c ( hid_t_f *prp_id , int_f *flag) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pget_fill_time_c ( hid_t_f *prp_id , int_f *flag) { int ret_value = -1; @@ -1954,7 +1954,7 @@ nh5pget_fill_time_c ( hid_t_f *prp_id , int_f *flag) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_fill_time_c ( hid_t_f *prp_id , int_f *flag) { int ret_value = -1; @@ -1972,14 +1972,14 @@ nh5pset_fill_time_c ( hid_t_f *prp_id , int_f *flag) * Purpose: Call H5Pset_meta_block_size to set size of metadata block * Inputs: prp_id - file access property list identifier * size - size of the metadata block - * Outputs: NONE + * Outputs: NONE * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Monday, October 7, 2002 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_meta_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) { int ret_value = 0; @@ -1995,7 +1995,7 @@ nh5pset_meta_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) * Name: h5pget_meta_block_size_c * Purpose: Call H5Pget_meta_block_size to get size of metadata block * Inputs: prp_id - file access property list identifier - * Outputs: + * Outputs: * size - size of the metadata block * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -2003,7 +2003,7 @@ nh5pset_meta_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pget_meta_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) { int ret_value = 0; @@ -2020,14 +2020,14 @@ nh5pget_meta_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) * Purpose: Call H5Pset_sieve_buf_size to set size of datasieve buffer * Inputs: prp_id - file access property list identifier * size - size of the buffer - * Outputs: NONE + * Outputs: NONE * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Monday, October 7, 2002 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_sieve_buf_size_c ( hid_t_f *prp_id , size_t_f *size) { int ret_value = 0; @@ -2043,7 +2043,7 @@ nh5pset_sieve_buf_size_c ( hid_t_f *prp_id , size_t_f *size) * Name: h5pget_sieve_buf_size_c * Purpose: Call H5Pget_sieve_buf_size to get size of datasieve buffer * Inputs: prp_id - file access property list identifier - * Outputs: + * Outputs: * size - size of the buffer * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -2051,7 +2051,7 @@ nh5pset_sieve_buf_size_c ( hid_t_f *prp_id , size_t_f *size) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pget_sieve_buf_size_c ( hid_t_f *prp_id , size_t_f *size) { int ret_value = 0; @@ -2068,14 +2068,14 @@ nh5pget_sieve_buf_size_c ( hid_t_f *prp_id , size_t_f *size) * Purpose: Call H5Pset_small_data_block_size to set size of raw small data block * Inputs: prp_id - file access property list identifier * size - size of the block - * Outputs: NONE + * Outputs: NONE * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Monday, October 7, 2002 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_small_data_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) { int ret_value = 0; @@ -2091,7 +2091,7 @@ nh5pset_small_data_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) * Name: h5pget_small_data_block_size_c * Purpose: Call H5Pget_small_data_block_size to get size of raw small data block * Inputs: prp_id - file access property list identifier - * Outputs: + * Outputs: * size - size of the block * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -2099,7 +2099,7 @@ nh5pset_small_data_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pget_small_data_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) { int ret_value = 0; @@ -2116,14 +2116,14 @@ nh5pget_small_data_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) * Purpose: Call H5Pset_hyper_vector_size to set size of the hyper vector * Inputs: prp_id - dataset transfer property list identifier * size - size of the vector - * Outputs: NONE + * Outputs: NONE * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Monday, October 7, 2002 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_hyper_vector_size_c ( hid_t_f *prp_id , size_t_f *size) { int ret_value = 0; @@ -2139,7 +2139,7 @@ nh5pset_hyper_vector_size_c ( hid_t_f *prp_id , size_t_f *size) * Name: h5pget_hyper_vector_size_c * Purpose: Call H5Pget_hyper_vector_size to get size of the hyper vector * Inputs: prp_id - dataset transfer property list identifier - * Outputs: + * Outputs: * size - size of the vector * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -2147,7 +2147,7 @@ nh5pset_hyper_vector_size_c ( hid_t_f *prp_id , size_t_f *size) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pget_hyper_vector_size_c ( hid_t_f *prp_id , size_t_f *size) { int ret_value = 0; @@ -2156,7 +2156,7 @@ nh5pget_hyper_vector_size_c ( hid_t_f *prp_id , size_t_f *size) c_prp_id = (hid_t)*prp_id; if ( H5Pget_hyper_vector_size(c_prp_id, &c_size) < 0 ) ret_value = -1; - *size = (size_t_f)c_size; + *size = (size_t_f)c_size; return ret_value; } /*---------------------------------------------------------------------------- @@ -2179,7 +2179,7 @@ nh5pcreate_class_c(hid_t_f *parent, _fcd name, int_f *name_len, hid_t_f *class) hid_t c_class; char* c_name; - c_name = (char *)HD5f2cstring(name, (int)*name_len); + c_name = (char *)HD5f2cstring(name, (int)*name_len); if (c_name == NULL) goto DONE; c_parent = (hid_t)*parent; @@ -2198,11 +2198,11 @@ DONE: /*---------------------------------------------------------------------------- * Name: h5pregisterc_c - * Purpose: Call h5pregister_c to registers a permanent property + * Purpose: Call h5pregister_c to registers a permanent property * Inputs: class - property list class identifier * name - name of the new property * name_len - length of the "name" buffer - * size - property size + * size - property size * value - property value of character type * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -2213,7 +2213,7 @@ int_f nh5pregisterc_c(hid_t_f *class, _fcd name, int_f *name_len, size_t_f *size, _fcd value, int_f *value_len) { int ret_value = -1; - + /* * Call h5pregister_c function */ @@ -2223,12 +2223,12 @@ nh5pregisterc_c(hid_t_f *class, _fcd name, int_f *name_len, size_t_f *size, _fcd /*---------------------------------------------------------------------------- * Name: h5pregister_c - * Purpose: Call H5Pregister to registers a permanent property + * Purpose: Call H5Pregister to registers a permanent property * Inputs: class - property list class identifier * name - name of the new property * name_len - length of the "name" buffer - * size - property size - * value - property value + * size - property size + * value - property value * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * October 11, 2002 @@ -2242,7 +2242,7 @@ nh5pregister_c(hid_t_f *class, _fcd name, int_f *name_len, size_t_f *size, void char* c_name; size_t c_size; - c_name = (char *)HD5f2cstring(name, (int)*name_len); + c_name = (char *)HD5f2cstring(name, (int)*name_len); if (c_name == NULL) goto DONE; c_size = (size_t)*size; c_class = (hid_t)*class; @@ -2259,11 +2259,11 @@ DONE: } /*---------------------------------------------------------------------------- * Name: h5pinsertc_c - * Purpose: Call h5pinsert_c to register a temporary property + * Purpose: Call h5pinsert_c to register a temporary property * Inputs: plist - property list identifier * name - name of the new property * name_len - length of the "name" buffer - * size - property size + * size - property size * value - property value of character type * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -2274,7 +2274,7 @@ int_f nh5pinsertc_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, _fcd value, int_f *value_len) { int_f ret_value = -1; - + /* * Call h5pinsert_c function */ @@ -2288,8 +2288,8 @@ nh5pinsertc_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, _fcd v * Inputs: plist - property list class identifier * name - name of the new property * name_len - length of the "name" buffer - * size - property size - * value - property value + * size - property size + * value - property value * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * October 11, 2002 @@ -2303,7 +2303,7 @@ nh5pinsert_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, void *v char* c_name; size_t c_size; - c_name = (char *)HD5f2cstring(name, (int)*name_len); + c_name = (char *)HD5f2cstring(name, (int)*name_len); if (c_name == NULL) goto DONE; c_size = (size_t)*size; c_plist = (hid_t)*plist; @@ -2321,7 +2321,7 @@ DONE: /*---------------------------------------------------------------------------- * Name: h5pexist_c - * Purpose: Call H5Pexist to querie whether a property name exists + * Purpose: Call H5Pexist to querie whether a property name exists * in a property list or class * Inputs: plist - property list or property class identifier * name - name of the new property @@ -2339,7 +2339,7 @@ nh5pexist_c(hid_t_f *class, _fcd name, int_f *name_len) char* c_name; htri_t status; - c_name = (char *)HD5f2cstring(name, (int)*name_len); + c_name = (char *)HD5f2cstring(name, (int)*name_len); if (c_name == NULL) goto DONE; c_class = (hid_t)*class; @@ -2355,8 +2355,8 @@ DONE: } /*---------------------------------------------------------------------------- * Name: h5pisa_class_c - * Purpose: Call H5Pisa_class to querie whether a property is a - * member of a class + * Purpose: Call H5Pisa_class to querie whether a property is a + * member of a class * Inputs: plist - property list identifier * class - property class identifier * Returns: nonnegative on success, -1 on failure @@ -2402,7 +2402,7 @@ nh5pget_size_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size) char* c_name; size_t c_size; - c_name = (char *)HD5f2cstring(name, (int)*name_len); + c_name = (char *)HD5f2cstring(name, (int)*name_len); if (c_name == NULL) goto DONE; c_plist = (hid_t)*plist; @@ -2447,7 +2447,7 @@ nh5pget_nprops_c(hid_t_f *plist, size_t_f *nprops) } /*---------------------------------------------------------------------------- * Name: h5pget_class_parent_c - * Purpose: Call H5Pget_class_parent to get the parent class of + * Purpose: Call H5Pget_class_parent to get the parent class of * a genereic property class * Inputs: prp_id - property list to query * Outputs: parent_id - parent classs identifier @@ -2477,7 +2477,7 @@ nh5pget_class_parent_c(hid_t_f *prp_id, hid_t_f *parent_id) } /*---------------------------------------------------------------------------- * Name: h5pcopy_prop_c - * Purpose: Call H5Pcopy_prop to copy a property from one list or + * Purpose: Call H5Pcopy_prop to copy a property from one list or * class to another * Inputs: dst_id - identifier of destination property list * src_id - identifier of source property list @@ -2495,7 +2495,7 @@ nh5pcopy_prop_c(hid_t_f *dst_id, hid_t_f *src_id, _fcd name, int_f *name_len) hid_t c_dst_id, c_src_id; char* c_name; - c_name = (char *)HD5f2cstring(name, (int)*name_len); + c_name = (char *)HD5f2cstring(name, (int)*name_len); if (c_name == NULL) goto DONE; c_dst_id = (hid_t)*dst_id; @@ -2528,7 +2528,7 @@ nh5premove_c(hid_t_f *plid, _fcd name, int_f *name_len) hid_t c_plid; char* c_name; - c_name = (char *)HD5f2cstring(name, (int)*name_len); + c_name = (char *)HD5f2cstring(name, (int)*name_len); if (c_name == NULL) goto DONE; c_plid = (hid_t)*plid; @@ -2560,7 +2560,7 @@ nh5punregister_c(hid_t_f *class, _fcd name, int_f *name_len) hid_t c_class; char* c_name; - c_name = (char *)HD5f2cstring(name, (int)*name_len); + c_name = (char *)HD5f2cstring(name, (int)*name_len); if (c_name == NULL) goto DONE; c_class = (hid_t)*class; @@ -2599,7 +2599,7 @@ nh5pclose_class_c(hid_t_f *class) } /*---------------------------------------------------------------------------- * Name: h5pget_class_name_c - * Purpose: Call H5Pget_class_name to get property class name + * Purpose: Call H5Pget_class_name to get property class name * Inputs: class - identifier of property class * name - ibuffer to retrieve name in * name_len - length of the "name" buffer @@ -2620,7 +2620,7 @@ nh5pget_class_name_c(hid_t_f *class, _fcd name, int_f *name_len) /* * Call H5Pget_class_name function. */ - c_name = H5Pget_class_name(c_class); + c_name = H5Pget_class_name(c_class); if( c_name == NULL) goto DONE; HD5packFstring(c_name, _fcdtocp(name), (int)*name_len); @@ -2646,7 +2646,7 @@ int_f nh5psetc_c(hid_t_f *plist, _fcd name, int_f *name_len, _fcd value, int_f *value_len) { int_f ret_value = -1; - + /* * Call h5pset_c function */ @@ -2660,7 +2660,7 @@ nh5psetc_c(hid_t_f *plist, _fcd name, int_f *name_len, _fcd value, int_f *value_ * Inputs: plist - property list class identifier * name - name of the new property * name_len - length of the "name" buffer - * value - property value + * value - property value * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * October 11, 2002 @@ -2673,7 +2673,7 @@ nh5pset_c(hid_t_f *plist, _fcd name, int_f *name_len, void *value) hid_t c_plist; char* c_name; - c_name = (char *)HD5f2cstring(name, (int)*name_len); + c_name = (char *)HD5f2cstring(name, (int)*name_len); if (c_name == NULL) goto DONE; c_plist = (hid_t)*plist; @@ -2703,7 +2703,7 @@ int_f nh5pgetc_c(hid_t_f *plist, _fcd name, int_f *name_len, _fcd value, int_f *value_len) { int_f ret_value = -1; - + /* * Call h5pget_c function */ @@ -2717,7 +2717,7 @@ nh5pgetc_c(hid_t_f *plist, _fcd name, int_f *name_len, _fcd value, int_f *value_ * Inputs: plist - property list class identifier * name - name of the new property * name_len - length of the "name" buffer - * Output: value - property value + * Output: value - property value * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * October 11, 2002 @@ -2730,7 +2730,7 @@ nh5pget_c(hid_t_f *plist, _fcd name, int_f *name_len, void *value) hid_t c_plist; char* c_name; - c_name = (char *)HD5f2cstring(name, (int)*name_len); + c_name = (char *)HD5f2cstring(name, (int)*name_len); if (c_name == NULL) goto DONE; c_plist = (hid_t)*plist; @@ -2746,8 +2746,8 @@ DONE: } /*---------------------------------------------------------------------------- * Name: h5pset_shuffle_c - * Purpose: Call H5Pset_shuffle - * Inputs: prp_id - property list identifier + * Purpose: Call H5Pset_shuffle + * Inputs: prp_id - property list identifier * type_size - size of the datatype in bytes * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -2755,7 +2755,7 @@ DONE: * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_shuffle_c ( hid_t_f *prp_id ) { int_f ret_value = 0; @@ -2770,14 +2770,14 @@ nh5pset_shuffle_c ( hid_t_f *prp_id ) /*---------------------------------------------------------------------------- * Name: h5pset_fletcher32_c * Purpose: Call H5Pset_fletcher32 to enable EDC - * Inputs: prp_id - dataset creation property list identifier + * Inputs: prp_id - dataset creation property list identifier * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Thursday, March 13, 2003 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_fletcher32_c ( hid_t_f *prp_id ) { int_f ret_value = 0; @@ -2793,7 +2793,7 @@ nh5pset_fletcher32_c ( hid_t_f *prp_id ) /*---------------------------------------------------------------------------- * Name: h5pset_edc_check_c * Purpose: Call H5Pset_edc_check to enable EDC - * Inputs: prp_id - dataset transfer property list identifier + * Inputs: prp_id - dataset transfer property list identifier * flag - EDC flag * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -2801,7 +2801,7 @@ nh5pset_fletcher32_c ( hid_t_f *prp_id ) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_edc_check_c ( hid_t_f *prp_id, int_f *flag ) { int_f ret_value = 0; @@ -2819,7 +2819,7 @@ nh5pset_edc_check_c ( hid_t_f *prp_id, int_f *flag ) /*---------------------------------------------------------------------------- * Name: h5pget_edc_check_c * Purpose: Call H5Pget_edc_check to query EDC - * Inputs: prp_id - dataset transfer property list identifier + * Inputs: prp_id - dataset transfer property list identifier * Outouts: flag - EDC flag * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -2827,7 +2827,7 @@ nh5pset_edc_check_c ( hid_t_f *prp_id, int_f *flag ) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pget_edc_check_c ( hid_t_f *prp_id, int_f *flag ) { int_f ret_value = 0; @@ -2843,7 +2843,7 @@ nh5pget_edc_check_c ( hid_t_f *prp_id, int_f *flag ) /*---------------------------------------------------------------------------- * Name: h5pset_family_offset_c * Purpose: Call H5Pset_family_offset to set and offset for family driver - * Inputs: prp_id - property list identifier + * Inputs: prp_id - property list identifier * offset - offset in bytes * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -2851,7 +2851,7 @@ nh5pget_edc_check_c ( hid_t_f *prp_id, int_f *flag ) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_family_offset_c ( hid_t_f *prp_id , hsize_t_f *offset) { int_f ret_value = 0; @@ -2869,9 +2869,9 @@ nh5pset_family_offset_c ( hid_t_f *prp_id , hsize_t_f *offset) /*---------------------------------------------------------------------------- * Name: h5pset_fapl_multi_c * Purpose: Call H5Pset_fapl_multi to set multi file dirver - * Inputs: prp_id - file_creation property list identifier + * Inputs: prp_id - file_creation property list identifier * mem_map - memory mapping array - * memb_fapl - property list for each memory usage type + * memb_fapl - property list for each memory usage type * memb_name - array with members names * len - array with the lenght of each name * lenmax - lenght of the name a sdeclared in Fortran @@ -2882,7 +2882,7 @@ nh5pset_family_offset_c ( hid_t_f *prp_id , hsize_t_f *offset) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f /*nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _fcd memb_name, int_f *len, int_f *lenmax, haddr_t_f *memb_addr, int_f *flag) */ nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _fcd memb_name, int_f *len, int_f *lenmax, real_f *memb_addr, int_f *flag) { @@ -2890,9 +2890,9 @@ nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f hid_t c_prp_id; H5FD_mem_t c_memb_map[H5FD_MEM_NTYPES]; hid_t c_memb_fapl[H5FD_MEM_NTYPES]; - char *c_memb_name[H5FD_MEM_NTYPES]; - haddr_t c_memb_addr[H5FD_MEM_NTYPES]; - hbool_t relax; + char *c_memb_name[H5FD_MEM_NTYPES]; + haddr_t c_memb_addr[H5FD_MEM_NTYPES]; + hbool_t relax; herr_t status; char *tmp, *tmp_p, *tmp_pp; int i; @@ -2910,7 +2910,7 @@ nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f */ tmp = (char *)HD5f2cstring(memb_name, c_lenmax*(H5FD_MEM_NTYPES)); - if (tmp ==NULL) return ret_value; + if (tmp ==NULL) return ret_value; tmp_p = tmp; for (i=0; i < H5FD_MEM_NTYPES; i++) { c_memb_name[i] = malloc((size_t)len[i] + 1); @@ -2921,11 +2921,11 @@ nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f /* printf(" %d \n", len[i]); printf("name %s \n", c_memb_name[i]); */ - } + } /* * Take care of othe arguments */ - + c_prp_id = (hid_t)*prp_id; for (i=0; i < H5FD_MEM_NTYPES; i++) { c_memb_map[i] = (H5FD_mem_t)memb_map[i]; @@ -2933,9 +2933,9 @@ nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f c_memb_fapl[i] = (hid_t)memb_fapl[i]; /*printf("fapl %d \n", c_memb_fapl[i]); */ if(memb_addr[i] < 0) c_memb_addr[i] = HADDR_UNDEF; - else c_memb_addr[i] = (haddr_t)(((float)memb_addr[i])*(HADDR_MAX)); + else c_memb_addr[i] = (haddr_t)(((float)memb_addr[i])*(HADDR_MAX)); /*printf("address %Ld \n", c_memb_addr[i]); */ - } + } /* * Call H5Pset_fapl_multi function */ @@ -2953,19 +2953,19 @@ DONE: /*---------------------------------------------------------------------------- * Name: h5pset_fapl_multi_sc * Purpose: Call H5Pset_fapl_multi to set multi file dirver - * Inputs: prp_id - file_creation property list identifier + * Inputs: prp_id - file_creation property list identifier * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * March 31 2003 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_fapl_multi_sc ( hid_t_f *prp_id , int_f *flag) { int_f ret_value = -1; hid_t c_prp_id; - hbool_t relax; + hbool_t relax; herr_t status; relax = (hbool_t)*flag; @@ -2982,10 +2982,10 @@ nh5pset_fapl_multi_sc ( hid_t_f *prp_id , int_f *flag) /*---------------------------------------------------------------------------- * Name: h5pget_fapl_multi_c * Purpose: Call H5Pget_fapl_multi to set multi file dirver - * Inputs: prp_id - file_creation property list identifier + * Inputs: prp_id - file_creation property list identifier * lenmax - lenght of the name a sdeclared in Fortran * Outputs: memb_map - memory mapping array - * memb_fapl - property list for each memory usage type + * memb_fapl - property list for each memory usage type * memb_name - array with members names * len - array with the lenght of each name * flag - flag allowing partila access when one of the files is missing @@ -2995,16 +2995,16 @@ nh5pset_fapl_multi_sc ( hid_t_f *prp_id , int_f *flag) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pget_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _fcd memb_name, int_f *len, int_f *lenmax, real_f *memb_addr, int_f *flag, int_f *maxlen_out) { int_f ret_value = -1; hid_t c_prp_id; H5FD_mem_t c_memb_map[H5FD_MEM_NTYPES]; hid_t c_memb_fapl[H5FD_MEM_NTYPES]; - char *c_memb_name[H5FD_MEM_NTYPES]; + char *c_memb_name[H5FD_MEM_NTYPES]; haddr_t c_memb_addr[H5FD_MEM_NTYPES]; - hbool_t relax; + hbool_t relax; herr_t status; char *tmp, *tmp_p; int i; @@ -3018,7 +3018,7 @@ nh5pget_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f */ status = H5Pget_fapl_multi(c_prp_id, c_memb_map, c_memb_fapl, c_memb_name, c_memb_addr, &relax); - if ( status < 0 ) return ret_value; + if ( status < 0 ) return ret_value; /* * Take care of names array @@ -3032,13 +3032,13 @@ nh5pget_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f len[i] = (int_f)strlen(c_memb_name[i]); length = H5_MAX(length, strlen(c_memb_name[i])); tmp_p = tmp_p + c_lenmax; - } + } HD5packFstring(tmp, _fcdtocp(memb_name), (int)(c_lenmax*H5FD_MEM_NTYPES)); /* * Take care of other arguments */ - + for (i=0; i < H5FD_MEM_NTYPES; i++) { memb_map[i] = (int_f)c_memb_map[i]; memb_fapl[i] = (hid_t_f)c_memb_fapl[i]; @@ -3048,8 +3048,8 @@ HD5packFstring(tmp, _fcdtocp(memb_name), (int)(c_lenmax*H5FD_MEM_NTYPES)); if(c_memb_addr[i] == HADDR_UNDEF) memb_addr[i] = -1; else memb_addr[i] = (real_f) ((long)c_memb_addr[i]/HADDR_MAX); #endif /*WIN32*/ - } - *flag = (int_f)relax; + } + *flag = (int_f)relax; *maxlen_out = (int_f)length; ret_value = 0; free(tmp); @@ -3060,7 +3060,7 @@ HD5packFstring(tmp, _fcdtocp(memb_name), (int)(c_lenmax*H5FD_MEM_NTYPES)); /*---------------------------------------------------------------------------- * Name: h5pset_szip_c * Purpose: Call H5Pset_szip to set szip compression - * Inputs: prp_id - dataset creation property list identifier + * Inputs: prp_id - dataset creation property list identifier * options_mask * pixels_per_block -szip compression parameters * Returns: 0 on success, -1 on failure @@ -3069,7 +3069,7 @@ HD5packFstring(tmp, _fcdtocp(memb_name), (int)(c_lenmax*H5FD_MEM_NTYPES)); * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_szip_c ( hid_t_f *prp_id , int_f *options_mask, int_f *pixels_per_block) { int_f ret_value = -1; @@ -3093,7 +3093,7 @@ nh5pset_szip_c ( hid_t_f *prp_id , int_f *options_mask, int_f *pixels_per_block) /*---------------------------------------------------------------------------- * Name: h5pall_filters_avail_c * Purpose: Call H5Pall_filters_avail - * Inputs: prp_id - dataset creation property list identifier + * Inputs: prp_id - dataset creation property list identifier * Outputs: status - logical flag * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -3101,13 +3101,13 @@ nh5pset_szip_c ( hid_t_f *prp_id , int_f *options_mask, int_f *pixels_per_block) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pall_filters_avail_c ( hid_t_f *prp_id , int_f *status) { int_f ret_value = -1; hid_t c_prp_id; htri_t c_status; - + c_prp_id = (hid_t)*prp_id; /* @@ -3123,15 +3123,15 @@ nh5pall_filters_avail_c ( hid_t_f *prp_id , int_f *status) } /*---------------------------------------------------------------------------- * Name: h5pget_filter_by_id_c - * Purpose: Call H5Pget_filter_by_id to get information about a filter + * Purpose: Call H5Pget_filter_by_id to get information about a filter * in a pipeline * Inputs: prp_id - property list identifier * filter_id - filter id * namelen - Anticipated number of characters in name. - *Outputs: flags - Bit vector specifying certain general + *Outputs: flags - Bit vector specifying certain general * properties of the filter. * cd_nelmts - Number of elements in cd_value - * cd_values - Auxiliary data for the filter. + * cd_values - Auxiliary data for the filter. * name - Name of the filter * Returns: 0 on success, -1 on failure * Programmer: Elena POurmal @@ -3161,8 +3161,8 @@ nh5pget_filter_by_id_c(hid_t_f *prp_id, int_f* filter_id, int_f* flags, size_t_f if (!c_cd_values) {HDfree(c_name); return ret_value; } - - + + /* * Call H5Pget_filter function. */ @@ -3173,23 +3173,23 @@ nh5pget_filter_by_id_c(hid_t_f *prp_id, int_f* filter_id, int_f* flags, size_t_f *cd_nelmts = (size_t_f)c_cd_nelmts; *flags = (int_f)c_flags; - HD5packFstring(c_name, _fcdtocp(name), (int)strlen(c_name)); - + HD5packFstring(c_name, _fcdtocp(name), (int)strlen(c_name)); + for (i = 0; i < c_cd_nelmts_in; i++) cd_values[i] = (int_f)c_cd_values[i]; - + ret_value = 0; DONE: HDfree(c_name); HDfree(c_cd_values); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pmodify_filter_c * Purpose: Call H5Pmodify_filter to modify a filter - * Inputs: prp_id - property list identifier + * Inputs: prp_id - property list identifier * filter - Filter to be modified * flags - Bit vector specifying certain general * properties of the filter. @@ -3211,7 +3211,7 @@ nh5pmodify_filter_c (hid_t_f *prp_id, int_f* filter, int_f* flags, size_t_f* cd_ H5Z_filter_t c_filter; unsigned int * c_cd_values; unsigned i; - + c_filter = (H5Z_filter_t)*filter; c_flags = (unsigned)*flags; c_cd_nelmts = (size_t)*cd_nelmts; @@ -3237,7 +3237,7 @@ DONE: /*---------------------------------------------------------------------------- * Name: h5premove_filter_c * Purpose: Call H5Premove_filter to delete one or more filters - * Inputs: prp_id - property list identifier + * Inputs: prp_id - property list identifier * filter - Filter to be deleted * Returns: 0 on success, -1 on failure * Programmer: Quincey Koziol @@ -3250,7 +3250,7 @@ nh5premove_filter_c (hid_t_f *prp_id, int_f* filter) int_f ret_value = -1; hid_t c_prp_id; H5Z_filter_t c_filter; - + c_filter = (H5Z_filter_t)*filter; c_prp_id = (hid_t)*prp_id; diff --git a/fortran/src/H5Rf.c b/fortran/src/H5Rf.c index 843c2ea..808bb90 100644 --- a/fortran/src/H5Rf.c +++ b/fortran/src/H5Rf.c @@ -19,10 +19,10 @@ /*---------------------------------------------------------------------------- * Name: h5rcreate_object_c * Purpose: Call H5Rcreate to create a reference to an object - * Inputs: loc_id - file or group identifier - * name - name of the dataset + * Inputs: loc_id - file or group identifier + * name - name of the dataset * namelen - name length - * Outputs: ref - reference to the object + * Outputs: ref - reference to the object * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, December 1, 1999 @@ -42,7 +42,7 @@ nh5rcreate_object_c (haddr_t_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen) * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -56,19 +56,19 @@ nh5rcreate_object_c (haddr_t_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen) *ref=(haddr_t_f)ref_c; ret_value = 0; } - + return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5rcreate_region_c * Purpose: Call H5Rcreate to create a reference to dataset region - * region - * Inputs: loc_id - file or group identifier - * name - name of the dataset + * region + * Inputs: loc_id - file or group identifier + * name - name of the dataset * namelen - name length * space_id - dataset space identifier - * Outputs: ref - reference to the dataset region + * Outputs: ref - reference to the dataset region * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, December 1, 1999 @@ -89,7 +89,7 @@ nh5rcreate_region_c (int_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen, hid * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -105,14 +105,14 @@ nh5rcreate_region_c (int_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen, hid ret_value = 0; } return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5rdereference_region_c * Purpose: Call H5Rdereference to dereference to dataset region - * Inputs: dset_id - dataset identifier - * ref - reference to the dataset region - * Outputs: obj_id - dereferenced dataset identifier + * Inputs: dset_id - dataset identifier + * ref - reference to the dataset region + * Outputs: obj_id - dereferenced dataset identifier * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, December 1, 1999 @@ -135,17 +135,17 @@ nh5rdereference_region_c (hid_t_f *dset_id, int_f *ref, hid_t_f *obj_id) c_obj_id = H5Rdereference(c_dset_id, H5R_DATASET_REGION, &ref_c); if(c_obj_id < 0) return ret_value; *obj_id = (hid_t_f)c_obj_id; - ret_value = 0; + ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5rdereference_object_c - * Purpose: Call H5Rdereference to dereference an object - * Inputs: dset_id - dataset identifier - * ref - reference to an object - * Outputs: obj_id - dereferenced object identifier + * Purpose: Call H5Rdereference to dereference an object + * Inputs: dset_id - dataset identifier + * ref - reference to an object + * Outputs: obj_id - dereferenced object identifier * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, December 1, 1999 @@ -168,16 +168,16 @@ nh5rdereference_object_c (hid_t_f *dset_id, haddr_t_f *ref, hid_t_f *obj_id) c_obj_id = H5Rdereference(c_dset_id, H5R_OBJECT, &ref_c); if(c_obj_id < 0) return ret_value; *obj_id = (hid_t_f)c_obj_id; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5rget_region_region_object_c - * Purpose: Call H5Rget_region to dereference dataspace region - * Inputs: dset_id - dataset identifier - * ref - reference to the dataset region - * Outputs: space_id - dereferenced dataset dataspace identifier + * Purpose: Call H5Rget_region to dereference dataspace region + * Inputs: dset_id - dataset identifier + * ref - reference to the dataset region + * Outputs: space_id - dereferenced dataset dataspace identifier * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, December 1, 1999 @@ -200,17 +200,17 @@ nh5rget_region_region_c (hid_t_f *dset_id, int_f *ref, hid_t_f *space_id) c_space_id = H5Rget_region(c_dset_id, H5R_DATASET_REGION, &ref_c); if(c_space_id < 0) return ret_value; *space_id = (hid_t_f)c_space_id; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5rget_object_type_obj_c - * Purpose: Call H5Rget_object_type to retrieve the type of the object reference points - * to - * Inputs: dset_id - dataset identifier - * ref - reference to the dataset region - * Outputs: obj_type - type of dereferenced object + * Purpose: Call H5Rget_object_type to retrieve the type of the object reference points + * to + * Inputs: dset_id - dataset identifier + * ref - reference to the dataset region + * Outputs: obj_type - type of dereferenced object * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, December 1, 1999 @@ -233,6 +233,6 @@ nh5rget_object_type_obj_c (hid_t_f *dset_id, haddr_t_f *ref, int_f *obj_type) c_obj_type = H5Rget_obj_type(c_dset_id, H5R_OBJECT, &ref_c); if(c_obj_type < 0) return ret_value; *obj_type = (int_f)c_obj_type; - ret_value = 0; + ret_value = 0; return ret_value; } diff --git a/fortran/src/H5Sf.c b/fortran/src/H5Sf.c index df93eae..a7f2b1b 100644 --- a/fortran/src/H5Sf.c +++ b/fortran/src/H5Sf.c @@ -16,7 +16,7 @@ /*---------------------------------------------------------------------------- * Name: h5screate_simple_c - * Purpose: Call H5Screate_simple to create a dataspace + * Purpose: Call H5Screate_simple to create a dataspace * Inputs: rank - number of dimensions of dataspace * dims - array of the size of each dimension maxdims - an array of the maximum size of each dimension @@ -27,7 +27,7 @@ * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5screate_simple_c ( int_f *rank, hsize_t_f *dims, hsize_t_f *maxdims, hid_t_f *space_id ) { int ret_value = -1; @@ -46,7 +46,7 @@ nh5screate_simple_c ( int_f *rank, hsize_t_f *dims, hsize_t_f *maxdims, hid_t_f */ for (i = 0; i < *rank ; i++) { c_dims[i] = dims[*rank - i - 1]; - c_maxdims[i] = maxdims[*rank - i - 1]; + c_maxdims[i] = maxdims[*rank - i - 1]; } c_space_id = H5Screate_simple(*rank, c_dims, c_maxdims); @@ -57,13 +57,13 @@ nh5screate_simple_c ( int_f *rank, hsize_t_f *dims, hsize_t_f *maxdims, hid_t_f HDfree (c_dims); HDfree (c_maxdims); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5sclose_c - * Purpose: Call H5Sclose to close the dataspace + * Purpose: Call H5Sclose to close the dataspace * Inputs: space_id - identifier of the dataspace to be closed * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -71,12 +71,12 @@ nh5screate_simple_c ( int_f *rank, hsize_t_f *dims, hsize_t_f *maxdims, hid_t_f * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sclose_c ( hid_t_f *space_id ) { int ret_value = 0; hid_t c_space_id; - + c_space_id = *space_id; if ( H5Sclose(c_space_id) < 0 ) ret_value = -1; return ret_value; @@ -85,7 +85,7 @@ nh5sclose_c ( hid_t_f *space_id ) /*---------------------------------------------------------------------------- * Name: h5screate_c - * Purpose: Call H5Screate to create a dataspace + * Purpose: Call H5Screate to create a dataspace * Inputs: classtype - type of the dataspace class * Outputs: space_id - identifier of the created dataspace * Returns: 0 on success, -1 on failure @@ -94,14 +94,14 @@ nh5sclose_c ( hid_t_f *space_id ) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5screate_c ( int_f *classtype, hid_t_f *space_id ) { H5S_class_t c_classtype; int ret_value = 0; hid_t c_space_id; c_classtype = (H5S_class_t) *classtype; - c_space_id = H5Screate(c_classtype); + c_space_id = H5Screate(c_classtype); if ( c_space_id < 0 ) ret_value = -1; *space_id = (hid_t_f) c_space_id; @@ -110,8 +110,8 @@ nh5screate_c ( int_f *classtype, hid_t_f *space_id ) /*---------------------------------------------------------------------------- * Name: h5scopy_c - * Purpose: Call H5Scopy to copy dataspace - * Inputs: space_id - identifier of the dataspace to be copied + * Purpose: Call H5Scopy to copy dataspace + * Inputs: space_id - identifier of the dataspace to be copied * Outputs: new_space_id - identifier of the new datspace * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -119,7 +119,7 @@ nh5screate_c ( int_f *classtype, hid_t_f *space_id ) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5scopy_c( hid_t_f *space_id , hid_t_f *new_space_id) { int ret_value = 0; @@ -127,7 +127,7 @@ nh5scopy_c( hid_t_f *space_id , hid_t_f *new_space_id) hid_t c_space_id; c_space_id = *space_id; - c_new_space_id = H5Scopy(c_space_id); + c_new_space_id = H5Scopy(c_space_id); if ( c_new_space_id < 0 ) ret_value = -1; *new_space_id = (hid_t_f)c_new_space_id; @@ -136,11 +136,11 @@ nh5scopy_c( hid_t_f *space_id , hid_t_f *new_space_id) /*---------------------------------------------------------------------------- * Name: h5sget_select_hyper_nblocks_c - * Purpose: Call H5SH5Sget_select_hyper_nblocks to - * get the the number of hyperslab blocks in - * the current dataspace selection if successful + * Purpose: Call H5SH5Sget_select_hyper_nblocks to + * get the the number of hyperslab blocks in + * the current dataspace selection if successful * Inputs: space_id - identifier of the dataspace - * Outputs: num_blocks - number of hyperslab blocks in + * Outputs: num_blocks - number of hyperslab blocks in * the current dataspace selection * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su @@ -148,7 +148,7 @@ nh5scopy_c( hid_t_f *space_id , hid_t_f *new_space_id) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sget_select_hyper_nblocks_c( hid_t_f *space_id , hssize_t_f * num_blocks) { int ret_value = 0; @@ -165,11 +165,11 @@ nh5sget_select_hyper_nblocks_c( hid_t_f *space_id , hssize_t_f * num_blocks) /*---------------------------------------------------------------------------- * Name: h5sget_select_elem_npoints_c - * Purpose: Call H5Sget_select_elem_npoints to - * get the the number of element points in - * the current dataspace selection if successful + * Purpose: Call H5Sget_select_elem_npoints to + * get the the number of element points in + * the current dataspace selection if successful * Inputs: space_id - identifier of the dataspace - * Outputs: num_points - number of element points in + * Outputs: num_points - number of element points in * the current dataspace selection * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su @@ -177,7 +177,7 @@ nh5sget_select_hyper_nblocks_c( hid_t_f *space_id , hssize_t_f * num_blocks) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sget_select_elem_npoints_c( hid_t_f *space_id , hssize_t_f * num_points) { int ret_value = 0; @@ -194,26 +194,26 @@ nh5sget_select_elem_npoints_c( hid_t_f *space_id , hssize_t_f * num_points) /*---------------------------------------------------------------------------- * Name: h5sget_select_hyper_blocklist_c - * Purpose: Call H5Sget_select_hyper_blocklist to - * get a list of the hyperslab blocks currently selected + * Purpose: Call H5Sget_select_hyper_blocklist to + * get a list of the hyperslab blocks currently selected * Starting with the startblock-th block in the * list of blocks, num_blocks blocks are put into the user's - * buffer. If the user's buffer fills up before numblocks + * buffer. If the user's buffer fills up before numblocks * blocks are inserted, the buffer - * will contain only as many blocks as fit. + * will contain only as many blocks as fit. * Inputs: space_id - identifier of the dataspace * startblock - Hyperslab block to start with - * num_blocks - number of hyperslab blocks in + * num_blocks - number of hyperslab blocks in * the current dataspace selection - * Outputs: buf - List of hyperslab blocks selected + * Outputs: buf - List of hyperslab blocks selected * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Monday, November 15, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f -nh5sget_select_hyper_blocklist_c( hid_t_f *space_id ,hsize_t_f * startblock, +int_f +nh5sget_select_hyper_blocklist_c( hid_t_f *space_id ,hsize_t_f * startblock, hsize_t_f * num_blocks, hsize_t_f * buf) { int ret_value = -1; @@ -234,7 +234,7 @@ nh5sget_select_hyper_blocklist_c( hid_t_f *space_id ,hsize_t_f * startblock, c_buf = (hsize_t*)malloc(sizeof(hsize_t)*(size_t)(c_num_blocks*2*rank)); if (!c_buf) return ret_value; - ret_value = H5Sget_select_hyper_blocklist(c_space_id, c_startblock, + ret_value = H5Sget_select_hyper_blocklist(c_space_id, c_startblock, c_num_blocks, c_buf); for(i = 0; i < c_num_blocks*2*rank; i++) { @@ -247,20 +247,20 @@ nh5sget_select_hyper_blocklist_c( hid_t_f *space_id ,hsize_t_f * startblock, /*---------------------------------------------------------------------------- * Name: h5sget_select_bounds_c - * Purpose: Call H5Sget_select_bounds to retrieve the coordinates - * of the bounding box containing the current selection + * Purpose: Call H5Sget_select_bounds to retrieve the coordinates + * of the bounding box containing the current selection * and places them into user-supplied buffers * Inputs: space_id - identifier of the dataspace * Outputs: start - Starting coordinates of the bounding box * end - Ending coordinates of the bounding box, - * i.e., the coordinates of the diagonally opposite corne + * i.e., the coordinates of the diagonally opposite corne * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Wednesday, November 17, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sget_select_bounds_c( hid_t_f *space_id , hsize_t_f * start, hsize_t_f * end) { int ret_value = -1; @@ -295,25 +295,25 @@ nh5sget_select_bounds_c( hid_t_f *space_id , hsize_t_f * start, hsize_t_f * end) /*---------------------------------------------------------------------------- * Name: h5sget_select_elem_pointlist_c * Purpose: Call H5Sget_select_elem_pointlist - * get a list of element points in the - * current dataspace selectin. + * get a list of element points in the + * current dataspace selectin. * Starting with the startpoint-th point in the * list of points, numpoints points are put into the user's - * buffer. If the user's buffer fills up before numpoints + * buffer. If the user's buffer fills up before numpoints * points are inserted, the buffer - * will contain only as many points as fit. + * will contain only as many points as fit. * Inputs: space_id - identifier of the dataspace * startpoint - Element point to start with - * numpoints - Number of element points to get - * Outputs: buf - List of element points selected + * numpoints - Number of element points to get + * Outputs: buf - List of element points selected * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Wednesday, November 17, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f -nh5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint, +int_f +nh5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint, hsize_t_f * numpoints, hsize_t_f * buf) { int ret_value = -1; @@ -328,17 +328,17 @@ nh5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint, rank = H5Sget_simple_extent_ndims(c_space_id); if (rank < 0 ) return ret_value; - c_startpoint = (hsize_t)*startpoint; + c_startpoint = (hsize_t)*startpoint; c_buf = (hsize_t*)malloc(sizeof(hsize_t)*(size_t)(c_num_points*rank)); if (!c_buf) return ret_value; - ret_value = H5Sget_select_elem_pointlist(c_space_id, c_startpoint, + ret_value = H5Sget_select_elem_pointlist(c_space_id, c_startpoint, c_num_points, c_buf); for (i = c_num_points*rank-1; i >= 0; i--) { buf[i] = (hsize_t_f)(c_buf[i]+1); } if (ret_value >= 0 ) ret_value = 0; - + HDfree(c_buf); return ret_value; @@ -348,15 +348,15 @@ nh5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint, /*---------------------------------------------------------------------------- * Name: h5sselect_all_c - * Purpose: Call H5Sselect_all to select entire dataspace - * Inputs: space_id - identifier of the dataspace + * Purpose: Call H5Sselect_all to select entire dataspace + * Inputs: space_id - identifier of the dataspace * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Tuesday, August 10, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sselect_all_c ( hid_t_f *space_id ) { int ret_value = 0; @@ -369,15 +369,15 @@ nh5sselect_all_c ( hid_t_f *space_id ) /*---------------------------------------------------------------------------- * Name: h5sselect_none_c - * Purpose: Call H5Sselect_none to reset the selection region - * Inputs: space_id - identifier of the dataspace + * Purpose: Call H5Sselect_none to reset the selection region + * Inputs: space_id - identifier of the dataspace * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Tuesday, August 10, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sselect_none_c ( hid_t_f *space_id ) { int ret_value = 0; @@ -391,8 +391,8 @@ nh5sselect_none_c ( hid_t_f *space_id ) /*---------------------------------------------------------------------------- * Name: h5sselect_valid_c * Purpose: Call H5Sselect_valid to verify that selection - * is within dataspace extent. - * Inputs: space_id - identifier of the dataspace + * is within dataspace extent. + * Inputs: space_id - identifier of the dataspace * Outputs: flag - 0 if not valid selection, 1 if is valid selection, * and negative on failure. * Returns: 0 on success, -1 on failure @@ -401,7 +401,7 @@ nh5sselect_none_c ( hid_t_f *space_id ) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sselect_valid_c ( hid_t_f *space_id , int_f *flag ) { int ret_value = 0; @@ -418,16 +418,16 @@ nh5sselect_valid_c ( hid_t_f *space_id , int_f *flag ) /*---------------------------------------------------------------------------- * Name: h5sget_simple_extent_npoints_c * Purpose: Call H5Sget_simple_extent_npoints to determine the number - * of elements in a dataspace - * Inputs: space_id - identifier of the dataspace - * Outputs: npoints - number of points in a dataspace + * of elements in a dataspace + * Inputs: space_id - identifier of the dataspace + * Outputs: npoints - number of points in a dataspace * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, August 11, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sget_simple_extent_npoints_c ( hid_t_f *space_id , hsize_t_f *npoints ) { int ret_value = 0; @@ -444,16 +444,16 @@ nh5sget_simple_extent_npoints_c ( hid_t_f *space_id , hsize_t_f *npoints ) /*---------------------------------------------------------------------------- * Name: h5sget_select_npoints_c * Purpose: Call H5Sget_select_npoints to determine the number - * of elements in a dataspace selection - * Inputs: space_id - identifier of the dataspace - * Outputs: npoints - number of points in a dataspace selection + * of elements in a dataspace selection + * Inputs: space_id - identifier of the dataspace + * Outputs: npoints - number of points in a dataspace selection * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, August 11, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sget_select_npoints_c ( hid_t_f *space_id , hssize_t_f *npoints ) { int ret_value = 0; @@ -470,21 +470,21 @@ nh5sget_select_npoints_c ( hid_t_f *space_id , hssize_t_f *npoints ) /*---------------------------------------------------------------------------- * Name: h5sget_simple_extent_ndims_c * Purpose: Call H5Sget_simple_extent_ndims to determine the number - * dimensions - * Inputs: space_id - identifier of the dataspace - * Outputs: rank - number of dataspace dimensions + * dimensions + * Inputs: space_id - identifier of the dataspace + * Outputs: rank - number of dataspace dimensions * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, August 11, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sget_simple_extent_ndims_c ( hid_t_f *space_id , int_f *ndims ) { int ret_value = 0; hid_t c_space_id; - int c_ndims; + int c_ndims; c_space_id = *space_id; c_ndims = H5Sget_simple_extent_ndims(c_space_id); @@ -496,22 +496,22 @@ nh5sget_simple_extent_ndims_c ( hid_t_f *space_id , int_f *ndims ) /*---------------------------------------------------------------------------- * Name: h5sget_simple_extent_type_c * Purpose: Call H5Sget_simple_extent_type to determine the class type - * of a dataspace - * Inputs: space_id - identifier of the dataspace + * of a dataspace + * Inputs: space_id - identifier of the dataspace * Outputs: classtype - class type; possible values are: - * H5S_SCALAR_F (0), H5S_SIMPLE_F (1), H5S_NULL_F (2) + * H5S_SCALAR_F (0), H5S_SIMPLE_F (1), H5S_NULL_F (2) * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, August 11, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sget_simple_extent_type_c ( hid_t_f *space_id , int_f *classtype) { int ret_value = 0; hid_t c_space_id; - H5S_class_t c_classtype; + H5S_class_t c_classtype; c_space_id = *space_id; c_classtype = H5Sget_simple_extent_type(c_space_id); @@ -527,17 +527,17 @@ nh5sget_simple_extent_type_c ( hid_t_f *space_id , int_f *classtype) /*---------------------------------------------------------------------------- * Name: h5soffset_simple_c - * Purpose: Call H5Soffset_simple to set the offset of a simple - * dataspace - * Inputs: space_id - identifier of the dataspace - * offset - offset array + * Purpose: Call H5Soffset_simple to set the offset of a simple + * dataspace + * Inputs: space_id - identifier of the dataspace + * offset - offset array * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, August 11, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5soffset_simple_c ( hid_t_f *space_id , hssize_t_f *offset) { int ret_value = -1; @@ -568,10 +568,10 @@ nh5soffset_simple_c ( hid_t_f *space_id , hssize_t_f *offset) /*---------------------------------------------------------------------------- * Name: h5sset_extent_simple_c * Purpose: Call H5Sset_extent_simple to set or reset size of - * existing dataspace - * Inputs: space_id - identifier of the dataspace + * existing dataspace + * Inputs: space_id - identifier of the dataspace * rank - dataspace rank - * current_size - array with the new dimension sizes + * current_size - array with the new dimension sizes * maximum_size - aray with maximum sizes of dimensions * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -579,7 +579,7 @@ nh5soffset_simple_c ( hid_t_f *space_id , hssize_t_f *offset) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sset_extent_simple_c ( hid_t_f *space_id , int_f *rank, hsize_t_f *current_size, hsize_t_f *maximum_size) { int ret_value = -1; @@ -603,7 +603,7 @@ nh5sset_extent_simple_c ( hid_t_f *space_id , int_f *rank, hsize_t_f *current_si c_current_size[i] = (hsize_t)current_size[*rank - i - 1]; c_maximum_size[i] = (hsize_t)maximum_size[*rank - i - 1]; } - + c_space_id = *space_id; c_rank = *rank; status = H5Sset_extent_simple(c_space_id, c_rank, c_current_size, c_maximum_size); @@ -615,10 +615,10 @@ nh5sset_extent_simple_c ( hid_t_f *space_id , int_f *rank, hsize_t_f *current_si /*---------------------------------------------------------------------------- * Name: h5sget_simple_extent_dims_c - * Purpose: Call H5Sget_simple_extent_dims to retrieve sizes of an - * existing dataspace - * Inputs: space_id - identifier of the dataspace - * Outputs: dims - array with the dimension sizes + * Purpose: Call H5Sget_simple_extent_dims to retrieve sizes of an + * existing dataspace + * Inputs: space_id - identifier of the dataspace + * Outputs: dims - array with the dimension sizes * maxdims - aray with maximum sizes of dimensions * Returns: number of dataspace dimensions (rank) on success, -1 on failure * Programmer: Elena Pourmal @@ -626,7 +626,7 @@ nh5sset_extent_simple_c ( hid_t_f *space_id , int_f *rank, hsize_t_f *current_si * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sget_simple_extent_dims_c ( hid_t_f *space_id , hsize_t_f *dims, hsize_t_f *maxdims) { int ret_value = -1; @@ -664,9 +664,9 @@ nh5sget_simple_extent_dims_c ( hid_t_f *space_id , hsize_t_f *dims, hsize_t_f *m /*---------------------------------------------------------------------------- * Name: h5sis_simple_c - * Purpose: Call H5Sis_simple to detrmine if the dataspace - * is simple. - * Inputs: space_id - identifier of the dataspace + * Purpose: Call H5Sis_simple to detrmine if the dataspace + * is simple. + * Inputs: space_id - identifier of the dataspace * Outputs: flag - 0 if not simple, 1 if is simple, * and negative on failure. * Returns: 0 on success, -1 on failure @@ -675,7 +675,7 @@ nh5sget_simple_extent_dims_c ( hid_t_f *space_id , hsize_t_f *dims, hsize_t_f *m * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sis_simple_c ( hid_t_f *space_id , int_f *flag ) { int ret_value = 0; @@ -692,8 +692,8 @@ nh5sis_simple_c ( hid_t_f *space_id , int_f *flag ) /*---------------------------------------------------------------------------- * Name: h5sextent_copy_c - * Purpose: Call H5Sextent_copy to copy an extent of dataspace - * Inputs: dest_space_id - identifier of the destination dataspace + * Purpose: Call H5Sextent_copy to copy an extent of dataspace + * Inputs: dest_space_id - identifier of the destination dataspace * source_space_id - identifier of the source dataspace * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -701,7 +701,7 @@ nh5sis_simple_c ( hid_t_f *space_id , int_f *flag ) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sextent_copy_c ( hid_t_f *dest_space_id , hid_t_f *source_space_id) { int ret_value = 0; @@ -710,22 +710,22 @@ nh5sextent_copy_c ( hid_t_f *dest_space_id , hid_t_f *source_space_id) c_dest_space_id = *dest_space_id; c_source_space_id = *source_space_id; - status = H5Sextent_copy(c_dest_space_id, c_source_space_id); + status = H5Sextent_copy(c_dest_space_id, c_source_space_id); if ( status < 0 ) ret_value = -1; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5sset_extent_none_c - * Purpose: Call H5Sset_extent_none to remove extent from a dataspace - * Inputs: space_id - dataspace identifier + * Purpose: Call H5Sset_extent_none to remove extent from a dataspace + * Inputs: space_id - dataspace identifier * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, August 11, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sset_extent_none_c ( hid_t_f *space_id ) { int ret_value = 0; @@ -733,19 +733,19 @@ nh5sset_extent_none_c ( hid_t_f *space_id ) herr_t status; c_space_id = *space_id; - status = H5Sset_extent_none(c_space_id); + status = H5Sset_extent_none(c_space_id); if ( status < 0 ) ret_value = -1; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5sselect_hyperslab_c - * Purpose: Call H5Sselect_hyperslab to select a hyperslab - * Inputs: space_id - identifier of the dataspace + * Purpose: Call H5Sselect_hyperslab to select a hyperslab + * Inputs: space_id - identifier of the dataspace * operator - defines how the new selection is combined - * with the previous one; current values are - * H5S_SELECT_SET_F (0) and H5S_SELECT_OR_F (1) - * start - offset of start of hyperslab + * with the previous one; current values are + * H5S_SELECT_SET_F (0) and H5S_SELECT_OR_F (1) + * start - offset of start of hyperslab * count - number of blocks included in the hyperslab * stride - hyperslab stride (interval between blocks) * block - size of block in the hyperslab @@ -755,7 +755,7 @@ nh5sset_extent_none_c ( hid_t_f *space_id ) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sselect_hyperslab_c ( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block) { int ret_value = -1; @@ -763,7 +763,7 @@ nh5sselect_hyperslab_c ( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize_ hsize_t *c_start = NULL; hsize_t *c_count = NULL; hsize_t *c_stride = NULL; - hsize_t *c_block = NULL; + hsize_t *c_block = NULL; H5S_seloper_t c_op; herr_t status; @@ -816,10 +816,10 @@ DONE: #ifdef NEW_HYPERSLAB_API /*---------------------------------------------------------------------------- * Name: h5scombine_hyperslab_c - * Purpose: Call H5Scombine_hyperslab - * Inputs: space_id - identifier of the dataspace + * Purpose: Call H5Scombine_hyperslab + * Inputs: space_id - identifier of the dataspace * operator - defines how the new selection is combined - * start - offset of start of hyperslab + * start - offset of start of hyperslab * count - number of blocks included in the hyperslab * stride - hyperslab stride (interval between blocks) * block - size of block in the hyperslab @@ -830,7 +830,7 @@ DONE: * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5scombine_hyperslab_c ( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block, hid_t_f *hyper_id) { int ret_value = -1; @@ -839,7 +839,7 @@ nh5scombine_hyperslab_c ( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize hsize_t *c_start = NULL; hsize_t *c_count = NULL; hsize_t *c_stride = NULL; - hsize_t *c_block = NULL; + hsize_t *c_block = NULL; H5S_seloper_t c_op; herr_t status; @@ -890,9 +890,9 @@ DONE: /*---------------------------------------------------------------------------- * Name: h5scombine_select_c * Purpose: Call H5Scombine_ select - * Inputs: space1_id - identifier of the first dataspace + * Inputs: space1_id - identifier of the first dataspace * operator - defines how the new selection is combined - * space2_id - identifier of the second dataspace + * space2_id - identifier of the second dataspace * Outputs: ds_id - identifier for the new dataspace * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -900,7 +900,7 @@ DONE: * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5scombine_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id, hid_t_f *ds_id) { int ret_value = -1; @@ -924,14 +924,14 @@ nh5scombine_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id, hid_t * Purpose: Call H5Sselect_ select * Inputs: space1_id - identifier of the first dataspace to modify * operator - defines how the new selection is combined - * space2_id - identifier of the second dataspace + * space2_id - identifier of the second dataspace * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Monday, October 7, 2002 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sselect_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id) { int ret_value = -1; @@ -951,7 +951,7 @@ nh5sselect_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id) /*---------------------------------------------------------------------------- * Name: h5sget_select_type_c * Purpose: Call H5Sget_select_type - * Inputs: space_id - identifier of the dataspace + * Inputs: space_id - identifier of the dataspace * Outputs: type - type of selection * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -959,7 +959,7 @@ nh5sselect_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sget_select_type_c ( hid_t_f *space_id , int_f *type) { int ret_value = -1; @@ -977,20 +977,20 @@ nh5sget_select_type_c ( hid_t_f *space_id , int_f *type) /*---------------------------------------------------------------------------- * Name: h5sselect_elements_c - * Purpose: Call H5Sselect_elements to select elements of a dataspace - * Inputs: space_id - identifier of the dataspace + * Purpose: Call H5Sselect_elements to select elements of a dataspace + * Inputs: space_id - identifier of the dataspace * operator - defines how the new selection is combined - * with the previous one; current values are - * H5S_SELECT_SET_F (0) - * nelements - number of elements in the selection - * coord - arrays with the elements coordinates + * with the previous one; current values are + * H5S_SELECT_SET_F (0) + * nelements - number of elements in the selection + * coord - arrays with the elements coordinates * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, August 11, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *nelements, hsize_t_f *coord) { int ret_value = -1; @@ -1021,7 +1021,7 @@ nh5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *nelements, hsi c_nelements = *nelements; status = H5Sselect_elements(c_space_id, c_op, c_nelements, (const hsize_t **)c_coord); if ( status >= 0 ) ret_value = 0; - HDfree(c_coord); + HDfree(c_coord); return ret_value; } diff --git a/fortran/src/H5Tf.c b/fortran/src/H5Tf.c index cd1ccd0..a4ac7bd 100644 --- a/fortran/src/H5Tf.c +++ b/fortran/src/H5Tf.c @@ -19,9 +19,9 @@ /*---------------------------------------------------------------------------- * Name: h5topen_c - * Purpose: Call H5Topen to open a datatype - * Inputs: loc_id - file or group identifier - * name - name of the datatype within file or group + * Purpose: Call H5Topen to open a datatype + * Inputs: loc_id - file or group identifier + * name - name of the datatype within file or group * namelen - name length * Outputs: type_id - dataset identifier * Returns: 0 on success, -1 on failure @@ -42,7 +42,7 @@ nh5topen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id) * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -56,14 +56,14 @@ nh5topen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id) HDfree(c_name); ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5tcommit_c - * Purpose: Call H5Tcommit to commit a datatype - * Inputs: loc_id - file or group identifier - * name - name of the datatype within file or group + * Purpose: Call H5Tcommit to commit a datatype + * Inputs: loc_id - file or group identifier + * name - name of the datatype within file or group * namelen - name length * type_id - dataset identifier * Returns: 0 on success, -1 on failure @@ -85,7 +85,7 @@ nh5tcommit_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id) * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -98,11 +98,11 @@ nh5tcommit_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id) if (status < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5tclose_c - * Purpose: Call H5Tclose to close the datatype + * Purpose: Call H5Tclose to close the datatype * Inputs: type_id - identifier of the datatype to be closed * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -110,7 +110,7 @@ nh5tcommit_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tclose_c ( hid_t_f *type_id ) { int ret_value = 0; @@ -125,7 +125,7 @@ nh5tclose_c ( hid_t_f *type_id ) /*---------------------------------------------------------------------------- * Name: h5tcopy_c * Purpose: Call H5Tcopy to copy a datatype - * Inputs: type_id - identifier of the datatype to be copied + * Inputs: type_id - identifier of the datatype to be copied * Outputs: new_type_id - identifier of the new datatype * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -133,7 +133,7 @@ nh5tclose_c ( hid_t_f *type_id ) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tcopy_c ( hid_t_f *type_id , hid_t_f *new_type_id) { int ret_value = 0; @@ -141,7 +141,7 @@ nh5tcopy_c ( hid_t_f *type_id , hid_t_f *new_type_id) hid_t c_new_type_id; c_type_id = *type_id; - c_new_type_id = H5Tcopy(c_type_id); + c_new_type_id = H5Tcopy(c_type_id); if ( c_new_type_id < 0 ) ret_value = -1; *new_type_id = (hid_t_f)c_new_type_id; return ret_value; @@ -150,16 +150,16 @@ nh5tcopy_c ( hid_t_f *type_id , hid_t_f *new_type_id) /*---------------------------------------------------------------------------- * Name: h5tequal_c * Purpose: Call H5Tequal to copy a datatype - * Inputs: type1_id - datatype identifier - * type2_id - datatype identifier - * Outputs: c_flag - flag; indicates if two datatypes are equal or not. + * Inputs: type1_id - datatype identifier + * type2_id - datatype identifier + * Outputs: c_flag - flag; indicates if two datatypes are equal or not. * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal - * Tuesday, February 22, 2000 + * Tuesday, February 22, 2000 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tequal_c ( hid_t_f *type1_id , hid_t_f *type2_id, int_f *c_flag) { int ret_value = -1; @@ -168,9 +168,9 @@ nh5tequal_c ( hid_t_f *type1_id , hid_t_f *type2_id, int_f *c_flag) c_type1_id = *type1_id; c_type2_id = *type2_id; - status = H5Tequal(c_type1_id, c_type2_id); - if ( status < 0 ) return ret_value; - *c_flag = (int_f)status; + status = H5Tequal(c_type1_id, c_type2_id); + if ( status < 0 ) return ret_value; + *c_flag = (int_f)status; ret_value = 0; return ret_value; } @@ -179,7 +179,7 @@ nh5tequal_c ( hid_t_f *type1_id , hid_t_f *type2_id, int_f *c_flag) /*---------------------------------------------------------------------------- * Name: h5tget_class_c * Purpose: Call H5Tget_class to determine the datatype class - * Inputs: type_id - identifier of the dataspace + * Inputs: type_id - identifier of the dataspace * Outputs: classtype - class type; possible values are: * H5T_NO_CLASS_F (-1) * H5T_INTEGER_F (0) @@ -197,18 +197,18 @@ nh5tequal_c ( hid_t_f *type1_id , hid_t_f *type2_id, int_f *c_flag) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_class_c ( hid_t_f *type_id , int_f *classtype) { int ret_value = 0; hid_t c_type_id; - H5T_class_t c_classtype; + H5T_class_t c_classtype; c_type_id = *type_id; c_classtype = H5Tget_class(c_type_id); if (c_classtype == H5T_NO_CLASS ) { /* *classtype = H5T_NO_CLASS_F; */ - *classtype = (int_f)H5T_NO_CLASS; + *classtype = (int_f)H5T_NO_CLASS; ret_value = -1; return ret_value; } @@ -229,8 +229,8 @@ nh5tget_class_c ( hid_t_f *type_id , int_f *classtype) /*---------------------------------------------------------------------------- * Name: h5tget_order_c - * Purpose: Call H5Tget_order to determine byte order - * Inputs: type_id - identifier of the dataspace + * Purpose: Call H5Tget_order to determine byte order + * Inputs: type_id - identifier of the dataspace * Outputs: order; possible values are: * H5T_ORDER_LE_F (0) * H5T_ORDER_BE_F (1) @@ -241,12 +241,12 @@ nh5tget_class_c ( hid_t_f *type_id , int_f *classtype) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_order_c ( hid_t_f *type_id , int_f *order) { int ret_value = -1; hid_t c_type_id; - H5T_order_t c_order; + H5T_order_t c_order; c_type_id = *type_id; c_order = H5Tget_order(c_type_id); @@ -264,8 +264,8 @@ nh5tget_order_c ( hid_t_f *type_id , int_f *order) /*---------------------------------------------------------------------------- * Name: h5tset_order_c - * Purpose: Call H5Tset_order to set byte order - * Inputs: type_id - identifier of the dataspace + * Purpose: Call H5Tset_order to set byte order + * Inputs: type_id - identifier of the dataspace * order; possible values are: * H5T_ORDER_LE_F (0) * H5T_ORDER_BE_F (1) @@ -276,12 +276,12 @@ nh5tget_order_c ( hid_t_f *type_id , int_f *order) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tset_order_c ( hid_t_f *type_id , int_f *order) { int ret_value = 0; hid_t c_type_id; - H5T_order_t c_order; + H5T_order_t c_order; herr_t status; c_order = (H5T_order_t)*order; /* @@ -297,47 +297,47 @@ nh5tset_order_c ( hid_t_f *type_id , int_f *order) /*---------------------------------------------------------------------------- * Name: h5tget_size_c - * Purpose: Call H5Tget_size to get size of the datatype - * Inputs: type_id - identifier of the dataspace - * Outputs: size (in bytes) + * Purpose: Call H5Tget_size to get size of the datatype + * Inputs: type_id - identifier of the dataspace + * Outputs: size (in bytes) * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Saturday, August 14, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_size_c ( hid_t_f *type_id , size_t_f *size) { int ret_value = -1; hid_t c_type_id; - size_t c_size; + size_t c_size; c_type_id = *type_id; c_size = H5Tget_size(c_type_id); if ( c_size == 0 ) return ret_value; *size = (size_t_f)c_size ; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tset_size_c - * Purpose: Call H5Tget_size to get size of the datatype - * Inputs: type_id - identifier of the dataspace - * Outputs: size (in bytes) + * Purpose: Call H5Tget_size to get size of the datatype + * Inputs: type_id - identifier of the dataspace + * Outputs: size (in bytes) * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Saturday, August 14, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tset_size_c ( hid_t_f *type_id , size_t_f *size) { int ret_value = -1; hid_t c_type_id; - size_t c_size; + size_t c_size; herr_t status; c_size = (size_t)*size; @@ -350,134 +350,134 @@ nh5tset_size_c ( hid_t_f *type_id , size_t_f *size) /*---------------------------------------------------------------------------- * Name: h5tget_precision_c - * Purpose: Call H5Tget_precision to get precision of the datatype - * Inputs: type_id - identifier of the dataspace - * Outputs: precision - number of significant bits + * Purpose: Call H5Tget_precision to get precision of the datatype + * Inputs: type_id - identifier of the dataspace + * Outputs: precision - number of significant bits * Returns: 0 on success, -1 on failure * Programmer: XIANGYANG SU * Tuesday, January 25, 2000 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_precision_c ( hid_t_f *type_id , size_t_f *precision) { int ret_value = -1; hid_t c_type_id; - size_t c_precision; + size_t c_precision; c_type_id = *type_id; c_precision = H5Tget_precision(c_type_id); if ( c_precision == 0 ) return ret_value; *precision = (size_t_f)c_precision ; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tset_precision_c - * Purpose: Call H5Tset_precision to set precision of the datatype - * Inputs: type_id - identifier of the dataspace - * precision - number of significant bits + * Purpose: Call H5Tset_precision to set precision of the datatype + * Inputs: type_id - identifier of the dataspace + * precision - number of significant bits * Returns: 0 on success, -1 on failure * Programmer: XIANGYANG SU * Tuesday, January 25, 2000 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tset_precision_c ( hid_t_f *type_id , size_t_f *precision) { int ret_value = -1; hid_t c_type_id; - size_t c_precision; + size_t c_precision; herr_t status; c_type_id = *type_id; c_precision = (size_t)*precision; status = H5Tset_precision(c_type_id, c_precision); if ( status < 0 ) return ret_value; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tget_offset_c - * Purpose: Call H5Tget_offset to get bit offset of the first - * significant bit of the datatype - * Inputs: type_id - identifier of the dataspace - * Outputs: offset - bit offset of the first significant bit + * Purpose: Call H5Tget_offset to get bit offset of the first + * significant bit of the datatype + * Inputs: type_id - identifier of the dataspace + * Outputs: offset - bit offset of the first significant bit * Returns: 0 on success, -1 on failure * Programmer: XIANGYANG SU * Tuesday, January 25, 2000 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_offset_c ( hid_t_f *type_id , size_t_f *offset) { int ret_value = -1; hid_t c_type_id; - size_t c_offset; + size_t c_offset; c_type_id = *type_id; c_offset = H5Tget_offset(c_type_id); if ( c_offset == 0 ) return ret_value; *offset = (size_t_f)c_offset ; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tset_offset_c - * Purpose: Call H5Tset_offset to set bit offset of the first - * significant bit of the datatype - * Inputs: type_id - identifier of the dataspace - * offset - bit offset of the first significant bit + * Purpose: Call H5Tset_offset to set bit offset of the first + * significant bit of the datatype + * Inputs: type_id - identifier of the dataspace + * offset - bit offset of the first significant bit * Returns: 0 on success, -1 on failure * Programmer: XIANGYANG SU * Tuesday, January 25, 2000 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tset_offset_c ( hid_t_f *type_id , size_t_f *offset) { int ret_value = -1; hid_t c_type_id; - size_t c_offset; + size_t c_offset; herr_t status; c_offset = (size_t)*offset; c_type_id = *type_id; status = H5Tset_offset(c_type_id, c_offset); if ( status < 0 ) return ret_value; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tget_pad_c * Purpose: Call H5Tget_pad to get the padding type of the least and - * most-significant bit padding - * - * Inputs: type_id - identifier of the dataspace + * most-significant bit padding + * + * Inputs: type_id - identifier of the dataspace * Outputs: lsbpad - padding type of the least significant bit - * msbpad - padding type of the least significant bit + * msbpad - padding type of the least significant bit * Returns: 0 on success, -1 on failure * Programmer: XIANGYANG SU * Wednesday, January 26, 2000 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_pad_c ( hid_t_f *type_id , int_f * lsbpad, int_f * msbpad) { int ret_value = -1; hid_t c_type_id; herr_t status; - H5T_pad_t c_lsb, c_msb; + H5T_pad_t c_lsb, c_msb; c_type_id = *type_id; status = H5Tget_pad(c_type_id, &c_lsb, &c_msb); @@ -485,85 +485,85 @@ nh5tget_pad_c ( hid_t_f *type_id , int_f * lsbpad, int_f * msbpad) *lsbpad = (int_f) c_lsb; *msbpad = (int_f) c_msb; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tset_pad_c - * Inputs: type_id - identifier of the dataspace + * Inputs: type_id - identifier of the dataspace * Purpose: Call H5Tset_pad to set the padding type of the least and - * most-significant bit padding - * - * Inputs: type_id - identifier of the dataspace + * most-significant bit padding + * + * Inputs: type_id - identifier of the dataspace * lsbpad - padding type of the least significant bit - * msbpad - padding type of the least significant bit + * msbpad - padding type of the least significant bit * Returns: 0 on success, -1 on failure * Programmer: XIANGYANG SU * Wednesday, January 26, 2000 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tset_pad_c ( hid_t_f *type_id, int_f * lsbpad, int_f* msbpad ) { int ret_value = -1; hid_t c_type_id; herr_t status; - H5T_pad_t c_lsb, c_msb; + H5T_pad_t c_lsb, c_msb; c_type_id = *type_id; c_lsb = (H5T_pad_t)*lsbpad; c_msb = (H5T_pad_t)*msbpad; status = H5Tset_pad(c_type_id, c_lsb, c_msb); if ( status < 0 ) return ret_value; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tget_sign_c - * Purpose: Call H5Tget_sign to get sign type for an integer type - * Inputs: type_id - identifier of the dataspace - * Outputs: sign - sign type for an integer type + * Purpose: Call H5Tget_sign to get sign type for an integer type + * Inputs: type_id - identifier of the dataspace + * Outputs: sign - sign type for an integer type * Returns: 0 on success, -1 on failure * Programmer: XIANGYANG SU * Wednesday, January 26, 2000 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_sign_c ( hid_t_f *type_id , int_f *sign) { int ret_value = -1; hid_t c_type_id; - H5T_sign_t c_sign; + H5T_sign_t c_sign; c_type_id = *type_id; c_sign = H5Tget_sign(c_type_id); if ( c_sign == -1 ) return ret_value; *sign = (int_f)c_sign ; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tset_sign_c - * Purpose: Call H5Tset_sign to set sign type for an integer type - * Inputs: type_id - identifier of the dataspace - * sign - sign type for an integer typ + * Purpose: Call H5Tset_sign to set sign type for an integer type + * Inputs: type_id - identifier of the dataspace + * sign - sign type for an integer typ * Returns: 0 on success, -1 on failure * Programmer: XIANGYANG SU * Wednesday, January 26, 2000 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tset_sign_c ( hid_t_f *type_id , int_f* sign) { int ret_value = -1; hid_t c_type_id; - H5T_sign_t c_sign; + H5T_sign_t c_sign; herr_t status; c_type_id = *type_id; @@ -571,15 +571,15 @@ nh5tset_sign_c ( hid_t_f *type_id , int_f* sign) status = H5Tset_sign(c_type_id, c_sign); if ( status < 0 ) return ret_value; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tget_fields_c - * Purpose: Call H5Tget_fields to get floating point datatype + * Purpose: Call H5Tget_fields to get floating point datatype * bit field information - * Inputs: type_id - identifier of the dataspace + * Inputs: type_id - identifier of the dataspace * Outputs: epos - exponent bit-position * esize - size of exponent in bits * mpos - mantissa bit-position @@ -590,13 +590,13 @@ nh5tset_sign_c ( hid_t_f *type_id , int_f* sign) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_fields_c ( hid_t_f *type_id , size_t_f *spos, size_t_f *epos, size_t_f* esize, size_t_f* mpos, size_t_f* msize) { int ret_value = -1; hid_t c_type_id; herr_t status; - size_t c_spos, c_epos, c_esize, c_mpos, c_msize; + size_t c_spos, c_epos, c_esize, c_mpos, c_msize; c_type_id = *type_id; status = H5Tget_fields(c_type_id, &c_spos, &c_epos, &c_esize, &c_mpos, &c_msize); @@ -606,15 +606,15 @@ nh5tget_fields_c ( hid_t_f *type_id , size_t_f *spos, size_t_f *epos, size_t_f* *esize = (size_t_f) c_esize; *mpos = (size_t_f) c_mpos; *msize = (size_t_f) c_msize; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tset_fields_c - * Purpose: Call H5Tset_fields to set floating point datatype + * Purpose: Call H5Tset_fields to set floating point datatype * bit field information - * Inputs: type_id - identifier of the dataspace + * Inputs: type_id - identifier of the dataspace * epos - exponent bit-position * esize - size of exponent in bits * mpos - mantissa bit-position @@ -625,13 +625,13 @@ nh5tget_fields_c ( hid_t_f *type_id , size_t_f *spos, size_t_f *epos, size_t_f* * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tset_fields_c ( hid_t_f *type_id, size_t_f *spos, size_t_f *epos, size_t_f* esize, size_t_f* mpos, size_t_f* msize) { int ret_value = -1; hid_t c_type_id; herr_t status; - size_t c_spos, c_epos, c_esize, c_mpos, c_msize; + size_t c_spos, c_epos, c_esize, c_mpos, c_msize; c_spos = (size_t)*spos; c_epos = (size_t)*epos; @@ -642,15 +642,15 @@ nh5tset_fields_c ( hid_t_f *type_id, size_t_f *spos, size_t_f *epos, size_t_f* e status = H5Tset_fields(c_type_id, c_spos, c_epos, c_esize, c_mpos, c_msize); if ( status < 0 ) return ret_value; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tget_ebias_c - * Purpose: Call H5Tget_ebias to get exponent bias of a - * floating-point type of the datatype - * Inputs: type_id - identifier of the dataspace + * Purpose: Call H5Tget_ebias to get exponent bias of a + * floating-point type of the datatype + * Inputs: type_id - identifier of the dataspace * Outputs: ebias - exponent bias of a floating-point type of the datatype * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su @@ -658,40 +658,40 @@ nh5tset_fields_c ( hid_t_f *type_id, size_t_f *spos, size_t_f *epos, size_t_f* e * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_ebias_c ( hid_t_f *type_id , size_t_f *ebias) { int ret_value = -1; hid_t c_type_id; - size_t c_ebias; + size_t c_ebias; c_type_id = *type_id; c_ebias = H5Tget_ebias(c_type_id); if ( c_ebias == 0 ) return ret_value; *ebias = (size_t_f)c_ebias; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tset_ebias_c * Purpose: Call H5Tset_ebias to set exponent bias of a - * floating-point type of the datatype - * Inputs: type_id - identifier of the dataspace - * ebias - exponent bias of a floating-point type of the datatyp + * floating-point type of the datatype + * Inputs: type_id - identifier of the dataspace + * ebias - exponent bias of a floating-point type of the datatyp * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Friday, January 27, 2000 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tset_ebias_c ( hid_t_f *type_id , size_t_f *ebias) { int ret_value = -1; hid_t c_type_id; - size_t c_ebias; + size_t c_ebias; herr_t status; c_type_id = *type_id; @@ -706,8 +706,8 @@ nh5tset_ebias_c ( hid_t_f *type_id , size_t_f *ebias) /*---------------------------------------------------------------------------- * Name: h5tget_norm_c * Purpose: Call H5Tget_norm to get mantissa normalization - * of a floating-point datatype - * Inputs: type_id - identifier of the dataspace + * of a floating-point datatype + * Inputs: type_id - identifier of the dataspace * Outputs: norm - mantissa normalization of a floating-point type * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su @@ -715,27 +715,27 @@ nh5tset_ebias_c ( hid_t_f *type_id , size_t_f *ebias) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_norm_c ( hid_t_f *type_id , int_f *norm) { int ret_value = -1; hid_t c_type_id; - H5T_norm_t c_norm; + H5T_norm_t c_norm; c_type_id = *type_id; c_norm = H5Tget_norm(c_type_id); if ( c_norm == 0 ) return ret_value; *norm = (int_f)c_norm; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tset_norm_c - * Purpose: Call H5Tset_norm to set mantissa normalization of - * floating-point type of the datatype - * Inputs: type_id - identifier of the dataspace + * Purpose: Call H5Tset_norm to set mantissa normalization of + * floating-point type of the datatype + * Inputs: type_id - identifier of the dataspace * norm - mantissa normalization of a floating-point type * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su @@ -743,12 +743,12 @@ nh5tget_norm_c ( hid_t_f *type_id , int_f *norm) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tset_norm_c ( hid_t_f *type_id , int_f *norm) { int ret_value = -1; hid_t c_type_id; - H5T_norm_t c_norm; + H5T_norm_t c_norm; herr_t status; c_type_id = *type_id; @@ -764,8 +764,8 @@ nh5tset_norm_c ( hid_t_f *type_id , int_f *norm) * Name: h5tget_inpad_c * Purpose: Call H5Tget_inpad to get the padding type for * unused bits in floating-point datatypes - * - * Inputs: type_id - identifier of the dataspace + * + * Inputs: type_id - identifier of the dataspace * Outputs: padtype - padding type for * unused bits in floating-point datatype * Returns: 0 on success, -1 on failure @@ -774,29 +774,29 @@ nh5tset_norm_c ( hid_t_f *type_id , int_f *norm) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_inpad_c ( hid_t_f *type_id , int_f * padtype) { int ret_value = -1; hid_t c_type_id; - H5T_pad_t c_padtype; + H5T_pad_t c_padtype; c_type_id = *type_id; c_padtype = H5Tget_inpad(c_type_id); if ( c_padtype == H5T_PAD_ERROR ) return ret_value; *padtype = (int_f) c_padtype; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tset_inpad_c - * Inputs: type_id - identifier of the dataspace - * Purpose: Call H5Tset_inpad to set the padding type + * Inputs: type_id - identifier of the dataspace + * Purpose: Call H5Tset_inpad to set the padding type * unused bits in floating-point datatype - * - * Inputs: type_id - identifier of the dataspace + * + * Inputs: type_id - identifier of the dataspace * padtype - padding type for unused bits * in floating-point datatypes * Returns: 0 on success, -1 on failure @@ -805,29 +805,29 @@ nh5tget_inpad_c ( hid_t_f *type_id , int_f * padtype) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tset_inpad_c ( hid_t_f *type_id, int_f * padtype) { int ret_value = -1; hid_t c_type_id; herr_t status; - H5T_pad_t c_padtype; + H5T_pad_t c_padtype; c_type_id = *type_id; c_padtype = (H5T_pad_t)*padtype; status = H5Tset_inpad(c_type_id, c_padtype); if ( status < 0 ) return ret_value; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tget_cset_c - * Purpose: Call H5Tget_cset to get character set + * Purpose: Call H5Tget_cset to get character set * type of a string datatype - * - * Inputs: type_id - identifier of the dataspace + * + * Inputs: type_id - identifier of the dataspace * Outputs: cset - character set type of a string datatype * Returns: 0 on success, -1 on failure * Programmer: XIANGYANG SU @@ -835,29 +835,29 @@ nh5tset_inpad_c ( hid_t_f *type_id, int_f * padtype) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_cset_c ( hid_t_f *type_id , int_f * cset) { int ret_value = -1; hid_t c_type_id; - H5T_cset_t c_cset; + H5T_cset_t c_cset; c_type_id = *type_id; c_cset = H5Tget_cset(c_type_id); if ( c_cset == H5T_CSET_ERROR ) return ret_value; *cset = (int_f) c_cset; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tset_cset_c - * Inputs: type_id - identifier of the dataspace + * Inputs: type_id - identifier of the dataspace * Purpose: Call H5Tset_cset to set character set * type of a string datatype - * - * Inputs: type_id - identifier of the dataspace + * + * Inputs: type_id - identifier of the dataspace * cset - character set type of a string datatype * Returns: 0 on success, -1 on failure * Programmer: XIANGYANG SU @@ -865,20 +865,20 @@ nh5tget_cset_c ( hid_t_f *type_id , int_f * cset) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tset_cset_c ( hid_t_f *type_id, int_f * cset) { int ret_value = -1; hid_t c_type_id; herr_t status; - H5T_cset_t c_cset; + H5T_cset_t c_cset; c_type_id = *type_id; c_cset = (H5T_cset_t)*cset; status = H5Tset_cset(c_type_id, c_cset); if ( status < 0 ) return ret_value; - ret_value = 0; + ret_value = 0; return ret_value; } @@ -886,7 +886,7 @@ nh5tset_cset_c ( hid_t_f *type_id, int_f * cset) * Name: h5tget_strpad_c * Purpose: Call H5Tget_strpad to get string padding method * for a string datatype - * Inputs: type_id - identifier of the dataspace + * Inputs: type_id - identifier of the dataspace * Outputs: strpad - string padding method for a string datatype * Returns: 0 on success, -1 on failure * Programmer: XIANGYANG SU @@ -894,29 +894,29 @@ nh5tset_cset_c ( hid_t_f *type_id, int_f * cset) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_strpad_c ( hid_t_f *type_id , int_f * strpad) { int ret_value = -1; hid_t c_type_id; - H5T_str_t c_strpad; + H5T_str_t c_strpad; c_type_id = *type_id; c_strpad = H5Tget_strpad(c_type_id); if ( c_strpad == H5T_STR_ERROR ) return ret_value; *strpad = (int_f) c_strpad; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tset_strpad_c - * Inputs: type_id - identifier of the dataspace + * Inputs: type_id - identifier of the dataspace * Purpose: Call H5Tset_strpad to set string padding method * for a string datatype - * - * Inputs: type_id - identifier of the dataspace + * + * Inputs: type_id - identifier of the dataspace * strpad - string padding method for a string datatype * Returns: 0 on success, -1 on failure * Programmer: XIANGYANG SU @@ -924,28 +924,28 @@ nh5tget_strpad_c ( hid_t_f *type_id , int_f * strpad) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tset_strpad_c ( hid_t_f *type_id, int_f * strpad) { int ret_value = -1; hid_t c_type_id; herr_t status; - H5T_str_t c_strpad; + H5T_str_t c_strpad; c_type_id = *type_id; c_strpad = (H5T_str_t)*strpad; status = H5Tset_strpad(c_type_id, c_strpad); if ( status < 0 ) return ret_value; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tget_nmembers_c - * Purpose: Call H5Tget_nmembers to get number of fields + * Purpose: Call H5Tget_nmembers to get number of fields * in a compound datatype - * Inputs: type_id - identifier of the dataspace + * Inputs: type_id - identifier of the dataspace * Outputs: num_members - number of fields in a compound datatype * Returns: 0 on success, -1 on failure * Programmer: XIANGYANG SU @@ -953,7 +953,7 @@ nh5tset_strpad_c ( hid_t_f *type_id, int_f * strpad) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_nmembers_c ( hid_t_f *type_id , int_f * num_members) { int ret_value = -1; @@ -963,16 +963,16 @@ nh5tget_nmembers_c ( hid_t_f *type_id , int_f * num_members) *num_members = (int_f)H5Tget_nmembers(c_type_id); if (*num_members < 0 ) return ret_value; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tget_member_name_c - * Purpose: Call H5Tget_member_name to get name + * Purpose: Call H5Tget_member_name to get name * of a compound datatype - * Inputs: type_id - identifier of the dataspace - * Outputs: member_name - name of a field of a compound datatype + * Inputs: type_id - identifier of the dataspace + * Outputs: member_name - name of a field of a compound datatype * Returns: 0 on success, -1 on failure * Programmer: XIANGYANG SU * Thursday, February 3, 2000 @@ -980,7 +980,7 @@ nh5tget_nmembers_c ( hid_t_f *type_id , int_f * num_members) * Added namelen parameter to return length of the name to Fortran user *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_member_name_c ( hid_t_f *type_id ,int_f* idx, _fcd member_name, int_f *namelen) { int ret_value = -1; @@ -993,18 +993,18 @@ nh5tget_member_name_c ( hid_t_f *type_id ,int_f* idx, _fcd member_name, int_f *n c_name = H5Tget_member_name(c_type_id, c_index); if (c_name == NULL ) return ret_value; - HD5packFstring(c_name, _fcdtocp(member_name), (int)strlen(c_name)); + HD5packFstring(c_name, _fcdtocp(member_name), (int)strlen(c_name)); *namelen = (int_f)strlen(c_name); HDfree(c_name); - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tget_member_index_c * Purpose: Call H5Tget_member_index to get an index of * the specified datatype filed or member. - * Inputs: type_id - datatype identifier - * name - name of the datatype within file or group + * Inputs: type_id - datatype identifier + * name - name of the datatype within file or group * namelen - name length * Outputs: index - 0-based index * Returns: 0 on success, -1 on failure @@ -1025,7 +1025,7 @@ nh5tget_member_index_c (hid_t_f *type_id, _fcd name, int_f *namelen, int_f *idx) * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -1040,25 +1040,25 @@ DONE: HDfree(c_name); ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5tget_member_offset_c * Purpose: Call H5Tget_member_offset to get byte offset of the - * beginning of a field within a compound datatype with + * beginning of a field within a compound datatype with * respect to the beginning of the compound data type datum - * Inputs: type_id - identifier of the dataspace + * Inputs: type_id - identifier of the dataspace * member_no - Number of the field whose offset is requested * Outputs: offset - byte offset of the the beginning of the field of - * a compound datatype + * a compound datatype * Returns: always 0 * Programmer: XIANGYANG SU * Thursday, February 3, 2000 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_member_offset_c ( hid_t_f *type_id ,int_f* member_no, size_t_f * offset) { int ret_value = -1; @@ -1070,23 +1070,23 @@ nh5tget_member_offset_c ( hid_t_f *type_id ,int_f* member_no, size_t_f * offset) c_member_no = *member_no; c_offset = H5Tget_member_offset(c_type_id, c_member_no); *offset = (size_t_f)c_offset; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tget_array_dims_c - * Purpose: Call H5Tget_array_dims to get + * Purpose: Call H5Tget_array_dims to get * dimensions of array datatype * Inputs: type_id - identifier of the array datatype * Outputs: dims - dimensions(sizes of dimensions) of the array * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Thursday, November 16, 2000 - * Modifications: + * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_array_dims_c ( hid_t_f *type_id , hsize_t_f * dims) { int ret_value = -1; @@ -1112,7 +1112,7 @@ nh5tget_array_dims_c ( hid_t_f *type_id , hsize_t_f * dims) dims[rank-i-1] = (hsize_t_f)c_dims[i]; } - ret_value = 0; + ret_value = 0; HDfree(c_dims); return ret_value; @@ -1120,17 +1120,17 @@ nh5tget_array_dims_c ( hid_t_f *type_id , hsize_t_f * dims) /*---------------------------------------------------------------------------- * Name: h5tget_array_ndims_c - * Purpose: Call H5Tget_array_ndims to get number + * Purpose: Call H5Tget_array_ndims to get number * of dimensions of array datatype * Inputs: type_id - identifier of the array datatype * Outputs: ndims - number of dimensions of the array * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Thursday, November 16, 2000 - * Modifications: + * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_array_ndims_c ( hid_t_f *type_id , int_f * ndims) { int ret_value = -1; @@ -1142,23 +1142,23 @@ nh5tget_array_ndims_c ( hid_t_f *type_id , int_f * ndims) if (c_ndims < 0) return ret_value; *ndims = (int_f)c_ndims; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tget_super_c - * Purpose: Call H5Tget_super to get base datatype from which - * datatype was derived + * Purpose: Call H5Tget_super to get base datatype from which + * datatype was derived * Inputs: type_id - identifier of the array datatype - * Outputs: base_type_id - base datatype identifier + * Outputs: base_type_id - base datatype identifier * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Thursday, November 16, 2000 - * Modifications: + * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_super_c ( hid_t_f *type_id , hid_t_f *base_type_id) { int ret_value = -1; @@ -1170,7 +1170,7 @@ nh5tget_super_c ( hid_t_f *type_id , hid_t_f *base_type_id) if (c_base_type_id < 0) return ret_value; *base_type_id = (hid_t_f)c_base_type_id; - ret_value = 0; + ret_value = 0; return ret_value; } @@ -1179,7 +1179,7 @@ nh5tget_super_c ( hid_t_f *type_id , hid_t_f *base_type_id) * Name: h5tget_member_type_c * Purpose: Call H5Tget_member_type to get the identifier of a copy of * the datatype of the field - * Inputs: type_id - identifier of the datatype + * Inputs: type_id - identifier of the datatype * field_idx - Field index (0-based) of the field type to retrieve * Outputs: datatype - identifier of a copy of the datatype of the field * Returns: 0 on success, -1 on failure @@ -1188,7 +1188,7 @@ nh5tget_super_c ( hid_t_f *type_id , hid_t_f *base_type_id) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_member_type_c ( hid_t_f *type_id ,int_f* field_idx, hid_t_f * datatype) { int ret_value = -1; @@ -1200,23 +1200,23 @@ nh5tget_member_type_c ( hid_t_f *type_id ,int_f* field_idx, hid_t_f * datatype) *datatype = (hid_t_f)H5Tget_member_type(c_type_id, c_field_idx); if(*datatype < 0) return ret_value; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tcreate_c - * Purpose: Call H5Tcreate to create a datatype - * Inputs: class - class type - * size - size of the class memeber + * Purpose: Call H5Tcreate to create a datatype + * Inputs: class - class type + * size - size of the class memeber * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * Programmer: Elena Pourmal * Thursday, February 17, 2000 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tcreate_c(int_f *class, size_t_f *size, hid_t_f *type_id) { int ret_value = -1; @@ -1229,14 +1229,14 @@ nh5tcreate_c(int_f *class, size_t_f *size, hid_t_f *type_id) *type_id = (hid_t_f)H5Tcreate(c_class, c_size); if(*type_id < 0) return ret_value; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tinsert_c * Purpose: Call H5Tinsert to adds another member to the compound datatype - * Inputs: type_id - identifier of the datatype + * Inputs: type_id - identifier of the datatype * name - Name of the field to insert * namelen - length of the name * offset - Offset in memory structure of the field to insert @@ -1247,7 +1247,7 @@ nh5tcreate_c(int_f *class, size_t_f *size, hid_t_f *type_id) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tinsert_c(hid_t_f *type_id, _fcd name, int_f* namelen, size_t_f *offset, hid_t_f * field_id) { int ret_value = -1; @@ -1260,7 +1260,7 @@ nh5tinsert_c(hid_t_f *type_id, _fcd name, int_f* namelen, size_t_f *offset, hid_ c_offset =(size_t) *offset; c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; c_type_id = *type_id; @@ -1268,17 +1268,17 @@ nh5tinsert_c(hid_t_f *type_id, _fcd name, int_f* namelen, size_t_f *offset, hid_ error = H5Tinsert(c_type_id, c_name, c_offset, c_field_id); HDfree(c_name); if(error < 0) return ret_value; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tpack_c - * Purpose: Call H5Tpack tor ecursively remove padding from - * within a compound datatype to make it more efficient + * Purpose: Call H5Tpack tor ecursively remove padding from + * within a compound datatype to make it more efficient * (space-wise) to store that data - * Inputs: type_id - identifier of the datatype + * Inputs: type_id - identifier of the datatype * Returns: 0 on success, -1 on failure * Programmer: XIANGYANG SU * Thursday, February 3, 2000 @@ -1298,7 +1298,7 @@ nh5tpack_c(hid_t_f * type_id) ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5tarray_create_c @@ -1308,9 +1308,9 @@ nh5tpack_c(hid_t_f * type_id) * dims - Size of new member array * type_id - identifier of the array datatype * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * Programmer: Elena Pourmal * Thursday, November 16, 2000 - * Modifications: + * Modifications: *---------------------------------------------------------------------------*/ int_f nh5tarray_create_c(hid_t_f * base_id, int_f *rank, hsize_t_f* dims, hid_t_f* type_id) @@ -1332,7 +1332,7 @@ nh5tarray_create_c(hid_t_f * base_id, int_f *rank, hsize_t_f* dims, hid_t_f* typ for (i = 0; i < *rank ; i++) { c_dims[i] = (hsize_t)dims[*rank - i - 1]; } - + c_base_id = (hid_t)*base_id; c_rank = (int)*rank; c_type_id = H5Tarray_create(c_base_id, c_rank, c_dims, NULL); @@ -1353,8 +1353,8 @@ nh5tarray_create_c(hid_t_f * base_id, int_f *rank, hsize_t_f* dims, hid_t_f* typ /*---------------------------------------------------------------------------- * Name: h5tenum_create_c * Purpose: Call H5Tenum_create to create a new enumeration datatype - * Inputs: parent_id - Datatype identifier for the base datatype - * Outputs: new_type_id - datatype identifier for the new + * Inputs: parent_id - Datatype identifier for the base datatype + * Outputs: new_type_id - datatype identifier for the new * enumeration datatype * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su @@ -1362,7 +1362,7 @@ nh5tarray_create_c(hid_t_f * base_id, int_f *rank, hsize_t_f* dims, hid_t_f* typ * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tenum_create_c ( hid_t_f *parent_id , hid_t_f *new_type_id) { int ret_value = 0; @@ -1370,7 +1370,7 @@ nh5tenum_create_c ( hid_t_f *parent_id , hid_t_f *new_type_id) hid_t c_new_type_id; c_parent_id = *parent_id; - c_new_type_id = H5Tenum_create(c_parent_id); + c_new_type_id = H5Tenum_create(c_parent_id); if ( c_new_type_id < 0 ) ret_value = -1; *new_type_id = (hid_t_f)c_new_type_id; @@ -1380,7 +1380,7 @@ nh5tenum_create_c ( hid_t_f *parent_id , hid_t_f *new_type_id) /*---------------------------------------------------------------------------- * Name: h5tenum_insert_c * Purpose: Call H5Tenum_insert to insert a new enumeration datatype member. - * Inputs: type_id - identifier of the datatype + * Inputs: type_id - identifier of the datatype * name - Name of the new member * namelen - length of the name * value - value of the new member @@ -1390,7 +1390,7 @@ nh5tenum_create_c ( hid_t_f *parent_id , hid_t_f *new_type_id) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tenum_insert_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value) { int ret_value = -1; @@ -1401,16 +1401,16 @@ nh5tenum_insert_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value) herr_t error; c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; - + c_type_id = (hid_t)*type_id; c_value = (int)*value; error = H5Tenum_insert(c_type_id, c_name, &c_value); HDfree(c_name); if(error < 0) return ret_value; - ret_value = 0; + ret_value = 0; return ret_value; } @@ -1419,7 +1419,7 @@ nh5tenum_insert_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value) * Name: h5tenum_nameof_c * Purpose: Call H5Tenum_nameof to find the symbol name that corresponds to * the specified value of the enumeration datatype type - * Inputs: type_id - identifier of the datatype + * Inputs: type_id - identifier of the datatype * namelen - length of the name * value - value of the enumeration datatype * Output: name - Name of the enumeration datatype @@ -1429,7 +1429,7 @@ nh5tenum_insert_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tenum_nameof_c(hid_t_f *type_id, int_f* value, _fcd name, size_t_f* namelen) { int ret_value = -1; @@ -1443,11 +1443,11 @@ nh5tenum_nameof_c(hid_t_f *type_id, int_f* value, _fcd name, size_t_f* namelen) c_name = (char *)malloc(sizeof(char)*c_namelen); c_type_id = (hid_t)*type_id; error = H5Tenum_nameof(c_type_id, &c_value, c_name, c_namelen); - HD5packFstring(c_name, _fcdtocp(name), (int)strlen(c_name)); + HD5packFstring(c_name, _fcdtocp(name), (int)strlen(c_name)); HDfree(c_name); if(error < 0) return ret_value; - ret_value = 0; + ret_value = 0; return ret_value; } @@ -1455,9 +1455,9 @@ nh5tenum_nameof_c(hid_t_f *type_id, int_f* value, _fcd name, size_t_f* namelen) * Name: h5tenum_valueof_c * Purpose: Call H5Tenum_valueof to find the value of that corresponds to * the specified name of the enumeration datatype type - * Inputs: type_id - identifier of the datatype + * Inputs: type_id - identifier of the datatype * name - Name of the enumeration datatype - * namelen - length of name + * namelen - length of name * Output: value - value of the enumeration datatype * Returns: 0 on success, -1 on failure * Programmer: XIANGYANG SU @@ -1465,7 +1465,7 @@ nh5tenum_nameof_c(hid_t_f *type_id, int_f* value, _fcd name, size_t_f* namelen) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tenum_valueof_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value) { int ret_value = -1; @@ -1474,7 +1474,7 @@ nh5tenum_valueof_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value) int c_namelen; herr_t error; c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; c_type_id = *type_id; @@ -1482,16 +1482,16 @@ nh5tenum_valueof_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value) HDfree(c_name); if(error < 0) return ret_value; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tget_member_value_c - * Purpose: Call H5Tget_member_value to get the value of an + * Purpose: Call H5Tget_member_value to get the value of an * enumeration datatype member - * Inputs: type_id - identifier of the datatype + * Inputs: type_id - identifier of the datatype * member_no - Number of the enumeration datatype member. * Output: value - value of the enumeration datatype * Returns: 0 on success, -1 on failure @@ -1500,7 +1500,7 @@ nh5tenum_valueof_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_member_value_c(hid_t_f *type_id, int_f* member_no, int_f* value) { int ret_value = -1; @@ -1515,16 +1515,16 @@ nh5tget_member_value_c(hid_t_f *type_id, int_f* member_no, int_f* value) if(error < 0) return ret_value; *value = (int_f)c_value; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tset_tag_c - * Inputs: type_id - identifier of the dataspace + * Inputs: type_id - identifier of the dataspace * Purpose: Call H5Tset_tag to set an opaque datatype tag - * Inputs: type_id - identifier of the dataspace - * tag - Unique ASCII string with which the opaque + * Inputs: type_id - identifier of the dataspace + * tag - Unique ASCII string with which the opaque * datatype is to be tagged * namelen - length of tag * Returns: 0 on success, -1 on failure @@ -1541,23 +1541,23 @@ nh5tset_tag_c(hid_t_f* type_id, _fcd tag, int_f* namelen) char* c_tag; int c_namelen; - c_namelen = *namelen; - c_tag = (char *)HD5f2cstring(tag, c_namelen); + c_namelen = *namelen; + c_tag = (char *)HD5f2cstring(tag, c_namelen); c_type_id = *type_id; status = H5Tset_tag(c_type_id, c_tag); HDfree(c_tag); if ( status < 0 ) return ret_value; - ret_value = 0; + ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5tget_tag_c * Purpose: Call H5Tset_tag to set an opaque datatype tag * Inputs: type_id - identifier of the datatype - * Outputs: tag - Unique ASCII string with which the opaque + * Outputs: tag - Unique ASCII string with which the opaque * datatype is to be tagged * taglen - length of tag * Returns: 0 on success, -1 on failure @@ -1576,10 +1576,10 @@ nh5tget_tag_c(hid_t_f* type_id, _fcd tag, int_f* taglen) c_tag = H5Tget_tag(c_type_id); if (c_tag == NULL ) return ret_value; - HD5packFstring(c_tag, _fcdtocp(tag), (int)strlen(c_tag)); + HD5packFstring(c_tag, _fcdtocp(tag), (int)strlen(c_tag)); *taglen = (int_f)HDstrlen(c_tag); HDfree(c_tag); - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- @@ -1603,14 +1603,14 @@ nh5tvlen_create_c(hid_t_f* type_id, hid_t_f *vltype_id) c_vltype_id = H5Tvlen_create(c_type_id); if (c_vltype_id < 0 ) return ret_value; *vltype_id = (hid_t_f)c_vltype_id; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tis_variable_str_c * Purpose: Call H5Tis_variable_str to detrmine if the datatype * is a variable string. - * Inputs: type_id - identifier of the dataspace + * Inputs: type_id - identifier of the dataspace * Outputs: flag - 0 if not VL str, 1 if is not * and negative on failure. * Returns: 0 on success, -1 on failure @@ -1619,7 +1619,7 @@ nh5tvlen_create_c(hid_t_f* type_id, hid_t_f *vltype_id) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag ) { int ret_value = 0; @@ -1636,7 +1636,7 @@ nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag ) * Name: h5tget_member_class_c * Purpose: Call H5Tget_member_class to detrmine ithe class of the compound * datatype member - * Inputs: type_id - identifier of the dataspace + * Inputs: type_id - identifier of the dataspace * member_no - member's index * Outputs: class - member's class * and negative on failure. @@ -1646,7 +1646,7 @@ nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag ) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_member_class_c ( hid_t_f *type_id , int_f *member_no, int_f *class ) { int ret_value = 0; diff --git a/fortran/src/H5Zf.c b/fortran/src/H5Zf.c index 8c2b6b6..6436de5 100644 --- a/fortran/src/H5Zf.c +++ b/fortran/src/H5Zf.c @@ -54,7 +54,7 @@ nh5zunregister_c (int_f *filter) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5zfilter_avail_c ( int_f *filter , int_f *flag ) { int ret_value = 0; @@ -80,7 +80,7 @@ nh5zfilter_avail_c ( int_f *filter , int_f *flag ) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5zget_filter_info_c ( int_f *filter , int_f *flag ) { int ret_value = 0; diff --git a/fortran/src/H5_f.c b/fortran/src/H5_f.c index 8b244f0..745dfe4 100644 --- a/fortran/src/H5_f.c +++ b/fortran/src/H5_f.c @@ -19,21 +19,21 @@ /*--------------------------------------------------------------------------- * Name: h5init_types_c * Purpose: Initialize predefined datatypes in Fortran - * Inputs: types - array with the predefined Native Fortran + * Inputs: types - array with the predefined Native Fortran * type, its element and length must be the - * same as the types array defined in the + * same as the types array defined in the * H5f90global.f90 - * floatingtypes - array with the predefined Floating Fortran + * floatingtypes - array with the predefined Floating Fortran * type, its element and length must be the - * same as the floatingtypes array defined in the + * same as the floatingtypes array defined in the * H5f90global.f90 - * integertypes - array with the predefined Integer Fortran + * integertypes - array with the predefined Integer Fortran * type, its element and length must be the - * same as the integertypes array defined in the + * same as the integertypes array defined in the * H5f90global.f90 - * Outputs: None + * Outputs: None * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * Programmer: Elena Pourmal * Tuesday, August 3, 1999 * Modifications: *---------------------------------------------------------------------------*/ @@ -112,49 +112,49 @@ nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertype if ((integertypes[13] = (hid_t_f)H5Tcopy(H5T_STD_U32LE)) < 0) return ret_value; if ((integertypes[14] = (hid_t_f)H5Tcopy(H5T_STD_U64BE)) < 0) return ret_value; if ((integertypes[15] = (hid_t_f)H5Tcopy(H5T_STD_U64LE)) < 0) return ret_value; -/* - * Define Fortran H5T_STRING type to store non-fixed size strings +/* + * Define Fortran H5T_STRING type to store non-fixed size strings */ if ((c_type_id = H5Tcopy(H5T_C_S1)) < 0) return ret_value; - if(H5Tset_size(c_type_id, H5T_VARIABLE) < 0) return ret_value; + if(H5Tset_size(c_type_id, H5T_VARIABLE) < 0) return ret_value; integertypes[16] = c_type_id; - ret_value = 0; + ret_value = 0; return ret_value; } - + /*--------------------------------------------------------------------------- * Name: h5close_types_c * Purpose: Closes predefined datatype in Fortran - * Inputs: types - array with the predefined Native Fortran + * Inputs: types - array with the predefined Native Fortran * type, its element and length must be the - * same as the types array defined in the + * same as the types array defined in the * H5f90global.f90 * lentypes - length of the types array, which must be the - * same as the length of types array defined + * same as the length of types array defined * in the H5f90global.f90 - * floatingtypes - array with the predefined Floating Fortran + * floatingtypes - array with the predefined Floating Fortran * type, its element and length must be the - * same as the floatingtypes array defined in the + * same as the floatingtypes array defined in the * H5f90global.f90 * floatinglen - length of the floatingtypes array, which must be the - * same as the length of floatingtypes array defined + * same as the length of floatingtypes array defined * in the H5f90global.f90 - * integertypes - array with the predefined Integer Fortran + * integertypes - array with the predefined Integer Fortran * type, its element and length must be the - * same as the integertypes array defined in the + * same as the integertypes array defined in the * H5f90global.f90 * integerlen - length of the floatingtypes array, which must be the - * same as the length of floatingtypes array defined + * same as the length of floatingtypes array defined * in the H5f90global.f90 - * Outputs: None + * Outputs: None * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * Programmer: Elena Pourmal * Tuesday, August 3, 1999 * Modifications: *---------------------------------------------------------------------------*/ int_f -nh5close_types_c( hid_t_f * types, int_f *lentypes, +nh5close_types_c( hid_t_f * types, int_f *lentypes, hid_t_f * floatingtypes, int_f* floatinglen, hid_t_f * integertypes, int_f * integerlen ) { @@ -175,13 +175,13 @@ nh5close_types_c( hid_t_f * types, int_f *lentypes, c_type_id = integertypes[i]; if ( H5Tclose(c_type_id) < 0) return ret_value; } - ret_value = 0; + ret_value = 0; return ret_value; -} +} /*--------------------------------------------------------------------------- * Name: h5init_flags_c * Purpose: Initialize Fortran flags - * Inputs: h5d_flags - H5D inteface flags + * Inputs: h5d_flags - H5D inteface flags * h5f_flags - H5F interface flags * h5fd_flags - H5FD interface flags * h5fd_hid_flags- H5FD interface flags of type hid_t @@ -192,18 +192,18 @@ nh5close_types_c( hid_t_f * types, int_f *lentypes, * h5s_flags - H5S interface flags * h5t_flags - H5T interface flags * h5z_flags - H5Z interface flags - * Outputs: None + * Outputs: None * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * Programmer: Elena Pourmal * Tuesday, August 3, 1999 * Modifications: Added Z flags. EIP, March 12, 2003 * Added more FD flags and new H5LIB flags - * Added more FD flags for HDF5 file driver - * EIP, April 9, 2005 + * Added more FD flags for HDF5 file driver + * EIP, April 9, 2005 *---------------------------------------------------------------------------*/ int_f nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags, - int_f *h5fd_flags, hid_t_f *h5fd_hid_flags, + int_f *h5fd_flags, hid_t_f *h5fd_hid_flags, int_f *h5g_flags, int_f *h5i_flags, hid_t_f *h5p_flags, int_f *h5r_flags, int_f *h5s_flags, int_f *h5t_flags, int_f *h5z_flags) @@ -235,7 +235,7 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags, /* * H5F flags */ - h5f_flags[0] = (int_f)H5F_ACC_RDWR; + h5f_flags[0] = (int_f)H5F_ACC_RDWR; h5f_flags[1] = (int_f)H5F_ACC_RDONLY; h5f_flags[2] = (int_f)H5F_ACC_TRUNC; h5f_flags[3] = (int_f)H5F_ACC_EXCL; @@ -264,7 +264,7 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags, h5fd_flags[6] = H5FD_MEM_DRAW; h5fd_flags[7] = H5FD_MEM_GHEAP; h5fd_flags[8] = H5FD_MEM_LHEAP; - h5fd_flags[9] = H5FD_MEM_OHDR; + h5fd_flags[9] = H5FD_MEM_OHDR; h5fd_flags[10] = H5FD_MEM_NTYPES; /* @@ -308,8 +308,8 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags, * H5P flags */ - h5p_flags[0] = H5P_FILE_CREATE; - h5p_flags[1] = H5P_FILE_ACCESS; + h5p_flags[0] = H5P_FILE_CREATE; + h5p_flags[1] = H5P_FILE_ACCESS; h5p_flags[2] = H5P_DATASET_CREATE; h5p_flags[3] = H5P_DATASET_XFER; h5p_flags[4] = H5P_MOUNT; @@ -328,9 +328,9 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags, */ - h5s_flags[0] = H5S_SCALAR; - h5s_flags[1] = H5S_SIMPLE; - h5s_flags[2] = H5S_NULL; + h5s_flags[0] = H5S_SCALAR; + h5s_flags[1] = H5S_SIMPLE; + h5s_flags[2] = H5S_NULL; h5s_flags[3] = H5S_SELECT_SET; h5s_flags[4] = H5S_SELECT_OR; h5s_flags[5] = (int_f)H5S_UNLIMITED; @@ -357,29 +357,29 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags, */ - h5t_flags[0] = H5T_NO_CLASS; - h5t_flags[1] = H5T_INTEGER; - h5t_flags[2] = H5T_FLOAT; - h5t_flags[3] = H5T_TIME; - h5t_flags[4] = H5T_STRING; + h5t_flags[0] = H5T_NO_CLASS; + h5t_flags[1] = H5T_INTEGER; + h5t_flags[2] = H5T_FLOAT; + h5t_flags[3] = H5T_TIME; + h5t_flags[4] = H5T_STRING; h5t_flags[5] = H5T_BITFIELD; h5t_flags[6] = H5T_OPAQUE; - h5t_flags[7] = H5T_COMPOUND; + h5t_flags[7] = H5T_COMPOUND; h5t_flags[8] = H5T_REFERENCE; - h5t_flags[9] = H5T_ENUM; - h5t_flags[10] = H5T_ORDER_LE; + h5t_flags[9] = H5T_ENUM; + h5t_flags[10] = H5T_ORDER_LE; h5t_flags[11] = H5T_ORDER_BE; h5t_flags[12] = H5T_ORDER_VAX; h5t_flags[13] = H5T_PAD_ZERO; h5t_flags[14] = H5T_PAD_ONE; h5t_flags[15] = H5T_PAD_BACKGROUND; - h5t_flags[16] = H5T_PAD_ERROR; - h5t_flags[17] = H5T_SGN_NONE; - h5t_flags[18] = H5T_SGN_2; + h5t_flags[16] = H5T_PAD_ERROR; + h5t_flags[17] = H5T_SGN_NONE; + h5t_flags[18] = H5T_SGN_2; h5t_flags[19] = H5T_SGN_ERROR; h5t_flags[20] = H5T_NORM_IMPLIED; h5t_flags[21] = H5T_NORM_MSBSET; - h5t_flags[22] = H5T_NORM_NONE; + h5t_flags[22] = H5T_NORM_NONE; h5t_flags[23] = H5T_CSET_ASCII; h5t_flags[24] = H5T_CSET_UTF8; h5t_flags[25] = H5T_STR_NULLTERM; @@ -407,7 +407,7 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags, h5z_flags[12] = H5Z_FILTER_CONFIG_DECODE_ENABLED; h5z_flags[13] = H5Z_FILTER_ALL; - ret_value = 0; + ret_value = 0; return ret_value; } @@ -419,7 +419,7 @@ nh5init1_flags_c(int_f *h5lib_flags) unsigned prm_2 = H5_SZIP_NN_OPTION_MASK; h5lib_flags[0] = (int_f)prm_1; h5lib_flags[1] = (int_f)prm_2; - ret_value = 0; + ret_value = 0; return ret_value; } @@ -427,8 +427,8 @@ nh5init1_flags_c(int_f *h5lib_flags) * Name: h5open_c * Purpose: Calls H5open call to initialize C HDF5 library * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Friday, November 17, 2000 + * Programmer: Elena Pourmal + * Friday, November 17, 2000 * Modifications: *---------------------------------------------------------------------------*/ int_f @@ -436,16 +436,16 @@ nh5open_c() { int ret_value = -1; - if (H5open() < 0) return ret_value; - ret_value = 0; + if (H5open() < 0) return ret_value; + ret_value = 0; return ret_value; -} +} /*--------------------------------------------------------------------------- * Name: h5close_c * Purpose: Calls H5close call to close C HDF5 library * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Friday, November 17, 2000 + * Programmer: Elena Pourmal + * Friday, November 17, 2000 * Modifications: *---------------------------------------------------------------------------*/ int_f @@ -453,24 +453,24 @@ nh5close_c() { int ret_value = -1; - if (H5close() < 0) return ret_value; - ret_value = 0; + if (H5close() < 0) return ret_value; + ret_value = 0; return ret_value; -} +} /*--------------------------------------------------------------------------- * Name: h5get_libversion_c * Purpose: Calls H5get_libversion function - * to retrieve library version info. - * Inputs: + * to retrieve library version info. + * Inputs: * None - * Outputs: + * Outputs: * majnum - the major version of the library * minnum - the minor version of the library * relnum - the release version of the library * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * Programmer: Elena Pourmal * Tuesday, September 24, 2002 * Modifications: *---------------------------------------------------------------------------*/ @@ -479,30 +479,30 @@ nh5get_libversion_c( int_f *majnum, int_f *minnum, int_f *relnum) { int ret_value = -1; - unsigned c_majnum, c_minnum, c_relnum; + unsigned c_majnum, c_minnum, c_relnum; if (H5get_libversion(&c_majnum, &c_minnum, &c_relnum) < 0) return ret_value; *majnum = (int_f)c_majnum; *minnum = (int_f)c_minnum; *relnum = (int_f)c_relnum; - ret_value = 0; + ret_value = 0; return ret_value; -} +} /*--------------------------------------------------------------------------- * Name: h5check_version_c * Purpose: Calls H5check_version function - * to verify library version info. - * Inputs: + * to verify library version info. + * Inputs: * majnum - the major version of the library * minnum - the minor version of the library * relnum - the release version of the library - * Outputs: + * Outputs: * None * Returns: 0 on success, aborts on failure - * Programmer: Elena Pourmal + * Programmer: Elena Pourmal * Tuesday, September 24, 2002 * Modifications: *---------------------------------------------------------------------------*/ @@ -511,22 +511,22 @@ nh5check_version_c( int_f *majnum, int_f *minnum, int_f *relnum) { int ret_value = -1; - unsigned c_majnum, c_minnum, c_relnum; + unsigned c_majnum, c_minnum, c_relnum; c_majnum = (unsigned) *majnum; c_minnum = (unsigned) *minnum; c_relnum = (unsigned) *relnum; H5check_version(c_majnum, c_minnum, c_relnum); - ret_value = 0; + ret_value = 0; return ret_value; -} +} /*--------------------------------------------------------------------------- * Name: h5garbage_collect_c * Purpose: Calls H5garbage_collect to collect on all free-lists of all types * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * Programmer: Elena Pourmal * Tuesday, September 24, 2002 * Modifications: *---------------------------------------------------------------------------*/ @@ -535,16 +535,16 @@ nh5garbage_collect_c() { int ret_value = -1; - if (H5garbage_collect() < 0) return ret_value; - ret_value = 0; + if (H5garbage_collect() < 0) return ret_value; + ret_value = 0; return ret_value; -} +} /*--------------------------------------------------------------------------- * Name: h5dont_atexit_c * Purpose: Calls H5dont_atexit not to install atexit cleanup routine * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * Programmer: Elena Pourmal * Tuesday, September 24, 2002 * Modifications: *---------------------------------------------------------------------------*/ @@ -553,7 +553,7 @@ nh5dont_atexit_c() { int ret_value = -1; - if (H5dont_atexit() < 0) return ret_value; - ret_value = 0; + if (H5dont_atexit() < 0) return ret_value; + ret_value = 0; return ret_value; -} +} diff --git a/fortran/src/H5f90.h b/fortran/src/H5f90.h index 864da1c..a9d15ae 100644 --- a/fortran/src/H5f90.h +++ b/fortran/src/H5f90.h @@ -14,7 +14,7 @@ #ifndef _H5f90_H -#define _H5f90_H +#define _H5f90_H #include "hdf5.h" #include "H5private.h" diff --git a/fortran/src/H5f90kit.c b/fortran/src/H5f90kit.c index a25645b..2cd9f7c 100644 --- a/fortran/src/H5f90kit.c +++ b/fortran/src/H5f90kit.c @@ -14,7 +14,7 @@ #include -#include +#include #include "H5f90.h" diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h index 38f6b53..5d972f9 100644 --- a/fortran/src/H5f90proto.h +++ b/fortran/src/H5f90proto.h @@ -236,14 +236,14 @@ H5_FCDLL int_f nh5awrite_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, v H5_FCDLL int_f nh5areadc_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims); H5_FCDLL int_f nh5aread_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); H5_FCDLL int_f nh5aclose_c ( hid_t_f *attr_id ); -H5_FCDLL int_f nh5adelete_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen); +H5_FCDLL int_f nh5adelete_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen); H5_FCDLL int_f nh5aopen_idx_c (hid_t_f *obj_id, int_f *idx, hid_t_f *attr_id); H5_FCDLL int_f nh5aget_space_c (hid_t_f *attr_id, hid_t_f *space_id); H5_FCDLL int_f nh5aget_type_c (hid_t_f *attr_id, hid_t_f *type_id); H5_FCDLL int_f nh5aget_num_attrs_c (hid_t_f *obj_id, int_f *attr_num); H5_FCDLL int_f nh5aget_name_c(hid_t_f *attr_id, size_t_f *size, _fcd buf); -/* +/* * Functions form H5Tf.c file */ # define nh5topen_c H5_FC_FUNC_(h5topen_c, H5TOPEN_C) @@ -361,7 +361,7 @@ H5_FCDLL int_f nh5tvlen_create_c ( hid_t_f *type_id , hid_t_f *vltype_id); H5_FCDLL int_f nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag ); H5_FCDLL int_f nh5tget_member_class_c ( hid_t_f *type_id , int_f *member_no, int_f *class ); -/* +/* * Functions from H5Pf.c */ # define nh5pcreate_c H5_FC_FUNC_(h5pcreate_c, H5PCREATE_C) @@ -463,7 +463,7 @@ H5_FCDLL int_f nh5tget_member_class_c ( hid_t_f *type_id , int_f *member_no, in # define nh5pset_fletcher32_c H5_FC_FUNC_(h5pset_fletcher32_c, H5PSET_FLETCHER32_C) # define nh5pset_edc_check_c H5_FC_FUNC_(h5pset_edc_check_c, H5PSET_EDC_CHECK_C) # define nh5pget_edc_check_c H5_FC_FUNC_(h5pget_edc_check_c, H5PGET_EDC_CHECK_C) -# define nh5pset_family_offset_c H5_FC_FUNC_(h5pset_family_offset_c, H5PSET_FAMILY_OFFSET_C) +# define nh5pset_family_offset_c H5_FC_FUNC_(h5pset_family_offset_c, H5PSET_FAMILY_OFFSET_C) # define nh5pget_fapl_multi_c H5_FC_FUNC_(h5pget_fapl_multi_c, H5PGET_FAPL_MULTI_C) # define nh5pset_fapl_multi_c H5_FC_FUNC_(h5pset_fapl_multi_c, H5PSET_FAPL_MULTI_C) # define nh5pset_fapl_multi_sc H5_FC_FUNC_(h5pset_fapl_multi_sc, H5PSET_FAPL_MULTI_SC) @@ -548,23 +548,23 @@ H5_FCDLL int_f nh5pget_small_data_block_size_c(hid_t_f *plist, hsize_t_f *size); H5_FCDLL int_f nh5pset_hyper_vector_size_c(hid_t_f *plist, size_t_f *size); H5_FCDLL int_f nh5pget_hyper_vector_size_c(hid_t_f *plist, size_t_f *size); H5_FCDLL int_f nh5pcreate_class_c(hid_t_f *parent, _fcd name, int_f *name_len, hid_t_f *class); -H5_FCDLL int_f nh5pregister_c(hid_t_f *class, _fcd name, int_f * name_len, size_t_f *size, void *value); -H5_FCDLL int_f nh5pregisterc_c(hid_t_f *class, _fcd name, int_f * name_len, size_t_f *size, _fcd value, int_f *value_len); -H5_FCDLL int_f nh5pinsert_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, void *value); -H5_FCDLL int_f nh5pinsertc_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, _fcd value, int_f *value_len); -H5_FCDLL int_f nh5pset_c(hid_t_f *prp_id, _fcd name, int_f *name_len, void *value); -H5_FCDLL int_f nh5psetc_c(hid_t_f *prp_id, _fcd name, int_f *name_len, _fcd value, int_f *value_len); -H5_FCDLL int_f nh5pget_c(hid_t_f *prp_id, _fcd name, int_f *name_len, void *value); +H5_FCDLL int_f nh5pregister_c(hid_t_f *class, _fcd name, int_f * name_len, size_t_f *size, void *value); +H5_FCDLL int_f nh5pregisterc_c(hid_t_f *class, _fcd name, int_f * name_len, size_t_f *size, _fcd value, int_f *value_len); +H5_FCDLL int_f nh5pinsert_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, void *value); +H5_FCDLL int_f nh5pinsertc_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, _fcd value, int_f *value_len); +H5_FCDLL int_f nh5pset_c(hid_t_f *prp_id, _fcd name, int_f *name_len, void *value); +H5_FCDLL int_f nh5psetc_c(hid_t_f *prp_id, _fcd name, int_f *name_len, _fcd value, int_f *value_len); +H5_FCDLL int_f nh5pget_c(hid_t_f *prp_id, _fcd name, int_f *name_len, void *value); H5_FCDLL int_f nh5pgetc_c(hid_t_f *prp_id, _fcd name, int_f *name_len, _fcd value, int_f *value_len); -H5_FCDLL int_f nh5pexist_c(hid_t_f *prp_id, _fcd name, int_f *name_len); -H5_FCDLL int_f nh5pget_size_c(hid_t_f *prp_id, _fcd name, int_f *name_len, size_t_f *size); -H5_FCDLL int_f nh5pget_nprops_c(hid_t_f *prp_id, size_t_f *nprops); -H5_FCDLL int_f nh5pget_class_parent_c(hid_t_f *prp_id, hid_t_f *parent_id); -H5_FCDLL int_f nh5pisa_class_c(hid_t_f *plist, hid_t_f *pclass); +H5_FCDLL int_f nh5pexist_c(hid_t_f *prp_id, _fcd name, int_f *name_len); +H5_FCDLL int_f nh5pget_size_c(hid_t_f *prp_id, _fcd name, int_f *name_len, size_t_f *size); +H5_FCDLL int_f nh5pget_nprops_c(hid_t_f *prp_id, size_t_f *nprops); +H5_FCDLL int_f nh5pget_class_parent_c(hid_t_f *prp_id, hid_t_f *parent_id); +H5_FCDLL int_f nh5pisa_class_c(hid_t_f *plist, hid_t_f *pclass); H5_FCDLL int_f nh5pcopy_prop_c(hid_t_f *dst_id, hid_t_f *src_id, _fcd name, int_f *name_len); -H5_FCDLL int_f nh5premove_c(hid_t_f *plid, _fcd name, int_f *name_len); +H5_FCDLL int_f nh5premove_c(hid_t_f *plid, _fcd name, int_f *name_len); H5_FCDLL int_f nh5punregister_c(hid_t_f *class, _fcd name, int_f *name_len); -H5_FCDLL int_f nh5pclose_class_c(hid_t_f * class); +H5_FCDLL int_f nh5pclose_class_c(hid_t_f * class); H5_FCDLL int_f nh5pget_class_name_c(hid_t_f *prp_id, _fcd name, int_f *name_len); H5_FCDLL int_f nh5pset_shuffle_c ( hid_t_f *prp_id); H5_FCDLL int_f nh5pset_fletcher32_c ( hid_t_f *prp_id ); @@ -575,11 +575,11 @@ H5_FCDLL int_f nh5pget_fapl_multi_c ( hid_t_f *prp_id , int_f *mem_map, hid_t_f H5_FCDLL int_f nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *mem_map, hid_t_f *memb_fapl, _fcd memb_name, int_f *len, int_f *lenmax, real_f *memb_addr, int_f *flag); H5_FCDLL int_f nh5pset_fapl_multi_sc ( hid_t_f *prp_id , int_f *flag); H5_FCDLL int_f nh5pset_szip_c ( hid_t_f *prp_id , int_f *options_mask, int_f *pixels_per_block); -H5_FCDLL int_f nh5pall_filters_avail_c ( hid_t_f *prp_id , int_f *status); +H5_FCDLL int_f nh5pall_filters_avail_c ( hid_t_f *prp_id , int_f *status); H5_FCDLL int_f nh5pfill_value_defined_c ( hid_t_f *prp_id , int_f *flag); /* - * Functions frome H5Rf.c + * Functions frome H5Rf.c */ # define nh5rcreate_object_c H5_FC_FUNC_(h5rcreate_object_c, H5RCREATE_OBJECT_C) # define nh5rcreate_region_c H5_FC_FUNC_(h5rcreate_region_c, H5RCREATE_REGION_C) @@ -614,7 +614,7 @@ H5_FCDLL int_f nh5iget_ref_c(hid_t_f *obj_id, int_f *ref_count); H5_FCDLL int_f nh5iget_file_id_c(hid_t_f *obj_id, hid_t_f *file_id); /* - * Functions from H5Ef.c + * Functions from H5Ef.c */ # define nh5eclear_c H5_FC_FUNC_(h5eclear_c, H5ECLEAR_C) # define nh5eprint_c1 H5_FC_FUNC_(h5eprint_c1, H5EPRINT_C1) @@ -632,7 +632,7 @@ H5_FCDLL int_f nh5eget_minor_c(int_f* error_no, _fcd name, size_t_f* namelen); H5_FCDLL int_f nh5eset_auto_c(int_f* printflag); /* - * Functions from H5f.c + * Functions from H5f.c */ # define nh5open_c H5_FC_FUNC_(h5open_c, H5OPEN_C) # define nh5close_c H5_FC_FUNC_(h5close_c, H5CLOSE_C) @@ -654,8 +654,8 @@ H5_FCDLL int_f nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags, int_f *h5fd_flags, hid_t_f *h5fd_hid_flags, int_f *h5g_flags, int_f *h5i_flags, hid_t_f *h5p_flags, int_f *h5r_flags, int_f *h5s_flags, - int_f *h5t_flags, int_f *h5z_flags); -H5_FCDLL int_f nh5init1_flags_c(int_f *h5lib_flags); + int_f *h5t_flags, int_f *h5z_flags); +H5_FCDLL int_f nh5init1_flags_c(int_f *h5lib_flags); H5_FCDLL int_f nh5get_libversion_c(int_f *majnum, int_f *minnum, int_f *relnum); H5_FCDLL int_f nh5check_version_c(int_f *majnum, int_f *minnum, int_f *relnum); H5_FCDLL int_f nh5garbage_collect_c(void); diff --git a/fortran/src/H5match_types.c b/fortran/src/H5match_types.c index 2edc813..2c11a29 100644 --- a/fortran/src/H5match_types.c +++ b/fortran/src/H5match_types.c @@ -221,13 +221,13 @@ int main() #endif /* int */ -#if defined H5_FORTRAN_HAS_NATIVE_8 +#if defined H5_FORTRAN_HAS_NATIVE_8 writeToFiles("INT", "int_f", 8); -#elif defined H5_FORTRAN_HAS_NATIVE_4 +#elif defined H5_FORTRAN_HAS_NATIVE_4 writeToFiles("INT", "int_f", 4); -#elif defined H5_FORTRAN_HAS_NATIVE_2 +#elif defined H5_FORTRAN_HAS_NATIVE_2 writeToFiles("INT", "int_f", 2); -#elif defined H5_FORTRAN_HAS_NATIVE_1 +#elif defined H5_FORTRAN_HAS_NATIVE_1 writeToFiles("INT", "int_f", 1); #else /* Error: couldn't find a size for int */ diff --git a/fortran/test/t.c b/fortran/test/t.c index 3b51add..cb71fd2 100644 --- a/fortran/test/t.c +++ b/fortran/test/t.c @@ -17,9 +17,9 @@ /*---------------------------------------------------------------------------- * Name: h5_fixname_c * Purpose: Call h5_fixname to modify file name - * Inputs: base_name - name of the file + * Inputs: base_name - name of the file * base_namelen - name length - * fapl - file access property list + * fapl - file access property list * full_name - buffer to return full name * full_namelen - name length * Returns: 0 on success, -1 on failure @@ -42,7 +42,7 @@ nh5_fixname_c(_fcd base_name, size_t_f *base_namelen, hid_t_f* fapl, _fcd full_n /* * Convert FORTRAN name to C name */ - c_base_name = (char *)HD5f2cstring(base_name, (size_t)*base_namelen); + c_base_name = (char *)HD5f2cstring(base_name, (size_t)*base_namelen); if (c_base_name == NULL) goto DONE; c_full_name = (char *) HDmalloc((size_t)*full_namelen + 1); if (c_full_name == NULL) goto DONE; @@ -51,7 +51,7 @@ nh5_fixname_c(_fcd base_name, size_t_f *base_namelen, hid_t_f* fapl, _fcd full_n * Call h5_fixname function. */ if (NULL != h5_fixname(c_base_name, c_fapl, c_full_name, (size_t)*full_namelen + 1)) { - HD5packFstring(c_full_name, _fcdtocp(full_name), (size_t)*full_namelen); + HD5packFstring(c_full_name, _fcdtocp(full_name), (size_t)*full_namelen); ret_value = 0; goto DONE; } @@ -59,15 +59,15 @@ nh5_fixname_c(_fcd base_name, size_t_f *base_namelen, hid_t_f* fapl, _fcd full_n DONE: if (NULL != c_base_name) HDfree(c_base_name); if (NULL != c_full_name) HDfree(c_full_name); - return ret_value; -} + return ret_value; +} /*---------------------------------------------------------------------------- * Name: h5_cleanup_c * Purpose: Call h5_cleanup to clean temporary files. - * Inputs: base_name - name of the file + * Inputs: base_name - name of the file * base_namelen - name length - * fapl - file access property list + * fapl - file access property list * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Thursday, September 19, 2002 @@ -89,7 +89,7 @@ nh5_cleanup_c(_fcd base_name, size_t_f *base_namelen, hid_t_f* fapl) /* * Convert FORTRAN name to C name */ - c_base_name[0] = (char *)HD5f2cstring(base_name, (size_t)*base_namelen); + c_base_name[0] = (char *)HD5f2cstring(base_name, (size_t)*base_namelen); if (c_base_name[0] == NULL) goto DONE; /* @@ -100,19 +100,19 @@ nh5_cleanup_c(_fcd base_name, size_t_f *base_namelen, hid_t_f* fapl) goto DONE; } */ - h5_fixname(c_base_name[0], c_fapl, filename, sizeof(filename)); + h5_fixname(c_base_name[0], c_fapl, filename, sizeof(filename)); HDremove(filename); ret_value =0; DONE: if (NULL != c_base_name[0]) HDfree(c_base_name[0]); - return ret_value; - -} + return ret_value; + +} /*---------------------------------------------------------------------------- * Name: h5_exit_c - * Purpose: Call 'exit()' to terminate application. Be careful not to + * Purpose: Call 'exit()' to terminate application. Be careful not to * overflow the exit value range since UNIX supports a very * small range such as 1 byte. Therefore, exit(256) may end * up as exit(0). diff --git a/fortran/test/t.h b/fortran/test/t.h index d66f882..79c6d4b 100644 --- a/fortran/test/t.h +++ b/fortran/test/t.h @@ -26,12 +26,12 @@ char *h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) # define nh5_cleanup_c H5_FC_FUNC_(h5_cleanup_c, H5_CLEANUP_C) # define nh5_exit_c H5_FC_FUNC_(h5_exit_c, H5_EXIT_C) -H5_FCTESTDLL int_f nh5_fixname_c +H5_FCTESTDLL int_f nh5_fixname_c (_fcd base_name, size_t_f *base_namelen, hid_t_f *fapl, _fcd full_name, size_t_f *full_namelen); -H5_FCTESTDLL int_f nh5_cleanup_c +H5_FCTESTDLL int_f nh5_cleanup_c (_fcd base_name, size_t_f *base_namelen, hid_t_f *fapl); -H5_FCTESTDLL void nh5_exit_c +H5_FCTESTDLL void nh5_exit_c (int_f *status); diff --git a/hl/c++/src/H5PacketTable.cpp b/hl/c++/src/H5PacketTable.cpp index 3f77d8f..010d1a1 100644 --- a/hl/c++/src/H5PacketTable.cpp +++ b/hl/c++/src/H5PacketTable.cpp @@ -30,7 +30,7 @@ } /* IsValid - * Returns true if this packet table is valid, false otherwise. + * Returns true if this packet table is valid, false otherwise. * Use this after the constructor to ensure HDF did not have * any trouble making or opening the packet table. */ @@ -89,7 +89,7 @@ /* Constructor * Creates a packet table in which to store fixed length records. * Takes the ID of the file the packet table will be created in, the name of - * the packet table, the ID of the datatype of the set, and the size + * the packet table, the ID of the datatype of the set, and the size * of a memory chunk used in chunking. */ FL_PacketTable::FL_PacketTable(hid_t fileID, char* name, hid_t dtypeID, int chunkSize) @@ -177,7 +177,7 @@ { return H5PTget_next(table_id, numRecords, data); } - + /********************************/ /* Variable-Length Packet Table */ diff --git a/hl/c++/src/H5PacketTable.h b/hl/c++/src/H5PacketTable.h index 1d6ba31..1e0e4c6 100644 --- a/hl/c++/src/H5PacketTable.h +++ b/hl/c++/src/H5PacketTable.h @@ -31,7 +31,7 @@ public: ~PacketTable(); /* IsValid - * Returns true if this packet table is valid, false otherwise. + * Returns true if this packet table is valid, false otherwise. * Use this after the constructor to ensure HDF did not have * any trouble making or opening the packet table. */ @@ -78,7 +78,7 @@ public: /* Constructor * Creates a packet table in which to store fixed length records. * Takes the ID of the file the packet table will be created in, the name of - * the packet table, the ID of the datatype of the set, and the size + * the packet table, the ID of the datatype of the set, and the size * of a memory chunk used in chunking. */ FL_PacketTable(hid_t fileID, char* name, hid_t dtypeID, int chunkSize); diff --git a/hl/c++/test/ptableTest.cpp b/hl/c++/test/ptableTest.cpp index 9dc2bffe..f2db380 100644 --- a/hl/c++/test/ptableTest.cpp +++ b/hl/c++/test/ptableTest.cpp @@ -84,7 +84,7 @@ int BasicTest() wrapper.AppendPacket(&myRecord); /* get number of records test */ - count = wrapper.GetPacketCount(); + count = wrapper.GetPacketCount(); if(count != 2) goto out; @@ -374,7 +374,7 @@ int SystemTest() hid_t dtypeID1, dtypeID2; unsigned int count; - /* Creating two inter-related datatypes. Create two datasets and put + /* Creating two inter-related datatypes. Create two datasets and put * one datatype in each. */ typedef struct compoundType { diff --git a/hl/fortran/src/H5IMcc.c b/hl/fortran/src/H5IMcc.c index 192d58a..0ff802d 100644 --- a/hl/fortran/src/H5IMcc.c +++ b/hl/fortran/src/H5IMcc.c @@ -22,7 +22,7 @@ * private functions *------------------------------------------------------------------------- */ -herr_t H5IM_get_palette( hid_t loc_id, +herr_t H5IM_get_palette( hid_t loc_id, const char *image_name, int pal_number, hid_t tid, @@ -49,8 +49,8 @@ herr_t H5IM_get_palette( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5IMmake_image_8bitf( hid_t loc_id, - const char *dset_name, +herr_t H5IMmake_image_8bitf( hid_t loc_id, + const char *dset_name, hsize_t width, hsize_t height, int_f *buf ) @@ -58,17 +58,17 @@ herr_t H5IMmake_image_8bitf( hid_t loc_id, hid_t did; /* dataset ID */ hid_t sid; /* space ID */ hsize_t dims[IMAGE8_RANK]; /* dimensions */ - + /* initialize the image dimensions */ - dims[0] = height; - dims[1] = width; - dims[2] = 1; + dims[0] = height; + dims[1] = width; + dims[2] = 1; /*------------------------------------------------------------------------- * create and write the dataset *------------------------------------------------------------------------- */ - + /* create the data space for the dataset. */ if ((sid=H5Screate_simple(IMAGE8_RANK,dims,NULL))<0) return -1; @@ -80,7 +80,7 @@ herr_t H5IMmake_image_8bitf( hid_t loc_id, /* write with memory type H5T_NATIVE_INT */ /* Use long type if Fortran integer is 8 bytes and C long long is also 8 bytes*/ /* Fail if otherwise */ - if (buf) + if (buf) { if (sizeof(int_f) == sizeof(int)) { if (H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0) @@ -105,7 +105,7 @@ herr_t H5IMmake_image_8bitf( hid_t loc_id, * attach the specification attributes *------------------------------------------------------------------------- */ - + /* attach the CLASS attribute */ if ( H5LTset_attribute_string( loc_id, dset_name, "CLASS", IMAGE_CLASS ) < 0 ) return -1; @@ -139,9 +139,9 @@ herr_t H5IMmake_image_8bitf( hid_t loc_id, * The memory datatype is H5T_NATIVE_INT. It is supposed to be called from * the FORTRAN interface where the image buffer is defined as type "integer" * - * Interlace Mode Dimensions in the Dataspace - * INTERLACE_PIXEL [height][width][pixel components] - * INTERLACE_PLANE [pixel components][height][width] + * Interlace Mode Dimensions in the Dataspace + * INTERLACE_PIXEL [height][width][pixel components] + * INTERLACE_PLANE [pixel components][height][width] * * * Modifications: @@ -149,8 +149,8 @@ herr_t H5IMmake_image_8bitf( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5IMmake_image_24bitf( hid_t loc_id, - const char *dset_name, +herr_t H5IMmake_image_24bitf( hid_t loc_id, + const char *dset_name, hsize_t width, hsize_t height, const char *interlace, @@ -164,28 +164,28 @@ herr_t H5IMmake_image_24bitf( hid_t loc_id, * attach the image dimensions according to the interlace mode *------------------------------------------------------------------------- */ - if ( strcmp( interlace, "INTERLACE_PIXEL" ) == 0 ) + if ( strcmp( interlace, "INTERLACE_PIXEL" ) == 0 ) { /* Number of color planes is defined as the third dimension */ - dims[0] = height; - dims[1] = width; - dims[2] = IMAGE24_RANK; + dims[0] = height; + dims[1] = width; + dims[2] = IMAGE24_RANK; } else - if ( strcmp( interlace, "INTERLACE_PLANE" ) == 0 ) + if ( strcmp( interlace, "INTERLACE_PLANE" ) == 0 ) { /* Number of color planes is defined as the first dimension */ - dims[0] = IMAGE24_RANK; - dims[1] = height; - dims[2] = width; + dims[0] = IMAGE24_RANK; + dims[1] = height; + dims[2] = width; } else return -1; - + /*------------------------------------------------------------------------- * create and write the dataset *------------------------------------------------------------------------- */ - + /* create the data space for the dataset. */ if ((sid=H5Screate_simple(IMAGE24_RANK,dims,NULL))<0) return -1; @@ -195,7 +195,7 @@ herr_t H5IMmake_image_24bitf( hid_t loc_id, return -1; /* write with memory type H5T_NATIVE_INT */ - if (buf) + if (buf) { if (sizeof(int_f) == sizeof(int)) { if (H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0) @@ -263,11 +263,11 @@ herr_t H5IMmake_image_24bitf( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5IMread_imagef( hid_t loc_id, - const char *dset_name, +herr_t H5IMread_imagef( hid_t loc_id, + const char *dset_name, int_f *buf ) { - hid_t did; + hid_t did; /* open the dataset */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) @@ -314,7 +314,7 @@ out: * The memory datatype is H5T_NATIVE_INT. It is supposed to be called from * the FORTRAN interface where the image buffer is defined as type "integer" * - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: @@ -322,20 +322,20 @@ out: *------------------------------------------------------------------------- */ -herr_t H5IMmake_palettef( hid_t loc_id, +herr_t H5IMmake_palettef( hid_t loc_id, const char *pal_name, const hsize_t *pal_dims, - int_f *pal_data ) + int_f *pal_data ) + +{ -{ - hid_t did; /* dataset ID */ hid_t sid; /* space ID */ int has_pal; - + /* Check if the dataset already exists */ has_pal = H5LTfind_dataset( loc_id, pal_name ); - + /* It exists. Return */ if ( has_pal == 1 ) return 0; @@ -344,7 +344,7 @@ herr_t H5IMmake_palettef( hid_t loc_id, * create and write the dataset *------------------------------------------------------------------------- */ - + /* create the data space for the dataset. */ if ((sid=H5Screate_simple(2,pal_dims,NULL))<0) return -1; @@ -354,7 +354,7 @@ herr_t H5IMmake_palettef( hid_t loc_id, return -1; /* write with memory type H5T_NATIVE_INT */ - if (pal_data) + if (pal_data) { if (sizeof(int_f) == sizeof(int)) { if (H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,pal_data)<0) @@ -387,7 +387,7 @@ herr_t H5IMmake_palettef( hid_t loc_id, /* Attach the attribute "PAL_VERSION" to the >>palette<< dataset*/ if ( H5LTset_attribute_string( loc_id, pal_name, "PAL_VERSION", "1.2" ) < 0 ) return -1; - + return 0; } @@ -409,7 +409,7 @@ herr_t H5IMmake_palettef( hid_t loc_id, * The memory datatype is H5T_NATIVE_INT. It is supposed to be called from * the FORTRAN interface where the image buffer is defined as type "integer" * - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: @@ -417,7 +417,7 @@ herr_t H5IMmake_palettef( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5IMget_palettef( hid_t loc_id, +herr_t H5IMget_palettef( hid_t loc_id, const char *image_name, int pal_number, int_f *pal_data ) @@ -447,19 +447,19 @@ herr_t H5IMget_palettef( hid_t loc_id, * Comments: * This function allows reading of an 8bit palette from disk disk * to memory type TID - * The memory datatype can be H5T_NATIVE_INT or H5T_NATIVE_UCHAR currently. + * The memory datatype can be H5T_NATIVE_INT or H5T_NATIVE_UCHAR currently. * the H5T_NATIVE_INT is supposed to be called from * the FORTRAN interface where the image buffer is defined as type "integer" * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: * *------------------------------------------------------------------------- */ -herr_t H5IM_get_palette( hid_t loc_id, +herr_t H5IM_get_palette( hid_t loc_id, const char *image_name, int pal_number, hid_t tid, @@ -488,7 +488,7 @@ herr_t H5IM_get_palette( hid_t loc_id, if ( (attr_id = H5Aopen_name( image_id, "PALETTE" )) < 0 ) goto out; - + if ( (attr_type = H5Aget_type( attr_id )) < 0 ) goto out; @@ -528,13 +528,13 @@ herr_t H5IM_get_palette( hid_t loc_id, goto out; free( refbuf ); - - } /* H5T_REFERENCE */ - - if ( H5Tclose( attr_type ) < 0 ) + + } /* H5T_REFERENCE */ + + if ( H5Tclose( attr_type ) < 0 ) goto out; - /* Close the attribute. */ + /* Close the attribute. */ if ( H5Aclose( attr_id ) < 0 ) goto out; diff --git a/hl/fortran/src/H5IMcc.h b/hl/fortran/src/H5IMcc.h index 32c79ff..d568d73 100644 --- a/hl/fortran/src/H5IMcc.h +++ b/hl/fortran/src/H5IMcc.h @@ -31,29 +31,29 @@ extern "C" { -herr_t H5IMmake_image_8bitf( hid_t loc_id, - const char *dset_name, +herr_t H5IMmake_image_8bitf( hid_t loc_id, + const char *dset_name, hsize_t width, hsize_t height, int_f *buf ); -herr_t H5IMmake_image_24bitf( hid_t loc_id, - const char *dset_name, +herr_t H5IMmake_image_24bitf( hid_t loc_id, + const char *dset_name, hsize_t width, hsize_t height, const char *interlace, int_f *buf); -herr_t H5IMread_imagef( hid_t loc_id, - const char *dset_name, +herr_t H5IMread_imagef( hid_t loc_id, + const char *dset_name, int_f *buf ); -herr_t H5IMmake_palettef( hid_t loc_id, +herr_t H5IMmake_palettef( hid_t loc_id, const char *pal_name, const hsize_t *pal_dims, int_f *pal_data ); -herr_t H5IMget_palettef( hid_t loc_id, +herr_t H5IMget_palettef( hid_t loc_id, const char *image_name, int pal_number, int_f *pal_data ); diff --git a/hl/fortran/src/H5IMfc.c b/hl/fortran/src/H5IMfc.c index 7d09f10..822dbe6 100755 --- a/hl/fortran/src/H5IMfc.c +++ b/hl/fortran/src/H5IMfc.c @@ -22,7 +22,7 @@ /*------------------------------------------------------------------------- * Function: h5immake_image_8bit_c * - * Purpose: Call H5IMmake_image_8bit + * Purpose: Call H5IMmake_image_8bit * * Return: Success: 0, Failure: -1 * @@ -39,11 +39,11 @@ */ int_f -nh5immake_image_8bit_c (hid_t_f *loc_id, +nh5immake_image_8bit_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, hsize_t_f *width, - hsize_t_f *height, + hsize_t_f *height, int_f *buf) { int ret_value = -1; @@ -56,7 +56,7 @@ nh5immake_image_8bit_c (hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = (int)*namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -68,12 +68,12 @@ nh5immake_image_8bit_c (hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: h5imread_image_c * - * Purpose: Call H5IMread_image + * Purpose: Call H5IMread_image * * Return: Success: 0, Failure: -1 * @@ -90,9 +90,9 @@ nh5immake_image_8bit_c (hid_t_f *loc_id, */ int_f -nh5imread_image_c (hid_t_f *loc_id, +nh5imread_image_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, int_f *buf) { int ret_value = -1; @@ -106,7 +106,7 @@ nh5imread_image_c (hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = (int)*namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -119,12 +119,12 @@ nh5imread_image_c (hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: h5immake_image_24bit_c * - * Purpose: Call H5IMmake_image_24bit + * Purpose: Call H5IMmake_image_24bit * * Return: Success: 0, Failure: -1 * @@ -141,11 +141,11 @@ nh5imread_image_c (hid_t_f *loc_id, */ int_f -nh5immake_image_24bit_c (hid_t_f *loc_id, +nh5immake_image_24bit_c (hid_t_f *loc_id, int_f *namelen, _fcd name, int_f *ilen, - _fcd il, + _fcd il, hsize_t_f *width, hsize_t_f *height, void *buf) @@ -162,11 +162,11 @@ nh5immake_image_24bit_c (hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; c_ilen = *ilen; - c_il = (char *)HD5f2cstring(il, c_ilen); + c_il = (char *)HD5f2cstring(il, c_ilen); if (c_il == NULL) return ret_value; /* @@ -179,12 +179,12 @@ nh5immake_image_24bit_c (hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: h5imget_image_info_c * - * Purpose: Call H5IMget_image_info + * Purpose: Call H5IMget_image_info * * Return: Success: 0, Failure: -1 * @@ -201,7 +201,7 @@ nh5immake_image_24bit_c (hid_t_f *loc_id, */ int_f -nh5imget_image_info_c(hid_t_f *loc_id, +nh5imget_image_info_c(hid_t_f *loc_id, int_f *namelen, _fcd name, hsize_t_f *width, @@ -226,7 +226,7 @@ nh5imget_image_info_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -239,14 +239,14 @@ nh5imget_image_info_c(hid_t_f *loc_id, * Call H5IMget_image_info function. */ c_loc_id = (hid_t)*loc_id; - + ret = H5IMget_image_info(c_loc_id,c_name,&c_width,&c_height,&c_planes,c_buf,&c_npals); *width = (hsize_t_f) c_width; *height = (hsize_t_f) c_height; *planes = (hsize_t_f) c_planes; *npals = (hsize_t_f) c_npals; - + /* * Convert C name to FORTRAN and place it in the given buffer @@ -254,11 +254,11 @@ nh5imget_image_info_c(hid_t_f *loc_id, HD5packFstring(c_buf, _fcdtocp(interlace), (size_t)*ilen); if(c_buf) free(c_buf); - + if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- @@ -281,7 +281,7 @@ nh5imget_image_info_c(hid_t_f *loc_id, */ int_f -nh5imis_image_c(hid_t_f *loc_id, +nh5imis_image_c(hid_t_f *loc_id, int_f *namelen, _fcd name) { @@ -293,7 +293,7 @@ nh5imis_image_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return -1; /* @@ -302,14 +302,14 @@ nh5imis_image_c(hid_t_f *loc_id, c_loc_id = (hid_t)*loc_id; return( H5IMis_image(c_loc_id, c_name)); - -} + +} /*------------------------------------------------------------------------- * Function: h5immake_palette_c * - * Purpose: Call H5IMmake_palette + * Purpose: Call H5IMmake_palette * * Return: Success: 0, Failure: -1 * @@ -326,9 +326,9 @@ nh5imis_image_c(hid_t_f *loc_id, */ int_f -nh5immake_palette_c (hid_t_f *loc_id, +nh5immake_palette_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, hsize_t_f *dims, void *buf) { @@ -345,7 +345,7 @@ nh5immake_palette_c (hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; c_dims = malloc(sizeof(hsize_t) * (rank )); @@ -367,13 +367,13 @@ nh5immake_palette_c (hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: h5imlink_palette_c * - * Purpose: Call H5IMlink_palette + * Purpose: Call H5IMlink_palette * * Return: Success: 0, Failure: -1 * @@ -390,9 +390,9 @@ nh5immake_palette_c (hid_t_f *loc_id, */ int_f -nh5imlink_palette_c (hid_t_f *loc_id, +nh5imlink_palette_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, int_f *ilen, _fcd pal_name) { @@ -409,11 +409,11 @@ nh5imlink_palette_c (hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; c_namelenpal = *ilen; - c_namepal = (char *)HD5f2cstring(pal_name, c_namelenpal); + c_namepal = (char *)HD5f2cstring(pal_name, c_namelenpal); if (c_namepal == NULL) return ret_value; /* @@ -427,13 +427,13 @@ nh5imlink_palette_c (hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: h5imunlink_palette_c * - * Purpose: Call H5IMunlink_palette + * Purpose: Call H5IMunlink_palette * * Return: Success: 0, Failure: -1 * @@ -450,9 +450,9 @@ nh5imlink_palette_c (hid_t_f *loc_id, */ int_f -nh5imunlink_palette_c (hid_t_f *loc_id, +nh5imunlink_palette_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, int_f *ilen, _fcd pal_name) { @@ -469,11 +469,11 @@ nh5imunlink_palette_c (hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; c_namelenpal = *ilen; - c_namepal = (char *)HD5f2cstring(pal_name, c_namelenpal); + c_namepal = (char *)HD5f2cstring(pal_name, c_namelenpal); if (c_namepal == NULL) return ret_value; /* @@ -487,14 +487,14 @@ nh5imunlink_palette_c (hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} - +} + /*------------------------------------------------------------------------- * Function: h5imget_npalettes_c * - * Purpose: Call H5IMget_npalettes + * Purpose: Call H5IMget_npalettes * * Return: Success: 0, Failure: -1 * @@ -511,7 +511,7 @@ nh5imunlink_palette_c (hid_t_f *loc_id, */ int_f -nh5imget_npalettes_c(hid_t_f *loc_id, +nh5imget_npalettes_c(hid_t_f *loc_id, int_f *namelen, _fcd name, hsize_t_f *npals) @@ -527,7 +527,7 @@ nh5imget_npalettes_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -538,18 +538,18 @@ nh5imget_npalettes_c(hid_t_f *loc_id, ret = H5IMget_npalettes(c_loc_id,c_name,&c_npals); *npals = (hsize_t_f) c_npals; - + if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: h5imget_palette_info_c * - * Purpose: Call H5IMget_palette_info + * Purpose: Call H5IMget_palette_info * * Return: Success: 0, Failure: -1 * @@ -567,7 +567,7 @@ nh5imget_npalettes_c(hid_t_f *loc_id, int_f -nh5imget_palette_info_c(hid_t_f *loc_id, +nh5imget_palette_info_c(hid_t_f *loc_id, int_f *namelen, _fcd name, int_f *pal_number, @@ -585,7 +585,7 @@ nh5imget_palette_info_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -599,17 +599,17 @@ nh5imget_palette_info_c(hid_t_f *loc_id, dims[i] = (hsize_t_f) c_dims[i]; } - + if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: h5imget_palette_c * - * Purpose: Call H5IMget_palette + * Purpose: Call H5IMget_palette * * Return: Success: 0, Failure: -1 * @@ -627,7 +627,7 @@ nh5imget_palette_info_c(hid_t_f *loc_id, int_f -nh5imget_palette_c(hid_t_f *loc_id, +nh5imget_palette_c(hid_t_f *loc_id, int_f *namelen, _fcd name, int_f *pal_number, @@ -643,7 +643,7 @@ nh5imget_palette_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -652,13 +652,13 @@ nh5imget_palette_c(hid_t_f *loc_id, c_loc_id = (hid_t)*loc_id; ret = H5IMget_palettef(c_loc_id,c_name,*pal_number,buf); - + if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} + - /*------------------------------------------------------------------------- * Function: h5imis_palette_c * @@ -679,7 +679,7 @@ nh5imget_palette_c(hid_t_f *loc_id, */ int_f -nh5imis_palette_c(hid_t_f *loc_id, +nh5imis_palette_c(hid_t_f *loc_id, int_f *namelen, _fcd name) { @@ -691,7 +691,7 @@ nh5imis_palette_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return -1; /* @@ -700,5 +700,5 @@ nh5imis_palette_c(hid_t_f *loc_id, c_loc_id = (hid_t)*loc_id; return( H5IMis_palette(c_loc_id, c_name)); - -} + +} diff --git a/hl/fortran/src/H5LTf90proto.h b/hl/fortran/src/H5LTf90proto.h index cae95cf..81c30a4 100755 --- a/hl/fortran/src/H5LTf90proto.h +++ b/hl/fortran/src/H5LTf90proto.h @@ -18,7 +18,7 @@ #include "H5public.h" #include "H5f90i.h" -#include +#include #include @@ -82,118 +82,118 @@ H5_DLL void HD5packFstring (char *src, char *dest, size_t len); # define nh5tbget_table_info_c H5_FC_FUNC_(h5tbget_table_info_c, H5TBGET_TABLE_INFO_C) # define nh5tbget_field_info_c H5_FC_FUNC_(h5tbget_field_info_c, H5TBGET_FIELD_INFO_C) -H5_DLL +H5_DLL int_f -nh5ltmake_dataset_c (hid_t_f *loc_id, +nh5ltmake_dataset_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, - int_f *rank, + _fcd name, + int_f *rank, hsize_t_f *dims, - hid_t_f *type_id, + hid_t_f *type_id, void *buf); -H5_DLL +H5_DLL int_f -nh5ltread_dataset_c (hid_t_f *loc_id, +nh5ltread_dataset_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, - hid_t_f *type_id, + _fcd name, + hid_t_f *type_id, void *buf, hsize_t_f *dims); H5_DLL int_f -nh5ltset_attribute_int_c(hid_t_f *loc_id, +nh5ltset_attribute_int_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, size_t_f *size, void *buf); H5_DLL int_f -nh5ltset_attribute_float_c(hid_t_f *loc_id, +nh5ltset_attribute_float_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, size_t_f *size, void *buf); H5_DLL int_f -nh5ltset_attribute_double_c(hid_t_f *loc_id, +nh5ltset_attribute_double_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, size_t_f *size, void *buf); H5_DLL int_f -nh5ltset_attribute_string_c(hid_t_f *loc_id, +nh5ltset_attribute_string_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, void *buf); H5_DLL int_f -nh5ltget_attribute_int_c(hid_t_f *loc_id, +nh5ltget_attribute_int_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, void *buf); H5_DLL int_f -nh5ltget_attribute_float_c(hid_t_f *loc_id, +nh5ltget_attribute_float_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, void *buf); H5_DLL int_f -nh5ltget_attribute_double_c(hid_t_f *loc_id, +nh5ltget_attribute_double_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, void *buf); H5_DLL int_f -nh5ltget_attribute_string_c(hid_t_f *loc_id, +nh5ltget_attribute_string_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, void *buf); H5_DLL int_f -nh5ltget_dataset_ndims_c(hid_t_f *loc_id, +nh5ltget_dataset_ndims_c(hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, int_f *rank); H5_DLL int_f -nh5ltfind_dataset_c(hid_t_f *loc_id, +nh5ltfind_dataset_c(hid_t_f *loc_id, int_f *namelen, _fcd name); H5_DLL int_f -nh5ltget_dataset_info_c(hid_t_f *loc_id, +nh5ltget_dataset_info_c(hid_t_f *loc_id, int_f *namelen, _fcd name, hsize_t_f *dims, @@ -202,35 +202,35 @@ nh5ltget_dataset_info_c(hid_t_f *loc_id, H5_DLL int_f -nh5ltget_attribute_ndims_c(hid_t_f *loc_id, +nh5ltget_attribute_ndims_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, int_f *rank); H5_DLL int_f -nh5ltget_attribute_info_c(hid_t_f *loc_id, +nh5ltget_attribute_info_c(hid_t_f *loc_id, int_f *namelen, _fcd name, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, hsize_t_f *dims, int_f *type_class, size_t_f *type_size); H5_DLL int_f -nh5ltmake_dataset_string_c (hid_t_f *loc_id, +nh5ltmake_dataset_string_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, char *buf); H5_DLL int_f -nh5ltread_dataset_string_c (hid_t_f *loc_id, +nh5ltread_dataset_string_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, char *buf); /*------------------------------------------------------------------------- @@ -240,32 +240,32 @@ nh5ltread_dataset_string_c (hid_t_f *loc_id, H5_DLL int_f -nh5immake_image_8bit_c (hid_t_f *loc_id, +nh5immake_image_8bit_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, hsize_t_f *width, - hsize_t_f *height, + hsize_t_f *height, int_f *buf); H5_DLL int_f -nh5imread_image_c (hid_t_f *loc_id, +nh5imread_image_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, int_f *buf); H5_DLL int_f -nh5immake_image_24bit_c (hid_t_f *loc_id, +nh5immake_image_24bit_c (hid_t_f *loc_id, int_f *namelen, _fcd name, int_f *ilen, - _fcd il, + _fcd il, hsize_t_f *width, hsize_t_f *height, void *buf); H5_DLL int_f -nh5imget_image_info_c(hid_t_f *loc_id, +nh5imget_image_info_c(hid_t_f *loc_id, int_f *namelen, _fcd name, hsize_t_f *width, @@ -278,38 +278,38 @@ nh5imget_image_info_c(hid_t_f *loc_id, H5_DLL int_f -nh5imis_image_c(hid_t_f *loc_id, +nh5imis_image_c(hid_t_f *loc_id, int_f *namelen, _fcd name); H5_DLL int_f -nh5immake_palette_c (hid_t_f *loc_id, +nh5immake_palette_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, hsize_t_f *dims, void *buf); H5_DLL int_f -nh5imlink_palette_c (hid_t_f *loc_id, +nh5imlink_palette_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, int_f *ilen, _fcd pal_name); H5_DLL int_f -nh5imunlink_palette_c (hid_t_f *loc_id, +nh5imunlink_palette_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, int_f *ilen, _fcd pal_name); H5_DLL int_f -nh5imget_npalettes_c(hid_t_f *loc_id, +nh5imget_npalettes_c(hid_t_f *loc_id, int_f *namelen, _fcd name, hsize_t_f *npals); @@ -317,7 +317,7 @@ nh5imget_npalettes_c(hid_t_f *loc_id, H5_DLL int_f -nh5imget_palette_info_c(hid_t_f *loc_id, +nh5imget_palette_info_c(hid_t_f *loc_id, int_f *namelen, _fcd name, int_f *pal_number, @@ -325,7 +325,7 @@ nh5imget_palette_info_c(hid_t_f *loc_id, H5_DLL int_f -nh5imget_palette_c(hid_t_f *loc_id, +nh5imget_palette_c(hid_t_f *loc_id, int_f *namelen, _fcd name, int_f *pal_number, @@ -333,7 +333,7 @@ nh5imget_palette_c(hid_t_f *loc_id, H5_DLL int_f -nh5imis_palette_c(hid_t_f *loc_id, +nh5imis_palette_c(hid_t_f *loc_id, int_f *namelen, _fcd name); @@ -348,9 +348,9 @@ H5_DLL int_f nh5tbmake_table_c(int_f *namelen1, _fcd name1, - hid_t_f *loc_id, + hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, hsize_t_f *nfields, hsize_t_f *nrecords, size_t_f *type_size, @@ -363,9 +363,9 @@ nh5tbmake_table_c(int_f *namelen1, H5_DLL int_f -nh5tbwrite_field_name_c(hid_t_f *loc_id, +nh5tbwrite_field_name_c(hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, int_f *namelen1, _fcd field_name, hsize_t_f *start, @@ -375,9 +375,9 @@ nh5tbwrite_field_name_c(hid_t_f *loc_id, H5_DLL int_f -nh5tbread_field_name_c(hid_t_f *loc_id, +nh5tbread_field_name_c(hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, int_f *namelen1, _fcd field_name, hsize_t_f *start, @@ -387,9 +387,9 @@ nh5tbread_field_name_c(hid_t_f *loc_id, H5_DLL int_f -nh5tbwrite_field_index_c(hid_t_f *loc_id, +nh5tbwrite_field_index_c(hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, int_f *field_index, hsize_t_f *start, hsize_t_f *nrecords, @@ -398,9 +398,9 @@ nh5tbwrite_field_index_c(hid_t_f *loc_id, H5_DLL int_f -nh5tbread_field_index_c(hid_t_f *loc_id, +nh5tbread_field_index_c(hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, int_f *field_index, hsize_t_f *start, hsize_t_f *nrecords, @@ -409,7 +409,7 @@ nh5tbread_field_index_c(hid_t_f *loc_id, H5_DLL int_f -nh5tbinsert_field_c(hid_t_f *loc_id, +nh5tbinsert_field_c(hid_t_f *loc_id, int_f *namelen, _fcd name, int_f *namelen1, @@ -420,7 +420,7 @@ nh5tbinsert_field_c(hid_t_f *loc_id, H5_DLL int_f -nh5tbdelete_field_c(hid_t_f *loc_id, +nh5tbdelete_field_c(hid_t_f *loc_id, int_f *namelen, _fcd name, int_f *namelen1, @@ -429,17 +429,17 @@ nh5tbdelete_field_c(hid_t_f *loc_id, H5_DLL int_f -nh5tbget_table_info_c(hid_t_f *loc_id, +nh5tbget_table_info_c(hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, hsize_t_f *nfields, hsize_t_f *nrecords); H5_DLL int_f -nh5tbget_field_info_c(hid_t_f *loc_id, +nh5tbget_field_info_c(hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, hsize_t_f *nfields, size_t_f *field_sizes, size_t_f *field_offsets, diff --git a/hl/fortran/src/H5LTfc.c b/hl/fortran/src/H5LTfc.c index 6078b23..693eca9 100755 --- a/hl/fortran/src/H5LTfc.c +++ b/hl/fortran/src/H5LTfc.c @@ -22,7 +22,7 @@ /*------------------------------------------------------------------------- * Function: H5LTmake_dataset_c * - * Purpose: Call H5LTmake_dataset + * Purpose: Call H5LTmake_dataset * * Return: Success: 0, Failure: -1 * @@ -39,12 +39,12 @@ */ int_f -nh5ltmake_dataset_c (hid_t_f *loc_id, +nh5ltmake_dataset_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, - int_f *rank, + _fcd name, + int_f *rank, hsize_t_f *dims, - hid_t_f *type_id, + hid_t_f *type_id, void *buf) { int ret_value = -1; @@ -60,7 +60,7 @@ nh5ltmake_dataset_c (hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; c_dims = malloc(sizeof(hsize_t) * (*rank )); @@ -82,17 +82,17 @@ nh5ltmake_dataset_c (hid_t_f *loc_id, ret = H5LTmake_dataset(c_loc_id, c_name, *rank, c_dims, c_type_id, buf ); free (c_dims); - + if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: H5LTread_dataset_c * - * Purpose: Call H5LTmake_dataset + * Purpose: Call H5LTmake_dataset * * Return: Success: 0, Failure: -1 * @@ -109,10 +109,10 @@ nh5ltmake_dataset_c (hid_t_f *loc_id, */ int_f -nh5ltread_dataset_c (hid_t_f *loc_id, +nh5ltread_dataset_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, - hid_t_f *type_id, + _fcd name, + hid_t_f *type_id, void *buf, hsize_t_f *dims) { @@ -127,7 +127,7 @@ nh5ltread_dataset_c (hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -141,13 +141,13 @@ nh5ltread_dataset_c (hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: H5LTmake_dataset_string_c * - * Purpose: Call H5LTmake_dataset + * Purpose: Call H5LTmake_dataset * * Return: Success: 0, Failure: -1 * @@ -164,9 +164,9 @@ nh5ltread_dataset_c (hid_t_f *loc_id, */ int_f -nh5ltmake_dataset_string_c (hid_t_f *loc_id, +nh5ltmake_dataset_string_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, char *buf) { int ret_value = -1; @@ -179,7 +179,7 @@ nh5ltmake_dataset_string_c (hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -192,13 +192,13 @@ nh5ltmake_dataset_string_c (hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: H5LTread_dataset_string_c * - * Purpose: Call H5LTread_dataset_string + * Purpose: Call H5LTread_dataset_string * * Return: Success: 0, Failure: -1 * @@ -215,9 +215,9 @@ nh5ltmake_dataset_string_c (hid_t_f *loc_id, */ int_f -nh5ltread_dataset_string_c (hid_t_f *loc_id, +nh5ltread_dataset_string_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, char *buf) { int ret_value = -1; @@ -230,7 +230,7 @@ nh5ltread_dataset_string_c (hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -243,14 +243,14 @@ nh5ltread_dataset_string_c (hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} - +} + /*------------------------------------------------------------------------- * Function: H5LTset_attribute_int_c * - * Purpose: Call H5LTset_attribute_int + * Purpose: Call H5LTset_attribute_int * * Return: Success: 0, Failure: -1 * @@ -267,11 +267,11 @@ nh5ltread_dataset_string_c (hid_t_f *loc_id, */ int_f -nh5ltset_attribute_int_c(hid_t_f *loc_id, +nh5ltset_attribute_int_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, size_t_f *size, void *buf) { @@ -288,11 +288,11 @@ nh5ltset_attribute_int_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(dsetname, c_namelen); + c_name = (char *)HD5f2cstring(dsetname, c_namelen); if (c_name == NULL) return ret_value; c_attrnamelen = (int)*attrnamelen; - c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); + c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); if (c_attrname == NULL) return ret_value; /* @@ -301,7 +301,7 @@ nh5ltset_attribute_int_c(hid_t_f *loc_id, c_loc_id = (hid_t)*loc_id; c_size = (size_t)*size; - if (sizeof(int_f) == sizeof(int)) + if (sizeof(int_f) == sizeof(int)) ret = H5LTset_attribute_int(c_loc_id,c_name,c_attrname,buf,c_size); else if (sizeof(int_f) == sizeof(long)) ret = H5LTset_attribute_long(c_loc_id,c_name,c_attrname,buf,c_size); @@ -313,7 +313,7 @@ nh5ltset_attribute_int_c(hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: H5LTset_attribute_float_c @@ -335,11 +335,11 @@ nh5ltset_attribute_int_c(hid_t_f *loc_id, */ int_f -nh5ltset_attribute_float_c(hid_t_f *loc_id, +nh5ltset_attribute_float_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, size_t_f *size, void *buf) { @@ -356,11 +356,11 @@ nh5ltset_attribute_float_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(dsetname, c_namelen); + c_name = (char *)HD5f2cstring(dsetname, c_namelen); if (c_name == NULL) return ret_value; c_attrnamelen = *attrnamelen; - c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); + c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); if (c_attrname == NULL) return ret_value; /* @@ -370,11 +370,11 @@ nh5ltset_attribute_float_c(hid_t_f *loc_id, c_size = (size_t)*size; ret = H5LTset_attribute_float(c_loc_id,c_name,c_attrname,buf,c_size); - + if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- @@ -397,11 +397,11 @@ nh5ltset_attribute_float_c(hid_t_f *loc_id, */ int_f -nh5ltset_attribute_double_c(hid_t_f *loc_id, +nh5ltset_attribute_double_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, size_t_f *size, void *buf) { @@ -418,11 +418,11 @@ nh5ltset_attribute_double_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(dsetname, c_namelen); + c_name = (char *)HD5f2cstring(dsetname, c_namelen); if (c_name == NULL) return ret_value; c_attrnamelen = *attrnamelen; - c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); + c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); if (c_attrname == NULL) return ret_value; /* @@ -432,11 +432,11 @@ nh5ltset_attribute_double_c(hid_t_f *loc_id, c_size = (size_t)*size; ret = H5LTset_attribute_double(c_loc_id,c_name,c_attrname,buf,c_size); - + if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: H5LTset_attribute_string_c @@ -458,11 +458,11 @@ nh5ltset_attribute_double_c(hid_t_f *loc_id, */ int_f -nh5ltset_attribute_string_c(hid_t_f *loc_id, +nh5ltset_attribute_string_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, void *buf) { int ret_value = -1; @@ -477,11 +477,11 @@ nh5ltset_attribute_string_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(dsetname, c_namelen); + c_name = (char *)HD5f2cstring(dsetname, c_namelen); if (c_name == NULL) return ret_value; c_attrnamelen = *attrnamelen; - c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); + c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); if (c_attrname == NULL) return ret_value; /* @@ -490,16 +490,16 @@ nh5ltset_attribute_string_c(hid_t_f *loc_id, c_loc_id = (hid_t)*loc_id; ret = H5LTset_attribute_string(c_loc_id,c_name,c_attrname,buf); - + if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: H5LTget_attribute_int_c * - * Purpose: Call H5LTget_attribute_int + * Purpose: Call H5LTget_attribute_int * * Return: Success: 0, Failure: -1 * @@ -516,11 +516,11 @@ nh5ltset_attribute_string_c(hid_t_f *loc_id, */ int_f -nh5ltget_attribute_int_c(hid_t_f *loc_id, +nh5ltget_attribute_int_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, void *buf) { int ret_value = -1; @@ -535,18 +535,18 @@ nh5ltget_attribute_int_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = (int)*namelen; - c_name = (char *)HD5f2cstring(dsetname, c_namelen); + c_name = (char *)HD5f2cstring(dsetname, c_namelen); if (c_name == NULL) return ret_value; c_attrnamelen = (int)*attrnamelen; - c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); + c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); if (c_attrname == NULL) return ret_value; /* * Call H5LTget_attribute_int function. */ c_loc_id = (hid_t)*loc_id; - + if(sizeof(int_f) == sizeof(int)) ret = H5LTget_attribute_int(c_loc_id,c_name,c_attrname,buf); else if (sizeof(int_f) == sizeof(long)) @@ -555,17 +555,17 @@ nh5ltget_attribute_int_c(hid_t_f *loc_id, ret = H5LTget_attribute_long_long(c_loc_id,c_name,c_attrname,buf); else return ret_value; - + if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: H5LTget_attribute_float_c * - * Purpose: Call H5LTget_attribute_float + * Purpose: Call H5LTget_attribute_float * * Return: Success: 0, Failure: -1 * @@ -582,11 +582,11 @@ nh5ltget_attribute_int_c(hid_t_f *loc_id, */ int_f -nh5ltget_attribute_float_c(hid_t_f *loc_id, +nh5ltget_attribute_float_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, void *buf) { int ret_value = -1; @@ -601,11 +601,11 @@ nh5ltget_attribute_float_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = (int)*namelen; - c_name = (char *)HD5f2cstring(dsetname, c_namelen); + c_name = (char *)HD5f2cstring(dsetname, c_namelen); if (c_name == NULL) return ret_value; c_attrnamelen = (int)*attrnamelen; - c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); + c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); if (c_attrname == NULL) return ret_value; /* @@ -614,16 +614,16 @@ nh5ltget_attribute_float_c(hid_t_f *loc_id, c_loc_id = (hid_t)*loc_id; ret = H5LTget_attribute_float(c_loc_id,c_name,c_attrname,buf); - + if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: H5LTget_attribute_double_c * - * Purpose: Call H5LTget_attribute_double + * Purpose: Call H5LTget_attribute_double * * Return: Success: 0, Failure: -1 * @@ -640,11 +640,11 @@ nh5ltget_attribute_float_c(hid_t_f *loc_id, */ int_f -nh5ltget_attribute_double_c(hid_t_f *loc_id, +nh5ltget_attribute_double_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, void *buf) { int ret_value = -1; @@ -659,11 +659,11 @@ nh5ltget_attribute_double_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = (int)*namelen; - c_name = (char *)HD5f2cstring(dsetname, c_namelen); + c_name = (char *)HD5f2cstring(dsetname, c_namelen); if (c_name == NULL) return ret_value; c_attrnamelen = (int)*attrnamelen; - c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); + c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); if (c_attrname == NULL) return ret_value; /* @@ -672,16 +672,16 @@ nh5ltget_attribute_double_c(hid_t_f *loc_id, c_loc_id = (hid_t)*loc_id; ret = H5LTget_attribute_double(c_loc_id,c_name,c_attrname,buf); - + if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: H5LTget_attribute_string_c * - * Purpose: Call H5LTget_attribute_string + * Purpose: Call H5LTget_attribute_string * * Return: Success: 0, Failure: -1 * @@ -698,11 +698,11 @@ nh5ltget_attribute_double_c(hid_t_f *loc_id, */ int_f -nh5ltget_attribute_string_c(hid_t_f *loc_id, +nh5ltget_attribute_string_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, void *buf) { int ret_value = -1; @@ -717,11 +717,11 @@ nh5ltget_attribute_string_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = (int)*namelen; - c_name = (char *)HD5f2cstring(dsetname, c_namelen); + c_name = (char *)HD5f2cstring(dsetname, c_namelen); if (c_name == NULL) return ret_value; c_attrnamelen = (int)*attrnamelen; - c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); + c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); if (c_attrname == NULL) return ret_value; /* @@ -730,17 +730,17 @@ nh5ltget_attribute_string_c(hid_t_f *loc_id, c_loc_id = (hid_t)*loc_id; ret = H5LTget_attribute_string(c_loc_id,c_name,c_attrname,buf); - + if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: H5LTget_dataset_ndims_c * - * Purpose: Call H5LTget_dataset_ndims + * Purpose: Call H5LTget_dataset_ndims * * Return: Success: 0, Failure: -1 * @@ -757,9 +757,9 @@ nh5ltget_attribute_string_c(hid_t_f *loc_id, */ int_f -nh5ltget_dataset_ndims_c(hid_t_f *loc_id, +nh5ltget_dataset_ndims_c(hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, int_f *rank) { int ret_value = -1; @@ -773,7 +773,7 @@ nh5ltget_dataset_ndims_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = (int)*namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -782,12 +782,12 @@ nh5ltget_dataset_ndims_c(hid_t_f *loc_id, c_loc_id = (hid_t)*loc_id; ret = H5LTget_dataset_ndims(c_loc_id, c_name, &c_rank); - + if (ret < 0) return ret_value; *rank = (int_f)c_rank; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- @@ -810,7 +810,7 @@ nh5ltget_dataset_ndims_c(hid_t_f *loc_id, */ int_f -nh5ltfind_dataset_c(hid_t_f *loc_id, +nh5ltfind_dataset_c(hid_t_f *loc_id, int_f *namelen, _fcd name) { @@ -822,7 +822,7 @@ nh5ltfind_dataset_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = (int)*namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return -1; /* @@ -831,13 +831,13 @@ nh5ltfind_dataset_c(hid_t_f *loc_id, c_loc_id = (hid_t)*loc_id; return( H5LTfind_dataset(c_loc_id, c_name)); - -} + +} /*------------------------------------------------------------------------- * Function: h5ltget_dataset_info_c * - * Purpose: Call H5LTget_dataset_info + * Purpose: Call H5LTget_dataset_info * * Return: Success: 0, Failure: -1 * @@ -854,7 +854,7 @@ nh5ltfind_dataset_c(hid_t_f *loc_id, */ int_f -nh5ltget_dataset_info_c(hid_t_f *loc_id, +nh5ltget_dataset_info_c(hid_t_f *loc_id, int_f *namelen, _fcd name, hsize_t_f *dims, @@ -875,7 +875,7 @@ nh5ltget_dataset_info_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = (int)*namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -891,16 +891,16 @@ nh5ltget_dataset_info_c(hid_t_f *loc_id, dims[i] = (hsize_t_f) c_dims[i]; } - + if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: h5ltget_attribute_ndims_c * - * Purpose: Call H5LTget_attribute_ndims + * Purpose: Call H5LTget_attribute_ndims * * Return: Success: 0, Failure: -1 * @@ -917,11 +917,11 @@ nh5ltget_dataset_info_c(hid_t_f *loc_id, */ int_f -nh5ltget_attribute_ndims_c(hid_t_f *loc_id, +nh5ltget_attribute_ndims_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, int_f *rank) { int ret_value = -1; @@ -937,11 +937,11 @@ nh5ltget_attribute_ndims_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen =(int) *namelen; - c_name = (char *)HD5f2cstring(dsetname, c_namelen); + c_name = (char *)HD5f2cstring(dsetname, c_namelen); if (c_name == NULL) return ret_value; c_attrnamelen = (int)*attrnamelen; - c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); + c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); if (c_attrname == NULL) return ret_value; /* @@ -950,18 +950,18 @@ nh5ltget_attribute_ndims_c(hid_t_f *loc_id, c_loc_id = (hid_t)*loc_id; ret = H5LTget_attribute_ndims(c_loc_id,c_name,c_attrname,&c_rank); - + if (ret < 0) return ret_value; *rank = (int_f)c_rank; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: h5ltget_attribute_info_c * - * Purpose: Call H5LTget_attribute_info + * Purpose: Call H5LTget_attribute_info * * Return: Success: 0, Failure: -1 * @@ -978,11 +978,11 @@ nh5ltget_attribute_ndims_c(hid_t_f *loc_id, */ int_f -nh5ltget_attribute_info_c(hid_t_f *loc_id, +nh5ltget_attribute_info_c(hid_t_f *loc_id, int_f *namelen, _fcd name, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, hsize_t_f *dims, int_f *type_class, size_t_f *type_size) @@ -1003,11 +1003,11 @@ nh5ltget_attribute_info_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = (int)*namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; c_attrnamelen = (int)*attrnamelen; - c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); + c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); if (c_attrname == NULL) return ret_value; /* @@ -1023,8 +1023,8 @@ nh5ltget_attribute_info_c(hid_t_f *loc_id, dims[i] = (hsize_t_f) c_dims[i]; } - + if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} diff --git a/hl/fortran/src/H5TBfc.c b/hl/fortran/src/H5TBfc.c index 6af79db..56515b1 100755 --- a/hl/fortran/src/H5TBfc.c +++ b/hl/fortran/src/H5TBfc.c @@ -20,7 +20,7 @@ /*------------------------------------------------------------------------- * Function: h5tbmake_table_c * - * Purpose: Call H5TBmake_table + * Purpose: Call H5TBmake_table * * Return: Success: 0, Failure: -1 * @@ -38,9 +38,9 @@ int_f nh5tbmake_table_c(int_f *namelen1, _fcd name1, - hid_t_f *loc_id, + hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, hsize_t_f *nfields, hsize_t_f *nrecords, size_t_f *type_size, @@ -66,7 +66,7 @@ nh5tbmake_table_c(int_f *namelen1, hsize_t c_chunk_size = *chunk_size; size_t c_type_size = *type_size; size_t *c_field_offset; - hid_t *c_field_types; + hid_t *c_field_types; char **c_field_names; char *tmp, *tmp_p; @@ -80,11 +80,11 @@ nh5tbmake_table_c(int_f *namelen1, * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; c_namelen1 = *namelen1; - c_name1 = (char *)HD5f2cstring(name1, c_namelen1); + c_name1 = (char *)HD5f2cstring(name1, c_namelen1); if (c_name1 == NULL) return ret_value; c_field_offset = (size_t*)malloc(sizeof(size_t) * (size_t)c_nfields); @@ -101,12 +101,12 @@ nh5tbmake_table_c(int_f *namelen1, /* * Allocate array of character pointers */ - c_field_names = (char **)malloc((size_t)num_elem * sizeof(char *)); + c_field_names = (char **)malloc((size_t)num_elem * sizeof(char *)); if (c_field_names == NULL) return ret_value; /* Copy data to long C string */ tmp = (char *)HD5f2cstring(field_names, (int)(max_len*num_elem)); - if (tmp == NULL) { + if (tmp == NULL) { free(c_field_names); return ret_value; } @@ -118,7 +118,7 @@ nh5tbmake_table_c(int_f *namelen1, for (i=0; i < num_elem; i++) { c_field_names[i] = (char *) malloc((size_t)namelen2[i]+1); memcpy(c_field_names[i], tmp_p, (size_t)namelen2[i]); - c_field_names[i][namelen2[i]] = '\0'; + c_field_names[i][namelen2[i]] = '\0'; tmp_p = tmp_p + max_len; } @@ -140,7 +140,7 @@ nh5tbmake_table_c(int_f *namelen1, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} @@ -148,7 +148,7 @@ nh5tbmake_table_c(int_f *namelen1, /*------------------------------------------------------------------------- * Function: h5tbwrite_field_name_c * - * Purpose: Call H5TBwrite_fields_name + * Purpose: Call H5TBwrite_fields_name * * Return: Success: 0, Failure: -1 * @@ -165,15 +165,15 @@ nh5tbmake_table_c(int_f *namelen1, */ int_f -nh5tbwrite_field_name_c(hid_t_f *loc_id, +nh5tbwrite_field_name_c(hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, int_f *namelen1, _fcd field_name, hsize_t_f *start, hsize_t_f *nrecords, size_t_f *type_size, - void *buf) + void *buf) { int ret_value = -1; herr_t ret; @@ -194,11 +194,11 @@ nh5tbwrite_field_name_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; c_namelen1 = *namelen1; - c_name1 = (char *)HD5f2cstring(field_name, c_namelen1); + c_name1 = (char *)HD5f2cstring(field_name, c_namelen1); if (c_name1 == NULL) return ret_value; /* @@ -211,13 +211,13 @@ nh5tbwrite_field_name_c(hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: h5tbread_field_name_c * - * Purpose: Call H5TBread_fields_name + * Purpose: Call H5TBread_fields_name * * Return: Success: 0, Failure: -1 * @@ -234,15 +234,15 @@ nh5tbwrite_field_name_c(hid_t_f *loc_id, */ int_f -nh5tbread_field_name_c(hid_t_f *loc_id, +nh5tbread_field_name_c(hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, int_f *namelen1, _fcd field_name, hsize_t_f *start, hsize_t_f *nrecords, size_t_f *type_size, - void *buf) + void *buf) { int ret_value = -1; herr_t ret; @@ -263,11 +263,11 @@ nh5tbread_field_name_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; c_namelen1 = *namelen1; - c_name1 = (char *)HD5f2cstring(field_name, c_namelen1); + c_name1 = (char *)HD5f2cstring(field_name, c_namelen1); if (c_name1 == NULL) return ret_value; /* @@ -280,14 +280,14 @@ nh5tbread_field_name_c(hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: h5tbwrite_field_index_c * - * Purpose: Call H5TBwrite_fields_index + * Purpose: Call H5TBwrite_fields_index * * Return: Success: 0, Failure: -1 * @@ -304,14 +304,14 @@ nh5tbread_field_name_c(hid_t_f *loc_id, */ int_f -nh5tbwrite_field_index_c(hid_t_f *loc_id, +nh5tbwrite_field_index_c(hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, int_f *field_index, hsize_t_f *start, hsize_t_f *nrecords, size_t_f *type_size, - void *buf) + void *buf) { int ret_value = -1; herr_t ret; @@ -332,7 +332,7 @@ nh5tbwrite_field_index_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; @@ -346,13 +346,13 @@ nh5tbwrite_field_index_c(hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: h5tbread_field_index_c * - * Purpose: Call H5TBread_fields_index + * Purpose: Call H5TBread_fields_index * * Return: Success: 0, Failure: -1 * @@ -369,14 +369,14 @@ nh5tbwrite_field_index_c(hid_t_f *loc_id, */ int_f -nh5tbread_field_index_c(hid_t_f *loc_id, +nh5tbread_field_index_c(hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, int_f *field_index, hsize_t_f *start, hsize_t_f *nrecords, size_t_f *type_size, - void *buf) + void *buf) { int ret_value = -1; herr_t ret; @@ -397,7 +397,7 @@ nh5tbread_field_index_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -410,13 +410,13 @@ nh5tbread_field_index_c(hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: h5tbinsert_field_c * - * Purpose: Call H5TBinsert_field + * Purpose: Call H5TBinsert_field * * Return: Success: 0, Failure: -1 * @@ -431,16 +431,16 @@ nh5tbread_field_index_c(hid_t_f *loc_id, * *------------------------------------------------------------------------- */ - + int_f -nh5tbinsert_field_c(hid_t_f *loc_id, +nh5tbinsert_field_c(hid_t_f *loc_id, int_f *namelen, _fcd name, int_f *namelen1, _fcd field_name, hid_t_f *field_type, int_f *position, - void *buf) + void *buf) { int ret_value = -1; herr_t ret; @@ -456,11 +456,11 @@ nh5tbinsert_field_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; c_namelen1 = *namelen1; - c_name1 = (char *)HD5f2cstring(field_name, c_namelen1); + c_name1 = (char *)HD5f2cstring(field_name, c_namelen1); if (c_name1 == NULL) return ret_value; /* @@ -472,13 +472,13 @@ nh5tbinsert_field_c(hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: h5tbdelete_field_c * - * Purpose: Call H5TBdelete_field + * Purpose: Call H5TBdelete_field * * Return: Success: 0, Failure: -1 * @@ -493,13 +493,13 @@ nh5tbinsert_field_c(hid_t_f *loc_id, * *------------------------------------------------------------------------- */ - + int_f -nh5tbdelete_field_c(hid_t_f *loc_id, +nh5tbdelete_field_c(hid_t_f *loc_id, int_f *namelen, _fcd name, int_f *namelen1, - _fcd field_name) + _fcd field_name) { int ret_value = -1; herr_t ret; @@ -513,11 +513,11 @@ nh5tbdelete_field_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; c_namelen1 = *namelen1; - c_name1 = (char *)HD5f2cstring(field_name, c_namelen1); + c_name1 = (char *)HD5f2cstring(field_name, c_namelen1); if (c_name1 == NULL) return ret_value; /* @@ -529,14 +529,14 @@ nh5tbdelete_field_c(hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} - +} + /*------------------------------------------------------------------------- * Function: h5tbget_table_info_c * - * Purpose: Call H5TBread_fields_index + * Purpose: Call H5TBread_fields_index * * Return: Success: 0, Failure: -1 * @@ -553,11 +553,11 @@ nh5tbdelete_field_c(hid_t_f *loc_id, */ int_f -nh5tbget_table_info_c(hid_t_f *loc_id, +nh5tbget_table_info_c(hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, hsize_t_f *nfields, - hsize_t_f *nrecords) + hsize_t_f *nrecords) { int ret_value = -1; herr_t ret; @@ -571,7 +571,7 @@ nh5tbget_table_info_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -586,14 +586,14 @@ nh5tbget_table_info_c(hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: h5tbget_field_info_c * - * Purpose: Call H5TBget_field_info + * Purpose: Call H5TBget_field_info * * Return: Success: 0, Failure: -1 * @@ -609,16 +609,16 @@ nh5tbget_table_info_c(hid_t_f *loc_id, *------------------------------------------------------------------------- */ int_f -nh5tbget_field_info_c(hid_t_f *loc_id, +nh5tbget_field_info_c(hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, hsize_t_f *nfields, size_t_f *field_sizes, size_t_f *field_offsets, size_t_f *type_size, int_f *namelen2, /* field_names lenghts */ _fcd field_names) /* field_names */ - + { int ret_value = -1; herr_t ret; @@ -647,7 +647,7 @@ nh5tbget_field_info_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; @@ -659,7 +659,7 @@ nh5tbget_field_info_c(hid_t_f *loc_id, c_field_names = malloc( sizeof(char*) * (size_t)c_nfields ); if (!c_field_names) return ret_value; - for ( i = 0; i < c_nfields; i++) + for ( i = 0; i < c_nfields; i++) { c_field_names[i] = malloc( sizeof(char) * HLTB_MAX_FIELD_LEN ); } @@ -683,12 +683,12 @@ nh5tbget_field_info_c(hid_t_f *loc_id, namelen2[i] = (int_f)strlen(c_field_names[i]); length = MAX(length, strlen(c_field_names[i])); tmp_p = tmp_p + c_lenmax; - } + } HD5packFstring(tmp, _fcdtocp(field_names), (int)(c_lenmax*c_nfields)); *type_size = (size_t_f)c_type_size; - for (i=0; i < num_elem; i++) + for (i=0; i < num_elem; i++) { field_sizes[i] = (size_t_f)c_field_sizes[i]; field_offsets[i] = (size_t_f)c_field_offsets[i]; @@ -709,5 +709,5 @@ nh5tbget_field_info_c(hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c index fbf7f19..b77b97f 100644 --- a/hl/src/H5DS.c +++ b/hl/src/H5DS.c @@ -22,7 +22,7 @@ /*------------------------------------------------------------------------- * Function: H5DSset_scale * - * Purpose: Convert dataset DSID to a dimension scale, by writing the standard + * Purpose: Convert dataset DSID to a dimension scale, by writing the standard * attributes for a Dimension Scale dataset; optionally set its name * * Return: Success: SUCCESS, Failure: FAIL @@ -38,9 +38,9 @@ *------------------------------------------------------------------------- */ -herr_t H5DSset_scale(hid_t dsid, - char *dimname) -{ +herr_t H5DSset_scale(hid_t dsid, + char *dimname) +{ int has_dimlist; H5I_type_t it; @@ -66,12 +66,12 @@ herr_t H5DSset_scale(hid_t dsid, if (has_dimlist == 1) return FAIL; - + /*------------------------------------------------------------------------- * write the standard attributes for a Dimension Scale dataset *------------------------------------------------------------------------- */ - + if (H5LT_set_attribute_string(dsid,"CLASS",DIMENSION_SCALE_CLASS)<0) return FAIL; @@ -89,10 +89,10 @@ herr_t H5DSset_scale(hid_t dsid, /*------------------------------------------------------------------------- * Function: H5DSattach_scale * - * Purpose: attach a DS with DSID to the IDX dimension of the existing + * Purpose: attach a DS with DSID to the IDX dimension of the existing * dataset DID * - * Return: + * Return: * Success: SUCCESS * Failure: FAIL * @@ -109,8 +109,8 @@ herr_t H5DSset_scale(hid_t dsid, herr_t H5DSattach_scale(hid_t did, hid_t dsid, - unsigned int idx) -{ + unsigned int idx) +{ int has_dimlist; int has_reflist; int is_ds; @@ -130,15 +130,15 @@ herr_t H5DSattach_scale(hid_t did, H5I_type_t it1, it2; int i, len; int found_ds=0; - + /*------------------------------------------------------------------------- * parameter checking *------------------------------------------------------------------------- */ /* the dataset cannot be a DS dataset */ - if ((H5DSis_scale(did))==1) + if ((H5DSis_scale(did))==1) return FAIL; - + /* get info for the dataset in the parameter list */ if (H5Gget_objinfo(did,".",TRUE,&sb1)<0) return FAIL; @@ -148,7 +148,7 @@ herr_t H5DSattach_scale(hid_t did, return FAIL; /* same object, not valid */ - if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) + if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) return FAIL; /* get ID type */ @@ -172,7 +172,7 @@ herr_t H5DSattach_scale(hid_t did, /*------------------------------------------------------------------------- * The dataset may or may not have the associated DS attribute * First we try to open to see if it is already there; if not, it is created. - * If it exists, the array of references is extended to hold the reference + * If it exists, the array of references is extended to hold the reference * to the new DS *------------------------------------------------------------------------- */ @@ -180,7 +180,7 @@ herr_t H5DSattach_scale(hid_t did, /* get dataset space */ if ((sid = H5Dget_space(did))<0) return FAIL; - + /* get rank */ if ((rank=H5Sget_simple_extent_ndims(sid))<0) goto out; @@ -205,15 +205,15 @@ herr_t H5DSattach_scale(hid_t did, /* create a reference for the >>DS<< dataset */ if (H5Rcreate(&ref_to_ds,dsid,".",H5R_OBJECT,-1)<0) return FAIL; - + /* create a reference for the >>data<< dataset */ if (H5Rcreate(&dsl.ref,did,".",H5R_OBJECT,-1)<0) return FAIL; - + /* try to find the attribute "DIMENSION_LIST" on the >>data<< dataset */ if ((has_dimlist = H5LT_find_attribute(did,DIMENSION_LIST))<0) return FAIL; - + /*------------------------------------------------------------------------- * it does not exist. we create the attribute and its reference data *------------------------------------------------------------------------- @@ -231,7 +231,7 @@ herr_t H5DSattach_scale(hid_t did, /* space for the attribute */ if ((sid = H5Screate_simple(1,dims,NULL))<0) return FAIL; - + /* create the type for the attribute "DIMENSION_LIST" */ if ((tid = H5Tvlen_create(H5T_STD_REF_OBJ))<0) goto out; @@ -239,7 +239,7 @@ herr_t H5DSattach_scale(hid_t did, /* create the attribute */ if ((aid = H5Acreate(did,DIMENSION_LIST,tid,sid,H5P_DEFAULT))<0) goto out; - + /* allocate and initialize the VL */ buf = (hvl_t*)malloc((size_t)rank * sizeof(hvl_t)); @@ -251,7 +251,7 @@ herr_t H5DSattach_scale(hid_t did, buf[i].len = 0; buf[i].p = NULL; } - + /* store the REF information in the index of the dataset that has the DS */ buf[idx].len = 1; buf[idx].p = malloc( 1 * sizeof(hobj_ref_t)); @@ -260,7 +260,7 @@ herr_t H5DSattach_scale(hid_t did, /* write the attribute with the reference */ if (H5Awrite(aid,tid,buf)<0) goto out; - + /* close */ if (H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf)<0) goto out; @@ -275,32 +275,32 @@ herr_t H5DSattach_scale(hid_t did, free(dims); if (buf) free(buf); - + } - + /*------------------------------------------------------------------------- * the attribute already exists, open it, extend the buffer, * and insert the new reference *------------------------------------------------------------------------- */ - + else if ( has_dimlist == 1 ) { if ((aid = H5Aopen_name(did,DIMENSION_LIST))<0) goto out; - + if ((tid = H5Aget_type(aid))<0) goto out; if ((sid = H5Aget_space(aid))<0) goto out; - + /* allocate and initialize the VL */ buf = (hvl_t*)malloc((size_t)rank * sizeof(hvl_t)); if (buf == NULL) goto out; - + /* read */ if (H5Aread(aid,tid,buf)<0) goto out; @@ -315,21 +315,21 @@ herr_t H5DSattach_scale(hid_t did, /* get the scale id for this REF */ if ((dsid_j = H5Rdereference(did,H5R_OBJECT,&ref_j))<0) goto out; - + /* get info for DS in the parameter list */ if (H5Gget_objinfo(dsid,".",TRUE,&sb1)<0) goto out; - + /* get info for this DS */ if (H5Gget_objinfo(dsid_j,".",TRUE,&sb2)<0) goto out; - + /* same object, so this DS scale is already in this DIM IDX */ - if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) + if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) { found_ds = 1; } - + /* close the dereferenced dataset */ if (H5Dclose(dsid_j)<0) goto out; @@ -353,30 +353,30 @@ herr_t H5DSattach_scale(hid_t did, ((hobj_ref_t *)buf[idx].p)[0] = ref_to_ds; } } - + /* write the attribute with the new references */ if (H5Awrite(aid,tid,buf)<0) goto out; - + /* close */ if (H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf)<0) goto out; if (H5Sclose(sid)<0) goto out; - if (H5Tclose(tid)<0) + if (H5Tclose(tid)<0) goto out; if (H5Aclose(aid)<0) goto out; if (buf) free(buf); - - } /* has_dimlist */ - + + } /* has_dimlist */ + /*------------------------------------------------------------------------- * save DS info on the >>DS<< dataset *------------------------------------------------------------------------- */ - + /* try to find the attribute "REFERENCE_LIST" on the >>DS<< dataset */ if ((has_reflist = H5LT_find_attribute(dsid,REFERENCE_LIST))<0) goto out; @@ -398,30 +398,30 @@ herr_t H5DSattach_scale(hid_t did, /* space for the attribute */ if ((sid = H5Screate_simple(1,dims,NULL))<0) goto out; - + /* create the compound datatype for the attribute "REFERENCE_LIST" */ if ((tid = H5Tcreate(H5T_COMPOUND,sizeof(ds_list_t)))<0) goto out; - + /* insert reference field */ if (H5Tinsert(tid,"dataset",HOFFSET(ds_list_t,ref),H5T_STD_REF_OBJ)<0) goto out; - + /* insert dimension idx of the dataset field */ if (H5Tinsert(tid,"dimension",HOFFSET(ds_list_t,dim_idx),H5T_NATIVE_INT)<0) goto out; - + /* create the attribute */ if ((aid = H5Acreate(dsid,REFERENCE_LIST,tid,sid,H5P_DEFAULT))<0) goto out; - + /* store the IDX information */ dsl.dim_idx = idx; - + /* write the attribute with the reference */ if (H5Awrite(aid,tid,&dsl)<0) goto out; - + /* close */ if (H5Sclose(sid)<0) goto out; @@ -438,32 +438,32 @@ herr_t H5DSattach_scale(hid_t did, * the "REFERENCE_LIST" array already exists, open it and extend it *------------------------------------------------------------------------- */ - + else if ( has_reflist == 1 ) { if ((aid = H5Aopen_name(dsid,REFERENCE_LIST))<0) goto out; - + if ((tid = H5Aget_type(aid))<0) goto out; - + /* get and save the old reference(s) */ if ((sid = H5Aget_space(aid))<0) goto out; - + if ((nelmts = H5Sget_simple_extent_npoints(sid))<0) goto out; - + nelmts++; - + dsbuf = malloc((size_t)nelmts * sizeof(ds_list_t)); if (dsbuf == NULL) goto out; - + if (H5Aread(aid,tid,dsbuf)<0) goto out; - + /* close */ if (H5Sclose(sid)<0) goto out; @@ -474,7 +474,7 @@ herr_t H5DSattach_scale(hid_t did, * create a new attribute *------------------------------------------------------------------------- */ - + /* the attribute must be deleted, in order to the new one can reflect the changes*/ if (H5Adelete(dsid,REFERENCE_LIST)<0) goto out; @@ -488,34 +488,34 @@ herr_t H5DSattach_scale(hid_t did, if (dims == NULL) goto out; dims[0] = nelmts; - + if ((sid = H5Screate_simple(1,dims,NULL))<0) goto out; if (dims) free(dims); - + /* create the attribute again with the changes of space */ if ((aid = H5Acreate(dsid,REFERENCE_LIST,tid,sid,H5P_DEFAULT))<0) goto out; - + /* write the attribute with the new references */ if (H5Awrite(aid,tid,dsbuf)<0) goto out; - + /* close */ if (H5Sclose(sid)<0) goto out; - if (H5Tclose(tid)<0) + if (H5Tclose(tid)<0) goto out; if (H5Aclose(aid)<0) goto out; - + if (dsbuf) free(dsbuf); - - } /* has_reflist */ - + + } /* has_reflist */ + /*------------------------------------------------------------------------- * write the standard attributes for a Dimension Scale dataset *------------------------------------------------------------------------- @@ -523,7 +523,7 @@ herr_t H5DSattach_scale(hid_t did, if ((is_ds=H5DSis_scale(dsid))<0) return FAIL; - + if (is_ds == 0 ) { if (H5LT_set_attribute_string(dsid,"CLASS",DIMENSION_SCALE_CLASS)<0) @@ -531,7 +531,7 @@ herr_t H5DSattach_scale(hid_t did, } return SUCCESS; - + /* error zone, gracefully close */ out: H5E_BEGIN_TRY { @@ -545,10 +545,10 @@ out: /*------------------------------------------------------------------------- * Function: H5DSdetach_scale * - * Purpose: detach a DS with DSID to the IDX dimension of the existing + * Purpose: detach a DS with DSID to the IDX dimension of the existing * dataset DID * - * Return: + * Return: * Success: SUCCESS * Failure: FAIL * @@ -565,8 +565,8 @@ out: herr_t H5DSdetach_scale(hid_t did, hid_t dsid, - unsigned int idx) -{ + unsigned int idx) +{ int has_dimlist; int has_reflist; hssize_t nelmts; @@ -584,15 +584,15 @@ herr_t H5DSdetach_scale(hid_t did, H5G_stat_t sb1, sb2, sb3, sb4; int found_dset=0, found_ds=0; H5I_type_t it1, it2; - + /*------------------------------------------------------------------------- * parameter checking *------------------------------------------------------------------------- */ /* the dataset cannot be a DS dataset */ - if ((H5DSis_scale(did))==1) + if ((H5DSis_scale(did))==1) return FAIL; - + /* get info for the dataset in the parameter list */ if (H5Gget_objinfo(did,".",TRUE,&sb1)<0) return FAIL; @@ -602,7 +602,7 @@ herr_t H5DSdetach_scale(hid_t did, return FAIL; /* same object, not valid */ - if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) + if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) return FAIL; /* get ID type */ @@ -629,7 +629,7 @@ herr_t H5DSdetach_scale(hid_t did, /* get dataset space */ if ((sid = H5Dget_space(did))<0) return FAIL; - + /* get rank */ if ((rank=H5Sget_simple_extent_ndims(sid))<0) goto out; @@ -650,31 +650,31 @@ herr_t H5DSdetach_scale(hid_t did, if (has_reflist == 0) return FAIL; - + /*------------------------------------------------------------------------- * open "DIMENSION_LIST", and delete the reference *------------------------------------------------------------------------- */ - + if ((aid = H5Aopen_name(did,DIMENSION_LIST))<0) return FAIL; - + if ((tid = H5Aget_type(aid))<0) goto out; - + if ((sid = H5Aget_space(aid))<0) goto out; - + /* allocate and initialize the VL */ buf = (hvl_t*)malloc((size_t)rank * sizeof(hvl_t)); - + if (buf == NULL) goto out; - + /* read */ if (H5Aread(aid,tid,buf)<0) goto out; - + /* reset */ if ( buf[idx].len > 0 ) { @@ -682,28 +682,28 @@ herr_t H5DSdetach_scale(hid_t did, { /* get the reference */ ref = ((hobj_ref_t *)buf[idx].p)[j]; - + /* get the DS id */ if ((dsid_j = H5Rdereference(did,H5R_OBJECT,&ref))<0) goto out; - + /* get info for DS in the parameter list */ if (H5Gget_objinfo(dsid,".",TRUE,&sb1)<0) goto out; - + /* get info for this DS */ if (H5Gget_objinfo(dsid_j,".",TRUE,&sb2)<0) goto out; - + /* same object, reset */ - if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) + if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) { for(jj=j; jj>data<< dataset must exist + * the attribute "DIMENSION_LIST" on the >>data<< dataset must exist *------------------------------------------------------------------------- */ /* get dataset space */ if ((sid = H5Dget_space(did))<0) return FAIL; - + /* get rank */ if ((rank=H5Sget_simple_extent_ndims(sid))<0) goto out; @@ -973,10 +973,10 @@ int H5DSget_num_scales(hid_t did, return 0; /*------------------------------------------------------------------------- - * the attribute exists, open it + * the attribute exists, open it *------------------------------------------------------------------------- */ - + else if ( has_dimlist == 1 ) { if ((aid = H5Aopen_name(did,DIMENSION_LIST))<0) @@ -985,13 +985,13 @@ int H5DSget_num_scales(hid_t did, goto out; if ((sid = H5Aget_space(aid))<0) goto out; - + /* allocate and initialize the VL */ buf = (hvl_t*)malloc((size_t)rank * sizeof(hvl_t)); if (buf == NULL) goto out; - + /* read */ if (H5Aread(aid,tid,buf)<0) goto out; @@ -1003,17 +1003,17 @@ int H5DSget_num_scales(hid_t did, goto out; if (H5Sclose(sid)<0) goto out; - if (H5Tclose(tid)<0) + if (H5Tclose(tid)<0) goto out; if (H5Aclose(aid)<0) goto out; if (buf) free(buf); - - } /* has_dimlist */ + + } /* has_dimlist */ return nscales; - + /* error zone, gracefully close */ out: H5E_BEGIN_TRY { @@ -1043,10 +1043,10 @@ out: *------------------------------------------------------------------------- */ -herr_t H5DSset_label(hid_t did, +herr_t H5DSset_label(hid_t did, unsigned int idx, char *label) -{ +{ int has_labels; hid_t sid; /* space ID */ hid_t tid; /* attribute type ID */ @@ -1080,7 +1080,7 @@ herr_t H5DSset_label(hid_t did, /* get dataset space */ if ((sid = H5Dget_space(did))<0) return FAIL; - + /* get rank */ if ((rank=H5Sget_simple_extent_ndims(sid))<0) goto out; @@ -1101,17 +1101,17 @@ herr_t H5DSset_label(hid_t did, /* space for the attribute */ if ((sid = H5Screate_simple(1,dims,NULL))<0) goto out; - + /* create the datatype */ if ((tid = H5Tcopy(H5T_C_S1))<0) goto out; if (H5Tset_size(tid,H5T_VARIABLE)<0) goto out; - + /* create the attribute */ if ((aid = H5Acreate(did,DIMENSION_LABELS,tid,sid,H5P_DEFAULT))<0) goto out; - + /* allocate and initialize */ buf = (char **)malloc((size_t)rank * sizeof(char *)); @@ -1120,14 +1120,14 @@ herr_t H5DSset_label(hid_t did, for(i=0; i<(unsigned int)rank; i++) buf[i] = NULL; - + /* store the label information in the required index */ buf[idx] = label; - + /* write the attribute with the label */ if (H5Awrite(aid,tid,buf)<0) goto out; - + /* close */ if (H5Sclose(sid)<0) goto out; @@ -1138,7 +1138,7 @@ herr_t H5DSset_label(hid_t did, if (buf) free(buf); } - + /*------------------------------------------------------------------------- * just insert label *------------------------------------------------------------------------- @@ -1148,29 +1148,29 @@ herr_t H5DSset_label(hid_t did, { if ((aid = H5Aopen_name(did,DIMENSION_LABELS))<0) goto out; - + if ((tid = H5Aget_type(aid))<0) goto out; - + /* allocate and initialize */ buf = (char **)malloc((size_t)rank * sizeof(char *)); if (buf == NULL) goto out; - + /* read */ if (H5Aread(aid,tid,buf)<0) goto out; /* store the label information in the required index */ buf[idx] = label; - + /* write the attribute with the new references */ if (H5Awrite(aid,tid,buf)<0) goto out; - + /* close */ - if (H5Tclose(tid)<0) + if (H5Tclose(tid)<0) goto out; if (H5Aclose(aid)<0) goto out; @@ -1193,7 +1193,7 @@ out: /*------------------------------------------------------------------------- * Function: H5DSget_label * - * Purpose: Read the label LABEL for dimension IDX of datsset DID + * Purpose: Read the label LABEL for dimension IDX of datsset DID * Up to 'size' characters are stored in 'label' followed by a '\0' string * terminator. If the label is longer than 'size'-1, * the string terminator is stored in the last position of the buffer to @@ -1211,11 +1211,11 @@ out: * *------------------------------------------------------------------------- */ -ssize_t H5DSget_label(hid_t did, +ssize_t H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size) -{ +{ int has_labels; hid_t sid; /* space ID */ hid_t tid; /* attribute type ID */ @@ -1257,7 +1257,7 @@ ssize_t H5DSget_label(hid_t did, /* get dataset space */ if ((sid = H5Dget_space(did))<0) return FAIL; - + /* get rank */ if ((rank=H5Sget_simple_extent_ndims(sid))<0) goto out; @@ -1275,36 +1275,36 @@ ssize_t H5DSget_label(hid_t did, { if ((aid = H5Aopen_name(did,DIMENSION_LABELS))<0) goto out; - + if ((tid = H5Aget_type(aid))<0) goto out; - + /* allocate and initialize */ buf = (char **)malloc((size_t)rank * sizeof(char *)); if (buf == NULL) goto out; - + /* read */ if (H5Aread(aid,tid,buf)<0) goto out; - + /* get the real string length */ nbytes = HDstrlen(buf[idx]); - + /* compute the string length which will fit into the user's buffer */ copy_len = MIN(size-1, nbytes); - + /* copy all/some of the name */ if( label ) { HDmemcpy(label, buf[idx], copy_len); - + /* terminate the string */ label[copy_len]='\0'; } - + /* close */ - if (H5Tclose(tid)<0) + if (H5Tclose(tid)<0) goto out; if (H5Aclose(aid)<0) goto out; @@ -1348,10 +1348,10 @@ out: *------------------------------------------------------------------------- */ -ssize_t H5DSget_scale_name(hid_t did, +ssize_t H5DSget_scale_name(hid_t did, char *name, - size_t size) -{ + size_t size) +{ hid_t aid; /* attribute ID */ hid_t tid; /* attribute type ID */ hid_t sid; /* space ID */ @@ -1372,9 +1372,9 @@ ssize_t H5DSget_scale_name(hid_t did, if (H5I_DATASET!=it) return FAIL; - if ((H5DSis_scale(did))<=0) + if ((H5DSis_scale(did))<=0) return FAIL; - + /*------------------------------------------------------------------------- * check if the DS has a name *------------------------------------------------------------------------- @@ -1391,7 +1391,7 @@ ssize_t H5DSget_scale_name(hid_t did, * open the attribute *------------------------------------------------------------------------- */ - + if ((aid = H5Aopen_name(did,"NAME"))<0) return FAIL; @@ -1411,22 +1411,22 @@ ssize_t H5DSget_scale_name(hid_t did, buf = (char*)malloc(nbytes * sizeof(char)); if (buf == NULL) goto out; - + /* read */ if (H5Aread(aid,tid,buf)<0) goto out; /* compute the string length which will fit into the user's buffer */ copy_len = MIN(size-1, nbytes); - + /* copy all/some of the name */ if (name) { HDmemcpy(name, buf, copy_len); - + /* terminate the string */ name[copy_len]='\0'; } - + /* close */ if (H5Tclose(tid)<0) goto out; @@ -1475,8 +1475,8 @@ out: *------------------------------------------------------------------------- */ -htri_t H5DSis_scale(hid_t did) -{ +htri_t H5DSis_scale(hid_t did) +{ hid_t tid; /* attribute type ID */ hid_t aid; /* attribute ID */ herr_t has_class; /* has the "CLASS" attribute */ @@ -1506,19 +1506,19 @@ htri_t H5DSis_scale(hid_t did) { if ((aid = H5Aopen_name(did,"CLASS"))<0) goto out; - + if ((tid = H5Aget_type(aid))<0) goto out; if (H5Aread(aid,tid,buf)<0) goto out; - if( strcmp(buf,DIMENSION_SCALE_CLASS)==0) + if( strcmp(buf,DIMENSION_SCALE_CLASS)==0) is_ds = 1; else is_ds = 0; - - if (H5Tclose(tid)<0) + + if (H5Tclose(tid)<0) goto out; if (H5Aclose(aid)<0) @@ -1526,7 +1526,7 @@ htri_t H5DSis_scale(hid_t did) } return is_ds; - + /* error zone, gracefully close */ out: H5E_BEGIN_TRY { @@ -1541,16 +1541,16 @@ out: /*------------------------------------------------------------------------- * Function: H5DSiterate_scales * - * Purpose: H5DSiterate_scales iterates over the scales attached to dimension dim - * of dataset dset. For each scale in the list, the visitor_data and some - * additional information, specified below, are passed to the visitor function. - * The iteration begins with the idx object in the group and the next element - * to be processed by the operator is returned in idx. If idx is NULL, then the + * Purpose: H5DSiterate_scales iterates over the scales attached to dimension dim + * of dataset dset. For each scale in the list, the visitor_data and some + * additional information, specified below, are passed to the visitor function. + * The iteration begins with the idx object in the group and the next element + * to be processed by the operator is returned in idx. If idx is NULL, then the * iterator starts at zero. * * Parameters: * - * hid_t DID; IN: the dataset + * hid_t DID; IN: the dataset * unsigned int dim; IN: the dimension of the dataset * int *idx; IN/OUT: input the index to start iterating, output the next index * to visit. If NULL, start at the first position. @@ -1560,10 +1560,10 @@ out: * Iterate over all scales of DIM, calling an application callback * with the item, key and any operator data. * - * The operator callback receives a pointer to the item , + * The operator callback receives a pointer to the item , * and the pointer to the operator data passed * in to H5SL_iterate ('op_data'). The return values from an operator are: - * A. Zero causes the iterator to continue, returning zero when all + * A. Zero causes the iterator to continue, returning zero when all * nodes of that type have been processed. * B. Positive causes the iterator to immediately return that positive * value, indicating short-circuit success. @@ -1581,10 +1581,10 @@ out: *------------------------------------------------------------------------- */ -herr_t H5DSiterate_scales(hid_t did, - unsigned int dim, - int *idx, - H5DS_iterate_t visitor, +herr_t H5DSiterate_scales(hid_t did, + unsigned int dim, + int *idx, + H5DS_iterate_t visitor, void *visitor_data ) { hid_t scale_id; @@ -1619,7 +1619,7 @@ herr_t H5DSiterate_scales(hid_t did, /* get dataset space */ if ((sid = H5Dget_space(did))<0) return FAIL; - + /* get rank */ if ((rank=H5Sget_simple_extent_ndims(sid))<0) goto out; @@ -1643,22 +1643,22 @@ herr_t H5DSiterate_scales(hid_t did, goto out; if ((sid = H5Aget_space(aid))<0) goto out; - + /* allocate and initialize the VL */ buf = (hvl_t*)malloc((size_t)rank * sizeof(hvl_t)); if (buf == NULL) goto out; - + /* read */ if (H5Aread(aid,tid,buf)<0) goto out; - + if ( buf[dim].len > 0 ) { if (idx!=NULL) j_idx = *idx; - else + else j_idx=0; /* iterate */ @@ -1673,15 +1673,15 @@ herr_t H5DSiterate_scales(hid_t did, if ((scale_id = H5Rdereference(did,H5R_OBJECT,&ref))<0) goto out; } H5E_END_TRY; - + if((ret_value=(visitor)(did,dim,scale_id,visitor_data))!=0) { /* set the return IDX OUT value at current scale index and break */ - if (idx!=NULL) + if (idx!=NULL) { *idx = i; } - + /* close the DS id */ if (H5Dclose(scale_id)<0) goto out; @@ -1695,23 +1695,23 @@ herr_t H5DSiterate_scales(hid_t did, } /* i */ } /* if */ - + /* close */ if (H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf)<0) goto out; if (H5Sclose(sid)<0) goto out; - if (H5Tclose(tid)<0) + if (H5Tclose(tid)<0) goto out; if (H5Aclose(aid)<0) goto out; if (buf) free(buf); - + } /* if has_dimlist */ return ret_value; - + out: H5E_BEGIN_TRY { if (buf) @@ -1724,17 +1724,17 @@ out: H5Tclose(tid); } H5E_END_TRY; return FAIL; -} +} /*------------------------------------------------------------------------- * Function: H5DSis_attached * - * Purpose: Report if dimension scale DSID is currently attached to + * Purpose: Report if dimension scale DSID is currently attached to * dimension IDX of dataset DID by checking if DID has a pointer in the REFERENCE_LIST - * attribute and DSID (scale ) has a pointer in the DIMENSION_LIST attribute + * attribute and DSID (scale ) has a pointer in the DIMENSION_LIST attribute * - * Return: + * Return: * 1: both the DS and the dataset pointers match * 0: one of them or both do not match * FAIL (-1): error @@ -1752,8 +1752,8 @@ out: htri_t H5DSis_attached(hid_t did, hid_t dsid, - unsigned int idx) -{ + unsigned int idx) +{ int has_dimlist; int has_reflist; hssize_t nelmts; @@ -1775,9 +1775,9 @@ htri_t H5DSis_attached(hid_t did, *------------------------------------------------------------------------- */ /* the dataset cannot be a DS dataset */ - if ((H5DSis_scale(did))==1) + if ((H5DSis_scale(did))==1) return FAIL; - + /* get info for the dataset in the parameter list */ if (H5Gget_objinfo(did,".",TRUE,&sb1)<0) return FAIL; @@ -1787,7 +1787,7 @@ htri_t H5DSis_attached(hid_t did, return FAIL; /* same object, not valid */ - if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) + if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) return FAIL; /* get ID type */ @@ -1807,7 +1807,7 @@ htri_t H5DSis_attached(hid_t did, /* get dataset space */ if ((sid = H5Dget_space(did))<0) return FAIL; - + /* get rank */ if ((rank=H5Sget_simple_extent_ndims(sid))<0) goto out; @@ -1828,24 +1828,24 @@ htri_t H5DSis_attached(hid_t did, * open "DIMENSION_LIST" *------------------------------------------------------------------------- */ - + if ( has_dimlist == 1 ) { if ((aid = H5Aopen_name(did,DIMENSION_LIST))<0) goto out; - + if ((tid = H5Aget_type(aid))<0) goto out; if ((sid = H5Aget_space(aid))<0) goto out; - + /* allocate and initialize the VL */ buf = (hvl_t*)malloc((size_t)rank * sizeof(hvl_t)); if (buf == NULL) goto out; - + /* read */ if (H5Aread(aid,tid,buf)<0) goto out; @@ -1859,83 +1859,83 @@ htri_t H5DSis_attached(hid_t did, /* get the scale id for this REF */ if ((dsid_j = H5Rdereference(did,H5R_OBJECT,&ref))<0) goto out; - + /* get info for DS in the parameter list */ if (H5Gget_objinfo(dsid,".",TRUE,&sb1)<0) goto out; - + /* get info for this DS */ if (H5Gget_objinfo(dsid_j,".",TRUE,&sb2)<0) goto out; - + /* same object */ - if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) + if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) { found_ds = 1; } - + /* close the dereferenced dataset */ if (H5Dclose(dsid_j)<0) goto out; } - + /* close */ if (H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf)<0) goto out; if (H5Sclose(sid)<0) goto out; - if (H5Tclose(tid)<0) + if (H5Tclose(tid)<0) goto out; if (H5Aclose(aid)<0) goto out; if (buf) free(buf); - } /* has_dimlist */ - + } /* has_dimlist */ + /*------------------------------------------------------------------------- * info on the >>DS<< dataset *------------------------------------------------------------------------- */ - + /* try to find the attribute "REFERENCE_LIST" on the >>DS<< dataset */ if ((has_reflist = H5LT_find_attribute(dsid,REFERENCE_LIST))<0) goto out; /*------------------------------------------------------------------------- - * open "REFERENCE_LIST" + * open "REFERENCE_LIST" *------------------------------------------------------------------------- */ - + if ( has_reflist == 1 ) { if ((aid = H5Aopen_name(dsid,REFERENCE_LIST))<0) goto out; - + if ((tid = H5Aget_type(aid))<0) goto out; - + /* get and save the old reference(s) */ if ((sid = H5Aget_space(aid))<0) goto out; - + if ((nelmts = H5Sget_simple_extent_npoints(sid))<0) goto out; - + dsbuf = malloc((size_t)nelmts * sizeof(ds_list_t)); if (dsbuf == NULL) goto out; - + if (H5Aread(aid,tid,dsbuf)<0) goto out; - + /*------------------------------------------------------------------------- * iterate *------------------------------------------------------------------------- */ - + for(i=0; i table_size ) goto out; - /* Get the dataspace handle */ + /* Get the dataspace handle */ if ( (space_id = H5Dget_space( dataset_id )) < 0 ) goto out; diff --git a/hl/src/H5HL_private.h b/hl/src/H5HL_private.h index d6f2157..c431e7d 100644 --- a/hl/src/H5HL_private.h +++ b/hl/src/H5HL_private.h @@ -28,7 +28,7 @@ extern "C" { */ herr_t H5TBcommon_append_records( hid_t dataset_id, - hid_t mem_type_id, + hid_t mem_type_id, hsize_t nrecords, hsize_t orig_table_size, const void * data); diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c index 9e8982d..0db602c 100644 --- a/hl/src/H5IM.c +++ b/hl/src/H5IM.c @@ -27,7 +27,7 @@ * Date: June 13, 2001 * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: @@ -35,17 +35,17 @@ *------------------------------------------------------------------------- */ -herr_t H5IMmake_image_8bit( hid_t loc_id, - const char *dset_name, +herr_t H5IMmake_image_8bit( hid_t loc_id, + const char *dset_name, hsize_t width, hsize_t height, const unsigned char *buffer ) { hsize_t dims[IMAGE8_RANK]; - + /* Initialize the image dimensions */ - dims[0] = height; - dims[1] = width; + dims[0] = height; + dims[1] = width; dims[2] = 1; /* Make the dataset */ @@ -79,12 +79,12 @@ herr_t H5IMmake_image_8bit( hid_t loc_id, * Date: June 13, 2001 * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * - * Interlace Mode Dimensions in the Dataspace - * INTERLACE_PIXEL [height][width][pixel components] - * INTERLACE_PLANE [pixel components][height][width] + * Interlace Mode Dimensions in the Dataspace + * INTERLACE_PIXEL [height][width][pixel components] + * INTERLACE_PLANE [pixel components][height][width] * * * Modifications: @@ -92,34 +92,34 @@ herr_t H5IMmake_image_8bit( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5IMmake_image_24bit( hid_t loc_id, - const char *dset_name, +herr_t H5IMmake_image_24bit( hid_t loc_id, + const char *dset_name, hsize_t width, hsize_t height, const char *interlace, const unsigned char *buffer ) { hsize_t dims[IMAGE24_RANK]; - + /* Initialize the image dimensions */ - if ( strcmp( interlace, "INTERLACE_PIXEL" ) == 0 ) + if ( strcmp( interlace, "INTERLACE_PIXEL" ) == 0 ) { /* Number of color planes is defined as the third dimension */ - dims[0] = height; - dims[1] = width; - dims[2] = IMAGE24_RANK; + dims[0] = height; + dims[1] = width; + dims[2] = IMAGE24_RANK; } else - if ( strcmp( interlace, "INTERLACE_PLANE" ) == 0 ) + if ( strcmp( interlace, "INTERLACE_PLANE" ) == 0 ) { /* Number of color planes is defined as the first dimension */ - dims[0] = IMAGE24_RANK; - dims[1] = height; - dims[2] = width; + dims[0] = IMAGE24_RANK; + dims[1] = height; + dims[2] = width; } else return -1; - + /* Make the dataset */ if ( H5LTmake_dataset( loc_id, dset_name, IMAGE24_RANK, dims, H5T_NATIVE_UCHAR, buffer ) < 0 ) return -1; @@ -151,7 +151,7 @@ herr_t H5IMmake_image_24bit( hid_t loc_id, * * Purpose: operator function used by H5LT_find_palette * - * Return: + * Return: * * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu * @@ -167,33 +167,33 @@ herr_t H5IMmake_image_24bit( hid_t loc_id, static herr_t find_palette( hid_t loc_id, const char *name, void *op_data ) { - /* Define a default zero value for return. This will cause the iterator to continue if + /* Define a default zero value for return. This will cause the iterator to continue if * the palette attribute is not found yet. */ - int ret = 0; + int ret = 0; /* Shut compiler */ loc_id=loc_id; op_data=op_data; - - /* Define a positive value for return value if the attribute was found. This will - * cause the iterator to immediately return that positive value, - * indicating short-circuit success + + /* Define a positive value for return value if the attribute was found. This will + * cause the iterator to immediately return that positive value, + * indicating short-circuit success */ - - if( strcmp( name, "PALETTE" ) == 0 ) + + if( strcmp( name, "PALETTE" ) == 0 ) ret = 1; return ret; -} +} /*------------------------------------------------------------------------- * Function: H5IM_find_palette * - * Purpose: Private function. Find the attribute "PALETTE" in the image dataset + * Purpose: Private function. Find the attribute "PALETTE" in the image dataset * * Return: Success: 1, Failure: 0 * @@ -209,7 +209,7 @@ static herr_t find_palette( hid_t loc_id, const char *name, void *op_data ) *------------------------------------------------------------------------- */ -herr_t H5IM_find_palette( hid_t loc_id ) +herr_t H5IM_find_palette( hid_t loc_id ) { unsigned int attr_num; /* Starting attribute to look up */ @@ -225,7 +225,7 @@ herr_t H5IM_find_palette( hid_t loc_id ) /*------------------------------------------------------------------------- * Function: H5IMget_image_info * - * Purpose: Gets information about an image dataset (dimensions, interlace mode + * Purpose: Gets information about an image dataset (dimensions, interlace mode * and number of associated palettes). * * Return: Success: 0, Failure: -1 @@ -235,7 +235,7 @@ herr_t H5IM_find_palette( hid_t loc_id ) * Date: July 25, 2001 * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: @@ -243,18 +243,18 @@ herr_t H5IM_find_palette( hid_t loc_id ) *------------------------------------------------------------------------- */ -herr_t H5IMget_image_info( hid_t loc_id, - const char *dset_name, +herr_t H5IMget_image_info( hid_t loc_id, + const char *dset_name, hsize_t *width, hsize_t *height, hsize_t *planes, char *interlace, hssize_t *npals ) { - hid_t did, sid; + hid_t did, sid; hsize_t dims[IMAGE24_RANK]; hid_t attr_id; - hid_t attr_type; + hid_t attr_type; int has_attr; hid_t attr_space_id; hid_t attr_class; @@ -289,7 +289,7 @@ herr_t H5IMget_image_info( hid_t loc_id, if ( H5Aclose( attr_id ) < 0 ) goto out; } - + /* Get the dataspace handle */ if ( (sid = H5Dget_space( did )) < 0 ) goto out; @@ -304,18 +304,18 @@ herr_t H5IMget_image_info( hid_t loc_id, /* This is a 24 bit image */ { - if ( strcmp( interlace, "INTERLACE_PIXEL" ) == 0 ) + if ( strcmp( interlace, "INTERLACE_PIXEL" ) == 0 ) { /* Number of color planes is defined as the third dimension */ - *height = dims[0]; + *height = dims[0]; *width = dims[1]; *planes = dims[2]; } else - if ( strcmp( interlace, "INTERLACE_PLANE" ) == 0 ) + if ( strcmp( interlace, "INTERLACE_PLANE" ) == 0 ) { /* Number of color planes is defined as the first dimension */ - *planes = dims[0]; + *planes = dims[0]; *height = dims[1]; *width = dims[2]; } @@ -324,7 +324,7 @@ herr_t H5IMget_image_info( hid_t loc_id, else /* This is a 8 bit image */ { - *height = dims[0]; + *height = dims[0]; *width = dims[1]; *planes = 1; } @@ -345,7 +345,7 @@ herr_t H5IMget_image_info( hid_t loc_id, if ( (attr_id = H5Aopen_name( did, "PALETTE" )) < 0 ) goto out; - + if ( (attr_type = H5Aget_type( attr_id )) < 0 ) goto out; @@ -366,13 +366,13 @@ herr_t H5IMget_image_info( hid_t loc_id, if ( H5Sclose( attr_space_id ) < 0 ) goto out; - - } /* H5T_REFERENCE */ - - if ( H5Tclose( attr_type ) < 0 ) + + } /* H5T_REFERENCE */ + + if ( H5Tclose( attr_type ) < 0 ) goto out; - /* Close the attribute. */ + /* Close the attribute. */ if ( H5Aclose( attr_id ) < 0 ) goto out; @@ -403,7 +403,7 @@ out: * Date: June 13, 2001 * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: @@ -411,11 +411,11 @@ out: *------------------------------------------------------------------------- */ -herr_t H5IMread_image( hid_t loc_id, - const char *dset_name, +herr_t H5IMread_image( hid_t loc_id, + const char *dset_name, unsigned char *buffer ) { - hid_t did; + hid_t did; /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) @@ -450,7 +450,7 @@ out: * Date: May 01, 2001 * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: @@ -458,18 +458,18 @@ out: *------------------------------------------------------------------------- */ -herr_t H5IMmake_palette( hid_t loc_id, +herr_t H5IMmake_palette( hid_t loc_id, const char *pal_name, const hsize_t *pal_dims, - const unsigned char *pal_data ) + const unsigned char *pal_data ) + +{ -{ - int has_pal; - + /* Check if the dataset already exists */ has_pal = H5LTfind_dataset( loc_id, pal_name ); - + /* It exists. Return */ if ( has_pal == 1 ) return 0; @@ -485,7 +485,7 @@ herr_t H5IMmake_palette( hid_t loc_id, /* Attach the attribute "PAL_VERSION" to the >>palette<< dataset*/ if ( H5LTset_attribute_string( loc_id, pal_name, "PAL_VERSION", "1.2" ) < 0 ) return -1; - + return 0; } @@ -503,23 +503,23 @@ herr_t H5IMmake_palette( hid_t loc_id, * Date: May 01, 2001 * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html - * - * An image (dataset) within an HDF5 file may optionally specify an array of - * palettes to be viewed with. The dataset will have an attribute - * which contains an array of object reference pointers which refer to palettes in the file. + * + * An image (dataset) within an HDF5 file may optionally specify an array of + * palettes to be viewed with. The dataset will have an attribute + * which contains an array of object reference pointers which refer to palettes in the file. * * Modifications: * *------------------------------------------------------------------------- */ -herr_t H5IMlink_palette( hid_t loc_id, - const char *image_name, - const char *pal_name ) +herr_t H5IMlink_palette( hid_t loc_id, + const char *image_name, + const char *pal_name ) -{ +{ hid_t image_id; hid_t attr_type; @@ -532,12 +532,12 @@ herr_t H5IMlink_palette( hid_t loc_id, hsize_t dim_ref; int ok_pal; - /* The image dataset may or may not have the attribute "PALETTE" + /* The image dataset may or may not have the attribute "PALETTE" * First we try to open to see if it is already there; if not, it is created. - * If it exists, the array of references is extended to hold the reference + * If it exists, the array of references is extended to hold the reference * to the new palette */ - + /* First we get the image id */ if ( (image_id = H5Dopen( loc_id, image_name )) < 0 ) return -1; @@ -551,11 +551,11 @@ herr_t H5IMlink_palette( hid_t loc_id, if ( (attr_space_id = H5Screate( H5S_SCALAR )) < 0 ) goto out; - + /* Create the attribute type for the reference */ if ( (attr_type = H5Tcopy( H5T_STD_REF_OBJ )) < 0 ) goto out; - + /* Create the attribute "PALETTE" to be attached to the image*/ if ( (attr_id = H5Acreate( image_id, "PALETTE", attr_type, attr_space_id, H5P_DEFAULT )) < 0 ) goto out; @@ -581,7 +581,7 @@ herr_t H5IMlink_palette( hid_t loc_id, if ( (attr_id = H5Aopen_name( image_id, "PALETTE" )) < 0 ) goto out; - + if ( (attr_type = H5Aget_type( attr_id )) < 0 ) goto out; @@ -615,7 +615,7 @@ herr_t H5IMlink_palette( hid_t loc_id, goto out; /* Create a new reference for this palette. */ - if ( H5Rcreate( &ref, loc_id, pal_name, H5R_OBJECT, -1 ) < 0 ) + if ( H5Rcreate( &ref, loc_id, pal_name, H5R_OBJECT, -1 ) < 0 ) goto out; refbuf[n_refs] = ref; @@ -636,22 +636,22 @@ herr_t H5IMlink_palette( hid_t loc_id, goto out; free( refbuf ); - - } /* H5T_REFERENCE */ - - if ( H5Tclose( attr_type ) < 0 ) + + } /* H5T_REFERENCE */ + + if ( H5Tclose( attr_type ) < 0 ) goto out; - /* Close the attribute. */ + /* Close the attribute. */ if ( H5Aclose( attr_id ) < 0 ) goto out; } - + /* Close the image dataset. */ if ( H5Dclose( image_id ) < 0 ) return -1; - + return 0; out: @@ -673,7 +673,7 @@ out: * Date: September 10, 2001 * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: @@ -681,10 +681,10 @@ out: *------------------------------------------------------------------------- */ -herr_t H5IMunlink_palette( hid_t loc_id, - const char *image_name, - const char *pal_name ) -{ +herr_t H5IMunlink_palette( hid_t loc_id, + const char *image_name, + const char *pal_name ) +{ hid_t image_id; hid_t attr_type; hid_t attr_id; @@ -693,17 +693,17 @@ herr_t H5IMunlink_palette( hid_t loc_id, /* Try to find the palette dataset */ has_pal = H5LTfind_dataset( loc_id, pal_name ); - + /* It does not exist. Return */ if ( has_pal == 0 ) return -1; - /* The image dataset may or not have the attribute "PALETTE" + /* The image dataset may or not have the attribute "PALETTE" * First we try to open to see if it is already there; if not, it is created. - * If it exists, the array of references is extended to hold the reference + * If it exists, the array of references is extended to hold the reference * to the new palette */ - + /* First we get the image id */ if ( (image_id = H5Dopen( loc_id, image_name )) < 0 ) return -1; @@ -720,7 +720,7 @@ herr_t H5IMunlink_palette( hid_t loc_id, { if ( (attr_id = H5Aopen_name( image_id, "PALETTE" )) < 0 ) goto out; - + if ( (attr_type = H5Aget_type( attr_id )) < 0 ) goto out; @@ -735,21 +735,21 @@ herr_t H5IMunlink_palette( hid_t loc_id, if ( H5Adelete( image_id, "PALETTE" ) < 0 ) goto out; - } /* H5T_REFERENCE */ + } /* H5T_REFERENCE */ - if ( H5Tclose( attr_type ) < 0 ) + if ( H5Tclose( attr_type ) < 0 ) goto out; - /* Close the attribute. */ + /* Close the attribute. */ if ( H5Aclose( attr_id ) < 0 ) goto out; } /* ok_pal */ - + /* Close the image dataset. */ if ( H5Dclose( image_id ) < 0 ) return -1; - + return 0; out: @@ -776,8 +776,8 @@ out: *------------------------------------------------------------------------- */ -herr_t H5IMget_npalettes( hid_t loc_id, - const char *image_name, +herr_t H5IMget_npalettes( hid_t loc_id, + const char *image_name, hssize_t *npals ) { hid_t image_id; @@ -802,7 +802,7 @@ herr_t H5IMget_npalettes( hid_t loc_id, if ( (attr_id = H5Aopen_name( image_id, "PALETTE" )) < 0 ) goto out; - + if ( (attr_type = H5Aget_type( attr_id )) < 0 ) goto out; @@ -820,13 +820,13 @@ herr_t H5IMget_npalettes( hid_t loc_id, if ( H5Sclose( attr_space_id ) < 0 ) goto out; - - } /* H5T_REFERENCE */ - - if ( H5Tclose( attr_type ) < 0 ) + + } /* H5T_REFERENCE */ + + if ( H5Tclose( attr_type ) < 0 ) goto out; - /* Close the attribute. */ + /* Close the attribute. */ if ( H5Aclose( attr_id ) < 0 ) goto out; @@ -843,7 +843,7 @@ out: return -1; } - + /*------------------------------------------------------------------------- * Function: H5IMget_palette_info @@ -857,7 +857,7 @@ out: * Date: July 22, 2001 * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: @@ -865,7 +865,7 @@ out: *------------------------------------------------------------------------- */ -herr_t H5IMget_palette_info( hid_t loc_id, +herr_t H5IMget_palette_info( hid_t loc_id, const char *image_name, int pal_number, hsize_t *pal_dims ) @@ -895,7 +895,7 @@ herr_t H5IMget_palette_info( hid_t loc_id, if ( (attr_id = H5Aopen_name( image_id, "PALETTE" )) < 0 ) goto out; - + if ( (attr_type = H5Aget_type( attr_id )) < 0 ) goto out; @@ -931,7 +931,7 @@ herr_t H5IMget_palette_info( hid_t loc_id, if ( H5Sget_simple_extent_ndims( pal_space_id ) < 0 ) goto out; - + if ( H5Sget_simple_extent_dims( pal_space_id, pal_dims, pal_maxdims ) < 0 ) goto out; @@ -946,18 +946,18 @@ herr_t H5IMget_palette_info( hid_t loc_id, goto out; free( refbuf ); - - } /* H5T_REFERENCE */ - - if ( H5Tclose( attr_type ) < 0 ) + + } /* H5T_REFERENCE */ + + if ( H5Tclose( attr_type ) < 0 ) goto out; - /* Close the attribute. */ + /* Close the attribute. */ if ( H5Aclose( attr_id ) < 0 ) goto out; } - + /* Close the image dataset. */ if ( H5Dclose( image_id ) < 0 ) return -1; @@ -969,7 +969,7 @@ out: return -1; } - + /*------------------------------------------------------------------------- * Function: H5IMget_palette @@ -983,7 +983,7 @@ out: * Date: August 30, 2001 * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: @@ -991,7 +991,7 @@ out: *------------------------------------------------------------------------- */ -herr_t H5IMget_palette( hid_t loc_id, +herr_t H5IMget_palette( hid_t loc_id, const char *image_name, int pal_number, unsigned char *pal_data ) @@ -1019,7 +1019,7 @@ herr_t H5IMget_palette( hid_t loc_id, if ( (attr_id = H5Aopen_name( image_id, "PALETTE" )) < 0 ) goto out; - + if ( (attr_type = H5Aget_type( attr_id )) < 0 ) goto out; @@ -1059,13 +1059,13 @@ herr_t H5IMget_palette( hid_t loc_id, goto out; free( refbuf ); - - } /* H5T_REFERENCE */ - - if ( H5Tclose( attr_type ) < 0 ) + + } /* H5T_REFERENCE */ + + if ( H5Tclose( attr_type ) < 0 ) goto out; - /* Close the attribute. */ + /* Close the attribute. */ if ( H5Aclose( attr_id ) < 0 ) goto out; } @@ -1081,7 +1081,7 @@ out: return -1; } - + /*------------------------------------------------------------------------- * Function: H5IMis_image * @@ -1094,7 +1094,7 @@ out: * Date: August 30, 2001 * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: @@ -1102,7 +1102,7 @@ out: *------------------------------------------------------------------------- */ -herr_t H5IMis_image( hid_t loc_id, +herr_t H5IMis_image( hid_t loc_id, const char *dset_name ) { hid_t did; @@ -1133,7 +1133,7 @@ herr_t H5IMis_image( hid_t loc_id, if ( (attr_id = H5Aopen_name( did, "CLASS" )) < 0 ) goto out; - + if ( (attr_type = H5Aget_type( attr_id )) < 0 ) goto out; @@ -1143,12 +1143,12 @@ herr_t H5IMis_image( hid_t loc_id, if ( H5Aread( attr_id, attr_type, attr_data ) < 0 ) goto out; - if( strcmp( attr_data, IMAGE_CLASS ) == 0 ) + if( strcmp( attr_data, IMAGE_CLASS ) == 0 ) ret = 1; else ret = 0; - - if ( H5Tclose( attr_type ) < 0 ) + + if ( H5Tclose( attr_type ) < 0 ) goto out; if ( H5Aclose( attr_id ) < 0 ) @@ -1180,7 +1180,7 @@ out: * Date: August 30, 2001 * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: @@ -1188,7 +1188,7 @@ out: *------------------------------------------------------------------------- */ -herr_t H5IMis_palette( hid_t loc_id, +herr_t H5IMis_palette( hid_t loc_id, const char *dset_name ) { hid_t did; @@ -1219,7 +1219,7 @@ herr_t H5IMis_palette( hid_t loc_id, if ( (attr_id = H5Aopen_name( did, "CLASS" )) < 0 ) goto out; - + if ( (attr_type = H5Aget_type( attr_id )) < 0 ) goto out; @@ -1229,12 +1229,12 @@ herr_t H5IMis_palette( hid_t loc_id, if ( H5Aread( attr_id, attr_type, attr_data ) < 0 ) goto out; - if( strcmp( attr_data, PALETTE_CLASS ) == 0 ) + if( strcmp( attr_data, PALETTE_CLASS ) == 0 ) ret = 1; else ret = 0; - - if ( H5Tclose( attr_type ) < 0 ) + + if ( H5Tclose( attr_type ) < 0 ) goto out; if ( H5Aclose( attr_id ) < 0 ) diff --git a/hl/src/H5IM.h b/hl/src/H5IM.h index b2d96ad..a18434f 100644 --- a/hl/src/H5IM.h +++ b/hl/src/H5IM.h @@ -28,69 +28,69 @@ extern "C" { #define IMAGE24_RANK 3 -H5_HLDLL herr_t H5IMmake_image_8bit( hid_t loc_id, - const char *dset_name, +H5_HLDLL herr_t H5IMmake_image_8bit( hid_t loc_id, + const char *dset_name, hsize_t width, hsize_t height, const unsigned char *buffer ); -H5_HLDLL herr_t H5IMmake_image_24bit( hid_t loc_id, - const char *dset_name, +H5_HLDLL herr_t H5IMmake_image_24bit( hid_t loc_id, + const char *dset_name, hsize_t width, hsize_t height, const char *interlace, const unsigned char *buffer ); -H5_HLDLL herr_t H5IMget_image_info( hid_t loc_id, - const char *dset_name, +H5_HLDLL herr_t H5IMget_image_info( hid_t loc_id, + const char *dset_name, hsize_t *width, hsize_t *height, hsize_t *planes, char *interlace, hssize_t *npals ); -H5_HLDLL herr_t H5IMread_image( hid_t loc_id, - const char *dset_name, +H5_HLDLL herr_t H5IMread_image( hid_t loc_id, + const char *dset_name, unsigned char *buffer ); -H5_HLDLL herr_t H5IMmake_palette( hid_t loc_id, +H5_HLDLL herr_t H5IMmake_palette( hid_t loc_id, const char *pal_name, const hsize_t *pal_dims, const unsigned char *pal_data ); -H5_HLDLL herr_t H5IMlink_palette( hid_t loc_id, - const char *image_name, +H5_HLDLL herr_t H5IMlink_palette( hid_t loc_id, + const char *image_name, const char *pal_name ); -H5_HLDLL herr_t H5IMunlink_palette( hid_t loc_id, - const char *image_name, +H5_HLDLL herr_t H5IMunlink_palette( hid_t loc_id, + const char *image_name, const char *pal_name ); -H5_HLDLL herr_t H5IMget_npalettes( hid_t loc_id, - const char *image_name, +H5_HLDLL herr_t H5IMget_npalettes( hid_t loc_id, + const char *image_name, hssize_t *npals ); -H5_HLDLL herr_t H5IMget_palette_info( hid_t loc_id, - const char *image_name, +H5_HLDLL herr_t H5IMget_palette_info( hid_t loc_id, + const char *image_name, int pal_number, hsize_t *pal_dims ); -H5_HLDLL herr_t H5IMget_palette( hid_t loc_id, +H5_HLDLL herr_t H5IMget_palette( hid_t loc_id, const char *image_name, int pal_number, unsigned char *pal_data ); -H5_HLDLL herr_t H5IMis_image( hid_t loc_id, +H5_HLDLL herr_t H5IMis_image( hid_t loc_id, const char *dset_name ); -H5_HLDLL herr_t H5IMis_palette( hid_t loc_id, +H5_HLDLL herr_t H5IMis_palette( hid_t loc_id, const char *dset_name ); H5_HLDLL herr_t H5IM_find_palette(hid_t loc_id ); - + #ifdef __cplusplus diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index bdd76ef..aab6a37 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -15,23 +15,23 @@ #include /*------------------------------------------------------------------------- - * + * * internal functions - * + * *------------------------------------------------------------------------- */ -herr_t H5LT_open_id( hid_t loc_id, - const char *obj_name, +herr_t H5LT_open_id( hid_t loc_id, + const char *obj_name, int obj_type ); herr_t H5LT_close_id( hid_t obj_id, int obj_type ); /*------------------------------------------------------------------------- - * + * * Public functions - * + * *------------------------------------------------------------------------- */ @@ -54,16 +54,16 @@ herr_t H5LT_close_id( hid_t obj_id, *------------------------------------------------------------------------- */ -herr_t H5LTmake_dataset( hid_t loc_id, - const char *dset_name, - int rank, +herr_t H5LTmake_dataset( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, hid_t tid, - const void *data ) + const void *data ) { - hid_t did, sid; - + hid_t did, sid; + /* Create the data space for the dataset. */ if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 ) return -1; @@ -74,7 +74,7 @@ herr_t H5LTmake_dataset( hid_t loc_id, /* Write the dataset only if there is data to write */ - if ( data ) + if ( data ) { if ( H5Dwrite( did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 ) goto out; @@ -84,7 +84,7 @@ herr_t H5LTmake_dataset( hid_t loc_id, if ( H5Dclose( did ) < 0 ) return -1; - /* Terminate access to the data space. */ + /* Terminate access to the data space. */ if ( H5Sclose( sid ) < 0 ) return -1; @@ -115,15 +115,15 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTmake_dataset_char( hid_t loc_id, - const char *dset_name, - int rank, +herr_t H5LTmake_dataset_char( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, - const char *data ) + const char *data ) { - hid_t did, sid; - + hid_t did, sid; + /* Create the data space for the dataset. */ if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 ) return -1; @@ -134,7 +134,7 @@ herr_t H5LTmake_dataset_char( hid_t loc_id, /* Write the dataset only if there is data to write */ - if ( data ) + if ( data ) { if ( H5Dwrite( did, H5T_NATIVE_CHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 ) goto out; @@ -144,7 +144,7 @@ herr_t H5LTmake_dataset_char( hid_t loc_id, if ( H5Dclose( did ) < 0 ) return -1; - /* Terminate access to the data space. */ + /* Terminate access to the data space. */ if ( H5Sclose( sid ) < 0 ) return -1; @@ -177,15 +177,15 @@ out: */ -herr_t H5LTmake_dataset_short( hid_t loc_id, - const char *dset_name, - int rank, +herr_t H5LTmake_dataset_short( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, - const short *data ) + const short *data ) { - hid_t did, sid; - + hid_t did, sid; + /* Create the data space for the dataset. */ if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 ) return -1; @@ -196,7 +196,7 @@ herr_t H5LTmake_dataset_short( hid_t loc_id, /* Write the dataset only if there is data to write */ - if ( data ) + if ( data ) { if ( H5Dwrite( did, H5T_NATIVE_SHORT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 ) goto out; @@ -206,7 +206,7 @@ herr_t H5LTmake_dataset_short( hid_t loc_id, if ( H5Dclose( did ) < 0 ) return -1; - /* Terminate access to the data space. */ + /* Terminate access to the data space. */ if ( H5Sclose( sid ) < 0 ) return -1; @@ -238,15 +238,15 @@ out: */ -herr_t H5LTmake_dataset_int( hid_t loc_id, - const char *dset_name, - int rank, +herr_t H5LTmake_dataset_int( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, - const int *data ) + const int *data ) { - hid_t did, sid; - + hid_t did, sid; + /* Create the data space for the dataset. */ if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 ) return -1; @@ -257,7 +257,7 @@ herr_t H5LTmake_dataset_int( hid_t loc_id, /* Write the dataset only if there is data to write */ - if ( data ) + if ( data ) { if ( H5Dwrite( did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 ) goto out; @@ -267,7 +267,7 @@ herr_t H5LTmake_dataset_int( hid_t loc_id, if ( H5Dclose( did ) < 0 ) return -1; - /* Terminate access to the data space. */ + /* Terminate access to the data space. */ if ( H5Sclose( sid ) < 0 ) return -1; @@ -301,15 +301,15 @@ out: */ -herr_t H5LTmake_dataset_long( hid_t loc_id, - const char *dset_name, - int rank, +herr_t H5LTmake_dataset_long( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, - const long *data ) + const long *data ) { - hid_t did, sid; - + hid_t did, sid; + /* Create the data space for the dataset. */ if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 ) return -1; @@ -320,7 +320,7 @@ herr_t H5LTmake_dataset_long( hid_t loc_id, /* Write the dataset only if there is data to write */ - if ( data ) + if ( data ) { if ( H5Dwrite( did, H5T_NATIVE_LONG, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 ) goto out; @@ -330,7 +330,7 @@ herr_t H5LTmake_dataset_long( hid_t loc_id, if ( H5Dclose( did ) < 0 ) return -1; - /* Terminate access to the data space. */ + /* Terminate access to the data space. */ if ( H5Sclose( sid ) < 0 ) return -1; @@ -362,15 +362,15 @@ out: */ -herr_t H5LTmake_dataset_float( hid_t loc_id, - const char *dset_name, - int rank, +herr_t H5LTmake_dataset_float( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, - const float *data ) + const float *data ) { - hid_t did, sid; - + hid_t did, sid; + /* Create the data space for the dataset. */ if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 ) return -1; @@ -381,7 +381,7 @@ herr_t H5LTmake_dataset_float( hid_t loc_id, /* Write the dataset only if there is data to write */ - if ( data ) + if ( data ) { if ( H5Dwrite( did, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 ) goto out; @@ -391,7 +391,7 @@ herr_t H5LTmake_dataset_float( hid_t loc_id, if ( H5Dclose( did ) < 0 ) return -1; - /* Terminate access to the data space. */ + /* Terminate access to the data space. */ if ( H5Sclose( sid ) < 0 ) return -1; @@ -425,15 +425,15 @@ out: */ -herr_t H5LTmake_dataset_double( hid_t loc_id, - const char *dset_name, - int rank, +herr_t H5LTmake_dataset_double( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, - const double *data ) + const double *data ) { - hid_t did, sid; - + hid_t did, sid; + /* Create the data space for the dataset. */ if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 ) return -1; @@ -444,7 +444,7 @@ herr_t H5LTmake_dataset_double( hid_t loc_id, /* Write the dataset only if there is data to write */ - if ( data ) + if ( data ) { if ( H5Dwrite( did, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 ) goto out; @@ -454,7 +454,7 @@ herr_t H5LTmake_dataset_double( hid_t loc_id, if ( H5Dclose( did ) < 0 ) return -1; - /* Terminate access to the data space. */ + /* Terminate access to the data space. */ if ( H5Sclose( sid ) < 0 ) return -1; @@ -487,12 +487,12 @@ out: */ -herr_t H5LTmake_dataset_string(hid_t loc_id, - const char *dset_name, - const char *buf ) +herr_t H5LTmake_dataset_string(hid_t loc_id, + const char *dset_name, + const char *buf ) { - hid_t did=-1; + hid_t did=-1; hid_t sid=-1; hid_t tid; size_t size; @@ -508,7 +508,7 @@ herr_t H5LTmake_dataset_string(hid_t loc_id, if ( H5Tset_strpad(tid,H5T_STR_NULLTERM ) < 0 ) goto out; - + /* Create the data space for the dataset. */ if ( (sid = H5Screate( H5S_SCALAR )) < 0 ) goto out; @@ -519,7 +519,7 @@ herr_t H5LTmake_dataset_string(hid_t loc_id, /* Write the dataset only if there is data to write */ - if (buf) + if (buf) { if ( H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0 ) goto out; @@ -557,12 +557,12 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTread_dataset( hid_t loc_id, +herr_t H5LTread_dataset( hid_t loc_id, const char *dset_name, hid_t tid, void *data ) { - hid_t did; + hid_t did; /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) @@ -583,7 +583,7 @@ out: return -1; } - + /*------------------------------------------------------------------------- * Function: H5LTread_dataset_char @@ -599,11 +599,11 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTread_dataset_char( hid_t loc_id, +herr_t H5LTread_dataset_char( hid_t loc_id, const char *dset_name, char *data ) { - hid_t did; + hid_t did; /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) @@ -639,11 +639,11 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTread_dataset_short( hid_t loc_id, +herr_t H5LTread_dataset_short( hid_t loc_id, const char *dset_name, short *data ) { - hid_t did; + hid_t did; /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) @@ -679,11 +679,11 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTread_dataset_int( hid_t loc_id, +herr_t H5LTread_dataset_int( hid_t loc_id, const char *dset_name, int *data ) { - hid_t did; + hid_t did; /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) @@ -719,11 +719,11 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTread_dataset_long( hid_t loc_id, +herr_t H5LTread_dataset_long( hid_t loc_id, const char *dset_name, long *data ) { - hid_t did; + hid_t did; /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) @@ -759,11 +759,11 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTread_dataset_float( hid_t loc_id, +herr_t H5LTread_dataset_float( hid_t loc_id, const char *dset_name, float *data ) { - hid_t did; + hid_t did; /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) @@ -800,11 +800,11 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTread_dataset_double( hid_t loc_id, +herr_t H5LTread_dataset_double( hid_t loc_id, const char *dset_name, double *data ) { - hid_t did; + hid_t did; /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) @@ -841,11 +841,11 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTread_dataset_string( hid_t loc_id, +herr_t H5LTread_dataset_string( hid_t loc_id, const char *dset_name, char *buf ) { - hid_t did; + hid_t did; hid_t tid; /* Open the dataset. */ @@ -889,12 +889,12 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTget_dataset_ndims( hid_t loc_id, +herr_t H5LTget_dataset_ndims( hid_t loc_id, const char *dset_name, int *rank ) { - hid_t did; - hid_t sid; + hid_t did; + hid_t sid; /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) @@ -940,15 +940,15 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTget_dataset_info( hid_t loc_id, +herr_t H5LTget_dataset_info( hid_t loc_id, const char *dset_name, hsize_t *dims, H5T_class_t *type_class, size_t *type_size ) { - hid_t did; + hid_t did; hid_t tid; - hid_t sid; + hid_t sid; /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) @@ -1011,42 +1011,42 @@ out: static herr_t find_dataset( hid_t loc_id, const char *name, void *op_data) { - /* Define a default zero value for return. This will cause the iterator to continue if + /* Define a default zero value for return. This will cause the iterator to continue if * the dataset is not found yet. */ - int ret = 0; + int ret = 0; char *dset_name = (char*)op_data; - + /* Shut the compiler up */ loc_id=loc_id; - /* Define a positive value for return value if the dataset was found. This will - * cause the iterator to immediately return that positive value, - * indicating short-circuit success + /* Define a positive value for return value if the dataset was found. This will + * cause the iterator to immediately return that positive value, + * indicating short-circuit success */ - if( strcmp( name, dset_name ) == 0 ) + if( strcmp( name, dset_name ) == 0 ) ret = 1; return ret; -} +} /*------------------------------------------------------------------------- * Function: H5LTfind_dataset * - * Purpose: Inquires if a dataset named dset_name exists attached + * Purpose: Inquires if a dataset named dset_name exists attached * to the object loc_id. * * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * * Date: July 15, 2001 * - * Return: + * Return: * Success: The return value of the first operator that * returns non-zero, or zero if all members were * processed with no operator returning non-zero. @@ -1058,7 +1058,7 @@ static herr_t find_dataset( hid_t loc_id, const char *name, void *op_data) *------------------------------------------------------------------------- */ -herr_t H5LTfind_dataset( hid_t loc_id, const char *dset_name ) +herr_t H5LTfind_dataset( hid_t loc_id, const char *dset_name ) { herr_t ret; @@ -1070,17 +1070,17 @@ herr_t H5LTfind_dataset( hid_t loc_id, const char *dset_name ) /*------------------------------------------------------------------------- - * + * * Set attribute functions - * + * *------------------------------------------------------------------------- */ - + /*------------------------------------------------------------------------- * Function: H5LTset_attribute_string * - * Purpose: Creates and writes a string attribute named attr_name and attaches + * Purpose: Creates and writes a string attribute named attr_name and attaches * it to the object specified by the name obj_name. * * Return: Success: 0, Failure: -1 @@ -1096,20 +1096,20 @@ herr_t H5LTfind_dataset( hid_t loc_id, const char *dset_name ) *------------------------------------------------------------------------- */ -herr_t H5LTset_attribute_string( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_string( hid_t loc_id, + const char *obj_name, const char *attr_name, - const char *attr_data ) + const char *attr_data ) { hid_t attr_type; hid_t attr_space_id; hid_t attr_id; - hid_t obj_id; + hid_t obj_id; int has_attr; H5G_stat_t statbuf; size_t attr_size; - + /* Get the type of object */ if (H5Gget_objinfo( loc_id, obj_name, 1, &statbuf )<0) return -1; @@ -1150,10 +1150,10 @@ herr_t H5LTset_attribute_string( hid_t loc_id, if ( H5Awrite( attr_id, attr_type, attr_data ) < 0 ) goto out; - + if ( H5Aclose( attr_id ) < 0 ) goto out; - + if ( H5Sclose( attr_space_id ) < 0 ) goto out; @@ -1193,23 +1193,23 @@ out: */ -herr_t H5LT_set_attribute_numerical( hid_t loc_id, - const char *obj_name, +herr_t H5LT_set_attribute_numerical( hid_t loc_id, + const char *obj_name, const char *attr_name, size_t size, hid_t tid, - const void *data ) + const void *data ) { - hid_t obj_id, sid, attr_id; + hid_t obj_id, sid, attr_id; hsize_t dim_size=size; int has_attr; H5G_stat_t statbuf; - + /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -1271,17 +1271,17 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LT_open_id( hid_t loc_id, - const char *obj_name, - int obj_type /*basic object type*/ ) +herr_t H5LT_open_id( hid_t loc_id, + const char *obj_name, + int obj_type /*basic object type*/ ) { - hid_t obj_id = -1; - + hid_t obj_id = -1; + switch ( obj_type ) { case H5G_DATASET: - + /* Open the dataset. */ if ( (obj_id = H5Dopen( loc_id, obj_name )) < 0 ) return -1; @@ -1295,10 +1295,10 @@ herr_t H5LT_open_id( hid_t loc_id, break; default: - return -1; + return -1; } - return obj_id; + return obj_id; } @@ -1320,27 +1320,27 @@ herr_t H5LT_open_id( hid_t loc_id, */ herr_t H5LT_close_id( hid_t obj_id, - int obj_type /*basic object type*/ ) + int obj_type /*basic object type*/ ) { switch ( obj_type ) { case H5G_DATASET: /* Close the dataset. */ if ( H5Dclose( obj_id ) < 0 ) - return -1; + return -1; break; case H5G_GROUP: /* Close the group. */ if ( H5Gclose( obj_id ) < 0 ) - return -1; + return -1; break; default: - return -1; + return -1; } - return 0; + return 0; } @@ -1360,14 +1360,14 @@ herr_t H5LT_close_id( hid_t obj_id, *------------------------------------------------------------------------- */ -herr_t H5LTset_attribute_char( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_char( hid_t loc_id, + const char *obj_name, const char *attr_name, const char *data, - size_t size ) + size_t size ) { - - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, H5T_NATIVE_CHAR, data ) < 0 ) return -1; @@ -1390,14 +1390,14 @@ herr_t H5LTset_attribute_char( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5LTset_attribute_uchar( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_uchar( hid_t loc_id, + const char *obj_name, const char *attr_name, const unsigned char *data, - size_t size ) + size_t size ) { - - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, H5T_NATIVE_UCHAR, data ) < 0 ) return -1; @@ -1421,14 +1421,14 @@ herr_t H5LTset_attribute_uchar( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5LTset_attribute_short( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_short( hid_t loc_id, + const char *obj_name, const char *attr_name, const short *data, - size_t size ) + size_t size ) { - - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, H5T_NATIVE_SHORT, data ) < 0 ) return -1; @@ -1452,14 +1452,14 @@ herr_t H5LTset_attribute_short( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5LTset_attribute_ushort( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_ushort( hid_t loc_id, + const char *obj_name, const char *attr_name, const unsigned short *data, - size_t size ) + size_t size ) { - - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, H5T_NATIVE_USHORT, data ) < 0 ) return -1; @@ -1483,14 +1483,14 @@ herr_t H5LTset_attribute_ushort( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5LTset_attribute_int( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_int( hid_t loc_id, + const char *obj_name, const char *attr_name, const int *data, - size_t size ) + size_t size ) { - - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, H5T_NATIVE_INT, data ) < 0 ) return -1; @@ -1514,14 +1514,14 @@ herr_t H5LTset_attribute_int( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5LTset_attribute_uint( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_uint( hid_t loc_id, + const char *obj_name, const char *attr_name, const unsigned int *data, - size_t size ) + size_t size ) { - - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, H5T_NATIVE_UINT, data ) < 0 ) return -1; @@ -1546,14 +1546,14 @@ herr_t H5LTset_attribute_uint( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5LTset_attribute_long( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_long( hid_t loc_id, + const char *obj_name, const char *attr_name, const long *data, - size_t size ) + size_t size ) { - - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, H5T_NATIVE_LONG, data ) < 0 ) return -1; @@ -1576,14 +1576,14 @@ herr_t H5LTset_attribute_long( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5LTset_attribute_long_long( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_long_long( hid_t loc_id, + const char *obj_name, const char *attr_name, const long_long *data, - size_t size ) + size_t size ) { - - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, H5T_NATIVE_LLONG, data ) < 0 ) return -1; @@ -1608,14 +1608,14 @@ herr_t H5LTset_attribute_long_long( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5LTset_attribute_ulong( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_ulong( hid_t loc_id, + const char *obj_name, const char *attr_name, const unsigned long *data, - size_t size ) + size_t size ) { - - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, H5T_NATIVE_ULONG, data ) < 0 ) return -1; @@ -1641,14 +1641,14 @@ herr_t H5LTset_attribute_ulong( hid_t loc_id, */ -herr_t H5LTset_attribute_float( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_float( hid_t loc_id, + const char *obj_name, const char *attr_name, const float *data, size_t size ) { - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, H5T_NATIVE_FLOAT, data ) < 0 ) return -1; @@ -1673,14 +1673,14 @@ herr_t H5LTset_attribute_float( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5LTset_attribute_double( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_double( hid_t loc_id, + const char *obj_name, const char *attr_name, const double *data, - size_t size ) + size_t size ) { - - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, H5T_NATIVE_DOUBLE, data ) < 0 ) return -1; @@ -1709,28 +1709,28 @@ herr_t H5LTset_attribute_double( hid_t loc_id, static herr_t find_attr( hid_t loc_id, const char *name, void *op_data) { - /* Define a default zero value for return. This will cause the iterator to continue if + /* Define a default zero value for return. This will cause the iterator to continue if * the palette attribute is not found yet. */ - int ret = 0; + int ret = 0; char *attr_name = (char*)op_data; - + /* Shut the compiler up */ loc_id=loc_id; - /* Define a positive value for return value if the attribute was found. This will - * cause the iterator to immediately return that positive value, - * indicating short-circuit success + /* Define a positive value for return value if the attribute was found. This will + * cause the iterator to immediately return that positive value, + * indicating short-circuit success */ - if( strcmp( name, attr_name ) == 0 ) + if( strcmp( name, attr_name ) == 0 ) ret = 1; return ret; -} +} /*------------------------------------------------------------------------- @@ -1745,7 +1745,7 @@ static herr_t find_attr( hid_t loc_id, const char *name, void *op_data) * Comments: * The function uses H5Aiterate with the operator function find_attr * - * Return: + * Return: * Success: The return value of the first operator that * returns non-zero, or zero if all members were * processed with no operator returning non-zero. @@ -1757,10 +1757,10 @@ static herr_t find_attr( hid_t loc_id, const char *name, void *op_data) *------------------------------------------------------------------------- */ -herr_t H5LT_find_attribute( hid_t loc_id, const char* attr_name ) +herr_t H5LT_find_attribute( hid_t loc_id, const char* attr_name ) { - unsigned int attr_num; + unsigned int attr_num; herr_t ret; attr_num = 0; @@ -1785,16 +1785,16 @@ herr_t H5LT_find_attribute( hid_t loc_id, const char* attr_name ) *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute_ndims( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_ndims( hid_t loc_id, + const char *obj_name, const char *attr_name, int *rank ) { - hid_t attr_id; - hid_t sid; + hid_t attr_id; + hid_t sid; H5G_stat_t statbuf; - hid_t obj_id; - + hid_t obj_id; + /* Get the type of object */ if (H5Gget_objinfo( loc_id, obj_name, 1, &statbuf )<0) return -1; @@ -1854,19 +1854,19 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute_info( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_info( hid_t loc_id, + const char *obj_name, const char *attr_name, hsize_t *dims, H5T_class_t *type_class, size_t *type_size ) { - hid_t attr_id; + hid_t attr_id; hid_t tid; - hid_t sid; + hid_t sid; H5G_stat_t statbuf; - hid_t obj_id; - + hid_t obj_id; + /* Get the type of object */ if (H5Gget_objinfo( loc_id, obj_name, 1, &statbuf )<0) return -1; @@ -1936,7 +1936,7 @@ out: /*------------------------------------------------------------------------- * Function: H5LTcreate_compound_type * - * Purpose: + * Purpose: * * Return: Success: 0, Failure: -1 * @@ -1952,19 +1952,19 @@ out: *------------------------------------------------------------------------- */ -hid_t H5LTcreate_compound_type( hsize_t nfields, size_t size, const char *field_names[], - const size_t *field_offset, const hid_t *field_types ) +hid_t H5LTcreate_compound_type( hsize_t nfields, size_t size, const char *field_names[], + const size_t *field_offset, const hid_t *field_types ) { - hid_t tid; + hid_t tid; hsize_t i; - + /* Create the memory data type. */ if ((tid = H5Tcreate (H5T_COMPOUND, size )) < 0 ) goto out; /* Insert fields. */ - for ( i = 0; i < nfields; i++) + for ( i = 0; i < nfields; i++) { if ( H5Tinsert(tid, field_names[i], field_offset[i], field_types[i] ) < 0 ) goto out; @@ -1984,7 +1984,7 @@ out: * Function: H5LTrepack * * Purpose: Packs/Unpacks data from buffers. This function transfers data from a packed - * data, src_buf, to a "natural byte aligned" (an n-byte item at an n-byte boundary) + * data, src_buf, to a "natural byte aligned" (an n-byte item at an n-byte boundary) * data, dst_buf, and vice-versa. * * Return: Success: 0, Failure: -1 @@ -1993,7 +1993,7 @@ out: * * Date: January 17, 2002 * - * Comments: + * Comments: * * Modifications: * @@ -2001,16 +2001,16 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTrepack( hsize_t nfields, - hsize_t nrecords, - size_t src_size, - const size_t *src_offset, - const size_t *src_sizes, - size_t dst_size, - const size_t *dst_offset, +herr_t H5LTrepack( hsize_t nfields, + hsize_t nrecords, + size_t src_size, + const size_t *src_offset, + const size_t *src_sizes, + size_t dst_size, + const size_t *dst_offset, const size_t *dst_sizes, - unsigned char *src_buf, - unsigned char *dst_buf ) + unsigned char *src_buf, + unsigned char *dst_buf ) { hsize_t i, j; /* size of each field of destination data counting with padding */ @@ -2042,12 +2042,12 @@ herr_t H5LTrepack( hsize_t nfields, src_buf += src_sizes[j]; } - + } - + if ( size_pad != NULL ) free( size_pad ); - + return 0; out: @@ -2057,9 +2057,9 @@ out: /*------------------------------------------------------------------------- - * + * * Get attribute functions - * + * *------------------------------------------------------------------------- */ @@ -2083,10 +2083,10 @@ out: */ -herr_t H5LTget_attribute_string( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_string( hid_t loc_id, + const char *obj_name, const char *attr_name, - char *data ) + char *data ) { /* identifiers */ @@ -2096,7 +2096,7 @@ herr_t H5LTget_attribute_string( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2130,10 +2130,10 @@ herr_t H5LTget_attribute_string( hid_t loc_id, * *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute_char( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_char( hid_t loc_id, + const char *obj_name, const char *attr_name, - char *data ) + char *data ) { /* identifiers */ @@ -2143,7 +2143,7 @@ herr_t H5LTget_attribute_char( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2177,10 +2177,10 @@ herr_t H5LTget_attribute_char( hid_t loc_id, * *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute_uchar( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_uchar( hid_t loc_id, + const char *obj_name, const char *attr_name, - unsigned char *data ) + unsigned char *data ) { /* identifiers */ @@ -2190,7 +2190,7 @@ herr_t H5LTget_attribute_uchar( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2226,10 +2226,10 @@ herr_t H5LTget_attribute_uchar( hid_t loc_id, * *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute_short( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_short( hid_t loc_id, + const char *obj_name, const char *attr_name, - short *data ) + short *data ) { /* identifiers */ @@ -2239,7 +2239,7 @@ herr_t H5LTget_attribute_short( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2273,10 +2273,10 @@ herr_t H5LTget_attribute_short( hid_t loc_id, * *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute_ushort( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_ushort( hid_t loc_id, + const char *obj_name, const char *attr_name, - unsigned short *data ) + unsigned short *data ) { /* identifiers */ @@ -2286,7 +2286,7 @@ herr_t H5LTget_attribute_ushort( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2322,10 +2322,10 @@ herr_t H5LTget_attribute_ushort( hid_t loc_id, * *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute_int( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_int( hid_t loc_id, + const char *obj_name, const char *attr_name, - int *data ) + int *data ) { /* identifiers */ @@ -2335,7 +2335,7 @@ herr_t H5LTget_attribute_int( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2369,10 +2369,10 @@ herr_t H5LTget_attribute_int( hid_t loc_id, * *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute_uint( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_uint( hid_t loc_id, + const char *obj_name, const char *attr_name, - unsigned int *data ) + unsigned int *data ) { /* identifiers */ @@ -2382,7 +2382,7 @@ herr_t H5LTget_attribute_uint( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2418,10 +2418,10 @@ herr_t H5LTget_attribute_uint( hid_t loc_id, * *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute_long( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_long( hid_t loc_id, + const char *obj_name, const char *attr_name, - long *data ) + long *data ) { /* identifiers */ @@ -2431,7 +2431,7 @@ herr_t H5LTget_attribute_long( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2464,10 +2464,10 @@ herr_t H5LTget_attribute_long( hid_t loc_id, * *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute_long_long( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_long_long( hid_t loc_id, + const char *obj_name, const char *attr_name, - long_long *data ) + long_long *data ) { /* identifiers */ @@ -2477,7 +2477,7 @@ herr_t H5LTget_attribute_long_long( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2512,10 +2512,10 @@ herr_t H5LTget_attribute_long_long( hid_t loc_id, * *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute_ulong( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_ulong( hid_t loc_id, + const char *obj_name, const char *attr_name, - unsigned long *data ) + unsigned long *data ) { /* identifiers */ @@ -2525,7 +2525,7 @@ herr_t H5LTget_attribute_ulong( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2562,10 +2562,10 @@ herr_t H5LTget_attribute_ulong( hid_t loc_id, */ -herr_t H5LTget_attribute_float( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_float( hid_t loc_id, + const char *obj_name, const char *attr_name, - float *data ) + float *data ) { /* identifiers */ @@ -2575,7 +2575,7 @@ herr_t H5LTget_attribute_float( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2612,10 +2612,10 @@ herr_t H5LTget_attribute_float( hid_t loc_id, */ -herr_t H5LTget_attribute_double( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_double( hid_t loc_id, + const char *obj_name, const char *attr_name, - double *data ) + double *data ) { /* identifiers */ @@ -2625,7 +2625,7 @@ herr_t H5LTget_attribute_double( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2662,11 +2662,11 @@ herr_t H5LTget_attribute_double( hid_t loc_id, */ -herr_t H5LTget_attribute( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute( hid_t loc_id, + const char *obj_name, const char *attr_name, hid_t mem_type_id, - void *data ) + void *data ) { /* identifiers */ @@ -2676,7 +2676,7 @@ herr_t H5LTget_attribute( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2695,7 +2695,7 @@ herr_t H5LTget_attribute( hid_t loc_id, return 0; } - + /*------------------------------------------------------------------------- * private functions *------------------------------------------------------------------------- @@ -2721,10 +2721,10 @@ herr_t H5LTget_attribute( hid_t loc_id, */ -herr_t H5LT_get_attribute_mem( hid_t obj_id, +herr_t H5LT_get_attribute_mem( hid_t obj_id, const char *attr_name, hid_t mem_type_id, - void *data ) + void *data ) { /* identifiers */ @@ -2764,9 +2764,9 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LT_get_attribute_disk( hid_t loc_id, +herr_t H5LT_get_attribute_disk( hid_t loc_id, const char *attr_name, - void *attr_out ) + void *attr_out ) { /* identifiers */ hid_t attr_id; @@ -2780,7 +2780,7 @@ herr_t H5LT_get_attribute_disk( hid_t loc_id, if ( H5Aread( attr_id, attr_type, attr_out ) < 0 ) goto out; - + if ( H5Tclose( attr_type ) < 0 ) goto out; @@ -2818,26 +2818,26 @@ out: */ -herr_t H5LT_set_attribute_string(hid_t dset_id, +herr_t H5LT_set_attribute_string(hid_t dset_id, char *name, - char *buf ) + char *buf ) { hid_t tid; hid_t sid; hid_t aid; int has_attr; size_t size; - + /* verify if the attribute already exists */ has_attr = H5LT_find_attribute(dset_id,name); - + /* the attribute already exists, delete it */ if ( has_attr == 1 ) { if ( H5Adelete(dset_id,name)<0) return FAIL; } - + /*------------------------------------------------------------------------- * create the attribute type *------------------------------------------------------------------------- @@ -2856,7 +2856,7 @@ herr_t H5LT_set_attribute_string(hid_t dset_id, if ((sid = H5Screate(H5S_SCALAR))<0) goto out; - + /*------------------------------------------------------------------------- * create and write the attribute *------------------------------------------------------------------------- @@ -2866,10 +2866,10 @@ herr_t H5LT_set_attribute_string(hid_t dset_id, if (H5Awrite(aid,tid,buf)<0) goto out; - + if (H5Aclose(aid)<0) goto out; - + if (H5Sclose(sid)<0) goto out; @@ -2877,7 +2877,7 @@ herr_t H5LT_set_attribute_string(hid_t dset_id, goto out; return SUCCESS; - + /* error zone, gracefully close */ out: H5E_BEGIN_TRY { @@ -2886,6 +2886,6 @@ out: H5Sclose(sid); } H5E_END_TRY; return FAIL; - + } diff --git a/hl/src/H5LT.h b/hl/src/H5LT.h index 53b97ba..c9d6269 100644 --- a/hl/src/H5LT.h +++ b/hl/src/H5LT.h @@ -46,51 +46,51 @@ extern "C" { *------------------------------------------------------------------------- */ -H5_HLDLL herr_t H5LTmake_dataset( hid_t loc_id, - const char *dset_name, - int rank, +H5_HLDLL herr_t H5LTmake_dataset( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, hid_t type_id, const void *buffer ); -H5_HLDLL herr_t H5LTmake_dataset_char( hid_t loc_id, - const char *dset_name, - int rank, +H5_HLDLL herr_t H5LTmake_dataset_char( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, const char *buffer ); -H5_HLDLL herr_t H5LTmake_dataset_short( hid_t loc_id, - const char *dset_name, - int rank, +H5_HLDLL herr_t H5LTmake_dataset_short( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, const short *buffer ); -H5_HLDLL herr_t H5LTmake_dataset_int( hid_t loc_id, - const char *dset_name, - int rank, +H5_HLDLL herr_t H5LTmake_dataset_int( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, const int *buffer ); -H5_HLDLL herr_t H5LTmake_dataset_long( hid_t loc_id, - const char *dset_name, - int rank, +H5_HLDLL herr_t H5LTmake_dataset_long( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, const long *buffer ); -H5_HLDLL herr_t H5LTmake_dataset_float( hid_t loc_id, - const char *dset_name, - int rank, +H5_HLDLL herr_t H5LTmake_dataset_float( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, const float *buffer ); -H5_HLDLL herr_t H5LTmake_dataset_double( hid_t loc_id, - const char *dset_name, - int rank, +H5_HLDLL herr_t H5LTmake_dataset_double( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, const double *buffer ); -H5_HLDLL herr_t H5LTmake_dataset_string( hid_t loc_id, - const char *dset_name, +H5_HLDLL herr_t H5LTmake_dataset_string( hid_t loc_id, + const char *dset_name, const char *buf ); @@ -101,36 +101,36 @@ H5_HLDLL herr_t H5LTmake_dataset_string( hid_t loc_id, *------------------------------------------------------------------------- */ -H5_HLDLL herr_t H5LTread_dataset( hid_t loc_id, +H5_HLDLL herr_t H5LTread_dataset( hid_t loc_id, const char *dset_name, hid_t type_id, void *buffer ); -H5_HLDLL herr_t H5LTread_dataset_char( hid_t loc_id, +H5_HLDLL herr_t H5LTread_dataset_char( hid_t loc_id, const char *dset_name, char *buffer ); -H5_HLDLL herr_t H5LTread_dataset_short( hid_t loc_id, +H5_HLDLL herr_t H5LTread_dataset_short( hid_t loc_id, const char *dset_name, short *buffer ); -H5_HLDLL herr_t H5LTread_dataset_int( hid_t loc_id, +H5_HLDLL herr_t H5LTread_dataset_int( hid_t loc_id, const char *dset_name, int *buffer ); -H5_HLDLL herr_t H5LTread_dataset_long( hid_t loc_id, +H5_HLDLL herr_t H5LTread_dataset_long( hid_t loc_id, const char *dset_name, long *buffer ); -H5_HLDLL herr_t H5LTread_dataset_float( hid_t loc_id, +H5_HLDLL herr_t H5LTread_dataset_float( hid_t loc_id, const char *dset_name, float *buffer ); -H5_HLDLL herr_t H5LTread_dataset_double( hid_t loc_id, +H5_HLDLL herr_t H5LTread_dataset_double( hid_t loc_id, const char *dset_name, double *buffer ); -H5_HLDLL herr_t H5LTread_dataset_string( hid_t loc_id, +H5_HLDLL herr_t H5LTread_dataset_string( hid_t loc_id, const char *dset_name, char *buf ); @@ -142,17 +142,17 @@ H5_HLDLL herr_t H5LTread_dataset_string( hid_t loc_id, */ -H5_HLDLL herr_t H5LTget_dataset_ndims( hid_t loc_id, +H5_HLDLL herr_t H5LTget_dataset_ndims( hid_t loc_id, const char *dset_name, int *rank ); -H5_HLDLL herr_t H5LTget_dataset_info( hid_t loc_id, +H5_HLDLL herr_t H5LTget_dataset_info( hid_t loc_id, const char *dset_name, hsize_t *dims, H5T_class_t *type_class, size_t *type_size ); -H5_HLDLL herr_t H5LTfind_dataset( hid_t loc_id, const char *name ); +H5_HLDLL herr_t H5LTfind_dataset( hid_t loc_id, const char *name ); @@ -164,73 +164,73 @@ H5_HLDLL herr_t H5LTfind_dataset( hid_t loc_id, const char *name ); */ -H5_HLDLL herr_t H5LTset_attribute_string( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_string( hid_t loc_id, + const char *obj_name, const char *attr_name, const char *attr_data ); -H5_HLDLL herr_t H5LTset_attribute_char( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_char( hid_t loc_id, + const char *obj_name, const char *attr_name, const char *buffer, size_t size ); -H5_HLDLL herr_t H5LTset_attribute_uchar( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_uchar( hid_t loc_id, + const char *obj_name, const char *attr_name, const unsigned char *buffer, size_t size ); -H5_HLDLL herr_t H5LTset_attribute_short( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_short( hid_t loc_id, + const char *obj_name, const char *attr_name, const short *buffer, size_t size ); -H5_HLDLL herr_t H5LTset_attribute_ushort( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_ushort( hid_t loc_id, + const char *obj_name, const char *attr_name, const unsigned short *buffer, size_t size ); -H5_HLDLL herr_t H5LTset_attribute_int( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_int( hid_t loc_id, + const char *obj_name, const char *attr_name, const int *buffer, size_t size ); -H5_HLDLL herr_t H5LTset_attribute_uint( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_uint( hid_t loc_id, + const char *obj_name, const char *attr_name, const unsigned int *buffer, size_t size ); -H5_HLDLL herr_t H5LTset_attribute_long( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_long( hid_t loc_id, + const char *obj_name, const char *attr_name, const long *buffer, size_t size ); -H5_HLDLL herr_t H5LTset_attribute_long_long( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_long_long( hid_t loc_id, + const char *obj_name, const char *attr_name, const long_long *buffer, size_t size ); -H5_HLDLL herr_t H5LTset_attribute_ulong( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_ulong( hid_t loc_id, + const char *obj_name, const char *attr_name, const unsigned long *buffer, size_t size ); -H5_HLDLL herr_t H5LTset_attribute_float( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_float( hid_t loc_id, + const char *obj_name, const char *attr_name, const float *buffer, size_t size ); -H5_HLDLL herr_t H5LTset_attribute_double( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_double( hid_t loc_id, + const char *obj_name, const char *attr_name, const double *buffer, size_t size ); @@ -242,69 +242,69 @@ H5_HLDLL herr_t H5LTset_attribute_double( hid_t loc_id, *------------------------------------------------------------------------- */ -H5_HLDLL herr_t H5LTget_attribute( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute( hid_t loc_id, + const char *obj_name, const char *attr_name, hid_t mem_type_id, void *data ); -H5_HLDLL herr_t H5LTget_attribute_string( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_string( hid_t loc_id, + const char *obj_name, const char *attr_name, char *data ); -H5_HLDLL herr_t H5LTget_attribute_char( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_char( hid_t loc_id, + const char *obj_name, const char *attr_name, char *data ); -H5_HLDLL herr_t H5LTget_attribute_uchar( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_uchar( hid_t loc_id, + const char *obj_name, const char *attr_name, unsigned char *data ); -H5_HLDLL herr_t H5LTget_attribute_short( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_short( hid_t loc_id, + const char *obj_name, const char *attr_name, short *data ); -H5_HLDLL herr_t H5LTget_attribute_ushort( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_ushort( hid_t loc_id, + const char *obj_name, const char *attr_name, unsigned short *data ); -H5_HLDLL herr_t H5LTget_attribute_int( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_int( hid_t loc_id, + const char *obj_name, const char *attr_name, int *data ); -H5_HLDLL herr_t H5LTget_attribute_uint( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_uint( hid_t loc_id, + const char *obj_name, const char *attr_name, unsigned int *data ); -H5_HLDLL herr_t H5LTget_attribute_long( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_long( hid_t loc_id, + const char *obj_name, const char *attr_name, long *data ); -H5_HLDLL herr_t H5LTget_attribute_long_long( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_long_long( hid_t loc_id, + const char *obj_name, const char *attr_name, long_long *data ); -H5_HLDLL herr_t H5LTget_attribute_ulong( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_ulong( hid_t loc_id, + const char *obj_name, const char *attr_name, unsigned long *data ); -H5_HLDLL herr_t H5LTget_attribute_float( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_float( hid_t loc_id, + const char *obj_name, const char *attr_name, float *data ); -H5_HLDLL herr_t H5LTget_attribute_double( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_double( hid_t loc_id, + const char *obj_name, const char *attr_name, double *data ); @@ -317,13 +317,13 @@ H5_HLDLL herr_t H5LTget_attribute_double( hid_t loc_id, */ -H5_HLDLL herr_t H5LTget_attribute_ndims( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_ndims( hid_t loc_id, + const char *obj_name, const char *attr_name, int *rank ); -H5_HLDLL herr_t H5LTget_attribute_info( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_info( hid_t loc_id, + const char *obj_name, const char *attr_name, hsize_t *dims, H5T_class_t *type_class, @@ -341,51 +341,51 @@ H5_HLDLL herr_t H5LTget_attribute_info( hid_t loc_id, */ -H5_HLDLL hid_t H5LTcreate_compound_type( hsize_t nfields, size_t size, const char *field_names[], +H5_HLDLL hid_t H5LTcreate_compound_type( hsize_t nfields, size_t size, const char *field_names[], const size_t *field_offset, const hid_t *field_types ); -H5_HLDLL herr_t H5LTrepack( hsize_t nfields, - hsize_t nrecords, - size_t src_size, - const size_t *src_offset, - const size_t *src_sizes, - size_t dst_size, - const size_t *dst_offset, +H5_HLDLL herr_t H5LTrepack( hsize_t nfields, + hsize_t nrecords, + size_t src_size, + const size_t *src_offset, + const size_t *src_sizes, + size_t dst_size, + const size_t *dst_offset, const size_t *dst_sizes, - unsigned char *src_buf, + unsigned char *src_buf, unsigned char *dst_buf ); /*------------------------------------------------------------------------- - * + * * Private functions - * + * *------------------------------------------------------------------------- */ -H5_HLDLL herr_t H5LT_get_attribute_mem( hid_t obj_id, +H5_HLDLL herr_t H5LT_get_attribute_mem( hid_t obj_id, const char *attr_name, hid_t mem_type_id, void *data ); -H5_HLDLL herr_t H5LT_get_attribute_disk( hid_t obj_id, +H5_HLDLL herr_t H5LT_get_attribute_disk( hid_t obj_id, const char *attr_name, void *data ); -H5_HLDLL herr_t H5LT_find_attribute( hid_t loc_id, const char *name ); +H5_HLDLL herr_t H5LT_find_attribute( hid_t loc_id, const char *name ); -H5_HLDLL herr_t H5LT_set_attribute_numerical( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LT_set_attribute_numerical( hid_t loc_id, + const char *obj_name, const char *attr_name, size_t size, hid_t type_id, const void *data ); -H5_HLDLL herr_t H5LT_set_attribute_string( hid_t dset_id, +H5_HLDLL herr_t H5LT_set_attribute_string( hid_t dset_id, char *name, char *buf ); diff --git a/hl/src/H5PT.c b/hl/src/H5PT.c index d59e9ed..083e0e7 100644 --- a/hl/src/H5PT.c +++ b/hl/src/H5PT.c @@ -54,8 +54,8 @@ herr_t H5PT_set_index(htbl_t *table_id, hsize_t pt_index); * * Date: March 12, 2004 * - * Comments: This function does not handle compression or fill data - * currently. Fill data is not necessary because the + * Comments: This function does not handle compression or fill data + * currently. Fill data is not necessary because the * table is initially of size 0. * * Modifications: @@ -112,7 +112,7 @@ hid_t H5PTcreate_fl ( hid_t loc_id, /* Create the table identifier */ table->dset_id = dset_id; - if((table->type_id = H5Tcopy(dtype_id)) <0) + if((table->type_id = H5Tcopy(dtype_id)) <0) goto out; H5PT_create_index(table); @@ -152,8 +152,8 @@ hid_t H5PTcreate_fl ( hid_t loc_id, * * Date: April 12, 2004 * - * Comments: This function does not handle compression or fill data - * currently. Fill data is not necessary because the + * Comments: This function does not handle compression or fill data + * currently. Fill data is not necessary because the * table is initially of size 0. * * Modifications: @@ -200,7 +200,7 @@ out: * * Date: March 10, 2004 * - * Comments: + * Comments: * * Modifications: * @@ -273,7 +273,7 @@ out: /*------------------------------------------------------------------------- * Function: H5PT_close * - * Purpose: Closes a table (i.e. cleans up all open resources used by a + * Purpose: Closes a table (i.e. cleans up all open resources used by a * table). * * Return: Success: 0, Failure: -1 @@ -283,7 +283,7 @@ out: * * Date: March 10, 2004 * - * Comments: + * Comments: * * Modifications: * @@ -321,7 +321,7 @@ out: /*------------------------------------------------------------------------- * Function: H5PTclose * - * Purpose: Closes a table (i.e. cleans up all open resources used by a + * Purpose: Closes a table (i.e. cleans up all open resources used by a * table). * * Return: Success: 0, Failure: -1 @@ -331,7 +331,7 @@ out: * * Date: April 21, 2004 * - * Comments: + * Comments: * * Modifications: * @@ -386,7 +386,7 @@ out: * * Date: March 12, 2004 * - * Comments: + * Comments: * * Modifications: * @@ -406,7 +406,7 @@ herr_t H5PTappend( hid_t table_id, if (nrecords == 0) return 0; - if((H5TBcommon_append_records(table->dset_id, table->type_id, + if((H5TBcommon_append_records(table->dset_id, table->type_id, nrecords, table->size, data)) <0) goto out; @@ -427,9 +427,9 @@ out: /*------------------------------------------------------------------------- - * Function: H5PTget_next + * Function: H5PTget_next * - * Purpose: Reads packets starting at the current index and updates + * Purpose: Reads packets starting at the current index and updates * that index * * Return: Success: 0, Failure: -1 @@ -441,7 +441,7 @@ out: * * Comments: * - * Modifications: + * Modifications: * * *------------------------------------------------------------------------- @@ -460,7 +460,7 @@ herr_t H5PTget_next( hid_t table_id, if (nrecords == 0) return 0; - if((H5TBcommon_read_records(table->dset_id, table->type_id, + if((H5TBcommon_read_records(table->dset_id, table->type_id, table->current_index, nrecords, table->size, data)) < 0) goto out; @@ -473,7 +473,7 @@ out: } /*------------------------------------------------------------------------- - * Function: H5PTread_packets + * Function: H5PTread_packets * * Purpose: Reads packets from anywhere in a packet table * @@ -484,9 +484,9 @@ out: * * Date: March 12, 2004 * - * Comments: + * Comments: * - * Modifications: + * Modifications: * * *------------------------------------------------------------------------- @@ -507,7 +507,7 @@ herr_t H5PTread_packets( hid_t table_id, if (nrecords == 0) return 0; - if( H5TBcommon_read_records(table->dset_id, table->type_id, + if( H5TBcommon_read_records(table->dset_id, table->type_id, start, nrecords, table->size, data) < 0) goto out; @@ -518,9 +518,9 @@ out: } /*------------------------------------------------------------------------- - * + * * Table attribute functions - * + * *------------------------------------------------------------------------- */ @@ -536,9 +536,9 @@ out: * * Date: March 12, 2004 * - * Comments: + * Comments: * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ @@ -578,9 +578,9 @@ herr_t H5PT_set_index(htbl_t *table, hsize_t index) * * Date: April 23, 2004 * - * Comments: + * Comments: * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ @@ -613,7 +613,7 @@ herr_t H5PTset_index(hid_t table_id, hsize_t pt_index) */ /*------------------------------------------------------------------------- - * Function: H5PTget_num_packets + * Function: H5PTget_num_packets * * Purpose: Returns by reference the number of packets in the dataset * @@ -626,7 +626,7 @@ herr_t H5PTset_index(hid_t table_id, hsize_t pt_index) * * Comments: * - * Modifications: + * Modifications: * * *------------------------------------------------------------------------- @@ -648,7 +648,7 @@ out: /*------------------------------------------------------------------------- - * Function: H5PTis_valid + * Function: H5PTis_valid * * Purpose: Validates a table identifier * @@ -661,7 +661,7 @@ out: * * Comments: * - * Modifications: + * Modifications: * * *------------------------------------------------------------------------- @@ -676,7 +676,7 @@ herr_t H5PTis_valid(hid_t table_id) } /*------------------------------------------------------------------------- - * Function: H5PTis_varlen + * Function: H5PTis_varlen * * Purpose: Returns 1 if a table_id corresponds to a packet table of variable- * length records or 0 for fixed-length records. @@ -690,7 +690,7 @@ herr_t H5PTis_valid(hid_t table_id) * * Comments: * - * Modifications: + * Modifications: * * *------------------------------------------------------------------------- @@ -716,16 +716,16 @@ out: } /*------------------------------------------------------------------------- - * + * * Memory Management functions - * + * *------------------------------------------------------------------------- */ /*------------------------------------------------------------------------- * Function: H5PTfree_vlen_readbuff * - * Purpose: Frees memory used when reading from a variable length packet + * Purpose: Frees memory used when reading from a variable length packet * table. * * Return: Success: 0, Failure: -1 @@ -738,7 +738,7 @@ out: * * Comments: * - * Modifications: + * Modifications: * * *------------------------------------------------------------------------- diff --git a/hl/src/H5PT.h b/hl/src/H5PT.h index 699419e..9d07131 100644 --- a/hl/src/H5PT.h +++ b/hl/src/H5PT.h @@ -90,9 +90,9 @@ H5_HLDLL herr_t H5PTis_valid( hid_t table_id ); H5_HLDLL herr_t H5PTis_varlen( hid_t table_id ); /*------------------------------------------------------------------------- - * + * * Packet Table "current index" functions - * + * *------------------------------------------------------------------------- */ @@ -102,9 +102,9 @@ H5_HLDLL herr_t H5PTset_index( hid_t table_id, hsize_t pt_index ); /*------------------------------------------------------------------------- - * + * * Memory Management functions - * + * *------------------------------------------------------------------------- */ diff --git a/hl/src/H5TB.c b/hl/src/H5TB.c index 59642da..c67747f 100644 --- a/hl/src/H5TB.c +++ b/hl/src/H5TB.c @@ -21,25 +21,25 @@ /*------------------------------------------------------------------------- - * + * * Private functions - * + * *------------------------------------------------------------------------- */ -int H5TB_find_field(const char *field, +int H5TB_find_field(const char *field, const char *field_list); -herr_t H5TB_attach_attributes(const char *table_title, - hid_t loc_id, +herr_t H5TB_attach_attributes(const char *table_title, + hid_t loc_id, const char *dset_name, - hsize_t nfields, + hsize_t nfields, hid_t tid ); -hid_t H5TB_create_type(hid_t loc_id, +hid_t H5TB_create_type(hid_t loc_id, const char *dset_name, - size_t dst_size, - const size_t *dst_offset, + size_t dst_size, + const size_t *dst_offset, const size_t *dst_sizes, hid_t ftype_id); @@ -64,14 +64,14 @@ hid_t H5TB_create_type(hid_t loc_id, * * Comments: The data is packed * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ herr_t H5TBmake_table( const char *table_title, - hid_t loc_id, + hid_t loc_id, const char *dset_name, hsize_t nfields, hsize_t nrecords, @@ -82,12 +82,12 @@ herr_t H5TBmake_table( const char *table_title, hsize_t chunk_size, void *fill_data, int compress, - const void *data ) + const void *data ) { hid_t did; - hid_t sid; - hid_t mem_type_id; + hid_t sid; + hid_t mem_type_id; hid_t plist_id; hsize_t dims[1]; hsize_t dims_chunk[1]; @@ -107,7 +107,7 @@ herr_t H5TBmake_table( const char *table_title, return -1; /* Insert fields. */ - for ( i = 0; i < nfields; i++) + for ( i = 0; i < nfields; i++) { if ( H5Tinsert(mem_type_id, field_names[i], field_offset[i], field_types[i] ) < 0 ) return -1; @@ -125,25 +125,25 @@ herr_t H5TBmake_table( const char *table_title, /* Set the fill value using a struct as the data type. */ if ( fill_data ) { - if ( H5Pset_fill_value( plist_id, mem_type_id, fill_data ) < 0 ) + if ( H5Pset_fill_value( plist_id, mem_type_id, fill_data ) < 0 ) return -1; } - /* - Dataset creation property list is modified to use - GZIP compression with the compression effort set to 6. - Note that compression can be used only when dataset is chunked. + /* + Dataset creation property list is modified to use + GZIP compression with the compression effort set to 6. + Note that compression can be used only when dataset is chunked. */ if ( compress ) { - if ( H5Pset_deflate( plist_id, 6) < 0 ) + if ( H5Pset_deflate( plist_id, 6) < 0 ) return -1; } - + /* Create the dataset. */ if ( (did = H5Dcreate( loc_id, dset_name, mem_type_id, sid, plist_id )) < 0 ) goto out; - + /* Only write if there is something to write */ if ( data ) { @@ -151,8 +151,8 @@ herr_t H5TBmake_table( const char *table_title, if ( H5Dwrite( did, mem_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 ) goto out; } - - /* Terminate access to the data space. */ + + /* Terminate access to the data space. */ if ( H5Sclose( sid ) < 0 ) goto out; @@ -168,7 +168,7 @@ herr_t H5TBmake_table( const char *table_title, * Set the conforming table attributes *------------------------------------------------------------------------- */ - + /* Attach the CLASS attribute */ if ( H5LTset_attribute_string( loc_id, dset_name, "CLASS", TABLE_CLASS ) < 0 ) goto out; @@ -176,7 +176,7 @@ herr_t H5TBmake_table( const char *table_title, /* Attach the VERSION attribute */ if ( H5LTset_attribute_string( loc_id, dset_name, "VERSION", "2.0" ) < 0 ) goto out; - + /* Attach the TITLE attribute */ if ( H5LTset_attribute_string( loc_id, dset_name, "TITLE", table_title ) < 0 ) goto out; @@ -193,7 +193,7 @@ herr_t H5TBmake_table( const char *table_title, strcat( attr_name, aux ); sprintf( aux, "%s", "_NAME" ); strcat( attr_name, aux ); - + /* Attach the attribute */ if ( H5LTset_attribute_string( loc_id, dset_name, attr_name, member_name ) < 0 ) goto out; @@ -211,7 +211,7 @@ herr_t H5TBmake_table( const char *table_title, /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) return -1; - + if (( sid = H5Screate(H5S_SCALAR)) < 0 ) goto out; @@ -229,28 +229,28 @@ herr_t H5TBmake_table( const char *table_title, if ( (attr_id = H5Acreate( did, attr_name, field_types[i], sid, H5P_DEFAULT )) < 0 ) goto out; - + if ( H5Awrite( attr_id, field_types[i], tmp_buf+field_offset[i] ) < 0 ) goto out; - + if ( H5Aclose( attr_id ) < 0 ) goto out; free( member_name ); } - + /* Close the dataset. */ H5Dclose( did ); - /* Close data space. */ + /* Close data space. */ H5Sclose( sid ); } - + /* Release the datatype. */ if ( H5Tclose( mem_type_id ) < 0 ) return -1; - - + + return 0; /* error zone, gracefully close */ @@ -279,7 +279,7 @@ out: * * Return: Success: 0, Failure: -1 * - * Programmers: + * Programmers: * Pedro Vicente, pvn@ncsa.uiuc.edu * Quincey Koziol * @@ -287,23 +287,23 @@ out: * * Comments: Uses memory offsets * - * Modifications: April 1, 2004 - * the DST_SIZES parameter is used to define the memory type ID - * returned by H5TB_create_type + * Modifications: April 1, 2004 + * the DST_SIZES parameter is used to define the memory type ID + * returned by H5TB_create_type * *------------------------------------------------------------------------- */ -herr_t H5TBappend_records( hid_t loc_id, +herr_t H5TBappend_records( hid_t loc_id, const char *dset_name, hsize_t nrecords, size_t dst_size, const size_t *dst_offset, const size_t *dst_sizes, - const void *data ) + const void *data ) { hid_t did; - hid_t tid=-1; + hid_t tid=-1; hid_t mem_type_id=-1; hid_t sid=-1; hid_t mem_space_id=-1; @@ -327,7 +327,7 @@ herr_t H5TBappend_records( hid_t loc_id, /* Append the records */ if ((H5TBcommon_append_records(did, mem_type_id, nrecords, nrecords_orig, data))<0) - goto out; + goto out; /* Release the datatype. */ if ( H5Tclose( tid ) < 0 ) @@ -341,7 +341,7 @@ herr_t H5TBappend_records( hid_t loc_id, if ( H5Dclose( did ) < 0 ) goto out; - + return 0; /* error zone, gracefully close */ @@ -369,27 +369,27 @@ out: * * Comments: Uses memory offsets * - * Modifications: April 1, 2004 - * the DST_SIZES parameter is used to define the memory type ID - * returned by H5TB_create_type + * Modifications: April 1, 2004 + * the DST_SIZES parameter is used to define the memory type ID + * returned by H5TB_create_type * *------------------------------------------------------------------------- */ -herr_t H5TBwrite_records( hid_t loc_id, +herr_t H5TBwrite_records( hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nrecords, size_t dst_size, const size_t *dst_offset, const size_t *dst_sizes, - const void *data ) + const void *data ) { hid_t did; - hid_t tid; - hsize_t count[1]; + hid_t tid; + hsize_t count[1]; hsize_t offset[1]; hid_t sid=-1; hid_t mem_space_id=-1; @@ -418,7 +418,7 @@ herr_t H5TBwrite_records( hid_t loc_id, if ( start + nrecords > dims[0] ) goto out; - + /* Define a hyperslab in the dataset of the size of the records */ offset[0] = start; count[0] = nrecords; @@ -440,7 +440,7 @@ herr_t H5TBwrite_records( hid_t loc_id, /* Terminate access to the dataspace */ if ( H5Sclose( sid ) < 0 ) goto out; - + /* Release the datatype. */ if ( H5Tclose( tid ) < 0 ) goto out; @@ -453,7 +453,7 @@ herr_t H5TBwrite_records( hid_t loc_id, if ( H5Dclose( did ) < 0 ) return -1; - + return 0; /* error zone, gracefully close */ @@ -481,13 +481,13 @@ out: * * Comments: * - * Modifications: April 1, 2004 - * the DST_SIZES parameter is used to define the memory type ID - * returned by H5TB_create_type + * Modifications: April 1, 2004 + * the DST_SIZES parameter is used to define the memory type ID + * returned by H5TB_create_type * *------------------------------------------------------------------------- */ -herr_t H5TBwrite_fields_name( hid_t loc_id, +herr_t H5TBwrite_fields_name( hid_t loc_id, const char *dset_name, const char *field_names, hsize_t start, @@ -495,15 +495,15 @@ herr_t H5TBwrite_fields_name( hid_t loc_id, size_t type_size, const size_t *field_offset, const size_t *dst_sizes, - const void *data ) + const void *data ) { hid_t did; - hid_t tid=-1; + hid_t tid=-1; hid_t write_type_id=-1; hid_t member_type_id; hid_t nmtype_id; - hsize_t count[1]; + hsize_t count[1]; hsize_t offset[1]; hid_t sid=-1; char *member_name; @@ -513,9 +513,9 @@ herr_t H5TBwrite_fields_name( hid_t loc_id, size_t size_native; /* Create xfer properties to preserve initialized data */ - if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0) + if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0) return -1; - if (H5Pset_preserve (PRESERVE, 1)<0) + if (H5Pset_preserve (PRESERVE, 1)<0) return -1; /* Open the dataset. */ @@ -525,7 +525,7 @@ herr_t H5TBwrite_fields_name( hid_t loc_id, /* Get the datatype */ if ( (tid = H5Dget_type( did )) < 0 ) goto out; - + /* Get the number of fields */ if ( ( nfields = H5Tget_nmembers( tid )) < 0 ) goto out; @@ -552,9 +552,9 @@ herr_t H5TBwrite_fields_name( hid_t loc_id, /* Convert to native type */ if ((nmtype_id=H5Tget_native_type(member_type_id,H5T_DIR_DEFAULT))<0) goto out; - + size_native=H5Tget_size(nmtype_id); - + /* Adjust, if necessary */ if (dst_sizes[j]!=size_native) { @@ -601,7 +601,7 @@ herr_t H5TBwrite_fields_name( hid_t loc_id, /* Write */ if ( H5Dwrite( did, write_type_id, H5S_ALL, sid, PRESERVE, data ) < 0 ) goto out; - + /* End access to the write id */ if ( H5Tclose( write_type_id ) ) goto out; @@ -617,7 +617,7 @@ herr_t H5TBwrite_fields_name( hid_t loc_id, /* End access to the property list */ if ( H5Pclose( PRESERVE ) < 0 ) return -1; - + return 0; /* error zone, gracefully close */ @@ -648,15 +648,15 @@ out: * * Comments: Uses memory offsets * - * Modifications: April 1, 2004 - * the DST_SIZES parameter is used to define the memory type ID - * returned by H5TB_create_type + * Modifications: April 1, 2004 + * the DST_SIZES parameter is used to define the memory type ID + * returned by H5TB_create_type * *------------------------------------------------------------------------- */ -herr_t H5TBwrite_fields_index( hid_t loc_id, +herr_t H5TBwrite_fields_index( hid_t loc_id, const char *dset_name, hsize_t nfields, const int *field_index, @@ -665,15 +665,15 @@ herr_t H5TBwrite_fields_index( hid_t loc_id, size_t type_size, const size_t *field_offset, const size_t *dst_sizes, - const void *data ) + const void *data ) { hid_t did; - hid_t tid=-1; + hid_t tid=-1; hid_t write_type_id=-1; hid_t member_type_id; hid_t nmtype_id; - hsize_t count[1]; + hsize_t count[1]; hsize_t offset[1]; hid_t sid=-1; char *member_name; @@ -682,9 +682,9 @@ herr_t H5TBwrite_fields_index( hid_t loc_id, size_t size_native; /* Create xfer properties to preserve initialized data */ - if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0) + if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0) return -1; - if (H5Pset_preserve (PRESERVE, 1)<0) + if (H5Pset_preserve (PRESERVE, 1)<0) return -1; /* Open the dataset. */ @@ -694,11 +694,11 @@ herr_t H5TBwrite_fields_index( hid_t loc_id, /* Get the datatype */ if ( (tid = H5Dget_type( did )) < 0 ) goto out; - + /* Get the number of fields */ if ( H5Tget_nmembers( tid ) < 0 ) goto out; - + /* Create a write id */ if ( ( write_type_id = H5Tcreate( H5T_COMPOUND, type_size )) < 0 ) goto out; @@ -709,7 +709,7 @@ herr_t H5TBwrite_fields_index( hid_t loc_id, { j = field_index[i]; - + /* Get the member name */ member_name = H5Tget_member_name( tid, (unsigned) j ); @@ -720,9 +720,9 @@ herr_t H5TBwrite_fields_index( hid_t loc_id, /* Convert to native type */ if ((nmtype_id=H5Tget_native_type(member_type_id,H5T_DIR_DEFAULT))<0) goto out; - + size_native=H5Tget_size(nmtype_id); - + if (dst_sizes[i]!=size_native) { if (H5Tset_size(nmtype_id, dst_sizes[i])<0) @@ -748,7 +748,7 @@ herr_t H5TBwrite_fields_index( hid_t loc_id, goto out; free( member_name ); - + } /* Get the dataspace handle */ @@ -764,7 +764,7 @@ herr_t H5TBwrite_fields_index( hid_t loc_id, /* Write */ if ( H5Dwrite( did, write_type_id, H5S_ALL, sid, PRESERVE, data ) < 0 ) goto out; - + /* End access to the write id */ if ( H5Tclose( write_type_id ) ) goto out; @@ -780,7 +780,7 @@ herr_t H5TBwrite_fields_index( hid_t loc_id, /* End access to the property list */ if ( H5Pclose( PRESERVE ) < 0 ) return -1; - + return 0; /* error zone, gracefully close */ @@ -817,25 +817,25 @@ out: * * Comments: * - * Modifications: April 1, 2004 + * Modifications: April 1, 2004 * used a memory type ID returned by H5TB_create_type * *------------------------------------------------------------------------- */ -herr_t H5TBread_table( hid_t loc_id, +herr_t H5TBread_table( hid_t loc_id, const char *dset_name, - size_t dst_size, - const size_t *dst_offset, + size_t dst_size, + const size_t *dst_offset, const size_t *dst_sizes, - void *dst_buf ) + void *dst_buf ) { hid_t did; - hid_t ftype_id=-1; + hid_t ftype_id=-1; hid_t mem_type_id=-1; hid_t sid; hsize_t dims[1]; - + /* open the dataset. */ if ((did=H5Dopen(loc_id,dset_name))<0) return -1; @@ -843,13 +843,13 @@ herr_t H5TBread_table( hid_t loc_id, /* get the dataspace handle */ if ( (sid = H5Dget_space( did )) < 0 ) goto out; - + /* get dimensions */ if ( H5Sget_simple_extent_dims( sid, dims, NULL) < 0 ) goto out; /* get the datatypes */ - if ((ftype_id=H5Dget_type (did))<0) + if ((ftype_id=H5Dget_type (did))<0) goto out; if ((mem_type_id=H5TB_create_type(loc_id,dset_name,dst_size,dst_offset,dst_sizes,ftype_id))<0) @@ -893,30 +893,30 @@ out: * * Date: November 19, 2001 * - * Comments: + * Comments: * - * Modifications: April 1, 2004 - * the DST_SIZES parameter is used to define the memory type ID - * returned by H5TB_create_type + * Modifications: April 1, 2004 + * the DST_SIZES parameter is used to define the memory type ID + * returned by H5TB_create_type * *------------------------------------------------------------------------- */ -herr_t H5TBread_records( hid_t loc_id, +herr_t H5TBread_records( hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nrecords, size_t dst_size, const size_t *dst_offset, const size_t *dst_sizes, - void *data ) + void *data ) { hid_t did; - hid_t ftype_id; + hid_t ftype_id; hid_t mem_type_id=-1; - hsize_t count[1]; + hsize_t count[1]; hsize_t offset[1]; hid_t sid=-1; hsize_t dims[1]; @@ -936,7 +936,7 @@ herr_t H5TBread_records( hid_t loc_id, /* get the datatypes */ if ( (ftype_id = H5Dget_type( did )) < 0 ) goto out; - + if ((mem_type_id=H5TB_create_type(loc_id,dset_name,dst_size,dst_offset,dst_sizes,ftype_id))<0) goto out; @@ -1011,15 +1011,15 @@ out: * * Comments: * - * Modifications: April 1, 2004 - * the DST_SIZES parameter is used to define the memory type ID - * returned by H5TB_create_type + * Modifications: April 1, 2004 + * the DST_SIZES parameter is used to define the memory type ID + * returned by H5TB_create_type * *------------------------------------------------------------------------- */ -herr_t H5TBread_fields_name( hid_t loc_id, +herr_t H5TBread_fields_name( hid_t loc_id, const char *dset_name, const char *field_names, hsize_t start, @@ -1027,24 +1027,24 @@ herr_t H5TBread_fields_name( hid_t loc_id, size_t type_size, const size_t *field_offset, const size_t *dst_sizes, - void *data ) + void *data ) { hid_t did; - hid_t ftype_id=-1; + hid_t ftype_id=-1; hid_t mem_type_id=-1; hid_t mtype_id; hid_t nmtype_id; char *member_name; hssize_t nfields; - hsize_t count[1]; + hsize_t count[1]; hsize_t offset[1]; hid_t sid=-1; hid_t mem_space_id=-1; hsize_t mem_size[1]; size_t size_native; hssize_t i, j; - + /* open the dataset */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) goto out; @@ -1076,9 +1076,9 @@ herr_t H5TBread_fields_name( hid_t loc_id, /* convert to native type */ if ((nmtype_id=H5Tget_native_type(mtype_id,H5T_DIR_DEFAULT))<0) goto out; - + size_native=H5Tget_size(nmtype_id); - + if (dst_sizes[j]!=size_native) { if (H5Tset_size(nmtype_id, dst_sizes[j])<0) @@ -1136,7 +1136,7 @@ herr_t H5TBread_fields_name( hid_t loc_id, goto out; if ( H5Dclose( did ) < 0 ) return -1; - + return 0; /* error zone, gracefully close */ @@ -1166,15 +1166,15 @@ out: * * Comments: * - * Modifications: April 1, 2004 - * the DST_SIZES parameter is used to define the memory type ID - * returned by H5TB_create_type + * Modifications: April 1, 2004 + * the DST_SIZES parameter is used to define the memory type ID + * returned by H5TB_create_type * *------------------------------------------------------------------------- */ -herr_t H5TBread_fields_index( hid_t loc_id, +herr_t H5TBread_fields_index( hid_t loc_id, const char *dset_name, hsize_t nfields, const int *field_index, @@ -1183,16 +1183,16 @@ herr_t H5TBread_fields_index( hid_t loc_id, size_t type_size, const size_t *field_offset, const size_t *dst_sizes, - void *data ) + void *data ) { hid_t did; - hid_t tid=-1; + hid_t tid=-1; hid_t read_type_id=-1; hid_t member_type_id; hid_t nmtype_id; char *member_name; - hsize_t count[1]; + hsize_t count[1]; hsize_t offset[1]; hid_t sid=-1; hid_t mem_space_id=-1; @@ -1216,7 +1216,7 @@ herr_t H5TBread_fields_index( hid_t loc_id, for ( i = 0; i < nfields; i++) { j = field_index[i]; - + /* Get the member name */ member_name = H5Tget_member_name( tid, (unsigned) j ); @@ -1227,13 +1227,13 @@ herr_t H5TBread_fields_index( hid_t loc_id, /* Get the member size */ if ( H5Tget_size( member_type_id ) == 0 ) goto out; - + /* Convert to native type */ if ((nmtype_id=H5Tget_native_type(member_type_id,H5T_DIR_DEFAULT))<0) goto out; - + size_native=H5Tget_size(nmtype_id); - + if (dst_sizes[i]!=size_native) { if (H5Tset_size(nmtype_id, dst_sizes[i])<0) @@ -1251,7 +1251,7 @@ herr_t H5TBread_fields_index( hid_t loc_id, if ( H5Tinsert( read_type_id, member_name, 0, nmtype_id ) < 0 ) goto out; } - + /* Close the member type */ if ( H5Tclose( member_type_id ) < 0 ) goto out; @@ -1270,7 +1270,7 @@ herr_t H5TBread_fields_index( hid_t loc_id, count[0] = nrecords; if ( H5Sselect_hyperslab( sid, H5S_SELECT_SET, offset, NULL, count, NULL) < 0 ) goto out; - + /* Create a memory dataspace handle */ mem_size[0] = count[0]; if ( (mem_space_id = H5Screate_simple( 1, mem_size, NULL )) < 0 ) @@ -1287,7 +1287,7 @@ herr_t H5TBread_fields_index( hid_t loc_id, /* Terminate access to the memory dataspace */ if ( H5Sclose( mem_space_id ) < 0 ) goto out; - + /* End access to the read id */ if ( H5Tclose( read_type_id ) ) goto out; @@ -1299,7 +1299,7 @@ herr_t H5TBread_fields_index( hid_t loc_id, /* End access to the dataset */ if ( H5Dclose( did ) < 0 ) return -1; - + return 0; /* error zone, gracefully close */ @@ -1340,7 +1340,7 @@ out: *------------------------------------------------------------------------- */ -herr_t H5TBdelete_record( hid_t loc_id, +herr_t H5TBdelete_record( hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nrecords ) @@ -1351,8 +1351,8 @@ herr_t H5TBdelete_record( hid_t loc_id, hsize_t read_start; hsize_t read_nrecords; hid_t did; - hid_t tid; - hsize_t count[1]; + hid_t tid; + hsize_t count[1]; hsize_t offset[1]; hid_t sid; hid_t mem_space_id; @@ -1366,7 +1366,7 @@ herr_t H5TBdelete_record( hid_t loc_id, hsize_t dims[1]; #endif - + /*------------------------------------------------------------------------- * First we get information about type size and offsets on disk *------------------------------------------------------------------------- @@ -1381,11 +1381,11 @@ herr_t H5TBdelete_record( hid_t loc_id, if ( src_offset == NULL ) return -1; - + /* Get field info */ if ( H5TBget_field_info( loc_id, dset_name, NULL, src_sizes, src_offset, &src_size ) < 0 ) return -1; - + /*------------------------------------------------------------------------- * Read the records after the deleted one(s) *------------------------------------------------------------------------- @@ -1399,7 +1399,7 @@ herr_t H5TBdelete_record( hid_t loc_id, return -1; /* Read the records after the deleted one(s) */ - if ( H5TBread_records( loc_id, dset_name, read_start, read_nrecords, src_size, + if ( H5TBread_records( loc_id, dset_name, read_start, read_nrecords, src_size, src_offset, src_sizes, tmp_buf ) < 0 ) return -1; @@ -1412,7 +1412,7 @@ herr_t H5TBdelete_record( hid_t loc_id, /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) return -1; - + /* Get the datatype */ if ( (tid = H5Dget_type( did )) < 0 ) goto out; @@ -1461,11 +1461,11 @@ herr_t H5TBdelete_record( hid_t loc_id, /* End access to the dataset */ if ( H5Dclose( did ) < 0 ) return -1; - + free( tmp_buf ); free( src_offset ); free( src_sizes ); - + /*------------------------------------------------------------------------- * Store the new dimension as an attribute @@ -1474,11 +1474,11 @@ herr_t H5TBdelete_record( hid_t loc_id, nrows = ntotal_records - nrecords; /* Set the attribute */ - if (H5LT_set_attribute_numerical(loc_id,dset_name,"NROWS",1, + if (H5LT_set_attribute_numerical(loc_id,dset_name,"NROWS",1, H5T_NATIVE_LLONG,&nrows)<0) return -1; - + return 0; out: @@ -1499,15 +1499,15 @@ out: * * Comments: Uses memory offsets * - * Modifications: April 1, 2004 - * the DST_SIZES parameter is used to define the memory type ID - * returned by H5TB_create_type + * Modifications: April 1, 2004 + * the DST_SIZES parameter is used to define the memory type ID + * returned by H5TB_create_type * *------------------------------------------------------------------------- */ -herr_t H5TBinsert_record( hid_t loc_id, +herr_t H5TBinsert_record( hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nrecords, @@ -1521,18 +1521,18 @@ herr_t H5TBinsert_record( hid_t loc_id, hsize_t ntotal_records; hsize_t read_nrecords; hid_t did; - hid_t tid=-1; + hid_t tid=-1; hid_t mem_type_id=-1; - hsize_t count[1]; + hsize_t count[1]; hsize_t offset[1]; hid_t sid=-1; hid_t mem_space_id=-1; hsize_t dims[1]; hsize_t mem_dims[1]; unsigned char *tmp_buf; - + /*------------------------------------------------------------------------- - * Read the records after the inserted one(s) + * Read the records after the inserted one(s) *------------------------------------------------------------------------- */ @@ -1556,7 +1556,7 @@ herr_t H5TBinsert_record( hid_t loc_id, tmp_buf = (unsigned char *)calloc((size_t) read_nrecords, dst_size ); /* Read the records after the inserted one(s) */ - if ( H5TBread_records( loc_id, dset_name, start, read_nrecords, dst_size, dst_offset, + if ( H5TBread_records( loc_id, dset_name, start, read_nrecords, dst_size, dst_offset, dst_sizes, tmp_buf ) < 0 ) return -1; @@ -1565,7 +1565,7 @@ herr_t H5TBinsert_record( hid_t loc_id, if ( H5Dextend ( did, dims ) < 0 ) goto out; - + /*------------------------------------------------------------------------- * Write the inserted records *------------------------------------------------------------------------- @@ -1588,13 +1588,13 @@ herr_t H5TBinsert_record( hid_t loc_id, if ( H5Dwrite( did, mem_type_id, mem_space_id, sid, H5P_DEFAULT, data ) < 0 ) goto out; - + /* Terminate access to the dataspace */ if ( H5Sclose( mem_space_id ) < 0 ) goto out; if ( H5Sclose( sid ) < 0 ) goto out; - + /*------------------------------------------------------------------------- * Write the "pushed down" records *------------------------------------------------------------------------- @@ -1617,7 +1617,7 @@ herr_t H5TBinsert_record( hid_t loc_id, if ( H5Dwrite( did, mem_type_id, mem_space_id, sid, H5P_DEFAULT, tmp_buf ) < 0 ) goto out; - + /* Terminate access to the dataspace */ if ( H5Sclose( mem_space_id ) < 0 ) goto out; @@ -1664,7 +1664,7 @@ out: * * Date: December 5, 2001 * - * Comments: + * Comments: * * Modifications: * @@ -1672,22 +1672,22 @@ out: *------------------------------------------------------------------------- */ -herr_t H5TBadd_records_from( hid_t loc_id, +herr_t H5TBadd_records_from( hid_t loc_id, const char *dset_name1, hsize_t start1, hsize_t nrecords, const char *dset_name2, - hsize_t start2 ) + hsize_t start2 ) { /* Identifiers for the 1st dataset. */ hid_t dataset_id1; - hid_t type_id1; + hid_t type_id1; hid_t space_id1=-1; hid_t mem_space_id1=-1; size_t type_size1; - hsize_t count[1]; + hsize_t count[1]; hsize_t offset[1]; hsize_t mem_size[1]; hsize_t nfields; @@ -1711,13 +1711,13 @@ herr_t H5TBadd_records_from( hid_t loc_id, if ( src_offset == NULL ) return -1; - + /* Get field info */ if ( H5TBget_field_info( loc_id, dset_name1, NULL, src_sizes, src_offset, &src_size ) < 0 ) return -1; - + /*------------------------------------------------------------------------- - * Get information about the first table and read it + * Get information about the first table and read it *------------------------------------------------------------------------- */ @@ -1754,12 +1754,12 @@ herr_t H5TBadd_records_from( hid_t loc_id, goto out; /*------------------------------------------------------------------------- - * Add to the second table + * Add to the second table *------------------------------------------------------------------------- */ if ( H5TBinsert_record(loc_id,dset_name2,start2,nrecords,src_size,src_offset,src_sizes,tmp_buf ) < 0 ) goto out; - + /*------------------------------------------------------------------------- * Close resources for table 1 *------------------------------------------------------------------------- @@ -1772,7 +1772,7 @@ herr_t H5TBadd_records_from( hid_t loc_id, /* Terminate access to the dataspace */ if ( H5Sclose( space_id1 ) < 0 ) goto out; - + /* Release the datatype. */ if ( H5Tclose( type_id1 ) < 0 ) return -1; @@ -1784,7 +1784,7 @@ herr_t H5TBadd_records_from( hid_t loc_id, free( tmp_buf ); free( src_offset ); free( src_sizes ); - + return 0; /* error zone, gracefully close */ @@ -1810,14 +1810,14 @@ out: * * Date: December 10, 2001 * - * Comments: + * Comments: * * Modifications: * * *------------------------------------------------------------------------- */ -herr_t H5TBcombine_tables( hid_t loc_id1, +herr_t H5TBcombine_tables( hid_t loc_id1, const char *dset_name1, hid_t loc_id2, const char *dset_name2, @@ -1826,23 +1826,23 @@ herr_t H5TBcombine_tables( hid_t loc_id1, /* Identifiers for the 1st dataset. */ hid_t dataset_id1; - hid_t type_id1; + hid_t type_id1; hid_t space_id1; hid_t plist_id1; /* Identifiers for the 2nd dataset. */ hid_t dataset_id2; - hid_t type_id2; + hid_t type_id2; hid_t space_id2; hid_t plist_id2; /* Identifiers for the 3rd dataset. */ hid_t dataset_id3; - hid_t type_id3; + hid_t type_id3; hid_t space_id3; hid_t plist_id3; - hsize_t count[1]; + hsize_t count[1]; hsize_t offset[1]; hid_t mem_space_id; hsize_t mem_size[1]; @@ -1850,7 +1850,7 @@ herr_t H5TBcombine_tables( hid_t loc_id1, hsize_t nrecords; hsize_t dims[1]; hsize_t maxdims[1] = { H5S_UNLIMITED }; - + size_t type_size; hid_t sid; @@ -1882,13 +1882,13 @@ herr_t H5TBcombine_tables( hid_t loc_id1, if ( src_offset == NULL ) return -1; - + /* Get field info */ if ( H5TBget_field_info( loc_id1, dset_name1, NULL, src_sizes, src_offset, &src_size ) < 0 ) return -1; /*------------------------------------------------------------------------- - * Get information about the first table + * Get information about the first table *------------------------------------------------------------------------- */ @@ -1911,7 +1911,7 @@ herr_t H5TBcombine_tables( hid_t loc_id1, /* Get the dimensions */ if ( H5TBget_table_info ( loc_id1, dset_name1, &nfields, &nrecords ) < 0 ) return -1; - + /*------------------------------------------------------------------------- * Make the merged table with no data originally *------------------------------------------------------------------------- @@ -1966,44 +1966,44 @@ herr_t H5TBcombine_tables( hid_t loc_id1, */ if ( has_fill == 1 ) { - + if (( sid = H5Screate(H5S_SCALAR)) < 0 ) goto out; - + for ( i = 0; i < nfields; i++) { - + /* Get the member type */ if ( ( member_type_id = H5Tget_member_type( type_id3, (unsigned) i )) < 0 ) goto out; - + /* Get the member offset */ member_offset = H5Tget_member_offset( type_id3, (unsigned) i ); - + strcpy( attr_name, "FIELD_" ); sprintf( aux, "%d", (int) i ); strcat( attr_name, aux ); sprintf( aux, "%s", "_FILL" ); strcat( attr_name, aux ); - + if ( (attr_id = H5Acreate( dataset_id3, attr_name, member_type_id, sid, H5P_DEFAULT )) < 0 ) goto out; - + if ( H5Awrite( attr_id, member_type_id, tmp_fill_buf+member_offset ) < 0 ) goto out; - + if ( H5Aclose( attr_id ) < 0 ) goto out; if ( H5Tclose( member_type_id ) < 0 ) goto out; } - - /* Close data space. */ + + /* Close data space. */ if ( H5Sclose( sid ) < 0 ) goto out; } - + /*------------------------------------------------------------------------- * Read data from 1st table *------------------------------------------------------------------------- @@ -2024,7 +2024,7 @@ herr_t H5TBcombine_tables( hid_t loc_id1, if ( H5Dread( dataset_id1, type_id1, mem_space_id, space_id1, H5P_DEFAULT, tmp_buf ) < 0 ) goto out; - + /*------------------------------------------------------------------------- * Save data from 1st table into new table *------------------------------------------------------------------------- @@ -2046,7 +2046,7 @@ herr_t H5TBcombine_tables( hid_t loc_id1, /* Terminate access to the dataspace */ if ( H5Sclose( space_id1 ) < 0 ) goto out; - + /* Release the datatype. */ if ( H5Tclose( type_id1 ) < 0 ) goto out; @@ -2063,7 +2063,7 @@ herr_t H5TBcombine_tables( hid_t loc_id1, free( tmp_buf ); /*------------------------------------------------------------------------- - * Get information about the 2nd table + * Get information about the 2nd table *------------------------------------------------------------------------- */ @@ -2108,7 +2108,7 @@ herr_t H5TBcombine_tables( hid_t loc_id1, if ( H5Dread( dataset_id2, type_id2, mem_space_id, space_id2, H5P_DEFAULT, tmp_buf ) < 0 ) goto out; - + /*------------------------------------------------------------------------- * Save data from 2nd table into new table *------------------------------------------------------------------------- @@ -2130,7 +2130,7 @@ herr_t H5TBcombine_tables( hid_t loc_id1, /* Terminate access to the dataspace */ if ( H5Sclose( space_id2 ) < 0 ) goto out; - + /* Release the datatype. */ if ( H5Tclose( type_id2 ) < 0 ) return -1; @@ -2151,7 +2151,7 @@ herr_t H5TBcombine_tables( hid_t loc_id1, /* Terminate access to the dataspace */ if ( H5Sclose( space_id3 ) < 0 ) return -1; - + /* Release the datatype. */ if ( H5Tclose( type_id3 ) < 0 ) return -1; @@ -2191,32 +2191,32 @@ out: * * Date: January 30, 2002 * - * Comments: + * Comments: * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ -herr_t H5TBinsert_field( hid_t loc_id, +herr_t H5TBinsert_field( hid_t loc_id, const char *dset_name, const char *field_name, hid_t field_type, hsize_t position, const void *fill_data, - const void *data ) + const void *data ) { /* Identifiers for the 1st, original dataset */ hid_t dataset_id1; - hid_t type_id1; + hid_t type_id1; hid_t space_id1; hid_t plist_id1; hid_t mem_space_id1; /* Identifiers for the 2nd, new dataset */ hid_t dataset_id2; - hid_t type_id2; + hid_t type_id2; hid_t space_id2; hid_t plist_id2; hid_t mem_space_id2; @@ -2231,7 +2231,7 @@ herr_t H5TBinsert_field( hid_t loc_id, hsize_t dims_chunk[1]; hsize_t dims[1]; hsize_t maxdims[1] = { H5S_UNLIMITED }; - hsize_t count[1]; + hsize_t count[1]; hsize_t offset[1]; hsize_t mem_size[1]; hid_t write_type_id; @@ -2251,16 +2251,16 @@ herr_t H5TBinsert_field( hid_t loc_id, /* Get the number of records and fields */ if ( H5TBget_table_info ( loc_id, dset_name, &nfields, &nrecords ) < 0 ) return -1; - + /*------------------------------------------------------------------------- * Get information about the old data type *------------------------------------------------------------------------- */ - + /* Open the dataset. */ if ( (dataset_id1 = H5Dopen( loc_id, dset_name )) < 0 ) return -1; - + /* Get creation properties list */ if ( (plist_id1 = H5Dget_create_plist( dataset_id1 )) < 0 ) goto out; @@ -2272,7 +2272,7 @@ herr_t H5TBinsert_field( hid_t loc_id, /* Get the size of the datatype */ if ( ( total_size = H5Tget_size( type_id1 )) == 0 ) goto out; - + /* Get the dataspace handle */ if ( (space_id1 = H5Dget_space( dataset_id1 )) < 0 ) goto out; @@ -2313,7 +2313,7 @@ herr_t H5TBinsert_field( hid_t loc_id, inserted = 0; /* Insert the old fields, counting with the new one */ - for ( i = 0; i < nfields + 1; i++) + for ( i = 0; i < nfields + 1; i++) { idx = i; @@ -2337,7 +2337,7 @@ herr_t H5TBinsert_field( hid_t loc_id, continue; } - + /* Get the member name */ member_name = H5Tget_member_name( type_id1, (unsigned)idx ); @@ -2347,7 +2347,7 @@ herr_t H5TBinsert_field( hid_t loc_id, /* Get the member size */ member_size = H5Tget_size( member_type_id ); - + /* Insert it into the new type */ if ( H5Tinsert( type_id2, member_name, curr_offset, member_type_id ) < 0 ) goto out; @@ -2360,9 +2360,9 @@ herr_t H5TBinsert_field( hid_t loc_id, if ( H5Tclose( member_type_id ) < 0 ) goto out; - + } /* i */ - + /*------------------------------------------------------------------------- * Create a new temporary dataset *------------------------------------------------------------------------- @@ -2407,7 +2407,7 @@ herr_t H5TBinsert_field( hid_t loc_id, if ( H5Dread( dataset_id1, type_id1, mem_space_id1, H5S_ALL, H5P_DEFAULT, tmp_buf ) < 0 ) goto out; - + /*------------------------------------------------------------------------- * Save data from 1st table into new table, using the 1st type id *------------------------------------------------------------------------- @@ -2427,15 +2427,15 @@ herr_t H5TBinsert_field( hid_t loc_id, /* Create a write id */ if ( ( write_type_id = H5Tcreate( H5T_COMPOUND, (size_t)new_member_size )) < 0 ) goto out; - + /* The field in the file is found by its name */ if ( H5Tinsert( write_type_id, field_name, 0, field_type ) < 0 ) goto out; /* Create xfer properties to preserve initialized data */ - if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0) + if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0) goto out; - if (H5Pset_preserve (PRESERVE, 1)<0) + if (H5Pset_preserve (PRESERVE, 1)<0) goto out; /* Only write if there is something to write */ @@ -2468,8 +2468,8 @@ herr_t H5TBinsert_field( hid_t loc_id, /* Terminate access to the memory dataspace */ if ( H5Sclose( mem_space_id1 ) < 0 ) - goto out; - + goto out; + /* Release the datatype. */ if ( H5Tclose( type_id1 ) < 0 ) goto out; @@ -2495,7 +2495,7 @@ herr_t H5TBinsert_field( hid_t loc_id, /* Terminate access to the dataspace */ if ( H5Sclose( space_id2 ) < 0 ) goto out; - + /* Release the datatype. */ if ( H5Tclose( type_id2 ) < 0 ) return -1; @@ -2511,7 +2511,7 @@ herr_t H5TBinsert_field( hid_t loc_id, * Delete 1st table *------------------------------------------------------------------------- */ - if ( H5Gunlink( loc_id, dset_name ) < 0 ) + if ( H5Gunlink( loc_id, dset_name ) < 0 ) return -1; /*------------------------------------------------------------------------- @@ -2519,7 +2519,7 @@ herr_t H5TBinsert_field( hid_t loc_id, *------------------------------------------------------------------------- */ - if ( H5Gmove( loc_id, "new", dset_name ) < 0 ) + if ( H5Gmove( loc_id, "new", dset_name ) < 0 ) return -1; /*------------------------------------------------------------------------- @@ -2567,10 +2567,10 @@ herr_t H5TBinsert_field( hid_t loc_id, if ( (attr_id = H5Acreate( dataset_id1, attr_name, member_type_id, space_id1, H5P_DEFAULT )) < 0 ) goto out; - + if ( H5Awrite( attr_id, member_type_id, tmp_fill_buf+member_offset ) < 0 ) goto out; - + if ( H5Aclose( attr_id ) < 0 ) goto out; @@ -2598,19 +2598,19 @@ herr_t H5TBinsert_field( hid_t loc_id, if ( (attr_id = H5Acreate( dataset_id1, attr_name, member_type_id, space_id1, H5P_DEFAULT )) < 0 ) goto out; - + if ( H5Awrite( attr_id, member_type_id, fill_data ) < 0 ) goto out; - + if ( H5Aclose( attr_id ) < 0 ) goto out; if ( H5Tclose( member_type_id ) < 0 ) goto out; - + } - - /* Close data space. */ + + /* Close data space. */ if ( H5Sclose( space_id1 ) < 0 ) goto out; @@ -2621,12 +2621,12 @@ herr_t H5TBinsert_field( hid_t loc_id, /* End access to the dataset */ if ( H5Dclose( dataset_id1 ) < 0 ) goto out; - + /* Release resources. */ free ( tmp_buf ); free ( tmp_fill_buf ); - + return 0; out: @@ -2645,7 +2645,7 @@ out: * * Date: January 30, 2002 * - * Comments: + * Comments: * * Modifications: * @@ -2653,20 +2653,20 @@ out: *------------------------------------------------------------------------- */ -herr_t H5TBdelete_field( hid_t loc_id, +herr_t H5TBdelete_field( hid_t loc_id, const char *dset_name, - const char *field_name ) + const char *field_name ) { /* Identifiers for the 1st original dataset */ hid_t dataset_id1; - hid_t type_id1; + hid_t type_id1; hid_t space_id1; hid_t plist_id1; /* Identifiers for the 2nd new dataset */ hid_t dataset_id2; - hid_t type_id2; + hid_t type_id2; hid_t space_id2; hid_t plist_id2; @@ -2694,11 +2694,11 @@ herr_t H5TBdelete_field( hid_t loc_id, hid_t attr_id; hsize_t i; int has_fill=0; - + /* Get the number of records and fields */ if ( H5TBget_table_info ( loc_id, dset_name, &nfields, &nrecords ) < 0 ) return -1; - + /*------------------------------------------------------------------------- * Get information about the old data type *------------------------------------------------------------------------- @@ -2718,7 +2718,7 @@ herr_t H5TBdelete_field( hid_t loc_id, /* Get the size of the datatype */ type_size1 = H5Tget_size( type_id1 ); - + /* Get the dataspace handle */ if ( (space_id1 = H5Dget_space( dataset_id1 )) < 0 ) goto out; @@ -2733,9 +2733,9 @@ herr_t H5TBdelete_field( hid_t loc_id, */ /* Check out the field */ - for ( i = 0; i < nfields; i++) + for ( i = 0; i < nfields; i++) { - + /* Get the member name */ member_name = H5Tget_member_name( type_id1,(unsigned) i ); @@ -2748,7 +2748,7 @@ herr_t H5TBdelete_field( hid_t loc_id, /* Get the member size */ delete_member_size = H5Tget_size( member_type_id ); - + /* Close the member type */ if ( H5Tclose( member_type_id ) < 0 ) goto out; @@ -2760,7 +2760,7 @@ herr_t H5TBdelete_field( hid_t loc_id, } free( member_name ); - + } /* i */ /* No field to delete was found */ @@ -2787,15 +2787,15 @@ herr_t H5TBdelete_field( hid_t loc_id, * Get attributes from previous table in the process *------------------------------------------------------------------------- */ - + /* Get the table title */ if ( (H5TBAget_title( dataset_id1, table_title )) < 0 ) goto out; /* Insert the old fields except the one to delete */ - for ( i = 0; i < nfields; i++) + for ( i = 0; i < nfields; i++) { - + /* Get the member name */ member_name = H5Tget_member_name( type_id1, (unsigned) i ); @@ -2812,11 +2812,11 @@ herr_t H5TBdelete_field( hid_t loc_id, /* Get the member size */ member_size = H5Tget_size( member_type_id ); - + /* Insert it into the new type */ if ( H5Tinsert( type_id2, member_name, curr_offset, member_type_id ) < 0 ) goto out; - + /*------------------------------------------------------------------------- * Get the fill value information *------------------------------------------------------------------------- @@ -2845,9 +2845,9 @@ herr_t H5TBdelete_field( hid_t loc_id, /* Close the member type */ if ( H5Tclose( member_type_id ) < 0 ) goto out; - + } /* i */ - + /*------------------------------------------------------------------------- * Create a new temporary dataset *------------------------------------------------------------------------- @@ -2874,9 +2874,9 @@ herr_t H5TBdelete_field( hid_t loc_id, * We have to read field by field of the old dataset and save it into the new one *------------------------------------------------------------------------- */ - for ( i = 0; i < nfields; i++) + for ( i = 0; i < nfields; i++) { - + /* Get the member name */ member_name = H5Tget_member_name( type_id1,(unsigned) i ); @@ -2903,23 +2903,23 @@ herr_t H5TBdelete_field( hid_t loc_id, goto out; tmp_buf = (unsigned char *)calloc((size_t) nrecords, member_size ); - + /* Read */ if ( H5Dread( dataset_id1, read_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp_buf ) < 0 ) goto out; - + /* Create a write id */ if ( ( write_type_id = H5Tcreate( H5T_COMPOUND, member_size )) < 0 ) goto out; - + /* The field in the file is found by its name */ if ( H5Tinsert( write_type_id, member_name, 0, member_type_id ) < 0 ) goto out; /* Create xfer properties to preserve initialized data */ - if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0) + if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0) goto out; - if (H5Pset_preserve (PRESERVE, 1)<0) + if (H5Pset_preserve (PRESERVE, 1)<0) goto out; /* Write */ @@ -2932,7 +2932,7 @@ herr_t H5TBdelete_field( hid_t loc_id, /* Close the member type */ if ( H5Tclose( member_type_id ) < 0 ) - goto out; + goto out; /* Close the read type */ if ( H5Tclose( read_type_id ) < 0 ) @@ -2941,10 +2941,10 @@ herr_t H5TBdelete_field( hid_t loc_id, /* Close the write type */ if ( H5Tclose( write_type_id ) < 0 ) goto out; - + /* Release resources. */ free( member_name ); - free ( tmp_buf ); + free ( tmp_buf ); } /* i */ @@ -2952,7 +2952,7 @@ herr_t H5TBdelete_field( hid_t loc_id, * Release resources from 1st table *------------------------------------------------------------------------- */ - + /* Release the datatype. */ if ( H5Tclose( type_id1 ) < 0 ) goto out; @@ -2978,7 +2978,7 @@ herr_t H5TBdelete_field( hid_t loc_id, /* Terminate access to the dataspace */ if ( H5Sclose( space_id2 ) < 0 ) goto out; - + /* Release the datatype. */ if ( H5Tclose( type_id2 ) < 0 ) return -1; @@ -2996,7 +2996,7 @@ herr_t H5TBdelete_field( hid_t loc_id, *------------------------------------------------------------------------- */ - if ( H5Gunlink( loc_id, dset_name ) < 0 ) + if ( H5Gunlink( loc_id, dset_name ) < 0 ) return -1; /*------------------------------------------------------------------------- @@ -3004,9 +3004,9 @@ herr_t H5TBdelete_field( hid_t loc_id, *------------------------------------------------------------------------- */ - if ( H5Gmove( loc_id, "new", dset_name ) < 0 ) + if ( H5Gmove( loc_id, "new", dset_name ) < 0 ) return -1; - + /*------------------------------------------------------------------------- * Attach the conforming table attributes *------------------------------------------------------------------------- @@ -3035,45 +3035,45 @@ herr_t H5TBdelete_field( hid_t loc_id, if ( has_fill == 1 ) { - + if (( space_id1 = H5Screate(H5S_SCALAR)) < 0 ) goto out; - + for ( i = 0; i < nfields; i++) { - + /* Get the member type */ if ( ( member_type_id = H5Tget_member_type( type_id1, (unsigned)i )) < 0 ) goto out; - + /* Get the member offset */ member_offset = H5Tget_member_offset( type_id1, (unsigned)i ); - + strcpy( attr_name, "FIELD_" ); sprintf( aux, "%d", (int)i ); strcat( attr_name, aux ); sprintf( aux, "%s", "_FILL" ); strcat( attr_name, aux ); - + if ( (attr_id = H5Acreate( dataset_id1, attr_name, member_type_id, space_id1, H5P_DEFAULT )) < 0 ) goto out; - + if ( H5Awrite( attr_id, member_type_id, tmp_fill_buf+member_offset ) < 0 ) goto out; - + if ( H5Aclose( attr_id ) < 0 ) goto out; - + /* Close the member type */ if ( H5Tclose( member_type_id ) < 0 ) goto out; - + } - - /* Close data space. */ + + /* Close data space. */ if ( H5Sclose( space_id1 ) < 0 ) goto out; - + } /*has_fill*/ /* Release the datatype. */ @@ -3083,7 +3083,7 @@ herr_t H5TBdelete_field( hid_t loc_id, /* End access to the dataset */ if ( H5Dclose( dataset_id1 ) < 0 ) goto out; - + /* Release resources. */ free ( tmp_fill_buf ); @@ -3095,9 +3095,9 @@ out: } /*------------------------------------------------------------------------- - * + * * Table attribute functions - * + * *------------------------------------------------------------------------- */ @@ -3112,22 +3112,22 @@ out: * * Date: January 30, 2001 * - * Comments: + * Comments: * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ -herr_t H5TBAget_title( hid_t loc_id, - char *table_title ) +herr_t H5TBAget_title( hid_t loc_id, + char *table_title ) { /* Get the TITLE attribute */ if ( H5LT_get_attribute_disk( loc_id, "TITLE", table_title ) < 0 ) return -1; - + return 0; } @@ -3143,18 +3143,18 @@ herr_t H5TBAget_title( hid_t loc_id, * * Date: January 30, 2002 * - * Comments: + * Comments: * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ -herr_t H5TBAget_fill( hid_t loc_id, +herr_t H5TBAget_fill( hid_t loc_id, const char *dset_name, hid_t dset_id, - unsigned char *dst_buf ) + unsigned char *dst_buf ) { hsize_t nfields; @@ -3168,7 +3168,7 @@ herr_t H5TBAget_fill( hid_t loc_id, /* Get the number of records and fields */ if ( H5TBget_table_info ( loc_id, dset_name, &nfields, &nrecords ) < 0 ) return -1; - + src_offset = (size_t *)malloc((size_t)nfields * sizeof(size_t)); if (src_offset == NULL ) @@ -3217,7 +3217,7 @@ out: */ /*------------------------------------------------------------------------- - * Function: H5TBget_table_info + * Function: H5TBget_table_info * * Purpose: Gets the number of records and fields of a table * @@ -3230,26 +3230,26 @@ out: * Comments: * * Modifications: May 08, 2003 - * In version 2.0 of Table, the number of records is stored as an + * In version 2.0 of Table, the number of records is stored as an * attribute "NROWS" * * *------------------------------------------------------------------------- */ -herr_t H5TBget_table_info ( hid_t loc_id, +herr_t H5TBget_table_info ( hid_t loc_id, const char *dset_name, hsize_t *nfields, hsize_t *nrecords ) { - hid_t tid; + hid_t tid; hid_t sid=-1; hid_t did; int num_members; hsize_t dims[1]; int has_attr; hsize_t n[1]; - + /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) return -1; @@ -3270,19 +3270,19 @@ herr_t H5TBget_table_info ( hid_t loc_id, * Get number of records *------------------------------------------------------------------------- */ - + if (nrecords) { /* Try to find the attribute "NROWS" */ has_attr = H5LT_find_attribute( did, "NROWS" ); - + /* It exists, get it */ if ( has_attr == 1 ) { /* Get the attribute */ if ( H5LTget_attribute(loc_id,dset_name,"NROWS",H5T_NATIVE_LLONG,n)<0) return -1; - + *nrecords = *n; } else @@ -3290,15 +3290,15 @@ herr_t H5TBget_table_info ( hid_t loc_id, /* Get the dataspace handle */ if ( (sid = H5Dget_space( did )) < 0 ) goto out; - + /* Get records */ if ( H5Sget_simple_extent_dims( sid, dims, NULL) < 0 ) goto out; - + /* Terminate access to the dataspace */ if ( H5Sclose( sid ) < 0 ) goto out; - + *nrecords = dims[0]; } }/*nrecords*/ @@ -3340,7 +3340,7 @@ out: * *------------------------------------------------------------------------- */ -herr_t H5TBget_field_info( hid_t loc_id, +herr_t H5TBget_field_info( hid_t loc_id, const char *dset_name, char *field_names[], size_t *field_sizes, @@ -3348,7 +3348,7 @@ herr_t H5TBget_field_info( hid_t loc_id, size_t *type_size ) { hid_t did; - hid_t ftype_id; + hid_t ftype_id; hid_t native_type_id; hssize_t nfields; char *member_name; @@ -3414,7 +3414,7 @@ herr_t H5TBget_field_info( hid_t loc_id, goto out; free( member_name ); - + } /* i */ /* Release the datatype. */ @@ -3459,19 +3459,19 @@ out: int H5TB_find_field( const char *field, const char *field_list ) { - const char *start = field_list; - const char *end; + const char *start = field_list; + const char *end; - while ( (end = strstr( start, "," )) != 0 ) { - if ( strncmp(start,field,(size_t)(end-start)) == 0 ) return 1; - start = end + 1; - } + while ( (end = strstr( start, "," )) != 0 ) { + if ( strncmp(start,field,(size_t)(end-start)) == 0 ) return 1; + start = end + 1; + } - if ( strcmp( start, field ) == 0 ) return 1; + if ( strcmp( start, field ) == 0 ) return 1; - return -1; + return -1; -} +} /*------------------------------------------------------------------------- @@ -3496,17 +3496,17 @@ int H5TB_find_field( const char *field, const char *field_list ) herr_t H5TB_attach_attributes( const char *table_title, - hid_t loc_id, + hid_t loc_id, const char *dset_name, hsize_t nfields, - hid_t tid ) + hid_t tid ) { char attr_name[255]; char *member_name; char aux[255]; hsize_t i; - + /* Attach the CLASS attribute */ if ( H5LTset_attribute_string( loc_id, dset_name, "CLASS", TABLE_CLASS ) < 0 ) goto out; @@ -3514,7 +3514,7 @@ herr_t H5TB_attach_attributes( const char *table_title, /* Attach the VERSION attribute */ if ( H5LTset_attribute_string( loc_id, dset_name, "VERSION", "2.0" ) < 0 ) goto out; - + /* Attach the TITLE attribute */ if ( H5LTset_attribute_string( loc_id, dset_name, "TITLE", table_title ) < 0 ) goto out; @@ -3531,7 +3531,7 @@ herr_t H5TB_attach_attributes( const char *table_title, strcat( attr_name, aux ); sprintf( aux, "%s", "_NAME" ); strcat( attr_name, aux ); - + /* Attach the attribute */ if ( H5LTset_attribute_string( loc_id, dset_name, attr_name, member_name ) < 0 ) goto out; @@ -3565,10 +3565,10 @@ out: *------------------------------------------------------------------------- */ -hid_t H5TB_create_type(hid_t loc_id, +hid_t H5TB_create_type(hid_t loc_id, const char *dset_name, - size_t dst_size, - const size_t *dst_offset, + size_t dst_size, + const size_t *dst_offset, const size_t *dst_sizes, hid_t ftype_id) { @@ -3587,7 +3587,7 @@ hid_t H5TB_create_type(hid_t loc_id, if ((fnames=malloc(sizeof(char*)*(size_t)nfields))==NULL) return -1; - for ( i=0; i space ) + if ( j > space ) { n++; j=0; @@ -130,14 +130,14 @@ static int test_simple(void) for (i=0, j=0, n=0; i < WIDTH*HEIGHT*3; i++, j++) { image_in2[i] = n; - if (j==3) + if (j==3) { n++; j=0; } if (n>255) n=0; } - + /* create a file using default properties */ if ((fid=H5Fcreate(FILE1,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0) goto out; @@ -163,7 +163,7 @@ static int test_simple(void) /* attach the palette to the image dataset */ if (H5IMlink_palette(fid,"image1","palette")<0) goto out; - + /* get info */ if (H5IMget_image_info(fid,"image1",&width,&height,&planes,interlace,&npals)<0) goto out; @@ -180,11 +180,11 @@ static int test_simple(void) /* read image */ if (H5IMread_image(fid,"image1",image_out1)<0) goto out; - + /* check */ - for (i = 0; i < height*width*planes; i++) + for (i = 0; i < height*width*planes; i++) { - if ( image_in1[i] != image_out1[i] ) + if ( image_in1[i] != image_out1[i] ) { goto out; } @@ -199,7 +199,7 @@ static int test_simple(void) */ TESTING2("true color image"); - + /* write image */ if (H5IMmake_image_24bit(fid,"image2",WIDTH,HEIGHT,"INTERLACE_PIXEL",image_in2)) goto out; @@ -220,9 +220,9 @@ static int test_simple(void) goto out; /* check */ - for (i = 0; i < height*width*planes; i++) + for (i = 0; i < height*width*planes; i++) { - if ( image_in2[i] != image_out2[i] ) + if ( image_in2[i] != image_out2[i] ) { goto out; } @@ -252,9 +252,9 @@ static int test_simple(void) goto out; /* check */ - for (i = 0; i < 2; i++) + for (i = 0; i < 2; i++) { - if ( pal_dims[i] != pal_dims_out[i] ) + if ( pal_dims[i] != pal_dims_out[i] ) { goto out; } @@ -269,9 +269,9 @@ static int test_simple(void) goto out; /* check */ - for (i = 0; i < PAL_ENTRIES*3; i++) + for (i = 0; i < PAL_ENTRIES*3; i++) { - if ( pal_data_in[i] != pal_data_out[i] ) + if ( pal_data_in[i] != pal_data_out[i] ) { goto out; } @@ -308,14 +308,14 @@ static int test_simple(void) PASSED(); /*------------------------------------------------------------------------- - * close + * close *------------------------------------------------------------------------- - */ + */ if (H5Fclose(fid)<0) goto out; return 0; - + /* error zone, gracefully close */ out: H5E_BEGIN_TRY { @@ -354,7 +354,7 @@ static int test_data(void) TESTING2("make indexed image"); - /* read first data file */ + /* read first data file */ if (read_data(DATA_FILE1,&width,&height)<0) goto out; @@ -371,11 +371,11 @@ static int test_data(void) * palette #1. rainbow palette. data is contained in "pal_rgb.h" *------------------------------------------------------------------------- */ - + /* initialize the palette data */ pal_dims[0] = 256; pal_dims[1] = 3; - + /* make a palette */ if (H5IMmake_palette(fid,PAL1_NAME,pal_dims,pal_rgb)<0) goto out; @@ -385,7 +385,7 @@ static int test_data(void) goto out; /*------------------------------------------------------------------------- - * palette #2. sepia palette. + * palette #2. sepia palette. * read a PAL file and attach the palette to the HDF5 file *------------------------------------------------------------------------- */ @@ -411,7 +411,7 @@ static int test_data(void) goto out; /*------------------------------------------------------------------------- - * palette #3. earth palette. + * palette #3. earth palette. * read a PAL file and attach the palette to the HDF5 file *------------------------------------------------------------------------- */ @@ -440,7 +440,7 @@ static int test_data(void) /*------------------------------------------------------------------------- - * palette #4. blue-red + * palette #4. blue-red * make a palette whith blue to red colors *------------------------------------------------------------------------- */ @@ -467,16 +467,16 @@ static int test_data(void) TESTING2("make true color image with pixel interlace"); - /* read second data file */ + /* read second data file */ if ((read_data(DATA_FILE2,&width,&height))<0) goto out; - + /* make image */ if ((H5IMmake_image_24bit(fid,IMAGE2_NAME,width,height,"INTERLACE_PIXEL",image_data))<0) goto out; PASSED(); - + /*------------------------------------------------------------------------- * True color image example with plane interlace *------------------------------------------------------------------------- @@ -484,26 +484,26 @@ static int test_data(void) TESTING2("make true color image with plane interlace"); - /* read third data file */ + /* read third data file */ if ((read_data(DATA_FILE3,&width,&height))<0) goto out; - + /* make image */ if ((H5IMmake_image_24bit(fid,IMAGE3_NAME,width,height,"INTERLACE_PLANE",image_data))<0) goto out; PASSED(); - + /*------------------------------------------------------------------------- - * close + * close *------------------------------------------------------------------------- - */ + */ if (H5Fclose(fid)<0) goto out; return 0; - + /* error zone, gracefully close */ out: H5E_BEGIN_TRY { @@ -515,23 +515,23 @@ out: /* - The following test provides an examples of how to generate HDF5 image data from - floating point data. In the example we use real life topographic data - (from the North American hemisphere). In the dataset sea values are represented - as negative numbers and land values are represented as positive numbers. - The example generates 3 HDF5 images, one that generates an image from all the values, - another that generates an image from the land values and another that generates an + The following test provides an examples of how to generate HDF5 image data from + floating point data. In the example we use real life topographic data + (from the North American hemisphere). In the dataset sea values are represented + as negative numbers and land values are represented as positive numbers. + The example generates 3 HDF5 images, one that generates an image from all the values, + another that generates an image from the land values and another that generates an image from the sea values. For the example we used data from MODB, the Mediterranean Oceanic Data Base http://modb.oce.ulg.ac.be/ - + */ static int test_generate(void) { hid_t fid; hsize_t pal_dims[2] = { 256, 3 }; - float *data; + float *data; int imax, jmax, kmax; float valex, xmin, xmax, value; FILE *f; @@ -555,7 +555,7 @@ static int test_generate(void) strcat(data_file, "/"); } strcat(data_file,DATA_FILE4); - + /*------------------------------------------------------------------------- * read data; the file data format is described below *------------------------------------------------------------------------- @@ -570,14 +570,14 @@ static int test_generate(void) } /* -!The first line of the ASCII file contains the dimension of the array : -! IMAX, JMAX, KMAX. The integers are stored with the FORTRAN format I5. -!The second line contains the exclusion value, the minimum and the maximum value of this -! file. These numbers are stored with the FORTRAN format E12.5. -! The remaining lines contains the data of the array, with 5 numbers per line -! (except the last line for each I-line). -! The array is stored in horizontal slices from sea surface to sea bottom and from -! north to south. So the indexes go from : +!The first line of the ASCII file contains the dimension of the array : +! IMAX, JMAX, KMAX. The integers are stored with the FORTRAN format I5. +!The second line contains the exclusion value, the minimum and the maximum value of this +! file. These numbers are stored with the FORTRAN format E12.5. +! The remaining lines contains the data of the array, with 5 numbers per line +! (except the last line for each I-line). +! The array is stored in horizontal slices from sea surface to sea bottom and from +! north to south. So the indexes go from : ! ! DO K = KMAX to 1 ! DO J = JMAX to 1 @@ -586,7 +586,7 @@ static int test_generate(void) ! OD ! OD ! OD -! +! ! ____________________________ ! / /| (imax,jmax,kmax) ! / sea surface / | @@ -603,21 +603,21 @@ static int test_generate(void) ! i ! */ - - - fscanf( f, "%d %d %d", &imax, &jmax, &kmax ); - fscanf( f, "%f %f %f", &valex, &xmin, &xmax ); - + + + fscanf( f, "%d %d %d", &imax, &jmax, &kmax ); + fscanf( f, "%f %f %f", &valex, &xmin, &xmax ); + data = (float*) malloc ( imax * jmax * kmax * sizeof( float )); image_data = (unsigned char*) malloc ( imax * jmax * kmax * sizeof( unsigned char )); - - for ( i = 0; i < imax * jmax * kmax; i++ ) + + for ( i = 0; i < imax * jmax * kmax; i++ ) { - fscanf( f, "%f ", &value ); + fscanf( f, "%f ", &value ); data[i] = value; } fclose( f ); - + /*------------------------------------------------------------------------- * transform the data from floating point to unsigend char * we are processing all the data here @@ -625,18 +625,18 @@ static int test_generate(void) */ TESTING2("make indexed image from all the data"); - - for ( i = 0; i < imax * jmax * kmax; i++ ) + + for ( i = 0; i < imax * jmax * kmax; i++ ) { image_data[i] = (unsigned char)(( 255 * (data[i] - xmin ) ) / (xmax - xmin )); } - + /* Make the image */ if ((H5IMmake_image_8bit(fid,"All data",(hsize_t)imax,(hsize_t)jmax,image_data))<0) goto out; PASSED(); - + /*------------------------------------------------------------------------- * transform the data from floating point to unsigend char * here we just process the land data @@ -644,21 +644,21 @@ static int test_generate(void) */ TESTING2("make indexed image from land data"); - - for ( i = 0; i < imax * jmax * kmax; i++ ) + + for ( i = 0; i < imax * jmax * kmax; i++ ) { if ( data[i] < 0 ) image_data[i] = 0; else image_data[i] = (unsigned char)(( 255 * (data[i] ) ) / xmax ); } - + /* make the image */ if ((H5IMmake_image_8bit(fid,"Land data",(hsize_t)imax,(hsize_t)jmax,image_data))<0) goto out; PASSED(); - + /*------------------------------------------------------------------------- * transform the data from floating point to unsigend char * here we just process the sea data @@ -666,32 +666,32 @@ static int test_generate(void) */ TESTING2("make indexed image from sea data"); - - for ( i = 0; i < imax * jmax * kmax; i++ ) + + for ( i = 0; i < imax * jmax * kmax; i++ ) { if ( data[i] > 0 ) image_data[i] = 0; else image_data[i] = (unsigned char)(( 255 * (data[i] - xmin ) ) / xmin ); } - + /* make the image */ if ((H5IMmake_image_8bit(fid,"Sea data",(hsize_t)imax,(hsize_t)jmax,image_data))<0) goto out; PASSED(); - + /*------------------------------------------------------------------------- * make a palette and attach it to the datasets *------------------------------------------------------------------------- */ TESTING2("attaching palettes"); - + /* make a palette */ if ((H5IMmake_palette(fid,PAL1_NAME,pal_dims,pal_rgb))<0) goto out; - + /* attach the palette to the image datasets */ if ((H5IMlink_palette(fid,"All data",PAL1_NAME))<0) goto out; @@ -701,17 +701,17 @@ static int test_generate(void) goto out; PASSED(); - + /*------------------------------------------------------------------------- - * close + * close *------------------------------------------------------------------------- - */ + */ if (H5Fclose(fid)<0) goto out; return 0; - + /* error zone, gracefully close */ out: H5E_BEGIN_TRY { @@ -733,7 +733,7 @@ out: * n * width * n - * + * * followed by the image data * *------------------------------------------------------------------------- @@ -778,10 +778,10 @@ static int read_data( const char* fname, /*IN*/ fscanf( f, "%s", str ); fscanf( f, "%d", &color_planes ); fscanf( f, "%s", str ); - fscanf( f, "%d", &h); + fscanf( f, "%d", &h); fscanf( f, "%s", str ); - fscanf( f, "%d", &w); - + fscanf( f, "%d", &w); + *width = (hsize_t)w; *height = (hsize_t)h; @@ -811,7 +811,7 @@ static int read_data( const char* fname, /*IN*/ * Read an ASCII palette file .PAL into an array * the files have a header of the type * - * Parameters: + * Parameters: * fname - name of file to read. * palette - array of rgb_t to store the read palette. * palette_size - number of elements in 'palette' array @@ -825,8 +825,8 @@ static int read_data( const char* fname, /*IN*/ #define STRING_CWPAL "CWPAL" #define VERSION_CWPAL "100" -static int read_palette(const char* fname, - rgb_t *palette, +static int read_palette(const char* fname, + rgb_t *palette, int palette_size) { FILE *file; @@ -850,42 +850,42 @@ static int read_palette(const char* fname, strcat(data_file, "/"); } strcat(data_file,fname); - + /* ensure the given palette is valid */ if (!palette) return -1; - + /* open the input file */ if (!(file = fopen(data_file, "r"))) { printf( "Could not open file %s. Try set $srcdir \n", data_file ); return -1; } - + /* read the file ident string */ if (fgets(buffer, sizeof(buffer), file) == NULL) { fclose(file); return -1; } - + /* ensure it matches the palette file ident string */ - if ( strncmp(buffer, STRING_JASC, sizeof(STRING_JASC) - 1) != 0 && + if ( strncmp(buffer, STRING_JASC, sizeof(STRING_JASC) - 1) != 0 && strncmp(buffer, STRING_CWPAL, sizeof(STRING_CWPAL) - 1) != 0 ) { fclose(file); return -1; } - + /* read the version string */ if (fgets(buffer, sizeof(buffer), file) == NULL) { fclose(file); return -1; } - - /* ensure it matches the palette file version string */ - if ( strncmp(buffer, VERSION_JASC, sizeof(VERSION_JASC) - 1) != 0 && + + /* ensure it matches the palette file version string */ + if ( strncmp(buffer, VERSION_JASC, sizeof(VERSION_JASC) - 1) != 0 && strncmp(buffer, VERSION_CWPAL, sizeof(VERSION_CWPAL) - 1) != 0 ) { fclose(file); @@ -898,31 +898,31 @@ static int read_palette(const char* fname, fclose(file); return -1; } - - - /* extract the number of colors. + + + /* extract the number of colors. check for missing version or number of colors in this case it reads the first entry */ - if ( strlen( buffer ) > 4 ) + if ( strlen( buffer ) > 4 ) { fclose(file); return -1; } - + if (sscanf(buffer, "%d", &nentries) != 1) { fclose(file); return -1; } - - /* ensure there are a sensible number of colors in the palette */ + + /* ensure there are a sensible number of colors in the palette */ if ((nentries < 0) || (nentries > 256) || (nentries > palette_size)) { fclose(file); return(-1); } - + /* read the palette entries */ for (i = 0; i < nentries; i++) { @@ -940,7 +940,7 @@ static int read_palette(const char* fname, /* close file */ fclose(file); - + return nentries; } diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index bc5fb72..ae29444 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -62,7 +62,7 @@ static int test_dsets( void ) char data_char_out[DIM]; short data_short_in[DIM] = {1,2,3,4,5,6}; short data_short_out[DIM]; - int data_int_in[DIM] = {1,2,3,4,5,6}; + int data_int_in[DIM] = {1,2,3,4,5,6}; int data_int_out[DIM]; long data_long_in[DIM] = {1,2,3,4,5,6}; long data_long_out[DIM]; @@ -74,7 +74,7 @@ static int test_dsets( void ) char data_string_out[20]; int i; - + /* Create a new file using default properties. */ file_id = H5Fcreate( FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT ); @@ -91,13 +91,13 @@ static int test_dsets( void ) /* Read dataset using the basic HDF5 API */ - if ( ( dataset_id = H5Dopen ( file_id, DSET0_NAME) ) < 0 ) + if ( ( dataset_id = H5Dopen ( file_id, DSET0_NAME) ) < 0 ) goto out; - if ( H5Dread ( dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data_int_out ) < 0 ) + if ( H5Dread ( dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data_int_out ) < 0 ) goto out; - if ( H5Dclose( dataset_id ) < 0 ) + if ( H5Dclose( dataset_id ) < 0 ) goto out; for (i = 0; i < DIM; i++) @@ -110,7 +110,7 @@ static int test_dsets( void ) PASSED(); /*------------------------------------------------------------------------- - * read using the LT function H5LTread_dataset + * read using the LT function H5LTread_dataset *------------------------------------------------------------------------- */ @@ -127,7 +127,7 @@ static int test_dsets( void ) } PASSED(); - + /*------------------------------------------------------------------------- * test the H5LTmake_dataset_ functions *------------------------------------------------------------------------- @@ -135,7 +135,7 @@ static int test_dsets( void ) /*------------------------------------------------------------------------- - * H5LTmake_dataset_char + * H5LTmake_dataset_char *------------------------------------------------------------------------- */ @@ -171,7 +171,7 @@ static int test_dsets( void ) /*------------------------------------------------------------------------- - * H5LTmake_dataset_short + * H5LTmake_dataset_short *------------------------------------------------------------------------- */ @@ -206,7 +206,7 @@ static int test_dsets( void ) PASSED(); /*------------------------------------------------------------------------- - * H5LTmake_dataset_int + * H5LTmake_dataset_int *------------------------------------------------------------------------- */ @@ -219,14 +219,14 @@ static int test_dsets( void ) /* Read dataset */ if ( H5LTread_dataset( file_id, DSET3_NAME, H5T_NATIVE_INT, data_int_out ) < 0 ) goto out; - + for (i = 0; i < DIM; i++) { if ( data_int_in[i] != data_int_out[i] ) { goto out; } } - + /* Read dataset */ if ( H5LTread_dataset_int( file_id, DSET3_NAME, data_int_out ) < 0 ) goto out; @@ -242,7 +242,7 @@ static int test_dsets( void ) /*------------------------------------------------------------------------- - * H5LTmake_dataset_long + * H5LTmake_dataset_long *------------------------------------------------------------------------- */ @@ -278,7 +278,7 @@ static int test_dsets( void ) /*------------------------------------------------------------------------- - * H5LTmake_dataset_float + * H5LTmake_dataset_float *------------------------------------------------------------------------- */ @@ -314,7 +314,7 @@ static int test_dsets( void ) /*------------------------------------------------------------------------- - * H5LTmake_dataset_double + * H5LTmake_dataset_double *------------------------------------------------------------------------- */ @@ -327,7 +327,7 @@ static int test_dsets( void ) /* Read dataset */ if ( H5LTread_dataset( file_id, DSET6_NAME, H5T_NATIVE_DOUBLE, data_double_out ) < 0 ) goto out; - + for (i = 0; i < DIM; i++) { if ( data_double_in[i] != data_double_out[i] ) { @@ -350,7 +350,7 @@ static int test_dsets( void ) /*------------------------------------------------------------------------- - * H5LTmake_dataset_string + * H5LTmake_dataset_string *------------------------------------------------------------------------- */ @@ -363,17 +363,17 @@ static int test_dsets( void ) /* Read dataset */ if ( H5LTread_dataset_string(file_id,DSET7_NAME,data_string_out) < 0 ) goto out; - - if ( strcmp(data_string_in,data_string_out) != 0 ) + + if ( strcmp(data_string_in,data_string_out) != 0 ) goto out; - - + + /*------------------------------------------------------------------------- * end tests *------------------------------------------------------------------------- */ - + /* Close the file. */ H5Fclose( file_id ); @@ -399,7 +399,7 @@ static int test_attr( void ) hid_t file_id; hid_t dataset_id; hid_t group_id; - hid_t space_id; + hid_t space_id; hsize_t dims[1] = { 5 }; /* Create a new file using default properties. */ @@ -414,7 +414,7 @@ static int test_attr( void ) if ((space_id = H5Screate_simple( 1, dims, NULL ))<0) goto out; /* Create the dataset */ - if ((dataset_id = H5Dcreate( file_id , "dset", H5T_NATIVE_INT, space_id, + if ((dataset_id = H5Dcreate( file_id , "dset", H5T_NATIVE_INT, space_id, H5P_DEFAULT ))<0) goto out; /* Close */ @@ -426,33 +426,33 @@ static int test_attr( void ) */ /* Create a group. */ - if ((group_id = H5Gcreate( file_id, "grp", 0 ))<0) + if ((group_id = H5Gcreate( file_id, "grp", 0 ))<0) goto out; - + /* Close */ H5Gclose( group_id ); - + /*------------------------------------------------------------------------- - * + * * Create attributes in the root group - * Note that we are calling the H5LTset_attribute functions with the name "." - * + * Note that we are calling the H5LTset_attribute functions with the name "." + * *------------------------------------------------------------------------- */ if (make_attributes( file_id, "." )<0) goto out; - + /*------------------------------------------------------------------------- - * + * * Create attributes in the dataset "dset" - * + * *------------------------------------------------------------------------- */ if (make_attributes( file_id, "dset" )<0) goto out; - + /*------------------------------------------------------------------------- - * + * * Create attributes in the group "grp" * *------------------------------------------------------------------------- @@ -519,7 +519,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name ) */ TESTING("H5LTset_attribute_string"); - + /* Set the attribute */ if ( H5LTset_attribute_string( loc_id, obj_name, ATTR1_NAME, attr_str_in ) < 0 ) return -1; @@ -533,12 +533,12 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name ) TESTING("H5LTget_attribute_string"); - + /* Get the attribute */ if ( H5LTget_attribute_string( loc_id, obj_name, ATTR1_NAME, attr_str_out ) < 0 ) return -1; - if ( strcmp( attr_str_in, attr_str_out ) != 0 ) + if ( strcmp( attr_str_in, attr_str_out ) != 0 ) { return -1; } @@ -994,13 +994,13 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name ) /*------------------------------------------------------------------------- - * H5LTget_attribute_ndims test + * H5LTget_attribute_ndims test *------------------------------------------------------------------------- */ TESTING("H5LTget_attribute_ndims"); - + if ( H5LTget_attribute_ndims( loc_id, obj_name, ATTR2_NAME, &rank_out ) < 0 ) return -1; @@ -1011,7 +1011,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name ) PASSED(); /*------------------------------------------------------------------------- - * H5LTget_attribute_info test + * H5LTget_attribute_info test *------------------------------------------------------------------------- */ @@ -1060,12 +1060,12 @@ int main( void ) /* check for errors */ if (nerrors) goto error; - + return 0; - + error: return 1; - + } diff --git a/hl/test/test_packet.c b/hl/test/test_packet.c index 38e1bc4..cd9a9e9 100644 --- a/hl/test/test_packet.c +++ b/hl/test/test_packet.c @@ -38,20 +38,20 @@ * structure used for some tests, a particle *------------------------------------------------------------------------- */ -typedef struct particle_t +typedef struct particle_t { char name[16]; int lati; int longi; float pressure; - double temperature; + double temperature; } particle_t; /*------------------------------------------------------------------------- * a static array of particles for writing and checking reads *------------------------------------------------------------------------- */ -static particle_t testPart[NRECORDS] = { +static particle_t testPart[NRECORDS] = { {"zero", 0,0, 0.0f, 0.0}, {"one", 10,10, 1.0f, 10.0}, {"two", 20,20, 2.0f, 20.0}, @@ -122,14 +122,14 @@ static int create_hl_table(hid_t fid) HOFFSET( particle_t, temperature )}; /* Define field information */ - const char *field_names[NFIELDS] = + const char *field_names[NFIELDS] = { "Name","Latitude", "Longitude", "Pressure", "Temperature" }; hid_t field_type[NFIELDS]; hid_t string_type; hsize_t chunk_size = 10; int *fill_data = NULL; int compress = 0; - herr_t status; + herr_t status; /* Initialize the field field_type */ string_type = H5Tcopy( H5T_C_S1 ); @@ -142,13 +142,13 @@ static int create_hl_table(hid_t fid) /*------------------------------------------------------------------------ - * H5TBmake_table + * H5TBmake_table *------------------------------------------------------------------------- */ status=H5TBmake_table( "Table Title", fid, H5TB_TABLE_NAME, (hsize_t) NFIELDS, - (hsize_t)NRECORDS, sizeof(particle_t), - field_names, part_offset, field_type, + (hsize_t)NRECORDS, sizeof(particle_t), + field_names, part_offset, field_type, chunk_size, fill_data, compress, testPart ); if(status<0) @@ -750,7 +750,7 @@ int test_opaque(hid_t fid) * * ensures that the packet table API throws the correct errors used on * objects that are not packet tables. - * + * *------------------------------------------------------------------------- */ int test_error(hid_t fid) @@ -807,7 +807,7 @@ int test_error(hid_t fid) if(H5PTread_packets(id, 0, 1, readBuf) >= 0) goto out; if(H5PTcreate_index(id) >= 0) - goto out; + goto out; H5E_END_TRY id_open=0; @@ -833,7 +833,7 @@ int test_error(hid_t fid) if(H5PTread_packets(id, 0, 1, readBuf) >= 0) goto out; if(H5PTcreate_index(id) >= 0) - goto out; + goto out; H5E_END_TRY PASSED(); @@ -882,7 +882,7 @@ int main(void) /*------------------------------------------------------------------------- * Packet test: test each function of the packet table *------------------------------------------------------------------------- - */ + */ /* create a file using default properties */ fid=H5Fcreate(TEST_FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); diff --git a/hl/test/test_table.c b/hl/test/test_table.c index 42987b2..6483932 100644 --- a/hl/test/test_table.c +++ b/hl/test/test_table.c @@ -29,7 +29,7 @@ * * Functions tested: * - * H5TBmake_table + * H5TBmake_table * H5TBread_table * H5TBwrite_records * H5TBread_records @@ -56,12 +56,12 @@ * structure used for all tests, a particle with properties *------------------------------------------------------------------------- */ -typedef struct particle_t +typedef struct particle_t { char name[16]; long longi; float pressure; - double temperature; + double temperature; int lati; } particle_t; @@ -72,24 +72,24 @@ typedef struct particle_t static hid_t h5file_open(const char *fname, unsigned flags); static int cmp_par(hsize_t i, hsize_t j, particle_t *rbuf, particle_t *wbuf ); -static int compare_deleted(hsize_t rrecords, hsize_t dstart, hsize_t drecords, +static int compare_deleted(hsize_t rrecords, hsize_t dstart, hsize_t drecords, particle_t *rbuf, particle_t *wbuf); /*------------------------------------------------------------------------- * a subset of particle_t, with latitude and longitude fields *------------------------------------------------------------------------- */ - typedef struct position_t + typedef struct position_t { long longi; int lati; } position_t; /*------------------------------------------------------------------------- - * a subset of particle_t, with name and pressure fields + * a subset of particle_t, with name and pressure fields *------------------------------------------------------------------------- */ - typedef struct namepressure_t + typedef struct namepressure_t { char name[16]; float pressure; @@ -117,7 +117,7 @@ static int compare_deleted(hsize_t rrecords, hsize_t dstart, hsize_t drecords, { char name[16]; long longi; - double temperature; + double temperature; int lati; } particle3_t; @@ -159,7 +159,7 @@ int test_table(hid_t fid, int write) hsize_t start2; /* record to start writing in 2nd table */ /*------------------------------------------------------------------------- - * read, write, insert, append buffers + * read, write, insert, append buffers *------------------------------------------------------------------------- */ particle_t rbuf[NRECORDS+4]; @@ -169,7 +169,7 @@ int test_table(hid_t fid, int write) particle_t abuf[2]={{"eight",80,8.0f,80.0,80},{"nine",90,9.0f,90.0,90}}; particle_t ibuf[2]={{"zero", 0, 0.0f, 0.0, 0},{"zero", 0, 0.0f, 0.0, 0}}; particle_t wbufd[NRECORDS]; - particle_t wbuf[NRECORDS] = { + particle_t wbuf[NRECORDS] = { {"zero", 0, 0.0f, 0.0, 0,}, {"one", 10, 1.0f, 10.0, 10}, {"two", 20, 2.0f, 20.0, 20}, @@ -187,23 +187,23 @@ int test_table(hid_t fid, int write) position_t position_out[NRECORDS]; position_t position_in[NRECORDS] = { {0,0}, {10,10}, - {20,20}, - {30,30}, + {20,20}, + {30,30}, {40,40}, - {50,50}, - {60,60}, + {50,50}, + {60,60}, {70,70} }; /* buffers for the fields "Name,Pressure" */ namepressure_t namepre_out[NRECORDS]; - namepressure_t namepre_in[NRECORDS] = + namepressure_t namepre_in[NRECORDS] = { {"zero",0.0f}, - {"one", 1.0f}, - {"two", 2.0f}, - {"three", 3.0f}, + {"one", 1.0f}, + {"two", 2.0f}, + {"three", 3.0f}, {"four", 4.0f}, {"five", 5.0f}, - {"six", 6.0f}, - {"seven", 7.0f}, + {"six", 6.0f}, + {"seven", 7.0f}, }; @@ -219,7 +219,7 @@ int test_table(hid_t fid, int write) HOFFSET( position_t, lati ) }; size_t field_offset_namepre[2]= - { + { HOFFSET( namepressure_t, name ), HOFFSET( namepressure_t, pressure ) }; @@ -229,12 +229,12 @@ int test_table(hid_t fid, int write) sizeof(position_in[0].lati) }; size_t field_sizes_namepre[2]= - { + { sizeof(namepre_in[0].name), sizeof(namepre_in[0].pressure) }; size_t field_sizes_pre[1]= - { + { sizeof(namepre_in[0].pressure) }; @@ -295,7 +295,7 @@ int test_table(hid_t fid, int write) sizeof( rbuf3[0].longi), sizeof( rbuf3[0].temperature), sizeof( rbuf3[0].lati)}; - + /*------------------------------------------------------------------------- * initialize table parameters @@ -306,7 +306,7 @@ int test_table(hid_t fid, int write) */ size_t type_size_mem = sizeof( particle_t ); - size_t field_offset[NFIELDS]= + size_t field_offset[NFIELDS]= { HOFFSET( particle_t, name ), HOFFSET( particle_t, longi ), @@ -314,17 +314,17 @@ int test_table(hid_t fid, int write) HOFFSET( particle_t, temperature ), HOFFSET( particle_t, lati ) }; - size_t field_size[NFIELDS] = + size_t field_size[NFIELDS] = { sizeof( rbuf[0].name), sizeof( rbuf[0].longi), sizeof( rbuf[0].pressure), sizeof( rbuf[0].temperature), - sizeof( rbuf[0].lati) + sizeof( rbuf[0].lati) }; - const char *field_names[NFIELDS] = + const char *field_names[NFIELDS] = { "Name","Longitude","Pressure","Temperature","Latitude" }; - hid_t field_type[NFIELDS]; + hid_t field_type[NFIELDS]; hid_t string_type = H5Tcopy( H5T_C_S1 ); H5Tset_size( string_type, 16 ); field_type[0] = string_type; @@ -337,7 +337,7 @@ int test_table(hid_t fid, int write) * * Functions tested: * - * H5TBmake_table + * H5TBmake_table * H5TBread_table * *------------------------------------------------------------------------- @@ -348,29 +348,29 @@ int test_table(hid_t fid, int write) if (H5TBmake_table(TITLE,fid,"table1",NFIELDS,NRECORDS,type_size_mem, field_names,field_offset,field_type, - chunk_size,fill,compress,wbuf)<0) + chunk_size,fill,compress,wbuf)<0) goto out; PASSED(); } TESTING2("reading table"); - + /*------------------------------------------------------------------------- * read the table *------------------------------------------------------------------------- */ - - if (H5TBread_table(fid,"table1",type_size_mem,field_offset,field_size,rbuf)<0) + + if (H5TBread_table(fid,"table1",type_size_mem,field_offset,field_size,rbuf)<0) goto out; - + /* compare the extracted table with the original array */ - for( i = 0; i < NRECORDS; i++ ) + for( i = 0; i < NRECORDS; i++ ) { - if (cmp_par(i,i,rbuf,wbuf)<0) + if (cmp_par(i,i,rbuf,wbuf)<0) goto out; } - + PASSED(); @@ -382,35 +382,35 @@ int test_table(hid_t fid, int write) * *------------------------------------------------------------------------- */ - if (write) + if (write) { TESTING2("writing records"); /* create an empty table */ if (H5TBmake_table(TITLE,fid,"table2",NFIELDS,NRECORDS,type_size_mem, field_names,field_offset,field_type, - chunk_size,fill,compress,0)<0) + chunk_size,fill,compress,0)<0) goto out; /*------------------------------------------------------------------------- * write records, start at 0, write 8 - * pos = 0 1 2 3 4 5 6 7 - * data= 0 1 2 3 4 5 6 7 + * pos = 0 1 2 3 4 5 6 7 + * data= 0 1 2 3 4 5 6 7 *------------------------------------------------------------------------- */ wstart=0; wrecords=8; if (H5TBwrite_records(fid,"table2",wstart,wrecords,type_size_mem,field_offset, - field_size,wbuf)<0) + field_size,wbuf)<0) goto out; /* read it back */ - if (H5TBread_table(fid,"table2",type_size_mem,field_offset,field_size,rbuf)<0) + if (H5TBread_table(fid,"table2",type_size_mem,field_offset,field_size,rbuf)<0) goto out; - + /* compare */ - for( i = 0; i < NRECORDS; i++ ) + for( i = 0; i < NRECORDS; i++ ) { - if (cmp_par(i,i,rbuf,wbuf)<0) + if (cmp_par(i,i,rbuf,wbuf)<0) goto out; } @@ -427,14 +427,14 @@ int test_table(hid_t fid, int write) */ TESTING2("reading records"); - + /*------------------------------------------------------------------------- * read records, start at 0, read 8 - * pos = 0 1 2 3 4 5 6 7 + * pos = 0 1 2 3 4 5 6 7 * data= 0 1 2 3 4 5 6 7 *------------------------------------------------------------------------- */ - + /*------------------------------------------------------------------------- * for the read test we cannot use "table2" because it has been appended * we use the original "table1" instead @@ -444,16 +444,16 @@ int test_table(hid_t fid, int write) strcpy(tname,"table2"); else strcpy(tname,"table1"); - + rstart=0; rrecords=8; if (H5TBread_records(fid,tname,rstart,rrecords,type_size_mem,field_offset, - field_size,rbuf)<0) + field_size,rbuf)<0) goto out; /* compare */ - for( i=rstart; i=istart && i=istart+irecords && i<10) { j=i-irecords; - if (cmp_par(i,j,rbuf,wbuf)<0) + if (cmp_par(i,j,rbuf,wbuf)<0) goto out; } - else + else { j=i-10; - if (cmp_par(i,j,rbuf,abuf)<0) + if (cmp_par(i,j,rbuf,abuf)<0) goto out; } } @@ -579,151 +579,151 @@ int test_table(hid_t fid, int write) /*------------------------------------------------------------------------- * Create a table - * pos = 0 1 2 3 4 5 6 7 - * data= 0 1 2 3 4 5 6 7 + * pos = 0 1 2 3 4 5 6 7 + * data= 0 1 2 3 4 5 6 7 *------------------------------------------------------------------------- */ - for( i=0; i= 2 && i <= 4 ) { if ( rbuf[i].lati != position_in[i].lati || rbuf[i].longi != position_in[i].longi || - rbuf[i].pressure != pressure_in[i] ) + rbuf[i].pressure != pressure_in[i] ) { fprintf(stderr,"%ld %f %d\n", rbuf[i].longi,rbuf[i].pressure,rbuf[i].lati); @@ -955,7 +955,7 @@ int test_table(hid_t fid, int write) *------------------------------------------------------------------------- */ TESTING2("reading fields by name"); - + /*------------------------------------------------------------------------- * write and read the "Pressure" field *------------------------------------------------------------------------- @@ -964,32 +964,32 @@ int test_table(hid_t fid, int write) { if (H5TBmake_table(TITLE,fid,"table10",NFIELDS,NRECORDS,type_size_mem, field_names,field_offset,field_type, - chunk_size,fill1,compress,0)<0) + chunk_size,fill1,compress,0)<0) goto out; - + /* write the pressure field to all the records */ - start = 0; - nrecords = NRECORDS; - if ( H5TBwrite_fields_name(fid,"table10","Pressure",start,nrecords, + start = 0; + nrecords = NRECORDS; + if ( H5TBwrite_fields_name(fid,"table10","Pressure",start,nrecords, sizeof( float ),0,field_sizes_pre,pressure_in)<0) goto out; } - + /* read the "Pressure" field */ - start = 0; - nrecords = NRECORDS; - if ( H5TBread_fields_name(fid,"table10","Pressure",start,nrecords, + start = 0; + nrecords = NRECORDS; + if ( H5TBread_fields_name(fid,"table10","Pressure",start,nrecords, sizeof(float),0,field_sizes_pre,pressure_out)<0) goto out; - + /* Compare the extracted table with the initial values */ - for( i = 0; i < NRECORDS; i++ ) + for( i = 0; i < NRECORDS; i++ ) { if ( pressure_out[i] != pressure_in[i] ) { goto out; } } - + /*------------------------------------------------------------------------- * Write and read the "Latitude,Longitude" fields *------------------------------------------------------------------------- @@ -997,28 +997,28 @@ int test_table(hid_t fid, int write) if (write) { /* Write the new longitude and latitude information to all the records */ - start = 0; - nrecords = NRECORDS; - if ( H5TBwrite_fields_name(fid,"table10", "Latitude,Longitude", start, nrecords, + start = 0; + nrecords = NRECORDS; + if ( H5TBwrite_fields_name(fid,"table10", "Latitude,Longitude", start, nrecords, sizeof( position_t ), field_offset_pos, field_sizes_pos, position_in ) < 0 ) goto out; }/*write*/ - + /* Read the "Latitude,Longitude" fields */ - start = 0; - nrecords = NRECORDS; - if ( H5TBread_fields_name( fid, "table10", "Latitude,Longitude", + start = 0; + nrecords = NRECORDS; + if ( H5TBread_fields_name( fid, "table10", "Latitude,Longitude", start, nrecords, sizeof(position_t), field_offset_pos, field_sizes_pos, position_out ) < 0 ) goto out; - + /* Compare the extracted table with the initial values */ - for( i = 0; i < NRECORDS; i++ ) + for( i = 0; i < NRECORDS; i++ ) { if ( position_out[i].lati != position_in[i].lati || - position_out[i].longi != position_in[i].longi ) + position_out[i].longi != position_in[i].longi ) goto out; } - + /*------------------------------------------------------------------------- * Write and read the "Name,Pressure" fields @@ -1027,23 +1027,23 @@ int test_table(hid_t fid, int write) if (write) { /* Write the new name and pressure information to all the records */ - start = 0; - nrecords = NRECORDS; - if ( H5TBwrite_fields_name( fid, "table10", "Name,Pressure", start, nrecords, + start = 0; + nrecords = NRECORDS; + if ( H5TBwrite_fields_name( fid, "table10", "Name,Pressure", start, nrecords, sizeof( namepressure_t ), field_offset_namepre, field_sizes_namepre, namepre_in ) < 0 ) goto out; }/*write*/ /* Read the "Name,Pressure" fields */ - start = 0; - nrecords = NRECORDS; - if ( H5TBread_fields_name( fid, "table10", "Name,Pressure", + start = 0; + nrecords = NRECORDS; + if ( H5TBread_fields_name( fid, "table10", "Name,Pressure", start, nrecords, sizeof(namepressure_t), field_offset_namepre, field_sizes_namepre, namepre_out ) < 0 ) goto out; /* Compare the extracted table with the initial values */ - for( i = 0; i < NRECORDS; i++ ) + for( i = 0; i < NRECORDS; i++ ) { if ( ( strcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) || namepre_out[i].pressure != namepre_in[i].pressure ) { @@ -1051,7 +1051,7 @@ int test_table(hid_t fid, int write) } } /* reset buffer */ - for( i = 0; i < NRECORDS; i++ ) + for( i = 0; i < NRECORDS; i++ ) { strcpy( namepre_out[i].name, "\0" ); namepre_out[i].pressure = -1; @@ -1061,15 +1061,15 @@ int test_table(hid_t fid, int write) * read only 3 records of the "Name,Pressure" fields, starting at record 2 *------------------------------------------------------------------------- */ - start = 2; - nrecords = 3; - if ( H5TBread_fields_name( fid, "table10", "Name,Pressure", - start, nrecords, sizeof(namepressure_t), field_offset_namepre, + start = 2; + nrecords = 3; + if ( H5TBread_fields_name( fid, "table10", "Name,Pressure", + start, nrecords, sizeof(namepressure_t), field_offset_namepre, field_sizes_namepre, namepre_out ) < 0 ) goto out; /* Compare the extracted table with the initial values */ - for( i = 0; i < 3; i++ ) + for( i = 0; i < 3; i++ ) { if ( ( strcmp( namepre_out[i].name, namepre_in[start+i].name ) != 0 ) || namepre_out[i].pressure != namepre_in[start+i].pressure ) { @@ -1093,42 +1093,42 @@ int test_table(hid_t fid, int write) /* make an empty table */ if (H5TBmake_table(TITLE,fid,"table11",NFIELDS,NRECORDS,type_size_mem, field_names,field_offset,field_type, - chunk_size,fill,compress,NULL)<0) + chunk_size,fill,compress,NULL)<0) goto out; /* write the pressure field starting at record 2 */ nfields = 1; - start = 2; - nrecords = 3; - if ( H5TBwrite_fields_index(fid, "table11", nfields, field_index_pre, start, nrecords, + start = 2; + nrecords = 3; + if ( H5TBwrite_fields_index(fid, "table11", nfields, field_index_pre, start, nrecords, sizeof( float ), 0, field_sizes_pre, pressure_in ) < 0 ) goto out; /* write the new longitude and latitude information starting at record 2 */ nfields = 2; - start = 2; - nrecords = 3; - if ( H5TBwrite_fields_index(fid, "table11", nfields, field_index_pos, start, nrecords, + start = 2; + nrecords = 3; + if ( H5TBwrite_fields_index(fid, "table11", nfields, field_index_pos, start, nrecords, sizeof( position_t ), field_offset_pos, field_sizes_pos, position_in ) < 0 ) goto out; /* read back the all table */ nfields = 5; - start = 0; - nrecords = NRECORDS; - if ( H5TBread_fields_index(fid, "table11", nfields, field_index, + start = 0; + nrecords = NRECORDS; + if ( H5TBread_fields_index(fid, "table11", nfields, field_index, start, nrecords, type_size_mem, field_offset, field_size, rbuf ) < 0 ) goto out; /* Compare the extracted table with the initial values */ - for( i = 0; i < NRECORDS; i++ ) + for( i = 0; i < NRECORDS; i++ ) { if ( i >= 2 && i <= 4 ) { if ( rbuf[i].lati != position_in[i].lati || rbuf[i].longi != position_in[i].longi || - rbuf[i].pressure != pressure_in[i] ) + rbuf[i].pressure != pressure_in[i] ) goto out; } } @@ -1145,7 +1145,7 @@ int test_table(hid_t fid, int write) * *------------------------------------------------------------------------- */ - + TESTING2("reading fields by index"); if (write) @@ -1153,9 +1153,9 @@ int test_table(hid_t fid, int write) /* make an empty table */ if (H5TBmake_table(TITLE,fid,"table12",NFIELDS,NRECORDS,type_size_mem, field_names,field_offset,field_type, - chunk_size,fill,compress,NULL)<0) + chunk_size,fill,compress,NULL)<0) goto out; - + /*------------------------------------------------------------------------- * write and read the "Pressure" field *------------------------------------------------------------------------- @@ -1163,29 +1163,29 @@ int test_table(hid_t fid, int write) /* write the pressure field to all the records */ nfields = 1; - start = 0; - nrecords = NRECORDS; - if ( H5TBwrite_fields_index(fid, "table12", nfields, field_index_pre, start, nrecords, + start = 0; + nrecords = NRECORDS; + if ( H5TBwrite_fields_index(fid, "table12", nfields, field_index_pre, start, nrecords, sizeof( float ), 0, field_sizes_pre, pressure_in ) < 0 ) goto out; } - + /* read the "Pressure" field */ nfields = 1; - start = 0; - nrecords = NRECORDS; - if ( H5TBread_fields_index(fid, "table12", nfields, field_index_pre, + start = 0; + nrecords = NRECORDS; + if ( H5TBread_fields_index(fid, "table12", nfields, field_index_pre, start, nrecords, sizeof(float), 0, field_sizes_pre, pressure_out ) < 0 ) goto out; /* compare the extracted table with the initial values */ - for( i = 0; i < NRECORDS; i++ ) + for( i = 0; i < NRECORDS; i++ ) { if ( pressure_out[i] != pressure_in[i] ) { goto out; } } - + /*------------------------------------------------------------------------- * write and read the "Latitude,Longitude" fields *------------------------------------------------------------------------- @@ -1194,23 +1194,23 @@ int test_table(hid_t fid, int write) { /* write the new longitude and latitude information to all the records */ nfields = 2; - start = 0; - nrecords = NRECORDS; - if ( H5TBwrite_fields_index(fid, "table12", nfields, field_index_pos, start, nrecords, + start = 0; + nrecords = NRECORDS; + if ( H5TBwrite_fields_index(fid, "table12", nfields, field_index_pos, start, nrecords, sizeof( position_t ), field_offset_pos, field_sizes_pos, position_in ) < 0 ) goto out; } /*write*/ /* read the "Latitude,Longitude" fields */ nfields = 2; - start = 0; - nrecords = NRECORDS; - if ( H5TBread_fields_index(fid, "table12", nfields, field_index_pos, + start = 0; + nrecords = NRECORDS; + if ( H5TBread_fields_index(fid, "table12", nfields, field_index_pos, start, nrecords, sizeof(position_t), field_offset_pos, field_sizes_pos, position_out ) < 0 ) goto out; /* compare the extracted table with the initial values */ - for( i = 0; i < NRECORDS; i++ ) + for( i = 0; i < NRECORDS; i++ ) { if ( position_out[i].lati != position_in[i].lati || position_out[i].longi != position_in[i].longi ) { @@ -1227,24 +1227,24 @@ int test_table(hid_t fid, int write) { /* write the new name and pressure information to all the records */ nfields = 2; - start = 0; - nrecords = NRECORDS; - if ( H5TBwrite_fields_index(fid, "table12", nfields, field_index_namepre, start, nrecords, + start = 0; + nrecords = NRECORDS; + if ( H5TBwrite_fields_index(fid, "table12", nfields, field_index_namepre, start, nrecords, sizeof( namepressure_t ), field_offset_namepre, field_sizes_namepre, namepre_in ) < 0 ) goto out; } /* read the "Name,Pressure" fields */ nfields = 2; - start = 0; - nrecords = NRECORDS; - if ( H5TBread_fields_index(fid, "table12", nfields, field_index_namepre, - start, nrecords, sizeof(namepressure_t), field_offset_namepre, + start = 0; + nrecords = NRECORDS; + if ( H5TBread_fields_index(fid, "table12", nfields, field_index_namepre, + start, nrecords, sizeof(namepressure_t), field_offset_namepre, field_sizes_namepre, namepre_out ) < 0 ) goto out; /* compare the extracted table with the initial values */ - for( i = 0; i < NRECORDS; i++ ) + for( i = 0; i < NRECORDS; i++ ) { if ( ( strcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) || namepre_out[i].pressure != namepre_in[i].pressure ) { @@ -1253,7 +1253,7 @@ int test_table(hid_t fid, int write) } /* reset buffer */ - for( i = 0; i < NRECORDS; i++ ) + for( i = 0; i < NRECORDS; i++ ) { strcpy( namepre_out[i].name, "\0" ); namepre_out[i].pressure = -1; @@ -1263,18 +1263,18 @@ int test_table(hid_t fid, int write) * read only 3 records of the "Name,Pressure" fields, starting at record 2 *------------------------------------------------------------------------- */ - + /* write the new name and pressure information to all the records */ nfields = 2; - start = 2; - nrecords = 3; - if ( H5TBread_fields_index(fid, "table12", nfields, field_index_namepre, - start, nrecords, sizeof(namepressure_t), field_offset_namepre, + start = 2; + nrecords = 3; + if ( H5TBread_fields_index(fid, "table12", nfields, field_index_namepre, + start, nrecords, sizeof(namepressure_t), field_offset_namepre, field_sizes_namepre, namepre_out ) < 0 ) goto out; /* compare the extracted table with the initial values */ - for( i = 0; i < 3; i++ ) + for( i = 0; i < 3; i++ ) { if ( ( strcmp( namepre_out[i].name, wbuf[start+i].name ) != 0 ) || namepre_out[i].pressure != wbuf[start+i].pressure ) { @@ -1293,7 +1293,7 @@ int test_table(hid_t fid, int write) * *------------------------------------------------------------------------- */ - + if (write) { TESTING2("inserting fields"); @@ -1301,12 +1301,12 @@ int test_table(hid_t fid, int write) /* make a table */ if (H5TBmake_table(TITLE,fid,"table13",NFIELDS,NRECORDS,type_size_mem, field_names,field_offset,field_type, - chunk_size,fill1,compress,wbuf)<0) + chunk_size,fill1,compress,wbuf)<0) goto out; - + /* insert the new field at the end of the field list */ position = NFIELDS; - if ( H5TBinsert_field( fid, "table13", "New Field", field_type_new, position, + if ( H5TBinsert_field( fid, "table13", "New Field", field_type_new, position, fill1_new, buf_new ) < 0 ) goto out; @@ -1315,7 +1315,7 @@ int test_table(hid_t fid, int write) goto out; /* compare the extracted table with the original array */ - for( i = 0; i < NRECORDS; i++ ) + for( i = 0; i < NRECORDS; i++ ) { if ( ( strcmp( rbuf2[i].name, wbuf[i].name ) != 0 ) || rbuf2[i].lati != wbuf[i].lati || @@ -1345,7 +1345,7 @@ int test_table(hid_t fid, int write) /* make a table */ if (H5TBmake_table(TITLE,fid,"table14",NFIELDS,NRECORDS,type_size_mem, field_names,field_offset,field_type, - chunk_size,fill,compress,wbuf)<0) + chunk_size,fill,compress,wbuf)<0) goto out; @@ -1356,9 +1356,9 @@ int test_table(hid_t fid, int write) /* read the table */ if ( H5TBread_table(fid, "table14", dst_size3, dst_offset3, dst_sizes3, rbuf3 ) < 0 ) goto out; - + /* compare the extracted table with the original array */ - for( i = 0; i < NRECORDS; i++ ) + for( i = 0; i < NRECORDS; i++ ) { if ( ( strcmp( rbuf3[i].name, wbuf[i].name ) != 0 ) || rbuf3[i].lati != wbuf[i].lati || @@ -1403,10 +1403,10 @@ int test_table(hid_t fid, int write) */ TESTING2("getting field info"); - + /* alocate */ names_out = malloc( sizeof(char*) * (size_t)NFIELDS ); - for ( i = 0; i < NFIELDS; i++) + for ( i = 0; i < NFIELDS; i++) { names_out[i] = malloc( sizeof(char) * 255 ); } @@ -1415,7 +1415,7 @@ int test_table(hid_t fid, int write) if ( H5TBget_field_info(fid, "table1", names_out, sizes_out, offset_out, &size_out ) < 0 ) goto out; - for ( i = 0; i < NFIELDS; i++) + for ( i = 0; i < NFIELDS; i++) { if ( (strcmp( field_names[i], names_out[i] ) != 0)) { goto out; @@ -1423,7 +1423,7 @@ int test_table(hid_t fid, int write) } /* release */ - for ( i = 0; i < NFIELDS; i++) + for ( i = 0; i < NFIELDS; i++) { free ( names_out[i] ); } @@ -1451,11 +1451,11 @@ int main(void) { hid_t fid; /* identifier for the file */ unsigned flags=H5F_ACC_RDONLY; - + /*------------------------------------------------------------------------- * test1: create a file for the write/read test *------------------------------------------------------------------------- - */ + */ /* create a file using default properties */ fid=H5Fcreate("test_table.h5",H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT); @@ -1472,7 +1472,7 @@ int main(void) /*------------------------------------------------------------------------- * test2: open a file written in test1 on a big-endian machine *------------------------------------------------------------------------- - */ + */ puts("Testing table with file open mode (read big-endian data):"); fid=h5file_open(TEST_FILE_BE,flags); @@ -1527,18 +1527,18 @@ out: */ static hid_t h5file_open(const char *fname, unsigned flags) { - + hid_t fid; /* identifier for the file */ char *srcdir = getenv("srcdir"); /* the source directory */ char data_file[512]=""; /* buffer to hold name of existing file */ - + /* compose the name of the file to open, using the srcdir, if appropriate */ if (srcdir){ strcpy(data_file,srcdir); strcat(data_file,"/"); - } + } strcat(data_file,fname); - + /* open */ if((fid=H5Fopen(data_file,flags,H5P_DEFAULT))<0) { fprintf(stderr,"Error: Cannot open file <%s>\n",data_file ); @@ -1573,21 +1573,21 @@ static int cmp_par(hsize_t i, hsize_t j, particle_t *rbuf, particle_t *wbuf ) * function to compare deleted records *------------------------------------------------------------------------- */ -static int compare_deleted(hsize_t rrecords, hsize_t dstart, hsize_t drecords, +static int compare_deleted(hsize_t rrecords, hsize_t dstart, hsize_t drecords, particle_t *rbuf, particle_t *wbuf) { hsize_t i,j; - for( i=0; iPackedField & 0x07) +1)) -1; Raster = GifImageDesc->GIFImage; /* Check for image seperator */ - + /* Now read in values from the image descriptor */ IWidth = GifImageDesc->ImageWidth; IHeight = GifImageDesc->ImageHeight; Interlace = GifImageDesc->PackedField & 0x40; - + /* * Note that I ignore the possible existence of a local color map. I'm * told there aren't many files around that use them, and the spec says * it's defined for future use. This could lead to an error reading some - * files. + * files. */ - + /* * Start reading the raster data. First we get the WORDial code size and * compute decompressor constant values, based on this code size. */ - + CodeSize = GifImageDesc->CodeSize; ClearCode = (1 << CodeSize); EOFCode = ClearCode + 1; FreeCode = FirstFree = ClearCode + 2; - + /* * The GIF spec has it that the code size is the code size used to compute * the above values is the code size given in the file, but the code size @@ -218,19 +218,19 @@ Decompress(GIFIMAGEDESC *GifImageDesc, GIFHEAD *GifHead) */ /* Allocate the Image */ - + if (!(Image = (BYTE *)malloc((size_t)IWidth*(size_t)IHeight))) { printf("Out of memory"); exit(-1); } - + BytesPerScanline = IWidth; - + /* * Decompress the file, continuing until you see the GIF EOF code. One * obvious enhancement is to add checking for corrupt files here. */ - + Code = ReadCode(); while (Code != EOFCode) { @@ -269,7 +269,7 @@ Decompress(GIFIMAGEDESC *GifImageDesc, GIFHEAD *GifHead) */ while (CurCode > DataMask) { if (OutCount > 1024) { - /*return error message*/ + /*return error message*/ } OutCode[OutCount++] = Suffix[CurCode]; @@ -316,5 +316,5 @@ Decompress(GIFIMAGEDESC *GifImageDesc, GIFHEAD *GifHead) Code = ReadCode(); } - return Image; + return Image; } diff --git a/hl/tools/gif2h5/gif.h b/hl/tools/gif2h5/gif.h index 282085f..ad60968 100644 --- a/hl/tools/gif2h5/gif.h +++ b/hl/tools/gif2h5/gif.h @@ -47,8 +47,8 @@ typedef unsigned char boolean; ** Set EndianOrder = 0 if machine is little endian ** EndianOrder = 1 if machine is big endian. */ -extern int EndianOrder; - +extern int EndianOrder; + /* ** The GIF header format. ** @@ -63,9 +63,9 @@ typedef struct _GifHeader { /* Offset Description */ BYTE ApplicationCount; BYTE PlainTextCount; BYTE HDFPalette[256][3]; - BYTE HeaderDump[6]; /* BYTE array to dump header contents */ + BYTE HeaderDump[6]; /* BYTE array to dump header contents */ BYTE LSDDump[7]; /* Logical Screen Descriptor dump */ -} GIFHEAD; +} GIFHEAD; /* @@ -122,9 +122,9 @@ typedef struct _GifCommentExtension { /* ** GIF to HDF Memory Struct -** Purpose : The gif to hdf structure is used to pass all the +** Purpose : The gif to hdf structure is used to pass all the ** gif data to the memory, which gets caught by the hdf driver -** Its the drivers job to put the data in the appropriate places +** Its the drivers job to put the data in the appropriate places ** in the HDF file. ** I have assumed that the ImageDescriptors and GraphicControls follow ** one another, ie. I have not associated them with each other. The driver diff --git a/hl/tools/gif2h5/gif2mem.c b/hl/tools/gif2h5/gif2mem.c index 01aa5a2..0695995 100644 --- a/hl/tools/gif2h5/gif2mem.c +++ b/hl/tools/gif2h5/gif2mem.c @@ -100,7 +100,7 @@ Gif2Mem(BYTE *MemGif) /* Read the GIF image file header information */ ReadGifHeader(gifHead, &MemGif); - + /* Check for FILE stream error */ #if 0 if (ferror(fpGif)) @@ -121,7 +121,7 @@ Gif2Mem(BYTE *MemGif) for (;;) { Identifier = *MemGif++; - + switch (Identifier) { case 0x3B: /* Trailer */ /* @@ -140,16 +140,16 @@ Gif2Mem(BYTE *MemGif) GifMemoryStruct.GifApplicationExtension = gifApplication; GifMemoryStruct.GifCommentExtension = gifComment; GifMemoryStruct.GifGraphicControlExtension = gifGraphicControl; - + /* return the struct */ return GifMemoryStruct; case 0x2C: /* Image Descriptor */ /* * If there was no image descriptor before this increase image - * count. If an imagedescriptor was present, reset GCEflag + * count. If an imagedescriptor was present, reset GCEflag */ - if (GCEflag == 0) + if (GCEflag == 0) ImageCount++; else GCEflag = 0; @@ -180,17 +180,17 @@ Gif2Mem(BYTE *MemGif) printf("Out of memory!"); exit(-1); } - + if (ReadGifImageDesc(gifImageDesc[ImageCount-1], &MemGif) == -1) fputs("Error reading Image Descriptor information\n", stderr); - + /* Decompress the Image */ gifImageDesc[ImageCount-1]->Image = Decompress(gifImageDesc[ImageCount-1], gifHead); free(gifImageDesc[ImageCount-1]->GIFImage); - /* + /* * Convert the local palette into an HDF compatible palette In * case the local color table is present, it is written out as * the HDFPalette If it is absent the global table is written @@ -213,8 +213,8 @@ Gif2Mem(BYTE *MemGif) } break; - - case 0x21: /* Extension Block */ + + case 0x21: /* Extension Block */ Label = *MemGif++; switch (Label) { @@ -240,7 +240,7 @@ Gif2Mem(BYTE *MemGif) "Error reading Plain Text Extension information.\n"); break; - + case 0xFE: /* Comment Extension */ CommentCount++; @@ -251,19 +251,19 @@ Gif2Mem(BYTE *MemGif) printf("Out of memory!"); exit(-1); } - + if(!(gifComment[CommentCount - 1] = (GIFCOMMENT *)malloc(sizeof(GIFCOMMENT)))) { printf("Out of memory!"); exit(-1); } - + if (ReadGifComment(gifComment[CommentCount - 1], &MemGif)) fprintf(stderr, "Error reading Comment Extension information\n"); break; - + case 0xF9: /* Graphic Control Extension */ if (GCEflag == 0 ) ImageCount++; @@ -289,17 +289,17 @@ Gif2Mem(BYTE *MemGif) gifImageDesc[j] = NULL; } } - + if(!(gifGraphicControl[ImageCount-1] = (GIFGRAPHICCONTROL*)malloc(sizeof(GIFGRAPHICCONTROL)))) { printf("Out of memory!"); exit(-1); } - - + + if (ReadGifGraphicControl(gifGraphicControl[ImageCount-1], &MemGif)) fprintf(stderr, "Error reading Graphic Control Extension information\n"); - + if (!*MemGif++ == 0) fprintf(stderr, "Error reading Graphic Control Extension\n"); @@ -311,18 +311,18 @@ Gif2Mem(BYTE *MemGif) if (ApplicationCount > ApplicationArray) ApplicationArray = (ApplicationArray << 1) + 1; - + if (!(gifApplication = (GIFAPPLICATION **)realloc(gifApplication , sizeof(GIFAPPLICATION *) * ApplicationArray))) { printf("Out of memory!"); exit(-1); } - + if(!(gifApplication[ApplicationCount - 1] = (GIFAPPLICATION *)malloc(sizeof(GIFAPPLICATION)))) { printf("Out of memory!"); exit(-1); } - + if (ReadGifApplication(gifApplication[ApplicationCount - 1], &MemGif)) fprintf(stderr, "Error reading Application Extension information\n"); diff --git a/hl/tools/gif2h5/gifread.c b/hl/tools/gif2h5/gifread.c index b135617..5f4aba0 100644 --- a/hl/tools/gif2h5/gifread.c +++ b/hl/tools/gif2h5/gifread.c @@ -11,16 +11,16 @@ * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include +#include +#include -#include "gif.h" +#include "gif.h" int EndianOrder; static BYTE *ReadDataSubBlocks(BYTE **MemGif2, WORD *DSize); -WORD +WORD GetWord(BYTE *MemGif) { WORD w; @@ -39,7 +39,7 @@ GetWord(BYTE *MemGif) BYTE GetByte(BYTE *MemGif) -{ +{ return *MemGif; } @@ -69,7 +69,7 @@ ReadGifHeader(GIFHEAD *GifHead, /* Pointer to GIF header structure */ printf("The file does not appear to be a valid GIF file.\n"); exit(-1); } - + for (i = 0 ; i < 7 ; i++) { GifHead->LSDDump[i] = *(*MemGif2)++; } @@ -84,7 +84,7 @@ ReadGifHeader(GIFHEAD *GifHead, /* Pointer to GIF header structure */ /* Read the Global Color Table */ - /* + /* * There are some changes made here apart from just reading in the * global color table as would seem intuitively obvious. The colors * are stored in the bottom part of the palette as opposed to the top @@ -100,7 +100,7 @@ ReadGifHeader(GIFHEAD *GifHead, /* Pointer to GIF header structure */ /* Check for a FILE stream error */ #if 0 if (ferror(FpGif)) - return -1; + return -1; #endif /* 0 */ return 0; /* No FILE stream error occured */ @@ -136,11 +136,11 @@ ReadGifImageDesc( for (i = 0 ; i < 9 ; i++) { GifImageDesc->GIDDump[i] = *(*MemGif2)++; } - + /* ** Get the relevant fields. I need ImageWidth and Height actively hence I have ** taken information from those fields. I intend to keep the GifImageDesc data - ** structure as it is so that anyone needing the rest of the fields can do so + ** structure as it is so that anyone needing the rest of the fields can do so ** quickly. */ @@ -160,10 +160,10 @@ ReadGifImageDesc( GifImageDesc->ImageHeight = (WORD) (GifImageDesc->GIDDump[6] & 0xFF); GifImageDesc->ImageHeight = ((WORD) (GifImageDesc->GIDDump[7] & 0xFF)) | (GifImageDesc->ImageWidth << 0x08); - + } - + GifImageDesc->PackedField = GifImageDesc->GIDDump[8]; /* Interlace = GifImageDesc->PackedField & 0x20; */ @@ -193,7 +193,7 @@ ReadGifImageDesc( printf("Out of memory"); exit(-1); } - + TempPtr = GifImageDesc->GIFImage; do @@ -258,7 +258,7 @@ ReadGifPlainText( if (!(GifPlainText->PlainTextData = ReadDataSubBlocks(MemGif2 , &(GifPlainText->DataSize)))) return(1); - /* + /* GifPlainText->Terminator = 0; */ @@ -299,7 +299,7 @@ ReadGifApplication( /* GifApplication->Terminator = 0; */ - + /* Check for a FILE stream error */ /* if (ferror(FpGif)) @@ -325,13 +325,13 @@ ReadGifComment( BYTE **MemGif2 /* GIF image file input FILE stream */ ) { - + /* Read in the Plain Text data sub-blocks */ if (!(GifComment->CommentData = ReadDataSubBlocks(MemGif2 , &(GifComment->DataSize)))) return(1); GifComment->Terminator = 0; - + return(0); /* No FILE stream error occured */ } @@ -357,9 +357,9 @@ ReadDataSubBlocks(BYTE **MemGif2, /* GIF image file input FILE stream int tempcount = 0; bufSize = 0; /* The output buffer is empty */ - + dataSize = *(*MemGif2)++; /* Get the size of the first sub-block */ - + /* Allocate initial data buffer */ if (!(ptr1 = ptr2 = (BYTE *) malloc((size_t)dataSize + 1))) { printf("Out of memory. Allocation of memory for data sub-blocks for\neither Comment, Plain Text or Application Extensions failed"); @@ -376,23 +376,23 @@ ReadDataSubBlocks(BYTE **MemGif2, /* GIF image file input FILE stream #endif /* COMMENTED_OUT */ while (dataSize--) /* Read/write the Plain Text data */ *ptr1++ = *(*MemGif2)++; - + /* Check if there is another data sub-block */ if ((dataSize = *(*MemGif2)++) == 0) break; /* Block Terminator encountered */ - + /* Increase the buffer size to accomodate the next sub-block */ if (!(ptr1 = ptr2 = (BYTE *) realloc(ptr2, bufSize + dataSize + 1))) return((BYTE *) NULL); - + ptr1 += bufSize; /* Move pointer to the end of the data */ - - + + } *ptr1++ = '\0'; - + return(ptr2); /* Return a pointer to the sub-block data */ } diff --git a/hl/tools/gif2h5/hdf2gif.c b/hl/tools/gif2h5/hdf2gif.c index 51ec144..52e57f7 100644 --- a/hl/tools/gif2h5/hdf2gif.c +++ b/hl/tools/gif2h5/hdf2gif.c @@ -64,7 +64,7 @@ usage(void) FILE *fpGif = NULL; int main(int argc , char **argv) { - + hsize_t dim_sizes[2]; BYTE *Image; @@ -180,7 +180,7 @@ int main(int argc , char **argv) return -1; } - + /* we shall always have a palette - read hdf will see to that */ has_local_palette = true; @@ -188,12 +188,12 @@ int main(int argc , char **argv) idx = 0x0001; b = (BYTE *) &idx; EndianOrder = (b[0] ? 1:0); - + if (!(fpGif = fopen(GIFName , "wb"))) { printf("Error opening gif file for output. Aborting.\n"); return -1; } - + /* hardwire n_images to 1 for now. */ n_images = number_of_images; @@ -249,7 +249,7 @@ int main(int argc , char **argv) Blue[i] = GlobalPalette[i][2]; } } - + for (i = 0; i < 256; i++) { pc2nc[i] = r1[i] = g1[i] = b1[i] = 0; } @@ -288,7 +288,7 @@ int main(int argc , char **argv) #ifdef UNUSED CountDown = w * h; /* # of pixels we'll be doing */ #endif /* UNUSED */ - + if (BitsPerPixel <= 1) InitCodeSize = 2; else @@ -305,7 +305,7 @@ int main(int argc , char **argv) /* * If it is the first image we do all the header stuff that isn't - * required for the rest of the images. + * required for the rest of the images. */ if (idx == 0) { /* Write out the GIF header and logical screen descriptor */ @@ -379,7 +379,7 @@ int main(int argc , char **argv) i = hdfWriteGIF(fpGif , Image , 0 , (int)dim_sizes[0] , (int)dim_sizes[1] , r1, g1 , b1 , pc2nc , 256 , 8 , BitsPerPixel); - fputc(0x00, fpGif); + fputc(0x00, fpGif); free(Image); } diff --git a/hl/tools/gif2h5/hdfgifwr.c b/hl/tools/gif2h5/hdfgifwr.c index a18b81f..b1b5be5 100644 --- a/hl/tools/gif2h5/hdfgifwr.c +++ b/hl/tools/gif2h5/hdfgifwr.c @@ -13,13 +13,13 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * hdfgifwr.c - handles writing of GIF files. - * - * Contains: + * hdfgifwr.c - handles writing of GIF files. + * + * Contains: * hdfWriteGIF(fp, pic, ptype, w, h, rmap, gmap, bmap, numcols, colorstyle, * comment) * - * Note: slightly brain-damaged, in that it'll only write non-interlaced + * Note: slightly brain-damaged, in that it'll only write non-interlaced * GIF files (in the interests of speed, or something) */ @@ -44,7 +44,7 @@ * James A. Woods (decvax!ihnp4!ames!jaw) * Joe Orost (decvax!vax135!petsd!joe) *****************************************************************/ - + #include #include @@ -125,7 +125,7 @@ int hdfWriteGIF(FILE *fp, byte *pic, int ptype, int w, int h, byte *rmap, Background = 0; #endif /* UNUSED */ - for (i = 0; i < 256; i++) { + for (i = 0; i < 256; i++) { pc2nc[i] = pc2ncmap[i]; #ifdef UNUSED r1[i] = rmap[i]; @@ -325,7 +325,7 @@ probe: continue; } - if ((long)HashTabOf (i) >= 0) + if ((long)HashTabOf (i) >= 0) goto probe; nomatch: @@ -380,7 +380,7 @@ output(int code) cur_accum |= ((long)code << cur_bits); else cur_accum = code; - + cur_bits += n_bits; while( cur_bits >= 8 ) { @@ -406,7 +406,7 @@ output(int code) maxcode = MAXCODE(n_bits); } } - + if (code == EOFCode) { /* At EOF, write the rest of the buffer */ while( cur_bits > 0 ) { diff --git a/hl/tools/gif2h5/readhdf.c b/hl/tools/gif2h5/readhdf.c index 2720d4d..3fc454c 100644 --- a/hl/tools/gif2h5/readhdf.c +++ b/hl/tools/gif2h5/readhdf.c @@ -30,17 +30,17 @@ cleanup(BYTE *ptr) ** BYTE palette[256][3] - the corresponding palette ** hsize_t* image_size - the size of each dimension of the image ** -** Future Notes: -** The way readHDF works right now is that it expects the user +** Future Notes: +** The way readHDF works right now is that it expects the user ** to know the exact path to the HDF image. Thus it does not ** parse the HDF file looking for image datasets and corresponding -** palettes. Also it takes in the default palette for the image +** palettes. Also it takes in the default palette for the image ** specified, if the palette is missing, it makes a default greyscale ** palette and throws it in. ** */ int ReadHDF(BYTE** data, BYTE palette[256][3], hsize_t *image_size, - CHAR *h5_file, CHAR *dset_name, CHAR *pal_name) + CHAR *h5_file, CHAR *dset_name, CHAR *pal_name) { hid_t fHfile; /* H5 file to open */ hid_t dspace; /* dataspace identifier for the the dataset */ @@ -130,7 +130,7 @@ int ReadHDF(BYTE** data, BYTE palette[256][3], hsize_t *image_size, pal_exist = 0; return -1; } - + pal_dtype = H5Dget_type(pal_set); if (dtype < 0) { fprintf(stderr , "Unable to open palette datatype\n"); @@ -151,7 +151,7 @@ int ReadHDF(BYTE** data, BYTE palette[256][3], hsize_t *image_size, pal_exist = 0; return -1; } - + /* get the dimension size of the palette. */ if (H5Sget_simple_extent_dims(pal_space , loc_pal_size , NULL) !=2 ) { fprintf(stderr , "Unable to get dimension info\n"); diff --git a/hl/tools/gif2h5/writehdf.c b/hl/tools/gif2h5/writehdf.c index d343aae..8d7405e 100644 --- a/hl/tools/gif2h5/writehdf.c +++ b/hl/tools/gif2h5/writehdf.c @@ -49,11 +49,11 @@ static int write_text_attribute(hid_t dataset_id , const char *attr_name, attr_dataspace_id , H5P_DEFAULT); /* write out the attribute data */ - if (H5Awrite(attr_attr_id , attr_type_id , attr_value) < 0) + if (H5Awrite(attr_attr_id , attr_type_id , attr_value) < 0) return -1; /* close the attribute */ - if (H5Aclose(attr_attr_id) < 0) + if (H5Aclose(attr_attr_id) < 0) return -1; /* close the dataspace */ @@ -192,12 +192,12 @@ WriteHDF(GIFTOMEM GifMemoryStruct, char *HDFName , char *GIFFileName) return -1; } - /* write the reference out */ + /* write the reference out */ if (H5Dwrite(ref_dataset_id , H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL , H5P_DEFAULT, &pal_ref) < 0) { fprintf(stderr , "Unable to write Palette Reference"); return -1; } - + /* close dataset */ if (H5Dclose(ref_dataset_id) < 0) { fprintf(stderr , "Unable to close palette dataset.\n"); @@ -271,7 +271,7 @@ WriteHDF(GIFTOMEM GifMemoryStruct, char *HDFName , char *GIFFileName) /* This info is available at http://hdf.ncsa.uiuc.edu/HDF5/doc/ImageSpec.html */ /* The following attributes must be set for each image: ** --------------------------------------- - ** Attribute Name Value + ** Attribute Name Value ** CLASS IMAGE ** IMAGE_VERSION 1.0 ** IMAGE_SUBCLASS IMAGE_BITMAP @@ -324,7 +324,7 @@ WriteHDF(GIFTOMEM GifMemoryStruct, char *HDFName , char *GIFFileName) ** Attribute: PALETTE ** Value : Reference to Palette *****************************************/ - + /**** MAKE SURE PALETTE EXISTS!!! ****/ if (gifHead.PackedField & 0x80) { /* global palette exists */ diff --git a/perform/benchpar.c b/perform/benchpar.c index 12dd8e0..8d8c1b5 100644 --- a/perform/benchpar.c +++ b/perform/benchpar.c @@ -88,7 +88,7 @@ static hid_t create_fapl(MPI_Comm comm, MPI_Info info, int acc_type ) /* set parallel access with communicator, using MPI-I/O driver */ if (acc_type == FACC_MPIO) { - ret = H5Pset_fapl_mpio(fapl, comm, info); + ret = H5Pset_fapl_mpio(fapl, comm, info); assert(ret>=0); } /* end if */ @@ -279,7 +279,7 @@ int main(int argc, char *argv[]) printf("rank=%d, error, slice dim larger than rank: slice_dim=%d, rank=%d\n",mpi_rank,slice_dim,rank); goto done; } /* end if */ - + /* Set rest of defaults */ if(file_name==NULL) { char *login; /* Pointer to login name */ diff --git a/perform/chunk.c b/perform/chunk.c index 4150b49..a8a6516 100644 --- a/perform/chunk.c +++ b/perform/chunk.c @@ -156,7 +156,7 @@ create_dataset (void) H5Pset_chunk (dcpl, 2, size); H5Zregister (H5Z_COUNTER); H5Pset_filter (dcpl, FILTER_COUNTER, 0, 0, NULL); - + /* The dataset */ dset = H5Dcreate (file, "dset", H5T_NATIVE_SCHAR, space, dcpl); assert (dset>=0); @@ -238,8 +238,8 @@ test_rowmaj (int op, size_t cache_size, size_t io_size) H5Sclose (mem_space); } } - - free (buf); + + free (buf); H5Sclose (file_space); H5Dclose (dset); H5Fclose (file); @@ -290,7 +290,7 @@ test_diag (int op, size_t cache_size, size_t io_size, size_t offset) dset = H5Dopen (file, "dset"); file_space = H5Dget_space (dset); nio_g = 0; - + for (i=0, hs_size[0]=io_size; hs_size[0]==io_size; i+=offset) { hs_offset[0] = hs_offset[1] = i; hs_size[0] = hs_size[1] = MIN (io_size, CH_SIZE*DS_SIZE-i); @@ -328,9 +328,9 @@ test_diag (int op, size_t cache_size, size_t io_size, size_t offset) * * Purpose: See file prologue. * - * Return: Success: + * Return: Success: * - * Failure: + * Failure: * * Programmer: Robb Matzke * Thursday, May 14, 1998 @@ -406,7 +406,7 @@ main (void) fclose (d); fprintf (f, "pause -1\n"); #endif - + #if 1 /* * Test row-major writing of the dataset with various sizes of request diff --git a/perform/iopipe.c b/perform/iopipe.c index 200ee7e..84a0a69 100644 --- a/perform/iopipe.c +++ b/perform/iopipe.c @@ -22,23 +22,23 @@ #ifdef H5_HAVE_WINSOCK_H #include -#endif +#endif /*Winsock.h includes windows.h, due to the different value of WINVER, windows.h should be put before H5private.h. Kent yang 6/21/2001*/ #if defined (__MWERKS__) -#ifdef H5_HAVE_SYS_TIMEB +#ifdef H5_HAVE_SYS_TIMEB #undef H5_HAVE_SYS_TIMEB #endif -#ifdef H5_HAVE_SYSTEM +#ifdef H5_HAVE_SYSTEM #undef H5_HAVE_SYSTEM #endif #endif /* __MWERKS__*/ #include "H5private.h" -#ifdef H5_HAVE_SYS_TIMEB +#ifdef H5_HAVE_SYS_TIMEB #include #endif @@ -117,12 +117,12 @@ print_stats (const char *prefix, (double)(t_start->tv_usec)/1000.0); #endif bw = (double)nbytes / e_time; - + #ifdef H5_HAVE_GETRUSAGE - printf (HEADING "%1.2fuser %1.2fsystem %1.2felapsed %1.2fMB/s\n", + printf (HEADING "%1.2fuser %1.2fsystem %1.2felapsed %1.2fMB/s\n", prefix, u_time, s_time, e_time, bw/(1024*1024)); #else - printf (HEADING "%1.2felapsed %1.2fMB/s\n", + printf (HEADING "%1.2felapsed %1.2fMB/s\n", prefix, e_time, bw/(1024*1024)); #endif @@ -132,7 +132,7 @@ print_stats (const char *prefix, /*------------------------------------------------------------------------- * Function: synchronize * - * Purpose: + * Purpose: * * Return: void * @@ -168,11 +168,11 @@ synchronize (void) /*------------------------------------------------------------------------- * Function: main * - * Purpose: + * Purpose: * - * Return: Success: + * Return: Success: * - * Failure: + * Failure: * * Programmer: Robb Matzke * Thursday, March 12, 1998 @@ -192,9 +192,9 @@ main (void) herr_t status; #ifdef H5_HAVE_GETRUSAGE struct rusage r_start, r_stop; -#else +#else struct timeval r_start, r_stop; -#endif +#endif struct timeval t_start, t_stop; int i, fd; hssize_t n; @@ -214,13 +214,13 @@ main (void) */ printf ("I/O request size is %1.1fMB\n", (double)(hssize_t)(size[0]*size[1])/1024.0*1024); - + /* Open the files */ file = H5Fcreate (HDF5_FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); assert (file>=0); fd = HDopen (RAW_FILE_NAME, O_RDWR|O_CREAT|O_TRUNC, 0666); assert (fd>=0); - + /* Create the dataset */ file_space = H5Screate_simple (2, size, size); assert (file_space>=0); @@ -238,11 +238,11 @@ printf("Before getrusage() call\n"); #endif #ifdef H5_HAVE_GETTIMEOFDAY gettimeofday (&t_start, NULL); -#else +#else #ifdef H5_HAVE_SYS_TIMEB _ftime(tbstart); #endif -#endif +#endif fprintf (stderr, HEADING, "fill raw"); for (i=0; imillitm; t_stop.tv_sec = tbstop->time; t_stop.tv_usec = tbstop->millitm; -#endif -#endif +#endif +#endif putc ('\n', stderr); print_stats ("fill raw", &r_start, &r_stop, &t_start, &t_stop, (size_t)(nread*size[0]*size[1])); - + /* Fill hdf5 */ synchronize (); @@ -280,7 +280,7 @@ printf("Before getrusage() call\n"); #ifdef H5_HAVE_SYS_TIMEB _ftime(tbstart); #endif -#endif +#endif fprintf (stderr, HEADING, "fill hdf5"); for (i=0; imillitm; t_stop.tv_sec = tbstop->time; t_stop.tv_usec = tbstop->millitm; -#endif -#endif +#endif +#endif putc ('\n', stderr); print_stats ("fill hdf5", &r_start, &r_stop, &t_start, &t_stop, (size_t)(nread*size[0]*size[1])); - + /* Write the raw dataset */ synchronize (); #ifdef H5_HAVE_GETRUSAGE @@ -319,7 +319,7 @@ printf("Before getrusage() call\n"); #ifdef H5_HAVE_SYS_TIMEB _ftime(tbstart); #endif -#endif +#endif fprintf (stderr, HEADING, "out raw"); for (i=0; imillitm; t_stop.tv_sec = tbstop->time; t_stop.tv_usec = tbstop->millitm; -#endif -#endif +#endif +#endif putc ('\n', stderr); print_stats ("out raw", &r_start, &r_stop, &t_start, &t_stop, @@ -359,7 +359,7 @@ printf("Before getrusage() call\n"); #ifdef H5_HAVE_SYS_TIMEB _ftime(tbstart); #endif -#endif +#endif fprintf (stderr, HEADING, "out hdf5"); for (i=0; imillitm; t_stop.tv_sec = tbstop->time; t_stop.tv_usec = tbstop->millitm; -#endif -#endif +#endif +#endif putc ('\n', stderr); print_stats ("out hdf5", &r_start, &r_stop, &t_start, &t_stop, @@ -398,7 +398,7 @@ printf("Before getrusage() call\n"); #ifdef H5_HAVE_SYS_TIMEB _ftime(tbstart); #endif -#endif +#endif fprintf (stderr, HEADING, "in raw"); for (i=0; imillitm; t_stop.tv_sec = tbstop->time; t_stop.tv_usec = tbstop->millitm; -#endif -#endif +#endif +#endif putc ('\n', stderr); print_stats ("in raw", &r_start, &r_stop, &t_start, &t_stop, (size_t)(nread*size[0]*size[1])); - + /* Read the hdf5 dataset */ synchronize (); @@ -438,8 +438,8 @@ printf("Before getrusage() call\n"); #else #ifdef H5_HAVE_SYS_TIMEB _ftime(tbstart); -#endif -#endif +#endif +#endif fprintf (stderr, HEADING, "in hdf5"); for (i=0; itime; t_stop.tv_usec = tbstop->millitm; #endif -#endif +#endif putc ('\n', stderr); print_stats ("in hdf5", &r_start, &r_stop, &t_start, &t_stop, @@ -482,8 +482,8 @@ printf("Before getrusage() call\n"); #else #ifdef H5_HAVE_SYS_TIMEB _ftime(tbstart); -#endif -#endif +#endif +#endif fprintf (stderr, HEADING, "in hdf5 partial"); for (i=0; imillitm; t_stop.tv_sec = tbstop->time; t_stop.tv_usec = tbstop->millitm; -#endif -#endif +#endif +#endif putc ('\n', stderr); print_stats ("in hdf5 partial", &r_start, &r_stop, &t_start, &t_stop, (size_t)(nread*count[0]*count[1])); - - + + /* Close everything */ HDclose (fd); H5Dclose (dset); H5Sclose (file_space); H5Fclose (file); - + return 0; } diff --git a/perform/mpi-perf.c b/perform/mpi-perf.c index b17ed4b..06cb499 100644 --- a/perform/mpi-perf.c +++ b/perform/mpi-perf.c @@ -99,11 +99,11 @@ int main(int argc, char **argv) if (mynod == 0) printf("# Using mpi-io calls.\n"); - - /* kindof a weird hack- if the location of the pvfstab file was + + /* kindof a weird hack- if the location of the pvfstab file was * specified on the command line, then spit out this location into * the appropriate environment variable: */ - + #if H5_HAVE_SETENV /* no setenv or unsetenv */ if (opt_pvfstab_set) { @@ -113,12 +113,12 @@ int main(int argc, char **argv) } } #endif - + /* this is how much of the file data is covered on each iteration of * the test. used to help determine the seek offset on each * iteration */ iter_jump = nprocs * opt_block; - + /* setup a buffer of data to write */ if (!(tmp = (char *) malloc(opt_block + 256))) { perror("malloc"); @@ -136,7 +136,7 @@ int main(int argc, char **argv) } /* open the file for writing */ - err = MPI_File_open(MPI_COMM_WORLD, opt_file, + err = MPI_File_open(MPI_COMM_WORLD, opt_file, MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh); if (err < 0) { fprintf(stderr, "node %d, open error: %s\n", mynod, strerror(errno)); @@ -163,7 +163,7 @@ int main(int argc, char **argv) nchars = opt_block/sizeof(char); err = MPI_File_write_at(fh, seek_position, buf, nchars, MPI_CHAR, &status); if(err){ - fprintf(stderr, "node %d, write error: %s\n", mynod, + fprintf(stderr, "node %d, write error: %s\n", mynod, strerror(errno)); } @@ -171,7 +171,7 @@ int main(int argc, char **argv) etim = MPI_Wtime(); write_tim += (etim - stim); - + /* we are done with this "write" iteration */ } @@ -179,12 +179,12 @@ int main(int argc, char **argv) if(err){ fprintf(stderr, "node %d, close error after write\n", mynod); } - + /* wait for everyone to synchronize at this point */ MPI_Barrier(MPI_COMM_WORLD); /* reopen the file to read the data back out */ - err = MPI_File_open(MPI_COMM_WORLD, opt_file, + err = MPI_File_open(MPI_COMM_WORLD, opt_file, MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh); if (err < 0) { fprintf(stderr, "node %d, open error: %s\n", mynod, strerror(errno)); @@ -246,7 +246,7 @@ int main(int argc, char **argv) MPI_COMM_WORLD); /* calculate the average from the sum */ - ave_read_tim = ave_read_tim / nprocs; + ave_read_tim = ave_read_tim / nprocs; MPI_Allreduce(&write_tim, &max_write_tim, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); @@ -256,33 +256,33 @@ int main(int argc, char **argv) MPI_COMM_WORLD); /* calculate the average from the sum */ - ave_write_tim = ave_write_tim / nprocs; - + ave_write_tim = ave_write_tim / nprocs; + /* print out the results on one node */ if (mynod == 0) { read_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_read_tim*1000000.0); write_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_write_tim*1000000.0); - + printf("nr_procs = %d, nr_iter = %d, blk_sz = %ld\n", nprocs, opt_iter, (long)opt_block); - + printf("# total_size = %ld\n", (long)(opt_block*nprocs*opt_iter)); - - printf("# Write: min_time = %f, max_time = %f, mean_time = %f\n", + + printf("# Write: min_time = %f, max_time = %f, mean_time = %f\n", min_write_tim, max_write_tim, ave_write_tim); - printf("# Read: min_time = %f, max_time = %f, mean_time = %f\n", + printf("# Read: min_time = %f, max_time = %f, mean_time = %f\n", min_read_tim, max_read_tim, ave_read_tim); - + printf("Write bandwidth = %f Mbytes/sec\n", write_bw); printf("Read bandwidth = %f Mbytes/sec\n", read_bw); - + if (opt_correct) { printf("Correctness test %s.\n", correct ? "passed" : "failed"); } } -die_jar_jar_die: +die_jar_jar_die: #if H5_HAVE_SETENV /* no setenv or unsetenv */ @@ -291,7 +291,7 @@ die_jar_jar_die: unsetenv("PVFSTAB_FILE"); } #endif - + free(tmp); if (opt_correct) free(tmp2); MPI_Finalize(); @@ -301,7 +301,7 @@ die_jar_jar_die: int parse_args(int argc, char **argv) { int c; - + while ((c = getopt(argc, argv, "s:b:i:f:p:c")) != EOF) { switch (c) { case 's': /* stripe */ @@ -335,7 +335,7 @@ int parse_args(int argc, char **argv) double Wtime() { struct timeval t; - + gettimeofday(&t, NULL); return((double)t.tv_sec + (double)t.tv_usec / 1000000); } diff --git a/perform/overhead.c b/perform/overhead.c index d9715e7..4835d44 100644 --- a/perform/overhead.c +++ b/perform/overhead.c @@ -60,7 +60,7 @@ #ifndef TRUE #define TRUE 1 #endif /* TRUE */ - + typedef enum fill_t { FILL_ALL, FILL_FORWARD, @@ -225,13 +225,13 @@ test(fill_t fill_style, const double splits[], if ((dset=H5Dcreate(file, "chunked", H5T_NATIVE_INT, fspace, dcpl))<0) goto error; -#if !defined( __MWERKS__) +#if !defined( __MWERKS__) - /* + /* workaround for a bug in the Metrowerks version 6.0 open function - */ + */ if ((fd=HDopen(FILE_NAME_1, O_RDONLY, 0666))<0) goto error; -#endif +#endif for (i=1; i<=cur_size[0]; i++) { @@ -267,7 +267,7 @@ test(fill_t fill_style, const double splits[], } -#if !defined( __MWERKS__) +#if !defined( __MWERKS__) /* Determine overhead */ if (verbose) { @@ -282,9 +282,9 @@ test(fill_t fill_style, const double splits[], (unsigned long)i, (double)(hssize_t)(sb.st_size-i*sizeof(int))/(hssize_t)i); } -#endif - - +#endif + + } H5Dclose(dset); @@ -314,15 +314,15 @@ test(fill_t fill_style, const double splits[], case FILL_ALL: abort(); } - + #if !defined( __MWERKS__) - + if (HDfstat(fd, &sb)<0) goto error; printf("%-7s %8.3f\n", sname, (double)(hssize_t)(sb.st_size-cur_size[0]*sizeof(int))/ (hssize_t)cur_size[0]); #endif - + } @@ -348,7 +348,7 @@ test(fill_t fill_style, const double splits[], /*------------------------------------------------------------------------- * Function: main * - * Purpose: + * Purpose: * * Return: Success: zero * @@ -378,7 +378,7 @@ main(int argc, char *argv[]) goto error; } if (H5Pclose(xfer)<0) goto error; - + /* Parse command-line options */ for (i=1, j=0; i= 0), "", H5FATAL); - ret = H5Pset_fapl_mpio(mpio_pl, MPI_COMM_WORLD, MPI_INFO_NULL); + ret = H5Pset_fapl_mpio(mpio_pl, MPI_COMM_WORLD, MPI_INFO_NULL); VRFY((ret >= 0), "", H5FATAL); /* set optional allocation alignment */ @@ -179,7 +179,7 @@ int main(int argc, char **argv) /* setup file access template */ acc_tpl = H5Pcreate (H5P_FILE_ACCESS); VRFY((acc_tpl >= 0), "", H5FATAL); - ret = H5Pset_fapl_mpio(acc_tpl, MPI_COMM_WORLD, MPI_INFO_NULL); + ret = H5Pset_fapl_mpio(acc_tpl, MPI_COMM_WORLD, MPI_INFO_NULL); VRFY((ret >= 0), "", H5FATAL); /* set optional allocation alignment */ @@ -216,7 +216,7 @@ int main(int argc, char **argv) start[0] = (j*iter_jump)+(mynod*opt_block); stride[0] = block[0] = opt_block; count[0]= 1; - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded", H5FATAL); if (opt_correct) /* fill in buffer for iteration */ { @@ -229,21 +229,21 @@ int main(int argc, char **argv) /* write data */ ret = H5Dwrite(dataset, H5T_NATIVE_CHAR, mem_dataspace, file_dataspace, - H5P_DEFAULT, buf); + H5P_DEFAULT, buf); VRFY((ret >= 0), "H5Dwrite dataset1 succeeded", !H5FATAL); /* discover the ending time of the operation */ etim = MPI_Wtime(); write_tim += (etim - stim); - + /* we are done with this "write" iteration */ } - /* close dataset and file */ + /* close dataset and file */ ret=H5Dclose(dataset); VRFY((ret >= 0), "H5Dclose succeeded", H5FATAL); - ret=H5Fclose(fid); + ret=H5Fclose(fid); VRFY((ret >= 0), "H5Fclose succeeded", H5FATAL); @@ -269,7 +269,7 @@ int main(int argc, char **argv) start[0] = (j*iter_jump)+(mynod*opt_block); stride[0] = block[0] = opt_block; count[0]= 1; - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded", H5FATAL); /* seek to the appropriate spot give the current iteration and * rank within the MPI processes */ @@ -282,11 +282,11 @@ int main(int argc, char **argv) /* read in the file data */ if (!opt_correct){ ret = H5Dread(dataset, H5T_NATIVE_CHAR, mem_dataspace, file_dataspace, - H5P_DEFAULT, buf); + H5P_DEFAULT, buf); } else{ ret = H5Dread(dataset, H5T_NATIVE_CHAR, mem_dataspace, file_dataspace, - H5P_DEFAULT, buf2); + H5P_DEFAULT, buf2); } myerrno = errno; /* discover the end time */ @@ -310,10 +310,10 @@ int main(int argc, char **argv) /* we are done with this read iteration */ } - /* close dataset and file */ + /* close dataset and file */ ret=H5Dclose(dataset); VRFY((ret >= 0), "H5Dclose succeeded", H5FATAL); - ret=H5Fclose(fid); + ret=H5Fclose(fid); VRFY((ret >= 0), "H5Fclose succeeded", H5FATAL); /* compute the read and write times */ @@ -325,7 +325,7 @@ int main(int argc, char **argv) MPI_COMM_WORLD); /* calculate the average from the sum */ - ave_read_tim = ave_read_tim / nprocs; + ave_read_tim = ave_read_tim / nprocs; MPI_Allreduce(&write_tim, &max_write_tim, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); @@ -335,33 +335,33 @@ int main(int argc, char **argv) MPI_COMM_WORLD); /* calculate the average from the sum */ - ave_write_tim = ave_write_tim / nprocs; - + ave_write_tim = ave_write_tim / nprocs; + /* print out the results on one node */ if (mynod == 0) { read_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_read_tim*1000000.0); write_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_write_tim*1000000.0); - + printf("nr_procs = %d, nr_iter = %d, blk_sz = %ld\n", nprocs, opt_iter, (long)opt_block); - + printf("# total_size = %ld\n", (long)(opt_block*nprocs*opt_iter)); - - printf("# Write: min_time = %f, max_time = %f, mean_time = %f\n", + + printf("# Write: min_time = %f, max_time = %f, mean_time = %f\n", min_write_tim, max_write_tim, ave_write_tim); - printf("# Read: min_time = %f, max_time = %f, mean_time = %f\n", + printf("# Read: min_time = %f, max_time = %f, mean_time = %f\n", min_read_tim, max_read_tim, ave_read_tim); - + printf("Write bandwidth = %f Mbytes/sec\n", write_bw); printf("Read bandwidth = %f Mbytes/sec\n", read_bw); - + if (opt_correct) { printf("Correctness test %s.\n", correct ? "passed" : "failed"); } } -die_jar_jar_die: +die_jar_jar_die: #if H5_HAVE_SETENV /* no setenv or unsetenv */ @@ -370,7 +370,7 @@ die_jar_jar_die: unsetenv("PVFSTAB_FILE"); } #endif - + free(tmp); if (opt_correct) free(tmp2); MPI_Finalize(); @@ -380,7 +380,7 @@ die_jar_jar_die: int parse_args(int argc, char **argv) { int c; - + while ((c = getopt(argc, argv, "s:b:i:f:p:a:2:c")) != EOF) { switch (c) { case 's': /* stripe */ @@ -444,7 +444,7 @@ int parse_args(int argc, char **argv) double Wtime() { struct timeval t; - + gettimeofday(&t, NULL); return((double)t.tv_sec + (double)t.tv_usec / 1000000); } diff --git a/perform/perf_meta.c b/perform/perf_meta.c index e157c78..69f4146 100644 --- a/perform/perf_meta.c +++ b/perform/perf_meta.c @@ -82,13 +82,13 @@ void print_perf(p_time, p_time, p_time); Purpose: Parse command line options * * Programmer: Raymond Lu - * Friday, Oct 3, 2003 + * Friday, Oct 3, 2003 * * Modifications: * *------------------------------------------------------------------------- */ -static int +static int parse_options(int argc, char **argv) { int t; @@ -104,7 +104,7 @@ parse_options(int argc, char **argv) switch(*(*argv+1)){ case 'h': /* Help page */ return(1); - + case 'd': /* Number of datasets */ NUM_DSETS = atoi((*argv+1)+1); if (NUM_DSETS < 0){ @@ -112,7 +112,7 @@ parse_options(int argc, char **argv) return(1); } break; - + case 'a': /* Number of attributes per dataset */ NUM_ATTRS = atoi((*argv+1)+1); if (NUM_ATTRS < 0){ @@ -155,11 +155,11 @@ parse_options(int argc, char **argv) return(1); } if(t == 1) - RUN_TEST |= TEST_1; + RUN_TEST |= TEST_1; else if(t == 2) - RUN_TEST |= TEST_2; + RUN_TEST |= TEST_2; else - RUN_TEST |= TEST_3; + RUN_TEST |= TEST_3; break; @@ -178,12 +178,12 @@ parse_options(int argc, char **argv) } #endif /*H5_HAVE_PARALLEL*/ - if(NUM_ATTRS && !BATCH_ATTRS) + if(NUM_ATTRS && !BATCH_ATTRS) NUM_ATTRS = 0; - - if(!NUM_ATTRS && BATCH_ATTRS) - BATCH_ATTRS = 0; - + + if(!NUM_ATTRS && BATCH_ATTRS) + BATCH_ATTRS = 0; + if(!NUM_DSETS) { nerrors++; return(1); @@ -195,7 +195,7 @@ parse_options(int argc, char **argv) return(1); } } - + return(0); } @@ -206,7 +206,7 @@ parse_options(int argc, char **argv) Purpose: Prints help page * * Programmer: Raymond Lu - * Friday, Oct 3, 2003 + * Friday, Oct 3, 2003 * * Modifications: * @@ -277,7 +277,7 @@ create_dspace(void) { hsize_t dims[2]; hsize_t small_dims[2]; - + /* Create the data space */ dims[0] = 256; dims[1] = 512; @@ -294,7 +294,7 @@ create_dspace(void) error: return -1; -} +} /*------------------------------------------------------------------------- @@ -324,8 +324,8 @@ create_dsets(hid_t file) * Create a dataset using the default dataset creation properties. */ for(i=0; i= 0), "H5Sselect_hyperslab"); } /* end if */ else { @@ -1097,7 +1097,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, h5count[0] = buf_size/blk_size; } /* end else */ hrc = H5Sselect_hyperslab(h5dset_space_id, H5S_SELECT_SET, - h5start, h5stride, h5count, h5block); + h5start, h5stride, h5count, h5block); VRFY((hrc >= 0), "H5Sselect_hyperslab"); } /* end if */ else { @@ -1462,7 +1462,7 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags) GOTOERROR(FAIL); } - + /* The perils of POSIX I/O in a parallel environment. The problem is: * * - Process n opens a file with truncation and then starts @@ -1524,7 +1524,7 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags) } /* end if */ else { /* Set the file driver to the MPI-I/O driver */ - hrc = H5Pset_fapl_mpio(acc_tpl, pio_comm_g, h5_io_info_g); + hrc = H5Pset_fapl_mpio(acc_tpl, pio_comm_g, h5_io_info_g); if (hrc < 0) { fprintf(stderr, "HDF5 Property List Set failed\n"); GOTOERROR(FAIL); @@ -1559,7 +1559,7 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags) } break; - } + } done: return ret_code; @@ -1632,10 +1632,10 @@ do_cleanupfile(iotype iot, char *fname) { if (pio_mpi_rank_g != 0) return; - + if (clean_file_g == -1) clean_file_g = (getenv("HDF5_NOCLEANUP")==NULL) ? 1 : 0; - + if (clean_file_g){ switch (iot){ case POSIXIO: diff --git a/perform/pio_perf.c b/perform/pio_perf.c index 0e816fc..cde0545 100644 --- a/perform/pio_perf.c +++ b/perform/pio_perf.c @@ -608,7 +608,7 @@ run_test(iotype iot, parameters parms, struct options *opts) pio_time_destroy(res.timers); } - /* + /* * Show various statistics */ /* Write statistics */ @@ -721,7 +721,7 @@ run_test(iotype iot, parameters parms, struct options *opts) /* * Function: output_all_info - * Purpose: + * Purpose: * Return: Nothing * Programmer: Bill Wendling, 29. January 2002 * Modifications: @@ -776,7 +776,7 @@ accumulate_minmax_stuff(minmax *mm, int count) { int i; minmax total_mm; - + total_mm.sum = 0.0; total_mm.max = -DBL_MAX; total_mm.min = DBL_MAX; diff --git a/perform/pio_standalone.h b/perform/pio_standalone.h index bf80544..4a67ba0 100644 --- a/perform/pio_standalone.h +++ b/perform/pio_standalone.h @@ -50,7 +50,7 @@ #define HDstrdup(S) _strdup(S) #else /* WIN32 */ -#if !defined strdup && !defined H5_HAVE_STRDUP +#if !defined strdup && !defined H5_HAVE_STRDUP extern char *strdup(const char *s); #endif @@ -58,9 +58,9 @@ extern char *strdup(const char *s); #endif /* WIN32 */ -#define HDstrcmp(S,T) strcmp(S,T) +#define HDstrcmp(S,T) strcmp(S,T) #define HDstrlen(S) strlen(S) -#define HDstrncmp(S,T,L) strncmp(S,T,L) +#define HDstrncmp(S,T,L) strncmp(S,T,L) #define HDstrncpy(X,Y,Z) strncpy(X,Y,Z) #define HDstrchr(S,C) strchr(S,C) #define HDfree(M) free(M) @@ -74,7 +74,7 @@ extern char *strdup(const char *s); #define HDclose(F) close(F) #ifdef WIN32 - #ifdef __MWERKS__ + #ifdef __MWERKS__ #define HDlseek(F,O,W) lseek(F,O,W) #else /*MSVS */ #define HDlseek(F,O,W) _lseeki64(F,O,W) diff --git a/src/H5.c b/src/H5.c index a0e1e1f..f719877 100644 --- a/src/H5.c +++ b/src/H5.c @@ -61,7 +61,7 @@ static void H5_debug_mask(const char*); * H5_init_library -- Initialize library-global information * USAGE * herr_t H5_init_library() - * + * * RETURNS * Non-negative on success/Negative on failure * @@ -70,7 +70,7 @@ static void H5_debug_mask(const char*); * *-------------------------------------------------------------------------- */ -herr_t +herr_t H5_init_library(void) { herr_t ret_value=SUCCEED; @@ -132,7 +132,7 @@ H5_init_library(void) * Initialize interfaces that might not be able to initialize themselves * soon enough. The file & dataset interfaces must be initialized because * calling H5P_create() might require the file/dataset property classes to be - * initialized. The property interface must be initialized before the file + * initialized. The property interface must be initialized before the file * & dataset interfaces though, in order to provide them with the proper * property classes. */ @@ -181,7 +181,7 @@ H5_term_library(void) unsigned at=0; char loop[1024]; H5E_auto_stack_t func; - + #ifdef H5_HAVE_THREADSAFE /* explicit locking of the API */ H5_FIRST_THREAD_INIT @@ -209,7 +209,7 @@ H5_term_library(void) (sprintf(loop+at, "..."), \ at += HDstrlen(loop+at), \ n):n)) - + do { pending = 0; /* Try to organize these so the "higher" level components get shut @@ -274,7 +274,7 @@ H5_term_library(void) H5_MPEinit_g = FALSE; /* turn it off no matter what */ } #endif - + /* Mark library as closed */ H5_INIT_GLOBAL = FALSE; done: @@ -448,7 +448,7 @@ H5_debug_mask(const char *s) char pkg_name[32], *rest; size_t i; int clear; - + while (s && *s) { if (HDisalpha(*s) || '-'==*s || '+'==*s) { /* Enable or Disable debugging? */ @@ -501,7 +501,7 @@ H5_debug_mask(const char *s) } } } - + /*------------------------------------------------------------------------- * Function: H5get_libversion @@ -577,11 +577,11 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum) FUNC_ENTER_API_NOINIT(H5check_version) H5TRACE3("e","IuIuIu",majnum,minnum,relnum); - + /* Don't check again, if we already have */ if (checked) HGOTO_DONE(SUCCEED) - + { const char *s; /* Environment string for disabling version check */ /* Allow different versions of the header files and library? */ @@ -606,7 +606,7 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum) stderr); /* Mention the versions we are referring to */ HDfprintf (stderr, "Headers are %u.%u.%u, library is %u.%u.%u\n", - majnum, minnum, relnum, + majnum, minnum, relnum, (unsigned)H5_VERS_MAJOR, (unsigned)H5_VERS_MINOR, (unsigned)H5_VERS_RELEASE); /* Bail out now. */ @@ -626,7 +626,7 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum) "continue.\n", stderr); /* Mention the versions we are referring to */ HDfprintf (stderr, "Headers are %u.%u.%u, library is %u.%u.%u\n", - majnum, minnum, relnum, + majnum, minnum, relnum, (unsigned)H5_VERS_MAJOR, (unsigned)H5_VERS_MINOR, (unsigned)H5_VERS_RELEASE); break; } /* end switch */ @@ -855,7 +855,7 @@ HDfprintf(FILE *stream, const char *fmt, ...) char *rest, format_templ[128]; const char *s; va_list ap; - + assert (stream); assert (fmt); @@ -894,7 +894,7 @@ HDfprintf(FILE *stream, const char *fmt, ...) } /*lint !e744 Switch statement doesn't _need_ default */ s++; } - + /* Field width */ if (HDisdigit (*s)) { zerofill = ('0'==*s); @@ -986,7 +986,7 @@ HDfprintf(FILE *stream, const char *fmt, ...) if (*modifier) sprintf (format_templ+HDstrlen(format_templ), "%s", modifier); sprintf (format_templ+HDstrlen(format_templ), "%c", conv); - + /* Conversion */ switch (conv) { @@ -1173,13 +1173,13 @@ HDstrtoll(const char *s, const char **rest, int base) { int64_t sign=1, acc=0; hbool_t overflow = FALSE; - + errno = 0; if (!s || (base && (base<2 || base>36))) { if (rest) *rest = s; return 0; } - + /* Skip white space */ while (HDisspace (*s)) s++; @@ -1188,7 +1188,7 @@ HDstrtoll(const char *s, const char **rest, int base) s++; } else if ('-'==*s) { sign = -1; - s++; + s++; } /* Zero base prefix */ @@ -1201,7 +1201,7 @@ HDstrtoll(const char *s, const char **rest, int base) } else if (0==base) { base = 10; } - + /* Digits */ while ((base<=10 && *s>='0' && *s<'0'+base) || (base>10 && ((*s>='0' && *s<='9') || @@ -1328,7 +1328,7 @@ void H5_timer_end (H5_timer_t *sum/*in,out*/, H5_timer_t *timer/*in,out*/) { H5_timer_t now; - + assert (timer); H5_timer_begin (&now); @@ -1361,7 +1361,7 @@ H5_timer_end (H5_timer_t *sum/*in,out*/, H5_timer_t *timer/*in,out*/) * 1.2345e-10 For bandwidth less than 1 * 6.7893e+94 For exceptionally large values * 6.678e+106 For really big values - * + * * Return: void * * Programmer: Robb Matzke @@ -1504,7 +1504,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) } else { HDmemset(&event_time, 0, sizeof event_time); } - + /* Print the first part of the line. This is the indication of the * nesting depth followed by the function name and either start of * argument list or start of return value. If this call is for a @@ -1537,7 +1537,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) fputc('+', out); fprintf(out, "%*s%s(", 2*current_depth, "", func); } - + /* Clear array sizes */ for (i=0; i<(hssize_t)NELMTS(asize); i++) asize[i] = -1; @@ -1559,7 +1559,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) } else { asize_idx = -1; } - + /* * The argument name. Leave off the `_id' part. If the argument * name is the null pointer then don't print the argument or the @@ -1736,7 +1736,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) } } break; - + case 's': if (ptr) { if (vp) { @@ -1765,7 +1765,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) } } break; - + case 't': if (ptr) { if (vp) { @@ -1788,7 +1788,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) } } break; - + default: fprintf (out, "BADTYPE(D%c)", type[1]); goto error; @@ -1808,7 +1808,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) else fprintf (out, "FAIL"); } break; - + case 'E': switch (type[1]) { case 'd': @@ -1833,7 +1833,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) } } break; - + case 'e': if (ptr) { if (vp) { @@ -1869,7 +1869,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) } } break; - + default: fprintf (out, "BADTYPE(E%c)", type[1]); goto error; @@ -2072,7 +2072,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) asize[argno] = (hssize_t)hssize; } break; - + default: fprintf (out, "BADTYPE(H%c)", type[1]); goto error; @@ -2271,7 +2271,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) asize[argno] = is; } break; - + case 'u': if (ptr) { if (vp) { @@ -2528,7 +2528,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) } } break; - + default: fprintf(out, "BADTYPE(S%c)", type[1]); goto error; @@ -2568,7 +2568,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) } } break; - + case 's': if (ptr) { if (vp) { diff --git a/src/H5A.c b/src/H5A.c index a8acc3a..78286fb 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -60,7 +60,7 @@ NAME H5A_init_interface -- Initialize interface-specific information USAGE herr_t H5A_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -79,7 +79,7 @@ H5A_init_interface(void) */ if (H5I_register_type(H5I_ATTR, (size_t)H5I_ATTRID_HASHSIZE, H5A_RESERVED_ATOMS, (H5I_free_t)H5A_close)0) { (void)H5I_clear_type(H5I_ATTR, FALSE); @@ -135,7 +135,7 @@ H5A_term_interface(void) hid_t plist_id; IN: ID of creation property list (currently not used) RETURNS Non-negative on success/Negative on failure - + ERRORS DESCRIPTION @@ -158,7 +158,7 @@ H5A_term_interface(void) * Modifications: * Robb Matzke, 5 Jun 1998 * The LOC_ID can also be a committed datatype. - * + * --------------------------------------------------------------------------*/ /* ARGSUSED */ hid_t @@ -197,7 +197,7 @@ done: /*------------------------------------------------------------------------- * Function: H5A_create * - * Purpose: + * Purpose: * This is the guts of the H5Acreate function. * Usage: * hid_t H5A_create (ent, name, type, space) @@ -297,7 +297,7 @@ H5A_create(const H5G_entry_t *ent, const char *name, const H5T_t *type, attr->ent_opened=1; /* Create the attribute message and save the attribute index */ - if (H5O_modify(&(attr->ent), H5O_ATTR_ID, H5O_NEW_MESG, 0, H5O_UPDATE_TIME, attr, dxpl_id) < 0) + if (H5O_modify(&(attr->ent), H5O_ATTR_ID, H5O_NEW_MESG, 0, H5O_UPDATE_TIME, attr, dxpl_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to update attribute header messages") /* Register the new attribute and get an ID for it */ @@ -329,7 +329,7 @@ done: void *op_data; IN: Op data passed in RETURNS Non-negative on success, negative on failure - + ERRORS DESCRIPTION @@ -374,7 +374,7 @@ H5A_find_idx_by_name(const void *_mesg, unsigned idx, void *_op_data) const char *name; IN: Name of dataset to find RETURNS non-negative on success, negative on failure - + ERRORS DESCRIPTION @@ -419,7 +419,7 @@ done: const char *name; IN: Name of attribute to locate and open RETURNS ID of attribute on success, negative on failure - + ERRORS DESCRIPTION @@ -459,7 +459,7 @@ H5Aopen_name(hid_t loc_id, const char *name) /* Go do the real work for opening the attribute */ if ((ret_value=H5A_open(ent, (unsigned)idx, H5AC_dxpl_id))<0) HGOTO_ERROR (H5E_ATTR, H5E_CANTINIT, FAIL, "unable to open attribute") - + done: FUNC_LEAVE_API(ret_value) } /* H5Aopen_name() */ @@ -476,7 +476,7 @@ done: unsigned idx; IN: Index (0-based) attribute to open RETURNS ID of attribute on success, negative on failure - + ERRORS DESCRIPTION @@ -490,7 +490,7 @@ done: * Modifications: * Robb Matzke, 5 Jun 1998 * The LOC_ID can also be a named (committed) datatype. - * + * --------------------------------------------------------------------------*/ hid_t H5Aopen_idx(hid_t loc_id, unsigned idx) @@ -510,7 +510,7 @@ H5Aopen_idx(hid_t loc_id, unsigned idx) /* Go do the real work for opening the attribute */ if ((ret_value=H5A_open(ent, idx, H5AC_dxpl_id))<0) HGOTO_ERROR (H5E_ATTR, H5E_CANTINIT, FAIL, "unable to open attribute") - + done: FUNC_LEAVE_API(ret_value) } /* H5Aopen_idx() */ @@ -519,7 +519,7 @@ done: /*------------------------------------------------------------------------- * Function: H5A_open * - * Purpose: + * Purpose: * This is the guts of the H5Aopen_xxx functions * Usage: * herr_t H5A_open (ent, idx) @@ -554,7 +554,7 @@ H5A_open(H5G_entry_t *ent, unsigned idx, hid_t dxpl_id) if (NULL==(attr=H5O_read(ent, H5O_ATTR_ID, (int)idx, NULL, dxpl_id))) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to load attribute info from dataset header") attr->initialized=1; - + /* Deep copy of the symbol table entry */ if (H5G_ent_copy(&(attr->ent),ent,H5G_COPY_DEEP)<0) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to copy entry") @@ -590,7 +590,7 @@ done: const void *buf; IN: Buffer of data to write RETURNS Non-negative on success/Negative on failure - + ERRORS DESCRIPTION @@ -635,7 +635,7 @@ done: const void *buf; IN: Buffer of data to write RETURNS Non-negative on success/Negative on failure - + ERRORS DESCRIPTION @@ -720,7 +720,7 @@ H5A_write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id) HGOTO_ERROR(H5E_ATTR, H5E_BADVALUE, FAIL, "attribute not found") /* Modify the attribute data */ - if (H5O_modify(&(attr->ent), H5O_ATTR_ID, idx, 0, H5O_UPDATE_DATA_ONLY|H5O_UPDATE_TIME, attr, dxpl_id) < 0) + if (H5O_modify(&(attr->ent), H5O_ATTR_ID, idx, 0, H5O_UPDATE_DATA_ONLY|H5O_UPDATE_TIME, attr, dxpl_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to update attribute header messages") } /* end if */ @@ -729,9 +729,9 @@ H5A_write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id) done: /* Release resources */ - if (src_id >= 0) + if (src_id >= 0) (void)H5I_dec_ref(src_id); - if (dst_id >= 0) + if (dst_id >= 0) (void)H5I_dec_ref(dst_id); if (bkg_buf) H5FL_BLK_FREE(attr_buf, bkg_buf); @@ -752,7 +752,7 @@ done: void *buf; IN: Buffer for data to read RETURNS Non-negative on success/Negative on failure - + ERRORS DESCRIPTION @@ -797,7 +797,7 @@ done: void *buf; IN: Buffer for data to read RETURNS Non-negative on success/Negative on failure - + ERRORS DESCRIPTION @@ -876,9 +876,9 @@ H5A_read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id) done: /* Release resources */ - if (src_id >= 0) + if (src_id >= 0) (void)H5I_dec_ref(src_id); - if (dst_id >= 0) + if (dst_id >= 0) (void)H5I_dec_ref(dst_id); if (tconv_buf) H5FL_BLK_FREE(attr_buf, tconv_buf); @@ -899,7 +899,7 @@ done: hid_t attr_id; IN: Attribute to get dataspace of RETURNS A dataspace ID on success, negative on failure - + ERRORS DESCRIPTION @@ -944,7 +944,7 @@ done: hid_t attr_id; IN: Attribute to get datatype of RETURNS A datatype ID on success, negative on failure - + ERRORS DESCRIPTION @@ -986,7 +986,7 @@ H5Aget_type(hid_t attr_id) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "invalid datatype location") if (H5T_lock(dst, FALSE)<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to lock transient datatype") - + /* Atomize */ if ((ret_value=H5I_register(H5I_DATATYPE, dst))<0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register datatype atom") @@ -1014,7 +1014,7 @@ done: RETURNS This function returns the length of the attribute's name (which may be longer than 'buf_size') on success or negative for failure. - + ERRORS DESCRIPTION @@ -1067,10 +1067,10 @@ done: * Function: H5Aget_storage_size * * Purpose: Returns the amount of storage size that is required for this - * attribute. + * attribute. * * Return: Success: The amount of storage size allocated for the - * attribute. The return value may be zero + * attribute. The return value may be zero * if no data has been stored. * * Failure: Zero @@ -1087,7 +1087,7 @@ H5Aget_storage_size(hid_t attr_id) { H5A_t *attr=NULL; hsize_t ret_value; /* Return value */ - + FUNC_ENTER_API(H5Aget_storage_size, 0) H5TRACE1("h","i",attr_id); @@ -1106,12 +1106,12 @@ done: /*------------------------------------------------------------------------- * Function: H5A_get_storage_size * - * Purpose: Private function for H5Aget_storage_size. Returns the + * Purpose: Private function for H5Aget_storage_size. Returns the * amount of storage size that is required for this - * attribute. + * attribute. * * Return: Success: The amount of storage size allocated for the - * attribute. The return value may be zero + * attribute. The return value may be zero * if no data has been stored. * * Failure: Zero @@ -1127,7 +1127,7 @@ static hsize_t H5A_get_storage_size(const H5A_t *attr) { hsize_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5A_get_storage_size) /* Set return value */ @@ -1135,7 +1135,7 @@ H5A_get_storage_size(const H5A_t *attr) FUNC_LEAVE_NOAPI(ret_value) } - + /*-------------------------------------------------------------------------- NAME @@ -1147,7 +1147,7 @@ H5A_get_storage_size(const H5A_t *attr) hid_t loc_id; IN: Object (dataset or group) to be queried RETURNS Number of attributes on success, negative on failure - + ERRORS DESCRIPTION @@ -1199,9 +1199,9 @@ done: /*------------------------------------------------------------------------- * Function: H5Arename * - * Purpose: Rename an attribute + * Purpose: Rename an attribute * - * Return: Success: Non-negative + * Return: Success: Non-negative * * Failure: Negative * @@ -1217,7 +1217,7 @@ H5Arename(hid_t loc_id, const char *old_name, const char *new_name) { H5G_entry_t *ent = NULL; /*symtab ent of object to attribute */ herr_t ret_value; /* Return value */ - + FUNC_ENTER_API(H5Arename, FAIL) H5TRACE3("e","iss",loc_id,old_name,new_name); @@ -1240,9 +1240,9 @@ done: /*------------------------------------------------------------------------- * Function: H5A_rename * - * Purpose: Private function for H5Arename. Rename an attribute + * Purpose: Private function for H5Arename. Rename an attribute * - * Return: Success: Non-negative + * Return: Success: Non-negative * * Failure: Negative * @@ -1259,14 +1259,14 @@ H5A_rename(H5G_entry_t *ent, const char *old_name, const char *new_name, hid_t d int seq, idx=FAIL; /* Index of attribute being querried */ H5A_t found_attr; /* Attribute with OLD_NAME */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5A_rename) /* Check arguments */ assert(ent); assert(old_name); assert(new_name); - + /* Read in the existing attributes to check for duplicates */ seq=0; while(H5O_read(ent, H5O_ATTR_ID, seq, &found_attr, dxpl_id)!=NULL) { @@ -1284,12 +1284,12 @@ H5A_rename(H5G_entry_t *ent, const char *old_name, const char *new_name, hid_t d H5E_clear_stack(NULL); if(idx<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "attribute cannot be found") - + /* Copy the attribute name. */ if(found_attr.name) HDfree(found_attr.name); - found_attr.name = HDstrdup(new_name); - if(!found_attr.name) + found_attr.name = HDstrdup(new_name); + if(!found_attr.name) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "String copy failed") /* Indicate entry is not opened and the attribute doesn't need fill-values. */ @@ -1297,9 +1297,9 @@ H5A_rename(H5G_entry_t *ent, const char *old_name, const char *new_name, hid_t d found_attr.initialized=TRUE; /* Modify the attribute message */ - if (H5O_modify(ent, H5O_ATTR_ID, idx, 0, H5O_UPDATE_TIME, &found_attr, dxpl_id) < 0) + if (H5O_modify(ent, H5O_ATTR_ID, idx, 0, H5O_UPDATE_TIME, &found_attr, dxpl_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to update attribute header messages") - + /* Close the attribute */ if(H5A_free(&found_attr)<0) HGOTO_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "unable to close renamed attribute") @@ -1323,7 +1323,7 @@ done: RETURNS Returns a negative value if something is wrong, the return value of the last operator if it was non-zero, or zero if all attributes were processed. - + ERRORS DESCRIPTION @@ -1337,7 +1337,7 @@ done: over ('loc_id'), the name of the current attribute about the object ('attr_name') and the pointer to the operator data passed in to H5Aiterate ('op_data'). The return values from an operator are: - A. Zero causes the iterator to continue, returning zero when all + A. Zero causes the iterator to continue, returning zero when all attributes have been processed. B. Positive causes the iterator to immediately return that positive value, indicating short-circuit success. The iterator can be @@ -1353,7 +1353,7 @@ done: * Robb Matzke, 5 Jun 1998 * Like the group iterator, if ATTR_NUM is the null pointer then all * attributes are processed. - * + * --------------------------------------------------------------------------*/ herr_t H5Aiterate(hid_t loc_id, unsigned *attr_num, H5A_operator_t op, void *op_data) @@ -1418,19 +1418,19 @@ done: const char *name; IN: Name of attribute to delete RETURNS Non-negative on success/Negative on failure - + ERRORS DESCRIPTION This function removes the named attribute from a dataset or group. This function should not be used when attribute IDs are open on 'loc_id' - as it may cause the internal indexes of the attributes to change and future + as it may cause the internal indexes of the attributes to change and future writes to the open attributes to produce incorrect results. * * Modifications: * Robb Matzke, 5 Jun 1998 * The LOC_ID can also be a named (committed) datatype. - * + * --------------------------------------------------------------------------*/ herr_t H5Adelete(hid_t loc_id, const char *name) @@ -1457,7 +1457,7 @@ H5Adelete(hid_t loc_id, const char *name) /* Delete the attribute from the location */ if ((ret_value=H5O_remove(ent, H5O_ATTR_ID, found, H5AC_dxpl_id)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute header message") - + done: FUNC_LEAVE_API(ret_value) } /* H5Adelete() */ @@ -1473,7 +1473,7 @@ done: hid_t attr_id; IN: Attribute to release access to RETURNS Non-negative on success/Negative on failure - + ERRORS DESCRIPTION @@ -1563,7 +1563,7 @@ H5A_copy(H5A_t *_new_attr, const H5A_t *old_attr, unsigned update_flags) /* Set the return value */ ret_value=new_attr; - + done: if(ret_value==NULL) { if(new_attr!=NULL && allocated_attr) @@ -1618,7 +1618,7 @@ done: /*------------------------------------------------------------------------- * Function: H5A_close * - * Purpose: Frees an attribute and all associated memory. + * Purpose: Frees an attribute and all associated memory. * * Return: Non-negative on success/Negative on failure * @@ -1662,7 +1662,7 @@ H5A_close(H5A_t *attr) HGOTO_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't release object header info") H5FL_FREE(H5A_t, attr); - + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A_close() */ diff --git a/src/H5AC.c b/src/H5AC.c index a7f5aa1..d4b70d2 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -32,7 +32,7 @@ * Turned on "H5AC_SORT_BY_ADDR" * * John Mainzer, 5/19/04 - * Complete redesign and rewrite. See the header comments for + * Complete redesign and rewrite. See the header comments for * H5AC_t for an overview of what is going on. * * John Mainzer, 6/4/04 @@ -86,7 +86,7 @@ hid_t H5AC_ind_dxpl_id=(-1); * Private file-scope function declarations: */ -static herr_t H5AC_check_if_write_permitted(const H5F_t *f, +static herr_t H5AC_check_if_write_permitted(const H5F_t *f, hid_t dxpl_id, hbool_t * write_permitted_ptr); @@ -318,10 +318,10 @@ H5AC_term_interface(void) * Modifications: * * Complete re-design and re-write to support the re-designed - * metadata cache. + * metadata cache. * - * At present, the size_hint is ignored, and the - * max_cache_size and min_clean_size fields are hard + * At present, the size_hint is ignored, and the + * max_cache_size and min_clean_size fields are hard * coded. This should be fixed, but a parameter * list change will be required, so I will leave it * for now. @@ -331,17 +331,17 @@ H5AC_term_interface(void) * JRM - 4/28/04 * * Reworked the function again after abstracting its guts to - * the similar function in H5C.c. The function is now a + * the similar function in H5C.c. The function is now a * wrapper for H5C_create(). * JRM - 6/4/04 * - * Deleted the old size_hint parameter and added the + * Deleted the old size_hint parameter and added the * max_cache_size, and min_clean_size parameters. * * JRM - 3/10/05 * * Deleted the max_cache_size, and min_clean_size parameters, - * and added the config_ptr parameter. Added code to + * and added the config_ptr parameter. Added code to * validate the resize configuration before we do anything. * * JRM - 3/24/05 @@ -371,7 +371,7 @@ static const char * H5AC_entry_type_names[H5AC_NTYPES] = }; herr_t -H5AC_create(const H5F_t *f, +H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -390,7 +390,7 @@ H5AC_create(const H5F_t *f, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Bad cache configuration"); } - /* The default max cache size and min clean size will frequently be + /* The default max cache size and min clean size will frequently be * overwritten shortly by the subsequent set resize config call. * -- JRM */ @@ -437,14 +437,14 @@ done: * Modifications: * * Complete re-design and re-write to support the re-designed - * metadata cache. + * metadata cache. * JRM - 5/12/04 * * Abstracted the guts of the function to H5C_dest() in H5C.c, * and then re-wrote the function as a wrapper for H5C_dest(). * * JRM - 6/7/04 - * + * *------------------------------------------------------------------------- */ herr_t @@ -477,34 +477,34 @@ done: * Function: H5AC_flush * * Purpose: Flush (and possibly destroy) the metadata cache associated - * with the specified file. + * with the specified file. * * This is a re-write of an earlier version of the function * which was reputedly capable of flushing (and destroying - * if requested) individual entries, individual entries if - * they match the supplied type, all entries of a given type, - * as well as all entries in the cache. + * if requested) individual entries, individual entries if + * they match the supplied type, all entries of a given type, + * as well as all entries in the cache. * * As only this last capability is actually used at present, - * I have not implemented the other capabilities in this - * version of the function. + * I have not implemented the other capabilities in this + * version of the function. * - * The type and addr parameters are retained to avoid source - * code changed, but values other than NULL and HADDR_UNDEF - * respectively are errors. If all goes well, they should + * The type and addr parameters are retained to avoid source + * code changed, but values other than NULL and HADDR_UNDEF + * respectively are errors. If all goes well, they should * be removed, and the function renamed to something more * descriptive -- perhaps H5AC_flush_cache. * * If the cache contains protected entries, the function will - * fail, as protected entries cannot be flushed. However - * all unprotected entries should be flushed before the + * fail, as protected entries cannot be flushed. However + * all unprotected entries should be flushed before the * function returns failure. - * - * For historical purposes, the original version of the + * + * For historical purposes, the original version of the * purpose section is reproduced below: * * ============ Original Version of "Purpose:" ============ - * + * * Flushes (and destroys if DESTROY is non-zero) the specified * entry from the cache. If the entry TYPE is CACHE_FREE and * ADDR is HADDR_UNDEF then all types of entries are @@ -547,10 +547,10 @@ H5AC_flush(H5F_t *f, hid_t dxpl_id, unsigned flags) HDassert(f); HDassert(f->shared->cache); - status = H5C_flush_cache(f, - dxpl_id, - H5AC_noblock_dxpl_id, - f->shared->cache, + status = H5C_flush_cache(f, + dxpl_id, + H5AC_noblock_dxpl_id, + f->shared->cache, flags); if ( status < 0 ) { @@ -597,16 +597,16 @@ done: * at the beginning of the function. * * JRM - 6/7/04 - * Abstracted the guts of the function to H5C_insert_entry() - * in H5C.c, and then re-wrote the function as a wrapper for + * Abstracted the guts of the function to H5C_insert_entry() + * in H5C.c, and then re-wrote the function as a wrapper for * H5C_insert_entry(). * * JRM - 1/6/05 * Added the flags parameter. At present, this parameter is * only used to set the new flush_marker field on the new * entry. Since this doesn't apply to the SAP code, no change - * is needed there. Thus the only change to the body of the - * code is to pass the flags parameter through to + * is needed there. Thus the only change to the body of the + * code is to pass the flags parameter through to * H5C_insert_entry(). * * JRM - 6/6/05 @@ -659,7 +659,7 @@ H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void * lf = f->shared->lf; if ( H5FD_is_fphdf5_driver(lf) ) { - + /* Newly inserted entry are presumed to be dirty */ info->is_dirty = TRUE; @@ -667,7 +667,7 @@ H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void * * This is the FPHDF5 driver. Grab a lock for this piece of * metadata from the SAP. Bail-out quickly if we're unable to do * that. In the case of the FPHDF5 driver, the local cache is - * turned off. We lock the address then write the data to the SAP. + * turned off. We lock the address then write the data to the SAP. * We do this because the cache is off and thus cannot retain the * data which has just been added to it. We will get it from the * SAP as needed in the future. @@ -719,7 +719,7 @@ H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void * result = H5C_insert_entry(f, dxpl_id, - H5AC_noblock_dxpl_id, + H5AC_noblock_dxpl_id, cache, type, addr, @@ -762,8 +762,8 @@ done: * Complete rewrite for the new meta-data cache. * * JRM - 6/7/04 - * Abstracted the guts of the function to H5C_rename_entry() - * in H5C.c, and then re-wrote the function as a wrapper for + * Abstracted the guts of the function to H5C_rename_entry() + * in H5C.c, and then re-wrote the function as a wrapper for * H5C_rename_entry(). * *------------------------------------------------------------------------- @@ -785,7 +785,7 @@ H5AC_rename(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t new_ad #ifdef H5_HAVE_PARALLEL #ifdef H5_HAVE_FPHDF5 - /* In the flexible parallel case, the cache is always empty. + /* In the flexible parallel case, the cache is always empty. * Thus H5AC_rename() has nothing to do by definition. */ { @@ -837,7 +837,7 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_protect * - * Purpose: If the target entry is not in the cache, load it. If + * Purpose: If the target entry is not in the cache, load it. If * necessary, attempt to evict one or more entries to keep * the cache within its maximum size. * @@ -845,8 +845,8 @@ done: * to the caller. The caller must call H5AC_unprotect() when * finished with the entry. * - * While it is protected, the entry may not be either evicted - * or flushed -- nor may it be accessed by another call to + * While it is protected, the entry may not be either evicted + * or flushed -- nor may it be accessed by another call to * H5AC_protect. Any attempt to do so will result in a failure. * * This comment is a re-write of the original Purpose: section. @@ -887,19 +887,19 @@ done: * Purpose section above. * * JRM - 6/7/04 - * Abstracted the guts of the function to H5C_protect() - * in H5C.c, and then re-wrote the function as a wrapper for + * Abstracted the guts of the function to H5C_protect() + * in H5C.c, and then re-wrote the function as a wrapper for * H5C_protect(). * *------------------------------------------------------------------------- */ void * -H5AC_protect(H5F_t *f, - hid_t dxpl_id, - const H5AC_class_t *type, +H5AC_protect(H5F_t *f, + hid_t dxpl_id, + const H5AC_class_t *type, haddr_t addr, - const void *udata1, - void *udata2, + const void *udata1, + void *udata2, H5AC_protect_t #ifndef H5_HAVE_FPHDF5 UNUSED @@ -957,7 +957,7 @@ H5AC_protect(H5F_t *f, * by some other process, we can loop and wait or bail * out of this function */ - HDfprintf(stderr, + HDfprintf(stderr, "Couldn't get lock for metadata at address %a\n", addr); #endif /* 0 */ @@ -966,7 +966,7 @@ H5AC_protect(H5F_t *f, } /* Load a thing from the SAP. */ - if ( NULL == (thing = type->load(f, dxpl_id, addr, + if ( NULL == (thing = type->load(f, dxpl_id, addr, udata1, udata2)) ) { #if 0 @@ -985,7 +985,7 @@ H5AC_protect(H5F_t *f, HGOTO_DONE(NULL) } - + info = (H5AC_info_t *)thing; HDassert(info->is_dirty == FALSE); @@ -1000,7 +1000,7 @@ H5AC_protect(H5F_t *f, "Can't get size of thing") } - HDassert(info->size < H5C_MAX_ENTRY_SIZE); + HDassert(info->size < H5C_MAX_ENTRY_SIZE); info->next = NULL; info->prev = NULL; @@ -1015,7 +1015,7 @@ H5AC_protect(H5F_t *f, thing = H5C_protect(f, dxpl_id, - H5AC_noblock_dxpl_id, + H5AC_noblock_dxpl_id, f->shared->cache, type, addr, @@ -1045,15 +1045,15 @@ done: * and give it back to the replacement policy. * * The TYPE and ADDR arguments must be the same as those in - * the corresponding call to H5AC_protect() and the THING - * argument must be the value returned by that call to + * the corresponding call to H5AC_protect() and the THING + * argument must be the value returned by that call to * H5AC_protect(). * * If the deleted flag is TRUE, simply remove the target entry - * from the cache, clear it, and free it without writing it to + * from the cache, clear it, and free it without writing it to * disk. * - * This verion of the function is a complete re-write to + * This verion of the function is a complete re-write to * use the new metadata cache. While there isn't all that * much difference between the old and new Purpose sections, * the original version is given below. @@ -1092,20 +1092,20 @@ done: * Complete re-write for the new metadata cache. * * JRM - 6/7/04 - * Abstracted the guts of the function to H5C_unprotect() - * in H5C.c, and then re-wrote the function as a wrapper for + * Abstracted the guts of the function to H5C_unprotect() + * in H5C.c, and then re-wrote the function as a wrapper for * H5C_unprotect(). - * + * * JRM - 1/6/05 * Replaced the deleted parameter with the new flags parameter. * Since the deleted parameter is not used by the FPHDF5 code, - * the only change in the body is to replace the deleted - * parameter with the flags parameter in the call to + * the only change in the body is to replace the deleted + * parameter with the flags parameter in the call to * H5C_unprotect(). * * JRM - 6/6/05 - * Added the dirtied flag and supporting code. This is - * part of a collection of changes directed at moving + * Added the dirtied flag and supporting code. This is + * part of a collection of changes directed at moving * management of cache entry dirty flags into the H5C code. * *------------------------------------------------------------------------- @@ -1152,7 +1152,7 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, ((H5AC_info_t *)thing)->is_protected = FALSE; /* mark the entry as dirty if appropriate. JRM - 6/6/05 */ - ((H5AC_info_t *)thing)->is_dirty |= + ((H5AC_info_t *)thing)->is_dirty |= (flags & H5AC__DIRTIED_FLAG) ? TRUE : FALSE; /* @@ -1160,7 +1160,7 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, * (deleted == TRUE), we need to send a request to the SAP * telling it to remove that bit of metadata from its cache. */ - /* the deleted parameter has been replaced with the flags + /* the deleted parameter has been replaced with the flags * parameter. The actual value of deleted is still passed * in as a bit in flags. If it is needed, it can be extracted * as follows: @@ -1204,7 +1204,7 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, result = H5C_unprotect(f, dxpl_id, - H5AC_noblock_dxpl_id, + H5AC_noblock_dxpl_id, f->shared->cache, type, addr, @@ -1239,8 +1239,8 @@ done: * Re-write to support the new metadata cache. * * JRM - 6/7/04 - * Abstracted the guts of the function to H5C_stats() - * in H5C.c, and then re-wrote the function as a wrapper for + * Abstracted the guts of the function to H5C_stats() + * in H5C.c, and then re-wrote the function as a wrapper for * H5C_stats(). * *------------------------------------------------------------------------- @@ -1334,7 +1334,7 @@ H5AC_get_cache_auto_resize_config(H5AC_t * cache_ptr, config_ptr->decrement = internal_config.decrement; config_ptr->apply_max_decrement = internal_config.apply_max_decrement; config_ptr->max_decrement = internal_config.max_decrement; - config_ptr->epochs_before_eviction = + config_ptr->epochs_before_eviction = (int)(internal_config.epochs_before_eviction); config_ptr->apply_empty_reserve = internal_config.apply_empty_reserve; config_ptr->empty_reserve = internal_config.empty_reserve; @@ -1522,7 +1522,7 @@ H5AC_set_cache_auto_resize_config(H5AC_t * cache_ptr, if ( ( config_ptr->rpt_fcn_enabled != TRUE ) && ( config_ptr->rpt_fcn_enabled != FALSE ) ) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_ptr->rpt_fcn_enabled must be either TRUE or FALSE.") } @@ -1536,13 +1536,13 @@ H5AC_set_cache_auto_resize_config(H5AC_t * cache_ptr, internal_config.rpt_fcn = NULL; } - + internal_config.set_initial_size = config_ptr->set_initial_size; internal_config.initial_size = config_ptr->initial_size; internal_config.min_clean_fraction = config_ptr->min_clean_fraction; internal_config.max_size = config_ptr->max_size; internal_config.min_size = config_ptr->min_size; - internal_config.epoch_length = + internal_config.epoch_length = (int64_t)(config_ptr->epoch_length); internal_config.incr_mode = config_ptr->incr_mode; @@ -1556,12 +1556,12 @@ H5AC_set_cache_auto_resize_config(H5AC_t * cache_ptr, internal_config.decrement = config_ptr->decrement; internal_config.apply_max_decrement = config_ptr->apply_max_decrement; internal_config.max_decrement = config_ptr->max_decrement; - internal_config.epochs_before_eviction = + internal_config.epochs_before_eviction = (int32_t)(config_ptr->epochs_before_eviction); internal_config.apply_empty_reserve = config_ptr->apply_empty_reserve; internal_config.empty_reserve = config_ptr->empty_reserve; - result = H5C_set_cache_auto_resize_config((H5C_t *)cache_ptr, + result = H5C_set_cache_auto_resize_config((H5C_t *)cache_ptr, &internal_config); if ( result < 0 ) { @@ -1579,7 +1579,7 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_validate_config() * - * Purpose: Run a sanity check on the contents of the supplied + * Purpose: Run a sanity check on the contents of the supplied * instance of H5AC_cache_config_t. * * Do nothing and return SUCCEED if no errors are detected, @@ -1587,7 +1587,7 @@ done: * * At present, this function operates by packing the data * from the instance of H5AC_cache_config_t into an instance - * of H5C_auto_size_ctl_t, and then calling + * of H5C_auto_size_ctl_t, and then calling * H5C_validate_resize_config(). As H5AC_cache_config_t and * H5C_auto_size_ctl_t diverge, we may have to change this. * @@ -1640,13 +1640,13 @@ H5AC_validate_config(H5AC_cache_config_t * config_ptr) internal_config.rpt_fcn = NULL; } - + internal_config.set_initial_size = config_ptr->set_initial_size; internal_config.initial_size = config_ptr->initial_size; internal_config.min_clean_fraction = config_ptr->min_clean_fraction; internal_config.max_size = config_ptr->max_size; internal_config.min_size = config_ptr->min_size; - internal_config.epoch_length = + internal_config.epoch_length = (int64_t)(config_ptr->epoch_length); internal_config.incr_mode = config_ptr->incr_mode; @@ -1660,7 +1660,7 @@ H5AC_validate_config(H5AC_cache_config_t * config_ptr) internal_config.decrement = config_ptr->decrement; internal_config.apply_max_decrement = config_ptr->apply_max_decrement; internal_config.max_decrement = config_ptr->max_decrement; - internal_config.epochs_before_eviction = + internal_config.epochs_before_eviction = (int32_t)(config_ptr->epochs_before_eviction); internal_config.apply_empty_reserve = config_ptr->apply_empty_reserve; internal_config.empty_reserve = config_ptr->empty_reserve; @@ -1688,10 +1688,10 @@ done: * * Function: H5AC_check_if_write_permitted * - * Purpose: Determine if a write is permitted under the current - * circumstances, and set *write_permitted_ptr accordingly. - * As a general rule it is, but when we are running in parallel - * mode with collective I/O, we must ensure that a read cannot + * Purpose: Determine if a write is permitted under the current + * circumstances, and set *write_permitted_ptr accordingly. + * As a general rule it is, but when we are running in parallel + * mode with collective I/O, we must ensure that a read cannot * cause a write. * * In the event of failure, the value of *write_permitted_ptr diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index 3d35028..450907f 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -53,8 +53,8 @@ #define H5AC_BPT_LEAF_ID 11 /*B+ tree leaf */ #define H5AC_NTYPES 12 -/* H5AC_DUMP_STATS_ON_CLOSE should always be FALSE when - * H5C_COLLECT_CACHE_STATS is FALSE. +/* H5AC_DUMP_STATS_ON_CLOSE should always be FALSE when + * H5C_COLLECT_CACHE_STATS is FALSE. * * When H5C_COLLECT_CACHE_STATS is TRUE, H5AC_DUMP_STATS_ON_CLOSE must * be FALSE for "make check" to succeed, but may be set to TRUE at other @@ -208,7 +208,7 @@ extern hid_t H5AC_ind_dxpl_id; */ /* #defines of flags used in the flags parameters in some of the - * following function calls. Note that they are just copies of + * following function calls. Note that they are just copies of * the equivalent flags from H5Cprivate.h. */ @@ -224,12 +224,12 @@ extern hid_t H5AC_ind_dxpl_id; H5_DLL herr_t H5AC_init(void); H5_DLL herr_t H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr); -H5_DLL herr_t H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, +H5_DLL herr_t H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void *thing, unsigned int flags); H5_DLL void *H5AC_protect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, const void *udata1, void *udata2, H5AC_protect_t rw); -H5_DLL herr_t H5AC_unprotect(H5F_t *f, hid_t dxpl_id, +H5_DLL herr_t H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void *thing, unsigned flags); H5_DLL herr_t H5AC_flush(H5F_t *f, hid_t dxpl_id, unsigned flags); diff --git a/src/H5ACpublic.h b/src/H5ACpublic.h index f8f3b6d..2381ccc 100644 --- a/src/H5ACpublic.h +++ b/src/H5ACpublic.h @@ -55,7 +55,7 @@ extern "C" { * version number, or an error will be flagged. * * rpt_fcn_enabled: Boolean field used to enable and disable the default - * reporting function. This function is invoked every time the + * reporting function. This function is invoked every time the * automatic cache resize code is run, and reports on its activities. * * This is a debugging function, and should normally be turned off. diff --git a/src/H5B.c b/src/H5B.c index 3123bfc..c5775d8 100644 --- a/src/H5B.c +++ b/src/H5B.c @@ -47,7 +47,7 @@ * e. left[x] is a pointer to the node's left sibling * or the null pointer if this is the left-most * node at this level in the tree. - * + * * f. right[x] is a pointer to the node's right * sibling or the null pointer if this is the * right-most node at this level in the tree. @@ -251,7 +251,7 @@ H5B_create(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, void *udata, #ifdef H5B_DEBUG H5B_assert(f, dxpl_id, *addr_p, shared->type, udata); #endif - + done: if (ret_value<0) { if(shared && shared->sizeof_rnode>0) { @@ -261,7 +261,7 @@ done: if (bt) (void)H5B_dest(f,bt); } - + FUNC_LEAVE_NOAPI(ret_value) } /*lint !e818 Can't make udata a pointer to const */ @@ -580,7 +580,7 @@ H5B_clear(H5F_t *f, H5B_t *bt, hbool_t destroy) /* Reset the dirty flag. */ bt->cache_info.is_dirty = FALSE; - + if (destroy) if (H5B_dest(f, bt) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree node") @@ -593,8 +593,8 @@ done: /*------------------------------------------------------------------------- * Function: H5B_compute_size * - * Purpose: Compute the size in bytes of the specified instance of - * H5B_t on disk, and return it in *len_ptr. On failure, + * Purpose: Compute the size in bytes of the specified instance of + * H5B_t on disk, and return it in *len_ptr. On failure, * the value of *len_ptr is undefined. * * Return: Non-negative on success/Negative on failure @@ -713,7 +713,7 @@ H5B_find(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void *u #else /* OLD_WAY */ HGOTO_DONE(FAIL) #endif /* OLD_WAY */ - + /* * Follow the link to the subtree or to the data node. */ @@ -782,8 +782,8 @@ done: * of H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. * - * In this case, that required adding the new - * old_bt_dirtied_ptr parameter to the function's argument + * In this case, that required adding the new + * old_bt_dirtied_ptr parameter to the function's argument * list. * *------------------------------------------------------------------------- @@ -870,7 +870,7 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_t *old_bt, unsigned *old_bt_flags, if (H5DEBUG(B)) fprintf(H5DEBUG(B), " split %3d/%-3d\n", nleft, nright); #endif - + /* * Create the new B-tree node. */ @@ -883,9 +883,9 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_t *old_bt, unsigned *old_bt_flags, /* * Copy data from the old node to the new node. */ - + /* this function didn't used to mark the new bt entry as dirty. Since - * we just inserted the entry, this doesn't matter unless the entry + * we just inserted the entry, this doesn't matter unless the entry * somehow gets flushed between the insert and the protect. At present, * I don't think this can happen, but it doesn't hurt to mark the entry * dirty again. @@ -906,7 +906,7 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_t *old_bt, unsigned *old_bt_flags, */ *old_bt_flags |= H5AC__DIRTIED_FLAG; old_bt->nchildren = nleft; - + /* * Update sibling pointers. */ @@ -921,7 +921,7 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_t *old_bt, unsigned *old_bt_flags, tmp_bt->left = *new_addr_p; - if (H5AC_unprotect(f, dxpl_id, H5AC_BT, old_bt->right, tmp_bt, + if (H5AC_unprotect(f, dxpl_id, H5AC_BT, old_bt->right, tmp_bt, H5AC__DIRTIED_FLAG) != SUCCEED) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree node") } @@ -929,7 +929,7 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_t *old_bt, unsigned *old_bt_flags, old_bt->right = *new_addr_p; done: - if (new_bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, *new_addr_p, new_bt, + if (new_bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, *new_addr_p, new_bt, new_bt_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree node") @@ -1020,14 +1020,14 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, if (H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) != SUCCEED) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release new child") bt = NULL; - + /* the new node */ if (NULL == (bt = H5AC_protect(f, dxpl_id, H5AC_BT, child, type, udata, H5AC_READ))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load new node") if (!rt_key_changed) HDmemcpy(rt_key, H5B_NKEY(bt,shared,bt->nchildren), type->sizeof_nkey); - + if (H5AC_unprotect(f, dxpl_id, H5AC_BT, child, bt, H5AC__NO_FLAGS_SET) != SUCCEED) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release new child") bt = NULL; @@ -1103,11 +1103,11 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, #ifdef H5B_DEBUG H5B_assert(f, dxpl_id, addr, type, udata); #endif - + done: FUNC_LEAVE_NOAPI(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5B_insert_child @@ -1137,7 +1137,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B_insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx, +H5B_insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx, haddr_t child, H5B_ins_t anchor, const void *md_key) { H5B_shared_t *shared; /* Pointer to shared B-tree info */ @@ -1476,7 +1476,7 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type if (H5B_insert_child(tmp_bt, tmp_bt_flags_ptr, idx, child_addr, my_ins, md_key) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert child") } - + /* * If this node split, return the mid key (the one that is shared * by the left and right node). @@ -1499,9 +1499,9 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type done: { - herr_t e1 = (bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, + herr_t e1 = (bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, bt_flags) < 0); - herr_t e2 = (twin && H5AC_unprotect(f, dxpl_id, H5AC_BT, *new_node_p, + herr_t e2 = (twin && H5AC_unprotect(f, dxpl_id, H5AC_BT, *new_node_p, twin, twin_flags)<0); if (e1 || e2) /*use vars to prevent short-circuit of side effects */ HDONE_ERROR(H5E_BTREE, H5E_PROTECT, H5B_INS_ERROR, "unable to release node(s)") @@ -1554,7 +1554,7 @@ H5B_iterate (H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, H5B_operator_t op unsigned level; haddr_t left_child; herr_t ret_value; - + FUNC_ENTER_NOAPI(H5B_iterate, FAIL) /* @@ -1677,7 +1677,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type unsigned idx=0, lt=0, rt; /* Final, left & right indices */ int cmp=1; /* Key comparison value */ H5B_ins_t ret_value = H5B_INS_ERROR; - + FUNC_ENTER_NOAPI(H5B_remove_helper, H5B_INS_ERROR) assert(f); @@ -1809,7 +1809,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type sibling->right = bt->right; - if (H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->left, sibling, + if (H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->left, sibling, H5AC__DIRTIED_FLAG) != SUCCEED) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, H5B_INS_ERROR, "unable to release node from tree") sibling=NULL; /* Make certain future references will be caught */ @@ -1823,7 +1823,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type sibling->left = bt->left; - if (H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->right, sibling, + if (H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->right, sibling, H5AC__DIRTIED_FLAG) != SUCCEED) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, H5B_INS_ERROR, "unable to release node from tree") sibling=NULL; /* Make certain future references will be caught */ @@ -1851,7 +1851,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type */ bt_flags |= H5AC__DIRTIED_FLAG; bt->nchildren -= 1; - + HDmemmove(bt->native, bt->native + type->sizeof_nkey, (bt->nchildren+1) * type->sizeof_nkey); @@ -1885,7 +1885,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type HDmemcpy(H5B_NKEY(sibling,shared,0), H5B_NKEY(bt,shared,bt->nchildren), type->sizeof_nkey); - if (H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->right, sibling, + if (H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->right, sibling, H5AC__DIRTIED_FLAG) != SUCCEED) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, H5B_INS_ERROR, "unable to release node from tree") sibling=NULL; /* Make certain future references will be caught */ @@ -1904,7 +1904,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type */ bt_flags |= H5AC__DIRTIED_FLAG; bt->nchildren -= 1; - + HDmemmove(bt->native + idx * type->sizeof_nkey, bt->native + (idx+1) * type->sizeof_nkey, (bt->nchildren+1-idx) * type->sizeof_nkey); @@ -1912,7 +1912,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type bt->child+idx+1, (bt->nchildren-idx) * sizeof(haddr_t)); ret_value = H5B_INS_NOOP; - + } else { ret_value = H5B_INS_NOOP; } @@ -1962,7 +1962,7 @@ H5B_remove(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void unsigned bt_flags = H5AC__NO_FLAGS_SET; H5B_t *bt = NULL; /*btree node */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5B_remove, FAIL) /* Check args */ @@ -1987,7 +1987,7 @@ H5B_remove(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void bt->level = 0; bt_flags |= H5AC__DIRTIED_FLAG; } - + if (H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, bt_flags) != SUCCEED) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release node") bt=NULL; /* Make certain future references will be caught */ @@ -2027,7 +2027,7 @@ H5B_delete(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void H5B_shared_t *shared; /* Pointer to shared B-tree info */ unsigned u; /* Local index variable */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5B_delete, FAIL) /* Check args */ @@ -2067,7 +2067,7 @@ H5B_delete(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void /* Delete this node from disk */ if (H5MF_xfree(f, H5FD_MEM_BTREE, dxpl_id, addr, (hsize_t)shared->sizeof_rnode)<0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free B-tree node") - + done: if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5C__DELETED_FLAG)<0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree node in cache") @@ -2283,7 +2283,7 @@ H5B_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int f HDfprintf(stream, "%*sChild %d...\n", indent, "", u); HDfprintf(stream, "%*s%-*s %a\n", indent + 3, "", MAX(0, fwidth - 3), "Address:", bt->child[u]); - + /* If there is a key debugging routine, use it to display the left & right keys */ if (type->debug_key) { /* Decode the 'left' key & print it */ diff --git a/src/H5B2.c b/src/H5B2.c index 68ad206..b7cbb5d 100644 --- a/src/H5B2.c +++ b/src/H5B2.c @@ -67,25 +67,25 @@ static herr_t H5B2_split_root(H5F_t *f, hid_t dxpl_id, H5B2_t *bt2, static herr_t H5B2_redistribute2(H5F_t *f, hid_t dxpl_id, unsigned depth, H5B2_internal_t *internal, unsigned idx); static herr_t H5B2_split2(H5F_t *f, hid_t dxpl_id, unsigned depth, - H5B2_node_ptr_t *curr_node_ptr, unsigned * parent_cache_info_flags_ptr, + H5B2_node_ptr_t *curr_node_ptr, unsigned * parent_cache_info_flags_ptr, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx); -static herr_t H5B2_split3(H5F_t *f, hid_t dxpl_id, unsigned depth, +static herr_t H5B2_split3(H5F_t *f, hid_t dxpl_id, unsigned depth, H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags, H5B2_internal_t *internal, unsigned *internal_flags, unsigned idx); static herr_t H5B2_redistribute3(H5F_t *f, hid_t dxpl_id, unsigned depth, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx); static herr_t H5B2_merge2(H5F_t *f, hid_t dxpl_id, unsigned depth, - H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, + H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx); static herr_t H5B2_merge3(H5F_t *f, hid_t dxpl_id, unsigned depth, - H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, + H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx); static herr_t H5B2_swap_leaf(H5F_t *f, hid_t dxpl_id, unsigned depth, - H5B2_internal_t *internal, unsigned *internal_flags_ptr, + H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx, void *swap_loc); static herr_t H5B2_insert_internal(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, unsigned depth, H5AC_info_t *parent_cache_info, - unsigned *parent_cache_info_flags_ptr, + unsigned *parent_cache_info_flags_ptr, H5B2_node_ptr_t *curr_node_ptr, void *udata); static herr_t H5B2_insert_leaf(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, H5B2_node_ptr_t *curr_node_ptr, void *udata); @@ -354,7 +354,7 @@ done: if (bt2) (void)H5B2_cache_hdr_dest(f,bt2); } /* end if */ - + FUNC_LEAVE_NOAPI(ret_value) } /* end H5B2_create() */ @@ -854,7 +854,7 @@ done: * of H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. * - * In this case, that required adding the new + * In this case, that required adding the new * parent_cache_info_dirtied_ptr and internal_dirtied_ptr * parameters to the function's argument list. * @@ -862,7 +862,7 @@ done: */ static herr_t H5B2_split2(H5F_t *f, hid_t dxpl_id, unsigned depth, H5B2_node_ptr_t *curr_node_ptr, - unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, + unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx) { const H5AC_class_t *child_class; /* Pointer to child node's class info */ @@ -1135,8 +1135,8 @@ done: * of H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. * - * In this case, that required adding the new - * internal_dirtied_ptr parameter to the function's + * In this case, that required adding the new + * internal_dirtied_ptr parameter to the function's * argument list. * *------------------------------------------------------------------------- @@ -1516,16 +1516,16 @@ done: * of H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. * - * In this case, that required adding the new + * In this case, that required adding the new * parent_cache_info_dirtied_ptr and internal_dirtied_ptr * parameters to the function's argument list. * *------------------------------------------------------------------------- */ static herr_t -H5B2_split3(H5F_t *f, hid_t dxpl_id, unsigned depth, +H5B2_split3(H5F_t *f, hid_t dxpl_id, unsigned depth, H5B2_node_ptr_t *curr_node_ptr, - unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, + unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx) { const H5AC_class_t *child_class; /* Pointer to child node's class info */ @@ -1711,7 +1711,7 @@ H5B2_split3(H5F_t *f, hid_t dxpl_id, unsigned depth, /* Move records from middle node to new node */ HDmemcpy(H5B2_NAT_NREC(new_native,shared,0),H5B2_NAT_NREC(middle_native,shared,(*middle_nrec-new_nrec_move)),shared->type->nrec_size*new_nrec_move); - + /* Move record from middle node up to parent node */ HDmemcpy(H5B2_INT_NREC(internal,shared,idx),H5B2_NAT_NREC(middle_native,shared,((*middle_nrec-new_nrec_move)-1)),shared->type->nrec_size); @@ -1856,14 +1856,14 @@ done: * of H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. * - * In this case, that required adding the new + * In this case, that required adding the new * parent_cache_info_dirtied_ptr and internal_dirtied_ptr * parameters to the function's argument list. * *------------------------------------------------------------------------- */ static herr_t -H5B2_merge2(H5F_t *f, hid_t dxpl_id, unsigned depth, +H5B2_merge2(H5F_t *f, hid_t dxpl_id, unsigned depth, H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx) { @@ -2023,15 +2023,15 @@ done: * of H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. * - * In this case, that required adding the new + * In this case, that required adding the new * parent_cache_info_dirtied_ptr and internal_dirtied_ptr * parameters to the function's argument list. * *------------------------------------------------------------------------- */ static herr_t -H5B2_merge3(H5F_t *f, hid_t dxpl_id, unsigned depth, - H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, +H5B2_merge3(H5F_t *f, hid_t dxpl_id, unsigned depth, + H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx) { const H5AC_class_t *child_class; /* Pointer to child node's class info */ @@ -2258,15 +2258,15 @@ done: * of H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. * - * In this case, that required adding the new - * internal_dirtied_ptr parameter to the function's + * In this case, that required adding the new + * internal_dirtied_ptr parameter to the function's * argument list. * *------------------------------------------------------------------------- */ static herr_t H5B2_swap_leaf(H5F_t *f, hid_t dxpl_id, unsigned depth, - H5B2_internal_t *internal, unsigned *internal_flags_ptr, + H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx, void *swap_loc) { const H5AC_class_t *child_class; /* Pointer to child node's class info */ @@ -2457,7 +2457,7 @@ done: */ static herr_t H5B2_insert_internal(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, - unsigned depth, H5AC_info_t *parent_cache_info, + unsigned depth, H5AC_info_t *parent_cache_info, unsigned *parent_cache_info_flags_ptr, H5B2_node_ptr_t *curr_node_ptr, void *udata) { @@ -2648,7 +2648,7 @@ H5B2_insert(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, if(H5B2_split_root(f, dxpl_id, bt2, &bt2_flags, bt2->shared)<0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to split root node") } /* end if */ - + /* Attempt to insert record into B-tree */ if(bt2->depth>0) { if(H5B2_insert_internal(f,dxpl_id,bt2->shared,bt2->depth,&(bt2->cache_info),&bt2_flags,&bt2->root,udata)<0) @@ -2686,7 +2686,7 @@ done: * Modifications: * * John Mainzer, 6/15/05 - * Modified the function to avoid modifying the is_dirty + * Modified the function to avoid modifying the is_dirty * field of the cache info, as that field is now maintained * by the cache code. Since this function uses a call to * H5AC_set(), and that function presumes that the newly @@ -2767,7 +2767,7 @@ done: * Modifications: * * John Mainzer, 6/15/05 - * Modified the function to avoid modifying the is_dirty + * Modified the function to avoid modifying the is_dirty * field of the cache info, as that field is now maintained * by the cache code. Since this function uses a call to * H5AC_set(), and that function presumes that the newly @@ -3030,7 +3030,7 @@ done: * UDATA pointer depending on the type of leaf node * requested. The UDATA can point to additional data passed * to the key comparison function. - * + * * The 'OP' routine is called with the record found and the * OP_DATA pointer, to allow caller to return information about * the record. @@ -3189,7 +3189,7 @@ H5B2_find(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, if (H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") } - + done: /* Check if we need to decrement the reference count for the B-tree's shared info */ if(incr_rc) @@ -3204,7 +3204,7 @@ done: * * Purpose: Locate the IDX'th record in a B-tree according to the * ordering used by the B-tree. The IDX values are 0-based. - * + * * The 'OP' routine is called with the record found and the * OP_DATA pointer, to allow caller to return information about * the record. @@ -3373,7 +3373,7 @@ H5B2_index(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, if (H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") } - + done: /* Check if we need to decrement the reference count for the B-tree's shared info */ if(incr_rc) @@ -3458,7 +3458,7 @@ H5B2_remove_leaf(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, /* Release space for B-tree node on disk */ if (H5MF_xfree(f, H5FD_MEM_BTREE, dxpl_id, leaf_addr, (hsize_t)shared->node_size)<0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free B-tree leaf node") - + /* Let the cache know that the object is deleted */ leaf_flags |= H5AC__DELETED_FLAG; @@ -3496,8 +3496,8 @@ done: * of H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. * - * In this case, that required adding the new - * parent_cache_info_dirtied_ptr parameter to the + * In this case, that required adding the new + * parent_cache_info_dirtied_ptr parameter to the * function's argument list. * *------------------------------------------------------------------------- @@ -3559,7 +3559,7 @@ H5B2_remove_internal(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, /* Release space for root B-tree node on disk */ if (H5MF_xfree(f, H5FD_MEM_BTREE, dxpl_id, internal_addr, (hsize_t)shared->node_size)<0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free B-tree leaf node") - + /* Let the cache know that the object is deleted */ internal_flags |= H5AC__DELETED_FLAG; @@ -3702,7 +3702,7 @@ done: * Function: H5B2_remove * * Purpose: Removes a record from a B-tree. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol @@ -3780,7 +3780,7 @@ done: * Function: H5B2_get_nrec * * Purpose: Retrieves the number of records in a B-tree - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol @@ -3836,7 +3836,7 @@ done: * caller-supplied UDATA pointer depending on the type of leaf node * requested. The UDATA can point to additional data passed * to the key comparison function. - * + * * The 'OP' routine is called with the record found and the * OP_DATA pointer, to allow caller to return information about * the record. @@ -3936,7 +3936,7 @@ done: * caller-supplied UDATA pointer depending on the type of leaf node * requested. The UDATA can point to additional data passed * to the key comparison function. - * + * * The 'OP' routine is called with the record found and the * OP_DATA pointer, to allow caller to return information about * the record. @@ -4033,7 +4033,7 @@ done: * caller-supplied UDATA pointer depending on the type of leaf node * requested. The UDATA can point to additional data passed * to the key comparison function. - * + * * The 'OP' routine is called with the record found and the * OP_DATA pointer, to allow caller to return information about * the record. @@ -4228,7 +4228,7 @@ H5B2_delete(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr) /* Release space for B-tree node on disk */ if (H5MF_xfree(f, H5FD_MEM_BTREE, dxpl_id, addr, (hsize_t)H5B2_HEADER_SIZE(f))<0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free B-tree header info") - + done: /* Release the B-tree header info */ if (bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, bt2, H5AC__DELETED_FLAG) < 0) @@ -4244,7 +4244,7 @@ done: * Purpose: Locate the specified information in a B-tree and modify it. * The UDATA can point to additional data passed * to the key comparison function. - * + * * The 'OP' routine is called with the record found and the * OP_DATA pointer, to allow caller to modify information about * the record. @@ -4418,7 +4418,7 @@ H5B2_modify(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, if (H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, leaf_flags) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") } - + done: /* Check if we need to decrement the reference count for the B-tree's shared info */ if(incr_rc) diff --git a/src/H5B2cache.c b/src/H5B2cache.c index 9f7d9db..7810aae 100644 --- a/src/H5B2cache.c +++ b/src/H5B2cache.c @@ -345,7 +345,7 @@ H5B2_cache_hdr_clear(H5F_t *f, H5B2_t *bt2, hbool_t destroy) /* Reset the dirty flag. */ bt2->cache_info.is_dirty = FALSE; - + if (destroy) if (H5B2_cache_hdr_dest(f, bt2) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree header") @@ -359,7 +359,7 @@ done: * Function: H5B2_cache_hdr_size * * Purpose: Compute the size in bytes of a B-tree header - * on disk, and return it in *size_ptr. On failure, + * on disk, and return it in *size_ptr. On failure, * the value of *size_ptr is undefined. * * Return: Non-negative on success/Negative on failure @@ -627,7 +627,7 @@ H5B2_cache_leaf_clear(H5F_t *f, H5B2_leaf_t *leaf, hbool_t destroy) /* Reset the dirty flag. */ leaf->cache_info.is_dirty = FALSE; - + if (destroy) if (H5B2_cache_leaf_dest(f, leaf) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree leaf node") @@ -641,7 +641,7 @@ done: * Function: H5B2_cache_leaf_size * * Purpose: Compute the size in bytes of a B-tree leaf node - * on disk, and return it in *size_ptr. On failure, + * on disk, and return it in *size_ptr. On failure, * the value of *size_ptr is undefined. * * Return: Non-negative on success/Negative on failure @@ -949,7 +949,7 @@ H5B2_cache_internal_clear(H5F_t *f, H5B2_internal_t *internal, hbool_t destroy) /* Reset the dirty flag. */ internal->cache_info.is_dirty = FALSE; - + if (destroy) if (H5B2_cache_internal_dest(f, internal) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree internal node") @@ -963,7 +963,7 @@ done: * Function: H5B2_cache_internal_size * * Purpose: Compute the size in bytes of a B-tree internal node - * on disk, and return it in *size_ptr. On failure, + * on disk, and return it in *size_ptr. On failure, * the value of *size_ptr is undefined. * * Return: Non-negative on success/Negative on failure diff --git a/src/H5B2private.h b/src/H5B2private.h index da67213..3be4413 100644 --- a/src/H5B2private.h +++ b/src/H5B2private.h @@ -44,7 +44,7 @@ #define H5B2_ITER_CONT (0) #define H5B2_ITER_STOP (1) - + /****************************/ /* Library Private Typedefs */ /****************************/ diff --git a/src/H5BP.c b/src/H5BP.c index 55d0095..758d1d6 100644 --- a/src/H5BP.c +++ b/src/H5BP.c @@ -229,7 +229,7 @@ done: if (bpt) (void)H5BP_cache_hdr_dest(f,bpt); } /* end if */ - + FUNC_LEAVE_NOAPI(ret_value) } /* end H5BP_create() */ @@ -443,7 +443,7 @@ HDfprintf(stderr,"%s: attempting to split root node\n",FUNC); HGOTO_ERROR(H5E_BTREE, H5E_UNSUPPORTED, FAIL, "Can't split root yet!") #endif /* LATER */ } /* end if */ - + /* Attempt to insert record into B+ tree */ if(bpt->depth>0) { #ifdef LATER diff --git a/src/H5BPcache.c b/src/H5BPcache.c index e511ae2..57e1677 100644 --- a/src/H5BPcache.c +++ b/src/H5BPcache.c @@ -328,7 +328,7 @@ H5BP_cache_hdr_clear(H5F_t *f, H5BP_t *bpt, hbool_t destroy) /* Reset the dirty flag. */ bpt->cache_info.is_dirty = FALSE; - + if (destroy) if (H5BP_cache_hdr_dest(f, bpt) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B+ tree header") @@ -342,7 +342,7 @@ done: * Function: H5BP_cache_hdr_size * * Purpose: Compute the size in bytes of a B+ tree header - * on disk, and return it in *size_ptr. On failure, + * on disk, and return it in *size_ptr. On failure, * the value of *size_ptr is undefined. * * Return: Non-negative on success/Negative on failure @@ -662,7 +662,7 @@ H5BP_cache_leaf_clear(H5F_t *f, H5BP_leaf_t *leaf, hbool_t destroy) /* Reset the dirty flag. */ leaf->cache_info.is_dirty = FALSE; - + if (destroy) if (H5BP_cache_leaf_dest(f, leaf) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B+ tree leaf node") @@ -676,7 +676,7 @@ done: * Function: H5BP_cache_leaf_size * * Purpose: Compute the size in bytes of a B+ tree leaf node - * on disk, and return it in *size_ptr. On failure, + * on disk, and return it in *size_ptr. On failure, * the value of *size_ptr is undefined. * * Return: Non-negative on success/Negative on failure diff --git a/src/H5BPprivate.h b/src/H5BPprivate.h index 88048ef..9921a73 100644 --- a/src/H5BPprivate.h +++ b/src/H5BPprivate.h @@ -37,7 +37,7 @@ /* Library Private Macros */ /**************************/ - + /****************************/ /* Library Private Typedefs */ /****************************/ diff --git a/src/H5BT.c b/src/H5BT.c index b0d9a09..84d13dc 100644 --- a/src/H5BT.c +++ b/src/H5BT.c @@ -121,7 +121,7 @@ done: if (bt) (void)H5BT_cache_dest(f,bt); } /* end if */ - + FUNC_LEAVE_NOAPI(ret_value) } /* end H5BT_create() */ @@ -445,7 +445,7 @@ done: /* Release the block tracker info */ if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BLTR, addr, bt, bt_flags) < 0) HDONE_ERROR(H5E_BLKTRK, H5E_CANTUNPROTECT, FAIL, "unable to release block tracker info") - + FUNC_LEAVE_NOAPI(ret_value) } /* end H5BT_insert() */ @@ -496,7 +496,7 @@ done: /* Release the block tracker info */ if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BLTR, addr, bt, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BLKTRK, H5E_CANTUNPROTECT, FAIL, "unable to release block tracker info") - + FUNC_LEAVE_NOAPI(ret_value) } /* end H5BT_get_total_size() */ @@ -706,7 +706,7 @@ done: /* Release the block tracker info */ if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BLTR, addr, bt, bt_flags) < 0) HDONE_ERROR(H5E_BLKTRK, H5E_CANTUNPROTECT, FAIL, "unable to release block tracker info") - + FUNC_LEAVE_NOAPI(ret_value) } /* end H5BT_remove() */ @@ -807,7 +807,7 @@ done: /* Release the block tracker info */ if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BLTR, addr, bt, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BLKTRK, H5E_CANTUNPROTECT, FAIL, "unable to release block tracker info") - + FUNC_LEAVE_NOAPI(ret_value) } /* end H5BT_locate() */ @@ -862,7 +862,7 @@ done: /* Release the block tracker info */ if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BLTR, addr, bt, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BLKTRK, H5E_CANTUNPROTECT, FAIL, "unable to release block tracker info") - + FUNC_LEAVE_NOAPI(ret_value) } /* end H5BT_iterate() */ @@ -955,7 +955,7 @@ done: /* Release the block tracker info */ if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BLTR, addr, bt, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BLKTRK, H5E_CANTUNPROTECT, FAIL, "unable to release block tracker info") - + FUNC_LEAVE_NOAPI(ret_value) } /* end H5BT_neighbor() */ @@ -1005,12 +1005,12 @@ H5BT_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) /* Release space for block tracker info on disk */ if (H5MF_xfree(f, H5FD_MEM_BLKTRK, dxpl_id, addr, (hsize_t)H5BT_SIZE(f))<0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free block tracker info") - + done: /* Release the block tracker info */ if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BLTR, addr, bt, H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG) < 0) HDONE_ERROR(H5E_BLKTRK, H5E_CANTUNPROTECT, FAIL, "unable to release block tracker info") - + FUNC_LEAVE_NOAPI(ret_value) } /* end H5BT_remove() */ diff --git a/src/H5BTcache.c b/src/H5BTcache.c index f5f6a4e..d579c05 100644 --- a/src/H5BTcache.c +++ b/src/H5BTcache.c @@ -289,7 +289,7 @@ H5BT_cache_clear(H5F_t *f, H5BT_t *bt, hbool_t destroy) /* Reset the dirty flag. */ bt->cache_info.is_dirty = FALSE; - + if (destroy) if (H5BT_cache_dest(f, bt) < 0) HGOTO_ERROR(H5E_BLKTRK, H5E_CANTFREE, FAIL, "unable to destroy block tracker info") @@ -303,7 +303,7 @@ done: * Function: H5BT_cache_size * * Purpose: Compute the size in bytes of a block tracker info - * on disk, and return it in *size_ptr. On failure, + * on disk, and return it in *size_ptr. On failure, * the value of *size_ptr is undefined. * * Return: Non-negative on success/Negative on failure diff --git a/src/H5BTprivate.h b/src/H5BTprivate.h index 3eab872..e7de549 100644 --- a/src/H5BTprivate.h +++ b/src/H5BTprivate.h @@ -45,7 +45,7 @@ #define H5BT_ITER_CONT H5B2_ITER_CONT #define H5BT_ITER_STOP H5B2_ITER_STOP - + /****************************/ /* Library Private Typedefs */ /****************************/ diff --git a/src/H5Bprivate.h b/src/H5Bprivate.h index b4b1a97..28494f7 100644 --- a/src/H5Bprivate.h +++ b/src/H5Bprivate.h @@ -47,7 +47,7 @@ #endif #define H5B_MAGIC "TREE" /*tree node magic number */ #define H5B_SIZEOF_MAGIC 4 /*size of magic number */ - + typedef enum H5B_ins_t { H5B_INS_ERROR = -1, /*error return value */ H5B_INS_NOOP = 0, /*insert made no changes */ @@ -103,7 +103,7 @@ typedef struct H5B_class_t { int (*cmp2)(H5F_t*, hid_t, void*, void*, void*); /*compare 2 keys */ int (*cmp3)(H5F_t*, hid_t, void*, void*, void*); /*compare 3 keys */ herr_t (*found)(H5F_t*, hid_t, haddr_t, const void*, void*); - + /* insert new data */ H5B_ins_t (*insert)(H5F_t*, hid_t, haddr_t, void*, hbool_t*, void*, void*, void*, hbool_t*, haddr_t*); @@ -111,7 +111,7 @@ typedef struct H5B_class_t { /* min insert uses min leaf, not new(), similarily for max insert */ hbool_t follow_min; hbool_t follow_max; - + /* remove existing data */ H5B_ins_t (*remove)(H5F_t*, hid_t, haddr_t, void*, hbool_t*, void*, void*, hbool_t*); diff --git a/src/H5C.c b/src/H5C.c index 0f13a65..afad50b 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -19,13 +19,13 @@ * John Mainzer * * Purpose: Functions in this file implement a generic cache for - * things which exist on disk, and which may be + * things which exist on disk, and which may be * unambiguously referenced by their disk addresses. * - * The code in this module was initially written in + * The code in this module was initially written in * support of a complete re-write of the metadata cache * in H5AC.c However, other uses for the cache code - * suggested themselves, and thus this file was created + * suggested themselves, and thus this file was created * in an attempt to support re-use. * * For a detailed overview of the cache, please see the @@ -43,9 +43,9 @@ * an overview. * * Some elements of the automatic cache resize code depend on - * the LRU list. Thus if we ever choose to support a new + * the LRU list. Thus if we ever choose to support a new * replacement policy, we will either have to disable those - * elements of the auto resize code when running the new + * elements of the auto resize code when running the new * policy, or modify them to make use of similar information * maintained by the new policy code. * @@ -69,7 +69,7 @@ * unprotect -- or some other way should be found to advise the * cache of changes in entry size. * - * - Flush entries in increasing address order in + * - Flush entries in increasing address order in * H5C_make_space_in_cache(). * * - Also in H5C_make_space_in_cache(), use high and low water marks @@ -87,7 +87,7 @@ * * Tests: * - * - Trim execution time. (This is no longer a major issue with the + * - Trim execution time. (This is no longer a major issue with the * shift from the TBBT to a hash table for indexing.) * * - Add random tests. @@ -113,11 +113,11 @@ /**************************************************************************** * - * We maintain doubly linked lists of instances of H5C_cache_entry_t for a - * variety of reasons -- protected list, LRU list, and the clean and dirty - * LRU lists at present. The following macros support linking and unlinking - * of instances of H5C_cache_entry_t by both their regular and auxilary next - * and previous pointers. + * We maintain doubly linked lists of instances of H5C_cache_entry_t for a + * variety of reasons -- protected list, LRU list, and the clean and dirty + * LRU lists at present. The following macros support linking and unlinking + * of instances of H5C_cache_entry_t by both their regular and auxilary next + * and previous pointers. * * The size and length fields are also maintained. * @@ -145,7 +145,7 @@ * size, but this would break the index_size = LRU_list_size + pl_size * invarient. * - * Alternatively, I could pass the current decr_mode in to the macro, + * Alternatively, I could pass the current decr_mode in to the macro, * and just skip the check whenever epoch markers may be in use. * * However, any size errors should be caught when the cache is flushed @@ -156,10 +156,10 @@ * * - In the H5C__DLL_PRE_INSERT_SC macro, replaced the lines: * - * ( ( (len) == 1 ) && + * ( ( (len) == 1 ) && * ( ( (head_ptr) != (tail_ptr) ) || ( (Size) <= 0 ) || - * ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) - * ) + * ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) + * ) * ) || * * with: @@ -167,7 +167,7 @@ * ( ( (len) == 1 ) && * ( ( (head_ptr) != (tail_ptr) ) || * ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) - * ) + * ) * ) || * * Epoch markers have size 0, so we can now have a non-empty list with @@ -185,7 +185,7 @@ * ) * ) || * - * with + * with * * ( ( (len) == 1 ) && * ( ( (head_ptr) != (tail_ptr) ) || @@ -199,7 +199,7 @@ * take on negative values, and thus the revised clause "( (Size) < 0 )" * caused compiler warnings. * JRM - 1/10/05 - * + * ****************************************************************************/ #if H5C_DO_SANITY_CHECKS @@ -495,7 +495,7 @@ if ( ( (entry_ptr) == NULL ) || \ * The following macros must handle stats collection when this collection * is enabled, and evaluate to the empty string when it is not. * - * The sole exception to this rule is + * The sole exception to this rule is * H5C__UPDATE_CACHE_HIT_RATE_STATS(), which is always active as * the cache hit rate stats are always collected and available. * @@ -529,7 +529,7 @@ if ( ( (entry_ptr) == NULL ) || \ if ( (cache_ptr)->slist_len > (cache_ptr)->max_slist_len ) \ (cache_ptr)->max_slist_len = (cache_ptr)->slist_len; \ if ( (cache_ptr)->slist_size > (cache_ptr)->max_slist_size ) \ - (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; + (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; #define H5C__UPDATE_STATS_FOR_RENAME(cache_ptr, entry_ptr) \ (((cache_ptr)->renames)[(entry_ptr)->type->id])++; @@ -614,16 +614,16 @@ if ( ( (entry_ptr) == NULL ) || \ #else /* H5C_COLLECT_CACHE_ENTRY_STATS */ -#define H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) +#define H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) #define H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) \ - (((cache_ptr)->clears)[(entry_ptr)->type->id])++; + (((cache_ptr)->clears)[(entry_ptr)->type->id])++; #define H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr) \ - (((cache_ptr)->flushes)[(entry_ptr)->type->id])++; + (((cache_ptr)->flushes)[(entry_ptr)->type->id])++; #define H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr) \ - (((cache_ptr)->evictions)[(entry_ptr)->type->id])++; + (((cache_ptr)->evictions)[(entry_ptr)->type->id])++; #define H5C__UPDATE_STATS_FOR_PROTECT(cache_ptr, entry_ptr, hit) \ if ( hit ) \ @@ -643,7 +643,7 @@ if ( ( (entry_ptr) == NULL ) || \ #else /* H5C_COLLECT_CACHE_STATS */ -#define H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) +#define H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) #define H5C__UPDATE_STATS_FOR_UNPROTECT(cache_ptr) #define H5C__UPDATE_STATS_FOR_RENAME(cache_ptr, entry_ptr) #define H5C__UPDATE_STATS_FOR_HT_INSERTION(cache_ptr) @@ -838,12 +838,12 @@ if ( ( (cache_ptr) == NULL ) || \ } \ } \ H5C__UPDATE_STATS_FOR_HT_SEARCH(cache_ptr, (entry_ptr != NULL), depth) \ -} +} /************************************************************************** * - * Skip list insertion and deletion macros: + * Skip list insertion and deletion macros: * * These used to be functions, but I converted them to macros to avoid some * function call overhead. @@ -854,7 +854,7 @@ if ( ( (cache_ptr) == NULL ) || \ * * Macro: H5C__INSERT_ENTRY_IN_SLIST * - * Purpose: Insert the specified instance of H5C_cache_entry_t into + * Purpose: Insert the specified instance of H5C_cache_entry_t into * the skip list in the specified instance of H5C_t. Update * the associated length and size fields. * @@ -866,8 +866,8 @@ if ( ( (cache_ptr) == NULL ) || \ * * JRM -- 7/21/04 * Updated function to set the in_tree flag when inserting - * an entry into the tree. Also modified the function to - * update the tree size and len fields instead of the similar + * an entry into the tree. Also modified the function to + * update the tree size and len fields instead of the similar * index fields. * * All of this is part of the modifications to support the @@ -875,7 +875,7 @@ if ( ( (cache_ptr) == NULL ) || \ * * JRM -- 7/27/04 * Converted the function H5C_insert_entry_in_tree() into - * the macro H5C__INSERT_ENTRY_IN_TREE in the hopes of + * the macro H5C__INSERT_ENTRY_IN_TREE in the hopes of * wringing a little more speed out of the cache. * * Note that we don't bother to check if the entry is already @@ -915,7 +915,7 @@ if ( ( (cache_ptr) == NULL ) || \ * * Function: H5C__REMOVE_ENTRY_FROM_SLIST * - * Purpose: Remove the specified instance of H5C_cache_entry_t from the + * Purpose: Remove the specified instance of H5C_cache_entry_t from the * index skip list in the specified instance of H5C_t. Update * the associated length and size fields. * @@ -965,7 +965,7 @@ if ( ( (cache_ptr) == NULL ) || \ /************************************************************************** * - * Replacement policy update macros: + * Replacement policy update macros: * * These used to be functions, but I converted them to macros to avoid some * function call overhead. @@ -976,10 +976,10 @@ if ( ( (cache_ptr) == NULL ) || \ * * Macro: H5C__UPDATE_RP_FOR_EVICTION * - * Purpose: Update the replacement policy data structures for an + * Purpose: Update the replacement policy data structures for an * eviction of the specified cache entry. * - * At present, we only support the modified LRU policy, so + * At present, we only support the modified LRU policy, so * this function deals with that case unconditionally. If * we ever support other replacement policies, the function * should switch on the current policy and act accordingly. @@ -1073,10 +1073,10 @@ if ( ( (cache_ptr) == NULL ) || \ * * Macro: H5C__UPDATE_RP_FOR_FLUSH * - * Purpose: Update the replacement policy data structures for a flush + * Purpose: Update the replacement policy data structures for a flush * of the specified cache entry. * - * At present, we only support the modified LRU policy, so + * At present, we only support the modified LRU policy, so * this function deals with that case unconditionally. If * we ever support other replacement policies, the function * should switch on the current policy and act accordingly. @@ -1193,7 +1193,7 @@ if ( ( (cache_ptr) == NULL ) || \ * Purpose: Update the replacement policy data structures for an * insertion of the specified cache entry. * - * At present, we only support the modified LRU policy, so + * At present, we only support the modified LRU policy, so * this function deals with that case unconditionally. If * we ever support other replacement policies, the function * should switch on the current policy and act accordingly. @@ -1288,14 +1288,14 @@ if ( ( (cache_ptr) == NULL ) || \ * * Macro: H5C__UPDATE_RP_FOR_PROTECT * - * Purpose: Update the replacement policy data structures for a + * Purpose: Update the replacement policy data structures for a * protect of the specified cache entry. * - * To do this, unlink the specified entry from any data + * To do this, unlink the specified entry from any data * structures used by the replacement policy, and add the * entry to the protected list. * - * At present, we only support the modified LRU policy, so + * At present, we only support the modified LRU policy, so * this function deals with that case unconditionally. If * we ever support other replacement policies, the function * should switch on the current policy and act accordingly. @@ -1409,10 +1409,10 @@ if ( ( (cache_ptr) == NULL ) || \ * * Macro: H5C__UPDATE_RP_FOR_RENAME * - * Purpose: Update the replacement policy data structures for a + * Purpose: Update the replacement policy data structures for a * rename of the specified cache entry. * - * At present, we only support the modified LRU policy, so + * At present, we only support the modified LRU policy, so * this function deals with that case unconditionally. If * we ever support other replacement policies, the function * should switch on the current policy and act accordingly. @@ -1438,7 +1438,7 @@ if ( ( (cache_ptr) == NULL ) || \ * at optimization. * * JRM - 6/23/05 - * Added the was_dirty parameter. It is possible that + * Added the was_dirty parameter. It is possible that * the entry was clean when it was renamed -- if so it * it is in the clean LRU regardless of the current * value of the is_dirty field. @@ -1554,7 +1554,7 @@ if ( ( (cache_ptr) == NULL ) || \ * list, and re-insert it in the data structures used by the * current replacement policy. * - * At present, we only support the modified LRU policy, so + * At present, we only support the modified LRU policy, so * this function deals with that case unconditionally. If * we ever support other replacement policies, the function * should switch on the current policy and act accordingly. @@ -1566,8 +1566,8 @@ if ( ( (cache_ptr) == NULL ) || \ * Modifications: * * JRM - 7/27/04 - * Converted the function H5C_update_rp_for_unprotect() to - * the macro H5C__UPDATE_RP_FOR_UNPROTECT in an effort to + * Converted the function H5C_update_rp_for_unprotect() to + * the macro H5C__UPDATE_RP_FOR_UNPROTECT in an effort to * squeeze a bit more performance out of the cache. * * At least for the first cut, I am leaving the comments and @@ -1779,10 +1779,10 @@ const H5C_class_t epoch_marker_class = ***************************************************************************/ static void * -H5C_epoch_marker_load(UNUSED H5F_t *f, - UNUSED hid_t dxpl_id, +H5C_epoch_marker_load(UNUSED H5F_t *f, + UNUSED hid_t dxpl_id, UNUSED haddr_t addr, - UNUSED const void *udata1, + UNUSED const void *udata1, UNUSED void *udata2) { void * ret_value = NULL; /* Return value */ @@ -1796,11 +1796,11 @@ done: FUNC_LEAVE_NOAPI(ret_value) } -static herr_t -H5C_epoch_marker_flush(UNUSED H5F_t *f, - UNUSED hid_t dxpl_id, +static herr_t +H5C_epoch_marker_flush(UNUSED H5F_t *f, + UNUSED hid_t dxpl_id, UNUSED hbool_t dest, - UNUSED haddr_t addr, + UNUSED haddr_t addr, UNUSED void *thing) { herr_t ret_value = FAIL; /* Return value */ @@ -1814,8 +1814,8 @@ done: FUNC_LEAVE_NOAPI(ret_value) } -static herr_t -H5C_epoch_marker_dest(UNUSED H5F_t *f, +static herr_t +H5C_epoch_marker_dest(UNUSED H5F_t *f, UNUSED void *thing) { herr_t ret_value = FAIL; /* Return value */ @@ -1829,9 +1829,9 @@ done: FUNC_LEAVE_NOAPI(ret_value) } -static herr_t -H5C_epoch_marker_clear(UNUSED H5F_t *f, - UNUSED void *thing, +static herr_t +H5C_epoch_marker_clear(UNUSED H5F_t *f, + UNUSED void *thing, UNUSED hbool_t dest) { herr_t ret_value = FAIL; /* Return value */ @@ -1845,9 +1845,9 @@ done: FUNC_LEAVE_NOAPI(ret_value) } -static herr_t -H5C_epoch_marker_size(UNUSED const H5F_t *f, - UNUSED const void *thing, +static herr_t +H5C_epoch_marker_size(UNUSED const H5F_t *f, + UNUSED const void *thing, UNUSED size_t *size_ptr) { herr_t ret_value = FAIL; /* Return value */ @@ -1865,16 +1865,16 @@ done: /*------------------------------------------------------------------------- * Function: H5C_create * - * Purpose: Allocate, initialize, and return the address of a new + * Purpose: Allocate, initialize, and return the address of a new * instance of H5C_t. * - * In general, the max_cache_size parameter must be positive, - * and the min_clean_size parameter must lie in the closed - * interval [0, max_cache_size]. + * In general, the max_cache_size parameter must be positive, + * and the min_clean_size parameter must lie in the closed + * interval [0, max_cache_size]. * * The check_write_permitted parameter must either be NULL, * or point to a function of type H5C_write_permitted_func_t. - * If it is NULL, the cache will presume that writes are + * If it is NULL, the cache will presume that writes are * always permitted. * * Return: Success: Pointer to the new instance. @@ -1891,7 +1891,7 @@ done: * * JRM -- 10/5/04 * Added call to H5C_reset_cache_hit_rate_stats(). Also - * added initialization for cache_is_full flag and for + * added initialization for cache_is_full flag and for * resize_ctl. * * JRM -- 11/12/04 @@ -1938,7 +1938,7 @@ H5C_create(size_t max_cache_size, "memory allocation failed") } - if ( (cache_ptr->slist_ptr = H5SL_create(H5SL_TYPE_HADDR,0.5,(size_t)16)) + if ( (cache_ptr->slist_ptr = H5SL_create(H5SL_TYPE_HADDR,0.5,(size_t)16)) == NULL ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, NULL, "can't create skip list.") @@ -2093,7 +2093,7 @@ done: * * This function should only be used where HDprintf() behaves * well -- i.e. not on Windows. - * + * * Return: void * * Programmer: John Mainzer @@ -2102,12 +2102,12 @@ done: * Modifications: * * JRM -- 11/22/04 - * Reworked function to adapt it to the addition of the + * Reworked function to adapt it to the addition of the * ageout method of cache size reduction. * *------------------------------------------------------------------------- */ -void +void H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, int32_t version, double hit_rate, @@ -2137,7 +2137,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, HDfprintf(stdout, "out of bounds low (%6.5lf).\n", (cache_ptr->resize_ctl).lower_hr_threshold); - HDfprintf(stdout, + HDfprintf(stdout, " cache size increased from (%Zu/%Zu) to (%Zu/%Zu).\n", old_max_cache_size, old_min_clean_size, @@ -2154,11 +2154,11 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, HDassert( hit_rate > (cache_ptr->resize_ctl).upper_hr_threshold ); - HDfprintf(stdout, + HDfprintf(stdout, "Auto cache resize -- decrease by threshold. "); - HDfprintf(stdout, "HR = %lf > %6.5lf\n", - hit_rate, + HDfprintf(stdout, "HR = %lf > %6.5lf\n", + hit_rate, (cache_ptr->resize_ctl).upper_hr_threshold); HDfprintf(stdout, "out of bounds high (%6.5lf).\n", @@ -2166,7 +2166,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, break; case H5C_decr__age_out: - HDfprintf(stdout, + HDfprintf(stdout, "Auto cache resize -- decrease by ageout. "); HDfprintf(stdout, "HR = %lf\n", hit_rate); break; @@ -2175,20 +2175,20 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, HDassert( hit_rate > (cache_ptr->resize_ctl).upper_hr_threshold ); - HDfprintf(stdout, + HDfprintf(stdout, "Auto cache resize -- decrease by ageout with "); HDfprintf(stdout, "threshold. HR = %lf > %6.5lf\n", - hit_rate, + hit_rate, (cache_ptr->resize_ctl).upper_hr_threshold); break; default: - HDfprintf(stdout, + HDfprintf(stdout, "Auto cache resize -- decrease by unknown mode."); HDfprintf(stdout, " HR = %lf\n", hit_rate); } - HDfprintf(stdout, + HDfprintf(stdout, " cache size decreased from (%Zu/%Zu) to (%Zu/%Zu).\n", old_max_cache_size, old_min_clean_size, @@ -2246,11 +2246,11 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, * This function fails if any object are protected since the * resulting file might not be consistent. * - * The primary_dxpl_id and secondary_dxpl_id parameters + * The primary_dxpl_id and secondary_dxpl_id parameters * specify the dxpl_ids used on the first write occasioned - * by the destroy (primary_dxpl_id), and on all subsequent - * writes (secondary_dxpl_id). This is useful in the metadata - * cache, but may not be needed elsewhere. If so, just use the + * by the destroy (primary_dxpl_id), and on all subsequent + * writes (secondary_dxpl_id). This is useful in the metadata + * cache, but may not be needed elsewhere. If so, just use the * same dxpl_id for both parameters. * * Note that *cache_ptr has been freed upon successful return. @@ -2267,9 +2267,9 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, *------------------------------------------------------------------------- */ herr_t -H5C_dest(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, +H5C_dest(H5F_t * f, + hid_t primary_dxpl_id, + hid_t secondary_dxpl_id, H5C_t * cache_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2280,7 +2280,7 @@ H5C_dest(H5F_t * f, HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); HDassert( cache_ptr->skip_file_checks || f ); - if ( H5C_flush_cache(f, primary_dxpl_id, secondary_dxpl_id, + if ( H5C_flush_cache(f, primary_dxpl_id, secondary_dxpl_id, cache_ptr, H5C__FLUSH_INVALIDATE_FLAG) < 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache") @@ -2332,8 +2332,8 @@ H5C_dest_empty(H5C_t * cache_ptr) /* This would normally be an assert, but we need to use an HGOTO_ERROR * call to shut up the compiler. */ - if ( ( ! cache_ptr ) || - ( cache_ptr->magic != H5C__H5C_T_MAGIC ) || + if ( ( ! cache_ptr ) || + ( cache_ptr->magic != H5C__H5C_T_MAGIC ) || ( cache_ptr->index_len != 0 ) ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ @@ -2364,18 +2364,18 @@ done: * specified cache. * * If the cache contains protected entries, the function will - * fail, as protected entries cannot be flushed. However - * all unprotected entries should be flushed before the + * fail, as protected entries cannot be flushed. However + * all unprotected entries should be flushed before the * function returns failure. * - * The primary_dxpl_id and secondary_dxpl_id parameters + * The primary_dxpl_id and secondary_dxpl_id parameters * specify the dxpl_ids used on the first write occasioned - * by the flush (primary_dxpl_id), and on all subsequent - * writes (secondary_dxpl_id). This is useful in the metadata - * cache, but may not be needed elsewhere. If so, just use the + * by the flush (primary_dxpl_id), and on all subsequent + * writes (secondary_dxpl_id). This is useful in the metadata + * cache, but may not be needed elsewhere. If so, just use the * same dxpl_id for both parameters. - * - * Return: Non-negative on success/Negative on failure or if there was + * + * Return: Non-negative on success/Negative on failure or if there was * a request to flush all items and something was protected. * * Programmer: John Mainzer @@ -2390,32 +2390,32 @@ done: * Added code to remove all epoch markers (if any) from the * LRU list before a destroy. Strictly speaking, this isn't * necessary, as the marker entries reside only in the LRU - * list, never in the index or in the tree. However, it + * list, never in the index or in the tree. However, it * never hurts to tidy up. * * JRM -- 1/6/05 - * Reworked code to support the new + * Reworked code to support the new * H5C__FLUSH_MARKED_ENTRIES_FLAG, and for the replacement of * H5F_FLUSH_INVALIDATE flag with H5C__FLUSH_INVALIDATE_FLAG. * * Note that the H5C__FLUSH_INVALIDATE_FLAG takes precidence * over the H5C__FLUSH_MARKED_ENTRIES_FLAG. Thus if both are - * set, the functions behaves as if just the + * set, the functions behaves as if just the * H5C__FLUSH_INVALIDATE_FLAG was set. * - * The H5C__FLUSH_CLEAR_ONLY_FLAG flag can co-exist with - * either the H5C__FLUSH_MARKED_ENTRIES_FLAG, or the + * The H5C__FLUSH_CLEAR_ONLY_FLAG flag can co-exist with + * either the H5C__FLUSH_MARKED_ENTRIES_FLAG, or the * H5C__FLUSH_INVALIDATE_FLAG. In all cases, it is simply * passed along to H5C_flush_single_entry(). In the case of - * H5C__FLUSH_MARKED_ENTRIES_FLAG, it will only apply to + * H5C__FLUSH_MARKED_ENTRIES_FLAG, it will only apply to * the marked entries. * *------------------------------------------------------------------------- */ herr_t -H5C_flush_cache(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, +H5C_flush_cache(H5F_t * f, + hid_t primary_dxpl_id, + hid_t secondary_dxpl_id, H5C_t * cache_ptr, unsigned flags) { @@ -2486,21 +2486,21 @@ H5C_flush_cache(H5F_t * f, if ( entry_ptr->is_protected ) { - /* we have major problems -- but lets flush everything + /* we have major problems -- but lets flush everything * we can before we flag an error. */ protected_entries++; - } else { + } else { - status = H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, + status = H5C_flush_single_entry(f, + primary_dxpl_id, + secondary_dxpl_id, cache_ptr, - NULL, - entry_ptr->addr, - flags, - &first_flush, + NULL, + entry_ptr->addr, + flags, + &first_flush, FALSE); if ( status < 0 ) { @@ -2549,7 +2549,7 @@ H5C_flush_cache(H5F_t * f, /* we have major problems -- but lets flush and destroy * everything we can before we flag an error. */ - + H5C__DELETE_FROM_INDEX(cache_ptr, entry_ptr) if ( !entry_ptr->in_slist ) { @@ -2562,14 +2562,14 @@ H5C_flush_cache(H5F_t * f, HDassert( !(entry_ptr->is_dirty) ); HDassert( !(entry_ptr->in_slist) ); - status = H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, + status = H5C_flush_single_entry(f, + primary_dxpl_id, + secondary_dxpl_id, cache_ptr, - NULL, - entry_ptr->addr, - flags, - &first_flush, + NULL, + entry_ptr->addr, + flags, + &first_flush, FALSE); if ( status < 0 ) { @@ -2587,10 +2587,10 @@ H5C_flush_cache(H5F_t * f, if ( protected_entries > 0 ) { - /* the caller asked us to flush and destroy a cache that + /* the caller asked us to flush and destroy a cache that * contains one or more protected entries. Since we can't * flush protected entries, we haven't destroyed them either. - * Since they are all on the protected list, just re-insert + * Since they are all on the protected list, just re-insert * them into the cache before we flag an error. */ entry_ptr = cache_ptr->pl_head_ptr; @@ -2627,7 +2627,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C_get_cache_auto_resize_config * - * Purpose: Copy the current configuration of the cache automatic + * Purpose: Copy the current configuration of the cache automatic * re-sizing function into the instance of H5C_auto_size_ctl_t * pointed to by config_ptr. * @@ -2644,7 +2644,7 @@ done: */ herr_t -H5C_get_cache_auto_resize_config(H5C_t * cache_ptr, +H5C_get_cache_auto_resize_config(H5C_t * cache_ptr, H5C_auto_size_ctl_t *config_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2676,10 +2676,10 @@ done: /*------------------------------------------------------------------------- * Function: H5C_get_cache_size * - * Purpose: Return the cache maximum size, the minimum clean size, the - * current size, and the current number of entries in + * Purpose: Return the cache maximum size, the minimum clean size, the + * current size, and the current number of entries in * *max_size_ptr, *min_clean_size_ptr, *cur_size_ptr, and - * *cur_num_entries_ptr respectively. If any of these + * *cur_num_entries_ptr respectively. If any of these * parameters are NULL, skip that value. * * Return: SUCCEED on success, and FAIL on failure. @@ -2695,7 +2695,7 @@ done: */ herr_t -H5C_get_cache_size(H5C_t * cache_ptr, +H5C_get_cache_size(H5C_t * cache_ptr, size_t * max_size_ptr, size_t * min_clean_size_ptr, size_t * cur_size_ptr, @@ -2740,10 +2740,10 @@ done: /*------------------------------------------------------------------------- * Function: H5C_get_cache_hit_rate * - * Purpose: Compute and return the current cache hit rate in - * *hit_rate_ptr. If there have been no accesses since the + * Purpose: Compute and return the current cache hit rate in + * *hit_rate_ptr. If there have been no accesses since the * last time the cache hit rate stats were reset, set - * *hit_rate_ptr to 0.0. On error, *hit_rate_ptr is + * *hit_rate_ptr to 0.0. On error, *hit_rate_ptr is * undefined. * * Return: SUCCEED on success, and FAIL on failure. @@ -2804,15 +2804,15 @@ done: * exist on disk yet, but it must have an address and disk * space reserved. * - * The primary_dxpl_id and secondary_dxpl_id parameters + * The primary_dxpl_id and secondary_dxpl_id parameters * specify the dxpl_ids used on the first write occasioned - * by the insertion (primary_dxpl_id), and on all subsequent - * writes (secondary_dxpl_id). This is useful in the - * metadata cache, but may not be needed elsewhere. If so, + * by the insertion (primary_dxpl_id), and on all subsequent + * writes (secondary_dxpl_id). This is useful in the + * metadata cache, but may not be needed elsewhere. If so, * just use the same dxpl_id for both parameters. * - * The primary_dxpl_id is the dxpl_id passed to the - * check_write_permitted function if such a function has been + * The primary_dxpl_id is the dxpl_id passed to the + * check_write_permitted function if such a function has been * provided. * * Observe that this function cannot occasion a read. @@ -2837,24 +2837,24 @@ done: * * JRM -- 1/6/05 * Added the flags parameter, and code supporting - * H5C__SET_FLUSH_MARKER_FLAG. Note that this flag is + * H5C__SET_FLUSH_MARKER_FLAG. Note that this flag is * ignored unless the new entry is dirty. * * JRM -- 6/6/05 * Added code to force all inserted entries to be dirty. - * This is part of a set of changes moving management of the + * This is part of a set of changes moving management of the * is_dirty field of H5C_cache_entry_t into the H5C code. * *------------------------------------------------------------------------- */ herr_t -H5C_insert_entry(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, +H5C_insert_entry(H5F_t * f, + hid_t primary_dxpl_id, + hid_t secondary_dxpl_id, H5C_t * cache_ptr, - const H5C_class_t * type, - haddr_t addr, + const H5C_class_t * type, + haddr_t addr, void * thing, unsigned int flags) { @@ -2893,7 +2893,7 @@ H5C_insert_entry(H5F_t * f, "Can't get size of thing") } - HDassert( entry_ptr->size < H5C_MAX_ENTRY_SIZE ); + HDassert( entry_ptr->size < H5C_MAX_ENTRY_SIZE ); entry_ptr->in_slist = FALSE; @@ -2901,12 +2901,12 @@ H5C_insert_entry(H5F_t * f, entry_ptr->ht_prev = NULL; entry_ptr->next = NULL; - entry_ptr->prev = NULL; + entry_ptr->prev = NULL; entry_ptr->aux_next = NULL; entry_ptr->aux_prev = NULL; - H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) + H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) if ((cache_ptr->index_size + entry_ptr->size) > cache_ptr->max_cache_size) { @@ -2916,8 +2916,8 @@ H5C_insert_entry(H5F_t * f, if ( cache_ptr->check_write_permitted != NULL ) { - result = (cache_ptr->check_write_permitted)(f, - primary_dxpl_id, + result = (cache_ptr->check_write_permitted)(f, + primary_dxpl_id, &write_permitted); if ( result < 0 ) { @@ -2936,13 +2936,13 @@ H5C_insert_entry(H5F_t * f, space_needed = cache_ptr->max_cache_size; } - /* Note that space_needed is just the amount of space that + /* Note that space_needed is just the amount of space that * needed to insert the new entry without exceeding the cache * size limit. The subsequent call to H5C_make_space_in_cache() * may evict the entries required to free more or less space * depending on conditions. It MAY be less if the cache is * currently undersized, or more if the cache is oversized. - * + * * The cache can exceed its maximum size limit via the following * mechanisms: * @@ -2952,20 +2952,20 @@ H5C_insert_entry(H5F_t * f, * Second, when writes are not permitted it is also possible * for the cache to grow without bound. * - * Finally, we usually don't check to see if the cache is - * oversized at the end of an unprotect. As a result, it is - * possible to have a vastly oversized cache with no protected + * Finally, we usually don't check to see if the cache is + * oversized at the end of an unprotect. As a result, it is + * possible to have a vastly oversized cache with no protected * entries as long as all the protects preceed the unprotects. * * Since items 1 and 2 are not changing any time soon, I see * no point in worrying about the third. */ - result = H5C_make_space_in_cache(f, - primary_dxpl_id, + result = H5C_make_space_in_cache(f, + primary_dxpl_id, secondary_dxpl_id, - cache_ptr, - space_needed, + cache_ptr, + space_needed, write_permitted, &first_flush); @@ -2997,7 +2997,7 @@ H5C_insert_entry(H5F_t * f, } /* we don't initialize the protected field until here as it is - * possible that the entry is already in the cache, and already + * possible that the entry is already in the cache, and already * protected. If it is, we don't want to make things worse by * marking it unprotected. */ @@ -3007,8 +3007,8 @@ H5C_insert_entry(H5F_t * f, H5C__INSERT_IN_INDEX(cache_ptr, entry_ptr, FAIL) /* New entries are presumed to be dirty, so this if statement is - * unnecessary. Rework it once the rest of the code changes are - * in and tested. -- JRM + * unnecessary. Rework it once the rest of the code changes are + * in and tested. -- JRM */ if ( entry_ptr->is_dirty ) { @@ -3051,7 +3051,7 @@ done: * JRM -- 6/6/05 * Updated function to force all renamed entries to be * dirty. This is part of a series of code modifications - * moving management of the is_dirty field of + * moving management of the is_dirty field of * H5C_cache_entry_t into the H5C code. * *------------------------------------------------------------------------- @@ -3059,7 +3059,7 @@ done: herr_t H5C_rename_entry(H5C_t * cache_ptr, - const H5C_class_t * type, + const H5C_class_t * type, haddr_t old_addr, haddr_t new_addr) { @@ -3091,7 +3091,7 @@ H5C_rename_entry(H5C_t * cache_ptr, H5C__SEARCH_INDEX(cache_ptr, new_addr, test_entry_ptr, FAIL) if ( test_entry_ptr != NULL ) { /* we are hosed */ - + if ( test_entry_ptr->type == type ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTRENAME, FAIL, \ @@ -3106,7 +3106,7 @@ H5C_rename_entry(H5C_t * cache_ptr, } /* If we get this far, we have work to do. Remove *entry_ptr from - * the hash table (and skip list if necessary), change its address to the + * the hash table (and skip list if necessary), change its address to the * new address, mark it as dirty (if it isn't already) and then re-insert. * * Update the replacement policy for a hit to avoid an eviction before @@ -3154,7 +3154,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C_protect * - * Purpose: If the target entry is not in the cache, load it. If + * Purpose: If the target entry is not in the cache, load it. If * necessary, attempt to evict one or more entries to keep * the cache within its maximum size. * @@ -3162,20 +3162,20 @@ done: * to the caller. The caller must call H5C_unprotect() when * finished with the entry. * - * While it is protected, the entry may not be either evicted - * or flushed -- nor may it be accessed by another call to + * While it is protected, the entry may not be either evicted + * or flushed -- nor may it be accessed by another call to * H5C_protect. Any attempt to do so will result in a failure. * - * The primary_dxpl_id and secondary_dxpl_id parameters + * The primary_dxpl_id and secondary_dxpl_id parameters * specify the dxpl_ids used on the first write occasioned - * by the insertion (primary_dxpl_id), and on all subsequent - * writes (secondary_dxpl_id). This is useful in the - * metadata cache, but may not be needed elsewhere. If so, + * by the insertion (primary_dxpl_id), and on all subsequent + * writes (secondary_dxpl_id). This is useful in the + * metadata cache, but may not be needed elsewhere. If so, * just use the same dxpl_id for both parameters. * * All reads are performed with the primary_dxpl_id. * - * Similarly, the primary_dxpl_id is passed to the + * Similarly, the primary_dxpl_id is passed to the * check_write_permitted function if it is called. * * Return: Success: Ptr to the desired entry @@ -3190,17 +3190,17 @@ done: * Updated for the addition of the hash table. * * JRM -- 10/28/04 - * Added code to set cache_full to TRUE whenever we try to + * Added code to set cache_full to TRUE whenever we try to * make space in the cache. * * JRM -- 11/12/04 - * Added code to call to H5C_make_space_in_cache() after the - * call to H5C__auto_adjust_cache_size() if that function + * Added code to call to H5C_make_space_in_cache() after the + * call to H5C__auto_adjust_cache_size() if that function * sets the size_decreased flag is TRUE. * * JRM -- 4/25/05 - * The size_decreased flag can also be set to TRUE in - * H5C_set_cache_auto_resize_config() if a new configuration + * The size_decreased flag can also be set to TRUE in + * H5C_set_cache_auto_resize_config() if a new configuration * forces an immediate reduction in cache size. Modified * the code to deal with this eventuallity. * @@ -3208,13 +3208,13 @@ done: */ void * -H5C_protect(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, +H5C_protect(H5F_t * f, + hid_t primary_dxpl_id, + hid_t secondary_dxpl_id, H5C_t * cache_ptr, - const H5C_class_t * type, + const H5C_class_t * type, haddr_t addr, - const void * udata1, + const void * udata1, void * udata2) { hbool_t hit = FALSE; @@ -3260,7 +3260,7 @@ H5C_protect(H5F_t * f, entry_ptr = (H5C_cache_entry_t *)thing; /* try to free up some space if necessay */ - if ( (cache_ptr->index_size + entry_ptr->size) > + if ( (cache_ptr->index_size + entry_ptr->size) > cache_ptr->max_cache_size ) { size_t space_needed; @@ -3269,8 +3269,8 @@ H5C_protect(H5F_t * f, if ( cache_ptr->check_write_permitted != NULL ) { - result = (cache_ptr->check_write_permitted)(f, - primary_dxpl_id, + result = (cache_ptr->check_write_permitted)(f, + primary_dxpl_id, &write_permitted); if ( result < 0 ) { @@ -3321,8 +3321,8 @@ H5C_protect(H5F_t * f, * no point in worrying about the third. */ - result = H5C_make_space_in_cache(f, primary_dxpl_id, - secondary_dxpl_id, cache_ptr, + result = H5C_make_space_in_cache(f, primary_dxpl_id, + secondary_dxpl_id, cache_ptr, space_needed, write_permitted, &first_flush); @@ -3333,7 +3333,7 @@ H5C_protect(H5F_t * f, } } - /* Insert the entry in the hash table. It can't be dirty yet, so + /* Insert the entry in the hash table. It can't be dirty yet, so * we don't even check to see if it should go in the skip list. */ H5C__INSERT_IN_INDEX(cache_ptr, entry_ptr, NULL) @@ -3375,8 +3375,8 @@ H5C_protect(H5F_t * f, if ( cache_ptr->check_write_permitted != NULL ) { - result = (cache_ptr->check_write_permitted)(f, - primary_dxpl_id, + result = (cache_ptr->check_write_permitted)(f, + primary_dxpl_id, &write_permitted); if ( result < 0 ) { @@ -3414,17 +3414,17 @@ H5C_protect(H5F_t * f, if ( cache_ptr->size_decreased ) { cache_ptr->size_decreased = FALSE; - + /* check to see if the cache is now oversized due to the cache - * size reduction. If it is, try to evict enough entries to + * size reduction. If it is, try to evict enough entries to * bring the cache size down to the current maximum cache size. */ if ( cache_ptr->index_size > cache_ptr->max_cache_size ) { cache_ptr->cache_full = TRUE; - result = H5C_make_space_in_cache(f, primary_dxpl_id, - secondary_dxpl_id, cache_ptr, + result = H5C_make_space_in_cache(f, primary_dxpl_id, + secondary_dxpl_id, cache_ptr, (size_t)0, write_permitted, &first_flush); @@ -3486,7 +3486,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C_set_cache_auto_resize_config * - * Purpose: Set the cache automatic resize configuration to the + * Purpose: Set the cache automatic resize configuration to the * provided values if they are in range, and fail if they * are not. * @@ -3503,8 +3503,8 @@ done: * Modifications: * * JRM -- 11/18/04 - * Reworked function to match major changes in - * H5C_auto_size_ctl_t. + * Reworked function to match major changes in + * H5C_auto_size_ctl_t. * * JRM -- 4/25/05 * Added code to set cache_ptr->size_decreased to TRUE @@ -3515,7 +3515,7 @@ done: */ herr_t -H5C_set_cache_auto_resize_config(H5C_t * cache_ptr, +H5C_set_cache_auto_resize_config(H5C_t * cache_ptr, H5C_auto_size_ctl_t *config_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -3588,7 +3588,7 @@ H5C_set_cache_auto_resize_config(H5C_t * cache_ptr, ( config_ptr->max_increment <= 0 ) ) ) { cache_ptr->size_increase_possible = FALSE; - } + } break; default: /* should be unreachable */ @@ -3647,18 +3647,18 @@ H5C_set_cache_auto_resize_config(H5C_t * cache_ptr, cache_ptr->resize_ctl = *config_ptr; - /* Resize the cache to the supplied initial value if requested, or as - * necessary to force it within the bounds of the current automatic + /* Resize the cache to the supplied initial value if requested, or as + * necessary to force it within the bounds of the current automatic * cache resizing configuration. * - * Note that the min_clean_fraction may have changed, so we + * Note that the min_clean_fraction may have changed, so we * go through the exercise even if the current size is within * range and an initial size has not been provided. */ if ( (cache_ptr->resize_ctl).set_initial_size ) { - + new_max_cache_size = (cache_ptr->resize_ctl).initial_size; - } + } else if ( cache_ptr->max_cache_size > (cache_ptr->resize_ctl).max_size ) { new_max_cache_size = (cache_ptr->resize_ctl).max_size; @@ -3740,9 +3740,9 @@ done: * Function: H5C_set_skip_flags * * Purpose: Set the values of the skip sanity check flags. - * + * * This function and the skip sanity check flags were created - * for the convenience of the test bed. However it is + * for the convenience of the test bed. However it is * possible that there may be other uses for the flags. * * Return: Non-negative on success/Negative on failure @@ -3834,8 +3834,8 @@ H5C_stats(H5C_t * cache_ptr, /* This would normally be an assert, but we need to use an HGOTO_ERROR * call to shut up the compiler. */ - if ( ( ! cache_ptr ) || - ( cache_ptr->magic != H5C__H5C_T_MAGIC ) || + if ( ( ! cache_ptr ) || + ( cache_ptr->magic != H5C__H5C_T_MAGIC ) || ( !cache_name ) ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad cache_ptr or cache_name") @@ -3858,7 +3858,7 @@ H5C_stats(H5C_t * cache_ptr, if ( aggregate_min_accesses > aggregate_max_accesses ) aggregate_min_accesses = aggregate_max_accesses; if ( aggregate_min_accesses > cache_ptr->min_accesses[i] ) - aggregate_min_accesses = cache_ptr->min_accesses[i]; + aggregate_min_accesses = cache_ptr->min_accesses[i]; if ( aggregate_max_clears < cache_ptr->max_clears[i] ) aggregate_max_clears = cache_ptr->max_clears[i]; if ( aggregate_max_flushes < cache_ptr->max_flushes[i] ) @@ -3878,54 +3878,54 @@ H5C_stats(H5C_t * cache_ptr, if ( cache_ptr->successful_ht_searches > 0 ) { - average_successful_search_depth = + average_successful_search_depth = ((double)(cache_ptr->total_successful_ht_search_depth)) / ((double)(cache_ptr->successful_ht_searches)); } if ( cache_ptr->failed_ht_searches > 0 ) { - average_failed_search_depth = + average_failed_search_depth = ((double)(cache_ptr->total_failed_ht_search_depth)) / ((double)(cache_ptr->failed_ht_searches)); } - + HDfprintf(stdout, "\nH5C: cache statistics for %s\n", cache_name); HDfprintf(stdout, "\n"); - HDfprintf(stdout, + HDfprintf(stdout, " hash table insertion / deletions = %ld / %ld\n", (long)(cache_ptr->total_ht_insertions), (long)(cache_ptr->total_ht_deletions)); - HDfprintf(stdout, + HDfprintf(stdout, " HT successful / failed searches = %ld / %ld\n", (long)(cache_ptr->successful_ht_searches), (long)(cache_ptr->failed_ht_searches)); - HDfprintf(stdout, + HDfprintf(stdout, " Av. HT suc / failed search depth = %f / %f\n", average_successful_search_depth, average_failed_search_depth); - HDfprintf(stdout, + HDfprintf(stdout, " current (max) index size / length = %ld (%ld) / %ld (%ld)\n", (long)(cache_ptr->index_size), (long)(cache_ptr->max_index_size), (long)(cache_ptr->index_len), (long)(cache_ptr->max_index_len)); - HDfprintf(stdout, + HDfprintf(stdout, " current (max) slist size / length = %ld (%ld) / %ld (%ld)\n", (long)(cache_ptr->slist_size), (long)(cache_ptr->max_slist_size), (long)(cache_ptr->slist_len), (long)(cache_ptr->max_slist_len)); - HDfprintf(stdout, + HDfprintf(stdout, " current (max) PL size / length = %ld (%ld) / %ld (%ld)\n", (long)(cache_ptr->pl_size), (long)(cache_ptr->max_pl_size), @@ -3947,13 +3947,13 @@ H5C_stats(H5C_t * cache_ptr, (long)(cache_ptr->dLRU_list_size), (long)(cache_ptr->dLRU_list_len)); - HDfprintf(stdout, + HDfprintf(stdout, " Total hits / misses / hit_rate = %ld / %ld / %f\n", - (long)total_hits, - (long)total_misses, + (long)total_hits, + (long)total_misses, hit_rate); - HDfprintf(stdout, + HDfprintf(stdout, " Total clears / flushes / evictions = %ld / %ld / %ld\n", (long)total_clears, (long)total_flushes, @@ -3986,7 +3986,7 @@ H5C_stats(H5C_t * cache_ptr, HDfprintf(stdout, "\n"); - HDfprintf(stdout, " Stats on %s:\n", + HDfprintf(stdout, " Stats on %s:\n", ((cache_ptr->type_name_table_ptr))[i]); if ( ( cache_ptr->hits[i] > 0 ) || ( cache_ptr->misses[i] > 0 ) ) { @@ -3997,36 +3997,36 @@ H5C_stats(H5C_t * cache_ptr, hit_rate = 0.0; } - HDfprintf(stdout, - " hits / misses / hit_rate = %ld / %ld / %f\n", + HDfprintf(stdout, + " hits / misses / hit_rate = %ld / %ld / %f\n", (long)(cache_ptr->hits[i]), (long)(cache_ptr->misses[i]), hit_rate); - HDfprintf(stdout, + HDfprintf(stdout, " clears / flushes / evictions = %ld / %ld / %ld\n", (long)(cache_ptr->clears[i]), (long)(cache_ptr->flushes[i]), (long)(cache_ptr->evictions[i])); - HDfprintf(stdout, + HDfprintf(stdout, " insertions / renames = %ld / %ld\n", (long)(cache_ptr->insertions[i]), (long)(cache_ptr->renames[i])); #if H5C_COLLECT_CACHE_ENTRY_STATS - HDfprintf(stdout, + HDfprintf(stdout, " entry max / min accesses = %d / %d\n", cache_ptr->max_accesses[i], cache_ptr->min_accesses[i]); - HDfprintf(stdout, + HDfprintf(stdout, " entry max_clears / max_flushes = %d / %d\n", cache_ptr->max_clears[i], cache_ptr->max_flushes[i]); - HDfprintf(stdout, + HDfprintf(stdout, " entry max_size = %d\n", (int)(cache_ptr->max_size[i])); @@ -4107,7 +4107,7 @@ H5C_stats__reset(H5C_t * cache_ptr) for ( i = 0; i <= cache_ptr->max_type_id; i++ ) { cache_ptr->max_accesses[i] = 0; - cache_ptr->min_accesses[i] = 1000000; + cache_ptr->min_accesses[i] = 1000000; cache_ptr->max_clears[i] = 0; cache_ptr->max_flushes[i] = 0; cache_ptr->max_size[i] = (size_t)0; @@ -4129,17 +4129,17 @@ H5C_stats__reset(H5C_t * cache_ptr) * and give it back to the replacement policy. * * The TYPE and ADDR arguments must be the same as those in - * the corresponding call to H5C_protect() and the THING - * argument must be the value returned by that call to + * the corresponding call to H5C_protect() and the THING + * argument must be the value returned by that call to * H5C_protect(). * - * The primary_dxpl_id and secondary_dxpl_id parameters + * The primary_dxpl_id and secondary_dxpl_id parameters * specify the dxpl_ids used on the first write occasioned - * by the unprotect (primary_dxpl_id), and on all subsequent - * writes (secondary_dxpl_id). Since an uprotect cannot - * occasion a write at present, all this is moot for now. - * However, things change, and in any case, - * H5C_flush_single_entry() needs primary_dxpl_id and + * by the unprotect (primary_dxpl_id), and on all subsequent + * writes (secondary_dxpl_id). Since an uprotect cannot + * occasion a write at present, all this is moot for now. + * However, things change, and in any case, + * H5C_flush_single_entry() needs primary_dxpl_id and * secondary_dxpl_id in its parameter list. * * The function can't cause a read either, so the dxpl_id @@ -4148,7 +4148,7 @@ H5C_stats__reset(H5C_t * cache_ptr) * Return: Non-negative on success/Negative on failure * * If the deleted flag is TRUE, simply remove the target entry - * from the cache, clear it, and free it without writing it to + * from the cache, clear it, and free it without writing it to * disk. * * Return: Non-negative on success/Negative on failure @@ -4165,27 +4165,27 @@ H5C_stats__reset(H5C_t * cache_ptr) * * JRM -- 1/6/05 * Added the flags parameter, and code supporting - * H5C__SET_FLUSH_MARKER_FLAG. Note that this flag is - * ignored unless the new entry is dirty. Also note that - * once the flush_marker field of an entry is set, the + * H5C__SET_FLUSH_MARKER_FLAG. Note that this flag is + * ignored unless the new entry is dirty. Also note that + * once the flush_marker field of an entry is set, the * only way it can be reset is by being flushed. * * JRM -- 6/3/05 - * Added the dirtied parameter and supporting code. This + * Added the dirtied parameter and supporting code. This * is part of an effort to move management of the is_dirty - * field into the cache code. This has become necessary + * field into the cache code. This has become necessary * to repair a cache coherency bug in PHDF5. * *------------------------------------------------------------------------- */ herr_t -H5C_unprotect(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, +H5C_unprotect(H5F_t * f, + hid_t primary_dxpl_id, + hid_t secondary_dxpl_id, H5C_t * cache_ptr, - const H5C_class_t * type, + const H5C_class_t * type, haddr_t addr, - void * thing, + void * thing, unsigned int flags) { hbool_t deleted; @@ -4224,7 +4224,7 @@ H5C_unprotect(H5F_t * f, H5C__UPDATE_RP_FOR_UNPROTECT(cache_ptr, entry_ptr, FAIL) - entry_ptr->is_protected = FALSE; + entry_ptr->is_protected = FALSE; /* if the entry is dirty, or its flush_marker with the set flush flag, * and then add it to the skip list if it isn't there already. @@ -4243,17 +4243,17 @@ H5C_unprotect(H5F_t * f, /* this implementation of the "deleted" option is a bit inefficient, as * we re-insert the entry to be deleted into the replacement policy * data structures, only to remove them again. Depending on how often - * we do this, we may want to optimize a bit. + * we do this, we may want to optimize a bit. * - * On the other hand, this implementation is reasonably clean, and + * On the other hand, this implementation is reasonably clean, and * makes good use of existing code. * JRM - 5/19/04 */ if ( deleted ) { /* the following first flush flag will never be used as we are - * calling H5C_flush_single_entry with both the - * H5C__FLUSH_CLEAR_ONLY_FLAG and H5C__FLUSH_INVALIDATE_FLAG flags. + * calling H5C_flush_single_entry with both the + * H5C__FLUSH_CLEAR_ONLY_FLAG and H5C__FLUSH_INVALIDATE_FLAG flags. * However, it is needed for the function call. */ hbool_t dummy_first_flush = TRUE; @@ -4273,15 +4273,15 @@ H5C_unprotect(H5F_t * f, "hash table contains multiple entries for addr?!?.") } - if ( H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, + if ( H5C_flush_single_entry(f, + primary_dxpl_id, + secondary_dxpl_id, cache_ptr, - type, - addr, - (H5C__FLUSH_CLEAR_ONLY_FLAG | + type, + addr, + (H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__FLUSH_INVALIDATE_FLAG), - &dummy_first_flush, + &dummy_first_flush, TRUE) < 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Can't flush.") @@ -4300,7 +4300,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C_validate_resize_config() * - * Purpose: Run a sanity check on the specified sections of the + * Purpose: Run a sanity check on the specified sections of the * provided instance of struct H5C_auto_size_ctl_t. * * Do nothing and return SUCCEED if no errors are detected, @@ -4339,7 +4339,7 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, if ( (tests & H5C_RESIZE_CFG__VALIDATE_GENERAL) != 0 ) { - if ( ( config_ptr->set_initial_size != TRUE ) && + if ( ( config_ptr->set_initial_size != TRUE ) && ( config_ptr->set_initial_size != FALSE ) ) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ @@ -4362,14 +4362,14 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, } if ( ( config_ptr->set_initial_size ) && - ( ( config_ptr->initial_size < config_ptr->min_size ) || + ( ( config_ptr->initial_size < config_ptr->min_size ) || ( config_ptr->initial_size > config_ptr->max_size ) ) ) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ "initial_size must be in the interval [min_size, max_size]"); } - if ( ( config_ptr->min_clean_fraction < 0.0 ) || + if ( ( config_ptr->min_clean_fraction < 0.0 ) || ( config_ptr->min_clean_fraction > 1.0 ) ) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ @@ -4397,8 +4397,8 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, } if ( config_ptr->incr_mode == H5C_incr__threshold ) { - - if ( ( config_ptr->lower_hr_threshold < 0.0 ) || + + if ( ( config_ptr->lower_hr_threshold < 0.0 ) || ( config_ptr->lower_hr_threshold > 1.0 ) ) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ @@ -4445,7 +4445,7 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, "upper_hr_threshold must be <= 1.0"); } - if ( ( config_ptr->decrement > 1.0 ) || + if ( ( config_ptr->decrement > 1.0 ) || ( config_ptr->decrement < 0.0 ) ) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ @@ -4481,7 +4481,7 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, } if ( ( config_ptr->apply_empty_reserve ) && - ( ( config_ptr->empty_reserve > 1.0 ) || + ( ( config_ptr->empty_reserve > 1.0 ) || ( config_ptr->empty_reserve < 0.0 ) ) ) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ @@ -4495,12 +4495,12 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, if ( config_ptr->decr_mode == H5C_decr__age_out_with_threshold ) { - if ( ( config_ptr->upper_hr_threshold > 1.0 ) || + if ( ( config_ptr->upper_hr_threshold > 1.0 ) || ( config_ptr->upper_hr_threshold < 0.0 ) ) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ "upper_hr_threshold must be in the interval [0.0, 1.0]"); - } + } } /* H5C_decr__age_out_with_threshold */ } /* H5C_RESIZE_CFG__VALIDATE_DECREMENT */ @@ -4515,9 +4515,9 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, ( config_ptr->decr_mode == H5C_decr__age_out_with_threshold ) ) && - ( config_ptr->lower_hr_threshold - >= - config_ptr->upper_hr_threshold + ( config_ptr->lower_hr_threshold + >= + config_ptr->upper_hr_threshold ) ) { @@ -4541,15 +4541,15 @@ done: * * Function: H5C__auto_adjust_cache_size * - * Purpose: Obtain the current full cache hit rate, and compare it - * with the hit rate thresholds for modifying cache size. - * If one of the thresholds has been crossed, adjusts the + * Purpose: Obtain the current full cache hit rate, and compare it + * with the hit rate thresholds for modifying cache size. + * If one of the thresholds has been crossed, adjusts the * size of the cache accordingly. * - * The function then resets the full cache hit rate + * The function then resets the full cache hit rate * statistics, and exits. * - * Return: Non-negative on success/Negative on failure or if there was + * Return: Non-negative on success/Negative on failure or if there was * an attempt to flush a protected item. * * @@ -4559,7 +4559,7 @@ done: * * JRM -- 11/18/04 * Major re-write to support ageout method of cache size - * reduction, and to adjust to changes in the + * reduction, and to adjust to changes in the * H5C_auto_size_ctl_t structure. * *------------------------------------------------------------------------- @@ -4587,7 +4587,7 @@ H5C__auto_adjust_cache_size(H5C_t * cache_ptr, HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - HDassert( cache_ptr->cache_accesses >= + HDassert( cache_ptr->cache_accesses >= (cache_ptr->resize_ctl).epoch_length ); HDassert( 0.0 <= (cache_ptr->resize_ctl).min_clean_fraction ); HDassert( (cache_ptr->resize_ctl).min_clean_fraction <= 100.0 ); @@ -4623,8 +4623,8 @@ H5C__auto_adjust_cache_size(H5C_t * cache_ptr, if ( ! cache_ptr->size_increase_possible ) { status = increase_disabled; - - } else if ( cache_ptr->max_cache_size >= + + } else if ( cache_ptr->max_cache_size >= (cache_ptr->resize_ctl).max_size ) { HDassert( cache_ptr->max_cache_size == \ @@ -4642,7 +4642,7 @@ H5C__auto_adjust_cache_size(H5C_t * cache_ptr, (cache_ptr->resize_ctl).increment); /* clip to max size if necessary */ - if ( new_max_cache_size > + if ( new_max_cache_size > (cache_ptr->resize_ctl).max_size ) { new_max_cache_size = (cache_ptr->resize_ctl).max_size; @@ -4650,7 +4650,7 @@ H5C__auto_adjust_cache_size(H5C_t * cache_ptr, /* clip to max increment if necessary */ if ( ( (cache_ptr->resize_ctl).apply_max_increment ) && - ( (cache_ptr->max_cache_size + + ( (cache_ptr->max_cache_size + (cache_ptr->resize_ctl).max_increment) < new_max_cache_size ) ) { @@ -4667,28 +4667,28 @@ H5C__auto_adjust_cache_size(H5C_t * cache_ptr, HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unknown incr_mode.") } - /* If the decr_mode is either age out or age out with threshold, we + /* If the decr_mode is either age out or age out with threshold, we * must run the marker maintenance code, whether we run the size - * reduction code or not. We do this in two places -- here we + * reduction code or not. We do this in two places -- here we * insert a new marker if the number of active epoch markers is * is less than the the current epochs before eviction, and after * the ageout call, we cycle the markers. * * However, we can't call the ageout code or cycle the markers - * unless there was a full complement of markers in place on + * unless there was a full complement of markers in place on * entry. The inserted_epoch_marker flag is used to track this. */ - if ( ( ( (cache_ptr->resize_ctl).decr_mode == H5C_decr__age_out ) + if ( ( ( (cache_ptr->resize_ctl).decr_mode == H5C_decr__age_out ) || - ( (cache_ptr->resize_ctl).decr_mode == + ( (cache_ptr->resize_ctl).decr_mode == H5C_decr__age_out_with_threshold ) ) && - ( cache_ptr->epoch_markers_active < - (cache_ptr->resize_ctl).epochs_before_eviction - ) + ( cache_ptr->epoch_markers_active < + (cache_ptr->resize_ctl).epochs_before_eviction + ) ) { result = H5C__autoadjust__ageout__insert_new_marker(cache_ptr); @@ -4722,8 +4722,8 @@ H5C__auto_adjust_cache_size(H5C_t * cache_ptr, if ( ! cache_ptr->size_decrease_possible ) { status = decrease_disabled; - - } else if ( cache_ptr->max_cache_size <= + + } else if ( cache_ptr->max_cache_size <= (cache_ptr->resize_ctl).min_size ) { HDassert( cache_ptr->max_cache_size == @@ -4737,20 +4737,20 @@ H5C__auto_adjust_cache_size(H5C_t * cache_ptr, (cache_ptr->resize_ctl).decrement); /* clip to min size if necessary */ - if ( new_max_cache_size < + if ( new_max_cache_size < (cache_ptr->resize_ctl).min_size ) { - new_max_cache_size = + new_max_cache_size = (cache_ptr->resize_ctl).min_size; } /* clip to max decrement if necessary */ if ( ( (cache_ptr->resize_ctl).apply_max_decrement ) && ( ((cache_ptr->resize_ctl).max_decrement + - new_max_cache_size) < + new_max_cache_size) < cache_ptr->max_cache_size ) ) { - new_max_cache_size = cache_ptr->max_cache_size - + new_max_cache_size = cache_ptr->max_cache_size - (cache_ptr->resize_ctl).max_decrement; } @@ -4794,9 +4794,9 @@ H5C__auto_adjust_cache_size(H5C_t * cache_ptr, } /* cycle the epoch markers here if appropriate */ - if ( ( ( (cache_ptr->resize_ctl).decr_mode == H5C_decr__age_out ) + if ( ( ( (cache_ptr->resize_ctl).decr_mode == H5C_decr__age_out ) || - ( (cache_ptr->resize_ctl).decr_mode == + ( (cache_ptr->resize_ctl).decr_mode == H5C_decr__age_out_with_threshold ) ) @@ -4820,7 +4820,7 @@ H5C__auto_adjust_cache_size(H5C_t * cache_ptr, old_min_clean_size = cache_ptr->min_clean_size; new_min_clean_size = (size_t) - ((double)new_max_cache_size * + ((double)new_max_cache_size * ((cache_ptr->resize_ctl).min_clean_fraction)); /* new_min_clean_size is of size_t, and thus must be non-negative. @@ -4878,11 +4878,11 @@ done: * * Function: H5C__autoadjust__ageout * - * Purpose: Implement the ageout automatic cache size decrement + * Purpose: Implement the ageout automatic cache size decrement * algorithm. Note that while this code evicts aged out * entries, the code does not change the maximum cache size. * Instead, the function simply computes the new value (if - * any change is indicated) and reports this value in + * any change is indicated) and reports this value in * *new_max_cache_size_ptr. * * Return: Non-negative on success/Negative on failure or if there was @@ -4933,10 +4933,10 @@ H5C__autoadjust__ageout(H5C_t * cache_ptr, } } - if ( ( (cache_ptr->resize_ctl).decr_mode == H5C_decr__age_out ) + if ( ( (cache_ptr->resize_ctl).decr_mode == H5C_decr__age_out ) || - ( ( (cache_ptr->resize_ctl).decr_mode == - H5C_decr__age_out_with_threshold + ( ( (cache_ptr->resize_ctl).decr_mode == + H5C_decr__age_out_with_threshold ) && ( hit_rate >= (cache_ptr->resize_ctl).upper_hr_threshold ) @@ -4987,17 +4987,17 @@ H5C__autoadjust__ageout(H5C_t * cache_ptr, if ( *new_max_cache_size_ptr < (cache_ptr->resize_ctl).min_size ) { - *new_max_cache_size_ptr = + *new_max_cache_size_ptr = (cache_ptr->resize_ctl).min_size; } /* clip to max decrement if necessary */ if ( ( (cache_ptr->resize_ctl).apply_max_decrement ) && ( ((cache_ptr->resize_ctl).max_decrement + - *new_max_cache_size_ptr) < + *new_max_cache_size_ptr) < cache_ptr->max_cache_size ) ) { - *new_max_cache_size_ptr = cache_ptr->max_cache_size - + *new_max_cache_size_ptr = cache_ptr->max_cache_size - (cache_ptr->resize_ctl).max_decrement; } } @@ -5047,7 +5047,7 @@ H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t * cache_ptr) HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - if ( cache_ptr->epoch_markers_active <= 0 ) { + if ( cache_ptr->epoch_markers_active <= 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ "No active epoch markers on entry?!?!?.") @@ -5057,8 +5057,8 @@ H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t * cache_ptr) i = cache_ptr->epoch_marker_ringbuf[cache_ptr->epoch_marker_ringbuf_first]; - cache_ptr->epoch_marker_ringbuf_first = - (cache_ptr->epoch_marker_ringbuf_first + 1) % + cache_ptr->epoch_marker_ringbuf_first = + (cache_ptr->epoch_marker_ringbuf_first + 1) % (H5C__MAX_EPOCH_MARKERS + 1); cache_ptr->epoch_marker_ringbuf_size -= 1; @@ -5082,14 +5082,14 @@ H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t * cache_ptr) /* now, re-insert it at the head of the LRU list, and at the tail of * the ring buffer. - */ + */ HDassert( ((cache_ptr->epoch_markers)[i]).addr == (haddr_t)i ); HDassert( ((cache_ptr->epoch_markers)[i]).next == NULL ); HDassert( ((cache_ptr->epoch_markers)[i]).prev == NULL ); - cache_ptr->epoch_marker_ringbuf_last = - (cache_ptr->epoch_marker_ringbuf_last + 1) % + cache_ptr->epoch_marker_ringbuf_last = + (cache_ptr->epoch_marker_ringbuf_last + 1) % (H5C__MAX_EPOCH_MARKERS + 1); (cache_ptr->epoch_marker_ringbuf)[cache_ptr->epoch_marker_ringbuf_last] = i; @@ -5119,26 +5119,26 @@ done: * Function: H5C__autoadjust__ageout__evict_aged_out_entries * * Purpose: Evict clean entries in the cache that haven't - * been accessed for at least + * been accessed for at least * (cache_ptr->resize_ctl).epochs_before_eviction epochs, * and flush dirty entries that haven't been accessed for * that amount of time. * - * Depending on configuration, the function will either + * Depending on configuration, the function will either * flush or evict all such entries, or all such entries it * encounters until it has freed the maximum amount of space * allowed under the maximum decrement. * * If we are running in parallel mode, writes may not be - * permitted. If so, the function simply skips any dirty + * permitted. If so, the function simply skips any dirty * entries it may encounter. * - * The function makes no attempt to maintain the minimum + * The function makes no attempt to maintain the minimum * clean size, as there is no guarantee that the cache size - * will be changed. + * will be changed. * - * If there is no cache size change, the minimum clean size - * constraint will be met through a combination of clean + * If there is no cache size change, the minimum clean size + * constraint will be met through a combination of clean * entries and free space in the cache. * * If there is a cache size reduction, the minimum clean size @@ -5146,13 +5146,13 @@ done: * we have to make space in the cache. * * The primary_dxpl_id and secondary_dxpl_id parameters - * specify the dxpl_ids used depending on the value of + * specify the dxpl_ids used depending on the value of * *first_flush_ptr. The idea is to use the primary_dxpl_id * on the first write in a sequence of writes, and to use * the secondary_dxpl_id on all subsequent writes. * - * This is useful in the metadata cache, but may not be - * needed elsewhere. If so, just use the same dxpl_id for + * This is useful in the metadata cache, but may not be + * needed elsewhere. If so, just use the same dxpl_id for * both parameters. * * Observe that this function cannot occasion a read. @@ -5189,7 +5189,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); /* if there is a limit on the amount that the cache size can be decrease - * in any one round of the cache size reduction algorithm, load that + * in any one round of the cache size reduction algorithm, load that * limit into eviction_size_limit. Otherwise, set eviction_size_limit * to the equivalent of infinity. The current size of the index will * do nicely. @@ -5252,7 +5252,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, } /* end while */ /* for now at least, don't bother to maintain the minimum clean size, - * as the cache should now be less than its maximum size. Due to + * as the cache should now be less than its maximum size. Due to * the vaguries of the cache size reduction algorthim, we may not * reduce the size of the cache. * @@ -5261,7 +5261,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, * * If we don't, no action is necessary, as we have just evicted and/or * or flushed a bunch of entries and therefore the sum of the clean - * and free space in the cache must be greater than or equal to the + * and free space in the cache must be greater than or equal to the * min clean space requirement (assuming that requirement was met on * entry). */ @@ -5269,16 +5269,16 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, } else /* ! write_permitted */ { /* since we are not allowed to write, all we can do is evict - * any clean entries that we may encounter before we either + * any clean entries that we may encounter before we either * hit the eviction size limit, or encounter the epoch marker. * * If we are operating read only, this isn't an issue, as there * will not be any dirty entries. * - * If we are operating in R/W mode, all the dirty entries we + * If we are operating in R/W mode, all the dirty entries we * skip will be flushed the next time we attempt to make space - * when writes are permitted. This may have some local - * performance implications, but it shouldn't cause any net + * when writes are permitted. This may have some local + * performance implications, but it shouldn't cause any net * slowdown. */ @@ -5312,7 +5312,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, "unable to flush clean entry") } } - /* just skip the entry if it is dirty, as we can't do + /* just skip the entry if it is dirty, as we can't do * anything with it now since we can't write. */ @@ -5337,8 +5337,8 @@ done: * * Function: H5C__autoadjust__ageout__insert_new_marker * - * Purpose: Find an unused marker cache entry, mark it as used, and - * insert it at the head of the LRU list. Also add the + * Purpose: Find an unused marker cache entry, mark it as used, and + * insert it at the head of the LRU list. Also add the * marker's index in the epoch_markers array. * * Return: SUCCEED on success/FAIL on failure. @@ -5372,8 +5372,8 @@ H5C__autoadjust__ageout__insert_new_marker(H5C_t * cache_ptr) /* find an unused marker */ i = 0; - while ( ( (cache_ptr->epoch_marker_active)[i] ) && - ( i < H5C__MAX_EPOCH_MARKERS ) ) + while ( ( (cache_ptr->epoch_marker_active)[i] ) && + ( i < H5C__MAX_EPOCH_MARKERS ) ) { i++; } @@ -5391,8 +5391,8 @@ H5C__autoadjust__ageout__insert_new_marker(H5C_t * cache_ptr) (cache_ptr->epoch_marker_active)[i] = TRUE; - cache_ptr->epoch_marker_ringbuf_last = - (cache_ptr->epoch_marker_ringbuf_last + 1) % + cache_ptr->epoch_marker_ringbuf_last = + (cache_ptr->epoch_marker_ringbuf_last + 1) % (H5C__MAX_EPOCH_MARKERS + 1); (cache_ptr->epoch_marker_ringbuf)[cache_ptr->epoch_marker_ringbuf_last] = i; @@ -5424,7 +5424,7 @@ done: * * Function: H5C__autoadjust__ageout__remove_all_markers * - * Purpose: Remove all epoch markers from the LRU list and mark them + * Purpose: Remove all epoch markers from the LRU list and mark them * as inactive. * * Return: SUCCEED on success/FAIL on failure. @@ -5452,15 +5452,15 @@ H5C__autoadjust__ageout__remove_all_markers(H5C_t * cache_ptr) while ( cache_ptr->epoch_markers_active > 0 ) { - /* get the index of the last epoch marker in the LRU list + /* get the index of the last epoch marker in the LRU list * and remove it from the ring buffer. */ ring_buf_index = cache_ptr->epoch_marker_ringbuf_first; i = (cache_ptr->epoch_marker_ringbuf)[ring_buf_index]; - cache_ptr->epoch_marker_ringbuf_first = - (cache_ptr->epoch_marker_ringbuf_first + 1) % + cache_ptr->epoch_marker_ringbuf_first = + (cache_ptr->epoch_marker_ringbuf_first + 1) % (H5C__MAX_EPOCH_MARKERS + 1); cache_ptr->epoch_marker_ringbuf_size -= 1; @@ -5508,9 +5508,9 @@ done: * * Function: H5C__autoadjust__ageout__remove_excess_markers * - * Purpose: Remove epoch markers from the end of the LRU list and + * Purpose: Remove epoch markers from the end of the LRU list and * mark them as inactive until the number of active markers - * equals the the current value of + * equals the the current value of * (cache_ptr->resize_ctl).epochs_before_eviction. * * Return: SUCCEED on success/FAIL on failure. @@ -5542,18 +5542,18 @@ H5C__autoadjust__ageout__remove_excess_markers(H5C_t * cache_ptr) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "no excess markers on entry.") } - while ( cache_ptr->epoch_markers_active > + while ( cache_ptr->epoch_markers_active > (cache_ptr->resize_ctl).epochs_before_eviction ) { - /* get the index of the last epoch marker in the LRU list + /* get the index of the last epoch marker in the LRU list * and remove it from the ring buffer. */ ring_buf_index = cache_ptr->epoch_marker_ringbuf_first; i = (cache_ptr->epoch_marker_ringbuf)[ring_buf_index]; - cache_ptr->epoch_marker_ringbuf_first = - (cache_ptr->epoch_marker_ringbuf_first + 1) % + cache_ptr->epoch_marker_ringbuf_first = + (cache_ptr->epoch_marker_ringbuf_first + 1) % (H5C__MAX_EPOCH_MARKERS + 1); cache_ptr->epoch_marker_ringbuf_size -= 1; @@ -5601,24 +5601,24 @@ done: * * Function: H5C_flush_single_entry * - * Purpose: Flush or clear (and evict if requested) the cache entry + * Purpose: Flush or clear (and evict if requested) the cache entry * with the specified address and type. If the type is NULL, - * any unprotected entry at the specified address will be + * any unprotected entry at the specified address will be * flushed (and possibly evicted). * - * Attempts to flush a protected entry will result in an + * Attempts to flush a protected entry will result in an * error. * - * *first_flush_ptr should be true if only one + * *first_flush_ptr should be true if only one * flush is contemplated before the next load, or if this - * is the first of a sequence of flushes that will be + * is the first of a sequence of flushes that will be * completed before the next load. *first_flush_ptr is set - * to false if a flush actually takes place, and should be + * to false if a flush actually takes place, and should be * left false until the end of the sequence. * * The primary_dxpl_id is used if *first_flush_ptr is TRUE - * on entry, and a flush actually takes place. The - * secondary_dxpl_id is used in any subsequent flush where + * on entry, and a flush actually takes place. The + * secondary_dxpl_id is used in any subsequent flush where * *first_flush_ptr is FALSE on entry. * * If the H5C__FLUSH_INVALIDATE_FLAG flag is set, the entry will @@ -5626,17 +5626,17 @@ done: * primary_dxpl_id, and secondary_dxpl_id are all irrelevent, * and the call can't be part of a sequence of flushes. * - * If the caller knows the address of the TBBT node at - * which the target entry resides, it can avoid a lookup + * If the caller knows the address of the TBBT node at + * which the target entry resides, it can avoid a lookup * by supplying that address in the tgt_node_ptr parameter. * If this parameter is NULL, the function will do a TBBT * search for the entry instead. * * The function does nothing silently if there is no entry - * at the supplied address, or if the entry found has the + * at the supplied address, or if the entry found has the * wrong type. * - * Return: Non-negative on success/Negative on failure or if there was + * Return: Non-negative on success/Negative on failure or if there was * an attempt to flush a protected item. * * Programmer: John Mainzer, 5/5/04 @@ -5652,19 +5652,19 @@ done: * JRM -- 1/6/05 * Updated function to reset the flush_marker field. * Also replace references to H5F_FLUSH_INVALIDATE and - * H5F_FLUSH_CLEAR_ONLY with references to + * H5F_FLUSH_CLEAR_ONLY with references to * H5C__FLUSH_INVALIDATE_FLAG and H5C__FLUSH_CLEAR_ONLY_FLAG * respectively. * *------------------------------------------------------------------------- */ static herr_t -H5C_flush_single_entry(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, +H5C_flush_single_entry(H5F_t * f, + hid_t primary_dxpl_id, + hid_t secondary_dxpl_id, H5C_t * cache_ptr, - const H5C_class_t * type_ptr, - haddr_t addr, + const H5C_class_t * type_ptr, + haddr_t addr, unsigned flags, hbool_t * first_flush_ptr, hbool_t del_entry_from_slist_on_destroy) @@ -5684,7 +5684,7 @@ H5C_flush_single_entry(H5F_t * f, HDassert( first_flush_ptr ); destroy = ( (flags & H5C__FLUSH_INVALIDATE_FLAG) != 0 ); - clear_only = ( (flags & H5C__FLUSH_CLEAR_ONLY_FLAG) != 0); + clear_only = ( (flags & H5C__FLUSH_CLEAR_ONLY_FLAG) != 0); /* attempt to find the target entry in the hash table */ H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, FAIL) @@ -5702,7 +5702,7 @@ H5C_flush_single_entry(H5F_t * f, } } else { - if ( ( entry_ptr->is_dirty ) || + if ( ( entry_ptr->is_dirty ) || ( entry_ptr->flush_marker ) || ( entry_ptr->addr != addr ) ) { @@ -5711,12 +5711,12 @@ H5C_flush_single_entry(H5F_t * f, } } } -#if 0 +#if 0 /* this should be useful for debugging from time to time. * lets leave it in for now. -- JRM 12/15/04 */ else { - HDfprintf(stdout, + HDfprintf(stdout, "H5C_flush_single_entry(): non-existant entry. addr = %a\n", addr); HDfflush(stdout); @@ -5737,12 +5737,12 @@ H5C_flush_single_entry(H5F_t * f, { /* we have work to do */ -#ifdef H5_HAVE_PARALLEL +#ifdef H5_HAVE_PARALLEL #ifndef NDEBUG /* If MPI based VFD is used, do special parallel I/O sanity checks. * Note that we only do these sanity checks when the clear_only flag - * is not set, and the entry to be flushed is dirty. Don't bother + * is not set, and the entry to be flushed is dirty. Don't bother * otherwise as no file I/O can result. * * There are also cases (testing for instance) where it is convenient @@ -5750,9 +5750,9 @@ H5C_flush_single_entry(H5F_t * f, * this isn't a problem -- but we do have to turn off sanity checks * involving them. We use cache_ptr->skip_dxpl_id_checks to do this. */ - if ( ( ! cache_ptr->skip_dxpl_id_checks ) && - ( ! clear_only ) && - ( entry_ptr->is_dirty ) && + if ( ( ! cache_ptr->skip_dxpl_id_checks ) && + ( ! clear_only ) && + ( entry_ptr->is_dirty ) && ( IS_H5FD_MPI(f) ) ) { H5P_genplist_t *dxpl; /* Dataset transfer property list */ @@ -5791,19 +5791,19 @@ H5C_flush_single_entry(H5F_t * f, H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr) } - /* Always remove the entry from the hash table on a destroy. On a - * flush with destroy, it is cheaper to discard the skip list all at - * once rather than remove the entries one by one, so we only delete + /* Always remove the entry from the hash table on a destroy. On a + * flush with destroy, it is cheaper to discard the skip list all at + * once rather than remove the entries one by one, so we only delete * from the list if requested. * - * We must do deletions now as the callback routines will free the + * We must do deletions now as the callback routines will free the * entry if destroy is true. */ if ( destroy ) { H5C__DELETE_FROM_INDEX(cache_ptr, entry_ptr) - if ( ( entry_ptr->in_slist ) && + if ( ( entry_ptr->in_slist ) && ( del_entry_from_slist_on_destroy ) ) { H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr) @@ -5811,7 +5811,7 @@ H5C_flush_single_entry(H5F_t * f, } /* Update the replacement policy for the flush or eviction. - * Again, do this now so we don't have to reference freed + * Again, do this now so we don't have to reference freed * memory in the destroy case. */ if ( destroy ) { /* AKA eviction */ @@ -5837,21 +5837,21 @@ H5C_flush_single_entry(H5F_t * f, HDfprintf(stdout, "cache_ptr->dLRU_list_size < entry_ptr->size.\n"); - if ( ( (cache_ptr->dLRU_list_size) == entry_ptr->size ) && + if ( ( (cache_ptr->dLRU_list_size) == entry_ptr->size ) && ( ! ( (cache_ptr->dLRU_list_len) == 1 ) ) ) HDfprintf(stdout, "dLRU_list_size == size && dLRU_list_len != 1\n"); - if ( ( entry_ptr->aux_prev == NULL ) && + if ( ( entry_ptr->aux_prev == NULL ) && ( cache_ptr->dLRU_head_ptr != entry_ptr ) ) HDfprintf(stdout, "entry_ptr->aux_prev == NULL && dLRU_head_ptr != entry_ptr\n"); - if ( ( entry_ptr->aux_next == NULL ) && + if ( ( entry_ptr->aux_next == NULL ) && ( cache_ptr->dLRU_tail_ptr != entry_ptr ) ) HDfprintf(stdout, "entry_ptr->aux_next == NULL && dLRU_tail_ptr != entry_ptr\n"); if ( ( cache_ptr->dLRU_list_len == 1 ) && - ( ! ( ( cache_ptr->dLRU_head_ptr == entry_ptr ) && + ( ! ( ( cache_ptr->dLRU_head_ptr == entry_ptr ) && ( cache_ptr->dLRU_tail_ptr == entry_ptr ) && ( entry_ptr->aux_next == NULL ) && ( entry_ptr->aux_prev == NULL ) && @@ -5863,8 +5863,8 @@ H5C_flush_single_entry(H5F_t * f, HDfprintf(stdout, "single entry dlru sanity check fails\n"); } - } - else + } + else { if ( cache_ptr->cLRU_head_ptr == NULL ) HDfprintf(stdout,"cache_ptr->cLRU_head_ptr == NULL.\n"); @@ -5882,21 +5882,21 @@ H5C_flush_single_entry(H5F_t * f, HDfprintf(stdout, "cache_ptr->cLRU_list_size < entry_ptr->size.\n"); - if ( ( (cache_ptr->cLRU_list_size) == entry_ptr->size ) && + if ( ( (cache_ptr->cLRU_list_size) == entry_ptr->size ) && ( ! ( (cache_ptr->cLRU_list_len) == 1 ) ) ) HDfprintf(stdout, "cLRU_list_size == size && cLRU_list_len != 1\n"); - if ( ( entry_ptr->aux_prev == NULL ) && + if ( ( entry_ptr->aux_prev == NULL ) && ( cache_ptr->cLRU_head_ptr != entry_ptr ) ) HDfprintf(stdout, "entry_ptr->aux_prev == NULL && cLRU_head_ptr != entry_ptr\n"); - if ( ( entry_ptr->aux_next == NULL ) && + if ( ( entry_ptr->aux_next == NULL ) && ( cache_ptr->cLRU_tail_ptr != entry_ptr ) ) HDfprintf(stdout, "entry_ptr->aux_next == NULL && cLRU_tail_ptr != entry_ptr\n"); if ( ( cache_ptr->cLRU_list_len == 1 ) && - ( ! ( ( cache_ptr->cLRU_head_ptr == entry_ptr ) && + ( ! ( ( cache_ptr->cLRU_head_ptr == entry_ptr ) && ( cache_ptr->cLRU_tail_ptr == entry_ptr ) && ( entry_ptr->aux_next == NULL ) && ( entry_ptr->aux_prev == NULL ) && @@ -5928,19 +5928,19 @@ H5C_flush_single_entry(H5F_t * f, } } else { - /* Only block for all the processes on the first piece of metadata + /* Only block for all the processes on the first piece of metadata */ if ( *first_flush_ptr && entry_ptr->is_dirty ) { - status = (entry_ptr->type->flush)(f, primary_dxpl_id, destroy, + status = (entry_ptr->type->flush)(f, primary_dxpl_id, destroy, entry_ptr->addr, entry_ptr); *first_flush_ptr = FALSE; } else { - status = (entry_ptr->type->flush)(f, secondary_dxpl_id, - destroy, entry_ptr->addr, + status = (entry_ptr->type->flush)(f, secondary_dxpl_id, + destroy, entry_ptr->addr, entry_ptr); } @@ -5952,7 +5952,7 @@ H5C_flush_single_entry(H5F_t * f, } if ( ! destroy ) { - + HDassert( !(entry_ptr->is_dirty) ); HDassert( !(entry_ptr->flush_marker) ); } @@ -5974,7 +5974,7 @@ done: * return the in memory address of the entry. Return NULL * on failure. * - * Note that this function simply loads the entry into + * Note that this function simply loads the entry into * core. It does not insert it into the cache. * * Return: Non-NULL on success / NULL on failure. @@ -5990,11 +5990,11 @@ done: */ static void * -H5C_load_entry(H5F_t * f, - hid_t dxpl_id, - const H5C_class_t * type, +H5C_load_entry(H5F_t * f, + hid_t dxpl_id, + const H5C_class_t * type, haddr_t addr, - const void * udata1, + const void * udata1, void * udata2, hbool_t skip_file_checks) { @@ -6031,7 +6031,7 @@ H5C_load_entry(H5F_t * f, "Can't get size of thing") } - HDassert( entry_ptr->size < H5C_MAX_ENTRY_SIZE ); + HDassert( entry_ptr->size < H5C_MAX_ENTRY_SIZE ); entry_ptr->ht_next = NULL; entry_ptr->ht_prev = NULL; @@ -6060,24 +6060,24 @@ done: * Purpose: Attempt to evict cache entries until the index_size * is at least needed_space below max_cache_size. * - * In passing, also attempt to bring cLRU_list_size to a + * In passing, also attempt to bring cLRU_list_size to a * value greater than min_clean_size. * * Depending on circumstances, both of these goals may * be impossible, as in parallel mode, we must avoid generating * a write as part of a read (to avoid deadlock in collective * I/O), and in all cases, it is possible (though hopefully - * highly unlikely) that the protected list may exceed the + * highly unlikely) that the protected list may exceed the * maximum size of the cache. - * + * * Thus the function simply does its best, returning success * unless an error is encountered. * - * The primary_dxpl_id and secondary_dxpl_id parameters + * The primary_dxpl_id and secondary_dxpl_id parameters * specify the dxpl_ids used on the first write occasioned - * by the call (primary_dxpl_id), and on all subsequent - * writes (secondary_dxpl_id). This is useful in the metadata - * cache, but may not be needed elsewhere. If so, just use the + * by the call (primary_dxpl_id), and on all subsequent + * writes (secondary_dxpl_id). This is useful in the metadata + * cache, but may not be needed elsewhere. If so, just use the * same dxpl_id for both parameters. * * Observe that this function cannot occasion a read. @@ -6093,7 +6093,7 @@ done: * table to facilitate lookups. * * JRM -- 11/22/04 - * Added the first_flush_ptr parameter, which replaces the + * Added the first_flush_ptr parameter, which replaces the * old first_flush local variable. This allows the function * to coordinate on the first flush issue with other functions. * @@ -6131,8 +6131,8 @@ H5C_make_space_in_cache(H5F_t * f, initial_list_len = cache_ptr->LRU_list_len; entry_ptr = cache_ptr->LRU_tail_ptr; - while ( ( (cache_ptr->index_size + space_needed) - > + while ( ( (cache_ptr->index_size + space_needed) + > cache_ptr->max_cache_size ) && @@ -6149,25 +6149,25 @@ H5C_make_space_in_cache(H5F_t * f, if ( entry_ptr->is_dirty ) { - result = H5C_flush_single_entry(f, - primary_dxpl_id, + result = H5C_flush_single_entry(f, + primary_dxpl_id, secondary_dxpl_id, cache_ptr, - entry_ptr->type, - entry_ptr->addr, - H5C__NO_FLAGS_SET, - first_flush_ptr, + entry_ptr->type, + entry_ptr->addr, + H5C__NO_FLAGS_SET, + first_flush_ptr, FALSE); } else { - result = H5C_flush_single_entry(f, - primary_dxpl_id, + result = H5C_flush_single_entry(f, + primary_dxpl_id, secondary_dxpl_id, cache_ptr, - entry_ptr->type, - entry_ptr->addr, + entry_ptr->type, + entry_ptr->addr, H5C__FLUSH_INVALIDATE_FLAG, - first_flush_ptr, + first_flush_ptr, TRUE); } } else { @@ -6203,14 +6203,14 @@ H5C_make_space_in_cache(H5F_t * f, prev_ptr = entry_ptr->aux_prev; - result = H5C_flush_single_entry(f, - primary_dxpl_id, + result = H5C_flush_single_entry(f, + primary_dxpl_id, secondary_dxpl_id, cache_ptr, - entry_ptr->type, - entry_ptr->addr, - H5C__NO_FLAGS_SET, - first_flush_ptr, + entry_ptr->type, + entry_ptr->addr, + H5C__NO_FLAGS_SET, + first_flush_ptr, FALSE); if ( result < 0 ) { @@ -6231,12 +6231,12 @@ H5C_make_space_in_cache(H5F_t * f, initial_list_len = cache_ptr->cLRU_list_len; entry_ptr = cache_ptr->cLRU_tail_ptr; - while ( ( (cache_ptr->index_size + space_needed) - > + while ( ( (cache_ptr->index_size + space_needed) + > cache_ptr->max_cache_size ) && - ( entries_examined <= initial_list_len ) + ( entries_examined <= initial_list_len ) && ( entry_ptr != NULL ) ) @@ -6246,14 +6246,14 @@ H5C_make_space_in_cache(H5F_t * f, prev_ptr = entry_ptr->aux_prev; - result = H5C_flush_single_entry(f, - primary_dxpl_id, + result = H5C_flush_single_entry(f, + primary_dxpl_id, secondary_dxpl_id, cache_ptr, - entry_ptr->type, - entry_ptr->addr, + entry_ptr->type, + entry_ptr->addr, H5C__FLUSH_INVALIDATE_FLAG, - first_flush_ptr, + first_flush_ptr, TRUE); if ( result < 0 ) { diff --git a/src/H5CS.c b/src/H5CS.c index 58817b8..63928dd 100644 --- a/src/H5CS.c +++ b/src/H5CS.c @@ -16,7 +16,7 @@ * Purpose: Provides internal function tracing in the form of a stack. * The FUNC_ENTER() macro adds the function name to the function * stack whenever a function is entered. - * As the functions return with FUNC_LEAVE, + * As the functions return with FUNC_LEAVE, * entries are removed from the stack. * * A function stack has a fixed maximum size. If this size is @@ -112,10 +112,10 @@ H5FS_print(FILE *stream) H5FS_t *fstack = H5FS_get_my_stack (); /* Get the correct function stack */ const int indent = 2; /* Indention level */ int i; /* Local index ariable */ - + /* Don't push this function on the function stack... :-) */ FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5FS_print); - + /* Sanity check */ assert(fstack); @@ -136,7 +136,7 @@ H5FS_print(FILE *stream) for (i=fstack->nused-1; i>=0; --i) HDfprintf(stream, "%*s#%03d: Routine: %s\n", indent, "", i, fstack->slot[i]); - + FUNC_LEAVE_NOAPI_NOFS(SUCCEED); } /* end H5FS_print() */ @@ -160,7 +160,7 @@ herr_t H5FS_push(const char *func_name) { H5FS_t *fstack = H5FS_get_my_stack (); - + /* Don't push this function on the function stack... :-) */ FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5FS_push); @@ -174,7 +174,7 @@ H5FS_push(const char *func_name) if (fstack->nusedslot[fstack->nused] = func_name; fstack->nused++; - + FUNC_LEAVE_NOAPI_NOFS(SUCCEED); } /* end H5FS_push() */ @@ -197,7 +197,7 @@ herr_t H5FS_pop(void) { H5FS_t *fstack = H5FS_get_my_stack (); - + /* Don't push this function on the function stack... :-) */ FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5FS_pop); @@ -207,7 +207,7 @@ H5FS_pop(void) /* Pop the function. */ fstack->nused--; - + FUNC_LEAVE_NOAPI_NOFS(SUCCEED); } /* end H5FS_pop() */ diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index 2ab2e9b..54a8f48 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -16,14 +16,14 @@ * Programmer: John Mainzer -- 10/12/04 * * Purpose: This file contains declarations which are normally visible - * only within the H5C package (just H5C.c at present). + * only within the H5C package (just H5C.c at present). * - * Source files outside the H5C package should include + * Source files outside the H5C package should include * H5Cprivate.h instead. * * The one exception to this rule is test/cache.c. The test - * code is easier to write if it can look at the cache's - * internal data structures. Indeed, this is the main + * code is easier to write if it can look at the cache's + * internal data structures. Indeed, this is the main * reason why this file was created. */ @@ -50,27 +50,27 @@ * * structure H5C_t * - * Catchall structure for all variables specific to an instance of the cache. + * Catchall structure for all variables specific to an instance of the cache. * - * While the individual fields of the structure are discussed below, the + * While the individual fields of the structure are discussed below, the * following overview may be helpful. * * Entries in the cache are stored in an instance of H5TB_TREE, indexed on - * the entry's disk address. While the H5TB_TREE is less efficient than + * the entry's disk address. While the H5TB_TREE is less efficient than * hash table, it keeps the entries in address sorted order. As flushes - * in parallel mode are more efficient if they are issued in increasing + * in parallel mode are more efficient if they are issued in increasing * address order, this is a significant benefit. Also the H5TB_TREE code * was readily available, which reduced development time. * * While the cache was designed with multiple replacement policies in mind, - * at present only a modified form of LRU is supported. + * at present only a modified form of LRU is supported. * * JRM - 4/26/04 * * Profiling has indicated that searches in the instance of H5TB_TREE are - * too expensive. To deal with this issue, I have augmented the cache - * with a hash table in which all entries will be stored. Given the - * advantages of flushing entries in increasing address order, the TBBT + * too expensive. To deal with this issue, I have augmented the cache + * with a hash table in which all entries will be stored. Given the + * advantages of flushing entries in increasing address order, the TBBT * is retained, but only dirty entries are stored in it. At least for * now, we will leave entries in the TBBT after they are flushed. * @@ -83,12 +83,12 @@ * field is used to validate pointers to instances of H5C_t. * * max_type_id: Integer field containing the maximum type id number assigned - * to a type of entry in the cache. All type ids from 0 to - * max_type_id inclusive must be defined. The names of the + * to a type of entry in the cache. All type ids from 0 to + * max_type_id inclusive must be defined. The names of the * types are stored in the type_name_table discussed below, and * indexed by the ids. * - * type_name_table_ptr: Pointer to an array of pointer to char of length + * type_name_table_ptr: Pointer to an array of pointer to char of length * max_type_id + 1. The strings pointed to by the entries * in the array are the names of the entry types associated * with the indexing type IDs. @@ -103,11 +103,11 @@ * max_cache_size, it will do so. The cache will attempt * to reduce its size as entries are unprotected. * - * b) When running in parallel mode, the cache may not be - * permitted to flush a dirty entry in response to a read. - * If there are no clean entries available to evict, the - * cache will exceed its maximum size. Again the cache - * will attempt to reduce its size to the max_cache_size + * b) When running in parallel mode, the cache may not be + * permitted to flush a dirty entry in response to a read. + * If there are no clean entries available to evict, the + * cache will exceed its maximum size. Again the cache + * will attempt to reduce its size to the max_cache_size * limit on the next cache write. * * min_clean_size: Nominal minimum number of clean bytes in the cache. @@ -116,11 +116,11 @@ * a soft limit. * * - * In addition to the call back functions required for each entry, the + * In addition to the call back functions required for each entry, the * cache requires the following call back functions for this instance of * the cache as a whole: - * - * check_write_permitted: In certain applications, the cache may not + * + * check_write_permitted: In certain applications, the cache may not * be allowed to write to disk at certain time. If specified, * the check_write_permitted function is used to determine if * a write is permissible at any given point in time. @@ -132,7 +132,7 @@ * The cache requires an index to facilitate searching for entries. The * following fields support that index. * - * index_len: Number of entries currently in the hash table used to index + * index_len: Number of entries currently in the hash table used to index * the cache. * * index_size: Number of bytes of cache entries currently stored in the @@ -146,16 +146,16 @@ * * index: Array of pointer to H5C_cache_entry_t of size * H5C__HASH_TABLE_LEN. At present, this value is a power - * of two, not the usual prime number. + * of two, not the usual prime number. * - * I hope that the variable size of cache elements, the large + * I hope that the variable size of cache elements, the large * hash table size, and the way in which HDF5 allocates space - * will combine to avoid problems with periodicity. If so, we - * can use a trivial hash function (a bit-and and a 3 bit left - * shift) with some small savings. + * will combine to avoid problems with periodicity. If so, we + * can use a trivial hash function (a bit-and and a 3 bit left + * shift) with some small savings. * * If not, it will become evident in the statistics. Changing - * to the usual prime number length hash table will require + * to the usual prime number length hash table will require * changing the H5C__HASH_FCN macro and the deletion of the * H5C__HASH_MASK #define. No other changes should be required. * @@ -330,7 +330,7 @@ * Automatic cache size adjustment: * * While the default cache size is adequate for most cases, we can run into - * cases where the default is too small. Ideally, we will let the user + * cases where the default is too small. Ideally, we will let the user * adjust the cache size as required. However, this is not possible in all * cases. Thus I have added automatic cache size adjustment code. * @@ -349,25 +349,25 @@ * all the ways this can happen, we simply set this flag when * we receive a new configuration. * - * cache_full: Boolean flag used to keep track of whether the cache is - * full, so we can refrain from increasing the size of a + * cache_full: Boolean flag used to keep track of whether the cache is + * full, so we can refrain from increasing the size of a * cache which hasn't used up the space alotted to it. * * The field is initialized to FALSE, and then set to TRUE * whenever we attempt to make space in the cache. * * resize_enabled: This is another convenience flag which is set whenever - * a new set of values for resize_ctl are provided. Very - * simply, + * a new set of values for resize_ctl are provided. Very + * simply, * - * resize_enabled = size_increase_possible || + * resize_enabled = size_increase_possible || * size_decrease_possible; * - * size_decreased: Boolean flag set to TRUE whenever the maximun cache - * size is decreased. The flag triggers a call to + * size_decreased: Boolean flag set to TRUE whenever the maximun cache + * size is decreased. The flag triggers a call to * H5C_make_space_in_cache() on the next call to H5C_protect(). * - * resize_ctl: Instance of H5C_auto_size_ctl_t containing configuration + * resize_ctl: Instance of H5C_auto_size_ctl_t containing configuration * data for automatic cache resizing. * * epoch_markers_active: Integer field containing the number of epoch @@ -381,37 +381,37 @@ * epoch_marker_ringbuf: Array of int of length H5C__MAX_EPOCH_MARKERS + 1. * * To manage the epoch marker cache entries, it is necessary - * to track their order in the LRU list. This is done with - * epoch_marker_ringbuf. When markers are inserted at the - * head of the LRU list, the index of the marker in the + * to track their order in the LRU list. This is done with + * epoch_marker_ringbuf. When markers are inserted at the + * head of the LRU list, the index of the marker in the * epoch_markers array is inserted at the tail of the ring * buffer. When it becomes the epoch_marker_active'th marker * in the LRU list, it will have worked its way to the head - * of the ring buffer as well. This allows us to remove it + * of the ring buffer as well. This allows us to remove it * without scanning the LRU list if such is required. * * epoch_marker_ringbuf_first: Integer field containing the index of the * first entry in the ring buffer. * - * epoch_marker_ringbuf_last: Integer field containing the index of the + * epoch_marker_ringbuf_last: Integer field containing the index of the * last entry in the ring buffer. * * epoch_marker_ringbuf_size: Integer field containing the number of entries * in the ring buffer. - * + * * epoch_markers: Array of instances of H5C_cache_entry_t of length * H5C__MAX_EPOCH_MARKERS. The entries are used as markers * in the LRU list to identify cache entries that haven't - * been accessed for some (small) specified number of - * epochs. These entries (if any) can then be evicted and + * been accessed for some (small) specified number of + * epochs. These entries (if any) can then be evicted and * the cache size reduced -- ideally without evicting any * of the current working set. Needless to say, the epoch * length and the number of epochs before an unused entry * must be chosen so that all, or almost all, the working * set will be accessed before the limit. * - * Epoch markers only appear in the LRU list, never in - * the index or slist. While they are of type + * Epoch markers only appear in the LRU list, never in + * the index or slist. While they are of type * H5C__EPOCH_MARKER_TYPE, and have associated class * functions, these functions should never be called. * @@ -419,7 +419,7 @@ * are set to the index of the instance in the epoch_markers * array, the size is set to 0, and the type field points * to the constant structure epoch_marker_class defined - * in H5C.c. The next and prev fields are used as usual + * in H5C.c. The next and prev fields are used as usual * to link the entry into the LRU list. * * All other fields are unused. @@ -427,18 +427,18 @@ * * Cache hit rate collection fields: * - * We supply the current cache hit rate on request, so we must keep a - * simple cache hit rate computation regardless of whether statistics + * We supply the current cache hit rate on request, so we must keep a + * simple cache hit rate computation regardless of whether statistics * collection is enabled. The following fields support this capability. * - * cache_hits: Number of cache hits since the last time the cache hit - * rate statistics were reset. Note that when automatic cache - * re-sizing is enabled, this field will be reset every automatic + * cache_hits: Number of cache hits since the last time the cache hit + * rate statistics were reset. Note that when automatic cache + * re-sizing is enabled, this field will be reset every automatic * resize epoch. * * cache_accesses: Number of times the cache has been accessed while - * since the last since the last time the cache hit rate statistics - * were reset. Note that when automatic cache re-sizing is enabled, + * since the last since the last time the cache hit rate statistics + * were reset. Note that when automatic cache re-sizing is enabled, * this field will be reset every automatic resize epoch. * * @@ -448,39 +448,39 @@ * below. The first set are collected only when H5C_COLLECT_CACHE_STATS * is true. * - * hits: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type id - * equal to the array index has been in cache when requested in + * hits: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the number of times an entry with type id + * equal to the array index has been in cache when requested in * the current epoch. * - * misses: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type id - * equal to the array index has not been in cache when + * misses: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the number of times an entry with type id + * equal to the array index has not been in cache when * requested in the current epoch. * - * insertions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type - * id equal to the array index has been inserted into the + * insertions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the number of times an entry with type + * id equal to the array index has been inserted into the * cache in the current epoch. * - * clears: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type - * id equal to the array index has been cleared in the current + * clears: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the number of times an entry with type + * id equal to the array index has been cleared in the current * epoch. * - * flushes: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type id + * flushes: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the number of times an entry with type id * equal to the array index has been written to disk in the * current epoch. * - * evictions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type id - * equal to the array index has been evicted from the cache in + * evictions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the number of times an entry with type id + * equal to the array index has been evicted from the cache in * the current epoch. * - * renames: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type - * id equal to the array index has been renamed in the current + * renames: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the number of times an entry with type + * id equal to the array index has been renamed in the current * epoch. * * total_ht_insertions: Number of times entries have been inserted into the @@ -489,10 +489,10 @@ * total_ht_deletions: Number of times entries have been deleted from the * hash table in the current epoch. * - * successful_ht_searches: int64 containing the total number of successful + * successful_ht_searches: int64 containing the total number of successful * searches of the hash table in the current epoch. * - * total_successful_ht_search_depth: int64 containing the total number of + * total_successful_ht_search_depth: int64 containing the total number of * entries other than the targets examined in successful * searches of the hash table in the current epoch. * @@ -500,7 +500,7 @@ * searches of the hash table in the current epoch. * * total_failed_ht_search_depth: int64 containing the total number of - * entries examined in unsuccessful searches of the hash + * entries examined in unsuccessful searches of the hash * table in the current epoch. * * max_index_len: Largest value attained by the index_len field in the @@ -524,28 +524,28 @@ * The remaining stats are collected only when both H5C_COLLECT_CACHE_STATS * and H5C_COLLECT_CACHE_ENTRY_STATS are true. * - * max_accesses: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the maximum number of times any single - * entry with type id equal to the array index has been + * max_accesses: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the maximum number of times any single + * entry with type id equal to the array index has been * accessed in the current epoch. * - * min_accesses: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the minimum number of times any single - * entry with type id equal to the array index has been + * min_accesses: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the minimum number of times any single + * entry with type id equal to the array index has been * accessed in the current epoch. * - * max_clears: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the maximum number of times any single - * entry with type id equal to the array index has been cleared + * max_clears: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the maximum number of times any single + * entry with type id equal to the array index has been cleared * in the current epoch. * - * max_flushes: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the maximum number of times any single - * entry with type id equal to the array index has been + * max_flushes: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the maximum number of times any single + * entry with type id equal to the array index has been * flushed in the current epoch. * * max_size: Array of size_t of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the maximum size of any single entry + * are used to record the maximum size of any single entry * with type id equal to the array index that has resided in * the cache in the current epoch. * @@ -563,9 +563,9 @@ * When this flag is set, all sanity checks on the file * parameters are skipped. The field defaults to FALSE. * - * skip_dxpl_id_checks: Boolean flag used to skip sanity checks on the + * skip_dxpl_id_checks: Boolean flag used to skip sanity checks on the * dxpl_id parameters passed to the cache. These are not - * used directly by the cache, so skipping the checks + * used directly by the cache, so skipping the checks * simplifies the test bed. * * When this flag is set, all sanity checks on the dxpl_id diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index ed3f394..7c0151b 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -51,10 +51,10 @@ #define H5C_COLLECT_CACHE_STATS 0 /* H5C_COLLECT_CACHE_ENTRY_STATS controls collection of statistics - * in individual cache entries. - * - * H5C_COLLECT_CACHE_ENTRY_STATS should only be defined to true if - * H5C_COLLECT_CACHE_STATS is also defined to true. + * in individual cache entries. + * + * H5C_COLLECT_CACHE_ENTRY_STATS should only be defined to true if + * H5C_COLLECT_CACHE_STATS is also defined to true. */ #if H5C_COLLECT_CACHE_STATS @@ -114,23 +114,23 @@ typedef struct H5C_t H5C_t; * Note that the space allocated on disk may not be contiguous. */ -typedef void *(*H5C_load_func_t)(H5F_t *f, - hid_t dxpl_id, - haddr_t addr, - const void *udata1, +typedef void *(*H5C_load_func_t)(H5F_t *f, + hid_t dxpl_id, + haddr_t addr, + const void *udata1, void *udata2); -typedef herr_t (*H5C_flush_func_t)(H5F_t *f, - hid_t dxpl_id, - hbool_t dest, - haddr_t addr, +typedef herr_t (*H5C_flush_func_t)(H5F_t *f, + hid_t dxpl_id, + hbool_t dest, + haddr_t addr, void *thing); -typedef herr_t (*H5C_dest_func_t)(H5F_t *f, +typedef herr_t (*H5C_dest_func_t)(H5F_t *f, void *thing); -typedef herr_t (*H5C_clear_func_t)(H5F_t *f, - void *thing, +typedef herr_t (*H5C_clear_func_t)(H5F_t *f, + void *thing, hbool_t dest); -typedef herr_t (*H5C_size_func_t)(const H5F_t *f, - const void *thing, +typedef herr_t (*H5C_size_func_t)(const H5F_t *f, + const void *thing, size_t *size_ptr); typedef struct H5C_class_t { @@ -153,8 +153,8 @@ typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f, * out of a hat -- you should be able to change them as necessary. * * However, if you need a very big cache, you should also increase the - * size of the hash table (H5C__HASH_TABLE_LEN in H5Cpkg.h). The current - * upper bound on cache size is rather large for the current hash table + * size of the hash table (H5C__HASH_TABLE_LEN in H5Cpkg.h). The current + * upper bound on cache size is rather large for the current hash table * size. */ @@ -174,11 +174,11 @@ typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f, * * structure H5C_cache_entry_t * - * Instances of the H5C_cache_entry_t structure are used to store cache - * entries in a hash table and sometimes in a skip list. + * Instances of the H5C_cache_entry_t structure are used to store cache + * entries in a hash table and sometimes in a skip list. * See H5SL.c for the particulars of the skip list. * - * In typical application, this structure is the first field in a + * In typical application, this structure is the first field in a * structure to be cached. For historical reasons, the external module * is responsible for managing the is_dirty field. All other fields are * managed by the cache. @@ -212,12 +212,12 @@ typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f, * * NOTE: For historical reasons, this field is not maintained * by the cache. Instead, the module using the cache - * sets this flag when it modifies the entry, and the + * sets this flag when it modifies the entry, and the * flush and clear functions supplied by that module * reset the dirty when appropriate. * * This is a bit quirky, so we may want to change this - * someday. However it will require a change in the + * someday. However it will require a change in the * cache interface. * * is_protected: Boolean flag indicating whether this entry is protected @@ -235,7 +235,7 @@ typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f, * being flushed. * * flush_marker: Boolean flag indicating that the entry is to be flushed - * the next time H5C_flush_cache() is called with the + * the next time H5C_flush_cache() is called with the * H5AC__FLUSH_MARKED_ENTRIES_FLAG. The flag is reset when * the entry is flushed for whatever reason. * @@ -248,63 +248,63 @@ typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f, * * ht_next: Next pointer used by the hash table to store multiple * entries in a single hash bin. This field points to the - * next entry in the doubly linked list of entries in the + * next entry in the doubly linked list of entries in the * hash bin, or NULL if there is no next entry. * * ht_prev: Prev pointer used by the hash table to store multiple * entries in a single hash bin. This field points to the - * previous entry in the doubly linked list of entries in + * previous entry in the doubly linked list of entries in * the hash bin, or NULL if there is no previuos entry. * * * Fields supporting replacement policies: * - * The cache must have a replacement policy, and it will usually be + * The cache must have a replacement policy, and it will usually be * necessary for this structure to contain fields supporting that policy. * - * While there has been interest in several replacement policies for + * While there has been interest in several replacement policies for * this cache, the initial development schedule is tight. Thus I have * elected to support only a modified LRU policy for the first cut. * * When additional replacement policies are added, the fields in this - * section will be used in different ways or not at all. Thus the + * section will be used in different ways or not at all. Thus the * documentation of these fields is repeated for each replacement policy. - * + * * Modified LRU: - * + * * When operating in parallel mode, we must ensure that a read does not * cause a write. If it does, the process will hang, as the write will * be collective and the other processes will not know to participate. * * To deal with this issue, I have modified the usual LRU policy by adding - * clean and dirty LRU lists to the usual LRU list. When reading in + * clean and dirty LRU lists to the usual LRU list. When reading in * parallel mode, we evict from the clean LRU list only. This implies - * that we must try to ensure that the clean LRU list is reasonably well + * that we must try to ensure that the clean LRU list is reasonably well * stocked. See the comments on H5C_t in H5Cpkg.h for more details. - * + * * Note that even if we start with a completely clean cache, a sequence * of protects without unprotects can empty the clean LRU list. In this - * case, the cache must grow temporarily. At the next write, we will + * case, the cache must grow temporarily. At the next write, we will * attempt to evict enough entries to get the cache down to its nominal * maximum size. * * The use of the replacement policy fields under the Modified LRU policy * is discussed below: * - * next: Next pointer in either the LRU or the protected list, - * depending on the current value of protected. If there - * is no next entry on the list, this field should be set + * next: Next pointer in either the LRU or the protected list, + * depending on the current value of protected. If there + * is no next entry on the list, this field should be set * to NULL. * - * prev: Prev pointer in either the LRU or the protected list, - * depending on the current value of protected. If there - * is no previous entry on the list, this field should be + * prev: Prev pointer in either the LRU or the protected list, + * depending on the current value of protected. If there + * is no previous entry on the list, this field should be * set to NULL. * * aux_next: Next pointer on either the clean or dirty LRU lists. * This entry should be NULL when protected is true. When * protected is false, and dirty is true, it should point - * to the next item on the dirty LRU list. When protected + * to the next item on the dirty LRU list. When protected * is false, and dirty is false, it should point to the * next item on the clean LRU list. In either case, when * there is no next item, it should be NULL. @@ -312,7 +312,7 @@ typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f, * aux_prev: Previous pointer on either the clean or dirty LRU lists. * This entry should be NULL when protected is true. When * protected is false, and dirty is true, it should point - * to the previous item on the dirty LRU list. When protected + * to the previous item on the dirty LRU list. When protected * is false, and dirty is false, it should point to the * previous item on the clean LRU list. In either case, when * there is no previous item, it should be NULL. @@ -322,7 +322,7 @@ typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f, * * These fields should only be compiled in when both H5C_COLLECT_CACHE_STATS * and H5C_COLLECT_CACHE_ENTRY_STATS are true. When present, they allow - * collection of statistics on individual cache entries. + * collection of statistics on individual cache entries. * * accesses: int32_t containing the number of times this cache entry has * been referenced in its lifetime. @@ -331,8 +331,8 @@ typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f, * been cleared in its life time. * * flushes: int32_t containing the number of times this cache entry has - * been flushed to file in its life time. - * + * been flushed to file in its life time. + * ****************************************************************************/ typedef struct H5C_cache_entry_t @@ -367,7 +367,7 @@ typedef struct H5C_cache_entry_t #endif /* H5C_COLLECT_CACHE_ENTRY_STATS */ -} H5C_cache_entry_t; +} H5C_cache_entry_t; /**************************************************************************** @@ -375,13 +375,13 @@ typedef struct H5C_cache_entry_t * structure H5C_auto_size_ctl_t * * Instances of H5C_auto_size_ctl_t are used to get and set the control - * fields for automatic cache re-sizing. + * fields for automatic cache re-sizing. * * The fields of the structure are discussed individually below: * - * version: Integer field containing the version number of this version - * of the H5C_auto_size_ctl_t structure. Any instance of - * H5C_auto_size_ctl_t passed to the cache must have a known + * version: Integer field containing the version number of this version + * of the H5C_auto_size_ctl_t structure. Any instance of + * H5C_auto_size_ctl_t passed to the cache must have a known * version number, or an error will be flagged. * * report_fcn: Pointer to the function that is to be called to report @@ -391,9 +391,9 @@ typedef struct H5C_cache_entry_t * If the field is not NULL, it must contain the address of a function * of type H5C_auto_resize_report_fcn. * - * set_initial_size: Boolean flag indicating whether the size of the - * initial size of the cache is to be set to the value given in - * the initial_size field. If set_initial_size is FALSE, the + * set_initial_size: Boolean flag indicating whether the size of the + * initial size of the cache is to be set to the value given in + * the initial_size field. If set_initial_size is FALSE, the * initial_size field is ignored. * * initial_size: If enabled, this field contain the size the cache is @@ -404,21 +404,21 @@ typedef struct H5C_cache_entry_t * of the cache that is to be kept clean. This field is only used * in parallel mode. Typical values are 0.1 to 0.5. * - * max_size: Maximum size to which the cache can be adjusted. The + * max_size: Maximum size to which the cache can be adjusted. The * supplied value must fall in the closed interval - * [MIN_MAX_CACHE_SIZE, MAX_MAX_CACHE_SIZE]. Also, max_size must + * [MIN_MAX_CACHE_SIZE, MAX_MAX_CACHE_SIZE]. Also, max_size must * be greater than or equal to min_size. * * min_size: Minimum size to which the cache can be adjusted. The * supplied value must fall in the closed interval - * [MIN_MAX_CACHE_SIZE, MAX_MAX_CACHE_SIZE]. Also, min_size must + * [MIN_MAX_CACHE_SIZE, MAX_MAX_CACHE_SIZE]. Also, min_size must * be less than or equal to max_size. * * epoch_length: Number of accesses on the cache over which to collect * hit rate stats before running the automatic cache resize code, - * if it is enabled. - * - * At the end of an epoch, we discard prior hit rate data and start + * if it is enabled. + * + * At the end of an epoch, we discard prior hit rate data and start * collecting afresh. The epoch_length must lie in the closed * interval [H5C__MIN_AR_EPOCH_LENGTH, H5C__MAX_AR_EPOCH_LENGTH]. * @@ -429,15 +429,15 @@ typedef struct H5C_cache_entry_t * value indicates how we determine whether the cache size should be * increased. At present there are two possible values: * - * H5C_incr__off: Don't attempt to increase the size of the cache + * H5C_incr__off: Don't attempt to increase the size of the cache * automatically. * * When this increment mode is selected, the remaining fields * in the cache size increase section ar ignored. * - * H5C_incr__threshold: Attempt to increase the size of the cache - * whenever the average hit rate over the last epoch drops - * below the value supplied in the lower_hr_threshold + * H5C_incr__threshold: Attempt to increase the size of the cache + * whenever the average hit rate over the last epoch drops + * below the value supplied in the lower_hr_threshold * field. * * Note that this attempt will fail if the cache is already @@ -445,9 +445,9 @@ typedef struct H5C_cache_entry_t * all available space. * * lower_hr_threshold: Lower hit rate threshold. If the increment mode - * (incr_mode) is H5C_incr__threshold and the hit rate drops below the - * value supplied in this field in an epoch, increment the cache size by - * size_increment. Note that cache size may not be incremented above + * (incr_mode) is H5C_incr__threshold and the hit rate drops below the + * value supplied in this field in an epoch, increment the cache size by + * size_increment. Note that cache size may not be incremented above * max_size, and that the increment may be further restricted by the * max_increment field if it is enabled. * @@ -460,73 +460,73 @@ typedef struct H5C_cache_entry_t * The increment must be greater than 1.0, and should not exceed 2.0. * * The new cache size is obtained by multiplying the current max cache - * size by the increment, and then clamping to max_size and to stay + * size by the increment, and then clamping to max_size and to stay * within the max_increment as necessary. * * apply_max_increment: Boolean flag indicating whether the max_increment * field should be used to limit the maximum cache size increment. * - * max_increment: If enabled by the apply_max_increment field described - * above, this field contains the maximum number of bytes by which the - * cache size can be increased in a single re-size. + * max_increment: If enabled by the apply_max_increment field described + * above, this field contains the maximum number of bytes by which the + * cache size can be increased in a single re-size. * * * Cache size decrease control fields: * - * decr_mode: Instance of the H5C_cache_decr_mode enumerated type whose + * decr_mode: Instance of the H5C_cache_decr_mode enumerated type whose * value indicates how we determine whether the cache size should be * decreased. At present there are four possibilities. * - * H5C_decr__off: Don't attempt to decrease the size of the cache + * H5C_decr__off: Don't attempt to decrease the size of the cache * automatically. * * When this increment mode is selected, the remaining fields * in the cache size decrease section are ignored. * - * H5C_decr__threshold: Attempt to decrease the size of the cache - * whenever the average hit rate over the last epoch rises - * above the value supplied in the upper_hr_threshold + * H5C_decr__threshold: Attempt to decrease the size of the cache + * whenever the average hit rate over the last epoch rises + * above the value supplied in the upper_hr_threshold * field. * - * H5C_decr__age_out: At the end of each epoch, search the cache for - * entries that have not been accessed for at least the number + * H5C_decr__age_out: At the end of each epoch, search the cache for + * entries that have not been accessed for at least the number * of epochs specified in the epochs_before_eviction field, and - * evict these entries. Conceptually, the maximum cache size + * evict these entries. Conceptually, the maximum cache size * is then decreased to match the new actual cache size. However, - * this reduction may be modified by the min_size, the + * this reduction may be modified by the min_size, the * max_decrement, and/or the empty_reserve. * - * H5C_decr__age_out_with_threshold: Same as age_out, but we only - * attempt to reduce the cache size when the hit rate observed - * over the last epoch exceeds the value provided in the + * H5C_decr__age_out_with_threshold: Same as age_out, but we only + * attempt to reduce the cache size when the hit rate observed + * over the last epoch exceeds the value provided in the * upper_hr_threshold field. * * upper_hr_threshold: Upper hit rate threshold. The use of this field * varies according to the current decr_mode: * - * H5C_decr__off or H5C_decr__age_out: The value of this field is + * H5C_decr__off or H5C_decr__age_out: The value of this field is * ignored. * - * H5C_decr__threshold: If the hit rate exceeds this threshold in any + * H5C_decr__threshold: If the hit rate exceeds this threshold in any * epoch, attempt to decrement the cache size by size_decrement. * * Note that cache size may not be decremented below min_size. * - * Note also that if the upper_threshold is 1.0, the cache size + * Note also that if the upper_threshold is 1.0, the cache size * will never be reduced. * - * H5C_decr__age_out_with_threshold: If the hit rate exceeds this - * threshold in any epoch, attempt to reduce the cache size - * by evicting entries that have not been accessed for more + * H5C_decr__age_out_with_threshold: If the hit rate exceeds this + * threshold in any epoch, attempt to reduce the cache size + * by evicting entries that have not been accessed for more * than the specified number of epochs. * - * decrement: This field is only used when the decr_mode is + * decrement: This field is only used when the decr_mode is * H5C_decr__threshold. * - * The field is a double containing the multiplier used to derive the - * new cache size from the old if a cache size decrement is triggered. + * The field is a double containing the multiplier used to derive the + * new cache size from the old if a cache size decrement is triggered. * The decrement must be in the range 0.0 (in which case the cache will - * try to contract to its minimum size) to 1.0 (in which case the + * try to contract to its minimum size) to 1.0 (in which case the * cache will never shrink). * * apply_max_decrement: Boolean flag used to determine whether decrements @@ -537,21 +537,21 @@ typedef struct H5C_cache_entry_t * restricted by the min_size of the cache, and (in age out modes) by * the empty_reserve field. * - * epochs_before_eviction: Integer field used in H5C_decr__age_out and + * epochs_before_eviction: Integer field used in H5C_decr__age_out and * H5C_decr__age_out_with_threshold decrement modes. * - * This field contains the number of epochs an entry must remain - * unaccessed before it is evicted in an attempt to reduce the + * This field contains the number of epochs an entry must remain + * unaccessed before it is evicted in an attempt to reduce the * cache size. If applicable, this field must lie in the range * [1, H5C__MAX_EPOCH_MARKERS]. * * apply_empty_reserve: Boolean field controlling whether the empty_reserve - * field is to be used in computing the new cache size when the + * field is to be used in computing the new cache size when the * decr_mode is H5C_decr__age_out or H5C_decr__age_out_with_threshold. * * empty_reserve: To avoid a constant racheting down of cache size by small - * amounts in the H5C_decr__age_out and H5C_decr__age_out_with_threshold - * modes, this field allows one to require that any cache size + * amounts in the H5C_decr__age_out and H5C_decr__age_out_with_threshold + * modes, this field allows one to require that any cache size * reductions leave the specified fraction of unused space in the cache. * * The value of this field must be in the range [0.0, 1.0]. I would @@ -639,7 +639,7 @@ typedef struct H5C_auto_size_ctl_t hbool_t apply_max_increment; size_t max_increment; - + /* size decrease control fields: */ enum H5C_cache_decr_mode decr_mode; @@ -663,7 +663,7 @@ typedef struct H5C_auto_size_ctl_t * Library prototypes. */ -/* #defines of flags used in the flags parameters in some of the +/* #defines of flags used in the flags parameters in some of the * following function calls. Note that not all flags are applicable * to all function calls. Flags that don't apply to a particular * function are ignored in that function. diff --git a/src/H5D.c b/src/H5D.c index 5f9658d..64c0847 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -34,7 +34,7 @@ /* Local functions */ static herr_t H5D_init_storage(H5D_t *dataset, hbool_t full_overwrite, hid_t dxpl_id); static H5D_shared_t * H5D_new(hid_t dcpl_id, hbool_t creating, hbool_t vl_type); -static H5D_t * H5D_create(H5G_entry_t *loc, const char *name, hid_t type_id, +static H5D_t * H5D_create(H5G_entry_t *loc, const char *name, hid_t type_id, const H5S_t *space, hid_t dcpl_id, hid_t dxpl_id); static H5D_t * H5D_open_oid(const H5G_entry_t *ent, hid_t dxpl_id); static herr_t H5D_get_space_status(H5D_t *dset, H5D_space_status_t *allocation, hid_t dxpl_id); @@ -115,7 +115,7 @@ NAME H5D_init_interface -- Initialize interface-specific information USAGE herr_t H5D_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -150,26 +150,26 @@ H5D_init_interface(void) * - Default value for filter callback * - Default value for datatype conversion callback */ - H5P_genclass_t *xfer_pclass; + H5P_genclass_t *xfer_pclass; size_t def_max_temp_buf = H5D_XFER_MAX_TEMP_BUF_DEF; void *def_tconv_buf = H5D_XFER_TCONV_BUF_DEF; - void *def_bkgr_buf = H5D_XFER_BKGR_BUF_DEF; - H5T_bkg_t def_bkgr_buf_type = H5D_XFER_BKGR_BUF_TYPE_DEF; + void *def_bkgr_buf = H5D_XFER_BKGR_BUF_DEF; + H5T_bkg_t def_bkgr_buf_type = H5D_XFER_BKGR_BUF_TYPE_DEF; double def_btree_split_ratio[3] = H5D_XFER_BTREE_SPLIT_RATIO_DEF; - H5MM_allocate_t def_vlen_alloc = H5D_XFER_VLEN_ALLOC_DEF; + H5MM_allocate_t def_vlen_alloc = H5D_XFER_VLEN_ALLOC_DEF; void *def_vlen_alloc_info = H5D_XFER_VLEN_ALLOC_INFO_DEF; - H5MM_free_t def_vlen_free = H5D_XFER_VLEN_FREE_DEF; + H5MM_free_t def_vlen_free = H5D_XFER_VLEN_FREE_DEF; void *def_vlen_free_info = H5D_XFER_VLEN_FREE_INFO_DEF; - hid_t def_vfl_id = H5D_XFER_VFL_ID_DEF; - void *def_vfl_info = H5D_XFER_VFL_INFO_DEF; - size_t def_hyp_vec_size = H5D_XFER_HYPER_VECTOR_SIZE_DEF; + hid_t def_vfl_id = H5D_XFER_VFL_ID_DEF; + void *def_vfl_info = H5D_XFER_VFL_INFO_DEF; + size_t def_hyp_vec_size = H5D_XFER_HYPER_VECTOR_SIZE_DEF; #ifdef H5_HAVE_PARALLEL H5FD_mpio_xfer_t def_io_xfer_mode = H5D_XFER_IO_XFER_MODE_DEF; #endif /* H5_HAVE_PARALLEL */ H5Z_EDC_t enable_edc = H5D_XFER_EDC_DEF; H5Z_cb_t filter_cb = H5D_XFER_FILTER_CB_DEF; H5T_conv_cb_t conv_cb = H5D_XFER_CONV_CB_DEF; - void *def_xfer_xform = H5D_XFER_XFORM_DEF; + void *def_xfer_xform = H5D_XFER_XFORM_DEF; /* Dataset creation property class variables. In sequence, they are, * - Creation property list class to modify @@ -187,7 +187,7 @@ H5D_init_interface(void) H5O_fill_t fill = H5D_CRT_FILL_VALUE_DEF; H5D_alloc_time_t alloc_time = H5D_CRT_ALLOC_TIME_DEF; unsigned alloc_time_state = H5D_CRT_ALLOC_TIME_STATE_DEF; - H5D_fill_time_t fill_time = H5D_CRT_FILL_TIME_DEF; + H5D_fill_time_t fill_time = H5D_CRT_FILL_TIME_DEF; H5O_efl_t efl = H5D_CRT_EXT_FILE_LIST_DEF; H5O_pline_t pline = H5D_CRT_DATA_PIPELINE_DEF; @@ -201,7 +201,7 @@ H5D_init_interface(void) if (H5I_register_type(H5I_DATASET, H5I_DATASETID_HASHSIZE, H5D_RESERVED_ATOMS, (H5I_free_t)H5D_close) 0) { /* Set the driver for the property list */ if(H5FD_dxpl_open(new_plist, driver_id, driver_info)<0) @@ -1148,13 +1148,13 @@ done: * Failure: FAIL * * Errors: - * ARGS BADTYPE Not a data space. - * ARGS BADTYPE Not a dataset creation plist. - * ARGS BADTYPE Not a file. - * ARGS BADTYPE Not a type. - * ARGS BADVALUE No name. - * DATASET CANTINIT Can't create dataset. - * DATASET CANTREGISTER Can't register dataset. + * ARGS BADTYPE Not a data space. + * ARGS BADTYPE Not a dataset creation plist. + * ARGS BADTYPE Not a file. + * ARGS BADTYPE Not a type. + * ARGS BADVALUE No name. + * DATASET CANTINIT Can't create dataset. + * DATASET CANTREGISTER Can't register dataset. * * Programmer: Robb Matzke * Wednesday, December 3, 1997 @@ -1248,7 +1248,7 @@ H5Dopen(hid_t loc_id, const char *name) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") if (!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") - + /* Find the dataset object */ if (H5G_find(loc, name, NULL, &ent, dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_NOTFOUND, FAIL, "not found") @@ -1291,8 +1291,8 @@ done: * Return: Non-negative on success/Negative on failure * * Errors: - * ARGS BADTYPE Not a dataset. - * DATASET CANTINIT Can't free. + * ARGS BADTYPE Not a dataset. + * DATASET CANTINIT Can't free. * * Programmer: Robb Matzke * Thursday, December 4, 1997 @@ -1329,7 +1329,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5Dget_space + * Function: H5Dget_space * * Purpose: Returns a copy of the file data space for a dataset. * @@ -1354,7 +1354,7 @@ H5Dget_space(hid_t dset_id) H5D_t *dset = NULL; H5S_t *space = NULL; hid_t ret_value; - + FUNC_ENTER_API(H5Dget_space, FAIL) H5TRACE1("i","i",dset_id); @@ -1387,9 +1387,9 @@ done: * * Purpose: Returns the status of data space allocation. * - * Return: + * Return: * Success: Non-negative - * + * * Failture: Negative * * Programmer: Raymond Lu @@ -1512,11 +1512,11 @@ done: hid_t H5Dget_type(hid_t dset_id) { - + H5D_t *dset = NULL; H5T_t *copied_type = NULL; hid_t ret_value = FAIL; - + FUNC_ENTER_API(H5Dget_type, FAIL) H5TRACE1("i","i",dset_id); @@ -1535,7 +1535,7 @@ H5Dget_type(hid_t dset_id) /* Unlock copied type */ if (H5T_lock (copied_type, FALSE)<0) HGOTO_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to lock transient data type") - + /* Create an atom */ if ((ret_value=H5I_register (H5I_DATATYPE, copied_type))<0) HGOTO_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register data type") @@ -1567,10 +1567,10 @@ done: * Tuesday, February 3, 1998 * * Modifications: - * + * * Raymond Lu * Tuesday, October 2, 2001 - * The way to retrieve and set property is changed for the + * The way to retrieve and set property is changed for the * generic property list. * *------------------------------------------------------------------------- @@ -1584,7 +1584,7 @@ H5Dget_create_plist(hid_t dset_id) H5P_genplist_t *new_plist; hid_t new_dcpl_id = FAIL; hid_t ret_value = FAIL; - + FUNC_ENTER_API(H5Dget_create_plist, FAIL) H5TRACE1("i","i",dset_id); @@ -1647,7 +1647,7 @@ H5Dextend(hid_t dset_id, const hsize_t *size) { H5D_t *dset = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Dextend, FAIL) H5TRACE2("e","i*h",dset_id,size); @@ -1695,7 +1695,7 @@ H5D_new(hid_t dcpl_id, hbool_t creating, hbool_t vl_type) H5P_genplist_t *plist; /* Property list created */ H5D_shared_t *new_dset = NULL; /* New dataset object */ H5D_shared_t *ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5D_new) if (NULL==(new_dset = H5FL_MALLOC(H5D_shared_t))) @@ -1754,7 +1754,7 @@ done: * Thursday, June 24, 2004 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1828,10 +1828,10 @@ done: * Modifications: * * John Mainzer 6/6/05 - * Modified function to use the new dirtied parameter of + * Modified function to use the new dirtied parameter of * H5AC_unprotect() instead of manipulating the is_dirty * field of the cache info directly. - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1939,7 +1939,7 @@ H5D_update_entry_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, H5P_genplist_t *p fill.alloc_time = alloc_time; fill.fill_time = fill_time; - + if (fill.fill_defined == FALSE && fill_time == H5D_FILL_TIME_ALLOC) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT,FAIL, "unable to create dataset") @@ -2032,7 +2032,7 @@ H5D_update_entry_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, H5P_genplist_t *p if (H5O_bogus_oh(file, dxpl_id, oh))<0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to update 'bogus' message") #endif /* H5O_ENABLE_BOGUS */ - + /* Add a modification time message. */ if (H5O_touch_oh(file, oh, TRUE, &oh_flags) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update modification time message") @@ -2067,8 +2067,8 @@ done: * Failure: NULL * * Errors: - * DATASET CANTINIT Can't update dataset header. - * DATASET CANTINIT Problem with the dataset name. + * DATASET CANTINIT Can't update dataset header. + * DATASET CANTINIT Problem with the dataset name. * DATASET CANTINIT Fail in file space allocation for * chunks * @@ -2089,13 +2089,13 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to retrieve and set property for generic property + * Changed the way to retrieve and set property for generic property * list. * * Raymond Lu, 26 Feb 2002 * A new fill value message is added. Two properties, space allocation * time and fill value writing time, govern space allocation and fill - * value writing. + * value writing. * * Bill Wendling, 1. November 2002 * Removed the cache updating mechanism. This was done so that it @@ -2113,7 +2113,7 @@ done: * Peter X. Cao * May 09, 2005 * Add property to create intermediate groups - * + * *------------------------------------------------------------------------- */ static H5D_t * @@ -2225,13 +2225,13 @@ H5D_create(H5G_entry_t *loc, const char *name, hid_t type_id, const H5S_t *space new_dset->shared->alloc_time=alloc_time; /* If MPI VFD is used, no filter support yet. */ - if(IS_H5FD_MPI(file) && dcpl_pline.nused > 0) + if(IS_H5FD_MPI(file) && dcpl_pline.nused > 0) HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, NULL, "Parallel I/O does not support filters yet") /* Chunked datasets are non-default, so retrieve their info here */ if(H5P_get(dc_plist, H5D_CRT_CHUNK_DIM_NAME, &chunk_ndims) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't retrieve chunk dimensions") - + /* Get the dataset's external file list information */ if(H5P_get(dc_plist, H5D_CRT_EXT_FILE_LIST_NAME, &new_dset->shared->efl) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't retrieve external file list") @@ -2322,7 +2322,7 @@ H5D_create(H5G_entry_t *loc, const char *name, hid_t type_id, const H5S_t *space /* * The chunk size of a dimension with a fixed size cannot exceed - * the maximum dimension size + * the maximum dimension size */ if(H5P_get(dc_plist, H5D_CRT_CHUNK_SIZE_NAME, new_dset->shared->layout.u.chunk.dim) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't retrieve chunk size") @@ -2357,7 +2357,7 @@ H5D_create(H5G_entry_t *loc, const char *name, hid_t type_id, const H5S_t *space hsize_t comp_data_size; /* - * Compact dataset is stored in dataset object header message of + * Compact dataset is stored in dataset object header message of * layout. */ tmp_size = H5S_GET_EXTENT_NPOINTS(space) * @@ -2389,7 +2389,7 @@ H5D_create(H5G_entry_t *loc, const char *name, hid_t type_id, const H5S_t *space if (H5D_get_dcpl_cache(new_dset->shared->dcpl_id,&new_dset->shared->dcpl_cache)<0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't fill DCPL cache") - /* + /* * Give the dataset a name. That is, create and add a new * "H5G_entry_t" object to the group this dataset is being initially * created in. @@ -2467,7 +2467,7 @@ H5D_isa(H5G_entry_t *ent, hid_t dxpl_id) { htri_t exists; htri_t ret_value=TRUE; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_isa, FAIL) assert(ent); @@ -2485,7 +2485,7 @@ H5D_isa(H5G_entry_t *ent, hid_t dxpl_id) } else if (!exists) { HGOTO_DONE(FALSE) } - + done: FUNC_LEAVE_NOAPI(ret_value) @@ -2493,7 +2493,7 @@ done: /* - *------------------------------------------------------------------------- + *------------------------------------------------------------------------- * Function: H5D_open * * Purpose: Checks if dataset is already open, or opens a dataset for @@ -2517,7 +2517,7 @@ H5D_open(const H5G_entry_t *ent, hid_t dxpl_id) H5D_shared_t *shared_fo=NULL; H5D_t *dataset=NULL; H5D_t *ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_open, NULL) /* check args */ @@ -2599,18 +2599,18 @@ static H5D_t * H5D_open_oid(const H5G_entry_t *ent, hid_t dxpl_id) { H5D_t *dataset = NULL; /*new dataset struct */ - H5O_fill_new_t fill = {NULL, 0, NULL, H5D_ALLOC_TIME_LATE, H5D_CRT_FILL_TIME_DEF, TRUE}; + H5O_fill_new_t fill = {NULL, 0, NULL, H5D_ALLOC_TIME_LATE, H5D_CRT_FILL_TIME_DEF, TRUE}; unsigned alloc_time_state; /* Allocation time state */ H5O_fill_t *fill_prop; /* Pointer to dataset's fill value area */ H5O_pline_t pline; /* I/O pipeline information */ H5P_genplist_t *plist; /* Property list */ H5D_t *ret_value = NULL; /*return value */ - + FUNC_ENTER_NOAPI(H5D_open_oid, NULL) /* check args */ assert (ent); - + /* Allocate the dataset structure */ if(NULL==(dataset=H5FL_CALLOC(H5D_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") @@ -2626,7 +2626,7 @@ H5D_open_oid(const H5G_entry_t *ent, hid_t dxpl_id) /* Find the dataset object */ if (H5O_open(&(dataset->ent)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, NULL, "unable to open") - + /* Get the type and space */ if (NULL==(dataset->shared->type=H5O_read(&(dataset->ent), H5O_DTYPE_ID, 0, NULL, dxpl_id))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to load type info from dataset header") @@ -2691,7 +2691,7 @@ H5D_open_oid(const H5G_entry_t *ent, hid_t dxpl_id) unsigned chunk_ndims; /* Dimensionality of chunk */ chunk_ndims = dataset->shared->layout.u.chunk.ndims - 1; - + if(H5P_set(plist, H5D_CRT_CHUNK_DIM_NAME, &chunk_ndims) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set chunk dimensions") if(H5P_set(plist, H5D_CRT_CHUNK_SIZE_NAME, dataset->shared->layout.u.chunk.dim) < 0) @@ -2706,7 +2706,7 @@ H5D_open_oid(const H5G_entry_t *ent, hid_t dxpl_id) dataset->shared->io_ops.readvv=H5D_istore_readvv; dataset->shared->io_ops.writevv=H5D_istore_writevv; break; - + case H5D_COMPACT: /* Set the I/O functions for this layout type */ dataset->shared->io_ops.readvv=H5D_compact_readvv; @@ -2744,7 +2744,7 @@ H5D_open_oid(const H5G_entry_t *ent, hid_t dxpl_id) case H5D_CHUNKED: fill.alloc_time=H5D_ALLOC_TIME_INCR; break; - + default: HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, NULL, "not implemented yet") } /* end switch */ /*lint !e788 All appropriate cases are covered */ @@ -2772,8 +2772,8 @@ H5D_open_oid(const H5G_entry_t *ent, hid_t dxpl_id) || (dataset->shared->layout.type==H5D_CONTIGUOUS && fill.alloc_time==H5D_ALLOC_TIME_LATE) || (dataset->shared->layout.type==H5D_CHUNKED && fill.alloc_time==H5D_ALLOC_TIME_INCR)) alloc_time_state=1; - - /* Set revised fill value properties */ + + /* Set revised fill value properties */ if(H5P_set(plist, H5D_CRT_FILL_VALUE_NAME, fill_prop) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set fill value") dataset->shared->alloc_time=fill.alloc_time; /* Cache this for later */ @@ -2856,7 +2856,7 @@ done: * * Errors: * DATASET CANTINIT Couldn't free the type or space, - * but the dataset was freed anyway. + * but the dataset was freed anyway. * * Programmer: Robb Matzke * Thursday, December 4, 1997 @@ -2916,7 +2916,7 @@ H5D_close(H5D_t *dataset) HGOTO_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "unable to destroy chunk cache") break; - case H5D_COMPACT: + case H5D_COMPACT: /* Update header message of layout for compact dataset. */ if(dataset->shared->layout.u.compact.dirty) { if(H5O_modify(&(dataset->ent), H5O_LAYOUT_ID, 0, 0, H5O_UPDATE_TIME, &(dataset->shared->layout), H5AC_dxpl_id)<0) @@ -2991,7 +2991,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to retrieve property for generic property + * Changed the way to retrieve property for generic property * list. * * Nat Furrer and James Laird @@ -3035,7 +3035,7 @@ H5D_extend (H5D_t *dataset, const hsize_t *size, hid_t dxpl_id) if(H5Z_can_apply(dataset->shared->dcpl_id, dataset->shared->type_id) <0) HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "can't apply filters") - dataset->shared->checked_filters = TRUE; + dataset->shared->checked_filters = TRUE; } } } @@ -3183,7 +3183,7 @@ H5D_alloc_storage (H5F_t *f, hid_t dxpl_id, H5D_t *dset/*in,out*/, H5D_time_allo unsigned init_space=0; /* Flag to indicate that space should be initialized */ unsigned addr_set=0; /* Flag to indicate that the dataset's storage address was set */ herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5D_alloc_storage) /* check args */ @@ -3235,7 +3235,7 @@ H5D_alloc_storage (H5F_t *f, hid_t dxpl_id, H5D_t *dset/*in,out*/, H5D_time_allo break; - case H5D_COMPACT: + case H5D_COMPACT: /* Check if space is already allocated */ if(layout->u.compact.buf==NULL) { /* Reserve space in layout header message for the entire array. */ @@ -3251,7 +3251,7 @@ H5D_alloc_storage (H5F_t *f, hid_t dxpl_id, H5D_t *dset/*in,out*/, H5D_time_allo init_space=1; } /* end if */ break; - + default: assert ("not implemented yet" && 0); #ifdef NDEBUG @@ -3322,7 +3322,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to retrieve property for generic property + * Changed the way to retrieve property for generic property * list. * *------------------------------------------------------------------------- @@ -3369,9 +3369,9 @@ H5D_init_storage(H5D_t *dset, hbool_t full_overwrite, hid_t dxpl_id) break; case H5D_CHUNKED: - /* - * Allocate file space - * for all chunks now and initialize each chunk with the fill value. + /* + * Allocate file space + * for all chunks now and initialize each chunk with the fill value. */ if (H5D_istore_allocate(dset, dxpl_id, full_overwrite)<0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to allocate all chunks of dataset") @@ -3383,7 +3383,7 @@ H5D_init_storage(H5D_t *dset, hbool_t full_overwrite, hid_t dxpl_id) HGOTO_ERROR (H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout") #endif /* NDEBUG */ } /* end switch */ /*lint !e788 All appropriate cases are covered */ - + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_init_storage() */ @@ -3414,7 +3414,7 @@ H5Dget_storage_size(hid_t dset_id) { H5D_t *dset=NULL; hsize_t ret_value; /* Return value */ - + FUNC_ENTER_API(H5Dget_storage_size, 0) H5TRACE1("h","i",dset_id); @@ -3451,7 +3451,7 @@ static hsize_t H5D_get_storage_size(H5D_t *dset, hid_t dxpl_id) { hsize_t ret_value; - + FUNC_ENTER_NOAPI(H5D_get_storage_size, 0) switch(dset->shared->layout.type) { @@ -3477,7 +3477,7 @@ H5D_get_storage_size(H5D_t *dset, hid_t dxpl_id) default: HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a dataset type") } /*lint !e788 All appropriate cases are covered */ - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -3488,12 +3488,12 @@ done: * * Purpose: Returns the address of dataset in file. * - * Return: Success: the address of dataset + * Return: Success: the address of dataset * * Failure: HADDR_UNDEF * - * Programmer: Raymond Lu - * November 6, 2002 + * Programmer: Raymond Lu + * November 6, 2002 * * Modifications: * @@ -3504,7 +3504,7 @@ H5Dget_offset(hid_t dset_id) { H5D_t *dset=NULL; haddr_t ret_value; /* Return value */ - + FUNC_ENTER_API(H5Dget_offset, HADDR_UNDEF) H5TRACE1("a","i",dset_id); @@ -3523,15 +3523,15 @@ done: /*------------------------------------------------------------------------- * Function: H5D_get_offset * - * Purpose: Private function for H5D_get_offset. Returns the address + * Purpose: Private function for H5D_get_offset. Returns the address * of dataset in file. * - * Return: Success: the address of dataset + * Return: Success: the address of dataset * * Failure: HADDR_UNDEF * - * Programmer: Raymond Lu - * November 6, 2002 + * Programmer: Raymond Lu + * November 6, 2002 * * Modifications: * @@ -3543,7 +3543,7 @@ H5D_get_offset(const H5D_t *dset) haddr_t ret_value=HADDR_UNDEF; haddr_t base_addr; H5F_t *f; - + FUNC_ENTER_NOAPI(H5D_get_offset, HADDR_UNDEF) assert(dset); @@ -3554,11 +3554,11 @@ H5D_get_offset(const H5D_t *dset) break; case H5D_CONTIGUOUS: - /* If dataspace hasn't been allocated or dataset is stored in + /* If dataspace hasn't been allocated or dataset is stored in * an external file, the value will be HADDR_UNDEF. */ f = H5D_get_file(dset); base_addr = H5F_get_base_addr(f); - + /* If there's user block in file, returns the absolute dataset offset * from the beginning of file. */ if(base_addr!=HADDR_UNDEF) @@ -3573,7 +3573,7 @@ H5D_get_offset(const H5D_t *dset) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, HADDR_UNDEF, "unknown dataset layout type") #endif /* NDEBUG */ } /*lint !e788 All appropriate cases are covered */ - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -3619,12 +3619,12 @@ done: * void *operator_data; IN/OUT: Pointer to any user-defined data * associated with the operation. * - * The return values from an operator are: + * The return values from an operator are: * Zero causes the iterator to continue, returning zero when all - * elements have been processed. + * elements have been processed. * Positive causes the iterator to immediately return that positive * value, indicating short-circuit success. The iterator can be - * restarted at the next element. + * restarted at the next element. * Negative causes the iterator to immediately return that value, * indicating failure. The iterator can be restarted at the next * element. @@ -3869,7 +3869,7 @@ H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, /* Get a copy of the dataspace ID */ if((vlen_bufsize.fspace_id=H5Dget_space(dataset_id))<0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "can't copy dataspace") - + /* Create a scalar for the memory dataspace */ if((vlen_bufsize.mspace_id=H5Screate(H5S_SCALAR))<0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "can't create dataspace") @@ -3931,7 +3931,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Dset_extent * - * Purpose: Modifies the dimensions of a dataset, based on H5Dextend. + * Purpose: Modifies the dimensions of a dataset, based on H5Dextend. * Can change to a lower dimension. * * Return: Success: SUCCEED, Failure: FAIL @@ -3974,7 +3974,7 @@ done: /*------------------------------------------------------------------------- * Function: H5D_set_extent * - * Purpose: Based in H5D_extend, allows change to a lower dimension, + * Purpose: Based in H5D_extend, allows change to a lower dimension, * calls H5S_set_extent and H5D_istore_prune_by_extent instead * * Return: Success: SUCCEED, Failure: FAIL @@ -4065,7 +4065,7 @@ H5D_set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) H5D_io_info_t io_info; /* Dataset I/O info */ H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ H5D_dxpl_cache_t *dxpl_cache=&_dxpl_cache; /* Data transfer property cache */ - + /* Fill the DXPL cache values for later use */ if (H5D_get_dxpl_cache(dxpl_id,&dxpl_cache)<0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") @@ -4157,14 +4157,14 @@ H5D_flush(const H5F_t *f, hid_t dxpl_id, unsigned flags) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush raw data cache") break; - case H5D_COMPACT: + case H5D_COMPACT: if(dataset->shared->layout.u.compact.dirty) { if(H5O_modify(&(dataset->ent), H5O_LAYOUT_ID, 0, 0, H5O_UPDATE_TIME, &(dataset->shared->layout), dxpl_id)<0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update layout message") dataset->shared->layout.u.compact.dirty = FALSE; } /* end if */ break; - + default: assert ("not implemented yet" && 0); #ifdef NDEBUG @@ -4218,7 +4218,7 @@ H5Ddebug(hid_t dset_id) } else if (H5D_CONTIGUOUS==dset->shared->layout.type) { HDfprintf(stdout, " %-10s %a\n", "Address:", dset->shared->layout.u.contig.addr); } - + done: FUNC_LEAVE_API(ret_value) } diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index a13bf5d..85d78eb 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -13,8 +13,8 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu - * August 5, 2002 + * Programmer: Raymond Lu + * August 5, 2002 * * Purpose: Compact dataset I/O functions. These routines are similar * H5D_contig_* and H5D_istore_*. @@ -35,32 +35,32 @@ /*------------------------------------------------------------------------- * Function: H5D_compact_readvv - * + * * Purpose: Reads some data vectors from a dataset into a buffer. - * The data is in compact dataset. The address is relative + * The data is in compact dataset. The address is relative * to the beginning address of the dataset. The offsets and * sequence lengths are in bytes. - * + * * Return: Non-negative on success/Negative on failure - * + * * Programmer: Quincey Koziol * May 7, 2003 - * - * Notes: + * + * Notes: * Offsets in the sequences must be monotonically increasing - * + * * Modifications: - * + * *------------------------------------------------------------------------- */ ssize_t H5D_compact_readvv(const H5D_io_info_t *io_info, - size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[], - size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[], + size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[], + size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[], void *buf) { ssize_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_compact_readvv, FAIL) assert(io_info->dset); @@ -69,42 +69,42 @@ H5D_compact_readvv(const H5D_io_info_t *io_info, if((ret_value=H5V_memcpyvv(buf,mem_max_nseq,mem_curr_seq,mem_size_arr,mem_offset_arr,io_info->dset->shared->layout.u.compact.buf,dset_max_nseq,dset_curr_seq,dset_size_arr,dset_offset_arr))<0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "vectorized memcpy failed") -done: +done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_compact_readvv() */ /*------------------------------------------------------------------------- * Function: H5D_compact_writevv - * + * * Purpose: Writes some data vectors from a dataset into a buffer. - * The data is in compact dataset. The address is relative + * The data is in compact dataset. The address is relative * to the beginning address for the file. The offsets and * sequence lengths are in bytes. This function only copies - * data into the buffer in the LAYOUT struct and mark it - * as DIRTY. Later in H5D_close, the data is copied into - * header message in memory. - * + * data into the buffer in the LAYOUT struct and mark it + * as DIRTY. Later in H5D_close, the data is copied into + * header message in memory. + * * Return: Non-negative on success/Negative on failure - * + * * Programmer: Quincey Koziol * May 2, 2003 - * - * Notes: + * + * Notes: * Offsets in the sequences must be monotonically increasing - * + * * Modifications: - * + * *------------------------------------------------------------------------- */ ssize_t H5D_compact_writevv(const H5D_io_info_t *io_info, - size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[], - size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[], + size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[], + size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[], const void *buf) { ssize_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_compact_writevv, FAIL) assert(io_info->dset); @@ -115,6 +115,6 @@ H5D_compact_writevv(const H5D_io_info_t *io_info, io_info->dset->shared->layout.u.compact.dirty = TRUE; -done: +done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_compact_writevv() */ diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index fd4dde0..bec3615 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -125,7 +125,7 @@ H5D_contig_fill(H5D_t *dset, hid_t dxpl_id) #endif /* H5_HAVE_PARALLEL */ int non_zero_fill_f=(-1); /* Indicate that a non-zero fill-value was used */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_contig_fill, FAIL) /* Check args */ @@ -216,7 +216,7 @@ H5D_contig_fill(H5D_t *dset, hid_t dxpl_id) /* Indicate that a zero fill buffer was used */ non_zero_fill_f=0; } /* end else */ - + /* Start at the beginning of the dataset */ offset = 0; @@ -249,7 +249,7 @@ H5D_contig_fill(H5D_t *dset, hid_t dxpl_id) npoints -= MIN(ptsperbuf, npoints); offset += size; } /* end while */ - + #ifdef H5_HAVE_PARALLEL /* Only need to block at the barrier if we actually wrote fill values */ /* And if we are using an MPI-capable file driver */ @@ -422,7 +422,7 @@ H5D_contig_readvv(const H5D_io_info_t *io_info, size_t u; /* Counting variable */ size_t v; /* Counting variable */ ssize_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_contig_readvv, FAIL) /* Check args */ @@ -689,7 +689,7 @@ H5D_contig_writevv(const H5D_io_info_t *io_info, size_t u; /* Counting variable */ size_t v; /* Counting variable */ ssize_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_contig_writevv, FAIL) /* Check args */ @@ -717,7 +717,7 @@ H5D_contig_writevv(const H5D_io_info_t *io_info, sieve_size=dset_contig->sieve_size; sieve_end=sieve_start+sieve_size; } /* end if */ - + /* Works through sequences as fast as possible */ for(; usieve_loc=addr; - + } /* end if */ /* Append to existing sieve buffer */ else { @@ -845,7 +845,7 @@ H5D_contig_writevv(const H5D_io_info_t *io_info, /* Adjust sieve size */ dset_contig->sieve_size += size; - + /* Update local copies of sieve information */ sieve_start=dset_contig->sieve_loc; sieve_size=dset_contig->sieve_size; diff --git a/src/H5Defl.c b/src/H5Defl.c index cfe10d6..aaba3a6 100644 --- a/src/H5Defl.c +++ b/src/H5Defl.c @@ -63,7 +63,7 @@ H5D_efl_read (const H5O_efl_t *efl, haddr_t addr, size_t size, uint8_t *buf) ssize_t n; size_t u; /* Local index variable */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5D_efl_read) /* Check args */ @@ -80,7 +80,7 @@ H5D_efl_read (const H5O_efl_t *efl, haddr_t addr, size_t size, uint8_t *buf) } cur += efl->slot[u].size; } - + /* Read the data */ while (size) { assert(buf); @@ -111,14 +111,14 @@ H5D_efl_read (const H5O_efl_t *efl, haddr_t addr, size_t size, uint8_t *buf) skip = 0; u++; } - + done: if (fd>=0) HDclose (fd); FUNC_LEAVE_NOAPI(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5D_efl_write @@ -150,7 +150,7 @@ H5D_efl_write (const H5O_efl_t *efl, haddr_t addr, size_t size, const uint8_t *b hsize_t skip=0; size_t u; /* Local index variable */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5D_efl_write) /* Check args */ @@ -167,7 +167,7 @@ H5D_efl_write (const H5O_efl_t *efl, haddr_t addr, size_t size, const uint8_t *b } cur += efl->slot[u].size; } - + /* Write the data */ while (size) { assert(buf); @@ -200,14 +200,14 @@ H5D_efl_write (const H5O_efl_t *efl, haddr_t addr, size_t size, const uint8_t *b skip = 0; u++; } - + done: if (fd>=0) HDclose (fd); FUNC_LEAVE_NOAPI(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5D_efl_readvv @@ -240,7 +240,7 @@ H5D_efl_readvv(const H5D_io_info_t *io_info, size_t u; /* Counting variable */ size_t v; /* Counting variable */ ssize_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_efl_readvv, FAIL) /* Check args */ @@ -291,7 +291,7 @@ H5D_efl_readvv(const H5D_io_info_t *io_info, done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_efl_readvv() */ - + /*------------------------------------------------------------------------- * Function: H5D_efl_writevv @@ -324,7 +324,7 @@ H5D_efl_writevv(const H5D_io_info_t *io_info, size_t u; /* Counting variable */ size_t v; /* Counting variable */ ssize_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_efl_writevv, FAIL) /* Check args */ @@ -375,4 +375,4 @@ H5D_efl_writevv(const H5D_io_info_t *io_info, done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_efl_writevv() */ - + diff --git a/src/H5Dio.c b/src/H5Dio.c index df9e1b7..ffff901 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -1136,7 +1136,7 @@ H5D_contig_read(H5D_io_info_t *io_info, hsize_t nelmts, /* Go figure out how many elements to read from the file */ assert(H5S_SELECT_ITER_NELMTS(&file_iter)==(nelmts-smine_start)); smine_nelmts = (size_t)MIN(request_nelmts, (nelmts-smine_start)); - + /* * Gather the data from disk into the data type conversion * buffer. Also gather data from application to background buffer @@ -1161,7 +1161,7 @@ H5D_contig_read(H5D_io_info_t *io_info, hsize_t nelmts, #endif if (n!=smine_nelmts) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file gather failed") - + if (H5T_BKG_YES==need_bkg) { #ifdef H5S_DEBUG H5_timer_begin(&timer); @@ -1176,7 +1176,7 @@ H5D_contig_read(H5D_io_info_t *io_info, hsize_t nelmts, if (n!=smine_nelmts) HGOTO_ERROR (H5E_IO, H5E_READERROR, FAIL, "mem gather failed") } /* end if */ - + /* * Perform data type conversion. */ @@ -1203,7 +1203,7 @@ H5D_contig_read(H5D_io_info_t *io_info, hsize_t nelmts, #endif if (status<0) HGOTO_ERROR (H5E_DATASET, H5E_READERROR, FAIL, "scatter failed") - + } /* end for */ done: @@ -1397,7 +1397,7 @@ H5D_contig_write(H5D_io_info_t *io_info, hsize_t nelmts, /* Go figure out how many elements to read from the file */ assert(H5S_SELECT_ITER_NELMTS(&file_iter)==(nelmts-smine_start)); smine_nelmts = (size_t)MIN(request_nelmts, (nelmts-smine_start)); - + /* * Gather data from application buffer into the data type conversion * buffer. Also gather data from the file into the background buffer @@ -1432,7 +1432,7 @@ H5D_contig_write(H5D_io_info_t *io_info, hsize_t nelmts, if (n!=smine_nelmts) HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "file gather failed") } /* end if */ - + /* * Perform data type conversion. */ @@ -3383,7 +3383,7 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: + * Programmer: * * Modifications: * diff --git a/src/H5Distore.c b/src/H5Distore.c index 661ab2d..688b5d4 100644 --- a/src/H5Distore.c +++ b/src/H5Distore.c @@ -348,7 +348,7 @@ H5D_istore_decode_key(const H5F_t UNUSED *f, const H5B_t *bt, const uint8_t *raw * Friday, October 10, 1997 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -403,7 +403,7 @@ H5D_istore_debug_key (FILE *stream, H5F_t UNUSED *f, hid_t UNUSED dxpl_id, int i const H5D_istore_key_t *key = (const H5D_istore_key_t *)_key; const H5D_istore_ud1_t *udata = (const H5D_istore_ud1_t *)_udata; unsigned u; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_debug_key) assert (key); @@ -486,7 +486,7 @@ H5D_istore_cmp2(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_lt_key, void *_uda * would describe the UDATA min_corner address * would fall lexicographically between LT_KEY * and RT_KEY. - * + * * Failure: FAIL (same as UDATA < LT_KEY) * * Programmer: Robb Matzke @@ -746,7 +746,7 @@ H5D_istore_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key, if (cmp < 0) { /* Negative indices not supported yet */ HGOTO_ERROR(H5E_STORAGE, H5E_UNSUPPORTED, H5B_INS_ERROR, "internal error") - + } else if (H5V_vector_eq_u (udata->mesg->u.chunk.ndims, udata->key.offset, lt_key->offset) && lt_key->nbytes>0) { @@ -758,7 +758,7 @@ H5D_istore_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key, /* Currently, the old chunk data is "thrown away" after the space is reallocated, * so avoid data copy in H5MF_realloc() call by just free'ing the space and * allocating new space. - * + * * This should keep the file smaller also, by freeing the space and then * allocating new space, instead of vice versa (in H5MF_realloc). * @@ -842,7 +842,7 @@ done: *------------------------------------------------------------------------- */ /* ARGSUSED */ -static int +static int H5D_istore_iter_allocated (H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_lt_key, haddr_t UNUSED addr, const void UNUSED *_rt_key, void *_udata) { @@ -931,7 +931,7 @@ H5D_istore_init (const H5F_t *f, const H5D_t *dset) { H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_istore_init, FAIL) if (H5F_RDCC_NBYTES(f)>0 && H5F_RDCC_NELMTS(f)>0) { @@ -975,7 +975,7 @@ H5D_istore_flush_entry(const H5D_io_info_t *io_info, H5D_rdcc_ent_t *ent, hbool_ void *buf=NULL; /*temporary buffer */ size_t alloc; /*bytes allocated for BUF */ hbool_t point_of_no_return = FALSE; - + FUNC_ENTER_NOAPI_NOINIT(H5D_istore_flush_entry) assert(io_info); @@ -1018,7 +1018,7 @@ H5D_istore_flush_entry(const H5D_io_info_t *io_info, H5D_rdcc_ent_t *ent, hbool_ point_of_no_return = TRUE; ent->chunk = NULL; } - if (H5Z_pipeline(&(io_info->dset->shared->dcpl_cache.pline), 0, &(udata.key.filter_mask), io_info->dxpl_cache->err_detect, + if (H5Z_pipeline(&(io_info->dset->shared->dcpl_cache.pline), 0, &(udata.key.filter_mask), io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, &(udata.key.nbytes), &alloc, &buf)<0) HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "output pipeline failed") } @@ -1038,7 +1038,7 @@ H5D_istore_flush_entry(const H5D_io_info_t *io_info, H5D_rdcc_ent_t *ent, hbool_ io_info->dset->shared->cache.chunk.nflushes++; #endif /* H5D_ISTORE_DEBUG */ } /* end if */ - + /* Reset, but do not free or removed from list */ if (reset) { point_of_no_return = FALSE; @@ -1047,12 +1047,12 @@ H5D_istore_flush_entry(const H5D_io_info_t *io_info, H5D_rdcc_ent_t *ent, hbool_ if(ent->chunk!=NULL) ent->chunk = H5D_istore_chunk_xfree(ent->chunk,&(io_info->dset->shared->dcpl_cache.pline)); } /* end if */ - + done: /* Free the temp buffer only if it's different than the entry chunk */ if (buf!=ent->chunk) H5MM_xfree(buf); - + /* * If we reached the point of no return then we have no choice but to * reset the entry. This can only happen if RESET is true but the @@ -1081,7 +1081,7 @@ done: * * Modifications: * Pedro Vicente, March 28, 2002 - * Added flush parameter that switches the call to H5F_istore_flush_entry + * Added flush parameter that switches the call to H5F_istore_flush_entry * The call with FALSE is used by the H5F_istore_prune_by_extent function * *------------------------------------------------------------------------- @@ -1162,7 +1162,7 @@ H5D_istore_flush (H5D_t *dset, hid_t dxpl_id, unsigned flags) int nerrors=0; H5D_rdcc_ent_t *ent=NULL, *next=NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_istore_flush, FAIL) /* Fill the DXPL cache values for later use */ @@ -1186,7 +1186,7 @@ H5D_istore_flush (H5D_t *dset, hid_t dxpl_id, unsigned flags) nerrors++; } } /* end for */ - + if (nerrors) HGOTO_ERROR (H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks") @@ -1222,7 +1222,7 @@ H5D_istore_dest (H5D_t *dset, hid_t dxpl_id) int nerrors=0; H5D_rdcc_ent_t *ent=NULL, *next=NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_istore_dest, FAIL) assert(dset); @@ -1407,7 +1407,7 @@ H5D_istore_prune (const H5D_io_info_t *io_info, size_t size) for (i=0; ihead; - + /* Compute next value for each pointer */ for (i=0; inext : NULL; @@ -1428,7 +1428,7 @@ H5D_istore_prune (const H5D_io_info_t *io_info, size_t size) HDputc('.', stderr); HDfflush(stderr); #endif - + } else if (1==i && p[1] && !p[1]->locked) { /* * Method 1: Preempt the entry without regard to @@ -1440,7 +1440,7 @@ H5D_istore_prune (const H5D_io_info_t *io_info, size_t size) HDputc(':', stderr); HDfflush(stderr); #endif - + } else { /* Nothing to preempt at this point */ cur= NULL; @@ -1457,7 +1457,7 @@ H5D_istore_prune (const H5D_io_info_t *io_info, size_t size) nerrors++; } } - + /* Advance pointers */ for (i=0; idxpl_cache); @@ -1541,7 +1541,7 @@ H5D_istore_lock(const H5D_io_info_t *io_info, if (rdcc->nslots>0) { idx=H5D_HASH(dset->shared,io_info->store->chunk.index); ent = rdcc->slot[idx]; - + if (ent) { for (u=0, found=TRUE; uu.chunk.ndims; u++) { if (io_info->store->chunk.offset[u]!=ent->offset[u]) { @@ -1574,7 +1574,7 @@ H5D_istore_lock(const H5D_io_info_t *io_info, #endif if (NULL==(chunk=H5D_istore_chunk_alloc (chunk_size,pline))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for raw data chunk") - + } else { H5D_istore_ud1_t tmp_udata; /*B-tree pass-through */ haddr_t chunk_addr; /* Address of chunk on disk */ @@ -1607,7 +1607,7 @@ H5D_istore_lock(const H5D_io_info_t *io_info, HGOTO_ERROR (H5E_IO, H5E_READERROR, NULL, "unable to read raw data chunk") if (pline->nused) - if (H5Z_pipeline(pline, H5Z_FLAG_REVERSE, &(udata->key.filter_mask), io_info->dxpl_cache->err_detect, + if (H5Z_pipeline(pline, H5Z_FLAG_REVERSE, &(udata->key.filter_mask), io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, &(udata->key.nbytes), &chunk_alloc, &chunk)<0) { HGOTO_ERROR(H5E_PLINE, H5E_READERROR, NULL, "data pipeline read failed") } @@ -1657,7 +1657,7 @@ else } /* end else */ } assert (found || chunk_size>0); - + if (!found && rdcc->nslots>0 && chunk_size<=rdcc->nbytes && (!ent || !ent->locked)) { /* @@ -1686,7 +1686,7 @@ else ent->rd_count = chunk_size; ent->wr_count = chunk_size; ent->chunk = chunk; - + /* Add it to the cache */ assert(NULL==rdcc->slot[idx]); rdcc->slot[idx] = ent; @@ -1749,7 +1749,7 @@ else /* Set return value */ ret_value = chunk; - + done: if (!ret_value) if(chunk) @@ -1793,7 +1793,7 @@ H5D_istore_unlock(const H5D_io_info_t *io_info, H5D_rdcc_ent_t *ent = NULL; unsigned u; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5D_istore_unlock) assert(io_info); @@ -1842,7 +1842,7 @@ H5D_istore_unlock(const H5D_io_info_t *io_info, } ent->locked = FALSE; } - + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_istore_unlock() */ @@ -1874,7 +1874,7 @@ H5D_istore_readvv(const H5D_io_info_t *io_info, haddr_t chunk_addr; /* Chunk address on disk */ size_t u; /* Local index variables */ ssize_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_istore_readvv, FAIL) /* Check args */ @@ -1956,7 +1956,7 @@ HDfprintf(stderr,"%s: buf=%p\n",FUNC,buf); if (rdcc->nslots>0) { unsigned idx=H5D_HASH(dset->shared,io_info->store->chunk.index); /* Cache entry index */ H5D_rdcc_ent_t *ent = rdcc->slot[idx]; /* Cache entry */ - + /* Potential match... */ if (ent) { for (u=0, found=TRUE; ushared->layout.u.chunk.ndims; u++) { @@ -2035,7 +2035,7 @@ HDfprintf(stderr,"%s: buf=%p\n",FUNC,buf); /* Set return value */ ret_value=naccessed; } /* end else */ - + done: FUNC_LEAVE_NOAPI(ret_value) } /* H5D_istore_readvv() */ @@ -2067,7 +2067,7 @@ H5D_istore_writevv(const H5D_io_info_t *io_info, haddr_t chunk_addr; /* Chunk address on disk */ size_t u; /* Local index variables */ ssize_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_istore_writevv, FAIL) /* Check args */ @@ -2185,7 +2185,7 @@ HDfprintf(stderr,"%s: mem_offset_arr[%Zu]=%Hu\n",FUNC,*mem_curr_seq,mem_offset_a /* Set return value */ ret_value=naccessed; } /* end else */ - + done: FUNC_LEAVE_NOAPI(ret_value) } /* H5D_istore_writevv() */ @@ -2236,7 +2236,7 @@ H5D_istore_create(H5F_t *f, hid_t dxpl_id, H5O_layout_t *layout /*out */ ) if (H5B_create(f, dxpl_id, H5B_ISTORE, &udata, &(layout->u.chunk.addr)/*out*/) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "can't create B-tree") - + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_istore_create() */ @@ -2328,7 +2328,7 @@ H5D_istore_get_addr(const H5D_io_info_t *io_info, H5D_istore_ud1_t *_udata) H5D_istore_ud1_t *udata; /* Pointer to information about a chunk */ unsigned u; haddr_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_get_addr) assert(io_info); @@ -2388,7 +2388,7 @@ static void * H5D_istore_chunk_alloc(size_t size, const H5O_pline_t *pline) { void *ret_value=NULL; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_chunk_alloc) assert(size); @@ -2513,7 +2513,7 @@ H5D_istore_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite) int space_ndims; /* Dataset's space rank */ hsize_t space_dim[H5O_LAYOUT_NDIMS]; /* Dataset's dataspace dimensions */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_istore_allocate, FAIL) /* Check args */ @@ -2682,7 +2682,7 @@ H5D_istore_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite) #endif /* H5_HAVE_PARALLEL */ } /* end if */ } /* end if */ - + /* Increment indices */ for (i=(int)dset->shared->layout.u.chunk.ndims-1, carry=1; i>=0 && carry; --i) { chunk_offset[i] += dset->shared->layout.u.chunk.dim[i]; @@ -2719,7 +2719,7 @@ done: * Function: H5D_istore_prune_by_extent * * Purpose: This function searches for chunks that are no longer necessary both in the - * raw data cache and in the B-tree. + * raw data cache and in the B-tree. * * Return: Success: 0, Failure: -1 * @@ -2732,12 +2732,12 @@ done: * * For chunks that are no longer necessary: * - * 1. Search in the raw data cache for each chunk + * 1. Search in the raw data cache for each chunk * 2. If found then preempt it from the cache - * 3. Search in the B-tree for each chunk + * 3. Search in the B-tree for each chunk * 4. If found then remove it from the B-tree and deallocate file storage for the chunk * - * This example shows a 2d dataset of 90x90 with a chunk size of 20x20. + * This example shows a 2d dataset of 90x90 with a chunk size of 20x20. * * * 0 20 40 60 80 90 100 @@ -2763,7 +2763,7 @@ done: * | : ::::::::::: : | : * 80+.........:.........:::::::::::.........:.....+...: O Fill Val * | : : ::::::::::: | : Explicitly - * | : : ::::::X:::: | : Written + * | : : ::::::X:::: | : Written * 90+---------+---------+---------+---------+-----+ : * : : : ::::::::::: : * 100:.........:.........:.........:::::::::::.........: @@ -2780,27 +2780,27 @@ done: * 0 20 40 60 70 80 90 100 * 0 +---------+---------+---------+----+----+-----+...+ * |:::::X:::::::::::::: : | : | : - * |:::::::X:::::::::::: : | : | : Key - * |::::::::::X::::::::: : | : | : -------- - * |::::::::::::X::::::: : | : | : +-+ Dataset - * 20+::::::::::::::::::::.........:....+....:.....|...: | | Extent - * | :::::X::::: : | : | : +-+ - * | ::::::::::: : | : | : - * | ::::::::::: : | : | : ... Chunk - * | :::::::X::: : | : | : : : Boundary - * 40+.........:::::::::::.........:....+....:.....|...: :.: - * | : : : | : | : - * | : : : | : | : ... Allocated - * | : : : | : | : ::: & Filled - * | : : : | : | : ::: Chunk - * 60+.........:.........:.........:....+....:.....|...: - * | : :::::::X::: | : | : X Element - * | : ::::::::::: | : | : Written - * +---------+---------+---------+----+ : | : - * | : ::::::::::: : | : - * 80+.........:.........:::::::::X:.........:.....|...: O Fill Val - * | : : ::::::::::: | : Explicitly - * | : : ::::::X:::: | : Written + * |:::::::X:::::::::::: : | : | : Key + * |::::::::::X::::::::: : | : | : -------- + * |::::::::::::X::::::: : | : | : +-+ Dataset + * 20+::::::::::::::::::::.........:....+....:.....|...: | | Extent + * | :::::X::::: : | : | : +-+ + * | ::::::::::: : | : | : + * | ::::::::::: : | : | : ... Chunk + * | :::::::X::: : | : | : : : Boundary + * 40+.........:::::::::::.........:....+....:.....|...: :.: + * | : : : | : | : + * | : : : | : | : ... Allocated + * | : : : | : | : ::: & Filled + * | : : : | : | : ::: Chunk + * 60+.........:.........:.........:....+....:.....|...: + * | : :::::::X::: | : | : X Element + * | : ::::::::::: | : | : Written + * +---------+---------+---------+----+ : | : + * | : ::::::::::: : | : + * 80+.........:.........:::::::::X:.........:.....|...: O Fill Val + * | : : ::::::::::: | : Explicitly + * | : : ::::::X:::: | : Written * 90+---------+---------+---------+---------+-----+ : * : : : ::::::::::: : * 100:.........:.........:.........:::::::::::.........: @@ -2808,7 +2808,7 @@ done: * * That means that the nine chunks along the bottom and right side should * no longer exist. Of those nine chunks, (0,80), (20,80), (40,80), - * (60,80), (80,80), (80,60), (80,40), (80,20), and (80,0), one is actually allocated + * (60,80), (80,80), (80,60), (80,40), (80,20), and (80,0), one is actually allocated * that needs to be released. * To release the chunks, we traverse the B-tree to obtain a list of unused * allocated chunks, and then call H5B_remove() for each chunk. @@ -2840,7 +2840,7 @@ H5D_istore_prune_by_extent(const H5D_io_info_t *io_info) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataset dimensions") /*------------------------------------------------------------------------- - * Figure out what chunks are no longer in use for the specified extent + * Figure out what chunks are no longer in use for the specified extent * and release them from the linked list raw data cache *------------------------------------------------------------------------- */ @@ -2892,7 +2892,7 @@ done: /*------------------------------------------------------------------------- * Function: H5D_istore_prune_extent * - * Purpose: Search for chunks that are no longer necessary in the B-tree. + * Purpose: Search for chunks that are no longer necessary in the B-tree. * * Return: Success: 0, Failure: -1 * @@ -2917,7 +2917,7 @@ H5D_istore_prune_extent(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t UN H5D_istore_ud1_t udata; int ret_value=H5B_ITER_CONT; /* Return value */ - /* The LT_KEY is the left key (the one that describes the chunk). It points to a chunk of + /* The LT_KEY is the left key (the one that describes the chunk). It points to a chunk of * storage that contains the beginning of the logical address space represented by UDATA. */ @@ -2951,7 +2951,7 @@ done: /*------------------------------------------------------------------------- * Function: H5D_istore_remove * - * Purpose: Removes chunks that are no longer necessary in the B-tree. + * Purpose: Removes chunks that are no longer necessary in the B-tree. * * Return: Success: 0, Failure: -1 * @@ -2996,7 +2996,7 @@ done: * Function: H5D_istore_initialize_by_extent * * Purpose: This function searches for chunks that have to be initialized with the fill - * value both in the raw data cache and in the B-tree. + * value both in the raw data cache and in the B-tree. * * Return: Success: 0, Failure: -1 * @@ -3004,12 +3004,12 @@ done: * * Date: April 4, 2002 * - * Comments: + * Comments: * * (See the example of H5D_istore_prune_by_extent) * Next, there are seven chunks where the database extent boundary is * within the chunk. We find those seven just like we did with the previous nine. - * Fot the ones that are allocated we initialize the part that lies outside the boundary + * Fot the ones that are allocated we initialize the part that lies outside the boundary * with the fill value. * * Modifications: @@ -3121,8 +3121,8 @@ H5D_istore_initialize_by_extent(H5D_io_info_t *io_info) naccessed *= sub_size[u]; } /* end for */ - /* - * Figure out what chunks have to be initialized. These are the chunks where the dataspace + /* + * Figure out what chunks have to be initialized. These are the chunks where the dataspace * extent boundary is within the chunk */ for(u = 0, found = 0; u < rank; u++) { @@ -3410,7 +3410,7 @@ H5D_istore_stats (H5D_t *dset, hbool_t headers) double miss_rate; char ascii[32]; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_istore_stats, FAIL) if (!H5DEBUG(AC)) @@ -3474,7 +3474,7 @@ H5D_istore_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int inden H5O_layout_t layout; H5D_istore_ud1_t udata; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_istore_debug,FAIL) layout.u.chunk.ndims = ndims; diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 479db17..43b736d 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -306,7 +306,7 @@ done: * * Return: non-negative on success, negative on failure. * - * Programmer: + * Programmer: * * Modifications: * @@ -336,7 +336,7 @@ H5D_mpio_select_read(H5D_io_info_t *io_info, * * Return: non-negative on success, negative on failure. * - * Programmer: + * Programmer: * * Modifications: * diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index 732af1f..df97218 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -39,7 +39,7 @@ /* Definitions for storage layout property */ #define H5D_CRT_LAYOUT_NAME "layout" #define H5D_CRT_LAYOUT_SIZE sizeof(H5D_layout_t) -#define H5D_CRT_LAYOUT_DEF H5D_CONTIGUOUS +#define H5D_CRT_LAYOUT_DEF H5D_CONTIGUOUS /* Definitions for chunk dimensionality property */ #define H5D_CRT_CHUNK_DIM_NAME "chunk_ndims" #define H5D_CRT_CHUNK_DIM_SIZE sizeof(unsigned) @@ -49,7 +49,7 @@ #define H5D_CRT_CHUNK_SIZE_SIZE sizeof(size_t[H5O_LAYOUT_NDIMS]) #define H5D_CRT_CHUNK_SIZE_DEF {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1} -/* Definitions for fill value. size=0 means fill value will be 0 as +/* Definitions for fill value. size=0 means fill value will be 0 as * library default; size=-1 means fill value is undefined. */ #define H5D_CRT_FILL_VALUE_NAME "fill_value" #define H5D_CRT_FILL_VALUE_SIZE sizeof(H5O_fill_t) @@ -65,7 +65,7 @@ /* Definitions for time of fill value writing */ #define H5D_CRT_FILL_TIME_NAME "fill_time" #define H5D_CRT_FILL_TIME_SIZE sizeof(H5D_fill_time_t) -#define H5D_CRT_FILL_TIME_DEF H5D_FILL_TIME_IFSET +#define H5D_CRT_FILL_TIME_DEF H5D_FILL_TIME_IFSET /* Definitions for external file list */ #define H5D_CRT_EXT_FILE_LIST_NAME "efl" #define H5D_CRT_EXT_FILE_LIST_SIZE sizeof(H5O_efl_t) @@ -74,7 +74,7 @@ /* Definitions for data filter pipeline */ #define H5D_CRT_DATA_PIPELINE_NAME "pline" #define H5D_CRT_DATA_PIPELINE_SIZE sizeof(H5O_pline_t) -#define H5D_CRT_DATA_PIPELINE_DEF {0, 0, NULL} +#define H5D_CRT_DATA_PIPELINE_DEF {0, 0, NULL} #define H5D_CRT_DATA_PIPELINE_CMP H5D_crt_data_pipeline_cmp /* ======== Data transfer properties ======== */ @@ -216,11 +216,11 @@ H5_DLL herr_t H5D_close(H5D_t *dataset); H5_DLL htri_t H5D_isa(H5G_entry_t *ent, hid_t dxpl_id); H5_DLL H5G_entry_t *H5D_entof(H5D_t *dataset); H5_DLL H5T_t *H5D_typeof(const H5D_t *dset); -H5_DLL herr_t H5D_crt_copy(hid_t new_plist_t, hid_t old_plist_t, +H5_DLL herr_t H5D_crt_copy(hid_t new_plist_t, hid_t old_plist_t, void *copy_data); H5_DLL herr_t H5D_crt_close(hid_t dxpl_id, void *close_data); H5_DLL herr_t H5D_xfer_create(hid_t dxpl_id, void *create_data); -H5_DLL herr_t H5D_xfer_copy(hid_t new_plist_id, hid_t old_plist_id, +H5_DLL herr_t H5D_xfer_copy(hid_t new_plist_id, hid_t old_plist_id, void *copy_data); H5_DLL herr_t H5D_xfer_close(hid_t dxpl_id, void *close_data); H5_DLL herr_t H5D_flush(const H5F_t *f, hid_t dxpl_id, unsigned flags); diff --git a/src/H5Dpublic.h b/src/H5Dpublic.h index 09556c2..3595bf2 100644 --- a/src/H5Dpublic.h +++ b/src/H5Dpublic.h @@ -39,7 +39,7 @@ typedef enum H5D_alloc_time_t { H5D_ALLOC_TIME_EARLY =1, H5D_ALLOC_TIME_LATE =2, H5D_ALLOC_TIME_INCR =3 -} H5D_alloc_time_t; +} H5D_alloc_time_t; /* Values for the status of space allocation */ typedef enum H5D_space_status_t { @@ -78,7 +78,7 @@ H5_DLL hid_t H5Dcreate (hid_t file_id, const char *name, hid_t type_id, H5_DLL hid_t H5Dopen (hid_t file_id, const char *name); H5_DLL herr_t H5Dclose (hid_t dset_id); H5_DLL hid_t H5Dget_space (hid_t dset_id); -H5_DLL herr_t H5Dget_space_status(hid_t dset_id, +H5_DLL herr_t H5Dget_space_status(hid_t dset_id, H5D_space_status_t *allocation); H5_DLL hid_t H5Dget_type (hid_t dset_id); H5_DLL hid_t H5Dget_create_plist (hid_t dset_id); diff --git a/src/H5Dselect.c b/src/H5Dselect.c index 125d22f..596937f 100644 --- a/src/H5Dselect.c +++ b/src/H5Dselect.c @@ -314,7 +314,7 @@ done: * Purpose: Gathers dataset elements from application memory BUF and * copies them into the gather buffer TGATH_BUF. * Each element is ELMT_SIZE bytes and arranged in application - * memory according to SPACE. + * memory according to SPACE. * The caller is requesting that at most NELMTS be gathered. * * Return: Success: Number of elements copied. @@ -447,7 +447,7 @@ H5D_select_read(H5D_io_info_t *io_info, assert(io_info->store); assert(buf); assert(TRUE==H5P_isa_class(io_info->dxpl_id,H5P_DATASET_XFER)); - + /* Initialize file iterator */ if (H5S_select_iter_init(&file_iter, file_space, elmt_size)<0) HGOTO_ERROR (H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator"); @@ -591,7 +591,7 @@ H5D_select_write(H5D_io_info_t *io_info, assert(io_info->store); assert(TRUE==H5P_isa_class(io_info->dxpl_id,H5P_DATASET_XFER)); assert(buf); - + /* Allocate the vector I/O arrays */ if(io_info->dxpl_cache->vec_size!=H5D_XFER_HYPER_VECTOR_SIZE_DEF) { if((mem_len = H5FL_SEQ_MALLOC(size_t,io_info->dxpl_cache->vec_size))==NULL) @@ -619,7 +619,7 @@ H5D_select_write(H5D_io_info_t *io_info, if (H5S_select_iter_init(&mem_iter, mem_space, elmt_size)<0) HGOTO_ERROR (H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator"); mem_iter_init=1; /* Memory selection iteration info has been initialized */ - + /* Initialize sequence counts */ curr_mem_seq=curr_file_seq=0; mem_nseq=file_nseq=0; diff --git a/src/H5E.c b/src/H5E.c index e1d2b18..a3a363c 100644 --- a/src/H5E.c +++ b/src/H5E.c @@ -93,7 +93,7 @@ int H5E_mpi_error_str_len; #endif /* Static function declarations */ -static H5E_cls_t *H5E_register_class(const char *cls_name, const char *lib_name, +static H5E_cls_t *H5E_register_class(const char *cls_name, const char *lib_name, const char *version); static herr_t H5E_unregister_class(H5E_cls_t *cls); static ssize_t H5E_get_class_name(const H5E_cls_t *cls, char *name, size_t size); @@ -108,7 +108,7 @@ static ssize_t H5E_get_num(const H5E_t *err_stack); static herr_t H5E_pop(H5E_t *err_stack, size_t count); static herr_t H5E_clear_entries(H5E_t *estack, size_t nentries); static herr_t H5E_print_stack(const H5E_t *estack, FILE *stream); -static herr_t H5E_walk_stack(const H5E_t *estack, H5E_direction_t direction, H5E_walk_t func, +static herr_t H5E_walk_stack(const H5E_t *estack, H5E_direction_t direction, H5E_walk_t func, void *client_data); static herr_t H5E_walk_cb(unsigned n, const H5E_error_t *err_desc, void *client_data); static herr_t H5E_get_auto_stack(const H5E_t *estack, hbool_t new_api, void **func, void **client_data); @@ -161,7 +161,7 @@ done: * * Programmer: Raymond Lu * Friday, July 11, 2003 - * + * *-------------------------------------------------------------------------- */ static herr_t @@ -175,15 +175,15 @@ H5E_init_interface(void) FUNC_ENTER_NOAPI_NOINIT(H5E_init_interface) /* Initialize the atom group for the error class IDs */ - if(H5I_register_type(H5I_ERROR_CLASS, H5I_ERRCLS_HASHSIZE, H5E_RESERVED_ATOMS, + if(H5I_register_type(H5I_ERROR_CLASS, H5I_ERRCLS_HASHSIZE, H5E_RESERVED_ATOMS, (H5I_free_t)H5E_unregister_class)0) H5I_clear_type(H5I_ERROR_STACK, FALSE); - + /* Clear all the error classes */ if (ncls>0) { H5I_clear_type(H5I_ERROR_CLASS, FALSE); - + /* Reset the HDF5 error class, if its been closed */ if(H5I_nmembers(H5I_ERROR_CLASS)==0) H5E_ERR_CLS_g = -1; } - + /* Clear all the error messages */ if (nmsg>0) { H5I_clear_type(H5I_ERROR_MSG, FALSE); - + /* Reset the HDF5 error messages, if they've been closed */ if(H5I_nmembers(H5I_ERROR_MSG)==0) { /* Include the automatically generated error code termination */ @@ -352,7 +352,7 @@ H5Eregister_class(const char *cls_name, const char *lib_name, const char *versio FUNC_ENTER_API(H5Eregister_class, FAIL) H5TRACE3("i","sss",cls_name,lib_name,version); - + /* Check arguments */ if (cls_name==NULL || lib_name==NULL || version==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid string") @@ -389,9 +389,9 @@ H5E_register_class(const char *cls_name, const char *lib_name, const char *versi { H5E_cls_t *cls; /* Pointer to error class */ H5E_cls_t *ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5E_register_class) - + /* Check arguments */ assert(cls_name); assert(lib_name); @@ -438,7 +438,7 @@ H5Eunregister_class(hid_t class_id) FUNC_ENTER_API(H5Eunregister_class, FAIL) H5TRACE1("e","i",class_id); - + /* Check arguments */ if (H5I_ERROR_CLASS != H5I_get_type(class_id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an error class") @@ -482,14 +482,14 @@ H5E_unregister_class(H5E_cls_t *cls) (void)H5I_search(H5I_ERROR_MSG, H5E_close_msg_cb, cls); /* Free error class structure */ - if(cls->cls_name) + if(cls->cls_name) H5MM_xfree((void*)cls->cls_name); if(cls->lib_name) H5MM_xfree((void*)cls->lib_name); if(cls->lib_vers) H5MM_xfree((void*)cls->lib_vers); H5FL_FREE(H5E_cls_t, cls); - + FUNC_LEAVE_NOAPI(SUCCEED) } @@ -500,7 +500,7 @@ H5E_unregister_class(H5E_cls_t *cls) * Purpose: Retrieves error class name. * * Return: Non-negative for name length if succeeds(zero means no name); - * otherwise returns negative value. + * otherwise returns negative value. * * Programmer: Raymond Lu * Friday, July 11, 2003 @@ -517,7 +517,7 @@ H5Eget_class_name(hid_t class_id, char *name, size_t size) FUNC_ENTER_API(H5Eget_class_name, FAIL) H5TRACE3("Zs","isz",class_id,name,size); - + /* Get the error class */ if(NULL==(cls = H5I_object_verify(class_id, H5I_ERROR_CLASS))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error class ID") @@ -535,9 +535,9 @@ done: * Function: H5E_get_class_name * * Purpose: Private function to retrieve error class name. - * + * * Return: Non-negative for name length if succeeds(zero means no name); - * otherwise returns negative value. + * otherwise returns negative value. * * Programmer: Raymond Lu * Friday, July 11, 2003 @@ -550,7 +550,7 @@ static ssize_t H5E_get_class_name(const H5E_cls_t *cls, char *name, size_t size) { ssize_t len; /* Length of rror class's name */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_get_class_name) /* Check arguments */ @@ -564,8 +564,8 @@ H5E_get_class_name(const H5E_cls_t *cls, char *name, size_t size) HDstrncpy(name, cls->cls_name, MIN((size_t)(len+1), size)); if((size_t)len >= size) name[size-1]='\0'; - } - + } + /* Return the full length */ FUNC_LEAVE_NOAPI(len) } @@ -579,7 +579,7 @@ H5E_get_class_name(const H5E_cls_t *cls, char *name, size_t size) * * Programmer: Raymond Lu * July 14, 2003 - * + * * Return: Non-negative value on success/Negative on failure * * Modifications: @@ -592,9 +592,9 @@ H5E_close_msg_cb(void *obj_ptr, hid_t obj_id, void *key) H5E_msg_t *err_msg = (H5E_msg_t*)obj_ptr; H5E_cls_t *cls = (H5E_cls_t*)key; herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5E_close_msg_cb) - + /* Check arguments */ assert(err_msg); @@ -602,7 +602,7 @@ H5E_close_msg_cb(void *obj_ptr, hid_t obj_id, void *key) if(err_msg->cls == cls) if(H5I_dec_ref(obj_id)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTDEC, FAIL, "unable to decrement ref count on error message") - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -626,7 +626,7 @@ herr_t H5Eclose_msg(hid_t err_id) { herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Eclose_msg, FAIL) H5TRACE1("e","i",err_id); @@ -664,7 +664,7 @@ H5E_close_msg(H5E_msg_t *err) /* Check arguments */ assert(err); - if(err->msg) + if(err->msg) H5MM_xfree((void*)err->msg); /* Don't free err->cls here */ @@ -693,10 +693,10 @@ H5Ecreate_msg(hid_t class_id, H5E_type_t msg_type, const char *msg_str) H5E_cls_t *cls; /* Pointer to error class */ H5E_msg_t *msg; /* Pointer to new error message */ hid_t ret_value; /* Return value */ - + FUNC_ENTER_API(H5Ecreate_msg, FAIL) H5TRACE3("i","iEts",class_id,msg_type,msg_str); - + /* Check arguments */ if(msg_type!=H5E_MAJOR && msg_type!=H5E_MINOR) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a valid message type") @@ -738,9 +738,9 @@ H5E_create_msg(H5E_cls_t *cls, H5E_type_t msg_type, const char *msg_str) { H5E_msg_t *msg; /* Pointer to new error message */ H5E_msg_t *ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5E_create_msg) - + /* Check arguments */ assert(cls); assert(msg_type==H5E_MAJOR || msg_type==H5E_MINOR); @@ -770,7 +770,7 @@ done: * Purpose: Retrieves a major error message. * * Return: Returns message if succeeds. - * otherwise returns NULL. + * otherwise returns NULL. * * Programmer: Raymond Lu * Friday, July 14, 2003 @@ -789,7 +789,7 @@ H5Eget_major(H5E_major_t maj) char *ret_value = NULL; FUNC_ENTER_API_NOCLEAR(H5Eget_major,NULL) - + /* Get the message object */ if((msg = H5I_object_verify(maj, H5I_ERROR_MSG))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a error message ID") @@ -797,7 +797,7 @@ H5Eget_major(H5E_major_t maj) /* Get the message's text */ if((size = H5E_get_msg(msg, &type, NULL, 0))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, NULL, "can't get error message text"); - + if(type != H5E_MAJOR) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, NULL, "Error message isn't a major one"); @@ -808,7 +808,7 @@ H5Eget_major(H5E_major_t maj) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, NULL, "can't get error message text") ret_value = msg_str; - + done: FUNC_LEAVE_API(ret_value) } @@ -820,7 +820,7 @@ done: * Purpose: Retrieves a minor error message. * * Return: Returns message if succeeds. - * otherwise returns NULL. + * otherwise returns NULL. * * Programmer: Raymond Lu * Friday, July 14, 2003 @@ -839,7 +839,7 @@ H5Eget_minor(H5E_minor_t min) char *ret_value = NULL; FUNC_ENTER_API_NOCLEAR(H5Eget_minor,NULL) - + /* Get the message object */ if((msg = H5I_object_verify(min, H5I_ERROR_MSG))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a error message ID") @@ -847,10 +847,10 @@ H5Eget_minor(H5E_minor_t min) /* Get the message's text */ if((size = H5E_get_msg(msg, &type, NULL, 0))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, NULL, "can't get error message text"); - + if(type != H5E_MINOR) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, NULL, "Error message isn't a minor one"); - + /* Don't know who is going to free it */ msg_str = (char*)H5MM_malloc((size_t)(++size)*sizeof(char)); @@ -858,7 +858,7 @@ H5Eget_minor(H5E_minor_t min) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, NULL, "can't get error message text") ret_value = msg_str; - + done: FUNC_LEAVE_API(ret_value) } @@ -870,7 +870,7 @@ done: * Purpose: Retrieves an error message. * * Return: Non-negative for message length if succeeds(zero means no message); - * otherwise returns negative value. + * otherwise returns negative value. * * Programmer: Raymond Lu * Friday, July 14, 2003 @@ -887,7 +887,7 @@ H5Eget_msg(hid_t msg_id, H5E_type_t *type, char *msg_str, size_t size) FUNC_ENTER_API(H5Eget_msg, FAIL) H5TRACE4("Zs","i*Etsz",msg_id,type,msg_str,size); - + /* Get the message object */ if((msg = H5I_object_verify(msg_id, H5I_ERROR_MSG))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error message ID") @@ -905,9 +905,9 @@ done: * Function: H5E_get_msg * * Purpose: Private function to retrieve an error message. - * + * * Return: Non-negative for name length if succeeds(zero means no name); - * otherwise returns negative value. + * otherwise returns negative value. * * Programmer: Raymond Lu * Friday, July 14, 2003 @@ -920,7 +920,7 @@ static ssize_t H5E_get_msg(const H5E_msg_t *msg, H5E_type_t *type, char *msg_str, size_t size) { ssize_t len; /* Length of rror class's name */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_get_msg) /* Check arguments */ @@ -934,8 +934,8 @@ H5E_get_msg(const H5E_msg_t *msg, H5E_type_t *type, char *msg_str, size_t size) HDstrncpy(msg_str, msg->msg, MIN((size_t)(len+1), size)); if((size_t)len >= size) msg_str[size-1]='\0'; - } - + } + /* Give the message type, if asked */ if(type) *type = msg->type; @@ -969,7 +969,7 @@ H5Eget_current_stack(void) /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(H5Eget_current_stack, FAIL) H5TRACE0("i",""); - + /* Get the current stack */ if((stk=H5E_get_current_stack())==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTCREATE, FAIL, "can't create error stack") @@ -1004,7 +1004,7 @@ H5E_get_current_stack(void) H5E_t *estack_copy=NULL; /* Pointer to new error stack to return */ unsigned u; /* Local index variable */ H5E_t *ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5E_get_current_stack) /* Get a pointer to the current error stack */ @@ -1016,24 +1016,24 @@ H5E_get_current_stack(void) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Make a copy of current error stack */ - estack_copy->nused = current_stack->nused; + estack_copy->nused = current_stack->nused; for(u=0; unused; u++) { H5E_error_t *current_error, *new_error; /* Pointers to errors on each stack */ /* Get pointers into the current error stack location */ current_error = &(current_stack->slot[u]); new_error = &(estack_copy->slot[u]); - + /* Increment the IDs to indicate that they are used in this stack */ if(H5I_inc_ref(current_error->cls_id)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, NULL, "unable to increment ref count on error class") - new_error->cls_id = current_error->cls_id; + new_error->cls_id = current_error->cls_id; if(H5I_inc_ref(current_error->maj_num)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, NULL, "unable to increment ref count on error message") - new_error->maj_num = current_error->maj_num; + new_error->maj_num = current_error->maj_num; if(H5I_inc_ref(current_error->min_num)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, NULL, "unable to increment ref count on error message") - new_error->min_num = current_error->min_num; + new_error->min_num = current_error->min_num; if((new_error->func_name = HDstrdup(current_error->func_name))==NULL) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") if((new_error->file_name = HDstrdup(current_error->file_name))==NULL) @@ -1042,10 +1042,10 @@ H5E_get_current_stack(void) if((new_error->desc = HDstrdup(current_error->desc))==NULL) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") } /* end for */ - - /* Empty current error stack */ + + /* Empty current error stack */ H5E_clear_stack(current_stack); - + /* Set the return value */ ret_value = estack_copy; @@ -1062,7 +1062,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Eset_current_stack * - * Purpose: Replaces current stack with specified stack. + * Purpose: Replaces current stack with specified stack. * * Return: Non-negative value on success/Negative on failure * @@ -1078,10 +1078,10 @@ H5Eset_current_stack(hid_t err_stack) { H5E_t *estack; herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Eset_current_stack, FAIL) H5TRACE1("e","i",err_stack); - + if(err_stack != H5E_DEFAULT) { if((estack = H5I_object_verify(err_stack, H5I_ERROR_STACK))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error stack ID") @@ -1116,7 +1116,7 @@ H5E_set_current_stack(H5E_t *estack) H5E_t *current_stack; /* Default error stack */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5E_set_current_stack) /* Sanity check */ @@ -1126,18 +1126,18 @@ H5E_set_current_stack(H5E_t *estack) if((current_stack = H5E_get_my_stack ())==NULL) /*lint !e506 !e774 Make lint 'constant value Boolean' in non-threaded case */ HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack") - /* Empty current error stack */ + /* Empty current error stack */ H5E_clear_stack(current_stack); /* Copy new stack to current error stack */ - current_stack->nused = estack->nused; + current_stack->nused = estack->nused; for(u=0; unused; u++) { H5E_error_t *current_error, *new_error; /* Pointers to errors on each stack */ /* Get pointers into the current error stack location */ current_error = &(current_stack->slot[u]); new_error = &(estack->slot[u]); - + /* Increment the IDs to indicate that they are used in this stack */ if(H5I_inc_ref(new_error->cls_id)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, FAIL, "unable to decrement ref count on error class") @@ -1220,7 +1220,7 @@ static herr_t H5E_close_stack(H5E_t *estack) { FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_close_stack) - + /* Sanity check */ assert(estack); @@ -1229,7 +1229,7 @@ H5E_close_stack(H5E_t *estack) /* Free the stack structure */ H5FL_FREE(H5E_t, estack); - + FUNC_LEAVE_NOAPI(SUCCEED) } @@ -1260,7 +1260,7 @@ H5Eget_num(hid_t error_stack_id) /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(H5Eget_num, FAIL) H5TRACE1("Is","i",error_stack_id); - + /* Need to check for errors */ if(error_stack_id == H5E_DEFAULT) { if((estack = H5E_get_my_stack())==NULL) /*lint !e506 !e774 Make lint 'constant value Boolean' in non-threaded case */ @@ -1274,7 +1274,7 @@ H5Eget_num(hid_t error_stack_id) if((estack = H5I_object_verify(error_stack_id, H5I_ERROR_STACK))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error stack ID") } /* end else */ - + /* Get the number of errors on stack */ if((ret_value=H5E_get_num(estack))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get number of errors") @@ -1305,8 +1305,8 @@ static ssize_t H5E_get_num(const H5E_t *estack) { FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_get_num) - - assert(estack); + + assert(estack); FUNC_LEAVE_NOAPI((ssize_t)estack->nused) } @@ -1335,7 +1335,7 @@ H5Epop(hid_t err_stack, size_t count) /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(H5Epop, FAIL) H5TRACE2("e","iz",err_stack,count); - + /* Need to check for errors */ if(err_stack == H5E_DEFAULT) { if((estack = H5E_get_my_stack())==NULL) /*lint !e506 !e774 Make lint 'constant value Boolean' in non-threaded case */ @@ -1382,7 +1382,7 @@ static herr_t H5E_pop(H5E_t *estack, size_t count) { herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5E_pop) /* Sanity check */ @@ -1403,17 +1403,17 @@ done: * * Purpose: This function definition is for backward compatibility only. * It doesn't have error stack and error class as parameters. - * The old definition of major and minor is casted as HID_T - * in H5Epublic.h + * The old definition of major and minor is casted as HID_T + * in H5Epublic.h * * Return: Non-negative on success/Negative on failure * * Programmer: Raymond Lu * Tuesday, Sep 16, 2003 * - * Notes: Basically a public API wrapper around the H5E_push_stack + * Notes: Basically a public API wrapper around the H5E_push_stack * function. For backward compatibility, it maintains the - * same parameter as the old function, in contrary to + * same parameter as the old function, in contrary to * H5Epush_stack. * * Modifications: @@ -1421,7 +1421,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Epush(const char *file, const char *func, unsigned line, +H5Epush(const char *file, const char *func, unsigned line, H5E_major_t maj, H5E_minor_t min, const char *str) { H5E_t *estack = NULL; /* Default error stack */ @@ -1430,7 +1430,7 @@ H5Epush(const char *file, const char *func, unsigned line, /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(H5Epush, FAIL) H5TRACE6("e","ssIuiis",file,func,line,maj,min,str); - + /* Push the error on the stack */ if(H5E_push_stack(estack, file, func, line, H5E_ERR_CLS_g, maj, min, str)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTSET, FAIL, "can't push error on stack") @@ -1456,7 +1456,7 @@ done: * Programmer: Quincey Koziol * Monday, October 18, 1999 * - * Notes: Basically a new public API wrapper around the H5E_push_stack + * Notes: Basically a new public API wrapper around the H5E_push_stack * function. * * Modifications: @@ -1470,7 +1470,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Epush_stack(hid_t err_stack, const char *file, const char *func, unsigned line, +H5Epush_stack(hid_t err_stack, const char *file, const char *func, unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *fmt, ...) { va_list ap; /* Varargs info */ @@ -1486,7 +1486,7 @@ H5Epush_stack(hid_t err_stack, const char *file, const char *func, unsigned line /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(H5Epush_stack, FAIL) H5TRACE7("e","issIuiis",err_stack,file,func,line,maj_id,min_id,fmt); - + if(err_stack == H5E_DEFAULT) estack = NULL; else { @@ -1497,7 +1497,7 @@ H5Epush_stack(hid_t err_stack, const char *file, const char *func, unsigned line if((estack = H5I_object_verify(err_stack, H5I_ERROR_STACK))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error stack ID") } /* end else */ - + /* Check for mis-matches in major & minor error classes */ if((maj_ptr = H5I_object_verify(maj_id, H5I_ERROR_MSG))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error message ID") @@ -1581,10 +1581,10 @@ done: * Programmer: Robb Matzke * Friday, December 12, 1997 * - * Modifications: + * Modifications: * Raymond Lu * Tuesday, July 15, 2003 - * + * * Added the ID of the error stack to which the error is pushed * on. The error message can be appended more message in the * same control format as printf and fprintf. @@ -1592,7 +1592,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5E_push_stack(H5E_t *estack, const char *file, const char *func, unsigned line, +H5E_push_stack(H5E_t *estack, const char *file, const char *func, unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *desc) { herr_t ret_value=SUCCEED; /* Return value */ @@ -1675,7 +1675,7 @@ H5Eclear(void) { H5E_t *estack = NULL; /* Default error stack to operate on */ herr_t ret_value=SUCCEED; /* Return value */ - + /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(H5Eclear, FAIL) H5TRACE0("e",""); @@ -1708,7 +1708,7 @@ H5Eclear_stack(hid_t err_stack) { H5E_t *estack; /* Error stack to operate on */ herr_t ret_value=SUCCEED; /* Return value */ - + /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(H5Eclear_stack, FAIL) H5TRACE1("e","i",err_stack); @@ -1723,7 +1723,7 @@ H5Eclear_stack(hid_t err_stack) if((estack = H5I_object_verify(err_stack, H5I_ERROR_STACK))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error stack ID") } /* end else */ - + /* Clear the error stack */ if(H5E_clear_stack(estack)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTSET, FAIL, "can't clear error stack") @@ -1761,7 +1761,7 @@ H5E_clear_entries(H5E_t *estack, size_t nentries) assert(estack); assert(estack->nused>=nentries); - /* Empty the error stack from the top down */ + /* Empty the error stack from the top down */ for(u=0; nentries>0; nentries--,u++) { error = &(estack->slot[estack->nused-(u+1)]); @@ -1785,7 +1785,7 @@ H5E_clear_entries(H5E_t *estack, size_t nentries) /* Decrement number of errors on stack */ estack->nused-=u; - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -1818,12 +1818,12 @@ H5E_clear_stack(H5E_t *estack) if((estack = H5E_get_my_stack())==NULL) /*lint !e506 !e774 Make lint 'constant value Boolean' in non-threaded case */ HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack") - /* Empty the error stack */ + /* Empty the error stack */ assert(estack); if(estack->nused) if(H5E_clear_entries(estack, estack->nused)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTSET, FAIL, "can't clear error stack") - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -1855,14 +1855,14 @@ H5Eprint(FILE *stream) { H5E_t *estack; /* Error stack to operate on */ herr_t ret_value=SUCCEED; /* Return value */ - + /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(H5Eprint, FAIL) /*NO TRACE*/ if((estack = H5E_get_my_stack())==NULL) /*lint !e506 !e774 Make lint 'constant value Boolean' in non-threaded case */ HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack") - + /* Print error stack */ if(H5E_print_stack(estack, stream)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTLIST, FAIL, "can't display error stack") @@ -1895,7 +1895,7 @@ done: * Print for specified error stack. A line will appear before the error * messages of each error class. It states the information of library * name, version number and thread ID. - * + * *------------------------------------------------------------------------- */ herr_t @@ -1903,7 +1903,7 @@ H5Eprint_stack(hid_t err_stack, FILE *stream) { H5E_t *estack; /* Error stack to operate on */ herr_t ret_value=SUCCEED; /* Return value */ - + /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(H5Eprint_stack, FAIL) /*NO TRACE*/ @@ -1920,7 +1920,7 @@ H5Eprint_stack(hid_t err_stack, FILE *stream) if((estack = H5I_object_verify(err_stack, H5I_ERROR_STACK))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error stack ID") } /* end else */ - + /* Print error stack */ if(H5E_print_stack(estack, stream)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTLIST, FAIL, "can't display error stack") @@ -1933,10 +1933,10 @@ done: /*------------------------------------------------------------------------- * Function: H5E_print_stack * - * Purpose: Private function to print the error stack in some default + * Purpose: Private function to print the error stack in some default * way. This is just a convenience function for H5Ewalk() and - * H5Ewalk_stack() with a function that prints error messages. - * Users are encouraged to write there own more specific error + * H5Ewalk_stack() with a function that prints error messages. + * Users are encouraged to write there own more specific error * handlers. * * Return: Non-negative on success/Negative on failure @@ -1954,7 +1954,7 @@ done: * Print for specified error stack. A line will appear before the error * messages of each error class. It states the information of library * name, version number and thread ID. - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1965,23 +1965,23 @@ H5E_print_stack(const H5E_t *estack, FILE *stream) /* Don't clear the error stack! :-) */ FUNC_ENTER_NOAPI_NOINIT(H5E_print_stack) - + /* Sanity check */ assert(estack); /* If no stream was given, use stderr */ - if (!stream) + if (!stream) eprint.stream = stderr; else eprint.stream = stream; /* Reset the original error class information */ HDmemset(&eprint.cls,0,sizeof(H5E_cls_t)); - + /* Walk the error stack */ if(H5E_walk_stack(estack, H5E_WALK_DOWNWARD, H5E_walk_cb, (void*)&eprint)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTLIST, FAIL, "can't walk error stack") - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -2041,7 +2041,7 @@ done: * Raymond Lu * Wednesday, July 16, 2003 * Let it walk through specified error stack. - * + * *------------------------------------------------------------------------- */ herr_t @@ -2104,7 +2104,7 @@ done: * Raymond Lu * Wednesday, July 16, 2003 * Let it walk through specified error stack. - * + * *------------------------------------------------------------------------- */ static herr_t @@ -2138,7 +2138,7 @@ H5E_walk_stack(const H5E_t *estack, H5E_direction_t direction, H5E_walk_t func, if(status<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTLIST, FAIL, "can't walk error stack") } /* end if */ - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -2197,7 +2197,7 @@ H5E_walk_cb(unsigned n, const H5E_error_t *err_desc, void *client_data) /* If no client data was passed, output to stderr */ if (!client_data) stream = stderr; else stream = eprint->stream; - + /* Get descriptions for the major and minor error numbers */ maj_ptr = H5I_object_verify(err_desc->maj_num, H5I_ERROR_MSG); min_ptr = H5I_object_verify(err_desc->min_num, H5I_ERROR_MSG); @@ -2209,7 +2209,7 @@ H5E_walk_cb(unsigned n, const H5E_error_t *err_desc, void *client_data) /* Get error class info */ cls_ptr = maj_ptr->cls; - + /* Print error class header if new class */ if(eprint->cls.lib_name==NULL || HDstrcmp(cls_ptr->lib_name, eprint->cls.lib_name)) { /* update to the new class information */ @@ -2218,7 +2218,7 @@ H5E_walk_cb(unsigned n, const H5E_error_t *err_desc, void *client_data) if(cls_ptr->lib_vers) eprint->cls.lib_vers = cls_ptr->lib_vers; fprintf (stream, "%s-DIAG: Error detected in %s (%s) ", cls_ptr->cls_name, cls_ptr->lib_name, cls_ptr->lib_vers); - + /* try show the process or thread id in multiple processes cases*/ #ifdef H5_HAVE_PARALLEL { int mpi_rank, mpi_initialized; @@ -2262,15 +2262,15 @@ H5E_walk_cb(unsigned n, const H5E_error_t *err_desc, void *client_data) * * Purpose: This function is for backward compatbility. * Returns the current settings for the automatic error stack - * traversal function and its data for specific error stack. - * Either (or both) arguments may be null in which case the + * traversal function and its data for specific error stack. + * Either (or both) arguments may be null in which case the * value is not returned. * * Return: Non-negative on success/Negative on failure * * Programmer: Raymond Lu * Sep 16, 2003 - * + * * Modifications: * *------------------------------------------------------------------------- @@ -2280,11 +2280,11 @@ H5Eget_auto(H5E_auto_t *func, void **client_data) { H5E_t *estack; /* Error stack to operate on */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Eget_auto, FAIL) H5TRACE2("e","*xx",func,client_data); - /* Retrieve default error stack */ + /* Retrieve default error stack */ if((estack = H5E_get_my_stack())==NULL) /*lint !e506 !e774 Make lint 'constant value Boolean' in non-threaded case */ HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack") @@ -2301,8 +2301,8 @@ done: * Function: H5Eget_auto_stack * * Purpose: Returns the current settings for the automatic error stack - * traversal function and its data for specific error stack. - * Either (or both) arguments may be null in which case the + * traversal function and its data for specific error stack. + * Either (or both) arguments may be null in which case the * value is not returned. * * Return: Non-negative on success/Negative on failure @@ -2313,7 +2313,7 @@ done: * Modifications: * Raymond Lu * July 18, 2003 - * Added error stack in the parameters. It returns the + * Added error stack in the parameters. It returns the * traversal function and data for that error stack. * *------------------------------------------------------------------------- @@ -2323,10 +2323,10 @@ H5Eget_auto_stack(hid_t estack_id, H5E_auto_stack_t *func, void **client_data) { H5E_t *estack; /* Error stack to operate on */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Eget_auto_stack, FAIL) H5TRACE3("e","i*xx",estack_id,func,client_data); - + if(estack_id == H5E_DEFAULT) { if((estack = H5E_get_my_stack())==NULL) /*lint !e506 !e774 Make lint 'constant value Boolean' in non-threaded case */ HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack") @@ -2347,9 +2347,9 @@ done: /*------------------------------------------------------------------------- * Function: H5E_get_auto_stack * - * Purpose: Private function to return the current settings for the - * automatic error stack traversal function and its data - * for specific error stack. Either (or both) arguments may + * Purpose: Private function to return the current settings for the + * automatic error stack traversal function and its data + * for specific error stack. Either (or both) arguments may * be null in which case the value is not returned. * * Return: Non-negative on success/Negative on failure @@ -2367,7 +2367,7 @@ H5E_get_auto_stack(const H5E_t *estack, hbool_t new_api, void * *func, void **cl FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_get_auto_stack) assert (estack); - + /* Retrieve the requested information */ if(func) *func = new_api ? (void *)estack->u.func_stack : (void *)estack->u.func; @@ -2382,8 +2382,8 @@ H5E_get_auto_stack(const H5E_t *estack, hbool_t new_api, void * *func, void **cl * Function: H5Eset_auto * * Purpose: This function is for backward compatbility. - * Turns on or off automatic printing of errors for certain - * error stack. When turned on (non-null FUNC pointer) any + * Turns on or off automatic printing of errors for certain + * error stack. When turned on (non-null FUNC pointer) any * API function which returns an error indication will first * call FUNC passing it CLIENT_DATA as an argument. * @@ -2393,7 +2393,7 @@ H5E_get_auto_stack(const H5E_t *estack, hbool_t new_api, void * *func, void **cl * * Automatic stack traversal is always in the H5E_WALK_DOWNWARD * direction. - * + * * See Also: H5Ewalk() * * Return: Non-negative on success/Negative on failure @@ -2410,13 +2410,13 @@ H5Eset_auto(H5E_auto_t func, void *client_data) { H5E_t *estack; /* Error stack to operate on */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Eset_auto, FAIL) H5TRACE2("e","xx",func,client_data); if((estack = H5E_get_my_stack())==NULL) /*lint !e506 !e774 Make lint 'constant value Boolean' in non-threaded case */ HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack") - + /* Set the automatic error reporting information */ if(H5E_set_auto_stack(estack, FALSE, (void *)func, client_data)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTSET, FAIL, "can't set automatic error info") @@ -2429,8 +2429,8 @@ done: /*------------------------------------------------------------------------- * Function: H5Eset_auto_stack * - * Purpose: Turns on or off automatic printing of errors for certain - * error stack. When turned on (non-null FUNC pointer) any + * Purpose: Turns on or off automatic printing of errors for certain + * error stack. When turned on (non-null FUNC pointer) any * API function which returns an error indication will first * call FUNC passing it CLIENT_DATA as an argument. * @@ -2440,7 +2440,7 @@ done: * * Automatic stack traversal is always in the H5E_WALK_DOWNWARD * direction. - * + * * See Also: H5Ewalk() * * Return: Non-negative on success/Negative on failure @@ -2457,7 +2457,7 @@ H5Eset_auto_stack(hid_t estack_id, H5E_auto_stack_t func, void *client_data) { H5E_t *estack; /* Error stack to operate on */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Eset_auto_stack, FAIL) H5TRACE3("e","ixx",estack_id,func,client_data); @@ -2468,7 +2468,7 @@ H5Eset_auto_stack(hid_t estack_id, H5E_auto_stack_t func, void *client_data) else if((estack = H5I_object_verify(estack_id, H5I_ERROR_STACK))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error stack ID") - + /* Set the automatic error reporting information */ if(H5E_set_auto_stack(estack, TRUE, (void *)func, client_data)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTSET, FAIL, "can't set automatic error info") @@ -2481,10 +2481,10 @@ done: /*------------------------------------------------------------------------- * Function: H5E_set_auto_stack * - * Purpose: Private function to turn on or off automatic printing of - * errors for certain error stack. When turned on (non-null - * FUNC pointer) any API function which returns an error - * indication will first call FUNC passing it CLIENT_DATA + * Purpose: Private function to turn on or off automatic printing of + * errors for certain error stack. When turned on (non-null + * FUNC pointer) any API function which returns an error + * indication will first call FUNC passing it CLIENT_DATA * as an argument. * * The default values before this function is called are @@ -2493,7 +2493,7 @@ done: * * Automatic stack traversal is always in the H5E_WALK_DOWNWARD * direction. - * + * * See Also: H5Ewalk() * * Return: Non-negative on success/Negative on failure @@ -2530,7 +2530,7 @@ H5E_set_auto_stack(H5E_t *estack, hbool_t new_api, void *func, void *client_data * Purpose: Private function to dump the error stack during an error in * an API function if a callback function is defined for the * current error stack. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol @@ -2574,7 +2574,7 @@ done: * error stack conforms to the H5E_auto_stack_t typedef * or the H5E_auto_t typedef. The IS_STACK parameter is set * to 1 for the first case and 0 for the latter case. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol @@ -2589,7 +2589,7 @@ H5Eauto_is_stack(hid_t estack_id, unsigned *is_stack) { H5E_t *estack; /* Error stack to operate on */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Eauto_is_stack, FAIL) H5TRACE2("e","i*Iu",estack_id,is_stack); @@ -2600,7 +2600,7 @@ H5Eauto_is_stack(hid_t estack_id, unsigned *is_stack) else if((estack = H5I_object_verify(estack_id, H5I_ERROR_STACK))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error stack ID") - + /* Check if the error stack reporting function is the "newer" stack type */ if(is_stack) *is_stack=estack->new_api; diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h index a1d8f0b..0c99f9f 100644 --- a/src/H5Eprivate.h +++ b/src/H5Eprivate.h @@ -113,7 +113,7 @@ typedef struct H5E_print_t { /* Library-private functions defined in H5E package */ H5_DLL herr_t H5E_init(void); -H5_DLL herr_t H5E_push_stack(H5E_t *estack, const char *file, const char *func, unsigned line, +H5_DLL herr_t H5E_push_stack(H5E_t *estack, const char *file, const char *func, unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *desc); H5_DLL herr_t H5E_clear_stack(H5E_t *estack); H5_DLL herr_t H5E_dump_api_stack(int is_api); diff --git a/src/H5Epublic.h b/src/H5Epublic.h index 883e8c6..001f0a5 100644 --- a/src/H5Epublic.h +++ b/src/H5Epublic.h @@ -162,10 +162,10 @@ H5_DLL herr_t H5Eauto_is_stack(hid_t err_stack, unsigned *is_stack); /* These old APIs are kept for backward compatibility. They don't have * the error stack in the parameters. */ -H5_DLL herr_t H5Epush(const char *file, const char *func, unsigned line, +H5_DLL herr_t H5Epush(const char *file, const char *func, unsigned line, H5E_major_t maj, H5E_minor_t min, const char *str); H5_DLL herr_t H5Eprint(FILE *stream); -H5_DLL herr_t H5Ewalk(H5E_direction_t direction, H5E_walk_t func, +H5_DLL herr_t H5Ewalk(H5E_direction_t direction, H5E_walk_t func, void *client_data); H5_DLL herr_t H5Eget_auto(H5E_auto_t *func, void **client_data); H5_DLL herr_t H5Eset_auto(H5E_auto_t func, void *client_data); @@ -173,12 +173,12 @@ H5_DLL herr_t H5Eclear(void); H5_DLL const char * H5Eget_major(H5E_major_t maj); H5_DLL const char * H5Eget_minor(H5E_minor_t min); -/* New APIs function the same as the old ones above, with the error stack +/* New APIs function the same as the old ones above, with the error stack * in the parameters */ -H5_DLL herr_t H5Epush_stack(hid_t err_stack, const char *file, const char *func, unsigned line, +H5_DLL herr_t H5Epush_stack(hid_t err_stack, const char *file, const char *func, unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *msg, ...); H5_DLL herr_t H5Eprint_stack(hid_t err_stack, FILE *stream); -H5_DLL herr_t H5Ewalk_stack(hid_t err_stack, H5E_direction_t direction, H5E_walk_t func, +H5_DLL herr_t H5Ewalk_stack(hid_t err_stack, H5E_direction_t direction, H5E_walk_t func, void *client_data); H5_DLL herr_t H5Eget_auto_stack(hid_t estack_id, H5E_auto_stack_t *func, void **client_data); H5_DLL herr_t H5Eset_auto_stack(hid_t estack_id, H5E_auto_stack_t func, void *client_data); diff --git a/src/H5Eterm.h b/src/H5Eterm.h index 987315a..1d89d87 100644 --- a/src/H5Eterm.h +++ b/src/H5Eterm.h @@ -20,168 +20,168 @@ #define _H5Eterm_H /* Reset major error IDs */ - -H5E_DATASET_g= -H5E_FUNC_g= -H5E_STORAGE_g= -H5E_FILE_g= -H5E_FPHDF5_g= -H5E_SYM_g= -H5E_VFL_g= -H5E_INTERNAL_g= -H5E_BTREE_g= -H5E_REFERENCE_g= -H5E_DATASPACE_g= -H5E_RESOURCE_g= -H5E_PLIST_g= -H5E_DATATYPE_g= -H5E_RS_g= -H5E_HEAP_g= -H5E_OHDR_g= -H5E_ATOM_g= -H5E_ATTR_g= -H5E_IO_g= -H5E_BLKTRK_g= -H5E_SLIST_g= -H5E_EFL_g= -H5E_TST_g= -H5E_ARGS_g= -H5E_ERROR_g= -H5E_PLINE_g= + +H5E_DATASET_g= +H5E_FUNC_g= +H5E_STORAGE_g= +H5E_FILE_g= +H5E_FPHDF5_g= +H5E_SYM_g= +H5E_VFL_g= +H5E_INTERNAL_g= +H5E_BTREE_g= +H5E_REFERENCE_g= +H5E_DATASPACE_g= +H5E_RESOURCE_g= +H5E_PLIST_g= +H5E_DATATYPE_g= +H5E_RS_g= +H5E_HEAP_g= +H5E_OHDR_g= +H5E_ATOM_g= +H5E_ATTR_g= +H5E_IO_g= +H5E_BLKTRK_g= +H5E_SLIST_g= +H5E_EFL_g= +H5E_TST_g= +H5E_ARGS_g= +H5E_ERROR_g= +H5E_PLINE_g= H5E_CACHE_g= (-1); /* Reset minor error IDs */ -/* Generic low-level file I/O errors */ -H5E_SEEKERROR_g= -H5E_READERROR_g= -H5E_WRITEERROR_g= -H5E_CLOSEERROR_g= -H5E_OVERFLOW_g= +/* Generic low-level file I/O errors */ +H5E_SEEKERROR_g= +H5E_READERROR_g= +H5E_WRITEERROR_g= +H5E_CLOSEERROR_g= +H5E_OVERFLOW_g= H5E_FCNTL_g= -/* Resource errors */ -H5E_NOSPACE_g= -H5E_CANTCOPY_g= -H5E_CANTFREE_g= -H5E_ALREADYEXISTS_g= -H5E_CANTLOCK_g= -H5E_CANTUNLOCK_g= -H5E_CANTGC_g= +/* Resource errors */ +H5E_NOSPACE_g= +H5E_CANTCOPY_g= +H5E_CANTFREE_g= +H5E_ALREADYEXISTS_g= +H5E_CANTLOCK_g= +H5E_CANTUNLOCK_g= +H5E_CANTGC_g= H5E_CANTGETSIZE_g= -/* Heap errors */ +/* Heap errors */ H5E_CANTRESTORE_g= -/* Function entry/exit interface errors */ -H5E_CANTINIT_g= -H5E_ALREADYINIT_g= +/* Function entry/exit interface errors */ +H5E_CANTINIT_g= +H5E_ALREADYINIT_g= H5E_CANTRELEASE_g= -/* Property list errors */ -H5E_CANTGET_g= -H5E_CANTSET_g= +/* Property list errors */ +H5E_CANTGET_g= +H5E_CANTSET_g= H5E_DUPCLASS_g= -/* Object header related errors */ -H5E_LINKCOUNT_g= -H5E_VERSION_g= -H5E_ALIGNMENT_g= -H5E_BADMESG_g= +/* Object header related errors */ +H5E_LINKCOUNT_g= +H5E_VERSION_g= +H5E_ALIGNMENT_g= +H5E_BADMESG_g= H5E_CANTDELETE_g= -/* FPHDF5 errors */ -H5E_CANTRECV_g= -H5E_CANTSENDMDATA_g= -H5E_CANTCHANGE_g= +/* FPHDF5 errors */ +H5E_CANTRECV_g= +H5E_CANTSENDMDATA_g= +H5E_CANTCHANGE_g= H5E_CANTALLOC_g= -/* System level errors */ +/* System level errors */ H5E_SYSERRSTR_g= -/* I/O pipeline errors */ -H5E_NOFILTER_g= -H5E_CALLBACK_g= -H5E_CANAPPLY_g= -H5E_SETLOCAL_g= +/* I/O pipeline errors */ +H5E_NOFILTER_g= +H5E_CALLBACK_g= +H5E_CANAPPLY_g= +H5E_SETLOCAL_g= H5E_NOENCODER_g= -/* Group related errors */ -H5E_CANTOPENOBJ_g= -H5E_CANTCLOSEOBJ_g= -H5E_COMPLEN_g= -H5E_CWG_g= -H5E_LINK_g= +/* Group related errors */ +H5E_CANTOPENOBJ_g= +H5E_CANTCLOSEOBJ_g= +H5E_COMPLEN_g= +H5E_CWG_g= +H5E_LINK_g= H5E_SLINK_g= -/* File accessability errors */ -H5E_FILEEXISTS_g= -H5E_FILEOPEN_g= -H5E_CANTCREATE_g= -H5E_CANTOPENFILE_g= -H5E_CANTCLOSEFILE_g= -H5E_NOTHDF5_g= -H5E_BADFILE_g= -H5E_TRUNCATED_g= +/* File accessability errors */ +H5E_FILEEXISTS_g= +H5E_FILEOPEN_g= +H5E_CANTCREATE_g= +H5E_CANTOPENFILE_g= +H5E_CANTCLOSEFILE_g= +H5E_NOTHDF5_g= +H5E_BADFILE_g= +H5E_TRUNCATED_g= H5E_MOUNT_g= -/* Object atom related errors */ -H5E_BADATOM_g= -H5E_BADGROUP_g= -H5E_CANTREGISTER_g= -H5E_CANTINC_g= -H5E_CANTDEC_g= +/* Object atom related errors */ +H5E_BADATOM_g= +H5E_BADGROUP_g= +H5E_CANTREGISTER_g= +H5E_CANTINC_g= +H5E_CANTDEC_g= H5E_NOIDS_g= -/* Cache related errors */ -H5E_CANTFLUSH_g= -H5E_CANTSERIALIZE_g= -H5E_CANTLOAD_g= -H5E_PROTECT_g= -H5E_NOTCACHED_g= -H5E_SYSTEM_g= -H5E_CANTINS_g= -H5E_CANTRENAME_g= -H5E_CANTPROTECT_g= +/* Cache related errors */ +H5E_CANTFLUSH_g= +H5E_CANTSERIALIZE_g= +H5E_CANTLOAD_g= +H5E_PROTECT_g= +H5E_NOTCACHED_g= +H5E_SYSTEM_g= +H5E_CANTINS_g= +H5E_CANTRENAME_g= +H5E_CANTPROTECT_g= H5E_CANTUNPROTECT_g= -/* Parallel MPI errors */ -H5E_MPI_g= +/* Parallel MPI errors */ +H5E_MPI_g= H5E_MPIERRSTR_g= -/* Block tracker errors */ +/* Block tracker errors */ H5E_OVERLAPS_g= -/* Dataspace errors */ -H5E_CANTCLIP_g= -H5E_CANTCOUNT_g= -H5E_CANTSELECT_g= -H5E_CANTNEXT_g= -H5E_BADSELECT_g= +/* Dataspace errors */ +H5E_CANTCLIP_g= +H5E_CANTCOUNT_g= +H5E_CANTSELECT_g= +H5E_CANTNEXT_g= +H5E_BADSELECT_g= H5E_CANTCOMPARE_g= -/* B-tree related errors */ -H5E_NOTFOUND_g= -H5E_EXISTS_g= -H5E_CANTENCODE_g= -H5E_CANTDECODE_g= -H5E_CANTSPLIT_g= -H5E_CANTREDISTRIBUTE_g= -H5E_CANTSWAP_g= -H5E_CANTINSERT_g= -H5E_CANTLIST_g= +/* B-tree related errors */ +H5E_NOTFOUND_g= +H5E_EXISTS_g= +H5E_CANTENCODE_g= +H5E_CANTDECODE_g= +H5E_CANTSPLIT_g= +H5E_CANTREDISTRIBUTE_g= +H5E_CANTSWAP_g= +H5E_CANTINSERT_g= +H5E_CANTLIST_g= H5E_CANTMODIFY_g= -/* Argument errors */ -H5E_UNINITIALIZED_g= -H5E_UNSUPPORTED_g= -H5E_BADTYPE_g= -H5E_BADRANGE_g= +/* Argument errors */ +H5E_UNINITIALIZED_g= +H5E_UNSUPPORTED_g= +H5E_BADTYPE_g= +H5E_BADRANGE_g= H5E_BADVALUE_g= -/* Datatype conversion errors */ -H5E_CANTCONVERT_g= +/* Datatype conversion errors */ +H5E_CANTCONVERT_g= H5E_BADSIZE_g= (-1); #endif /* H5Eterm_H */ diff --git a/src/H5F.c b/src/H5F.c index 61d38d5..285bb41 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -58,7 +58,7 @@ typedef struct H5F_olist_t { } file_info; unsigned list_index; /* Current index in open ID array */ int max_index; /* Maximum # of IDs to put into array */ -} H5F_olist_t; +} H5F_olist_t; /* PRIVATE PROTOTYPES */ #ifdef NOT_YET @@ -143,10 +143,10 @@ done: * J. Mainzer, 2005-03-10 * Updated function for changes in property list entries required * by the new metadata cache. - * + * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5F_init_interface(void) { size_t nprops; /* Number of properties */ @@ -154,7 +154,7 @@ H5F_init_interface(void) /* File creation property class variables. In sequence, they are * - File create property list class to modify - * - Default value for size of file user block + * - Default value for size of file user block * - Default value for 1/2 rank for symbol table leaf nodes * - Default value for 1/2 rank for btree internal nodes * - Default value for byte number in an address @@ -162,7 +162,7 @@ H5F_init_interface(void) * - Default value for version number of superblock * - Default value for free-space version number * - Default value for object directory version number - * - Default value for share-header format version + * - Default value for share-header format version */ H5P_genclass_t *crt_pclass; hsize_t userblock_size = H5F_CRT_USER_BLOCK_DEF; @@ -174,7 +174,7 @@ H5F_init_interface(void) unsigned freespace_ver = H5F_CRT_FREESPACE_VERS_DEF; unsigned objectdir_ver = H5F_CRT_OBJ_DIR_VERS_DEF; unsigned sharedheader_ver = H5F_CRT_SHARE_HEAD_VERS_DEF; - /* File access property class variables. In sequence, they are + /* File access property class variables. In sequence, they are * - File access property class to modify * - Initial metadata cache resize configuration * - Size of raw data chunk cache(elements) @@ -186,10 +186,10 @@ H5F_init_interface(void) * - Maximum sieve buffer size * - Garbage-collect reference * - File driver ID - * - File driver info + * - File driver info */ H5P_genclass_t *acs_pclass; - H5AC_cache_config_t + H5AC_cache_config_t mdc_initCacheCfg = H5F_ACS_META_CACHE_INIT_CONFIG_DEF; size_t rdcc_nelmts = H5F_ACS_DATA_CACHE_ELMT_SIZE_DEF; size_t rdcc_nbytes = H5F_ACS_DATA_CACHE_BYTE_SIZE_DEF; @@ -208,13 +208,13 @@ H5F_init_interface(void) hbool_t family_to_sec2 = H5F_ACS_FAMILY_TO_SEC2_DEF; H5FD_mem_t mem_type = H5F_ACS_MULTI_TYPE_DEF; - /* File mount property class variable. + /* File mount property class variable. * - Mount property class to modify - * - whether absolute symlinks is local to file + * - whether absolute symlinks is local to file */ H5P_genclass_t *mnt_pclass; hbool_t local = H5F_MNT_SYM_LOCAL_DEF; - + FUNC_ENTER_NOAPI_NOINIT(H5F_init_interface) /* @@ -222,8 +222,8 @@ H5F_init_interface(void) */ if (H5I_register_type(H5I_FILE, (size_t)H5I_FILEID_HASHSIZE, 0, (H5I_free_t)H5F_close) 0) { /* Set the driver for the property list */ if(H5FD_fapl_open(plist, driver_id, driver_info)<0) @@ -496,7 +496,7 @@ done: /*-------------------------------------------------------------------------- * Function: H5F_acs_copy * - * Purpose: Callback routine which is called whenever a file access + * Purpose: Callback routine which is called whenever a file access * property list is copied. This routine performs any generic * copy needed on the properties. * @@ -505,12 +505,12 @@ done: * Programmer: Raymond Lu * Tuesday, Oct 23, 2001 * - * Modifications: + * Modifications: * *-------------------------------------------------------------------------- - */ + */ /* ARGSUSED */ -herr_t +herr_t H5F_acs_copy(hid_t new_fapl_id, hid_t old_fapl_id, void UNUSED *copy_data) { hid_t driver_id; @@ -531,7 +531,7 @@ H5F_acs_copy(hid_t new_fapl_id, hid_t old_fapl_id, void UNUSED *copy_data) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get drver ID") if(H5P_get(old_plist, H5F_ACS_FILE_DRV_INFO_NAME, &driver_info) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get drver info") - + if(driver_id > 0) { /* Set the driver for the property list */ if(H5FD_fapl_open(new_plist, driver_id, driver_info)<0) @@ -545,24 +545,24 @@ done: /*-------------------------------------------------------------------------- * Function: H5F_acs_close - * - * Purpose: Callback routine which is called whenever a file access - * property list is closed. This routine performs any generic + * + * Purpose: Callback routine which is called whenever a file access + * property list is closed. This routine performs any generic * cleanup needed on the properties. * * Return: Success: Non-negative - * + * * Failure: Negative * * Programmer: Raymond Lu * Tuesday, Oct 23, 2001 - * + * * Modifications: * *--------------------------------------------------------------------------- - */ + */ /* ARGSUSED */ -herr_t +herr_t H5F_acs_close(hid_t fapl_id, void UNUSED *close_data) { hid_t driver_id; @@ -673,7 +673,7 @@ done: DESCRIPTION Encode non-standard (i.e. not 2, 4 or 8-byte) lengths in file meta-data. --------------------------------------------------------------------------*/ -void +void H5F_encode_length_unusual(const H5F_t *f, uint8_t **p, uint8_t *l) { int i = (int)H5F_SIZEOF_SIZE(f)-1; @@ -732,11 +732,11 @@ H5Fget_create_plist(hid_t file_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file") if(NULL == (plist = H5I_object(file->shared->fcpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") - + /* Create the property list object to return */ if((ret_value=H5P_copy_plist(plist)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTINIT, FAIL, "unable to copy file creation properties") - + done: FUNC_LEAVE_API(ret_value) } @@ -763,7 +763,7 @@ done: * * Modifications: * Raymond Lu, Oct 23, 2001 - * Changed file access property list to the new generic + * Changed file access property list to the new generic * property list. * * Bill Wendling, Apr 21, 2003 @@ -772,12 +772,12 @@ done: * weren't being close. * * J Mainzer, Mar 10, 2005 - * Updated function for changes in the property list entries + * Updated function for changes in the property list entries * used by the new metadata cache. - * + * * Quincey Koziol, May 25, 2005 * Extracted guts into new internal routine. - * + * *------------------------------------------------------------------------- */ hid_t @@ -785,7 +785,7 @@ H5Fget_access_plist(hid_t file_id) { H5F_t *f = NULL; hid_t ret_value = SUCCEED; - + FUNC_ENTER_API(H5Fget_access_plist, FAIL) H5TRACE1("i","i",file_id); @@ -822,7 +822,7 @@ done: * Wednesday, May 25, 2005 * * Modifications: - * + * *------------------------------------------------------------------------- */ hid_t @@ -830,9 +830,9 @@ H5F_get_access_plist(H5F_t *f) { H5P_genplist_t *new_plist; /* New property list */ H5P_genplist_t *old_plist; /* Old property list */ - void *driver_info=NULL; + void *driver_info=NULL; hid_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI(H5F_get_access_plist, FAIL) /* Check args */ @@ -893,7 +893,7 @@ H5F_get_access_plist(H5F_t *f) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set file close degree") } else if(f->shared->fc_degree != H5F_CLOSE_DEFAULT && H5P_set(new_plist, H5F_CLOSE_DEGREE_NAME, &(f->shared->fc_degree)) < 0) { HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set file close degree") - } + } done: FUNC_LEAVE_NOAPI(ret_value) @@ -903,11 +903,11 @@ done: /*------------------------------------------------------------------------- * Function: H5Fget_obj_count * - * Purpose: Public function returning the number of opened object IDs - * (files, datasets, groups and datatypes) in the same file. + * Purpose: Public function returning the number of opened object IDs + * (files, datasets, groups and datatypes) in the same file. * * Return: Non-negative on success; negative on failure. - * + * * Programmer: Raymond Lu * Wednesday, Dec 5, 2001 * @@ -1006,20 +1006,20 @@ done: * * Purpose: Private function to return a list of opened object IDs. * - * Return: Non-negative on success; negative on failure. - * - * Programmer: Raymond Lu - * Wednesday, Dec 5, 2001 - * - * Modification: - * + * Return: Non-negative on success; negative on failure. + * + * Programmer: Raymond Lu + * Wednesday, Dec 5, 2001 + * + * Modification: + * *------------------------------------------------------------------------- */ unsigned H5F_get_obj_ids(const H5F_t *f, unsigned types, int max_objs, hid_t *oid_list) { unsigned ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_get_obj_ids) ret_value = H5F_get_objects(f, types, max_objs, oid_list); @@ -1031,10 +1031,10 @@ H5F_get_obj_ids(const H5F_t *f, unsigned types, int max_objs, hid_t *oid_list) /*--------------------------------------------------------------------------- * Function: H5F_get_objects * - * Purpose: This function is called by H5F_get_obj_count or - * H5F_get_obj_ids to get number of object IDs and/or a + * Purpose: This function is called by H5F_get_obj_count or + * H5F_get_obj_ids to get number of object IDs and/or a * list of opened object IDs (in return value). - * Return: Non-negative on success; negative on failure. + * Return: Non-negative on success; negative on failure. * * Programmer: Raymond Lu * Wednesday, Dec 5, 2001 @@ -1075,28 +1075,28 @@ H5F_get_objects(const H5F_t *f, unsigned types, int max_index, hid_t *obj_id_lis (void)H5I_search(H5I_FILE, H5F_get_objects_cb, &olist); } /* end if */ - /* Search through dataset IDs to count number of datasets, and put their + /* Search through dataset IDs to count number of datasets, and put their * IDs on the object list */ if( (max_index < 0 || (int)olist.list_index < max_index) && (types & H5F_OBJ_DATASET) ) { olist.obj_type = H5I_DATASET; (void)H5I_search(H5I_DATASET, H5F_get_objects_cb, &olist); } - /* Search through group IDs to count number of groups, and put their + /* Search through group IDs to count number of groups, and put their * IDs on the object list */ if( (max_index < 0 || (int)olist.list_index < max_index) && (types & H5F_OBJ_GROUP) ) { olist.obj_type = H5I_GROUP; (void)H5I_search(H5I_GROUP, H5F_get_objects_cb, &olist); } - /* Search through datatype IDs to count number of named datatypes, and put their + /* Search through datatype IDs to count number of named datatypes, and put their * IDs on the object list */ if( (max_index < 0 || (int)olist.list_index < max_index) && (types & H5F_OBJ_DATATYPE) ) { olist.obj_type = H5I_DATATYPE; (void)H5I_search(H5I_DATATYPE, H5F_get_objects_cb, &olist); } - /* Search through attribute IDs to count number of attributes, and put their + /* Search through attribute IDs to count number of attributes, and put their * IDs on the object list */ if( (max_index < 0 || (int)olist.list_index < max_index) && (types & H5F_OBJ_ATTR) ) { olist.obj_type = H5I_ATTR; @@ -1111,9 +1111,9 @@ H5F_get_objects(const H5F_t *f, unsigned types, int max_index, hid_t *obj_id_lis /*------------------------------------------------------------------------- - * Function: H5F_get_objects_cb + * Function: H5F_get_objects_cb * - * Purpose: H5F_get_objects' callback function. It verifies if an + * Purpose: H5F_get_objects' callback function. It verifies if an * object is in the file, and either count it or put its ID * on the list. * @@ -1129,13 +1129,13 @@ H5F_get_objects_cb(void *obj_ptr, hid_t obj_id, void *key) { H5F_olist_t *olist = (H5F_olist_t *)key; /* Alias for search info */ int ret_value = FALSE; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5F_get_objects_cb) assert(obj_ptr); assert(olist); - /* Count file IDs */ + /* Count file IDs */ if(olist->obj_type == H5I_FILE) { if((olist->file_info.local && (!olist->file_info.ptr.file || (olist->file_info.ptr.file && (H5F_t*)obj_ptr == olist->file_info.ptr.file) )) @@ -1179,12 +1179,12 @@ H5F_get_objects_cb(void *obj_ptr, hid_t obj_id, void *key) } if((olist->file_info.local && - ( (!olist->file_info.ptr.file && olist->obj_type==H5I_DATATYPE && H5T_is_immutable((H5T_t*)obj_ptr)==FALSE) - || (!olist->file_info.ptr.file && olist->obj_type!=H5I_DATATYPE) + ( (!olist->file_info.ptr.file && olist->obj_type==H5I_DATATYPE && H5T_is_immutable((H5T_t*)obj_ptr)==FALSE) + || (!olist->file_info.ptr.file && olist->obj_type!=H5I_DATATYPE) || (ent && ent->file == olist->file_info.ptr.file) )) || (!olist->file_info.local && - ((!olist->file_info.ptr.shared && olist->obj_type==H5I_DATATYPE && H5T_is_immutable((H5T_t*)obj_ptr)==FALSE) - || (!olist->file_info.ptr.shared && olist->obj_type!=H5I_DATATYPE) + ((!olist->file_info.ptr.shared && olist->obj_type==H5I_DATATYPE && H5T_is_immutable((H5T_t*)obj_ptr)==FALSE) + || (!olist->file_info.ptr.shared && olist->obj_type!=H5I_DATATYPE) || (ent && ent->file && ent->file->shared == olist->file_info.ptr.shared) ))) { /* Add the object's ID to the ID list, if appropriate */ if(olist->obj_id_list) { @@ -1213,10 +1213,10 @@ done: * Purpose: Returns a pointer to the file handle of the low-level file * driver. * - * Return: Success: non-negative value. + * Return: Success: non-negative value. + * + * Failture: negative. * - * Failture: negative. - * * Programmer: Raymond Lu * Sep. 16, 2002 * @@ -1229,7 +1229,7 @@ H5Fget_vfd_handle(hid_t file_id, hid_t fapl, void **file_handle) { H5F_t *file=NULL; herr_t ret_value; - + FUNC_ENTER_API(H5Fget_vfd_handle, FAIL) H5TRACE3("e","iix",file_id,fapl,file_handle); @@ -1263,7 +1263,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5F_get_vfd_handle(const H5F_t *file, hid_t fapl, void**file_handle) +H5F_get_vfd_handle(const H5F_t *file, hid_t fapl, void**file_handle) { herr_t ret_value; @@ -1419,11 +1419,11 @@ done: * Modifications: * * Raymond Lu, Oct 14, 2001 - * Changed the file creation and access property list to the + * Changed the file creation and access property list to the * new generic property list. * * J Mainzer, Mar 10, 2005 - * Updated for the new metadata cache, and associated + * Updated for the new metadata cache, and associated * property list changes. * *------------------------------------------------------------------------- @@ -1433,7 +1433,7 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id) { H5F_t *f=NULL, *ret_value; H5P_genplist_t *plist; /* Property list */ - + FUNC_ENTER_NOAPI_NOINIT(H5F_new) if (NULL==(f=H5FL_CALLOC(H5F_t))) @@ -1448,7 +1448,7 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id) f->shared->base_addr = HADDR_UNDEF; f->shared->freespace_addr = HADDR_UNDEF; f->shared->driver_addr = HADDR_UNDEF; - + /* * Copy the file creation and file access property lists into the * new file handle. We do this early because some values might need @@ -1493,7 +1493,7 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get data cache cache size") if(H5P_get(plist, H5F_ACS_PREEMPT_READ_CHUNKS_NAME, &(f->shared->rdcc_w0)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get preempt read chunk") - + if(H5P_get(plist, H5F_ACS_ALIGN_THRHD_NAME, &(f->shared->threshold))<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get alignment threshold") if(H5P_get(plist, H5F_ACS_ALIGN_NAME, &(f->shared->alignment)) < 0) @@ -1519,7 +1519,7 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id) if(H5F_sfile_add(f->shared) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to append to list of open files") } /* end else */ - + f->shared->nrefs++; /* Set return value */ @@ -1531,7 +1531,7 @@ done: H5FL_FREE(H5F_file_t,f->shared); H5FL_FREE(H5F_t,f); } - + FUNC_LEAVE_NOAPI(ret_value) } @@ -1574,7 +1574,7 @@ static herr_t H5F_dest(H5F_t *f, hid_t dxpl_id) { herr_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI_NOINIT(H5F_dest) /* Sanity check */ @@ -1628,7 +1628,7 @@ H5F_dest(H5F_t *f, hid_t dxpl_id) /* Destroy shared file struct */ f->shared = H5FL_FREE(H5F_file_t,f->shared); - + } else if (f->shared->nrefs>0) { /* * There are other references to the shared part of the file. @@ -1718,7 +1718,7 @@ H5F_dest(H5F_t *f, hid_t dxpl_id) * arguments would be the same. * * Raymond Lu, 2001-10-14 - * Changed the file creation and access property lists to the + * Changed the file creation and access property lists to the * new generic property list. * * Bill Wendling, 2003-03-18 @@ -1855,9 +1855,9 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t d /* This step is for h5repart tool only. If user wants to change file driver from * family to sec2 while using h5repart, this private property should be set so that - * in the later step, the library can ignore the family driver information saved + * in the later step, the library can ignore the family driver information saved * in the superblock. - */ + */ if(H5P_exist_plist(a_plist, H5F_ACS_FAMILY_TO_SEC2_NAME) > 0) if(H5P_get(a_plist, H5F_ACS_FAMILY_TO_SEC2_NAME, &fam_sec2) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get property of changing family to sec2") @@ -1953,8 +1953,8 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t d HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL, "unable to read superblock") } - /* The following barrier ensures that all set eoa operations - * associated with creating the superblock are complete before + /* The following barrier ensures that all set eoa operations + * associated with creating the superblock are complete before * we attempt any allocations. * JRM - 4/13/04 */ @@ -1981,10 +1981,10 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t d if (H5F_read_superblock(file, dxpl_id, &root_ent, HADDR_UNDEF, NULL, (size_t)0) < 0) HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL, "unable to read superblock") -#ifdef H5_HAVE_FPHDF5 +#ifdef H5_HAVE_FPHDF5 if (H5FD_is_fphdf5_driver(lf)) { - /* reading the superblock generates lots of set_eoa calls. To avoid - * race conditions with allocations, make sure that everyone is done + /* reading the superblock generates lots of set_eoa calls. To avoid + * race conditions with allocations, make sure that everyone is done * reading the superblock before we proceed. */ if ( (mrc = MPI_Barrier(H5FP_SAP_BARRIER_COMM)) != MPI_SUCCESS ) { @@ -2000,7 +2000,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t d /* * Decide the file close degree. If it's the first time to open the - * file, set the degree to access property list value; if it's the + * file, set the degree to access property list value; if it's the * second time or later, verify the access property list value matches * the degree in shared file structure. */ @@ -2061,10 +2061,10 @@ done: * File struct creation and destruction is through H5F_new() and * H5F_dest(). Writing the root symbol table entry is done with * H5G_encode(). - * + * * Robb Matzke, 1997-08-29 * Moved creation of the boot block to H5F_flush(). - * + * * Robb Matzke, 1997-09-23 * Most of the work is now done by H5F_open() since H5Fcreate() * and H5Fopen() originally contained almost identical code. @@ -2078,9 +2078,9 @@ done: * Robb Matzke, 1999-08-02 * The file creation and file access property lists are passed * to the H5F_open() as object IDs. - * + * * Raymond Lu, 2001-10-14 - * Changed the file creation and access property list to the + * Changed the file creation and access property list to the * new generic property list. * *------------------------------------------------------------------------- @@ -2170,7 +2170,7 @@ done: * File struct creation and destruction is through H5F_new() and * H5F_dest(). Reading the root symbol table entry is done with * H5G_decode(). - * + * * Robb Matzke, 1997-09-23 * Most of the work is now done by H5F_open() since H5Fcreate() * and H5Fopen() originally contained almost identical code. @@ -2258,7 +2258,7 @@ H5Fflush(hid_t object_id, H5F_scope_t scope) H5A_t *attr = NULL; H5G_entry_t *ent = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Fflush, FAIL) H5TRACE2("e","iFs",object_id,scope); @@ -2346,10 +2346,10 @@ done: * Robb Matzke, 1999-08-16 * The driver information block is encoded and either allocated * or written to disk. - * + * * Raymond Lu, 2001-10-14 * Changed to new generic property list. - * + * * Quincey Koziol, 2002-05-20 * Added 'closing' parameter * @@ -2360,14 +2360,14 @@ done: * Quincey Koziol, 2002-06-06 * Return the remainders of the metadata & "small data" blocks to * the free list of blocks for the file. - * + * * Bill Wendling, 2003-03-18 * Modified the flags being passed in to be one flag instead * of several. * * John Mainzer, 2005-01-07 * H5AC (and H5C) now have their own system of flags. Hence - * we must now translate between the H5F_FLUSH flags and the + * we must now translate between the H5F_FLUSH flags and the * H5AC flags. Added code to handle this detail. * *------------------------------------------------------------------------- @@ -2626,16 +2626,16 @@ H5F_try_close(H5F_t *f) * H5F_CLOSE_SEMI: if there are still objects open, return fail; * otherwise, close file. * H5F_CLOSE_STRONG: if there are still objects open, close them - * first, then close file. - */ + * first, then close file. + */ switch(f->shared->fc_degree) { case H5F_CLOSE_WEAK: /* - * If file or object IDS are still open then delay deletion of - * resources until they have all been closed. Flush all + * If file or object IDS are still open then delay deletion of + * resources until they have all been closed. Flush all * caches and update the object header anyway so that failing to * close all objects isn't a major problem. - */ + */ if ((nopen_files + nopen_objs) > 0) HGOTO_DONE(SUCCEED) break; @@ -2679,7 +2679,7 @@ H5F_try_close(H5F_t *f) /* Get the list of IDs of open dataset, group, named datatype & attribute objects */ while((obj_count = H5F_get_obj_ids(f, H5F_OBJ_LOCAL|H5F_OBJ_DATASET|H5F_OBJ_GROUP|H5F_OBJ_DATATYPE|H5F_OBJ_ATTR, (int)(sizeof(objs)/sizeof(objs[0])), objs)) != 0) { - + /* Try to close all the open objects in this file */ for(u = 0; u < obj_count; u++) if(H5I_dec_ref(objs[u]) < 0) @@ -2820,7 +2820,7 @@ H5Freopen(hid_t file_id) H5F_t *old_file=NULL; H5F_t *new_file=NULL; hid_t ret_value; - + FUNC_ENTER_API(H5Freopen, FAIL) H5TRACE1("i","i",file_id); @@ -3225,7 +3225,7 @@ hid_t H5F_get_id(H5F_t *file) { hid_t ret_value; - + FUNC_ENTER_NOAPI_NOINIT(H5F_get_id) assert(file); @@ -3239,7 +3239,7 @@ H5F_get_id(H5F_t *file) if (H5I_inc_ref(file->file_id)<0) HGOTO_ERROR (H5E_ATOM, H5E_CANTSET, FAIL, "incrementing file ID failed") } - + ret_value = file->file_id; done: @@ -3263,7 +3263,7 @@ done: * *------------------------------------------------------------------------- */ -haddr_t +haddr_t H5F_get_base_addr(const H5F_t *f) { /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ @@ -3290,7 +3290,7 @@ H5F_get_base_addr(const H5F_t *f) * *------------------------------------------------------------------------- */ -haddr_t +haddr_t H5F_get_eoa(const H5F_t *f) { haddr_t ret_value; @@ -3334,7 +3334,7 @@ H5F_mpi_get_rank(const H5F_t *f) FUNC_ENTER_NOAPI(H5F_mpi_get_rank, FAIL) assert(f && f->shared); - + /* Dispatch to driver */ if ((ret_value=H5FD_mpi_get_rank(f->shared->lf))<0) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "driver get_rank request failed") @@ -3368,7 +3368,7 @@ H5F_mpi_get_comm(const H5F_t *f) FUNC_ENTER_NOAPI(H5F_mpi_get_comm, MPI_COMM_NULL) assert(f && f->shared); - + /* Dispatch to driver */ if ((ret_value=H5FD_mpi_get_comm(f->shared->lf))==MPI_COMM_NULL) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, MPI_COMM_NULL, "driver get_comm request failed") @@ -3483,7 +3483,7 @@ H5F_get_fcpl(const H5F_t *f) * address for the file. * * Errors: - * IO READERROR Low-level read failed. + * IO READERROR Low-level read failed. * * Return: Non-negative on success/Negative on failure * @@ -3538,8 +3538,8 @@ done: * address. * * Errors: - * IO WRITEERROR Low-level write failed. - * IO WRITEERROR No write intent. + * IO WRITEERROR Low-level write failed. + * IO WRITEERROR No write intent. * * Return: Non-negative on success/Negative on failure * @@ -3722,7 +3722,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Fget_filesize * - * Purpose: Retrieves the file size of the HDF5 file. This function + * Purpose: Retrieves the file size of the HDF5 file. This function * is called after an existing file is opened in order * to learn the true size of the underlying file. * @@ -3769,7 +3769,7 @@ done: * from the metadata cache, and return it in *config_ptr. * * Note that the version field of *config_Ptr must be correctly - * filled in by the caller. This allows us to adapt for + * filled in by the caller. This allows us to adapt for * obsolete versions of the structure. * * Return: Success: SUCCEED @@ -3803,7 +3803,7 @@ H5Fget_mdc_config(hid_t file_id, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") } - if ( ( NULL == config_ptr ) || + if ( ( NULL == config_ptr ) || ( config_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION ) ) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Bad config_ptr") @@ -3828,8 +3828,8 @@ done: /*------------------------------------------------------------------------- * Function: H5Fset_mdc_config * - * Purpose: Sets the current metadata cache automatic resize - * configuration, using the contents of the instance of + * Purpose: Sets the current metadata cache automatic resize + * configuration, using the contents of the instance of * H5AC_cache_config_t pointed to by config_ptr. * * Return: Success: SUCCEED @@ -3883,7 +3883,7 @@ done: * * Purpose: Retrieves the current hit rate from the metadata cache. * This rate is the overall hit rate since the last time - * the hit rate statistics were reset either manually or + * the hit rate statistics were reset either manually or * automatically. * * Return: Success: SUCCEED @@ -3900,7 +3900,7 @@ done: */ herr_t -H5Fget_mdc_hit_rate(hid_t file_id, +H5Fget_mdc_hit_rate(hid_t file_id, double *hit_rate_ptr) { H5F_t *file=NULL; /* File object for file ID */ @@ -3942,8 +3942,8 @@ done: * * Purpose: Retrieves the maximum size, minimum clean size, current * size, and current number of entries from the metadata - * cache associated with the specified file. If any of - * the ptr parameters are NULL, the associated datum is + * cache associated with the specified file. If any of + * the ptr parameters are NULL, the associated datum is * not returned. * * Return: Success: SUCCEED @@ -3960,7 +3960,7 @@ done: */ herr_t -H5Fget_mdc_size(hid_t file_id, +H5Fget_mdc_size(hid_t file_id, size_t *max_size_ptr, size_t *min_clean_size_ptr, size_t *cur_size_ptr, @@ -4009,7 +4009,7 @@ done: * Function: H5Freset_mdc_hit_rate_stats * * Purpose: Reset the hit rate statistic whose current value can - * be obtained via the H5Fget_mdc_hit_rate() call. Note + * be obtained via the H5Fget_mdc_hit_rate() call. Note * that this statistic will also be reset once per epoch * by the automatic cache resize code if it is enabled. * @@ -4054,7 +4054,7 @@ H5Freset_mdc_hit_rate_stats(hid_t file_id) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ "H5AC_reset_cache_hit_rate_stats() failed."); } - + done: @@ -4073,8 +4073,8 @@ done: * just returning the number of characters required to store the name. * If an error occurs then the buffer pointed to by `name' (NULL or non-NULL) * is unchanged and the function returns a negative value. - * - * Return: Success: The length of the file name + * + * Return: Success: The length of the file name * Failure: Negative * * Programmer: Raymond Lu diff --git a/src/H5FD.c b/src/H5FD.c index 599f73c..6474446 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -397,9 +397,9 @@ done: * * Modifications: * - * Raymond Lu + * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. * *------------------------------------------------------------------------- @@ -460,7 +460,7 @@ hsize_t H5FD_sb_size(H5FD_t *file) { hsize_t ret_value=0; - + FUNC_ENTER_NOAPI(H5FD_sb_size, 0) assert(file && file->cls); @@ -505,7 +505,7 @@ H5FD_sb_encode(H5FD_t *file, char *name/*out*/, uint8_t *buf) if (file->cls->sb_encode && (file->cls->sb_encode)(file, name/*out*/, buf/*out*/)<0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver sb_encode request failed") - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -567,7 +567,7 @@ H5FD_pl_copy(void *(*copy_func)(const void *), size_t pl_size, const void *old_p { void *new_pl = NULL; /* Copy of property list */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5FD_pl_copy) /* Copy old pl, if one exists */ @@ -661,7 +661,7 @@ void * H5FD_fapl_get(H5FD_t *file) { void *ret_value=NULL; - + FUNC_ENTER_NOAPI(H5FD_fapl_get, NULL) assert(file); @@ -695,7 +695,7 @@ H5FD_fapl_open(H5P_genplist_t *plist, hid_t driver_id, const void *driver_info) { void *copied_driver_info; /* Temporary VFL driver info */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_fapl_open, FAIL) /* Increment the reference count on driver and copy driver info */ @@ -737,7 +737,7 @@ H5FD_fapl_copy(hid_t driver_id, const void *old_fapl, void **copied_fapl) { H5FD_class_t *driver=NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_fapl_copy, FAIL) /* Check args */ @@ -780,7 +780,7 @@ H5FD_fapl_close(hid_t driver_id, void *fapl) if(driver_id>0) { if (NULL==(driver=H5I_object(driver_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a driver ID") - + /* Close the driver for the property list */ if(H5FD_pl_close(driver_id,driver->fapl_free,fapl)<0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver fapl_free request failed") @@ -812,7 +812,7 @@ H5FD_dxpl_open(H5P_genplist_t *plist, hid_t driver_id, const void *driver_info) { void *copied_driver_info; /* Temporary VFL driver info */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_dxpl_open, FAIL) /* Increment the reference count on the driver and copy the driver info */ @@ -820,7 +820,7 @@ H5FD_dxpl_open(H5P_genplist_t *plist, hid_t driver_id, const void *driver_info) HGOTO_ERROR (H5E_DATASET, H5E_CANTINC, FAIL, "can't increment VFL driver ID") if(H5FD_dxpl_copy(driver_id, driver_info, &copied_driver_info)<0) HGOTO_ERROR (H5E_DATASET, H5E_CANTCOPY, FAIL, "can't copy VFL driver") - + /* Set the driver information for the new property list */ if(H5P_set(plist, H5D_XFER_VFL_ID_NAME, &driver_id)<0) HGOTO_ERROR (H5E_PLIST, H5E_CANTSET, FAIL, "can't set VFL driver ID") @@ -854,7 +854,7 @@ H5FD_dxpl_copy(hid_t driver_id, const void *old_dxpl, void **copied_dxpl) { H5FD_class_t *driver=NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_dxpl_copy, FAIL) /* Check args */ @@ -897,7 +897,7 @@ H5FD_dxpl_close(hid_t driver_id, void *dxpl) if(driver_id>0) { if (NULL==(driver=H5I_object(driver_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a driver ID") - + /* Close the driver for the property list */ if(H5FD_pl_close(driver_id,driver->dxpl_free,dxpl)<0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver fapl_free request failed") @@ -999,9 +999,9 @@ done: * * Modifications: * - * Raymond Lu + * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. * *------------------------------------------------------------------------- @@ -1012,17 +1012,17 @@ H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) H5FD_class_t *driver; H5FD_t *file=NULL; hid_t driver_id = -1; - hsize_t meta_block_size=0; - hsize_t sdata_block_size=0; + hsize_t meta_block_size=0; + hsize_t sdata_block_size=0; H5P_genplist_t *plist; /* Property list pointer */ H5FD_t *ret_value; - + FUNC_ENTER_NOAPI(H5FD_open, NULL) /* Get file access property list */ if(NULL == (plist = H5I_object(fapl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list") - + if (0==maxaddr) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "zero format address range") @@ -1034,7 +1034,7 @@ H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, NULL, "invalid driver ID in file access property list") if (NULL==driver->open) HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, NULL, "file driver has no `open' method") - + /* Dispatch to file driver */ if (HADDR_UNDEF==maxaddr) maxaddr = driver->maxaddr; @@ -1152,7 +1152,7 @@ H5FD_close(H5FD_t *file) { const H5FD_class_t *driver; herr_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI(H5FD_close, FAIL) /* check args */ @@ -1278,10 +1278,10 @@ int H5FDcmp(const H5FD_t *f1, const H5FD_t *f2) { int ret_value; - + FUNC_ENTER_API(H5FDcmp, -1) /*return value is arbitrary*/ H5TRACE2("Is","xx",f1,f2); - + ret_value = H5FD_cmp(f1, f2); done: @@ -1362,10 +1362,10 @@ H5FDquery(const H5FD_t *f, unsigned long *flags/*out*/) FUNC_ENTER_API(H5FDquery, FAIL) H5TRACE2("Is","xx",f,flags); - + assert(f); assert(flags); - + ret_value = H5FD_query(f, flags); done: @@ -1398,7 +1398,7 @@ H5FD_query(const H5FD_t *f, unsigned long *flags/*out*/) assert(f); assert(flags); - + /* Check for query driver and call it */ if (f->cls->query) ret_value = (f->cls->query)(f, flags); @@ -1455,7 +1455,7 @@ haddr_t H5FDalloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) { haddr_t ret_value = HADDR_UNDEF; - + FUNC_ENTER_API(H5FDalloc, HADDR_UNDEF) H5TRACE4("a","xMtih",file,type,dxpl_id,size); @@ -1535,9 +1535,9 @@ H5FD_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) if ( H5FD_is_fphdf5_driver(file) && !H5FD_fphdf5_is_sap(file) ) { haddr_t addr; - if ( (addr = H5FP_client_alloc(file, type, dxpl_id, size)) + if ( (addr = H5FP_client_alloc(file, type, dxpl_id, size)) == HADDR_UNDEF) { - HGOTO_ERROR(H5E_FPHDF5, H5E_CANTALLOC, HADDR_UNDEF, + HGOTO_ERROR(H5E_FPHDF5, H5E_CANTALLOC, HADDR_UNDEF, "allocation failed.") } else { HGOTO_DONE(addr) @@ -1561,7 +1561,7 @@ H5FD_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) if ((ret_value = H5FD_alloc_from_free_list(file, type, mapped_type, size)) != HADDR_UNDEF) HGOTO_DONE(ret_value) - + #ifdef H5F_DEBUG if (H5DEBUG(F)) HDfprintf(H5DEBUG(F), "%s: Could not allocate from freelists\n", FUNC); @@ -1778,7 +1778,7 @@ H5FD_alloc_from_free_list(H5FD_t *file, H5FD_mem_t type, H5F_addr_overlap(ret_value, size, file->accum_loc, file->accum_size)) { ret_value = HADDR_UNDEF; } else { - /* Attempt to allocate memory for temporary node */ + /* Attempt to allocate memory for temporary node */ if((tmp = H5FL_MALLOC(H5FD_free_t))==NULL) HGOTO_ERROR(H5E_VFL, H5E_NOSPACE, HADDR_UNDEF, "free block allocation failed") @@ -2060,7 +2060,7 @@ H5FD_real_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) assert(file->cls); assert(type >= H5FD_MEM_DEFAULT && type < H5FD_MEM_NTYPES); assert(size > 0); - + /* * Dispatch to driver `alloc' callback or extend the end-of-address * marker @@ -2192,7 +2192,7 @@ H5FDfree(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t siz FUNC_ENTER_API(H5FDfree, FAIL) H5TRACE5("e","xMtiah",file,type,dxpl_id,addr,size); - + /* Check args */ if (!file || !file->cls) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer") @@ -2238,7 +2238,7 @@ H5FD_free(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t si { H5FD_mem_t mapped_type; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_free, FAIL) /* Check args */ @@ -2447,7 +2447,7 @@ H5FD_free(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t si /* Check if we increased the size of the largest block on the list */ file->maxsize = MAX(file->maxsize, last->size); - /* Check if this free block is at the end of file allocated space. + /* Check if this free block is at the end of file allocated space. * Truncate it if this is true. */ if(file->cls->get_eoa) { haddr_t eoa; @@ -2463,7 +2463,7 @@ H5FD_free(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t si file->maxsize=0; /*unknown*/ H5FL_FREE(H5FD_free_t, last); } - } + } } else if (file->cls->free) { if ((file->cls->free)(file, type, dxpl_id, addr, size)<0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver free request failed") @@ -2546,12 +2546,12 @@ H5FD_realloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t old_addr, hsi uint8_t _buf[8192]; uint8_t *buf=_buf; haddr_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_realloc, HADDR_UNDEF) if (new_size==old_size) { /*nothing to do*/ - + } else if (0==old_size) { /* allocate memory */ assert(!H5F_addr_defined(old_addr)); @@ -2563,7 +2563,7 @@ H5FD_realloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t old_addr, hsi if(H5FD_free(file, type, dxpl_id, old_addr, old_size)<0) HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, HADDR_UNDEF, "file deallocation request failed") new_addr = HADDR_UNDEF; - + } else if (new_sizecls); - + /* Dispatch to driver */ if (HADDR_UNDEF==(ret_value=(file->cls->get_eoa)(file))) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "driver get_eoa request failed") @@ -2975,7 +2975,7 @@ H5FD_set_eoa(H5FD_t *file, haddr_t addr) assert(file && file->cls); assert(H5F_addr_defined(addr) && addr<=file->maxaddr); - + /* Dispatch to driver */ if ((file->cls->set_eoa)(file, addr)<0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver set_eoa request failed") @@ -3015,7 +3015,7 @@ haddr_t H5FDget_eof(H5FD_t *file) { haddr_t ret_value; - + FUNC_ENTER_API(H5FDget_eof, HADDR_UNDEF) H5TRACE1("a","x",file); @@ -3056,7 +3056,7 @@ H5FD_get_eof(const H5FD_t *file) FUNC_ENTER_NOAPI(H5FD_get_eof, HADDR_UNDEF) assert(file && file->cls); - + /* Dispatch to driver */ if (file->cls->get_eof) { if (HADDR_UNDEF==(ret_value=(file->cls->get_eof)(file))) @@ -3384,7 +3384,7 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t si assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id)); assert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER)); assert(buf); - + #ifndef H5_HAVE_PARALLEL /* Do not return early for Parallel mode since the I/O could be a */ /* collective transfer. */ @@ -3734,7 +3734,7 @@ done: /*-------------------------------------------------------------------------- * Function: H5FDget_vfd_handle * - * Purpose: Returns a pointer to the file handle of low-level virtual + * Purpose: Returns a pointer to the file handle of low-level virtual * file driver. * * Return: Non-negative if succeed; negative otherwise. @@ -3751,7 +3751,7 @@ herr_t H5FDget_vfd_handle(H5FD_t *file, hid_t fapl, void** file_handle) herr_t ret_value; FUNC_ENTER_API(H5FDget_vfd_handle, FAIL) - + /* Check arguments */ assert(file); assert(file_handle); @@ -3768,7 +3768,7 @@ done: * Purpose: Retrieve the file handle for file driver. * * Return: Non-negative if succeed; negative if fails. - * + * * Programmer: Raymond Lu * Sep. 16, 2002 * @@ -3779,7 +3779,7 @@ done: herr_t H5FD_get_vfd_handle(H5FD_t *file, hid_t fapl, void** file_handle) { herr_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI(H5FD_get_vfd_handle, FAIL) assert(file_handle); @@ -3788,7 +3788,7 @@ herr_t H5FD_get_vfd_handle(H5FD_t *file, hid_t fapl, void** file_handle) done: FUNC_LEAVE_NOAPI(ret_value) -} +} /*------------------------------------------------------------------------- diff --git a/src/H5FDcore.c b/src/H5FDcore.c index b72887c..492e06f 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -65,7 +65,7 @@ typedef struct H5FD_core_fapl_t { /* * These macros check for overflow of various quantities. These macros * assume that file_offset_t is signed and haddr_t and size_t are unsigned. - * + * * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' * is too large to be represented by the second argument * of the file seek function. @@ -137,7 +137,7 @@ NAME H5FD_core_init_interface -- Initialize interface-specific information USAGE herr_t H5FD_core_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -221,7 +221,7 @@ H5FD_core_term(void) * Purpose: Modify the file access property list to use the H5FD_CORE * driver defined in this source file. The INCREMENT specifies * how much to grow the memory each time we need more. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke @@ -277,7 +277,7 @@ done: * Modifications: * Robb Matzke, 1999-10-19 * Added the BACKING_STORE argument. - * + * * Raymond Lu * 2001-10-25 * Changed file access list to the new generic property list. @@ -301,12 +301,12 @@ H5Pget_fapl_core(hid_t fapl_id, size_t *increment/*out*/, HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver") if (NULL==(fa=H5P_get_driver_info(plist))) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info") - + if (increment) *increment = fa->increment; if (backing_store) *backing_store = fa->backing_store; - + done: FUNC_LEAVE_API(ret_value) } @@ -381,7 +381,7 @@ H5FD_core_open(const char *name, unsigned UNUSED flags, hid_t fapl_id, H5FD_t *ret_value; FUNC_ENTER_NOAPI(H5FD_core_open, NULL) - + /* Check arguments */ if (!(H5F_ACC_CREAT & flags)) HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, NULL, "must create core files, not open them") @@ -499,7 +499,7 @@ H5FD_core_cmp(const H5FD_t *_f1, const H5FD_t *_f2) HGOTO_DONE(1) HGOTO_DONE(0) } - + if (NULL==f1->name) HGOTO_DONE(-1) if (NULL==f2->name) @@ -536,7 +536,7 @@ H5FD_core_get_eoa(const H5FD_t *_file) haddr_t ret_value; /* Return value */ const H5FD_core_t *file = (const H5FD_core_t*)_file; - + FUNC_ENTER_NOAPI(H5FD_core_get_eoa, HADDR_UNDEF) /* Set return value */ @@ -622,25 +622,25 @@ done: /*------------------------------------------------------------------------- * Function: H5FD_core_get_handle - * + * * Purpose: Returns the file handle of CORE file driver. - * + * * Returns: Non-negative if succeed or negative if fails. - * + * * Programmer: Raymond Lu * Sept. 16, 2002 - * - * Modifications: - * + * + * Modifications: + * *------------------------------------------------------------------------- */ /* ARGSUSED */ static herr_t H5FD_core_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) -{ +{ H5FD_core_t *file = (H5FD_core_t *)_file; herr_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI(H5FD_core_get_handle, FAIL) if(!file_handle) @@ -648,9 +648,9 @@ H5FD_core_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) *file_handle = &(file->mem); -done: +done: FUNC_LEAVE_NOAPI(ret_value) -} +} /*------------------------------------------------------------------------- @@ -679,7 +679,7 @@ H5FD_core_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, hadd { H5FD_core_t *file = (H5FD_core_t*)_file; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_core_read, FAIL) assert(file && file->pub.cls); @@ -746,7 +746,7 @@ H5FD_core_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, had { H5FD_core_t *file = (H5FD_core_t*)_file; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_core_write, FAIL) assert(file && file->pub.cls); @@ -814,7 +814,7 @@ H5FD_core_flush(H5FD_t *_file, hid_t UNUSED dxpl_id, unsigned UNUSED closing) { H5FD_core_t *file = (H5FD_core_t*)_file; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_core_flush, FAIL) /* Write to backing store */ diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index 73cb11c..832495f 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -30,7 +30,7 @@ * (actually, this happens when the file family is flushed, and * can be quite time consuming on file systems that don't * implement holes, like nfs). - * + * */ /* Interface initialization */ @@ -60,7 +60,7 @@ typedef struct H5FD_family_t { hid_t memb_fapl_id; /*file access property list for members */ hsize_t memb_size; /*actual size of each member file */ hsize_t pmem_size; /*member size passed in from property */ - hsize_t mem_newsize; /*new member size passed in as private property. + hsize_t mem_newsize; /*new member size passed in as private property. *It's used only by h5repart */ unsigned nmembs; /*number of family members */ unsigned amembs; /*number of member slots allocated */ @@ -90,7 +90,7 @@ static herr_t H5FD_family_dxpl_free(void *_dx); static hsize_t H5FD_family_sb_size(H5FD_t *_file); static herr_t H5FD_family_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out*/); -static herr_t H5FD_family_sb_decode(H5FD_t *_file, const char *name, +static herr_t H5FD_family_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf); static H5FD_t *H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); @@ -146,7 +146,7 @@ NAME H5FD_family_init_interface -- Initialize interface-specific information USAGE herr_t H5FD_family_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -242,9 +242,9 @@ H5FD_family_term(void) * * Modifications: * - * Raymond Lu + * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. * *------------------------------------------------------------------------- @@ -255,11 +255,11 @@ H5Pset_fapl_family(hid_t fapl_id, hsize_t msize, hid_t memb_fapl_id) herr_t ret_value; H5FD_family_fapl_t fa={0, -1}; H5P_genplist_t *plist; /* Property list pointer */ - + FUNC_ENTER_API(H5Pset_fapl_family, FAIL) H5TRACE3("e","ihi",fapl_id,msize,memb_fapl_id); - + /* Check arguments */ if(TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") @@ -300,9 +300,9 @@ done: * * Modifications: * - * Raymond Lu + * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. * *------------------------------------------------------------------------- @@ -314,7 +314,7 @@ H5Pget_fapl_family(hid_t fapl_id, hsize_t *msize/*out*/, H5FD_family_fapl_t *fa; H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Pget_fapl_family, FAIL) H5TRACE3("e","ixx",fapl_id,msize,memb_fapl_id); @@ -583,7 +583,7 @@ H5FD_family_sb_size(H5FD_t UNUSED *_file) FUNC_ENTER_NOAPI(H5FD_family_sb_size, UFAIL) - /* 8 bytes field for the size of member file size field should be + /* 8 bytes field for the size of member file size field should be * enough for now. */ ret_value += 8; @@ -630,7 +630,7 @@ H5FD_family_sb_encode(H5FD_t *_file, char *name/*out*/, /* copy member file size */ msize = (uint64_t)file->memb_size; UINT64ENCODE(p, msize); - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -639,11 +639,11 @@ done: /*------------------------------------------------------------------------- * Function: H5FD_family_sb_decode * - * Purpose: This function has 2 seperate purpose. One is to decodes the - * superblock information for this driver. The NAME argument is + * Purpose: This function has 2 seperate purpose. One is to decodes the + * superblock information for this driver. The NAME argument is * the eight-character (plus null termination) name stored in i - * the file. The FILE argument is updated according to the - * information in the superblock. + * the file. The FILE argument is updated according to the + * information in the superblock. * * Return: Success: 0 * @@ -663,14 +663,14 @@ H5FD_family_sb_decode(H5FD_t *_file, const char UNUSED *name, const unsigned cha uint64_t msize = 0; char err_msg[128]; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_family_sb_decode, FAIL) /* Read member file size. Skip name template for now although it's saved. */ UINT64DECODE(buf, msize); - - /* For h5repart only. Private property of new member size is used to signal - * h5repart is being used to change member file size. h5repart will open + + /* For h5repart only. Private property of new member size is used to signal + * h5repart is being used to change member file size. h5repart will open * files for read and write. When the files are closed, metadata will be * flushed to the files and updated this new size */ if(file->mem_newsize) { @@ -678,7 +678,7 @@ H5FD_family_sb_decode(H5FD_t *_file, const char UNUSED *name, const unsigned cha HGOTO_DONE(ret_value) } - /* Default - use the saved member size */ + /* Default - use the saved member size */ if(file->pmem_size == H5F_FAMILY_DEFAULT) { file->pmem_size = msize; } @@ -690,7 +690,7 @@ H5FD_family_sb_decode(H5FD_t *_file, const char UNUSED *name, const unsigned cha } /* Update member file size to the size saved in the superblock. - * That's the size intended to be. */ + * That's the size intended to be. */ file->memb_size = msize; done: @@ -716,17 +716,17 @@ done: * Raymond Lu * Thursday, November 18, 2004 * When file is re-opened, member size passed in from access property - * is checked to see if it's reasonable. If there is only 1 member - * file, member size can't be smaller than current member size. - * If there are at least 2 member files, member size can only be equal + * is checked to see if it's reasonable. If there is only 1 member + * file, member size can't be smaller than current member size. + * If there are at least 2 member files, member size can only be equal * the 1st member size. * * Raymond Lu * Tuesday, May 24, 2005 * The modification described above has been changed. The major checking - * is done in H5F_read_superblock. Member file size is saved in the + * is done in H5F_read_superblock. Member file size is saved in the * superblock now. H5F_read_superblock() reads this saved size and compare - * to the size passed in from file access property. Wrong size will + * to the size passed in from file access property. Wrong size will * result in a failure. * *------------------------------------------------------------------------- @@ -767,7 +767,7 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, if(NULL == (plist = H5I_object(fapl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list") fa = H5P_get_driver_info(plist); - + /* New family file size. It's used by h5repart only. */ if(H5P_exist_plist(plist, H5F_ACS_FAMILY_NEWSIZE_NAME) > 0) if(H5P_get(plist, H5F_ACS_FAMILY_NEWSIZE_NAME, &fam_newsize) < 0) @@ -789,11 +789,11 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, } file->name = H5MM_strdup(name); file->flags = flags; - + /* Check that names are unique */ sprintf(memb_name, name, 0); sprintf(temp, name, 1); - + if (!strcmp(memb_name, temp)) HGOTO_ERROR(H5E_FILE, H5E_FILEEXISTS, NULL, "file names not unique") @@ -811,7 +811,7 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, file->amembs = n; file->memb = x; } - + /* * Attempt to open file. If the first file cannot be opened then fail; * otherwise an open failure means that we've reached the last member. @@ -830,7 +830,7 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, file->nmembs++; } - /* If the file is reopened and there's only one member file existing, this file maybe + /* If the file is reopened and there's only one member file existing, this file maybe * smaller than the size specified through H5Pset_fapl_family(). Update the actual * member size. */ @@ -949,7 +949,7 @@ H5FD_family_cmp(const H5FD_t *_f1, const H5FD_t *_f2) assert(f1->nmembs>=1 && f1->memb[0]); assert(f2->nmembs>=1 && f2->memb[0]); - + ret_value= H5FDcmp(f1->memb[0], f2->memb[0]); done: @@ -986,7 +986,7 @@ H5FD_family_query(const H5FD_t UNUSED * _f, unsigned long *flags /* out */) if(flags) { *flags=0; *flags|=H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */ - /**flags|=H5FD_FEAT_ACCUMULATE_METADATA;*/ /* OK to accumulate metadata for faster writes. + /**flags|=H5FD_FEAT_ACCUMULATE_METADATA;*/ /* OK to accumulate metadata for faster writes. * - Turn it off temporarily because there's a bug * when trying to flush metadata during closing. */ *flags|=H5FD_FEAT_DATA_SIEVE; /* OK to perform data sieving for faster raw data reads & writes */ @@ -1084,7 +1084,7 @@ H5FD_family_set_eoa(H5FD_t *_file, haddr_t eoa) if (NULL==file->memb[u]) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to open member file") } - + /* Set the EOA marker for the member */ H5_CHECK_OVERFLOW(file->memb_size,hsize_t,haddr_t); if (addr>(haddr_t)file->memb_size) { @@ -1163,27 +1163,27 @@ done: /*------------------------------------------------------------------------- * Function: H5FD_family_get_handle - * + * * Purpose: Returns the file handle of FAMILY file driver. - * + * * Returns: Non-negative if succeed or negative if fails. - * + * * Programmer: Raymond Lu * Sept. 16, 2002 - * + * * Modifications: - * + * *------------------------------------------------------------------------- - */ -static herr_t + */ +static herr_t H5FD_family_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) -{ +{ H5FD_family_t *file = (H5FD_family_t *)_file; H5P_genplist_t *plist; hsize_t offset; int memb; herr_t ret_value; - + FUNC_ENTER_NOAPI(H5FD_family_get_handle, FAIL) /* Get the plist structure and family offset */ @@ -1259,7 +1259,7 @@ H5FD_family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, si sub = addr % file->memb_size; /* This check is for mainly for IA32 architecture whose size_t's size - * is 4 bytes, to prevent overflow when user application is trying to + * is 4 bytes, to prevent overflow when user application is trying to * write files bigger than 4GB. */ tempreq = file->memb_size-sub; if(tempreq > SIZET_MAX) @@ -1336,7 +1336,7 @@ H5FD_family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, s sub = addr % file->memb_size; /* This check is for mainly for IA32 architecture whose size_t's size - * is 4 bytes, to prevent overflow when user application is trying to + * is 4 bytes, to prevent overflow when user application is trying to * write files bigger than 4GB. */ tempreq = file->memb_size-sub; if(tempreq > SIZET_MAX) diff --git a/src/H5FDfphdf5.c b/src/H5FDfphdf5.c index de25c33..c600715 100644 --- a/src/H5FDfphdf5.c +++ b/src/H5FDfphdf5.c @@ -122,7 +122,7 @@ NAME H5FD_fphdf5_init_interface -- Initialize interface-specific information USAGE herr_t H5FD_fphdf5_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -231,7 +231,7 @@ H5Pset_fapl_fphdf5(hid_t fapl_id, MPI_Comm comm, MPI_Comm barrier_comm, H5P_genplist_t *plist; int mrc, comm_size; herr_t ret_value; - + FUNC_ENTER_API(H5Pset_fapl_fphdf5, FAIL) H5TRACE5("e","iMcMcMiIu",fapl_id,comm,barrier_comm,info,sap_rank); @@ -284,7 +284,7 @@ H5Pget_fapl_fphdf5(hid_t fapl_id, MPI_Comm *comm, MPI_Comm *barrier_comm, H5FD_fphdf5_fapl_t *fa; H5P_genplist_t *plist; herr_t ret_value = SUCCEED; - + FUNC_ENTER_API(H5Pget_fapl_fphdf5, FAIL) H5TRACE6("e","i*Mc*Mc*Mi*Iu*Iu",fapl_id,comm,barrier_comm,info,sap_rank, capt_rank); @@ -332,7 +332,7 @@ unsigned H5FD_fphdf5_file_id(H5FD_t *_file) { H5FD_fphdf5_t *file = (H5FD_fphdf5_t*)_file; - unsigned ret_value; + unsigned ret_value; FUNC_ENTER_NOAPI(H5FD_fphdf5_file_id, 0) @@ -464,7 +464,7 @@ H5Pset_dxpl_fphdf5(hid_t dxpl_id, H5FD_mpio_xfer_t xfer_mode) FUNC_ENTER_API(H5Pset_dxpl_fphdf5, FAIL) H5TRACE2("e","iDt",dxpl_id,xfer_mode); - + if (dxpl_id == H5P_DEFAULT) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't set values in default property list") @@ -950,17 +950,17 @@ done: * Modifications: *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5FD_fphdf5_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) -{ +{ H5FD_fphdf5_t *file = (H5FD_fphdf5_t *)_file; herr_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI(H5FD_fphdf5_get_handle, FAIL) /* check args */ assert(file); - + if (!file_handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid") @@ -1496,7 +1496,7 @@ static int H5FD_fphdf5_mpi_size(const H5FD_t *_file) { const H5FD_fphdf5_t *file = (const H5FD_fphdf5_t*)_file; - int ret_value; + int ret_value; FUNC_ENTER_NOAPI(H5FD_fphdf5_mpi_size, FAIL) diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 75c3c20..5725f87 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -150,7 +150,7 @@ typedef struct H5FD_log_t { /* * These macros check for overflow of various quantities. These macros * assume that file_offset_t is signed and haddr_t and size_t are unsigned. - * + * * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' * is too large to be represented by the second argument * of the file seek function. @@ -242,7 +242,7 @@ NAME H5FD_log_init_interface -- Initialize interface-specific information USAGE herr_t H5FD_log_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -326,7 +326,7 @@ H5FD_log_term(void) * Purpose: Modify the file access property list to use the H5FD_LOG * driver defined in this source file. There are no driver * specific properties. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke @@ -337,7 +337,7 @@ H5FD_log_term(void) * * Raymond Lu, 2001-10-25 * Changed the file access list to the new generic property list. - * + * *------------------------------------------------------------------------- */ herr_t @@ -349,10 +349,10 @@ H5Pset_fapl_log(hid_t fapl_id, const char *logfile, unsigned flags, size_t buf_s FUNC_ENTER_API(H5Pset_fapl_log, FAIL) H5TRACE4("e","isIuz",fapl_id,logfile,flags,buf_size); - + if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - + fa.logfile=(char*)logfile; fa.flags=flags; fa.buf_size=buf_size; @@ -420,7 +420,7 @@ H5FD_log_fapl_copy(const void *_old_fa) const H5FD_log_fapl_t *old_fa = (const H5FD_log_fapl_t*)_old_fa; H5FD_log_fapl_t *new_fa = H5MM_malloc(sizeof(H5FD_log_fapl_t)); void *ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_log_fapl_copy, NULL) assert(new_fa); @@ -976,36 +976,36 @@ done: /*------------------------------------------------------------------------- * Function: H5FD_log_get_handle - * + * * Purpose: Returns the file handle of LOG file driver. - * + * * Returns: Non-negative if succeed or negative if fails. - * + * * Programmer: Raymond Lu * Sept. 16, 2002 - * - * Modifications: - * + * + * Modifications: + * *------------------------------------------------------------------------- */ /* ARGSUSED */ static herr_t H5FD_log_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) -{ +{ H5FD_log_t *file = (H5FD_log_t *)_file; herr_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI(H5FD_log_get_handle, FAIL) if(!file_handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid") *file_handle = &(file->fd); - -done: + +done: FUNC_LEAVE_NOAPI(ret_value) -} - +} + /*------------------------------------------------------------------------- * Function: H5FD_log_read @@ -1034,7 +1034,7 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr H5FD_log_t *file = (H5FD_log_t*)_file; ssize_t nbytes; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_log_read, FAIL) assert(file && file->pub.cls); @@ -1111,7 +1111,7 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr addr += (haddr_t)nbytes; buf = (char*)buf + nbytes; } - + /* Update current position */ file->pos = addr; file->op = OP_READ; @@ -1153,7 +1153,7 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t add struct timeval timeval_diff; #endif /* H5_HAVE_GETTIMEOFDAY */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_log_write, FAIL) assert(file && file->pub.cls); @@ -1165,13 +1165,13 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t add assert(type==H5FD_MEM_DEFAULT || type==(H5FD_mem_t)file->flavor[(addr+size)-1] || (H5FD_mem_t)file->flavor[(addr+size)-1]==H5FD_MEM_DEFAULT); /* Check for overflow conditions */ - if (HADDR_UNDEF==addr) + if (HADDR_UNDEF==addr) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "addr undefined") if (REGION_OVERFLOW(addr, size)) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow") if (addr+size>file->eoa) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow") - + /* Log the I/O information about the write */ if(file->fa.flags&H5FD_LOG_FILE_WRITE) { size_t tmp_size=size; @@ -1212,7 +1212,7 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t add } /* end if */ HDfprintf(file->logfp," (%f s)\n",(double)timeval_diff.tv_sec+((double)timeval_diff.tv_usec/(double)1000000.0)); } /* end if */ - else + else HDfprintf(file->logfp,"\n"); #else /* H5_HAVE_GETTIMEOFDAY */ HDfprintf(file->logfp,"Seek: From %10a To %10a\n",file->pos,addr); @@ -1252,7 +1252,7 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t add if(file->fa.flags&H5FD_LOG_TIME_WRITE) HDgettimeofday(&timeval_stop,NULL); #endif /* H5_HAVE_GETTIMEOFDAY */ - + /* Log information about the write */ if(file->fa.flags&H5FD_LOG_LOC_WRITE) { /* Output the flavor information, if desired */ diff --git a/src/H5FDmpi.c b/src/H5FDmpi.c index 671eccb..2c1e526 100644 --- a/src/H5FDmpi.c +++ b/src/H5FDmpi.c @@ -62,7 +62,7 @@ H5FD_mpi_get_rank(const H5FD_t *file) assert(file && cls); assert(cls->get_rank); /* All MPI drivers must implement this */ - + /* Dispatch to driver */ if ((ret_value=(cls->get_rank)(file))<0) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "driver get_rank request failed") @@ -98,7 +98,7 @@ H5FD_mpi_get_size(const H5FD_t *file) assert(file && cls); assert(cls->get_size); /* All MPI drivers must implement this */ - + /* Dispatch to driver */ if ((ret_value=(cls->get_size)(file))<0) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "driver get_size request failed") @@ -134,7 +134,7 @@ H5FD_mpi_get_comm(const H5FD_t *file) assert(file && cls); assert(cls->get_comm); /* All MPI drivers must implement this */ - + /* Dispatch to driver */ if ((ret_value=(cls->get_comm)(file))==MPI_COMM_NULL) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, MPI_COMM_NULL, "driver get_comm request failed") @@ -151,7 +151,7 @@ done: * * Return: Success: The haddr_t equivalent of the MPI_OFF * argument. - * + * * Failure: HADDR_UNDEF * * Programmer: Unknown @@ -164,7 +164,7 @@ done: * * Robb Matzke, 1999-08-06 * Modified to work with the virtual file layer. - *------------------------------------------------------------------------- + *------------------------------------------------------------------------- */ haddr_t H5FD_mpi_MPIOff_to_haddr(MPI_Offset mpi_off) @@ -255,7 +255,7 @@ H5FD_mpi_comm_info_dup(MPI_Comm comm, MPI_Info info, MPI_Comm *comm_new, MPI_Inf MPI_Comm comm_dup=MPI_COMM_NULL; MPI_Info info_dup=MPI_INFO_NULL; int mpi_code; - + FUNC_ENTER_NOAPI(H5FD_mpi_comm_info_dup, FAIL) /* Check arguments */ @@ -297,7 +297,7 @@ done: * * Purpose: Free the communicator and Info object. * If comm or info is in fact MPI_COMM_NULL or MPI_INFO_NULL - * respectively, no action occurs to it. + * respectively, no action occurs to it. * * Return: Success: Non-negative. The values the pointers refer * to will be set to the corresponding NULL @@ -381,7 +381,7 @@ H5FD_mpio_wait_for_left_neighbor(H5FD_t *_file) file->mpi_rank-1, MPI_ANY_TAG, file->comm, &rcvstat ))) HMPI_GOTO_ERROR(FAIL, "MPI_Recv failed", mpi_code) } - + done: FUNC_LEAVE_NOAPI(ret_value) } diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 920d1e2..f285f1a 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -155,7 +155,7 @@ NAME H5FD_mpio_init_interface -- Initialize interface-specific information USAGE herr_t H5FD_mpio_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -217,7 +217,7 @@ H5FD_mpio_init(void) H5FD_mpio_Debug_inited++; } #endif /* H5FDmpio_DEBUG */ - + /* Set return value */ ret_value=H5FD_MPIO_g; @@ -300,7 +300,7 @@ H5FD_mpio_term(void) * Modified to work with the virtual file layer. * * Raymond Lu, 2001-10-23 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. * * Albert Cheng, 2003-04-17 @@ -317,7 +317,7 @@ H5Pset_fapl_mpio(hid_t fapl_id, MPI_Comm comm, MPI_Info info) H5FD_mpio_fapl_t fa; H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value; - + FUNC_ENTER_API(H5Pset_fapl_mpio, FAIL) H5TRACE3("e","iMcMi",fapl_id,comm,info); @@ -372,7 +372,7 @@ done: * read/write calls. * * Raymond Lu, 2001-10-23 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. * * Albert Cheng, 2003-04-17 @@ -388,7 +388,7 @@ H5Pget_fapl_mpio(hid_t fapl_id, MPI_Comm *comm/*out*/, MPI_Info *info/*out*/) MPI_Comm comm_tmp=MPI_COMM_NULL; int mpi_code; /* mpi return code */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Pget_fapl_mpio, FAIL) H5TRACE3("e","ixx",fapl_id,comm,info); @@ -407,7 +407,7 @@ H5Pget_fapl_mpio(hid_t fapl_id, MPI_Comm *comm/*out*/, MPI_Info *info/*out*/) if (MPI_SUCCESS != (mpi_code=MPI_Comm_dup(fa->comm, &comm_tmp))) HMPI_GOTO_ERROR(FAIL, "MPI_Comm_dup failed", mpi_code) } - + if (info){ if (MPI_INFO_NULL != fa->info){ if (MPI_SUCCESS != (mpi_code=MPI_Info_dup(fa->info, info))) @@ -444,7 +444,7 @@ done: * * H5FD_MPIO_COLLECTIVE: * Use collective I/O access. - * + * * Return: Success: Non-negative * * Failure: Negative @@ -465,7 +465,7 @@ H5Pset_dxpl_mpio(hid_t dxpl_id, H5FD_mpio_xfer_t xfer_mode) FUNC_ENTER_API(H5Pset_dxpl_mpio, FAIL) H5TRACE2("e","iDt",dxpl_id,xfer_mode); - + if(dxpl_id==H5P_DEFAULT) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't set values in default property list") @@ -601,7 +601,7 @@ H5FD_mpio_fapl_copy(const void *_old_fa) void *ret_value = NULL; const H5FD_mpio_fapl_t *old_fa = (const H5FD_mpio_fapl_t*)_old_fa; H5FD_mpio_fapl_t *new_fa = NULL; - + FUNC_ENTER_NOAPI(H5FD_mpio_fapl_copy, NULL) #ifdef H5FDmpio_DEBUG if (H5FD_mpio_Debug[(int)'t']) @@ -692,7 +692,7 @@ fprintf(stderr, "leaving H5FD_mpio_fapl_free\n"); * * Failure: NULL * - * Programmer: + * Programmer: * January 30, 1998 * * Modifications: @@ -710,7 +710,7 @@ fprintf(stderr, "leaving H5FD_mpio_fapl_free\n"); * Added barrier after MPI_File_set_size to prevent race * condition -- subsequent writes were being truncated, causing * holes in file. - * + * * Robb Matzke, 1999-08-06 * Modified to work with the virtual file layer. * @@ -1087,26 +1087,26 @@ done: /*------------------------------------------------------------------------- * Function: H5FD_mpio_get_handle - * + * * Purpose: Returns the file handle of MPIO file driver. - * + * * Returns: Non-negative if succeed or negative if fails. - * + * * Programmer: Raymond Lu * Sept. 16, 2002 - * + * * Modifications: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5FD_mpio_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) -{ +{ H5FD_mpio_t *file = (H5FD_mpio_t *)_file; herr_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI(H5FD_mpio_get_handle, FAIL) - + if(!file_handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid") @@ -1115,7 +1115,7 @@ H5FD_mpio_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) done: FUNC_LEAVE_NOAPI(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5FD_mpio_read @@ -1159,7 +1159,7 @@ done: * * Robb Matzke, 1999-07-28 * The ADDR argument is passed by value. - * + * * Robb Matzke, 1999-08-06 * Modified to work with the virtual file layer. * @@ -1240,7 +1240,7 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id, haddr_t add if(NULL == (plist = H5I_object(dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") xfer_mode=(H5FD_mpio_xfer_t)H5P_peek_unsigned(plist, H5D_XFER_IO_XFER_MODE_NAME); - + /* * Set up for a fancy xfer using complex types, or single byte block. We * wouldn't need to rely on the use_view field if MPI semantics allowed @@ -1412,7 +1412,7 @@ done: * * Kim Yates, Pat Weidhaas, 2000-09-26 * Move block of coding where only p0 writes after the - * MPI_File_set_view call. + * MPI_File_set_view call. * * Quincey Koziol, 2002-05-10 * Instead of always writing metadata from process 0, spread the @@ -1498,7 +1498,7 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, /* Obtain the data transfer properties */ if(NULL == (plist = H5I_object(dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - + if(type==H5FD_MEM_DRAW) { H5FD_mpio_xfer_t xfer_mode; /* I/O tranfer mode */ @@ -1614,7 +1614,7 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, /* Forget the EOF value (see H5FD_mpio_get_eof()) --rpm 1999-08-06 */ file->eof = HADDR_UNDEF; - + done: /* if only one process writes, need to broadcast the ret_value to other processes */ if (type!=H5FD_MEM_DRAW) { @@ -1655,7 +1655,7 @@ done: * allocated byte. * * Quincey Koziol, 2002-06-?? - * Changed file extension method to use MPI_File_set_size instead + * Changed file extension method to use MPI_File_set_size instead * read->write method. * *------------------------------------------------------------------------- diff --git a/src/H5FDmpiposix.c b/src/H5FDmpiposix.c index b6bfa80..16c4de6 100644 --- a/src/H5FDmpiposix.c +++ b/src/H5FDmpiposix.c @@ -150,7 +150,7 @@ typedef struct H5FD_mpiposix_t { /* * These macros check for overflow of various quantities. These macros * assume that file_offset_t is signed and haddr_t and size_t are unsigned. - * + * * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' * is too large to be represented by the second argument * of the file seek function. @@ -243,7 +243,7 @@ NAME H5FD_mpiposix_init_interface -- Initialize interface-specific information USAGE herr_t H5FD_mpiposix_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -361,7 +361,7 @@ H5Pset_fapl_mpiposix(hid_t fapl_id, MPI_Comm comm, hbool_t use_gpfs) H5FD_mpiposix_fapl_t fa; H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value; - + FUNC_ENTER_API(H5Pset_fapl_mpiposix, FAIL) H5TRACE3("e","iMcb",fapl_id,comm,use_gpfs); @@ -392,7 +392,7 @@ done: * of the application to free the returned communicator. * * Return: Success: Non-negative with the communicator and - * information returned through the COMM + * information returned through the COMM * argument if non-null. Since it is a duplicate * of the stored object, future modifications to * the access property list do not affect it and @@ -420,7 +420,7 @@ H5Pget_fapl_mpiposix(hid_t fapl_id, MPI_Comm *comm/*out*/, hbool_t *use_gpfs/*ou H5P_genplist_t *plist; /* Property list pointer */ int mpi_code; /* mpi return code */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Pget_fapl_mpiposix, FAIL) H5TRACE3("e","ixx",fapl_id,comm,use_gpfs); @@ -485,7 +485,7 @@ H5FD_mpiposix_fapl_get(H5FD_t *_file) /* Duplicate the communicator. */ if (MPI_SUCCESS != (mpi_code=MPI_Comm_dup(file->comm, &fa->comm))) HMPI_GOTO_ERROR(NULL, "MPI_Comm_dup failed", mpi_code) - + fa->use_gpfs = file->use_gpfs; /* Set return value */ @@ -519,7 +519,7 @@ H5FD_mpiposix_fapl_copy(const void *_old_fa) const H5FD_mpiposix_fapl_t *old_fa = (const H5FD_mpiposix_fapl_t*)_old_fa; H5FD_mpiposix_fapl_t *new_fa = NULL; int mpi_code; /* MPI return code */ - + FUNC_ENTER_NOAPI(H5FD_mpiposix_fapl_copy, NULL) if (NULL==(new_fa=H5MM_malloc(sizeof(H5FD_mpiposix_fapl_t)))) @@ -621,7 +621,7 @@ H5FD_mpiposix_open(const char *name, unsigned flags, hid_t fapl_id, #ifdef WIN32 HFILE filehandle; struct _BY_HANDLE_FILE_INFORMATION fileinfo; - int results; + int results; #endif H5FD_t *ret_value=NULL; /* Return value */ MPI_Comm comm_dup=MPI_COMM_NULL; @@ -734,7 +734,7 @@ H5FD_mpiposix_open(const char *name, unsigned flags, hid_t fapl_id, hint.fr.structType = GPFS_FREE_RANGE; hint.fr.start = 0; hint.fr.length = 0; - + if (gpfs_fcntl(fd, &hint)<0) HGOTO_ERROR(H5E_FILE, H5E_FCNTL, NULL, "failed to send hints to GPFS") } @@ -1048,26 +1048,26 @@ done: /*------------------------------------------------------------------------- * Function: H5FD_mpiposix_get_handle - * + * * Purpose: Returns the file handle of MPI-POSIX file driver. - * + * * Returns: Non-negative if succeed or negative if fails. - * + * * Programmer: Raymond Lu * Sept. 16, 2002 - * + * * Modifications: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5FD_mpiposix_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) -{ +{ H5FD_mpiposix_t *file = (H5FD_mpiposix_t *)_file; herr_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI(H5FD_mpiposix_get_handle, FAIL) - + if(!file_handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid") @@ -1157,7 +1157,7 @@ H5FD_mpiposix_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, addr += (haddr_t)nbytes; buf = (char*)buf + nbytes; } - + /* Update current position */ file->pos = addr; file->op = OP_READ; @@ -1217,13 +1217,13 @@ H5FD_mpiposix_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, assert(buf); /* Check for overflow conditions */ - if (HADDR_UNDEF==addr) + if (HADDR_UNDEF==addr) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "addr undefined") if (REGION_OVERFLOW(addr, size)) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow") if (addr+size>file->eoa) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow") - + /* Obtain the data transfer properties */ if(NULL == (plist = H5I_object(dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") @@ -1288,7 +1288,7 @@ H5FD_mpiposix_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, } #endif /* H5_HAVE_GPFS */ } - + /* Seek to the correct location */ if ((addr!=file->pos || OP_WRITE!=file->op) && file_seek(file->fd, (file_offset_t)addr, SEEK_SET)<0) diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index 155ec68..71b5c91 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -78,10 +78,10 @@ #define ALL_MEMBERS(LOOPVAR) { \ H5FD_mem_t LOOPVAR; \ for (LOOPVAR=H5FD_MEM_DEFAULT; LOOPVARmemb_addr, H5FD_MEM_NTYPES*sizeof(haddr_t)); if (relax) *relax = fa->relax; - + return 0; } @@ -867,7 +867,7 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) memb_eoa[mt] = HADDR_UNDEF; memb_name[mt] = NULL; } END_MEMBERS; - + /* * Read the map and count the unique members. */ @@ -925,7 +925,7 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) ALL_MEMBERS(mt) { file->fa.memb_map[mt] = map[mt]; } END_MEMBERS; - + /* Close files which are unused now */ memset(in_use, 0, sizeof in_use); UNIQUE_MEMBERS(map, mt) { @@ -1026,7 +1026,7 @@ H5FD_multi_fapl_copy(const void *_old_fa) H5FD_multi_fapl_t *new_fa = malloc(sizeof(H5FD_multi_fapl_t)); int nerrors = 0; static const char *func="H5FD_multi_fapl_copy"; /* Function Name for error reporting */ - + assert(new_fa); /* Clear the error stack */ @@ -1118,7 +1118,7 @@ H5FD_multi_dxpl_copy(const void *_old_dx) H5FD_multi_dxpl_t *new_dx = malloc(sizeof(H5FD_multi_dxpl_t)); int nerrors = 0; static const char *func="H5FD_multi_dxpl_copy"; /* Function Name for error reporting */ - + assert(new_dx); /* Clear the error stack */ @@ -1206,7 +1206,7 @@ H5FD_multi_open(const char *name, unsigned flags, hid_t fapl_id, H5FD_multi_fapl_t *fa; H5FD_mem_t m; static const char *func="H5FD_multi_open"; /* Function Name for error reporting */ - + /* Clear the error stack */ H5Eclear_stack(H5E_DEFAULT); @@ -1500,7 +1500,7 @@ H5FD_multi_set_eoa(H5FD_t *_file, haddr_t eoa) if (status<0) H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_BADVALUE, "member H5FDset_eoa failed", -1) } - + /* Save new eoa for return later */ file->eoa = eoa; @@ -1545,7 +1545,7 @@ H5FD_multi_get_eof(const H5FD_t *_file) if (HADDR_UNDEF==tmp) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eof", HADDR_UNDEF) if (tmp>0) tmp += file->fa.memb_addr[mt]; - + } else if (file->fa.relax) { /* * The member is not open yet (maybe it doesn't exist). Make the @@ -1553,27 +1553,27 @@ H5FD_multi_get_eof(const H5FD_t *_file) */ tmp = file->memb_next[mt]; assert(HADDR_UNDEF!=tmp); - + } else { H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eof", HADDR_UNDEF) } if (tmp>eof) eof = tmp; } END_MEMBERS; - + return MAX(file->eoa, eof); } /*------------------------------------------------------------------------- * Function: H5FD_multi_get_handle - * + * * Purpose: Returns the file handle of MULTI file driver. - * + * * Returns: Non-negative if succeed or negative if fails. - * - * Programmer: Raymond Lu - * Sept. 16, 2002 + * + * Programmer: Raymond Lu + * Sept. 16, 2002 * * Modifications: * @@ -1581,7 +1581,7 @@ H5FD_multi_get_eof(const H5FD_t *_file) */ static herr_t H5FD_multi_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) -{ +{ H5FD_multi_t *file = (H5FD_multi_t *)_file; H5FD_mem_t type, mmt; static const char *func="H5FD_multi_get_handle"; /* Function Name for error reporting */ @@ -1593,7 +1593,7 @@ H5FD_multi_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "data type is out of range", -1) mmt = file->fa.memb_map[type]; if(H5FD_MEM_DEFAULT==mmt) mmt = type; - + return (H5FDget_vfd_handle(file->memb[mmt], fapl, file_handle)); } @@ -1624,7 +1624,7 @@ H5FD_multi_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) mmt = file->fa.memb_map[type]; if (H5FD_MEM_DEFAULT==mmt) mmt = type; - + if (HADDR_UNDEF==(addr=H5FDalloc(file->memb[mmt], type, dxpl_id, size))) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file can't alloc", HADDR_UNDEF) addr += file->fa.memb_addr[mmt]; @@ -1660,7 +1660,7 @@ H5FD_multi_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsi mmt = file->fa.memb_map[type]; if (H5FD_MEM_DEFAULT==mmt) mmt = type; - + assert(addr>=file->fa.memb_addr[mmt]); assert(addr+size<=file->memb_next[mmt]); return H5FDfree(file->memb[mmt], type, dxpl_id, addr-file->fa.memb_addr[mmt], size); @@ -1702,7 +1702,7 @@ H5FD_multi_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz if (H5P_FILE_ACCESS_DEFAULT!=dxpl_id && H5FD_MULTI==H5Pget_driver(dxpl_id)) { dx = H5Pget_driver_info(dxpl_id); } - + /* Find the file to which this address belongs */ for (mt=H5FD_MEM_SUPER; mtfa.memb_map[mt]; @@ -1757,7 +1757,7 @@ H5FD_multi_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, si if (H5P_FILE_ACCESS_DEFAULT!=dxpl_id && H5FD_MULTI==H5Pget_driver(dxpl_id)) { dx = H5Pget_driver_info(dxpl_id); } - + /* Find the file to which this address belongs */ for (mt=H5FD_MEM_SUPER; mtfa.memb_map[mt]; @@ -1804,7 +1804,7 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing) #if 0 H5FD_mem_t mmt; - + /* Debugging stuff... */ fprintf(stderr, "multifile access information:\n"); @@ -1821,7 +1821,7 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing) fprintf(stderr, " File Starting Allocated Next Member\n"); fprintf(stderr, " Number Address Size Address Name\n"); fprintf(stderr, " ------ -------------------- -------------------- -------------------- ------------------------------\n"); - + for (mt=1; mtmemb_addr[mt]) { haddr_t eoa = H5FDget_eoa(file->memb[mt]); @@ -1847,7 +1847,7 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing) } if (nerrors) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error flushing member files", -1) - + return 0; } @@ -1878,7 +1878,7 @@ compute_next(H5FD_multi_t *file) ALL_MEMBERS(mt) { file->memb_next[mt] = HADDR_UNDEF; } END_MEMBERS; - + UNIQUE_MEMBERS(file->fa.memb_map, mt1) { UNIQUE_MEMBERS(file->fa.memb_map, mt2) { if (file->fa.memb_addr[mt1]fa.memb_addr[mt2] && @@ -1891,7 +1891,7 @@ compute_next(H5FD_multi_t *file) file->memb_next[mt1] = HADDR_MAX; /*last member*/ } } END_MEMBERS; - + return 0; } @@ -1918,7 +1918,7 @@ open_members(H5FD_multi_t *file) char tmp[1024]; int nerrors=0; static const char *func="(H5FD_multi)open_members"; /* Function Name for error reporting */ - + /* Clear the error stack */ H5Eclear_stack(H5E_DEFAULT); diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h index 94e215b..285404a 100644 --- a/src/H5FDpublic.h +++ b/src/H5FDpublic.h @@ -115,7 +115,7 @@ typedef enum H5FD_mem_t { * the library will attempt to cache metadata as it is written to the file * and build up a larger block of metadata to eventually pass to the VFL * 'write' routine. - * + * * Distinguish between updating the metadata accumulator on writes and * reads. This is particularly (perhaps only, even) important for MPI-I/O * where we guarantee that writes are collective, but reads may not be. @@ -139,7 +139,7 @@ typedef enum H5FD_mem_t { * and then sub-allocate "small" raw data requests from that larger block. */ #define H5FD_FEAT_AGGREGATE_SMALLDATA 0x00000010 - + /* Forward declaration */ typedef struct H5FD_t H5FD_t; diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index 41c9e62..f45deb1 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -119,7 +119,7 @@ typedef struct H5FD_sec2_t { /* * These macros check for overflow of various quantities. These macros * assume that file_offset_t is signed and haddr_t and size_t are unsigned. - * + * * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' * is too large to be represented by the second argument * of the file seek function. @@ -196,7 +196,7 @@ NAME H5FD_sec2_init_interface -- Initialize interface-specific information USAGE herr_t H5FD_sec2_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -280,7 +280,7 @@ H5FD_sec2_term(void) * Purpose: Modify the file access property list to use the H5FD_SEC2 * driver defined in this source file. There are no driver * specific properties. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke @@ -298,7 +298,7 @@ H5Pset_fapl_sec2(hid_t fapl_id) FUNC_ENTER_API(H5Pset_fapl_sec2, FAIL) H5TRACE1("e","i",fapl_id); - + if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") @@ -632,27 +632,27 @@ done: /*------------------------------------------------------------------------- * Function: H5FD_sec2_get_handle - * + * * Purpose: Returns the file handle of sec2 file driver. - * + * * Returns: Non-negative if succeed or negative if fails. - * + * * Programmer: Raymond Lu * Sept. 16, 2002 - * + * * Modifications: * *------------------------------------------------------------------------- */ /* ARGSUSED */ -static herr_t +static herr_t H5FD_sec2_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) -{ +{ H5FD_sec2_t *file = (H5FD_sec2_t *)_file; herr_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI(H5FD_sec2_get_handle, FAIL) - + if(!file_handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid") *file_handle = &(file->fd); @@ -689,7 +689,7 @@ H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, hadd H5FD_sec2_t *file = (H5FD_sec2_t*)_file; ssize_t nbytes; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_sec2_read, FAIL) assert(file && file->pub.cls); @@ -731,7 +731,7 @@ H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, hadd addr += (haddr_t)nbytes; buf = (char*)buf + nbytes; } - + /* Update current position */ file->pos = addr; file->op = OP_READ; @@ -773,20 +773,20 @@ H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, had H5FD_sec2_t *file = (H5FD_sec2_t*)_file; ssize_t nbytes; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_sec2_write, FAIL) assert(file && file->pub.cls); assert(buf); /* Check for overflow conditions */ - if (HADDR_UNDEF==addr) + if (HADDR_UNDEF==addr) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "addr undefined") if (REGION_OVERFLOW(addr, size)) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow") if (addr+size>file->eoa) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow") - + /* Seek to the correct location */ if ((addr!=file->pos || OP_WRITE!=file->op) && file_seek(file->fd, (file_offset_t)addr, SEEK_SET)<0) @@ -810,7 +810,7 @@ H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, had addr += (haddr_t)nbytes; buf = (const char*)buf + nbytes; } - + /* Update current position and eof */ file->pos = addr; file->op = OP_WRITE; diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index 99aae42..fc7dd1c 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -115,7 +115,7 @@ typedef struct H5FD_stdio_t { /* * These macros check for overflow of various quantities. These macros * assume that file_offset_t is signed and haddr_t and size_t are unsigned. - * + * * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' * is too large to be represented by the second argument * of the file seek function. @@ -254,7 +254,7 @@ H5FD_stdio_term(void) * Purpose: Modify the file access property list to use the H5FD_STDIO * driver defined in this source file. There are no driver * specific properties. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke @@ -277,7 +277,7 @@ H5Pset_fapl_stdio(hid_t fapl_id) if(0 == H5Pisa_class(fapl_id, H5P_FILE_ACCESS)) H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADTYPE, "not a file access property list", -1) - + return H5Pset_driver(fapl_id, H5FD_STDIO, NULL); } @@ -291,10 +291,10 @@ H5Pset_fapl_stdio(hid_t fapl_id) * * Errors: * IO CANTOPENFILE File doesn't exist and CREAT wasn't - * specified. - * IO CANTOPENFILE Fopen failed. + * specified. + * IO CANTOPENFILE Fopen failed. * IO FILEEXISTS File exists but CREAT and EXCL were - * specified. + * specified. * * Return: Success: A pointer to a new file data structure. The * public fields will be initialized by the @@ -402,7 +402,7 @@ H5FD_stdio_open( const char *name, unsigned flags, hid_t fapl_id, * Purpose: Closes a file. * * Errors: - * IO CLOSEERROR Fclose failed. + * IO CLOSEERROR Fclose failed. * * Return: Non-negative on success/Negative on failure * @@ -622,34 +622,34 @@ H5FD_stdio_get_eof(const H5FD_t *_file) /*------------------------------------------------------------------------- * Function: H5FD_stdio_get_handle - * + * * Purpose: Returns the file handle of stdio file driver. - * + * * Returns: Non-negative if succeed or negative if fails. - * + * * Programmer: Raymond Lu * Sept. 16, 2002 - * + * * Modifications: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5FD_stdio_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) -{ +{ H5FD_stdio_t *file = (H5FD_stdio_t *)_file; static const char *func="H5FD_stdio_get_handle"; /* Function Name for error reporting */ /* Shut compiler up */ fapl=fapl; - + /* Clear the error stack */ H5Eclear_stack(H5E_DEFAULT); *file_handle = &(file->fp); if(*file_handle==NULL) H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_WRITEERROR, "get handle failed", -1) - return(0); + return(0); } @@ -661,8 +661,8 @@ H5FD_stdio_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) * physical end of file returns zeros instead of failing. * * Errors: - * IO READERROR Fread failed. - * IO SEEKERROR Fseek failed. + * IO READERROR Fread failed. + * IO SEEKERROR Fseek failed. * * Return: Non-negative on success/Negative on failure * @@ -693,7 +693,7 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz H5Eclear_stack(H5E_DEFAULT); /* Check for overflow */ - if (HADDR_UNDEF==addr) + if (HADDR_UNDEF==addr) H5Epush_ret (func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1) if (REGION_OVERFLOW(addr, size)) H5Epush_ret (func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1) @@ -729,7 +729,7 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz memset((unsigned char *)buf + size - nbytes, 0, nbytes); size -= nbytes; } - + /* * Read the data. Since we're reading single-byte values, a partial read * will advance the file position by N. If N is zero or an error @@ -743,7 +743,7 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz } else if (n < size) { memset((unsigned char *)buf + n, 0, (size - n)); } - + /* * Update the file position data. */ @@ -760,8 +760,8 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz * file address ADDR. * * Errors: - * IO SEEKERROR Fseek failed. - * IO WRITEERROR Fwrite failed. + * IO SEEKERROR Fseek failed. + * IO WRITEERROR Fwrite failed. * * Return: Non-negative on success/Negative on failure * @@ -797,7 +797,7 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, H5Epush_ret (func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1) if (addr+size>file->eoa) H5Epush_ret (func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1) - + /* * Seek to the correct file position. */ @@ -810,7 +810,7 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, } file->pos = addr; } - + /* * Write the buffer. On successful return, the file position will be * advanced by the number of bytes read. Otherwise nobody knows where it @@ -821,7 +821,7 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, file->pos = HADDR_UNDEF; H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_WRITEERROR, "fwrite failed", -1) } - + /* * Update seek optimizing data. */ @@ -842,8 +842,8 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, * Purpose: Makes sure that all data is on disk. * * Errors: - * IO SEEKERROR fseek failed. - * IO WRITEERROR fflush or fwrite failed. + * IO SEEKERROR fseek failed. + * IO WRITEERROR fflush or fwrite failed. * * Return: Non-negative on success/Negative on failure * diff --git a/src/H5FDstream.c b/src/H5FDstream.c index d23db5b..a798539 100644 --- a/src/H5FDstream.c +++ b/src/H5FDstream.c @@ -1,7 +1,7 @@ /* * Copyright © 2000 The author. * The author prefers this code not be used for military purposes. - * + * * * Author: Thomas Radke * Tuesday, September 12, 2000 @@ -126,7 +126,7 @@ static const H5FD_stream_fapl_t default_fapl = /* * These macros check for overflow of various quantities. These macros * assume that file_offset_t is signed and haddr_t and size_t are unsigned. - * + * * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' * is too large to be represented by the second argument * of the file seek function. @@ -207,7 +207,7 @@ NAME H5FD_stream_init_interface -- Initialize interface-specific information USAGE herr_t H5FD_stream_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -300,7 +300,7 @@ H5FD_stream_term(void) * If a valid socket argument is given this will be used * by the driver instead of parsing the 'hostname:port' filename * and opening a socket internally. - * + * * Return: Success: Non-negative * Failure: Negative * @@ -426,7 +426,7 @@ H5FD_stream_open_socket (const char *filename, int o_flags, H5FD_STREAM_SOCKET_TYPE sock=H5FD_STREAM_INVALID_SOCKET; char *hostname=NULL; unsigned short int first_port; - const char *separator, *tmp; + const char *separator, *tmp; int on = 1; H5FD_STREAM_SOCKET_TYPE ret_value=H5FD_STREAM_INVALID_SOCKET; @@ -446,7 +446,7 @@ H5FD_stream_open_socket (const char *filename, int o_flags, HGOTO_ERROR(H5E_ARGS,H5E_BADVALUE,H5FD_STREAM_INVALID_SOCKET,"invalid port number") } } - + hostname = (char *) H5MM_malloc ((size_t)(separator - filename + 1)); /* Return if out of memory */ @@ -986,7 +986,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5FD_stream_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) { H5FD_stream_t *file = (H5FD_stream_t *)_file; diff --git a/src/H5FDstream.h b/src/H5FDstream.h index 450726b..e59d092 100644 --- a/src/H5FDstream.h +++ b/src/H5FDstream.h @@ -18,7 +18,7 @@ #ifdef H5_HAVE_STREAM # define H5FD_STREAM (H5FD_stream_init()) -#else +#else # define H5FD_STREAM (-1) #endif /*H5_HAVE_STREAM */ diff --git a/src/H5FL.c b/src/H5FL.c index 40483c8..cc9edb5 100644 --- a/src/H5FL.c +++ b/src/H5FL.c @@ -118,7 +118,7 @@ NAME H5FL_init_interface -- Initialize interface-specific information USAGE herr_t H5FL_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -151,7 +151,7 @@ H5FL_init_interface(void) * Tuesday, August 1, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static void * @@ -190,7 +190,7 @@ done: * Friday, March 24, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -236,7 +236,7 @@ done: * Friday, March 24, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -302,7 +302,7 @@ done: * Friday, March 24, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -362,7 +362,7 @@ done: * Monday, December 23, 2002 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -399,7 +399,7 @@ done: * Tuesday, July 25, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -408,7 +408,7 @@ H5FL_reg_gc_list(H5FL_reg_head_t *head) H5FL_reg_node_t *free_list; /* Pointer to nodes in free list being garbage collected */ void *tmp; /* Temporary node pointer */ size_t total_mem; /* Total memory used on list */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_reg_gc_list) /* Calculate the total memory used on this list */ @@ -458,7 +458,7 @@ H5FL_reg_gc_list(H5FL_reg_head_t *head) * Modifications: * Broke into two parts, one for looping over all the free lists and * another for freeing each list - QAK 7/25/00 - * + * *------------------------------------------------------------------------- */ static herr_t @@ -466,7 +466,7 @@ H5FL_reg_gc(void) { H5FL_reg_gc_node_t *gc_node; /* Pointer into the list of things to garbage collect */ herr_t ret_value=SUCCEED; /* return value*/ - + FUNC_ENTER_NOAPI_NOINIT(H5FL_reg_gc) /* Walk through all the free lists, free()'ing the nodes */ @@ -618,7 +618,7 @@ H5FL_blk_find_list(H5FL_blk_node_t **head, size_t size) temp=temp->next; } /* end while */ } /* end if */ - + FUNC_LEAVE_NOAPI(temp) } /* end H5FL_blk_find_list() */ @@ -651,7 +651,7 @@ H5FL_blk_create_list(H5FL_blk_node_t **head, size_t size) /* Allocate room for the new free list node */ if(NULL==(temp=H5FL_MALLOC(H5FL_blk_node_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for chunk info") - + /* Set the correct values for the new free list */ temp->size=size; temp->list=NULL; @@ -688,7 +688,7 @@ done: * Saturday, March 25, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -814,7 +814,7 @@ H5FL_blk_malloc(H5FL_blk_head_t *head, size_t size) } /* end if */ /* No free list available, or there are no nodes on the list, allocate a new node to give to the user */ - else { + else { /* Allocate new node, with room for the page info header and the actual page data */ if(NULL==(temp=H5FL_malloc(sizeof(H5FL_blk_list_t)+size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for chunk") @@ -1034,7 +1034,7 @@ H5FL_blk_unlink(H5FL_blk_head_t *pq) herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5FL_blk_unlink) - + /* Find the node to remove from the global list */ last=NULL; tmp=H5FL_blk_gc_head.first; @@ -1079,7 +1079,7 @@ done: * Thursday, March 23, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1088,7 +1088,7 @@ H5FL_blk_gc_list(H5FL_blk_head_t *head) H5FL_blk_list_t *list; /* The free list of native nodes of a particular size */ void *next; /* Temp. ptr to the free list list node */ void *temp; /* Temp. ptr to the free list page node */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_blk_gc_list) /* Loop through all the nodes in the block free list queue */ @@ -1143,7 +1143,7 @@ H5FL_blk_gc_list(H5FL_blk_head_t *head) * Saturday, March 25, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1151,7 +1151,7 @@ H5FL_blk_gc(void) { H5FL_blk_gc_node_t *gc_node; /* Pointer into the list of things to garbage collect */ herr_t ret_value=SUCCEED; /* return value*/ - + FUNC_ENTER_NOAPI_NOINIT(H5FL_blk_gc) /* Walk through all the free lists, free()'ing the nodes */ @@ -1199,7 +1199,7 @@ H5FL_blk_term(void) H5FL_blk_gc_node_t *tmp; /* Temporary pointer to a garbage collection node */ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_blk_term) - + /* Free the nodes on the garbage collection list, keeping nodes with allocations outstanding */ left=NULL; while(H5FL_blk_gc_head.first!=NULL) { @@ -1229,7 +1229,7 @@ printf("H5FL_blk_term: head->name=%s, head->allocated=%d\n", H5FL_blk_gc_head.fi /* Point to the list of nodes left with allocations open, if any */ H5FL_blk_gc_head.first=left; - + FUNC_LEAVE_NOAPI(H5FL_blk_gc_head.first!=NULL ? 1 : 0) } /* end H5FL_blk_term() */ @@ -1247,7 +1247,7 @@ printf("H5FL_blk_term: head->name=%s, head->allocated=%d\n", H5FL_blk_gc_head.fi * Saturday, March 25, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1277,7 +1277,7 @@ H5FL_arr_init(H5FL_arr_head_t *head) /* Initialize the size of each array */ for(u = 0; u<(size_t)head->maxelem; u++) head->list_arr[u].size = head->base_size + (head->elem_size * u); - + /* Indicate that the free list is initialized */ head->init=1; @@ -1298,7 +1298,7 @@ done: * Friday, March 24, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1374,7 +1374,7 @@ done: * Saturday, March 25, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1449,7 +1449,7 @@ done: * Monday, December 23, 2002 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1487,7 +1487,7 @@ done: * Saturday, March 25, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1548,7 +1548,7 @@ done: * Tuesday, July 25, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1558,7 +1558,7 @@ H5FL_arr_gc_list(H5FL_arr_head_t *head) void *tmp; /* Temporary node pointer */ unsigned u; /* Counter for array of free lists */ size_t total_mem; /* Total memory used on list */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_arr_gc_list) /* Walk through the array of free lists */ @@ -1610,7 +1610,7 @@ H5FL_arr_gc_list(H5FL_arr_head_t *head) * Saturday, March 25, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1618,7 +1618,7 @@ H5FL_arr_gc(void) { H5FL_gc_arr_node_t *gc_arr_node; /* Pointer into the list of things to garbage collect */ herr_t ret_value=SUCCEED; /* return value*/ - + FUNC_ENTER_NOAPI_NOINIT(H5FL_arr_gc) /* Walk through all the free lists, free()'ing the nodes */ @@ -1664,7 +1664,7 @@ H5FL_arr_term(void) { H5FL_gc_arr_node_t *left; /* pointer to garbage collection lists with work left */ H5FL_gc_arr_node_t *tmp; /* Temporary pointer to a garbage collection node */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_arr_term) /* Free the nodes on the garbage collection list, keeping nodes with allocations outstanding */ @@ -1698,7 +1698,7 @@ printf("H5FL_arr_term: head->name=%s, head->allocated=%d\n", H5FL_arr_gc_head.fi /* Point to the list of nodes left with allocations open, if any */ H5FL_arr_gc_head.first=left; - + FUNC_LEAVE_NOAPI(H5FL_arr_gc_head.first!=NULL ? 1 : 0) } /* end H5FL_arr_term() */ @@ -1715,7 +1715,7 @@ printf("H5FL_arr_term: head->name=%s, head->allocated=%d\n", H5FL_arr_gc_head.fi * Saturday, April 3, 2004 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1749,7 +1749,7 @@ H5FL_seq_free(H5FL_seq_head_t *head, void *obj) * Saturday, April 3, 2004 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1783,7 +1783,7 @@ done: * Saturday, April 3, 2004 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1817,7 +1817,7 @@ done: * Saturday, April 3, 2004 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1851,7 +1851,7 @@ done: * Wednesday, February 2, 2005 * * Modifications: - * + * *------------------------------------------------------------------------- */ H5FL_fac_head_t * @@ -1868,7 +1868,7 @@ H5FL_fac_init(size_t size) /* Allocate room for the new factory */ if(NULL==(factory=H5FL_MALLOC(H5FL_fac_head_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for factory object") - + /* Initialize block header information */ HDmemset(&(factory->queue),0,sizeof(H5FL_blk_head_t)); @@ -1895,7 +1895,7 @@ done: * Wednesday, February 2, 2005 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1929,7 +1929,7 @@ H5FL_fac_free(H5FL_fac_head_t *head, void *obj) * Wednesday, February 2, 2005 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1962,7 +1962,7 @@ done: * Wednesday, February 2, 2005 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1995,7 +1995,7 @@ done: * Wednesday, February 2, 2005 * * Modifications: - * + * *------------------------------------------------------------------------- */ herr_t @@ -2039,7 +2039,7 @@ done: * Friday, March 24, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ herr_t @@ -2095,7 +2095,7 @@ done: * *------------------------------------------------------------------------- */ -herr_t +herr_t H5FL_set_free_list_limits(int reg_global_lim, int reg_list_lim, int arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim) { @@ -2145,7 +2145,7 @@ int H5FL_term_interface(void) { int ret_value=0; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_term_interface) /* Garbage collect any nodes on the free lists */ diff --git a/src/H5FLprivate.h b/src/H5FLprivate.h index 4c8fa94..b7b2030 100644 --- a/src/H5FLprivate.h +++ b/src/H5FLprivate.h @@ -134,7 +134,7 @@ typedef struct H5FL_blk_head_t { } H5FL_blk_head_t; /* - * Macros for defining & using priority queues + * Macros for defining & using priority queues */ #define H5FL_BLK_NAME(t) H5_##t##_blk_free_list #ifndef H5_NO_BLK_FREE_LISTS diff --git a/src/H5FP.c b/src/H5FP.c index 0497cb1..6d85b88 100644 --- a/src/H5FP.c +++ b/src/H5FP.c @@ -335,7 +335,7 @@ done: /* * Function: H5FP_commit_sap_datatypes - * Purpose: Commit the H5FP_request, H5FP_reply, H5FP_read, + * Purpose: Commit the H5FP_request, H5FP_reply, H5FP_read, * H5FP_alloc, H5FP_eoa and H5FP_super structure datatypes * to MPI. * Return: Success: SUCCEED diff --git a/src/H5FPclient.c b/src/H5FPclient.c index a01bfaf..274324a 100644 --- a/src/H5FPclient.c +++ b/src/H5FPclient.c @@ -327,7 +327,7 @@ H5FP_request_read_metadata(H5FD_t *file, unsigned file_id, hid_t dxpl_id, HDmemset(&mpi_status, 0, sizeof(mpi_status)); /* the following code is a bit odd and doubtless needs a bit - * of explanation. I certainly stumbled over it the first + * of explanation. I certainly stumbled over it the first * time I read it. * * For reasons unknown, read requests sent to the SAP only @@ -345,7 +345,7 @@ H5FP_request_read_metadata(H5FD_t *file, unsigned file_id, hid_t dxpl_id, * * JRM - 4/13/04 */ - if (size < sap_read.md_size) + if (size < sap_read.md_size) { char *mdata; @@ -361,7 +361,7 @@ HDfprintf(stderr, "Metadata Read Failed!!!!\n"); H5FP_SAP_COMM, &mpi_status)) != MPI_SUCCESS) HMPI_GOTO_ERROR(FAIL, "MPI_Recv failed", mrc); } else { - HDfprintf(stdout, + HDfprintf(stdout, "H5FP_request_read_metadata: size = %d > md_size = %d.\n", (int)size, (int)(sap_read.md_size)); HDfprintf(stdout, "Mssg received from SAP is too small!!!!\n"); @@ -569,7 +569,7 @@ H5FP_request_flush_metadata(H5FD_t *file, unsigned file_id, hid_t dxpl_id, if ((mrc = MPI_Recv(&sap_reply, 1, H5FP_reply, (int)H5FP_sap_rank, H5FP_TAG_REPLY, H5FP_SAP_COMM, &mpi_status)) != MPI_SUCCESS) HMPI_GOTO_ERROR(FAIL, "MPI_Recv failed", mrc); - + if (sap_reply.status != H5FP_STATUS_OK) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCHANGE, FAIL, "can't write metadata to server"); @@ -649,15 +649,15 @@ done: /* * Function: H5FP_client_alloc * Purpose: Handle the client side of an allocation in the FP case. - * In essence, this is simply a matter of referring the + * In essence, this is simply a matter of referring the * request to the SAP, and then returning the reply. * * A modified version of this code used to live in H5FD_alloc(), * but I move it here to encapsulate it and generally tidy up. - * - * One can argue that we should all be done in an alloc - * routine in H5FDfdhdf5.c, but this invlves a smaller - * change to the code, and thus a smaller loss if I missed + * + * One can argue that we should all be done in an alloc + * routine in H5FDfdhdf5.c, but this invlves a smaller + * change to the code, and thus a smaller loss if I missed * a major gotcha. If things go well, and we don't heave * the current implementation of FP, I'll probably go that * route eventually. @@ -707,14 +707,14 @@ H5FP_client_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) if ( !capt_only || H5FD_fphdf5_is_captain(file) ) { /* Send the request to the SAP */ if ( H5FP_request_allocate(file, type, size, &fp_alloc.addr, - &fp_alloc.eoa, &req_id, &status) + &fp_alloc.eoa, &req_id, &status) != SUCCEED ) { HGOTO_ERROR(H5E_FPHDF5, H5E_CANTALLOC, HADDR_UNDEF, "server couldn't allocate from file") } } - /* It should be impossible for this assertion to fail, but then + /* It should be impossible for this assertion to fail, but then * that is what assertions are for. */ HDassert(status == H5FP_STATUS_OK); @@ -730,7 +730,7 @@ H5FP_client_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) } /* we used to send the eoa to the sap here, but that is silly, - * as the sap already knows, and it is possible that another + * as the sap already knows, and it is possible that another * interleaving allocation will result in a corrupted eoa. * * JRM - 4/7/04 @@ -745,7 +745,7 @@ done: } /* H5FP_client_alloc() */ -/* This function is now called only by H5FP_client_alloc() above. +/* This function is now called only by H5FP_client_alloc() above. * Should we make it a private function only accessible from this * file? JRM - 4/8/04 */ @@ -964,8 +964,8 @@ H5FP_request_set_eoa(H5FD_t *file, haddr_t eoa, unsigned *req_id, H5FP_status_t req.proc_rank = H5FD_mpi_get_rank(file); req.addr = eoa; -#if 0 - /* This is useful debugging code -- lets keep for a while. +#if 0 + /* This is useful debugging code -- lets keep for a while. * JRM -- 4/13/04 */ /* dump stack each time we set the eoa */ @@ -974,7 +974,7 @@ H5FP_request_set_eoa(H5FD_t *file, haddr_t eoa, unsigned *req_id, H5FP_status_t MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); - HDfprintf(stdout, + HDfprintf(stdout, "%d: %s: setting eoa: last eoa = %a, new eoa = %a.\n", mpi_rank, "H5FP_request_set_eoa", last_eoa_received, eoa); H5FS_print(stdout); @@ -1051,7 +1051,7 @@ H5FP_request_update_eoma_eosda(H5FD_t *file, unsigned *req_id, H5FP_status_t *st H5FP_SAP_BARRIER_COMM)) != MPI_SUCCESS) HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed!", mrc); -#if 0 +#if 0 /* The following set_eoa just parrots back to the SAP the eoa * we just received from it. While I don't think it is a problem * in this case, there are obvious potentials for race conditions, @@ -1096,7 +1096,7 @@ H5FP_gen_request_id() /* * Function: H5FP_dump_to_file - * Purpose: Dump the updated metadata to the file. + * Purpose: Dump the updated metadata to the file. * Return: Success: SUCCEED * Failure: FAIL * Programmer: Bill Wendling, 03. February 2003 diff --git a/src/H5FPprivate.h b/src/H5FPprivate.h index e309982..da34a6c 100644 --- a/src/H5FPprivate.h +++ b/src/H5FPprivate.h @@ -317,14 +317,14 @@ extern herr_t H5FP_request_flush_metadata(H5FD_t *file, unsigned file_id, extern herr_t H5FP_request_close(H5FD_t *file, unsigned sap_file_id, unsigned *req_id, H5FP_status_t *status); -/* the following function should probably become a private function +/* the following function should probably become a private function * in H5FPclient.c if H5FP_client_alloc() does the job. -- JRM */ extern herr_t H5FP_request_allocate(H5FD_t *file, H5FD_mem_t mem_type, hsize_t size, haddr_t *addr, haddr_t *eoa, unsigned *req_id, H5FP_status_t *status); -extern haddr_t H5FP_client_alloc(H5FD_t *file, H5FD_mem_t type, +extern haddr_t H5FP_client_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size); extern herr_t H5FP_request_free(H5FD_t *file, H5FD_mem_t mem_type, haddr_t addr, hsize_t size, diff --git a/src/H5FPserver.c b/src/H5FPserver.c index 9eee898..d7bd97a 100644 --- a/src/H5FPserver.c +++ b/src/H5FPserver.c @@ -184,7 +184,7 @@ H5FP_sap_receive_loop(void) herr_t ret_value = SUCCEED; int comm_size; int stop = 0; - H5FP_request_t req; + H5FP_request_t req; FUNC_ENTER_NOAPI(H5FP_sap_receive_loop, FAIL) @@ -318,7 +318,7 @@ H5FP_new_object_lock(hobj_ref_t oid, unsigned rank, H5FP_obj_t obj_type, { int comm_size; H5FP_object_lock *ret_value = NULL; - + FUNC_ENTER_NOAPI_NOINIT(H5FP_new_object_lock) if (MPI_Comm_size(H5FP_SAP_COMM, &comm_size) != MPI_SUCCESS) @@ -547,7 +547,7 @@ H5FP_merge_mod_node_with_next(H5SL_t *slist, H5SL_node_t *node_ptr) unsigned offset; unsigned i,j; - /* The next node address range is not completely subsumed in + /* The next node address range is not completely subsumed in * that of the current node. Must allocate a new buffer, and * copy over the contents of the two buffers. Where the buffers * overlap, give precidence to the data from *node_ptr @@ -565,7 +565,7 @@ H5FP_merge_mod_node_with_next(H5SL_t *slist, H5SL_node_t *node_ptr) combined_metadata_ptr[i++] = (mod_ptr->metadata)[j]; offset = (mod_ptr->addr + mod_ptr->md_size) - next_mod_ptr->addr; - + for ( j = offset; j < next_mod_ptr->md_size; j++ ) combined_metadata_ptr[i++] = (next_mod_ptr->metadata)[j]; @@ -583,7 +583,7 @@ H5FP_merge_mod_node_with_next(H5SL_t *slist, H5SL_node_t *node_ptr) H5SL_remove(slist, &next_mod_ptr->addr); H5FP_free_mod_node(next_mod_ptr); - + done: FUNC_LEAVE_NOAPI(ret_value) } /* H5FP_merge_mod_node_with_next() */ @@ -631,7 +631,7 @@ H5FP_merge_mod_node_with_prev(H5SL_t *slist, H5SL_node_t *node_ptr) char *combined_metadata_ptr; unsigned limit; - /* The node address range is not completely subsumed in + /* The node address range is not completely subsumed in * that of the previous node. Must allocate a new buffer, and * copy over the contents of the two buffers. Where the buffers * overlap, give precidence to the data from *node_ptr @@ -661,7 +661,7 @@ H5FP_merge_mod_node_with_prev(H5SL_t *slist, H5SL_node_t *node_ptr) prev_mod_ptr->md_size = combined_md_size; } else { /* supplied node is completely inside previous node */ /* no need to allocate a new buffer. Just copy data from - * mod_ptr->metadata to the appropriate locations in + * mod_ptr->metadata to the appropriate locations in * prev_mod_ptr->metadata. */ @@ -673,15 +673,15 @@ H5FP_merge_mod_node_with_prev(H5SL_t *slist, H5SL_node_t *node_ptr) HDassert(i <= prev_mod_ptr->md_size); } /* end else */ - /* We have copied metadata from the current node into the previous - * node. All that remains is to delete the current node from the + /* We have copied metadata from the current node into the previous + * node. All that remains is to delete the current node from the * tree and free it. */ H5SL_remove(slist, &mod_ptr->addr); H5FP_free_mod_node(mod_ptr); - + done: FUNC_LEAVE_NOAPI(ret_value) } /* H5FP_merge_mod_node_with_prev() */ @@ -689,9 +689,9 @@ done: /* * Function: H5FP_mod_node_overlaps_with_next * - * Purpose: Given a node in a mod tree, see if there is an overlap - * between the address range of the supplied node, and that - * of the next node in the tree (if any). + * Purpose: Given a node in a mod tree, see if there is an overlap + * between the address range of the supplied node, and that + * of the next node in the tree (if any). * * Return: TRUE if there is an overlap, and FALSE if there * isn't. @@ -715,7 +715,7 @@ H5FP_mod_node_overlaps_with_next(H5SL_node_t *node_ptr) next_node_ptr = H5SL_next(node_ptr); if ( next_node_ptr != NULL ) { -#if 0 +#if 0 if ( ( ((H5FP_mdata_mod *)H5SL_item(node_ptr))->addr > 100000 ) || ( (((H5FP_mdata_mod *)H5SL_item(node_ptr))->md_size) > 1024 ) ) { HDfprintf(stdout, "%s: addr = %a, size = %u, mem_type = %d.\n", @@ -726,7 +726,7 @@ H5FP_mod_node_overlaps_with_next(H5SL_node_t *node_ptr) } if ( (((H5FP_mdata_mod *)H5SL_item(node_ptr))->addr) - >= + >= (((H5FP_mdata_mod *)H5SL_item(next_node_ptr))->addr) ) { HDfprintf(stdout, "%s: addr,len = %a,%u, next_addr,len = %a,%u.\n", @@ -736,7 +736,7 @@ H5FP_mod_node_overlaps_with_next(H5SL_node_t *node_ptr) (((H5FP_mdata_mod *)H5SL_item(next_node_ptr))->addr), ((H5FP_mdata_mod *)H5SL_item(next_node_ptr))->md_size); - HDassert((((H5FP_mdata_mod *)H5SL_item(node_ptr))->addr) + HDassert((((H5FP_mdata_mod *)H5SL_item(node_ptr))->addr) < (((H5FP_mdata_mod *)H5SL_item(next_node_ptr))->addr) ); @@ -745,15 +745,15 @@ H5FP_mod_node_overlaps_with_next(H5SL_node_t *node_ptr) if ( ( (((H5FP_mdata_mod *)H5SL_item(node_ptr))->addr) + (((H5FP_mdata_mod *)H5SL_item(node_ptr))->md_size) - ) + ) > (((H5FP_mdata_mod *)H5SL_item(next_node_ptr))->addr) ) { -#if 0 +#if 0 /* This is useful debugging code -- keep it around for * a while. JRM -- 4/13/03 */ - HDfprintf(stdout, + HDfprintf(stdout, "H5FP_mod_node_overlaps_with_next: addr = %a, next_addr = %a.\n", (((H5FP_mdata_mod *)(node_ptr->data))->addr), (((H5FP_mdata_mod *)(next_node_ptr->data))->addr)); @@ -768,9 +768,9 @@ H5FP_mod_node_overlaps_with_next(H5SL_node_t *node_ptr) /* * Function: H5FP_mod_node_overlaps_with_prev * - * Purpose: Givena node in a mod tree, see if there is an overlap - * between the address range of the supplied node, and that - * of the previous node in the tree (if any). + * Purpose: Givena node in a mod tree, see if there is an overlap + * between the address range of the supplied node, and that + * of the previous node in the tree (if any). * * Return: TRUE if there is an overlap, and FALSE if there * isn't. @@ -795,7 +795,7 @@ H5FP_mod_node_overlaps_with_prev(H5SL_node_t *node_ptr) if ( prev_node_ptr != NULL ) { - HDassert((((H5FP_mdata_mod *)H5SL_item(node_ptr))->addr) + HDassert((((H5FP_mdata_mod *)H5SL_item(node_ptr))->addr) > (((H5FP_mdata_mod *)H5SL_item(prev_node_ptr))->addr) ); @@ -803,15 +803,15 @@ H5FP_mod_node_overlaps_with_prev(H5SL_node_t *node_ptr) if ( ( (((H5FP_mdata_mod *)H5SL_item(prev_node_ptr))->addr) + (((H5FP_mdata_mod *)H5SL_item(prev_node_ptr))->md_size) - ) + ) > (((H5FP_mdata_mod *)H5SL_item(node_ptr))->addr) ) { -#if 0 +#if 0 /* This is useful debugging code -- keep it around for * a while. JRM - 4/13/04 */ - HDfprintf(stdout, + HDfprintf(stdout, "H5FP_mod_node_overlaps_with_prev: addr = %a, prev_addr = %a.\n", (((H5FP_mdata_mod *)(node_ptr->data))->addr), (((H5FP_mdata_mod *)(prev_node_ptr->data))->addr)); @@ -839,7 +839,7 @@ H5FP_mod_node_overlaps_with_prev(H5SL_node_t *node_ptr) * JRM -- 3/29/04 */ static herr_t -H5FP_add_file_mod_to_list(H5FP_file_info *info, H5FD_mem_t mem_type, +H5FP_add_file_mod_to_list(H5FP_file_info *info, H5FD_mem_t mem_type, haddr_t addr, unsigned md_size, char *metadata) { @@ -853,13 +853,13 @@ H5FP_add_file_mod_to_list(H5FP_file_info *info, H5FD_mem_t mem_type, assert(info); #if 0 - /* This is useful debugging code -- keep it around for a + /* This is useful debugging code -- keep it around for a * while. JRM -- 4/13/04 */ - HDfprintf(stdout, - "H5FP_add_file_mod_to_list: Adding chunk at %a of length %u.\n", + HDfprintf(stdout, + "H5FP_add_file_mod_to_list: Adding chunk at %a of length %u.\n", addr, md_size); -#endif +#endif if ((node = H5SL_find(info->mod_list, &addr)) != NULL) { /* * The metadata is in the cache already. All we have to do is @@ -883,7 +883,7 @@ H5FP_add_file_mod_to_list(H5FP_file_info *info, H5FD_mem_t mem_type, (info->num_mods)--; /* since we just merged */ } - } else { /* fm->md_size == md_size */ + } else { /* fm->md_size == md_size */ HDfree(fm->metadata); fm->metadata = metadata; } @@ -907,7 +907,7 @@ H5FP_add_file_mod_to_list(H5FP_file_info *info, H5FD_mem_t mem_type, } /* if the tree was valid to begin with, we must merge with at - * most one previous node. + * most one previous node. */ if ( H5FP_mod_node_overlaps_with_prev(node) ) { if ( H5FP_merge_mod_node_with_prev(info->mod_list, node) < 0 ) @@ -1313,7 +1313,7 @@ H5FP_sap_handle_lock_request(H5FP_request_t *req) exit_state = H5FP_STATUS_BAD_FILE_ID; HGOTO_DONE(FAIL) } - + if (oids[j].info->closing) { /* we're closing the file - don't accept anymore locks */ exit_state = H5FP_STATUS_FILE_CLOSING; @@ -1446,7 +1446,7 @@ assert(0); HDfree(oids); H5FP_send_reply(req->proc_rank, req->req_id, req->file_id, exit_state); FUNC_LEAVE_NOAPI(ret_value) -} +} /* * Function: H5FP_sap_handle_release_lock_request @@ -1575,10 +1575,10 @@ H5FP_sap_handle_read_request(H5FP_request_t *req) int mrc; FUNC_ENTER_NOAPI_NOINIT(H5FP_sap_handle_read_request) -#if 0 +#if 0 /* More useful debugging code to keep for a time. JRM - 4/13/04 */ - HDfprintf(stdout, - "H5FP_sap_handle_read_request: req->addr = %a.\n", + HDfprintf(stdout, + "H5FP_sap_handle_read_request: req->addr = %a.\n", req->addr); #endif @@ -1659,8 +1659,8 @@ H5FP_sap_handle_write_request(H5FP_request_t *req, char *mdata, unsigned md_size FUNC_ENTER_NOAPI_NOINIT(H5FP_sap_handle_write_request) #if 0 /* Debugging code -- lets keep it for a time. JRM -- 4/13/04 */ - HDfprintf(stdout, - "H5FP_sap_handle_write_request: addr = %a, md_size = %d.\n", + HDfprintf(stdout, + "H5FP_sap_handle_write_request: addr = %a, md_size = %d.\n", (haddr_t)(req->addr), (int)md_size); #endif if ((info = H5SL_search(file_info_list,&req->file_id)) != NULL) { @@ -1850,9 +1850,9 @@ H5FP_sap_handle_alloc_request(H5FP_request_t *req) sap_alloc.eoa = HADDR_UNDEF; sap_alloc.status = H5FP_STATUS_CANT_ALLOC; } -#if 0 +#if 0 /* Debugging code -- lets keep it for a time. JRM -- 4/13/04 */ - HDfprintf(stdout, + HDfprintf(stdout, "%s: req_size = %d, req_type = %d, addr = %a, eoa = %a, status = %d, rp_rank = %d.\n", "H5FP_sap_handle_alloc_request", (int)(req->meta_block_size), @@ -1897,7 +1897,7 @@ H5FP_sap_handle_free_request(H5FP_request_t *req) #if 0 /* Debugging code -- lets keep it for a time. JRM -- 4/13/04 */ - HDfprintf(stdout, + HDfprintf(stdout, "%s: addr = %a, block_size = %a, mem_type = %d, rp_rank = %d.\n", "H5FP_sap_handle_free_request", req->addr, @@ -2006,10 +2006,10 @@ H5FP_sap_handle_set_eoa_request(H5FP_request_t *req) if ((info = H5SL_search(file_info_list,&req->file_id)) != NULL) { -#if 0 +#if 0 /* Debugging code -- lets keep it for a time. JRM -- 4/13/04 */ if ( req->addr < ((H5FD_fphdf5_t*)&info->file)->eoa ) { - HDfprintf(stdout, + HDfprintf(stdout, "%s: old eoa = %a, new eoa = %a, rp_rank = %d. %s\n", "H5FP_sap_handle_set_eoa_request", ((H5FD_fphdf5_t*)&info->file)->eoa, @@ -2019,14 +2019,14 @@ H5FP_sap_handle_set_eoa_request(H5FP_request_t *req) } #if 0 else { - HDfprintf(stdout, + HDfprintf(stdout, "%s: old eoa = %a, new eoa = %a, rp_rank = %d.\n", "H5FP_sap_handle_set_eoa_request", ((H5FD_fphdf5_t*)&info->file)->eoa, req->addr, (int)(req->proc_rank)); } -#endif +#endif #endif /* Get the EOA. */ @@ -2035,7 +2035,7 @@ H5FP_sap_handle_set_eoa_request(H5FP_request_t *req) } else { #if 1 /* Debugging code -- lets keep it for a time. JRM -- 4/13/04 */ - HDfprintf(stdout, + HDfprintf(stdout, "%s: Function failed -- Couldn't get info. new eoa = %a.\n", "H5FP_sap_handle_set_eoa_request", req->addr); diff --git a/src/H5FS.c b/src/H5FS.c index 58817b8..63928dd 100644 --- a/src/H5FS.c +++ b/src/H5FS.c @@ -16,7 +16,7 @@ * Purpose: Provides internal function tracing in the form of a stack. * The FUNC_ENTER() macro adds the function name to the function * stack whenever a function is entered. - * As the functions return with FUNC_LEAVE, + * As the functions return with FUNC_LEAVE, * entries are removed from the stack. * * A function stack has a fixed maximum size. If this size is @@ -112,10 +112,10 @@ H5FS_print(FILE *stream) H5FS_t *fstack = H5FS_get_my_stack (); /* Get the correct function stack */ const int indent = 2; /* Indention level */ int i; /* Local index ariable */ - + /* Don't push this function on the function stack... :-) */ FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5FS_print); - + /* Sanity check */ assert(fstack); @@ -136,7 +136,7 @@ H5FS_print(FILE *stream) for (i=fstack->nused-1; i>=0; --i) HDfprintf(stream, "%*s#%03d: Routine: %s\n", indent, "", i, fstack->slot[i]); - + FUNC_LEAVE_NOAPI_NOFS(SUCCEED); } /* end H5FS_print() */ @@ -160,7 +160,7 @@ herr_t H5FS_push(const char *func_name) { H5FS_t *fstack = H5FS_get_my_stack (); - + /* Don't push this function on the function stack... :-) */ FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5FS_push); @@ -174,7 +174,7 @@ H5FS_push(const char *func_name) if (fstack->nusedslot[fstack->nused] = func_name; fstack->nused++; - + FUNC_LEAVE_NOAPI_NOFS(SUCCEED); } /* end H5FS_push() */ @@ -197,7 +197,7 @@ herr_t H5FS_pop(void) { H5FS_t *fstack = H5FS_get_my_stack (); - + /* Don't push this function on the function stack... :-) */ FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5FS_pop); @@ -207,7 +207,7 @@ H5FS_pop(void) /* Pop the function. */ fstack->nused--; - + FUNC_LEAVE_NOAPI_NOFS(SUCCEED); } /* end H5FS_pop() */ diff --git a/src/H5Fdbg.c b/src/H5Fdbg.c index ee42963..4048ba0 100644 --- a/src/H5Fdbg.c +++ b/src/H5Fdbg.c @@ -46,7 +46,7 @@ * Modifications: * Robb Matzke, 1999-07-28 * The ADDR argument is passed by value. - * + * * Raymond Lu, 2001-10-14 * Changed to the new generic property list. * diff --git a/src/H5Fmount.c b/src/H5Fmount.c index 18feb9c..0bff83b 100644 --- a/src/H5Fmount.c +++ b/src/H5Fmount.c @@ -35,7 +35,7 @@ NAME H5F_init_mount_interface -- Initialize interface-specific information USAGE herr_t H5F_init_mount_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -71,7 +71,7 @@ H5F_close_mounts(H5F_t *f) { unsigned u; /* Local index */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5F_close_mounts, FAIL) HDassert(f); @@ -132,7 +132,7 @@ H5F_mount(H5G_entry_t *loc, const char *name, H5F_t *child, H5G_entry_t mp_open_ent; /* entry of moint point to be opened */ H5RS_str_t *name_r; /* Ref-counted version of name */ herr_t ret_value = SUCCEED; /*return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5F_mount) assert(loc); @@ -161,7 +161,7 @@ H5F_mount(H5G_entry_t *loc, const char *name, H5F_t *child, if(parent->shared->fc_degree != child->shared->fc_degree) HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "mounted file has different file close degree than parent") - + /* * Use a binary search to locate the position that the child should be * inserted into the parent mount table. At the end of this paragraph @@ -184,7 +184,7 @@ H5F_mount(H5G_entry_t *loc, const char *name, H5F_t *child, md++; if (!cmp) HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "mount point is already in use") - + /* Make room in the table */ if (parent->mtab.nmounts>=parent->mtab.nalloc) { unsigned n = MAX(16, 2*parent->mtab.nalloc); @@ -249,7 +249,7 @@ done: * * Pedro Vicente, 22 Aug 2002 * Added `id to name' support. - * + * *------------------------------------------------------------------------- */ static herr_t @@ -265,7 +265,7 @@ H5F_unmount(H5G_entry_t *loc, const char *name, hid_t dxpl_id) H5G_entry_t mnt_open_ent; /* entry used to open mount point*/ int child_idx; /* Index of child in parent's mtab */ herr_t ret_value = SUCCEED; /*return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5F_unmount) assert(loc); @@ -391,7 +391,7 @@ H5F_mountpoint(H5G_entry_t *find/*in,out*/) int cmp; H5G_entry_t *ent = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5F_mountpoint, FAIL) assert(find); @@ -432,7 +432,7 @@ H5F_mountpoint(H5G_entry_t *find/*in,out*/) parent = ent->file; } } while (!cmp); - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -457,7 +457,7 @@ htri_t H5F_has_mount(const H5F_t *file) { htri_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5F_has_mount, FAIL) assert(file); @@ -466,7 +466,7 @@ H5F_has_mount(const H5F_t *file) ret_value=TRUE; else ret_value=FALSE; - + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_has_mount() */ @@ -491,7 +491,7 @@ htri_t H5F_is_mount(const H5F_t *file) { htri_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5F_is_mount, FAIL) assert(file); @@ -500,7 +500,7 @@ H5F_is_mount(const H5F_t *file) ret_value=TRUE; else ret_value=FALSE; - + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_is_mount() */ @@ -527,7 +527,7 @@ H5Fmount(hid_t loc_id, const char *name, hid_t child_id, hid_t plist_id) H5G_entry_t *loc = NULL; H5F_t *child = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Fmount, FAIL) H5TRACE4("e","isii",loc_id,name,child_id,plist_id); @@ -579,7 +579,7 @@ H5Funmount(hid_t loc_id, const char *name) { H5G_entry_t *loc = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Funmount, FAIL) H5TRACE2("e","is",loc_id,name); @@ -629,7 +629,7 @@ H5F_mount_count_ids_recurse(H5F_t *f, unsigned *nopen_files, unsigned *nopen_obj if(f->file_id > 0) *nopen_files += 1; - /* Increment number of open objects in file + /* Increment number of open objects in file * (Reduced by number of mounted files, we'll add back in the mount point's * groups later, if they are open) */ @@ -666,7 +666,7 @@ herr_t H5F_mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs) { herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5F_mount_count_ids, FAIL) /* Sanity check */ diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 8e68d0b..4458c7a 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -123,7 +123,7 @@ typedef struct H5F_mount_t { struct H5G_t *group; /* Mount point group held open */ struct H5F_t *file; /* File mounted at that point */ } H5F_mount_t; - + /* * The mount table describes what files are attached to (mounted on) the file * to which this table belongs. diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 211a2aa..d3f6cd8 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -282,7 +282,7 @@ typedef struct H5F_t H5F_t; #else # define H5F_OVERFLOW_HSIZET2OFFT(X) 0 #endif - + /* ========= File Creation properties ============ */ /* Definitions for the size of the file user block in bytes */ #define H5F_CRT_USER_BLOCK_NAME "block_size" @@ -317,7 +317,7 @@ typedef struct H5F_t H5F_t; #define H5F_CRT_OBJ_DIR_VERS_SIZE sizeof(unsigned) #define H5F_CRT_OBJ_DIR_VERS_DEF HDF5_OBJECTDIR_VERSION /* Definitions for shared-header format version */ -#define H5F_CRT_SHARE_HEAD_VERS_NAME "share_head_version" +#define H5F_CRT_SHARE_HEAD_VERS_NAME "share_head_version" #define H5F_CRT_SHARE_HEAD_VERS_SIZE sizeof(unsigned) #define H5F_CRT_SHARE_HEAD_VERS_DEF HDF5_SHAREDHEADER_VERSION @@ -340,7 +340,7 @@ typedef struct H5F_t H5F_t; /* Definition for preemption read chunks first */ #define H5F_ACS_PREEMPT_READ_CHUNKS_NAME "rdcc_w0" #define H5F_ACS_PREEMPT_READ_CHUNKS_SIZE sizeof(double) -#define H5F_ACS_PREEMPT_READ_CHUNKS_DEF 0.75 +#define H5F_ACS_PREEMPT_READ_CHUNKS_DEF 0.75 /* Definition for threshold for alignment */ #define H5F_ACS_ALIGN_THRHD_NAME "threshold" @@ -358,7 +358,7 @@ typedef struct H5F_t H5F_t; #define H5F_ACS_META_BLOCK_SIZE_SIZE sizeof(hsize_t) #define H5F_ACS_META_BLOCK_SIZE_DEF 2048 -/* Definition for maximum sieve buffer size (when data sieving +/* Definition for maximum sieve buffer size (when data sieving is allowed by file driver */ #define H5F_ACS_SIEVE_BUF_SIZE_NAME "sieve_buf_size" #define H5F_ACS_SIEVE_BUF_SIZE_SIZE sizeof(size_t) @@ -395,18 +395,18 @@ typedef struct H5F_t H5F_t; #define H5F_ACS_FAMILY_OFFSET_SIZE sizeof(hsize_t) #define H5F_ACS_FAMILY_OFFSET_DEF 0 -/* Definition for new member size of family driver. It's private +/* Definition for new member size of family driver. It's private * property only used by h5repart */ #define H5F_ACS_FAMILY_NEWSIZE_NAME "family_newsize" #define H5F_ACS_FAMILY_NEWSIZE_SIZE sizeof(hsize_t) #define H5F_ACS_FAMILY_NEWSIZE_DEF 0 - -/* Definition for whether to conver family to sec2 driver. It's private + +/* Definition for whether to conver family to sec2 driver. It's private * property only used by h5repart */ #define H5F_ACS_FAMILY_TO_SEC2_NAME "family_to_sec2" #define H5F_ACS_FAMILY_TO_SEC2_SIZE sizeof(hbool_t) #define H5F_ACS_FAMILY_TO_SEC2_DEF FALSE - + /* Definition for data type in multi file driver */ #define H5F_ACS_MULTI_TYPE_NAME "multi_type" #define H5F_ACS_MULTI_TYPE_SIZE sizeof(H5FD_mem_t) @@ -415,8 +415,8 @@ typedef struct H5F_t H5F_t; /* ======================== File Mount properties ====================*/ /* Definition for whether absolute symlinks local to file. */ #define H5F_MNT_SYM_LOCAL_NAME "local" -#define H5F_MNT_SYM_LOCAL_SIZE sizeof(hbool_t) -#define H5F_MNT_SYM_LOCAL_DEF FALSE +#define H5F_MNT_SYM_LOCAL_SIZE sizeof(hbool_t) +#define H5F_MNT_SYM_LOCAL_DEF FALSE #ifdef H5_HAVE_PARALLEL /* Which process writes metadata */ @@ -481,7 +481,7 @@ H5_DLL void H5F_addr_decode(const H5F_t *, const uint8_t** /*in,out*/, /* Callback functions for file access class */ H5_DLL herr_t H5F_acs_create(hid_t fapl_id, void *close_data); H5_DLL herr_t H5F_acs_close(hid_t fapl_id, void *close_data); -H5_DLL herr_t H5F_acs_copy(hid_t new_fapl_id, hid_t old_fapl_id, +H5_DLL herr_t H5F_acs_copy(hid_t new_fapl_id, hid_t old_fapl_id, void *close_data); /* Shared file list related routines */ diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index a829b97..a38fe25 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -86,7 +86,7 @@ typedef enum H5F_scope_t { /* How does file close behave? * H5F_CLOSE_DEFAULT - Use the degree pre-defined by underlining VFL - * H5F_CLOSE_WEAK - file closes only after all opened objects are closed + * H5F_CLOSE_WEAK - file closes only after all opened objects are closed * H5F_CLOSE_SEMI - if no opened objects, file is close; otherwise, file close fails * H5F_CLOSE_STRONG - if there are opened objects, close them first, then @@ -121,7 +121,7 @@ H5_DLL herr_t H5Fmount(hid_t loc, const char *name, hid_t child, hid_t plist); H5_DLL herr_t H5Funmount(hid_t loc, const char *name); H5_DLL hssize_t H5Fget_freespace(hid_t file_id); H5_DLL herr_t H5Fget_filesize(hid_t file_id, hsize_t *size); -H5_DLL herr_t H5Fget_mdc_config(hid_t file_id, +H5_DLL herr_t H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t * config_ptr); H5_DLL herr_t H5Fset_mdc_config(hid_t file_id, H5AC_cache_config_t * config_ptr); diff --git a/src/H5Fsfile.c b/src/H5Fsfile.c index 70eb420..e269776 100644 --- a/src/H5Fsfile.c +++ b/src/H5Fsfile.c @@ -105,7 +105,7 @@ H5F_sfile_add(H5F_file_t *shared) { H5F_sfile_node_t *new_shared; /* New shared file node */ herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5F_sfile_add) /* Sanity check */ @@ -147,7 +147,7 @@ H5F_sfile_search(H5FD_t *lf) { H5F_sfile_node_t *curr; /* Current shared file node */ H5F_file_t *ret_value = NULL; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_sfile_search) /* Sanity check */ @@ -189,7 +189,7 @@ H5F_sfile_remove(H5F_file_t *shared) H5F_sfile_node_t *curr; /* Current shared file node */ H5F_sfile_node_t *last; /* Last shared file node */ herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5F_sfile_remove) /* Sanity check */ diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 4cb1646..1676fe3 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -34,7 +34,7 @@ NAME H5F_init_super_interface -- Initialize interface-specific information USAGE herr_t H5T_init_super_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -69,10 +69,10 @@ H5F_init_super_interface(void) * Modifications: * Raymond Lu * May 24, 2005 - * Started to check if driver(only family and multi drivers) + * Started to check if driver(only family and multi drivers) * matches driver information saved in the superblock. Wrong * driver will result in a failure. - * + * *------------------------------------------------------------------------- */ herr_t @@ -138,21 +138,21 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent, haddr_t addr /* Superblock version */ super_vers = *p++; - if (super_vers > HDF5_SUPERBLOCK_VERSION_MAX) + if (super_vers > HDF5_SUPERBLOCK_VERSION_MAX) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "bad superblock version number") if (H5P_set(c_plist, H5F_CRT_SUPER_VERS_NAME, &super_vers) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set superblock version") /* Freespace version */ freespace_vers = *p++; - if (HDF5_FREESPACE_VERSION != freespace_vers) + if (HDF5_FREESPACE_VERSION != freespace_vers) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "bad free space version number") if (H5P_set(c_plist, H5F_CRT_FREESPACE_VERS_NAME, &freespace_vers) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to free space version") /* Root group version number */ obj_dir_vers = *p++; - if (HDF5_OBJECTDIR_VERSION != obj_dir_vers) + if (HDF5_OBJECTDIR_VERSION != obj_dir_vers) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "bad object directory version number") if (H5P_set(c_plist, H5F_CRT_OBJ_DIR_VERS_NAME, &obj_dir_vers) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set object directory version") @@ -162,7 +162,7 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent, haddr_t addr /* Shared header version number */ share_head_vers = *p++; - if (HDF5_SHAREDHEADER_VERSION != share_head_vers) + if (HDF5_SHAREDHEADER_VERSION != share_head_vers) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "bad shared-header format version number") if (H5P_set(c_plist, H5F_CRT_SHARE_HEAD_VERS_NAME, &share_head_vers) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set shared-header format version") @@ -184,7 +184,7 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent, haddr_t addr if (H5P_set(c_plist, H5F_CRT_OBJ_BYTE_NUM_NAME, &sizeof_size) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set byte number for object size") shared->sizeof_size = sizeof_size; /* Keep a local copy also */ - + /* Skip over reserved byte */ p++; @@ -277,10 +277,10 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent, haddr_t addr /* This step is for h5repart tool only. If user wants to change file driver from * family to sec2 while using h5repart, set the driver address to undefined to let * the library ignore the family driver information saved in the superblock. - */ + */ if(shared->fam_to_sec2) shared->driver_addr = HADDR_UNDEF; - + /* Decode the optional driver information block */ if (H5F_addr_defined(shared->driver_addr)) { haddr_t drv_addr = shared->base_addr + shared->driver_addr; @@ -324,13 +324,13 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent, haddr_t addr HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to read file driver information") } /* end if */ - /* Check if driver matches driver information saved. Unfortunately, we can't push this + /* Check if driver matches driver information saved. Unfortunately, we can't push this * function to each specific driver because we're checking if the driver is correct.*/ if(!HDstrncmp(driver_name, "NCSAfami", 8) && HDstrcmp(lf->cls->name, "family")) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "family driver should be used") if(!HDstrncmp(driver_name, "NCSAmult", 8) && HDstrcmp(lf->cls->name, "multi")) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "multi driver should be used") - + if (H5FD_sb_decode(lf, driver_name, p) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to decode driver information") @@ -342,7 +342,7 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent, haddr_t addr /* Set the driver info block checksum */ shared->drvr_chksum = chksum; } /* end if */ - + /* * The user-defined data is the area of the file before the base * address. @@ -363,7 +363,7 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent, haddr_t addr #endif /* !H5_HAVE_FPHDF5 */ if (eof < stored_eoa) HGOTO_ERROR(H5E_FILE, H5E_TRUNCATED, FAIL, "truncated file") - + /* * Tell the file driver how much address space has already been * allocated so that it knows how to allocate additional memory. @@ -545,7 +545,7 @@ H5F_write_superblock(H5F_t *f, hid_t dxpl_id, uint8_t *buf) *p++ = 0; /* reserved */ UINT16ENCODE(p, f->shared->sym_leaf_k); UINT16ENCODE(p, f->shared->btree_k[H5B_SNODE_ID]); - UINT32ENCODE(p, f->shared->consist_flags); + UINT32ENCODE(p, f->shared->consist_flags); /* * Versions of the superblock >0 have the indexed storage B-tree diff --git a/src/H5G.c b/src/H5G.c index c133e90..b34bb68 100644 --- a/src/H5G.c +++ b/src/H5G.c @@ -24,7 +24,7 @@ * * The functions that begin with `H5G_node_' operate on the leaf * nodes of a symbol table B-tree. They should be defined in - * the H5Gnode.c file. + * the H5Gnode.c file. * * The remaining functions know how to traverse the group * directed graph. @@ -132,7 +132,7 @@ typedef struct H5G_names_t { H5RS_str_t *dst_name; H5G_entry_t *dst_loc; H5G_names_op_t op; -} H5G_names_t; +} H5G_names_t; /* Enum for H5G_namei actions */ typedef enum { @@ -177,14 +177,14 @@ static herr_t H5G_namei(const H5G_entry_t *loc_ent, const char *name, H5G_entry_t *ent, hid_t dxpl_id); static herr_t H5G_traverse_slink(H5G_entry_t *grp_ent/*in,out*/, H5G_entry_t *obj_ent/*in,out*/, int *nlinks/*in,out*/, hid_t dxpl_id); -static H5G_t *H5G_create(H5G_entry_t *loc, const char *name, size_t size_hint, +static H5G_t *H5G_create(H5G_entry_t *loc, const char *name, size_t size_hint, hid_t dxpl_id, hid_t gcpl_id, hid_t gapl_id); static htri_t H5G_isa(H5G_entry_t *ent, hid_t dxpl_id); static htri_t H5G_link_isa(H5G_entry_t *ent, hid_t dxpl_id); static H5G_t * H5G_open_oid(H5G_entry_t *ent, hid_t dxpl_id); static H5G_t *H5G_rootof(H5F_t *f); -static herr_t H5G_link(H5G_entry_t *cur_loc, const char *cur_name, - H5G_entry_t *new_loc, const char *new_name, +static herr_t H5G_link(H5G_entry_t *cur_loc, const char *cur_name, + H5G_entry_t *new_loc, const char *new_name, H5G_link_t type, unsigned namei_flags, hid_t dxpl_id); static herr_t H5G_get_num_objs(H5G_entry_t *grp, hsize_t *num_objs, hid_t dxpl_id); static ssize_t H5G_get_objname_by_idx(H5G_entry_t *loc, hsize_t idx, char* name, size_t size, hid_t dxpl_id); @@ -247,7 +247,7 @@ H5Gcreate(hid_t loc_id, const char *name, size_t size_hint) HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a location"); if (!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name given"); - + /* Create the group */ if (NULL == (grp = H5G_create(loc, name, size_hint, H5AC_dxpl_id, H5P_GROUP_CREATE_DEFAULT, H5P_DEFAULT))) @@ -270,7 +270,7 @@ done: * * Purpose: Creates a new group relative to LOC_ID and gives it the * specified NAME, and creation property list GCPL_ID and access - * property list GAPL_ID. + * property list GAPL_ID. * * The optional SIZE_HINT specifies how much file space to * reserve to store the names that will appear in this @@ -278,7 +278,7 @@ done: * then a default size is chosen. * * Given the default setting, H5Gcreate_expand() will have the - * same function of H5Gcreate() + * same function of H5Gcreate() * * See also: H5Gcreate(), H5Dcreate_expand() * @@ -290,8 +290,8 @@ done: * * Failure: FAIL * - * Programmer: Peter Cao - * May 08, 2005 + * Programmer: Peter Cao + * May 08, 2005 *------------------------------------------------------------------------- */ hid_t @@ -308,7 +308,7 @@ H5Gcreate_expand(hid_t loc_id, const char *name, size_t size_hint, hid_t gcpl_id HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") if (!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name given") - + /* Check group creation property list */ if(H5P_DEFAULT == gcpl_id) gcpl_id = H5P_GROUP_CREATE_DEFAULT; @@ -473,7 +473,7 @@ H5Giterate(hid_t loc_id, const char *name, int *idx_p, H5G_bt_ud2_t udata; H5G_t *grp = NULL; herr_t ret_value; - + FUNC_ENTER_API(H5Giterate, FAIL); H5TRACE5("e","is*Isxx",loc_id,name,idx_p,op,op_data); @@ -535,15 +535,15 @@ done: /*------------------------------------------------------------------------- * Function: H5Gget_num_objs * - * Purpose: Returns the number of objects in the group. It iterates + * Purpose: Returns the number of objects in the group. It iterates * all B-tree leaves and sum up total number of group members. * - * Return: Success: Non-negative + * Return: Success: Non-negative * - * Failure: Negative + * Failure: Negative * * Programmer: Raymond Lu - * Nov 20, 2002 + * Nov 20, 2002 * * Modifications: * @@ -554,7 +554,7 @@ H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs) { H5G_entry_t *loc = NULL; /* Pointer to symbol table entry */ herr_t ret_value; - + FUNC_ENTER_API(H5Gget_num_objs, FAIL); H5TRACE2("e","i*h",loc_id,num_objs); @@ -587,12 +587,12 @@ done: * If a zero is returned for the name's length, then there is no name * associated with the ID. * - * Return: Success: Non-negative + * Return: Success: Non-negative * - * Failure: Negative + * Failure: Negative * * Programmer: Raymond Lu - * Nov 20, 2002 + * Nov 20, 2002 * * Modifications: * @@ -625,14 +625,14 @@ done: * Function: H5Gget_objtype_by_idx * * Purpose: Returns the type of objects in the group by giving index. - * * - * Return: Success: H5G_GROUP(1), H5G_DATASET(2), H5G_TYPE(3) * - * Failure: H5G_UNKNOWN + * Return: Success: H5G_GROUP(1), H5G_DATASET(2), H5G_TYPE(3) + * + * Failure: H5G_UNKNOWN * * Programmer: Raymond Lu - * Nov 20, 2002 + * Nov 20, 2002 * * Modifications: * @@ -643,7 +643,7 @@ H5Gget_objtype_by_idx(hid_t loc_id, hsize_t idx) { H5G_entry_t *loc = NULL; /* Pointer to symbol table entry */ H5G_obj_t ret_value; - + FUNC_ENTER_API(H5Gget_objtype_by_idx, H5G_UNKNOWN); H5TRACE2("Go","ih",loc_id,idx); @@ -668,7 +668,7 @@ done: * Purpose: Renames an object within an HDF5 file. The original name SRC * is unlinked from the group graph and the new name DST is * inserted as an atomic operation. Both names are interpreted - * relative to SRC_LOC_ID and DST_LOC_ID, which are either a file + * relative to SRC_LOC_ID and DST_LOC_ID, which are either a file * ID or a group ID. * * Return: Non-negative on success/Negative on failure @@ -684,7 +684,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Gmove2(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, +H5Gmove2(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *dst_name) { H5G_entry_t *src_loc=NULL; @@ -713,7 +713,7 @@ H5Gmove2(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, } else if(src_loc->file != dst_loc->file) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "source and destination should be in the same file."); - + if (H5G_move(src_loc, src_name, dst_loc, dst_name, H5AC_dxpl_id)<0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to change object name"); @@ -729,8 +729,8 @@ done: * CUR_NAME. * * If TYPE is H5G_LINK_HARD then CUR_NAME must name an existing - * object. CUR_NAME and NEW_NAME are interpreted relative to - * CUR_LOC_ID and NEW_LOC_ID, which is either a file ID or a + * object. CUR_NAME and NEW_NAME are interpreted relative to + * CUR_LOC_ID and NEW_LOC_ID, which is either a file ID or a * group ID. * * If TYPE is H5G_LINK_SOFT then CUR_NAME can be anything and is @@ -750,7 +750,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Glink2(hid_t cur_loc_id, const char *cur_name, H5G_link_t type, +H5Glink2(hid_t cur_loc_id, const char *cur_name, H5G_link_t type, hid_t new_loc_id, const char *new_name) { H5G_entry_t *cur_loc = NULL; @@ -816,7 +816,7 @@ H5Gunlink(hid_t loc_id, const char *name) { H5G_entry_t *loc = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Gunlink, FAIL); H5TRACE2("e","is",loc_id,name); @@ -858,7 +858,7 @@ H5Gget_objinfo(hid_t loc_id, const char *name, hbool_t follow_link, { H5G_entry_t *loc = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Gget_objinfo, FAIL); H5TRACE4("e","isbx",loc_id,name,follow_link,statbuf); @@ -900,7 +900,7 @@ H5Gget_linkval(hid_t loc_id, const char *name, size_t size, char *buf/*out*/) { H5G_entry_t *loc = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Gget_linkval, FAIL); H5TRACE4("e","iszx",loc_id,name,size,buf); @@ -941,7 +941,7 @@ H5Gset_comment(hid_t loc_id, const char *name, const char *comment) { H5G_entry_t *loc = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Gset_comment, FAIL); H5TRACE3("e","iss",loc_id,name,comment); @@ -986,7 +986,7 @@ H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize, char *buf) { H5G_entry_t *loc = NULL; int ret_value; - + FUNC_ENTER_API(H5Gget_comment, FAIL); H5TRACE4("Is","iszs",loc_id,name,bufsize,buf); @@ -1009,7 +1009,7 @@ done: *------------------------------------------------------------------------- * N O A P I F U N C T I O N S B E Y O N D T H I S P O I N T *------------------------------------------------------------------------- - *------------------------------------------------------------------------- + *------------------------------------------------------------------------- */ /*------------------------------------------------------------------------- @@ -1096,7 +1096,7 @@ H5G_term_interface(void) int n=0; FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_term_interface); - + if (H5_interface_initialize_g) { if ((n=H5I_nmembers(H5I_GROUP))) { H5I_clear_type(H5I_GROUP, FALSE); @@ -1106,7 +1106,7 @@ H5G_term_interface(void) H5MM_xfree(H5G_type_g[i].desc); H5G_ntypes_g = H5G_atypes_g = 0; H5G_type_g = H5MM_xfree(H5G_type_g); - + /* Destroy the group object id group */ H5I_dec_type_ref(H5I_GROUP); @@ -1119,7 +1119,7 @@ H5G_term_interface(void) n = 1; /*H5I*/ } } - + FUNC_LEAVE_NOAPI(n); } @@ -1150,7 +1150,7 @@ H5G_register_type(H5G_obj_t type, htri_t(*isa)(H5G_entry_t*, hid_t), const char char *desc = NULL; size_t i; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_register_type); assert(type>=0); @@ -1184,7 +1184,7 @@ H5G_register_type(H5G_obj_t type, htri_t(*isa)(H5G_entry_t*, hid_t), const char H5G_atypes_g = n; H5G_type_g = x; } - + /* Add a new entry */ H5G_type_g[H5G_ntypes_g].type = type; H5G_type_g[H5G_ntypes_g].isa = isa; @@ -1263,7 +1263,7 @@ static const char * H5G_basename(const char *name, size_t *size_p) { size_t i; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_basename); /* Find the end of the base name */ @@ -1306,7 +1306,7 @@ H5G_normalize(const char *name) size_t s,d; /* Positions within the strings */ unsigned last_slash; /* Flag to indicate last character was a slash */ char *ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_normalize); /* Sanity check */ @@ -1402,7 +1402,7 @@ done: * component of the name is a mount point then H5F_mountpoint() * is not called and information about the mount point itself is * returned. - * + * * Errors: * * Return: Success: Non-negative if name can be fully resolved. @@ -1458,7 +1458,7 @@ H5G_namei(const H5G_entry_t *loc_ent, const char *name, const char **rest/*out*/ unsigned last_comp = 0; /* Flag to indicate that a component is the last component in the name */ unsigned did_insert = 0; /* Flag to indicate that H5G_stab_insert was called */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_namei); /* Set up "out" parameters */ @@ -1478,7 +1478,7 @@ H5G_namei(const H5G_entry_t *loc_ent, const char *name, const char **rest/*out*/ null_obj = 0; if (!nlinks) nlinks = &_nlinks; - + /* Check args */ if (!name || !*name) HGOTO_ERROR (H5E_SYM, H5E_NOTFOUND, FAIL, "no name given"); @@ -1492,7 +1492,7 @@ H5G_namei(const H5G_entry_t *loc_ent, const char *name, const char **rest/*out*/ /* Check if we need to get the root group's entry */ if ('/' == *name) { H5G_t *tmp_grp; /* Temporary pointer to root group of file */ - + tmp_grp=H5G_rootof(loc_ent->file); assert(tmp_grp); @@ -1503,7 +1503,7 @@ H5G_namei(const H5G_entry_t *loc_ent, const char *name, const char **rest/*out*/ /* Deep copy of the symbol table entry */ if (H5G_ent_copy(obj_ent, loc_ent,H5G_COPY_DEEP)<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to copy entry"); - + HDmemset(grp_ent, 0, sizeof(H5G_entry_t)); grp_ent->header = HADDR_UNDEF; @@ -1631,11 +1631,11 @@ H5G_namei(const H5G_entry_t *loc_ent, const char *name, const char **rest/*out*/ */ if (0==(target & H5G_TARGET_MOUNT) || !last_comp) H5F_mountpoint(obj_ent/*in,out*/); - + /* next component */ name += nchars; } /* end while */ - + /* Update the "rest of name" pointer */ if (rest) *rest = name; /*final null */ @@ -1697,7 +1697,7 @@ H5G_traverse_slink (H5G_entry_t *grp_ent/*in,out*/, H5RS_str_t *tmp_user_path_r=NULL, *tmp_canon_path_r=NULL; /* Temporary pointer to object's user path & canonical path */ const H5HL_t *heap; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_traverse_slink); /* Portably initialize the temporary group entry */ @@ -1717,7 +1717,7 @@ H5G_traverse_slink (H5G_entry_t *grp_ent/*in,out*/, if (H5HL_unprotect(grp_ent->file, dxpl_id, heap, stab_mesg.heap_addr, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR (H5E_SYM, H5E_NOTFOUND, FAIL, "unable to read unprotect link value") - + /* Hold the entry's name (& old_name) to restore later */ tmp_user_path_r=obj_ent->user_path_r; obj_ent->user_path_r=NULL; @@ -1910,7 +1910,7 @@ H5G_create(H5G_entry_t *loc, const char *name, size_t size_hint, if (H5G_stab_create(file, dxpl_id, size_hint, &(grp->ent)/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "can't create grp"); stab_init=1; /* Indicate that the symbol table information is valid */ - + /* Get the property list */ if (NULL == (gc_plist = H5I_object(gcpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a property list") @@ -1971,7 +1971,7 @@ static htri_t H5G_isa(H5G_entry_t *ent, hid_t dxpl_id) { htri_t ret_value; - + FUNC_ENTER_NOAPI_NOINIT(H5G_isa); assert(ent); @@ -2006,7 +2006,7 @@ static htri_t H5G_link_isa(H5G_entry_t *ent, hid_t UNUSED dxpl_id) { htri_t ret_value; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_link_isa); assert(ent); @@ -2211,7 +2211,7 @@ H5G_close(H5G_t *grp) if(H5G_free_ent_name(&(grp->ent))<0) { H5FL_FREE (H5G_t,grp); - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't free group entry name"); + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't free group entry name"); } } @@ -2501,7 +2501,7 @@ H5G_loc (hid_t loc_id) case H5I_GENPROP_CLS: case H5I_GENPROP_LST: HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "unable to get symbol table entry of property list"); - + case H5I_ERROR_CLASS: case H5I_ERROR_MSG: case H5I_ERROR_STACK: @@ -2537,7 +2537,7 @@ H5G_loc (hid_t loc_id) if (NULL==(ret_value=H5A_entof(attr))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "unable to get symbol table entry of attribute"); break; - + case H5I_REFERENCE: HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "unable to get symbol table entry of reference"); @@ -2582,7 +2582,7 @@ H5G_link (H5G_entry_t *cur_loc, const char *cur_name, H5G_entry_t *new_loc, size_t nchars; /*characters in component */ size_t offset; /*offset to sym-link value */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_link); /* Check args */ @@ -2603,7 +2603,7 @@ H5G_link (H5G_entry_t *cur_loc, const char *cur_name, H5G_entry_t *new_loc, * Lookup the the new_name so we can get the group which will contain * the new entry. The entry shouldn't exist yet. */ - if (H5G_namei(new_loc, norm_new_name, &rest, &grp_ent, NULL, + if (H5G_namei(new_loc, norm_new_name, &rest, &grp_ent, NULL, H5G_TARGET_NORMAL, NULL, H5G_NAMEI_TRAVERSE, NULL, dxpl_id)>=0) HGOTO_ERROR (H5E_SYM, H5E_EXISTS, FAIL, "already exists"); H5E_clear_stack (NULL); /*it's okay that we didn't find it*/ @@ -2664,7 +2664,7 @@ done: /* Free the group's ID to name buffer, if creating a soft link */ if(type == H5G_LINK_SOFT) H5G_free_ent_name(&grp_ent); - + /* Free the ID to name buffer */ if(cur_obj_init) H5G_free_ent_name(&cur_obj); @@ -2701,7 +2701,7 @@ H5G_get_type(H5G_entry_t *ent, hid_t dxpl_id) htri_t isa; size_t i; H5G_obj_t ret_value=H5G_UNKNOWN; /* Return value */ - + FUNC_ENTER_NOAPI(H5G_get_type, H5G_UNKNOWN); for (i=H5G_ntypes_g; i>0; --i) { @@ -2752,7 +2752,7 @@ H5G_get_objinfo (H5G_entry_t *loc, const char *name, hbool_t follow_link, { H5G_entry_t grp_ent, obj_ent; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5G_get_objinfo, FAIL); assert (loc); @@ -2828,27 +2828,27 @@ done: /*------------------------------------------------------------------------- * Function: H5G_get_num_objs * - * Purpose: Private function for H5Gget_num_objs. Returns the number - * of objects in the group. It iterates all B-tree leaves + * Purpose: Private function for H5Gget_num_objs. Returns the number + * of objects in the group. It iterates all B-tree leaves * and sum up total number of group members. * - * Return: Success: Non-negative + * Return: Success: Non-negative * - * Failure: Negative + * Failure: Negative * * Programmer: Raymond Lu - * Nov 20, 2002 + * Nov 20, 2002 * * Modifications: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5G_get_num_objs(H5G_entry_t *loc, hsize_t *num_objs, hid_t dxpl_id) { H5O_stab_t stab_mesg; /*info about B-tree */ herr_t ret_value; - + FUNC_ENTER_NOAPI_NOINIT(H5G_get_num_objs); /* Sanity check */ @@ -2866,9 +2866,9 @@ H5G_get_num_objs(H5G_entry_t *loc, hsize_t *num_objs, hid_t dxpl_id) if ((ret_value = H5B_iterate (loc->file, dxpl_id, H5B_SNODE, H5G_node_sumup, stab_mesg.btree_addr, num_objs))<0) HERROR (H5E_SYM, H5E_CANTINIT, "iteration operator failed"); - + done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value); } @@ -2878,24 +2878,24 @@ done: * Purpose: Private function for H5Gget_objname_by_idx. * Returns the name of objects in the group by giving index. * - * Return: Success: Non-negative + * Return: Success: Non-negative * - * Failure: Negative + * Failure: Negative * * Programmer: Raymond Lu - * Nov 20, 2002 + * Nov 20, 2002 * * Modifications: * *------------------------------------------------------------------------- */ -static ssize_t +static ssize_t H5G_get_objname_by_idx(H5G_entry_t *loc, hsize_t idx, char* name, size_t size, hid_t dxpl_id) { H5O_stab_t stab_mesg; /*info about local heap & B-tree */ H5G_bt_ud3_t udata; /* Iteration information */ ssize_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_get_objname_by_idx); /* Sanity check */ @@ -2915,7 +2915,7 @@ H5G_get_objname_by_idx(H5G_entry_t *loc, hsize_t idx, char* name, size_t size, h if ((ret_value = H5B_iterate (loc->file, dxpl_id, H5B_SNODE, H5G_node_name, stab_mesg.btree_addr, &udata))<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "iteration operator failed"); - + /* If we don't know the name now, we almost certainly went out of bounds */ if(udata.name==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "index out of bound"); @@ -2944,26 +2944,26 @@ done: * Purpose: Private function for H5Gget_objtype_by_idx. * Returns the type of objects in the group by giving index. * - * Return: Success: H5G_GROUP(1), H5G_DATASET(2), H5G_TYPE(3) + * Return: Success: H5G_GROUP(1), H5G_DATASET(2), H5G_TYPE(3) * - * Failure: UNKNOWN + * Failure: UNKNOWN * * Programmer: Raymond Lu - * Nov 20, 2002 + * Nov 20, 2002 * * Modifications: * *------------------------------------------------------------------------- */ -static H5G_obj_t +static H5G_obj_t H5G_get_objtype_by_idx(H5G_entry_t *loc, hsize_t idx, hid_t dxpl_id) { H5O_stab_t stab_mesg; /*info about local heap & B-tree */ H5G_bt_ud3_t udata; /* User data for B-tree callback */ H5G_obj_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_get_objtype_by_idx); - + /* Sanity check */ assert(loc); @@ -2976,12 +2976,12 @@ H5G_get_objtype_by_idx(H5G_entry_t *loc, hsize_t idx, hid_t dxpl_id) udata.num_objs = 0; udata.mesg = &stab_mesg; udata.type = H5G_UNKNOWN; - + /* Iterate over the group members */ if (H5B_iterate (loc->file, dxpl_id, H5B_SNODE, H5G_node_type, stab_mesg.btree_addr, &udata)<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5G_UNKNOWN, "iteration operator failed"); - + /* If we don't know the type now, we almost certainly went out of bounds */ if(udata.type==H5G_UNKNOWN) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5G_UNKNOWN, "index out of bound"); @@ -3029,7 +3029,7 @@ H5G_linkval (H5G_entry_t *loc, const char *name, size_t size, char *buf/*out*/, H5O_stab_t stab_mesg; const H5HL_t *heap; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_linkval); /* @@ -3051,7 +3051,7 @@ H5G_linkval (H5G_entry_t *loc, const char *name, size_t size, char *buf/*out*/, if (NULL == (heap = H5HL_protect(grp_ent.file, dxpl_id, stab_mesg.heap_addr))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to read protect link value") - + s = H5HL_offset_into(grp_ent.file, heap, obj_ent.cache.slink.lval_offset); /* Copy to output buffer */ @@ -3093,7 +3093,7 @@ H5G_set_comment(H5G_entry_t *loc, const char *name, const char *buf, hid_t dxpl_ H5G_entry_t obj_ent; H5O_name_t comment; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_set_comment); /* Get the symbol table entry for the object */ @@ -3148,7 +3148,7 @@ H5G_get_comment(H5G_entry_t *loc, const char *name, size_t bufsize, char *buf, h H5O_name_t comment; H5G_entry_t obj_ent; int ret_value; - + FUNC_ENTER_NOAPI_NOINIT(H5G_get_comment); /* Get the symbol table entry for the object */ @@ -3175,7 +3175,7 @@ done: FUNC_LEAVE_NOAPI(ret_value); } - + /*------------------------------------------------------------------------- * Function: H5G_unlink @@ -3204,7 +3204,7 @@ H5G_unlink(H5G_entry_t *loc, const char *name, hid_t dxpl_id) H5G_stat_t statbuf; /* Info about object to unlink */ H5RS_str_t *name_r; /* Ref-counted version of name */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_unlink); /* Sanity check */ @@ -3231,7 +3231,7 @@ H5G_unlink(H5G_entry_t *loc, const char *name, hid_t dxpl_id) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "no containing group specified"); if (NULL==(base=H5G_basename(norm_name, &len)) || '/'==*base) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "problems obtaining object base name"); - + /* Remove the name from the symbol table */ if (H5G_stab_remove(&grp_ent, base, dxpl_id)<0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to unlink name from symbol table"); @@ -3277,7 +3277,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_move(H5G_entry_t *src_loc, const char *src_name, H5G_entry_t *dst_loc, +H5G_move(H5G_entry_t *src_loc, const char *src_name, H5G_entry_t *dst_loc, const char *dst_name, hid_t dxpl_id) { H5G_stat_t sb; @@ -3287,7 +3287,7 @@ H5G_move(H5G_entry_t *src_loc, const char *src_name, H5G_entry_t *dst_loc, H5RS_str_t *src_name_r; /* Ref-counted version of src name */ H5RS_str_t *dst_name_r; /* Ref-counted version of dest name */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_move); /* Sanity check */ @@ -3314,7 +3314,7 @@ H5G_move(H5G_entry_t *src_loc, const char *src_name, H5G_entry_t *dst_loc, H5G_TARGET_NORMAL, dxpl_id)<0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to rename symbolic link"); H5MM_xfree(linkval); - + } else { /* * Rename the object. @@ -3325,7 +3325,7 @@ H5G_move(H5G_entry_t *src_loc, const char *src_name, H5G_entry_t *dst_loc, } /* Search the open ID list and replace names for the move operation - * This has to be done here because H5G_link and H5G_unlink have + * This has to be done here because H5G_link and H5G_unlink have * internal object entries, and do not modify the entries list */ if (H5G_namei(src_loc, src_name, NULL, NULL, &obj_ent, H5G_TARGET_NORMAL|H5G_TARGET_SLINK, NULL, H5G_NAMEI_TRAVERSE, NULL, dxpl_id)) @@ -3446,9 +3446,9 @@ H5G_free_grp_name(H5G_t *grp) { H5G_entry_t *ent; /* Group object's entry */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5G_free_grp_name, FAIL); - + /* Check args */ assert(grp && grp->shared); assert(grp->shared->fo_count > 0); @@ -3476,7 +3476,7 @@ done: * * Date: August 22, 2002 * - * Comments: + * Comments: * * Modifications: * @@ -3486,9 +3486,9 @@ herr_t H5G_free_ent_name(H5G_entry_t *ent) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5G_free_ent_name, FAIL); - + /* Check args */ assert(ent); @@ -3500,7 +3500,7 @@ H5G_free_ent_name(H5G_entry_t *ent) H5RS_decr(ent->canon_path_r); ent->canon_path_r=NULL; } /* end if */ - + done: FUNC_LEAVE_NOAPI(ret_value); } @@ -3522,7 +3522,7 @@ done: * * Date: June 11, 2002 * - * Comments: + * Comments: * * Modifications: * @@ -3537,7 +3537,7 @@ H5G_replace_name(H5G_obj_t type, H5G_entry_t *loc, unsigned search_group=0; /* Flag to indicate that groups are to be searched */ unsigned search_dataset=0; /* Flag to indicate that datasets are to be searched */ unsigned search_datatype=0; /* Flag to indicate that datatypes are to be searched */ - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(H5G_replace_name, FAIL); @@ -3600,7 +3600,7 @@ H5G_replace_name(H5G_obj_t type, H5G_entry_t *loc, if(search_datatype) H5I_search(H5I_DATATYPE, H5G_replace_ent, &names); -done: +done: FUNC_LEAVE_NOAPI(ret_value); } @@ -3617,7 +3617,7 @@ done: * * Date: September 24, 2002 * - * Comments: + * Comments: * * Modifications: * @@ -3630,9 +3630,9 @@ H5G_common_path(const H5RS_str_t *fullpath_r, const H5RS_str_t *prefix_r) const char *prefix; /* Pointer to actual prefix string */ size_t nchars1,nchars2; /* Number of characters in components */ htri_t ret_value=FALSE; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_common_path); - + /* Get component of each name */ fullpath=H5RS_get_str(fullpath_r); assert(fullpath); @@ -3686,7 +3686,7 @@ done: * * Date: June 5, 2002 * - * Comments: + * Comments: * * Modifications: * @@ -3700,11 +3700,11 @@ H5G_replace_ent(void *obj_ptr, hid_t obj_id, void *key) H5F_t *top_ent_file; /* Top file in entry's mounted file chain */ H5F_t *top_loc_file; /* Top file in location's mounted file chain */ herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_replace_ent); - + assert(obj_ptr); - + /* Get the symbol table entry */ switch(H5I_get_type(obj_id)) { case H5I_GROUP: @@ -3719,7 +3719,7 @@ H5G_replace_ent(void *obj_ptr, hid_t obj_id, void *key) /* Avoid non-named datatypes */ if(!H5T_is_named((H5T_t*)obj_ptr)) HGOTO_DONE(SUCCEED); /* Do not exit search over IDs */ - + ent = H5T_entof((H5T_t*)obj_ptr); break; @@ -3727,7 +3727,7 @@ H5G_replace_ent(void *obj_ptr, hid_t obj_id, void *key) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "unknown data object"); } /* end switch */ assert(ent); - + switch(names->op) { /*------------------------------------------------------------------------- * OP_MOUNT @@ -4006,11 +4006,11 @@ H5G_replace_ent(void *obj_ptr, hid_t obj_id, void *key) /* Allocate space for the new user path */ if(NULL==(new_user_path = H5FL_BLK_MALLOC(str_buf,user_dst_len+1))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); - + /* Allocate space for the new canonical path */ if(NULL==(new_canon_path = H5FL_BLK_MALLOC(str_buf,canon_dst_len+1))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); - + /* Create the new names */ HDstrcpy(new_user_path,user_prefix); HDstrcat(new_user_path,dst_canon_prefix); @@ -4054,9 +4054,9 @@ H5G_replace_ent(void *obj_ptr, hid_t obj_id, void *key) default: HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid call"); } /* end switch */ - + done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value); } diff --git a/src/H5Gent.c b/src/H5Gent.c index d6219ab..fa58ca7 100644 --- a/src/H5Gent.c +++ b/src/H5Gent.c @@ -117,7 +117,7 @@ done: * symbol table entries. * * Errors: - * SYM CANTDECODE Can't decode. + * SYM CANTDECODE Can't decode. * * Return: Success: Non-negative, with *pp pointing to the first byte * after the last symbol. @@ -233,7 +233,7 @@ H5G_ent_decode(H5F_t *f, const uint8_t **pp, H5G_entry_t *ent) * symbol table entries. * * Errors: - * SYM CANTENCODE Can't encode. + * SYM CANTENCODE Can't encode. * * Return: Success: Non-negative, with *pp pointing to the first byte * after the last symbol. @@ -344,7 +344,7 @@ H5G_ent_encode(H5F_t *f, uint8_t **pp, const H5G_entry_t *ent) /* fill with zero */ while (*pp < p_ret) *(*pp)++ = 0; *pp = p_ret; - + FUNC_LEAVE_NOAPI(SUCCEED); } @@ -360,7 +360,7 @@ H5G_ent_encode(H5F_t *f, uint8_t **pp, const H5G_entry_t *ent) * * Date: August 2002 * - * Comments: + * Comments: * * Modifications: * Quincey Koziol, Sept. 25, 2002: @@ -448,7 +448,7 @@ H5G_ent_debug(H5F_t UNUSED *f, hid_t dxpl_id, const H5G_entry_t *ent, FILE * str { const char *lval = NULL; int nested_indent, nested_fwidth; - + FUNC_ENTER_NOAPI_NOFUNC(H5G_ent_debug); /* Calculate the indent & field width values for nested information */ @@ -504,7 +504,7 @@ H5G_ent_debug(H5F_t UNUSED *f, hid_t dxpl_id, const H5G_entry_t *ent, FILE * str else HDfprintf(stream, "%*s%-*s\n", nested_indent, "", nested_fwidth, "Warning: Invalid heap address given, name not displayed!"); break; - + default: HDfprintf(stream, "*** Unknown symbol type %d\n", ent->type); break; diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 4c08b9c..214e3fe 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -300,7 +300,7 @@ H5G_node_debug_key (FILE *stream, H5F_t *f, hid_t dxpl_id, int indent, int fwidt const H5HL_t *heap = NULL; const char *s; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_node_debug_key); assert (key); @@ -462,7 +462,7 @@ done: * * Pedro Vicente, 18 Sep 2002 * Added `id to name' support. - * + * *------------------------------------------------------------------------- */ static herr_t @@ -679,7 +679,7 @@ done: * 5/13/04 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1006,7 +1006,7 @@ H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED *_lt_key HGOTO_ERROR(H5E_SYM, H5E_UNSUPPORTED, FAIL, "internal erorr (unknown symbol find operation)"); done: - if (sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, + if (sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to release symbol table node"); @@ -1343,7 +1343,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, if (H5O_link(sn->entry+idx, -1, dxpl_id)<0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5B_INS_ERROR, "unable to decrement object link count"); } - + /* Remove the name from the local heap */ if (NULL == (heap = H5HL_protect(f, dxpl_id, bt_udata->heap_addr))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5B_INS_ERROR, "unable to protect symbol name"); @@ -1385,7 +1385,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, } sn = NULL; ret_value = H5B_INS_REMOVE; - + } else if (0==idx) { /* * We are about to remove the left-most entry from the symbol table @@ -1397,7 +1397,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, HDmemmove(sn->entry+idx, sn->entry+idx+1, (sn->nsyms-idx)*sizeof(H5G_entry_t)); ret_value = H5B_INS_NOOP; - + } else if (idx+1==sn->nsyms) { /* * We are about to remove the right-most entry from the symbol table @@ -1409,7 +1409,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, rt_key->offset = sn->entry[sn->nsyms-1].name_off; *rt_key_changed = TRUE; ret_value = H5B_INS_NOOP; - + } else { /* * We are about to remove an entry from the middle of a symbol table @@ -1451,7 +1451,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, sn = NULL; ret_value = H5B_INS_REMOVE; } /* end else */ - + done: if (sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, sn_flags)<0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5B_INS_ERROR, "unable to release symbol table node"); @@ -1582,7 +1582,7 @@ done: * Function: H5G_node_sumup * * Purpose: This function gets called during a group iterate operation - * to return total number of members in the group. + * to return total number of members in the group. * * Return: Non-negative on success/Negative on failure * @@ -1635,10 +1635,10 @@ done: * Purpose: This function gets called during a group iterate operation * to return object name by giving idx. * - * Return: 0 if object isn't found in this node; 1 if object is found; + * Return: 0 if object isn't found in this node; 1 if object is found; * Negative on failure * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Nov 20, 2002 * * Modifications: @@ -1658,7 +1658,7 @@ H5G_node_name(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, const H5HL_t *heap = NULL; size_t name_off; hsize_t loc_idx; - const char *name; + const char *name; H5G_node_t *sn = NULL; int ret_value = H5B_ITER_CONT; @@ -1673,11 +1673,11 @@ H5G_node_name(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, if (NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, NULL, NULL, H5AC_READ))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_ITER_ERROR, "unable to load symbol table node"); - - /* Find the node, locate the object symbol table entry and retrieve the name */ + + /* Find the node, locate the object symbol table entry and retrieve the name */ if(bt_udata->idx >= bt_udata->num_objs && bt_udata->idx < (bt_udata->num_objs+sn->nsyms)) { - loc_idx = bt_udata->idx - bt_udata->num_objs; - name_off = sn->entry[loc_idx].name_off; + loc_idx = bt_udata->idx - bt_udata->num_objs; + name_off = sn->entry[loc_idx].name_off; if (NULL == (heap = H5HL_protect(f, dxpl_id, bt_udata->mesg->heap_addr))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5B_ITER_ERROR, "unable to protect symbol name"); @@ -1713,7 +1713,7 @@ done: * Return: 0 if object isn't found in this node; 1 if found; * Negative on failure * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Nov 20, 2002 * * Modifications: @@ -1741,13 +1741,13 @@ H5G_node_type(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, assert(H5F_addr_defined(addr)); assert(bt_udata); - /* Find the node, locate the object symbol table entry and retrieve the type */ + /* Find the node, locate the object symbol table entry and retrieve the type */ if (NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, NULL, NULL, H5AC_READ))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_ITER_ERROR, "unable to load symbol table node"); if(bt_udata->idx >= bt_udata->num_objs && bt_udata->idx < (bt_udata->num_objs+sn->nsyms)) { - loc_idx = bt_udata->idx - bt_udata->num_objs; - bt_udata->type = H5G_get_type(&(sn->entry[loc_idx]), dxpl_id); + loc_idx = bt_udata->idx - bt_udata->num_objs; + bt_udata->type = H5G_get_type(&(sn->entry[loc_idx]), dxpl_id); ret_value = H5B_ITER_STOP; } else { bt_udata->num_objs += sn->nsyms; @@ -1756,7 +1756,7 @@ H5G_node_type(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, done: if (sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) != SUCCEED) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5B_ITER_ERROR, "unable to release object header"); - + FUNC_LEAVE_NOAPI(ret_value); } diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h index 9b299ed..78d1bbd 100644 --- a/src/H5Gpkg.h +++ b/src/H5Gpkg.h @@ -105,7 +105,7 @@ typedef struct H5G_bt_ud2_t { /* upward */ int final_ent; /*final entry looked at */ - + } H5G_bt_ud2_t; /* diff --git a/src/H5Gpublic.h b/src/H5Gpublic.h index 094a4a2..d38a8cb 100644 --- a/src/H5Gpublic.h +++ b/src/H5Gpublic.h @@ -63,7 +63,7 @@ typedef enum H5G_obj_t { H5G_RESERVED_5, /* Reserved for future use */ H5G_RESERVED_6, /* Reserved for future use */ H5G_RESERVED_7 /* Reserved for future use */ -} H5G_obj_t; +} H5G_obj_t; #define H5G_NTYPES 256 /* Max possible number of types */ #define H5G_NLIBTYPES 8 /* Number of internal types */ @@ -80,7 +80,7 @@ typedef struct H5G_stat_t { size_t linklen; /*symbolic link value length */ H5O_stat_t ohdr; /* Object header information */ } H5G_stat_t; - + #define H5G_SAME_LOC 0 #define H5Glink(cur_loc_id, type, cur_name, new_name) \ H5Glink2(cur_loc_id, cur_name, type, H5G_SAME_LOC, new_name) @@ -98,7 +98,7 @@ H5_DLL herr_t H5Giterate(hid_t loc_id, const char *name, int *idx, H5_DLL herr_t H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs); H5_DLL ssize_t H5Gget_objname_by_idx(hid_t loc_id, hsize_t idx, char* name, size_t size); H5_DLL H5G_obj_t H5Gget_objtype_by_idx(hid_t loc_id, hsize_t idx); -H5_DLL herr_t H5Gmove2(hid_t src_loc, const char *src, hid_t dst_loc, +H5_DLL herr_t H5Gmove2(hid_t src_loc, const char *src, hid_t dst_loc, const char *dst); H5_DLL herr_t H5Glink2(hid_t src_loc, const char *cur_name, H5G_link_t type, hid_t dst_loc, const char *new_name); @@ -111,7 +111,7 @@ H5_DLL herr_t H5Gset_comment(hid_t loc_id, const char *name, const char *comment); H5_DLL int H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize, char *buf); -H5_DLL hid_t H5Gcreate_expand(hid_t loc_id, const char *name, size_t size_hint, +H5_DLL hid_t H5Gcreate_expand(hid_t loc_id, const char *name, size_t size_hint, hid_t gcpl_id, hid_t gapl_id); #ifdef __cplusplus diff --git a/src/H5Gstab.c b/src/H5Gstab.c index 01c439e..94378a8 100644 --- a/src/H5Gstab.c +++ b/src/H5Gstab.c @@ -238,7 +238,7 @@ H5G_stab_insert(H5G_entry_t *grp_ent, const char *name, H5G_entry_t *obj_ent, hi /* insert */ if (H5B_insert(grp_ent->file, dxpl_id, H5B_SNODE, stab.btree_addr, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert entry"); - + /* update the name offset in the entry */ obj_ent->name_off = udata.ent.name_off; @@ -267,7 +267,7 @@ H5G_stab_remove(H5G_entry_t *grp_ent, const char *name, hid_t dxpl_id) H5O_stab_t stab; /*symbol table message */ H5G_bt_ud1_t udata; /*data to pass through B-tree */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5G_stab_remove, FAIL); assert(grp_ent && grp_ent->file); @@ -307,18 +307,18 @@ done: * *------------------------------------------------------------------------- */ -herr_t +herr_t H5G_stab_insert_name(H5G_entry_t *loc, H5G_entry_t *obj, const char *name) { size_t name_len; /* Length of name to append */ - herr_t ret_value = SUCCEED; - + herr_t ret_value = SUCCEED; + FUNC_ENTER_NOAPI_NOINIT(H5G_stab_insert_name); assert(loc); assert(obj); assert(name); - + /* Reset the object's previous names, if they exist */ if(obj->user_path_r) { H5RS_decr(obj->user_path_r); @@ -430,8 +430,8 @@ herr_t H5G_stab_delete(H5F_t *f, hid_t dxpl_id, haddr_t btree_addr, haddr_t heap_addr) { H5G_bt_ud1_t udata; /*data to pass through B-tree */ - herr_t ret_value = SUCCEED; - + herr_t ret_value = SUCCEED; + FUNC_ENTER_NOAPI(H5G_stab_delete, FAIL); assert(f); diff --git a/src/H5HG.c b/src/H5HG.c index 631f1a0..26133b5 100644 --- a/src/H5HG.c +++ b/src/H5HG.c @@ -176,21 +176,21 @@ H5FL_BLK_DEFINE_STATIC(heap_chunk); * Modified function to return the disk address of the new * global heap collection, or HADDR_UNDEF on failure. This * is necessary, as in some cases (i.e. flexible parallel) - * H5AC_set() will imediately flush and destroy the in memory - * version of the new collection. For the same reason, I + * H5AC_set() will imediately flush and destroy the in memory + * version of the new collection. For the same reason, I * moved the code which places the new collection on the cwfs * list to just before the call to H5AC_set(). * * John Mainzer 6/8/05 * Removed code setting the is_dirty field of the cache info. - * This is no longer pemitted, as the cache code is now + * This is no longer pemitted, as the cache code is now * manageing this field. Since this function uses a call to * H5AC_set() (which marks the entry dirty automaticly), no * other change is required. * *------------------------------------------------------------------------- */ -static haddr_t +static haddr_t H5HG_create (H5F_t *f, hid_t dxpl_id, size_t size) { H5HG_heap_t *heap = NULL; @@ -198,7 +198,7 @@ H5HG_create (H5F_t *f, hid_t dxpl_id, size_t size) uint8_t *p = NULL; haddr_t addr; size_t n; - + FUNC_ENTER_NOAPI(H5HG_create, HADDR_UNDEF); /* Check args */ @@ -275,7 +275,7 @@ HDmemset(heap->chunk,0,size); f->shared->cwfs[0] = heap; f->shared->ncwfs = 1; } else { - HDmemmove (f->shared->cwfs+1, f->shared->cwfs, + HDmemmove (f->shared->cwfs+1, f->shared->cwfs, MIN (f->shared->ncwfs, H5HG_NCWFS-1)*sizeof(H5HG_heap_t*)); f->shared->cwfs[0] = heap; f->shared->ncwfs = MIN (H5HG_NCWFS, f->shared->ncwfs+1); @@ -330,7 +330,7 @@ H5HG_load (H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED * udata1, size_t nalloc, need; size_t max_idx=0; /* The maximum index seen */ H5HG_heap_t *ret_value = NULL; /* Return value */ - + FUNC_ENTER_NOAPI(H5HG_load, NULL); /* check arguments */ @@ -476,9 +476,9 @@ H5HG_load (H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED * udata1, f->shared->cwfs[0] = heap; } } - + ret_value = heap; - + done: if (!ret_value && heap) { if(H5HG_dest(f,heap)<0) @@ -512,7 +512,7 @@ static herr_t H5HG_flush (H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HG_heap_t *heap) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5HG_flush, FAIL); /* Check arguments */ @@ -555,7 +555,7 @@ static herr_t H5HG_dest (H5F_t *f, H5HG_heap_t *heap) { int i; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HG_dest); /* Check arguments */ @@ -668,7 +668,7 @@ H5HG_compute_size(const H5F_t UNUSED *f, const H5HG_heap_t *heap, size_t *size_p * Modified the function to use the new dirtied parameter of * of H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. - * + * * In this case, that required adding the new heap_dirtied_ptr * parameter to the function's argument list. * @@ -737,7 +737,7 @@ H5HG_alloc (H5F_t *f, H5HG_heap_t *heap, size_t size, unsigned * heap_flags_ptr) */ heap->obj[0].size = 0; heap->obj[0].begin = NULL; - + } else if (heap->obj[0].size-need >= H5HG_SIZEOF_OBJHDR (f)) { /* * Some free space remains and it's larger than a heap object header, @@ -751,7 +751,7 @@ H5HG_alloc (H5F_t *f, H5HG_heap_t *heap, size_t size, unsigned * heap_flags_ptr) UINT32ENCODE(p, 0); /*reserved*/ H5F_ENCODE_LENGTH (f, p, heap->obj[0].size); assert(H5HG_ISALIGNED(heap->obj[0].size)); - + } else { /* * Some free space remains but it's smaller than a heap object header, @@ -794,7 +794,7 @@ done: * Modified the function to use the new dirtied parameter of * of H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. - * + * * In this case, that required adding the new heap_dirtied_ptr * parameter to the function's argument list. * @@ -906,14 +906,14 @@ done: * * John Mainzer - 5/26/04 * Modified H5HG_create() to return the disk address of the - * new collection, instead of the address of its + * new collection, instead of the address of its * representation in core. This was necessary as in FP * mode, the cache will immediately flush and destroy any * entry inserted in it via H5AC_set(). I then modified * this function to account for the change in H5HG_create(). * * John Mainzer - 6/8/05 - * Modified function to use the dirtied parameter of + * Modified function to use the dirtied parameter of * H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. * @@ -930,7 +930,7 @@ H5HG_insert (H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out* unsigned heap_flags = H5AC__NO_FLAGS_SET; hbool_t found=0; /* Flag to indicate a heap with enough space was found */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5HG_insert, FAIL); /* Check args */ @@ -944,24 +944,24 @@ H5HG_insert (H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out* /* Find a large enough collection on the CWFS list */ need = H5HG_SIZEOF_OBJHDR(f) + H5HG_ALIGN(size); - /* Note that we don't have metadata cache locks on the entries in - * f->shared->cwfs. + /* Note that we don't have metadata cache locks on the entries in + * f->shared->cwfs. * * In the current situation, this doesn't matter, as we are single - * threaded, and as best I can tell, entries are added to and deleted - * from f->shared->cwfs as they are added to and deleted from the + * threaded, and as best I can tell, entries are added to and deleted + * from f->shared->cwfs as they are added to and deleted from the * metadata cache. * * To be proper, we should either lock each entry in f->shared->cwfs - * as we examine it, or lock the whole array. However, at present + * as we examine it, or lock the whole array. However, at present * I don't see the point as there will be significant overhead, - * and protecting and unprotecting all the collections in the global + * and protecting and unprotecting all the collections in the global * heap on a regular basis will skew the replacement policy. * - * However, there is a bigger issue -- as best I can tell, we only look - * for free space in global heap chunks that are in cache. If we can't + * However, there is a bigger issue -- as best I can tell, we only look + * for free space in global heap chunks that are in cache. If we can't * find any, we allocate a new chunk. This may be a problem in FP mode, - * as the metadata cache is disabled. Do we allocate a new heap + * as the metadata cache is disabled. Do we allocate a new heap * collection for every entry in this case? * * Note that all this comes from a cursory read of the source. Don't @@ -1014,8 +1014,8 @@ H5HG_insert (H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out* } /* end if */ else { - /* Move the collection forward in the CWFS list, if it's not - * already at the front + /* Move the collection forward in the CWFS list, if it's not + * already at the front */ if (cwfsno>0) { H5HG_heap_t *tmp = f->shared->cwfs[cwfsno]; @@ -1026,13 +1026,13 @@ H5HG_insert (H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out* } /* end else */ HDassert(H5F_addr_defined(addr)); - + if ( NULL == (heap = H5AC_protect(f, dxpl_id, H5AC_GHEAP, addr, NULL, NULL, H5AC_WRITE)) ) HGOTO_ERROR (H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load heap"); /* Split the free space to make room for the new object */ idx = H5HG_alloc (f, heap, size, &heap_flags); - + /* Copy data into the heap */ if(size>0) { HDmemcpy(heap->obj[idx].begin+H5HG_SIZEOF_OBJHDR(f), obj, size); @@ -1088,7 +1088,7 @@ H5HG_read (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj, void *object/*out*/) size_t size; uint8_t *p = NULL; void *ret_value; - + FUNC_ENTER_NOAPI(H5HG_read, NULL); /* Check args */ @@ -1153,7 +1153,7 @@ done: * Modifications: * * John Mainzer - 6/8/05 - * Modified function to use the dirtied parameter of + * Modified function to use the dirtied parameter of * H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. * @@ -1165,9 +1165,9 @@ H5HG_link (H5F_t *f, hid_t dxpl_id, const H5HG_t *hobj, int adjust) H5HG_heap_t *heap = NULL; unsigned heap_flags = H5AC__NO_FLAGS_SET; int ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5HG_link, FAIL); - + /* Check args */ assert (f); assert (hobj); @@ -1213,7 +1213,7 @@ done: * Modifications: * * John Mainzer - 6/8/05 - * Modified function to use the dirtied parameter of + * Modified function to use the dirtied parameter of * H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. * @@ -1229,7 +1229,7 @@ H5HG_remove (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj) unsigned u; unsigned flags=H5AC__NO_FLAGS_SET;/* Whether the heap gets deleted */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5HG_remove, FAIL); /* Check args */ @@ -1247,7 +1247,7 @@ H5HG_remove (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj) obj_start = heap->obj[hobj->idx].begin; /* Include object header size */ need = H5HG_ALIGN(heap->obj[hobj->idx].size)+H5HG_SIZEOF_OBJHDR(f); - + /* Move the new free space to the end of the heap */ for (u=0; unused; u++) { if (heap->obj[u].begin > heap->obj[hobj->idx].begin) @@ -1300,7 +1300,7 @@ H5HG_remove (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj) f->shared->cwfs[f->shared->ncwfs-1] = heap; } } - + done: if (heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, hobj->addr, heap, flags) != SUCCEED) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release object header"); diff --git a/src/H5HL.c b/src/H5HL.c index 72a1005..ee31ecc 100644 --- a/src/H5HL.c +++ b/src/H5HL.c @@ -870,11 +870,11 @@ H5HL_offset_into(H5F_t *f, const H5HL_t *heap, size_t offset) * Modifications: * * John Mainzer - 6/8/05/ - * Modified function to use the new dirtied parmeter of + * Modified function to use the new dirtied parmeter of * H5AC_unprotect(), which allows management of the is_dirty * field of the cache info to be moved into the cache code. * - * This required the addition of the heap_dirtied parameter + * This required the addition of the heap_dirtied parameter * to the function's parameter list. * *------------------------------------------------------------------------- @@ -947,7 +947,7 @@ H5HL_remove_free(H5HL_t *heap, H5HL_free_t *fl) * The ADDR argument is passed by value. * * John Mainzer, 6/7/05 - * Modified code to use the dirtied parameter of + * Modified code to use the dirtied parameter of * H5AC_unprotect() instead of manipulating the is_dirty * field of the cache info directly. * @@ -1100,7 +1100,7 @@ H5HL_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t buf_size, const void * (sizeof_hdr + heap->mem_alloc)); if (NULL==heap->chunk) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, (size_t)(-1), "memory allocation failed"); - + /* clear new section so junk doesn't appear in the file */ HDmemset(heap->chunk + sizeof_hdr + old_size, 0, need_more); } @@ -1143,7 +1143,7 @@ done: * The ADDR argument is passed by value. * * John Mainzer, 6/7/05 - * Modified code to use the dirtied parameter of + * Modified code to use the dirtied parameter of * H5AC_unprotect() instead of manipulating the is_dirty * field of the cache info directly. * @@ -1177,7 +1177,7 @@ H5HL_write(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t offset, size_t size, co HDmemcpy(heap->chunk + H5HL_SIZEOF_HDR(f) + offset, buf, size); done: - if (heap && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP, addr, heap, heap_flags) != SUCCEED && + if (heap && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP, addr, heap, heap_flags) != SUCCEED && ret_value != FAIL) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release object header"); @@ -1213,7 +1213,7 @@ done: * The ADDR argument is passed by value. * * John Mainzer, 6/7/05 - * Modified code to use the dirtied parameter of + * Modified code to use the dirtied parameter of * H5AC_unprotect() instead of manipulating the is_dirty * field of the cache info directly. * @@ -1343,7 +1343,7 @@ done: * Modifications: * * John Mainzer - 6/17/05 - * Modified function to use the new dirtied parmeter of + * Modified function to use the new dirtied parmeter of * H5AC_unprotect(), which allows management of the is_dirty * field of the cache info to be moved into the cache code. * diff --git a/src/H5HLprivate.h b/src/H5HLprivate.h index 7321bb9..001c3a1 100644 --- a/src/H5HLprivate.h +++ b/src/H5HLprivate.h @@ -64,7 +64,7 @@ typedef struct H5HL_t H5HL_t; H5_DLL herr_t H5HL_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, haddr_t *addr/*out*/); H5_DLL const H5HL_t *H5HL_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr); H5_DLL void *H5HL_offset_into(H5F_t *f, const H5HL_t *heap, size_t offset); -H5_DLL herr_t H5HL_unprotect(H5F_t *f, hid_t dxpl_id, const H5HL_t *heap, +H5_DLL herr_t H5HL_unprotect(H5F_t *f, hid_t dxpl_id, const H5HL_t *heap, haddr_t addr, unsigned heap_flags); H5_DLL size_t H5HL_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t size, const void *buf); diff --git a/src/H5I.c b/src/H5I.c index 6ae8ca8..a0e2096 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -14,17 +14,17 @@ /* * FILE: H5I.c - Internal storage routines for handling "IDs" - * + * * REMARKS: ID's which allow objects (void *'s currently) to be bundled * into "types" for more general storage. - * + * * DESIGN: The types are stored in an array of pointers to store each * type in an element. Each "type" node contains a link to a * hash table to manage the IDs in each type. Allowed types are * values within the range 1 to MAX_NUM_TYPES and are given out * at run-time. Types used by the library are stored in global * variables defined in H5Ipublic.h. - * + * * AUTHOR: Quincey Koziol * * MODIFICATIONS: @@ -109,7 +109,7 @@ typedef struct { /*-------------------- Locally scoped variables -----------------------------*/ /* Array of pointers to atomic types */ -static H5I_id_type_t *H5I_id_type_list_g[MAX_NUM_TYPES]; +static H5I_id_type_t *H5I_id_type_list_g[MAX_NUM_TYPES]; /* Variable to keep track of the number of types allocated. Its value is the */ /* next type ID to be handed out, so it is always one greater than the number */ @@ -135,7 +135,7 @@ NAME H5I_init_interface -- Initialize interface-specific information USAGE herr_t H5I_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -163,7 +163,7 @@ H5I_init_interface(void) * * Failure: Negative. * - * Programmer: + * Programmer: * * Modifications: * @@ -205,10 +205,10 @@ H5I_term_interface(void) * Function: H5Iregister_type * * Purpose: Public interface to H5I_register_type. Creates a new type - * of ID's to give out. A specific number (RESERVED) of type - * entries may be reserved to enable "constant" values to be handed - * out which are valid IDs in the type, but which do not map to any - * data structures and are not allocated dynamically later. HASH_SIZE is + * of ID's to give out. A specific number (RESERVED) of type + * entries may be reserved to enable "constant" values to be handed + * out which are valid IDs in the type, but which do not map to any + * data structures and are not allocated dynamically later. HASH_SIZE is * the minimum hash table size to use for the type. FREE_FUNC is * called with an object pointer when the object is removed from * the type. @@ -322,7 +322,7 @@ H5I_type_t H5I_register_type(H5I_type_t type_id, size_t hash_size, unsigned rese { ret_value = type_id; } - + /* Initialize the type */ /* Check arguments */ #ifdef HASH_SIZE_POWER_2 @@ -372,10 +372,10 @@ H5I_type_t H5I_register_type(H5I_type_t type_id, size_t hash_size, unsigned rese /*------------------------------------------------------------------------- * Function: H5Itype_exists * - * Purpose: Query function to inform the user if a given type is - * currently registered with the library. + * Purpose: Query function to inform the user if a given type is + * currently registered with the library. * - * Return: Success: 1 if the type is registered, 0 if it is not + * Return: Success: 1 if the type is registered, 0 if it is not * * Failure: Negative * @@ -579,7 +579,7 @@ H5I_clear_type(H5I_type_t type, hbool_t force) if (type <= H5I_BADID || type >= H5I_next_type) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number"); - + type_ptr = H5I_id_type_list_g[type]; if (type_ptr == NULL || type_ptr->count <= 0) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type"); @@ -666,7 +666,7 @@ H5I_clear_type(H5I_type_t type, hbool_t force) } /* end else */ } /* end for */ } /* end for */ - + done: FUNC_LEAVE_NOAPI(ret_value); } @@ -680,7 +680,7 @@ done: * involves calling the free-func for each ID's object and * then adding the ID struct to the ID free list. Public * interface to H5I_destroy_type. - * + * * Return: Zero on success/Negative on failure * * Programmer: Nathaniel Furrer @@ -807,7 +807,7 @@ hid_t H5Iregister(H5I_type_t type, void *object) * *------------------------------------------------------------------------- */ -hid_t +hid_t H5I_register(H5I_type_t type, void *object) { H5I_id_type_t *type_ptr=NULL; /*ptr to the type */ @@ -818,7 +818,7 @@ H5I_register(H5I_type_t type, void *object) hid_t ret_value=SUCCEED; /*return value */ H5I_id_info_t *curr_id; /*ptr to the current atom */ unsigned i; /*counter */ - + FUNC_ENTER_NOAPI(H5I_register, FAIL); /* Check arguments */ @@ -911,13 +911,13 @@ H5I_register(H5I_type_t type, void *object) * * Failure: NULL * - * Programmer: + * Programmer: * * Modifications: * *------------------------------------------------------------------------- */ -void * +void * H5I_object(hid_t id) { H5I_id_info_t *id_ptr = NULL; /*ptr to the new atom */ @@ -940,7 +940,7 @@ done: * Function: H5Iobject_verify * * Purpose: Find an object pointer for the specified ID, verifying that - * its in a particular type. Public interface to + * its in a particular type. Public interface to * H5I_object_verify. * * Return: Success: Non-null object pointer associated with the @@ -993,7 +993,7 @@ done: * *------------------------------------------------------------------------- */ -void * +void * H5I_object_verify(hid_t id, H5I_type_t id_type) { H5I_id_info_t *id_ptr = NULL; /*ptr to the new atom */ @@ -1033,7 +1033,7 @@ done: * *------------------------------------------------------------------------- */ -H5I_type_t +H5I_type_t H5I_get_type(hid_t id) { H5I_type_t ret_value = H5I_BADID; @@ -1062,7 +1062,7 @@ done: * * Failure: H5I_BADID, a negative value * - * Programmer: + * Programmer: * * Modifications: * Robb Matzke, 1999-08-23 @@ -1144,7 +1144,7 @@ void *H5Iremove_verify(hid_t id, H5I_type_t id_type) * *------------------------------------------------------------------------- */ -void * +void * H5I_remove_verify(hid_t id, H5I_type_t id_type) { void * ret_value = NULL; /*return value */ @@ -1176,13 +1176,13 @@ done: * * Failure: NULL * - * Programmer: + * Programmer: * * Modifications: * *------------------------------------------------------------------------- */ -void * +void * H5I_remove(hid_t id) { H5I_id_type_t *type_ptr = NULL;/*ptr to the atomic type */ @@ -1334,7 +1334,7 @@ H5I_dec_ref(hid_t id) type_ptr = H5I_id_type_list_g[type]; if (type_ptr == NULL || type_ptr->count <= 0) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number"); - + /* General lookup of the ID */ if ((id_ptr=H5I_find_id(id))==NULL) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't locate ID"); @@ -1632,7 +1632,7 @@ done: * return value of 0 means that the type will have to be * re-initialized before it can be used again (and should probably * be set to H5I_UNINIT). - * + * * Return: Number of references to type on success/Negative on failure * * Programmer: Nathaniel Furrer @@ -1673,7 +1673,7 @@ herr_t H5Idec_type_ref(H5I_type_t type) * return value of 0 means that the type will have to be * re-initialized before it can be used again (and should probably * be set to H5I_UNINIT). - * + * * Return: Number of references to type on success/Negative on failure * * Programmer: Unknown @@ -1716,7 +1716,7 @@ H5I_dec_type_ref(H5I_type_t type) --(type_ptr->count); ret_value = type_ptr->count; } - + done: FUNC_LEAVE_NOAPI(ret_value); } @@ -1921,7 +1921,7 @@ done: * * Failure: NULL * - * Programmer: + * Programmer: * * Modifications: * @@ -1976,10 +1976,10 @@ H5I_find_id(hid_t id) /*------------------------------------------------------------------------- * Function: H5Iget_name * - * Purpose: Gets a name of an object from its ID. + * Purpose: Gets a name of an object from its ID. * * Return: Success: The length of name. - * + * * Failure: -1 * * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu @@ -2126,14 +2126,14 @@ done: * Function: H5Iget_file_id * * Purpose: The public version of H5I_get_file_id(), obtains the file - * ID given an object ID. User has to close this ID. + * ID given an object ID. User has to close this ID. * * Return: Success: file ID * * Failure: a negative value * * Programmer: Raymond Lu - * Oct 27, 2003 + * Oct 27, 2003 * * Modifications: * @@ -2159,14 +2159,14 @@ done: * Function: H5I_get_file_id * * Purpose: The private version of H5Iget_file_id(), obtains the file - * ID given an object ID. + * ID given an object ID. * * Return: Success: file ID * * Failure: a negative value * * Programmer: Raymond Lu - * Oct 27, 2003 + * Oct 27, 2003 * * Modifications: * @@ -2185,7 +2185,7 @@ H5I_get_file_id(hid_t obj_id) type = H5I_TYPE(obj_id); if(type == H5I_FILE) { ret_value = obj_id; - + /* Increment reference count on atom. */ if (H5I_inc_ref(ret_value)<0) HGOTO_ERROR (H5E_ATOM, H5E_CANTSET, FAIL, "incrementing file ID failed"); diff --git a/src/H5Ipublic.h b/src/H5Ipublic.h index bda034c..1efa6ad 100644 --- a/src/H5Ipublic.h +++ b/src/H5Ipublic.h @@ -47,7 +47,7 @@ typedef enum H5I_type_t { H5I_GENPROP_LST, /*type ID for generic property lists */ H5I_ERROR_CLASS, /*type ID for error classes */ H5I_ERROR_MSG, /*type ID for error messages */ - H5I_ERROR_STACK, /*type ID for error stacks */ + H5I_ERROR_STACK, /*type ID for error stacks */ H5I_NTYPES /*number of library types, MUST BE LAST! */ } H5I_type_t; diff --git a/src/H5MF.c b/src/H5MF.c index 5e1cb45..f4ce055 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -65,20 +65,20 @@ haddr_t H5MF_alloc(H5F_t *f, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) { haddr_t ret_value; - + FUNC_ENTER_NOAPI(H5MF_alloc, HADDR_UNDEF); /* check arguments */ assert(f); assert(size > 0); - + /* Fail if we don't have write access */ if (0==(f->intent & H5F_ACC_RDWR)) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, HADDR_UNDEF, "file is read-only"); /* Check that the file can address the new space */ if( H5MF_alloc_overflow(f, size) ) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "not enough address space in file"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "not enough address space in file"); /* Allocate space from the virtual file layer */ if (HADDR_UNDEF==(ret_value=H5FD_alloc(f->shared->lf, type, dxpl_id, size))) @@ -187,7 +187,7 @@ H5MF_realloc(H5F_t *f, H5FD_mem_t type, hid_t dxpl_id, haddr_t old_addr, hsize_t hsize_t new_size) { haddr_t ret_value; - + FUNC_ENTER_NOAPI(H5MF_realloc, HADDR_UNDEF); /* Convert old relative address to absolute address */ @@ -331,7 +331,7 @@ H5MF_alloc_overflow(H5F_t *f, hsize_t size) /* Also add space that is "reserved" for data to be flushed * to disk (e.g., for object headers and the heap). - * This is the total amount of file space that will be + * This is the total amount of file space that will be * allocated. */ space_needed += f->shared->lf->reserved_alloc; diff --git a/src/H5MM.c b/src/H5MM.c index b08cd7d..415b2e2 100644 --- a/src/H5MM.c +++ b/src/H5MM.c @@ -20,7 +20,7 @@ * * Purpose: Memory management functions. * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ diff --git a/src/H5MP.c b/src/H5MP.c index 490b38a..e620f09 100644 --- a/src/H5MP.c +++ b/src/H5MP.c @@ -265,7 +265,7 @@ HDfprintf(stderr,"%s: request = %Zu, needed = %Zu\n", FUNC, request, needed); size_t page_size; /* Size of page needed */ /* Check if the request is too large for a standard page */ - page_size = (needed > mp->max_size) ? + page_size = (needed > mp->max_size) ? (needed + H5MP_BLOCK_ALIGN(sizeof(H5MP_page_t))) : mp->page_size; /* Allocate new page */ diff --git a/src/H5MPtest.c b/src/H5MPtest.c index 7962457..45d5179 100644 --- a/src/H5MPtest.c +++ b/src/H5MPtest.c @@ -158,7 +158,7 @@ HDfprintf(stderr,"%s: page_free = %Zu, page->free_size = %Zu\n", "H5MP_pool_is_f page = page->next; } /* end while */ - /* Check that the free space from the pages + /* Check that the free space from the pages * corresponds to free space in pool */ #ifdef QAK HDfprintf(stderr,"%s: pool_free = %Zu, mp->free_size = %Zu\n", "H5MP_pool_is_free_size_correct", pool_free, mp->free_size); diff --git a/src/H5O.c b/src/H5O.c index a15d9ac..c675bd6 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -20,7 +20,7 @@ * * Purpose: Object header virtual functions. * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ @@ -67,7 +67,7 @@ static int H5O_modify_real(H5G_entry_t *ent, const H5O_class_t *type, int overwrite, unsigned flags, unsigned update_flags, const void *mesg, hid_t dxpl_id); static int H5O_append_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - const H5O_class_t *type, unsigned flags, const void *mesg, + const H5O_class_t *type, unsigned flags, const void *mesg, unsigned * oh_flags_ptr); static herr_t H5O_remove_real(H5G_entry_t *ent, const H5O_class_t *type, int sequence, hid_t dxpl_id); @@ -82,7 +82,7 @@ static unsigned H5O_new_mesg(H5F_t *f, H5O_t *oh, unsigned *flags, const H5O_class_t **new_type, const void **new_mesg, hid_t dxpl_id, unsigned * oh_flags_ptr); static herr_t H5O_write_mesg(H5O_t *oh, unsigned idx, const H5O_class_t *type, - const void *mesg, unsigned flags, unsigned update_flags, + const void *mesg, unsigned flags, unsigned update_flags, unsigned * oh_flags_ptr); /* Metadata cache callbacks */ @@ -262,9 +262,9 @@ done: * Modifications: * * JRM -- 6/6/05 - * Removed code modifying the is_dirty field of the + * Removed code modifying the is_dirty field of the * cache_info. This field is now managed by the cache - * proper. + * proper. * *------------------------------------------------------------------------- */ @@ -306,7 +306,7 @@ H5O_init(H5F_t *f, hid_t dxpl_id, size_t size_hint, H5G_entry_t *ent/*out*/, had if (NULL == (oh->chunk[0].image = H5FL_BLK_CALLOC(chunk_image, size_hint))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); - + /* create the message list and initialize the first message */ oh->nmesgs = 1; oh->alloc_nmesgs = H5O_NMESGS; @@ -421,7 +421,7 @@ H5O_close(H5G_entry_t *obj_ent) } } #endif - + /* * If the file open object count has reached the number of open mount points * (each of which has a group open in the file) attempt to close the file. @@ -509,10 +509,10 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED * _udata1, oh->version = *p++; if (H5O_VERSION != oh->version) HGOTO_ERROR(H5E_OHDR, H5E_VERSION, NULL, "bad object header version number"); - + /* reserved */ p++; - + /* decode number of messages */ UINT16DECODE(p, nmesgs); @@ -540,7 +540,7 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED * _udata1, oh->alloc_nchunks = na; oh->chunk = x; } - + /* read the chunk raw data */ chunkno = oh->nchunks++; oh->chunk[chunkno].dirty = FALSE; @@ -551,7 +551,7 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED * _udata1, if (H5F_block_read(f, H5FD_MEM_OHDR, chunk_addr, chunk_size, dxpl_id, oh->chunk[chunkno].image) < 0) HGOTO_ERROR(H5E_OHDR, H5E_READERROR, NULL, "unable to read object header data"); - + /* load messages from this chunk */ for (p = oh->chunk[chunkno].image; p < oh->chunk[chunkno].image + chunk_size; p += mesg_size) { UINT16DECODE(p, id); @@ -694,11 +694,11 @@ H5O_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5O_t *oh) combine=1; } /* end if */ else { - if (H5F_block_write(f, H5FD_MEM_OHDR, addr, (size_t)H5O_SIZEOF_HDR(f), + if (H5F_block_write(f, H5FD_MEM_OHDR, addr, (size_t)H5O_SIZEOF_HDR(f), dxpl_id, buf) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to write object header hdr to disk"); } /* end else */ - + /* encode messages */ for (u = 0, curr_msg=&oh->mesg[0]; u < oh->nmesgs; u++,curr_msg++) { if (curr_msg->dirty) { @@ -712,7 +712,7 @@ H5O_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5O_t *oh) *p++ = 0; /*reserved*/ *p++ = 0; /*reserved*/ *p++ = 0; /*reserved*/ - + if (curr_msg->native) { assert(curr_msg->type->encode); @@ -731,7 +731,7 @@ H5O_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5O_t *oh) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate space for object header data"); oh->chunk[cont->chunkno].addr = cont->addr; } - + /* * Encode the message. If the message is shared then we * encode a Shared Object message instead of the object @@ -917,7 +917,7 @@ done: * The value returned will probably be low unless the object * has just been flushed, as we simply total up the size of * the header with the sizes of the chunks. Thus any message - * that has been added since the last flush will not be + * that has been added since the last flush will not be * reflected in the total. * * Return: Non-negative on success/Negative on failure @@ -944,7 +944,7 @@ H5O_compute_size(const H5F_t *f, const H5O_t *oh, size_t *size_ptr) size = H5O_SIZEOF_HDR(f); - for (u = 0; u < oh->nchunks; u++) + for (u = 0; u < oh->nchunks; u++) size += oh->chunk[u].size; HDassert(size >= H5O_SIZEOF_HDR(f)); @@ -1068,7 +1068,7 @@ H5O_free (unsigned type_id, void *mesg) assert(type_idmesg[idx].flags & H5O_FLAG_CONSTANT) { HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to modify constant message"); } else if (oh->mesg[idx].flags & H5O_FLAG_SHARED) { HGOTO_ERROR (H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to modify shared (constant) message"); } - + /* Write the information to the message */ if(H5O_write_mesg(oh,idx,type,mesg,flags,update_flags,&oh_flags)<0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to write message"); @@ -1927,14 +1927,14 @@ H5O_modify_real(H5G_entry_t *ent, const H5O_class_t *type, int overwrite, /* Update the modification time message if any */ if(update_flags&H5O_UPDATE_TIME) H5O_touch_oh(ent->file, oh, FALSE, &oh_flags); - + /* Set return value */ ret_value = sequence; done: if (oh && H5AC_unprotect(ent->file, dxpl_id, H5AC_OHDR, ent->header, oh, oh_flags) < 0) HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header"); - + FUNC_LEAVE_NOAPI(ret_value); } /* end H5O_modify_real() */ @@ -2000,7 +2000,7 @@ done: * Modifications: * * John Mainzer, 6/6/05 - * Updated function to use the new dirtied parameter of + * Updated function to use the new dirtied parameter of * H5AC_unprotect() instead of manipulating the is_dirty * field of the cache info directly. * @@ -2049,7 +2049,7 @@ done: * Feb 14 2003 * * John Mainzer, 6/6/05 - * Updated function to use the new dirtied parameter of + * Updated function to use the new dirtied parameter of * H5AC_unprotect() instead of manipulating the is_dirty * field of the cache info directly. * @@ -2101,14 +2101,14 @@ done: * Modifications: * * John Mainzer, 6/6/05 - * Updated function to use the new dirtied parameter of + * Updated function to use the new dirtied parameter of * H5AC_unprotect() instead of manipulating the is_dirty * of the cache info. * *------------------------------------------------------------------------- */ static int -H5O_append_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_class_t *type, +H5O_append_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_class_t *type, unsigned flags, const void *mesg, unsigned * oh_flags_ptr) { unsigned idx; /* Index of message to modify */ @@ -2155,7 +2155,7 @@ done: * Modifications: * * John Mainzer, 6/7/05 - * Modified function to use the new dirtied parameter to + * Modified function to use the new dirtied parameter to * H5AC_unprotect() instead of modfying the is_dirty field. * In this case, that requires the addition of the oh_dirtied_ptr * parameter to track whether *oh is dirty. @@ -2237,7 +2237,7 @@ done: * Modifications: * * John Mainzer, 6/6/05 - * Modified function to use the new dirtied parameter to + * Modified function to use the new dirtied parameter to * H5AC_unprotect() instead of modfying the is_dirty field. * In this case, that requires the addition of the oh_dirtied_ptr * parameter to track whether *oh is dirty. @@ -2246,7 +2246,7 @@ done: */ static herr_t H5O_write_mesg(H5O_t *oh, unsigned idx, const H5O_class_t *type, - const void *mesg, unsigned flags, unsigned update_flags, + const void *mesg, unsigned flags, unsigned update_flags, unsigned * oh_flags_ptr) { H5O_mesg_t *idx_msg; /* Pointer to message to modify */ @@ -2295,7 +2295,7 @@ done: * Modifications: * * John Mainzer, 6/6/05 - * Modified function to use the new dirtied parameter to + * Modified function to use the new dirtied parameter to * H5AC_unprotect() instead of modfying the is_dirty field. * In this case, that requires the addition of the oh_dirtied_ptr * parameter to track whether *oh is dirty. @@ -2312,7 +2312,7 @@ H5O_touch_oh(H5F_t *f, H5O_t *oh, hbool_t force, unsigned * oh_flags_ptr) time_t now; size_t size; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5O_touch_oh); assert(oh); @@ -2370,7 +2370,7 @@ done: * Modifications: * * John Mainzer, 6/16/05 - * Modified function to use the new dirtied parameter to + * Modified function to use the new dirtied parameter to * H5AC_unprotect() instead of modfying the is_dirty field. * *------------------------------------------------------------------------- @@ -2381,7 +2381,7 @@ H5O_touch(H5G_entry_t *ent, hbool_t force, hid_t dxpl_id) H5O_t *oh = NULL; unsigned oh_flags = H5AC__NO_FLAGS_SET; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5O_touch, FAIL); /* check args */ @@ -2422,7 +2422,7 @@ done: * Modifications: * * John Mainzer, 6/16/05 - * Modified function to use the new dirtied parameter to + * Modified function to use the new dirtied parameter to * H5AC_unprotect() instead of modfying the is_dirty field. * In this case, that requires the addition of the oh_dirtied_ptr * parameter to track whether *oh is dirty. @@ -2435,7 +2435,7 @@ H5O_bogus_oh(H5F_t *f, H5O_t *oh, hbool_t * oh_flags_ptr) int idx; size_t size; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER(H5O_bogus_oh, FAIL); assert(f); @@ -2484,7 +2484,7 @@ done: * Modifications: * * John Mainzer, 6/16/05 - * Modified function to use the new dirtied parameter to + * Modified function to use the new dirtied parameter to * H5AC_unprotect() instead of modfying the is_dirty field. * *------------------------------------------------------------------------- @@ -2495,7 +2495,7 @@ H5O_bogus(H5G_entry_t *ent, hid_t dxpl_id) H5O_t *oh = NULL; unsigned oh_flags = H5AC__NO_FLAGS_SET; herr_t ret_value = SUCCEED; - + FUNC_ENTER(H5O_bogus, FAIL); /* check args */ @@ -2632,7 +2632,7 @@ H5O_remove_real(H5G_entry_t *ent, const H5O_class_t *type, int sequence, hid_t d /* load the object header */ if (NULL == (oh = H5AC_protect(ent->file, dxpl_id, H5AC_OHDR, ent->header, NULL, NULL, H5AC_WRITE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to load object header"); - + for (u = seq = 0, curr_msg=&oh->mesg[0]; u < oh->nmesgs; u++,curr_msg++) { if (type->id != curr_msg->type->id) continue; @@ -2805,7 +2805,7 @@ H5O_alloc_extend_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno, size_t size) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, UFAIL, "memory allocation failed"); HDmemset(oh->chunk[chunkno].image+old_size, 0, oh->chunk[chunkno].size - old_size); - + /* adjust raw addresses for messages of this chunk */ if (old_addr != oh->chunk[chunkno].image) { for (u = 0; u < oh->nmesgs; u++) { @@ -2936,7 +2936,7 @@ H5O_alloc_new_chunk(H5F_t *f, H5O_t *oh, size_t size) oh->chunk[chunkno].size = size; if (NULL==(oh->chunk[chunkno].image = p = H5FL_BLK_CALLOC(chunk_image,size))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, UFAIL, "memory allocation failed"); - + /* * Make sure we have enough space for all possible new messages * that could be generated below. @@ -3181,7 +3181,7 @@ H5O_share (H5F_t *f, hid_t dxpl_id, const H5O_class_t *type, const void *mesg, size_t size; void *buf = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5O_share); /* Check args */ @@ -3230,7 +3230,7 @@ H5O_raw_size(unsigned type_id, const H5F_t *f, const void *mesg) { const H5O_class_t *type; /* Actual H5O class type for the ID */ size_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5O_raw_size,0); /* Check args */ @@ -3274,7 +3274,7 @@ H5O_get_share(unsigned type_id, H5F_t *f, const void *mesg, H5O_shared_t *share) { const H5O_class_t *type; /* Actual H5O class type for the ID */ herr_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5O_get_share,FAIL); /* Check args */ @@ -3318,7 +3318,7 @@ H5O_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) { H5O_t *oh=NULL; /* Object header information */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5O_delete,FAIL); /* Check args */ @@ -3334,7 +3334,7 @@ H5O_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "can't delete object from file"); done: - if (oh && + if (oh && H5AC_unprotect(f, dxpl_id, H5AC_OHDR, addr, oh, H5AC__DIRTIED_FLAG | H5C__DELETED_FLAG)<0) HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header"); @@ -3368,7 +3368,7 @@ H5O_delete_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh) H5O_chunk_t *curr_chk; /* Pointer to current chunk being operated on */ unsigned u; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5O_delete_oh); /* Check args */ @@ -3430,7 +3430,7 @@ H5O_delete_mesg(H5F_t *f, hid_t dxpl_id, H5O_mesg_t *mesg) { const H5O_class_t *type; /* Type of object to free */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5O_delete_mesg); /* Check args */ @@ -3492,7 +3492,7 @@ H5O_get_info(H5G_entry_t *ent, H5O_stat_t *ostat, hid_t dxpl_id) hsize_t free_space; /* Free space in object header */ unsigned u; /* Local index variable */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5O_get_info,FAIL); /* Check args */ @@ -3532,7 +3532,7 @@ done: /*------------------------------------------------------------------------- * Function: H5O_encode * - * Purpose: Encode an object(data type and simple data space only) + * Purpose: Encode an object(data type and simple data space only) * description into a buffer. * * Return: Success: Non-negative @@ -3560,7 +3560,7 @@ H5O_encode(H5F_t *f, unsigned char *buf, void *obj, unsigned type_id) type=message_type_g[type_id]; /* map the type ID to the actual type object */ assert(type); - /* Encode */ + /* Encode */ if ((type->encode)(f, buf, obj)<0) HGOTO_ERROR (H5E_OHDR, H5E_CANTENCODE, FAIL, "unable to encode message"); @@ -3572,10 +3572,10 @@ done: /*------------------------------------------------------------------------- * Function: H5O_decode * - * Purpose: Decode a binary object(data type and data space only) + * Purpose: Decode a binary object(data type and data space only) * description and return a new object handle. * - * Return: Success: Pointer to object(data type or space) + * Return: Success: Pointer to object(data type or space) * * Failure: NULL * @@ -3631,7 +3631,7 @@ done: * object being iterated over ('mesg'), and the pointer to the operator data * passed in to H5O_iterate ('op_data'). The return values from an operator * are: - * A. Zero causes the iterator to continue, returning zero when all + * A. Zero causes the iterator to continue, returning zero when all * object headers of that type have been processed. * B. Positive causes the iterator to immediately return that positive * value, indicating short-circuit success. @@ -3730,7 +3730,7 @@ H5O_debug_id(hid_t type_id, H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *str { const H5O_class_t *type; /* Actual H5O class type for the ID */ herr_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5O_debug_id,FAIL); /* Check args */ @@ -3868,7 +3868,7 @@ H5O_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int f "Constant:", (oh->mesg[i].flags & H5O_FLAG_CONSTANT) ? "Yes" : "No"); if (oh->mesg[i].flags & ~H5O_FLAG_BITS) { - HDfprintf (stream, "%*s%-*s 0x%02x\n", indent+3,"",MAX(0,fwidth-3), + HDfprintf (stream, "%*s%-*s 0x%02x\n", indent+3,"",MAX(0,fwidth-3), "*** ADDITIONAL UNKNOWN FLAGS --->", oh->mesg[i].flags & ~H5O_FLAG_BITS); } @@ -3881,14 +3881,14 @@ H5O_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int f chunkno = oh->mesg[i].chunkno; if (chunkno >= oh->nchunks) HDfprintf(stream, "*** BAD CHUNK NUMBER\n"); - + /* check the size */ if ((oh->mesg[i].raw + oh->mesg[i].raw_size > oh->chunk[chunkno].image + oh->chunk[chunkno].size) || (oh->mesg[i].raw < oh->chunk[chunkno].image)) { HDfprintf(stream, "*** BAD MESSAGE RAW ADDRESS\n"); } - + /* decode the message */ if (oh->mesg[i].flags & H5O_FLAG_SHARED) { decode = H5O_SHARED->decode; @@ -3901,7 +3901,7 @@ H5O_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int f oh->mesg[i].native = (decode)(f, dxpl_id, oh->mesg[i].raw, NULL); if (NULL==oh->mesg[i].native) debug = NULL; - + /* print the message */ HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3), "Message Information:"); diff --git a/src/H5Oattr.c b/src/H5Oattr.c index be48782..d0ed251 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -143,7 +143,7 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t UNUSED * UINT16DECODE(p, name_len); /*including null*/ UINT16DECODE(p, attr->dt_size); UINT16DECODE(p, attr->ds_size); - + /* Decode and store the name */ if (NULL==(attr->name=H5MM_strdup((const char *)p))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); @@ -179,7 +179,7 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t UNUSED * /* decode the attribute dataspace */ if (NULL==(attr->ds = H5FL_CALLOC(H5S_t))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); - + if((extent=(H5O_SDSPACE->decode)(f,dxpl_id,p,NULL))==NULL) HGOTO_ERROR(H5E_ATTR, H5E_CANTDECODE, NULL, "can't decode attribute dataspace"); @@ -188,7 +188,7 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t UNUSED * /* Release temporary extent information */ H5FL_FREE(H5S_extent_t,extent); - + /* Default to entire dataspace being selected */ if(H5S_select_all(attr->ds,0)<0) HGOTO_ERROR (H5E_DATASPACE, H5E_CANTSET, NULL, "unable to set all selection"); @@ -210,7 +210,7 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t UNUSED * /* Indicate that the fill values aren't to be written out */ attr->initialized=1; - + /* Set return value */ ret_value=attr; @@ -223,7 +223,7 @@ done: NAME H5O_attr_encode PURPOSE - Encode a simple attribute message + Encode a simple attribute message USAGE herr_t H5O_attr_encode(f, raw_size, p, mesg) H5F_t *f; IN: pointer to the HDF5 file struct @@ -243,7 +243,7 @@ done: * Added a version number at the beginning. * * Raymond Lu, 8 April 2004 - * For data space, changed the operation on H5S_simple_t to + * For data space, changed the operation on H5S_simple_t to * H5S_extent_t * --------------------------------------------------------------------------*/ @@ -341,7 +341,7 @@ H5O_attr_encode(H5F_t *f, uint8_t *p, const void *mesg) } /* end if */ else p += attr->ds_size; - + /* Store attribute data */ if(attr->data) HDmemcpy(p,attr->data,attr->data_size); @@ -360,8 +360,8 @@ done: Copies a message from MESG to DEST, allocating DEST if necessary. USAGE void *H5O_attr_copy(mesg, dest) - const void *mesg; IN: Pointer to the source attribute struct - const void *dest; IN: Pointer to the destination attribute struct + const void *mesg; IN: Pointer to the source attribute struct + const void *dest; IN: Pointer to the destination attribute struct RETURNS Pointer to DEST on success, NULL on failure DESCRIPTION @@ -609,7 +609,7 @@ done: RETURNS Non-negative on success/Negative on failure DESCRIPTION - This function prints debugging output to the stream passed as a + This function prints debugging output to the stream passed as a parameter. --------------------------------------------------------------------------*/ static herr_t @@ -642,7 +642,7 @@ H5O_attr_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int in fprintf(stream, "%*sSymbol table entry...\n", indent, ""); H5G_ent_debug(f, dxpl_id, &(mesg->ent), stream, indent+3, MAX(0, fwidth-3), HADDR_UNDEF); - + fprintf(stream, "%*sData type...\n", indent, ""); fprintf(stream, "%*s%-*s %lu\n", indent+3, "", MAX(0,fwidth-3), "Size:", diff --git a/src/H5Obogus.c b/src/H5Obogus.c index 4da3f89..54a52b2 100644 --- a/src/H5Obogus.c +++ b/src/H5Obogus.c @@ -24,7 +24,7 @@ * correct operation when parsing unknown object header * messages. * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ diff --git a/src/H5Ocont.c b/src/H5Ocont.c index 23c501e..b28186c 100644 --- a/src/H5Ocont.c +++ b/src/H5Ocont.c @@ -23,7 +23,7 @@ * the H5O package. Therefore, do not change * any definitions in this file! * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ diff --git a/src/H5Odtype.c b/src/H5Odtype.c index 0ab8bc5..7a7972b 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -207,7 +207,7 @@ H5O_dtype_decode_helper(H5F_t *f, const uint8_t **pp, H5T_t *dt) UINT32DECODE(*pp, dt->shared->u.compnd.memb[i].offset); /* Older versions of the library allowed a field to have - * intrinsic 'arrayness'. Newer versions of the library + * intrinsic 'arrayness'. Newer versions of the library * use the separate array datatypes. */ if(version==H5O_DTYPE_VERSION_COMPAT) { /* Decode the number of dimensions */ @@ -220,7 +220,7 @@ H5O_dtype_decode_helper(H5F_t *f, const uint8_t **pp, H5T_t *dt) /* Skip reserved bytes */ *pp += 4; - + /* Decode array dimension sizes */ for (j=0; j<4; j++) UINT32DECODE(*pp, dim[j]); @@ -261,7 +261,7 @@ H5O_dtype_decode_helper(H5F_t *f, const uint8_t **pp, H5T_t *dt) /* Close the base type for the array */ H5T_close(temp_type); - + /* Make the array type the type that is set for the field */ temp_type=array_dt; } /* end if */ @@ -723,7 +723,7 @@ H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt) /* Parent type */ if (H5O_dtype_encode_helper(pp, dt->shared->parent)<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "unable to encode parent data type"); - + /* Names, each a multiple of eight bytes */ for (i=0; ishared->u.enumer.nmembs; i++) { HDstrcpy((char*)(*pp), dt->shared->u.enumer.name[i]); @@ -737,11 +737,11 @@ H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt) HDmemcpy(*pp, dt->shared->u.enumer.value, dt->shared->u.enumer.nmembs * dt->shared->parent->shared->size); *pp += dt->shared->u.enumer.nmembs * dt->shared->parent->shared->size; break; - + case H5T_REFERENCE: flags |= (dt->shared->u.atomic.u.r.rtype & 0x0f); break; - + case H5T_STRING: /* * Character string types... (not fully implemented) @@ -880,7 +880,7 @@ done: NAME H5O_dtype_encode PURPOSE - Encode a simple datatype message + Encode a simple datatype message USAGE herr_t H5O_dtype_encode(f, raw_size, p, mesg) H5F_t *f; IN: pointer to the HDF5 file struct @@ -923,9 +923,9 @@ done: USAGE void *H5O_dtype_copy(mesg, dest) const void *mesg; IN: Pointer to the source simple datatype - struct + struct const void *dest; IN: Pointer to the destination simple - datatype struct + datatype struct RETURNS Pointer to DEST on success, NULL on failure DESCRIPTION @@ -1133,7 +1133,7 @@ H5O_dtype_get_share(H5F_t UNUSED *f, const void *_mesg, { const H5T_t *dt = (const H5T_t *)_mesg; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5O_dtype_get_share); assert (dt); @@ -1175,7 +1175,7 @@ H5O_dtype_set_share (H5F_t UNUSED *f, void *_mesg/*in,out*/, const H5O_shared_t *sh) { H5T_t *dt = (H5T_t *)_mesg; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_dtype_set_share); assert (dt); @@ -1208,7 +1208,7 @@ H5O_dtype_set_share (H5F_t UNUSED *f, void *_mesg/*in,out*/, RETURNS Non-negative on success/Negative on failure DESCRIPTION - This function prints debugging output to the stream passed as a + This function prints debugging output to the stream passed as a parameter. --------------------------------------------------------------------------*/ static herr_t @@ -1220,7 +1220,7 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, char buf[256]; unsigned i; size_t k; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_dtype_debug); /* check args */ @@ -1311,7 +1311,7 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, } fprintf(stream, "\n"); } - + } else if (H5T_OPAQUE==dt->shared->type) { fprintf(stream, "%*s%-*s \"%s\"\n", indent, "", fwidth, "Tag:", dt->shared->u.opaque.tag); diff --git a/src/H5Oefl.c b/src/H5Oefl.c index 8959233..9106310 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -73,7 +73,7 @@ const H5O_class_t H5O_EFL[1] = {{ * Modifications: * Robb Matzke, 1998-07-20 * Rearranged the message to add a version number near the beginning. - * + * *------------------------------------------------------------------------- */ static void * @@ -118,7 +118,7 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t UNUSED *s if (NULL == (heap = H5HL_protect(f, dxpl_id, mesg->heap_addr))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "unable to read protect link value") - + s = H5HL_offset_into(f, heap, 0); assert (s && !*s); @@ -137,7 +137,7 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t UNUSED *s if (NULL == (heap = H5HL_protect(f, dxpl_id, mesg->heap_addr))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "unable to read protect link value") - + s = H5HL_offset_into(f, heap, mesg->slot[u].name_offset); assert (s && *s); mesg->slot[u].name = H5MM_xstrdup (s); @@ -145,7 +145,7 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t UNUSED *s if (H5HL_unprotect(f, dxpl_id, heap, mesg->heap_addr, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "unable to read unprotect link value") - + /* File offset */ H5F_DECODE_LENGTH (f, p, mesg->slot[u].offset); @@ -184,7 +184,7 @@ done: * Entering the name into the local heap happens when the dataset is * created. Otherwise we could end up in infinite recursion if the heap * happens to hash to the same cache slot as the object header. - * + * *------------------------------------------------------------------------- */ static herr_t @@ -267,7 +267,7 @@ H5O_efl_copy(const void *_mesg, void *_dest, unsigned UNUSED update_flags) if (NULL==(dest = H5MM_calloc(sizeof(H5O_efl_t))) || NULL==(dest->slot=H5MM_malloc(mesg->nalloc* sizeof(H5O_efl_entry_t)))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); - + } else if (dest->nallocnalloc) { H5MM_xfree(dest->slot); if (NULL==(dest->slot = H5MM_malloc(mesg->nalloc* @@ -354,7 +354,7 @@ H5O_efl_reset(void *_mesg) { H5O_efl_t *mesg = (H5O_efl_t *) _mesg; size_t u; /* Local index variable */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_efl_reset); /* check args */ @@ -393,7 +393,7 @@ hsize_t H5O_efl_total_size (H5O_efl_t *efl) { hsize_t ret_value = 0, tmp; - + FUNC_ENTER_NOAPI_NOINIT(H5O_efl_total_size); if (efl->nused>0 && @@ -455,11 +455,11 @@ H5O_efl_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * s for (u = 0; u < mesg->nused; u++) { sprintf (buf, "File %u", (unsigned)u); HDfprintf (stream, "%*s%s:\n", indent, "", buf); - + HDfprintf(stream, "%*s%-*s \"%s\"\n", indent+3, "", MAX (fwidth-3, 0), "Name:", mesg->slot[u].name); - + HDfprintf(stream, "%*s%-*s %lu\n", indent+3, "", MAX (fwidth-3, 0), "Name offset:", (unsigned long)(mesg->slot[u].name_offset)); diff --git a/src/H5Ofill.c b/src/H5Ofill.c index a7c0af9..32b772f 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -87,8 +87,8 @@ const H5O_class_t H5O_FILL_NEW[1] = {{ /* Initial version of the "old" fill value information */ #define H5O_FILL_VERSION 1 /* Revised version of the "new" fill value information */ -#define H5O_FILL_VERSION_2 2 - +#define H5O_FILL_VERSION_2 2 + /* Declare a free list to manage the H5O_fill_new_t struct */ H5FL_DEFINE(H5O_fill_new_t); @@ -99,16 +99,16 @@ H5FL_DEFINE(H5O_fill_t); /*------------------------------------------------------------------------- * Function: H5O_fill_new_decode * - * Purpose: Decode a new fill value message. The new fill value - * message is fill value plus space allocation time and + * Purpose: Decode a new fill value message. The new fill value + * message is fill value plus space allocation time and * fill value writing time and whether fill value is defined. * * Return: Success: Ptr to new message in native struct. * * Failure: NULL * - * Programmer: Raymond Lu - * Feb 26, 2002 + * Programmer: Raymond Lu + * Feb 26, 2002 * * Modifications: * @@ -121,7 +121,7 @@ H5O_fill_new_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p, H5O_fill_new_t *mesg=NULL; int version; void *ret_value; - + FUNC_ENTER_NOAPI_NOINIT(H5O_fill_new_decode); assert(f); @@ -130,12 +130,12 @@ H5O_fill_new_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p, if (NULL==(mesg=H5FL_CALLOC(H5O_fill_new_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for fill value message"); - + /* Version */ version = *p++; if( version != H5O_FILL_VERSION && version !=H5O_FILL_VERSION_2) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad version number for fill value message"); - + /* Space allocation time */ mesg->alloc_time = (H5D_alloc_time_t)*p++; @@ -160,7 +160,7 @@ H5O_fill_new_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p, /* Set return value */ ret_value = (void*)mesg; - + done: if (!ret_value && mesg) { if(mesg->buf) @@ -194,7 +194,7 @@ H5O_fill_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p, { H5O_fill_t *mesg=NULL; void *ret_value; - + FUNC_ENTER_NOAPI_NOINIT(H5O_fill_decode); assert(f); @@ -209,10 +209,10 @@ H5O_fill_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for fill value"); HDmemcpy(mesg->buf, p, mesg->size); } - + /* Set return value */ ret_value = (void*)mesg; - + done: if (!ret_value && mesg) { if(mesg->buf) @@ -233,8 +233,8 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: Raymond Lu - * Feb 26, 2002 + * Programmer: Raymond Lu + * Feb 26, 2002 * * Modifications: * @@ -244,7 +244,7 @@ static herr_t H5O_fill_new_encode(H5F_t UNUSED *f, uint8_t *p, const void *_mesg) { const H5O_fill_new_t *mesg = (const H5O_fill_new_t *)_mesg; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_fill_new_encode); assert(f); @@ -311,16 +311,16 @@ H5O_fill_encode(H5F_t UNUSED *f, uint8_t *p, const void *_mesg) * Function: H5O_fill_new_copy * * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if - * necessary. The new fill value message is fill value plus - * space allocation time and fill value writing time and + * necessary. The new fill value message is fill value plus + * space allocation time and fill value writing time and * whether fill value is defined. * * Return: Success: Ptr to _DEST * * Failure: NULL * - * Programmer: Raymond Lu - * Feb 26, 2002 + * Programmer: Raymond Lu + * Feb 26, 2002 * * Modifications: * @@ -450,7 +450,7 @@ done: * * Purpose: Returns the size of the raw message in bytes not counting the * message type or size fields, but only the data fields. This - * function doesn't take into account alignment. The new fill + * function doesn't take into account alignment. The new fill * value message is fill value plus space allocation time and * fill value writing time and whether fill value is defined. * @@ -470,7 +470,7 @@ H5O_fill_new_size(const H5F_t UNUSED *f, const void *_mesg) { const H5O_fill_new_t *mesg = (const H5O_fill_new_t *)_mesg; size_t ret_value; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_fill_new_size); assert(f); @@ -510,7 +510,7 @@ static size_t H5O_fill_size(const H5F_t UNUSED *f, const void *_mesg) { const H5O_fill_t *mesg = (const H5O_fill_t *)_mesg; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_fill_size); assert(f); @@ -544,8 +544,8 @@ H5O_fill_new_reset(void *_mesg) FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_fill_new_reset); assert(mesg); - - if(mesg->buf) + + if(mesg->buf) mesg->buf = H5MM_xfree(mesg->buf); mesg->size = -1; if (mesg->type) { @@ -582,15 +582,15 @@ H5O_fill_reset(void *_mesg) FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_fill_reset); assert(mesg); - - if(mesg->buf) + + if(mesg->buf) mesg->buf = H5MM_xfree(mesg->buf); mesg->size = 0; if (mesg->type) { H5T_close(mesg->type); mesg->type = NULL; } - + FUNC_LEAVE_NOAPI(SUCCEED); } @@ -669,7 +669,7 @@ H5O_fill_new_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FIL { const H5O_fill_new_t *mesg = (const H5O_fill_new_t *)_mesg; H5D_fill_value_t fill_status; /* Whether the fill value is defined */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_fill_new_debug); assert(f); @@ -747,7 +747,7 @@ H5O_fill_new_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FIL } else { fprintf(stream, "\n"); } - + FUNC_LEAVE_NOAPI(SUCCEED); } @@ -771,7 +771,7 @@ H5O_fill_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE *s int indent, int fwidth) { const H5O_fill_t *mesg = (const H5O_fill_t *)_mesg; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_fill_debug); assert(f); @@ -789,7 +789,7 @@ H5O_fill_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE *s } else { fprintf(stream, "\n"); } - + FUNC_LEAVE_NOAPI(SUCCEED); } diff --git a/src/H5Olayout.c b/src/H5Olayout.c index 1d50f94..b488e57 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -58,7 +58,7 @@ const H5O_class_t H5O_LAYOUT[1] = {{ H5O_layout_debug, /*debug the message */ }}; -/* For forward and backward compatibility. Version is 1 when space is +/* For forward and backward compatibility. Version is 1 when space is * allocated; 2 when space is delayed for allocation; 3 is default now and * is revised to just store information needed for each storage type. */ #define H5O_LAYOUT_VERSION_1 1 @@ -352,7 +352,7 @@ H5O_layout_copy(const void *_mesg, void *_dest, unsigned UNUSED update_flags) assert(mesg); if (!dest && NULL==(dest=H5FL_MALLOC(H5O_layout_t))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); - + /* copy */ *dest = *mesg; @@ -376,20 +376,20 @@ done: /*------------------------------------------------------------------------- * Function: H5O_layout_meta_size - * + * * Purpose: Returns the size of the raw message in bytes except raw data - * part for compact dataset. This function doesn't take into + * part for compact dataset. This function doesn't take into * account message alignment. - * + * * Return: Success: Message data size in bytes(except raw data * for compact dataset) * Failure: 0 - * + * * Programmer: Raymond Lu - * August 14, 2002 - * + * August 14, 2002 + * * Modifications: - * + * *------------------------------------------------------------------------- */ size_t @@ -397,20 +397,20 @@ H5O_layout_meta_size(const H5F_t *f, const void *_mesg) { const H5O_layout_t *mesg = (const H5O_layout_t *) _mesg; size_t ret_value; - + FUNC_ENTER_NOAPI_NOINIT(H5O_layout_meta_size); - + /* check args */ assert(f); assert(mesg); - + ret_value = 1 + /* Version number */ 1; /* layout class type */ switch(mesg->type) { case H5D_CONTIGUOUS: - ret_value += H5F_SIZEOF_ADDR(f); /* Address of data */ - ret_value += H5F_SIZEOF_SIZE(f); /* Length of data */ + ret_value += H5F_SIZEOF_ADDR(f); /* Address of data */ + ret_value += H5F_SIZEOF_SIZE(f); /* Length of data */ break; case H5D_CHUNKED: @@ -419,7 +419,7 @@ H5O_layout_meta_size(const H5F_t *f, const void *_mesg) ret_value++; /* B-tree address */ - ret_value += H5F_SIZEOF_ADDR(f); /* Address of data */ + ret_value += H5F_SIZEOF_ADDR(f); /* Address of data */ /* Dimension sizes */ ret_value += mesg->u.chunk.ndims*4; @@ -434,15 +434,15 @@ H5O_layout_meta_size(const H5F_t *f, const void *_mesg) HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, 0, "Invalid layout class"); } /* end switch */ -done: +done: FUNC_LEAVE_NOAPI(ret_value); -} - +} + /*------------------------------------------------------------------------- * Function: H5O_layout_size * - * Purpose: Returns the size of the raw message in bytes. If it's + * Purpose: Returns the size of the raw message in bytes. If it's * compact dataset, the data part is also included. * This function doesn't take into account message alignment. * diff --git a/src/H5Omtime.c b/src/H5Omtime.c index ad398ae..c113676 100644 --- a/src/H5Omtime.c +++ b/src/H5Omtime.c @@ -26,7 +26,7 @@ #include "H5MMprivate.h" #include "H5Opkg.h" /* Object header functions */ -#if defined (WIN32) && !defined (__MWERKS__) +#if defined (WIN32) && !defined (__MWERKS__) #include #include #endif @@ -83,8 +83,8 @@ const H5O_class_t H5O_MTIME_NEW[1] = {{ }}; /* Current version of new mtime information */ -#define H5O_MTIME_VERSION 1 - +#define H5O_MTIME_VERSION 1 + /* Track whether tzset routine was called */ static int ntzset=0; @@ -243,12 +243,12 @@ H5O_mtime_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p, the_time -= tz.tz_minuteswest * 60 - (tm.tm_isdst ? 3600 : 0); } -#elif defined (WIN32) +#elif defined (WIN32) #if !defined (__MWERKS__) /* MSVC */ { struct timeb timebuffer; long tz; - + ftime(&timebuffer); tz = timebuffer.timezone; /* daylight is not handled properly. Currently we just hard-code @@ -272,7 +272,7 @@ H5O_mtime_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p, /* Irix64 */ HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to obtain local timezone information"); #endif - + /* The return value */ if (NULL==(mesg = H5FL_MALLOC(time_t))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); @@ -305,7 +305,7 @@ static herr_t H5O_mtime_new_encode(H5F_t UNUSED *f, uint8_t *p, const void *_mesg) { const time_t *mesg = (const time_t *) _mesg; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_mtime_new_encode); /* check args */ @@ -348,7 +348,7 @@ H5O_mtime_encode(H5F_t UNUSED *f, uint8_t *p, const void *_mesg) { const time_t *mesg = (const time_t *) _mesg; struct tm *tm; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_mtime_encode); /* check args */ @@ -397,7 +397,7 @@ H5O_mtime_copy(const void *_mesg, void *_dest, unsigned UNUSED update_flags) assert(mesg); if (!dest && NULL==(dest = H5FL_MALLOC(time_t))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); - + /* copy */ *dest = *mesg; @@ -548,7 +548,7 @@ H5O_mtime_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * const time_t *mesg = (const time_t *)_mesg; struct tm *tm; char buf[128]; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_mtime_debug); /* check args */ @@ -560,7 +560,7 @@ H5O_mtime_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * /* debug */ tm = HDlocaltime(mesg); - + HDstrftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S %Z", tm); fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Time:", buf); diff --git a/src/H5Oname.c b/src/H5Oname.c index 9fb5b3f..64477af 100644 --- a/src/H5Oname.c +++ b/src/H5Oname.c @@ -20,7 +20,7 @@ * * Purpose: Object name message. * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ @@ -177,7 +177,7 @@ H5O_name_copy(const void *_mesg, void *_dest, unsigned UNUSED update_flags) assert(mesg); if (!dest && NULL==(dest = H5MM_calloc(sizeof(H5O_name_t)))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); - + /* copy */ *dest = *mesg; if((dest->s = H5MM_xstrdup(mesg->s))==NULL) diff --git a/src/H5Onull.c b/src/H5Onull.c index 376b3ec..028a535 100644 --- a/src/H5Onull.c +++ b/src/H5Onull.c @@ -20,7 +20,7 @@ * * Purpose: The null message. * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ diff --git a/src/H5Opkg.h b/src/H5Opkg.h index bec95d7..7217e53 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -124,8 +124,8 @@ H5_DLLVAR const H5O_class_t H5O_DTYPE[1]; H5_DLLVAR const H5O_class_t H5O_FILL[1]; /* - * New Fill Value Message. The new fill value message is fill value plus - * space allocation time and fill value writing time and whether fill + * New Fill Value Message. The new fill value message is fill value plus + * space allocation time and fill value writing time and whether fill * value is defined. */ H5_DLLVAR const H5O_class_t H5O_FILL_NEW[1]; diff --git a/src/H5Opline.c b/src/H5Opline.c index 7c1dba6f..280c8db 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -178,7 +178,7 @@ H5O_pline_encode (H5F_t UNUSED *f, uint8_t *p/*out*/, const void *mesg) size_t i, j, name_length; const char *name=NULL; H5Z_class_t *cls=NULL; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_pline_encode); /* Check args */ @@ -251,7 +251,7 @@ H5O_pline_copy (const void *_src, void *_dst/*out*/, unsigned UNUSED update_flag H5O_pline_t *dst = (H5O_pline_t *)_dst; size_t i; H5O_pline_t *ret_value; - + FUNC_ENTER_NOAPI_NOINIT(H5O_pline_copy); if (!dst && NULL==(dst = H5FL_MALLOC (H5O_pline_t))) @@ -266,7 +266,7 @@ H5O_pline_copy (const void *_src, void *_dst/*out*/, unsigned UNUSED update_flag } else { dst->filter = NULL; } - + for (i=0; inused; i++) { dst->filter[i] = src->filter[i]; if (src->filter[i].name) { @@ -326,7 +326,7 @@ H5O_pline_size (const H5F_t UNUSED *f, const void *mesg) const char *name = NULL; H5Z_class_t *cls = NULL; size_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_pline_size); /* Message header */ @@ -340,14 +340,14 @@ H5O_pline_size (const H5F_t UNUSED *f, const void *mesg) (cls=H5Z_find(pline->filter[i].id))) name = cls->name; name_len = name ? HDstrlen(name)+1 : 0; - + ret_value += 2 + /*filter identification number */ 2 + /*name length */ 2 + /*flags */ 2 + /*number of client data values */ H5O_ALIGN(name_len); /*length of the filter name */ - + ret_value += pline->filter[i].cd_nelmts * 4; if (pline->filter[i].cd_nelmts % 2) ret_value += 4; @@ -377,7 +377,7 @@ H5O_pline_reset (void *mesg) { H5O_pline_t *pline = (H5O_pline_t*)mesg; size_t i; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_pline_reset); assert (pline); @@ -487,6 +487,6 @@ H5O_pline_debug (H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *mesg, FILE * (unsigned long)(pline->filter[i].cd_values[j])); } } - + FUNC_LEAVE_NOAPI(SUCCEED); } diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index ed2c56d..2e0d21f 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -85,8 +85,8 @@ typedef struct H5O_fill_t { } H5O_fill_t; /* - * New Fill Value Message. The new fill value message is fill value plus - * space allocation time and fill value writing time and whether fill + * New Fill Value Message. The new fill value message is fill value plus + * space allocation time and fill value writing time and whether fill * value is defined. */ @@ -95,8 +95,8 @@ typedef struct H5O_fill_new_t { ssize_t size; /*number of bytes in the fill value */ void *buf; /*the fill value */ H5D_alloc_time_t alloc_time; /* time to allocate space */ - H5D_fill_time_t fill_time; /* time to write fill value */ - hbool_t fill_defined; /* whether fill value is defined */ + H5D_fill_time_t fill_time; /* time to write fill value */ + hbool_t fill_defined; /* whether fill value is defined */ } H5O_fill_new_t; /* @@ -127,12 +127,12 @@ typedef struct H5O_efl_t { #define H5O_LAYOUT_NDIMS (H5S_MAX_RANK+1) typedef struct H5O_layout_contig_t { - haddr_t addr; /* File address of data */ + haddr_t addr; /* File address of data */ hsize_t size; /* Size of data in bytes */ } H5O_layout_contig_t; typedef struct H5O_layout_chunk_t { - haddr_t addr; /* File address of B-tree */ + haddr_t addr; /* File address of B-tree */ unsigned ndims; /* Num dimensions in chunk */ size_t dim[H5O_LAYOUT_NDIMS]; /* Size of chunk in elements */ size_t size; /* Size of chunk in bytes */ @@ -140,7 +140,7 @@ typedef struct H5O_layout_chunk_t { } H5O_layout_chunk_t; typedef struct H5O_layout_compact_t { - hbool_t dirty; /* Dirty flag for compact dataset */ + hbool_t dirty; /* Dirty flag for compact dataset */ size_t size; /* Size of buffer in bytes */ void *buf; /* Buffer for compact dataset */ } H5O_layout_compact_t; @@ -242,16 +242,16 @@ H5_DLL void *H5O_read(const H5G_entry_t *ent, unsigned type_id, int sequence, H5_DLL int H5O_modify(H5G_entry_t *ent, unsigned type_id, int overwrite, unsigned flags, unsigned update_flags, const void *mesg, hid_t dxpl_id); H5_DLL struct H5O_t * H5O_protect(H5G_entry_t *ent, hid_t dxpl_id); -H5_DLL herr_t H5O_unprotect(H5G_entry_t *ent, struct H5O_t *oh, hid_t dxpl_id, +H5_DLL herr_t H5O_unprotect(H5G_entry_t *ent, struct H5O_t *oh, hid_t dxpl_id, unsigned oh_flags); -H5_DLL int H5O_append(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh, unsigned type_id, +H5_DLL int H5O_append(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh, unsigned type_id, unsigned flags, const void *mesg, unsigned * oh_flags_ptr); H5_DLL herr_t H5O_touch(H5G_entry_t *ent, hbool_t force, hid_t dxpl_id); -H5_DLL herr_t H5O_touch_oh(H5F_t *f, struct H5O_t *oh, hbool_t force, +H5_DLL herr_t H5O_touch_oh(H5F_t *f, struct H5O_t *oh, hbool_t force, unsigned * oh_flags_ptr); #ifdef H5O_ENABLE_BOGUS H5_DLL herr_t H5O_bogus(H5G_entry_t *ent, hid_t dxpl_id); -H5_DLL herr_t H5O_bogus_oh(H5F_t *f, struct H5O_t *oh, +H5_DLL herr_t H5O_bogus_oh(H5F_t *f, struct H5O_t *oh, unsigned * oh_flags_ptr); #endif /* H5O_ENABLE_BOGUS */ H5_DLL herr_t H5O_remove(H5G_entry_t *ent, unsigned type_id, int sequence, diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index 70249ea..cc3beb1 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -86,7 +86,7 @@ H5FL_ARR_EXTERN(hsize_t); Robb Matzke, 1998-04-09 The current and maximum dimensions are now H5F_SIZEOF_SIZET bytes instead of just four bytes. - + Robb Matzke, 1998-07-20 Added a version number and reformatted the message for aligment. @@ -103,7 +103,7 @@ H5O_sdspace_decode(H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *p, H5O_shared_ void *ret_value; unsigned i; /* local counting variable */ unsigned flags, version; - + FUNC_ENTER_NOAPI_NOINIT(H5O_sdspace_decode); /* check args */ @@ -139,9 +139,9 @@ H5O_sdspace_decode(H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *p, H5O_shared_ /* Increment past reserved byte */ p++; } /* end else */ - + p += 4; /*reserved*/ - + if (sdim->rank > 0) { if (NULL==(sdim->size=H5FL_ARR_MALLOC(hsize_t,sdim->rank))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); @@ -166,7 +166,7 @@ H5O_sdspace_decode(H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *p, H5O_shared_ /* Set return value */ ret_value = (void*)sdim; /*success*/ - + done: if (!ret_value && sdim) { H5S_extent_release(sdim); @@ -181,7 +181,7 @@ done: NAME H5O_sdspace_encode PURPOSE - Encode a simple dimensionality message + Encode a simple dimensionality message USAGE herr_t H5O_sdspace_encode(f, raw_size, p, mesg) H5F_t *f; IN: pointer to the HDF5 file struct @@ -198,7 +198,7 @@ done: Robb Matzke, 1998-04-09 The current and maximum dimensions are now H5F_SIZEOF_SIZET bytes instead of just four bytes. - + Robb Matzke, 1998-07-20 Added a version number and reformatted the message for aligment. @@ -246,7 +246,7 @@ H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *mesg) for (u = 0; u < sdim->rank; u++) H5F_ENCODE_LENGTH (f, p, sdim->size[u]); if (flags & H5S_VALID_MAX) { - for (u = 0; u < sdim->rank; u++) + for (u = 0; u < sdim->rank; u++) H5F_ENCODE_LENGTH (f, p, sdim->max[u]); } } @@ -326,7 +326,7 @@ static size_t H5O_sdspace_size(const H5F_t *f, const void *mesg) { const H5S_extent_t *space = (const H5S_extent_t *) mesg; - + /* * All dimensionality messages are at least 8 bytes long. */ @@ -363,7 +363,7 @@ static herr_t H5O_sdspace_reset(void *_mesg) { H5S_extent_t *mesg = (H5S_extent_t*)_mesg; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_sdspace_reset); H5S_extent_release(mesg); @@ -414,7 +414,7 @@ H5O_sdspace_free (void *mesg) RETURNS Non-negative on success/Negative on failure DESCRIPTION - This function prints debugging output to the stream passed as a + This function prints debugging output to the stream passed as a parameter. --------------------------------------------------------------------------*/ static herr_t @@ -436,13 +436,13 @@ H5O_sdspace_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *mesg, HDfprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth, "Rank:", (unsigned long) (sdim->rank)); - + if(sdim->rank>0) { HDfprintf(stream, "%*s%-*s {", indent, "", fwidth, "Dim Size:"); for (u = 0; u < sdim->rank; u++) HDfprintf (stream, "%s%Hu", u?", ":"", sdim->size[u]); HDfprintf (stream, "}\n"); - + HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, "Dim Max:"); if (sdim->max) { HDfprintf (stream, "{"); diff --git a/src/H5Oshared.c b/src/H5Oshared.c index 8f4f558..c898a10 100644 --- a/src/H5Oshared.c +++ b/src/H5Oshared.c @@ -209,7 +209,7 @@ H5O_shared_decode (H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *buf, H5O_share H5O_shared_t *mesg=NULL; unsigned flags, version; void *ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5O_shared_decode); /* Check args */ @@ -283,7 +283,7 @@ H5O_shared_encode (H5F_t *f, uint8_t *buf/*out*/, const void *_mesg) { const H5O_shared_t *mesg = (const H5O_shared_t *)_mesg; unsigned flags; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_shared_encode); /* Check args */ @@ -353,7 +353,7 @@ H5O_shared_copy(const void *_mesg, void *_dest, unsigned UNUSED update_flags) assert(mesg); if (!dest && NULL==(dest = H5MM_malloc (sizeof(H5O_shared_t)))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); - + /* copy */ *dest = *mesg; @@ -386,12 +386,12 @@ H5O_shared_size (const H5F_t *f, const void *_mesg) { const H5O_shared_t *shared = (const H5O_shared_t *) _mesg; size_t ret_value; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_shared_size); ret_value = 1 + /*version */ 1 + /*the flags field */ - (shared->in_gh ? + (shared->in_gh ? (H5F_SIZEOF_ADDR(f)+4) : /*sharing via global heap */ H5F_SIZEOF_ADDR(f)); /*sharing by another obj hdr */ @@ -516,6 +516,6 @@ H5O_shared_debug (H5F_t UNUSED *f, hid_t dxpl_id, const void *_mesg, H5G_ent_debug (f, dxpl_id, &(mesg->u.ent), stream, indent, fwidth, HADDR_UNDEF); } - + FUNC_LEAVE_NOAPI(SUCCEED); } diff --git a/src/H5Ostab.c b/src/H5Ostab.c index b3a3fd5..7bb06d5 100644 --- a/src/H5Ostab.c +++ b/src/H5Ostab.c @@ -20,7 +20,7 @@ * * Purpose: Symbol table messages. * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ @@ -231,7 +231,7 @@ H5O_stab_copy(const void *_mesg, void *_dest, unsigned UNUSED update_flags) assert(stab); if (!dest && NULL==(dest = H5FL_MALLOC(H5O_stab_t))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); - + /* copy */ *dest = *stab; diff --git a/src/H5P.c b/src/H5P.c index 014f226..f48809a 100644 --- a/src/H5P.c +++ b/src/H5P.c @@ -39,7 +39,7 @@ /* Local variables */ /* - * Predefined property list classes. These are initialized at runtime by + * Predefined property list classes. These are initialized at runtime by * H5P_init_interface() in this source file. */ hid_t H5P_CLS_NO_CLASS_g = FAIL; @@ -206,14 +206,14 @@ NAME H5P_init_interface -- Initialize interface-specific information USAGE herr_t H5P_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION Initializes any interface-specific data or routines. Modification: - + Peter Cao May 08, 2005 Add Group creation property, Add object creation property class. @@ -271,7 +271,7 @@ H5P_init_interface(void) /* Assume that if there are properties in the class, they are the default ones */ if(nprops==0) { /* register create intermediate groups */ - if(H5P_register(obj_class,H5G_CRT_INTERMEDIATE_GROUP_NAME,H5G_CRT_INTERMEDIATE_GROUP_SIZE, + if(H5P_register(obj_class,H5G_CRT_INTERMEDIATE_GROUP_NAME,H5G_CRT_INTERMEDIATE_GROUP_SIZE, &intmd_group,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") } @@ -498,7 +498,7 @@ H5P_copy_pclass(H5P_genclass_t *pclass) assert(pclass); - /* + /* * Create new property class object */ @@ -574,12 +574,12 @@ H5P_copy_plist(H5P_genplist_t *old_plist) size_t nseen; /* Number of items 'seen' */ hbool_t has_parent_class; /* Flag to indicate that this property list's class has a parent */ hid_t ret_value=FAIL; /* return value */ - + FUNC_ENTER_NOAPI(H5P_copy_plist, FAIL); assert(old_plist); - /* + /* * Create new property list object */ @@ -1533,7 +1533,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ hid_t -H5Pcreate_class(hid_t parent, const char *name, +H5Pcreate_class(hid_t parent, const char *name, H5P_cls_create_func_t cls_create, void *create_data, H5P_cls_copy_func_t cls_copy, void *copy_data, H5P_cls_close_func_t cls_close, void *close_data @@ -1556,7 +1556,7 @@ H5Pcreate_class(hid_t parent, const char *name, || (copy_data!=NULL && cls_copy==NULL) || (close_data!=NULL && cls_close==NULL)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "data specified, but no callback provided"); - + /* Get the pointer to the parent class */ if(parent==H5P_DEFAULT) par_class=NULL; @@ -1617,7 +1617,7 @@ H5P_create(H5P_genclass_t *pclass) assert(pclass); - /* + /* * Create new property list object */ @@ -2239,7 +2239,7 @@ herr_t H5Pregister(hid_t cls_id, const char *name, size_t size, void *def_value, H5P_prp_create_func_t prp_create, H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, H5P_prp_delete_func_t prp_delete, - H5P_prp_copy_func_t prp_copy, H5P_prp_compare_func_t prp_cmp, + H5P_prp_copy_func_t prp_copy, H5P_prp_compare_func_t prp_cmp, H5P_prp_close_func_t prp_close) #endif /* H5_WANT_H5_V1_6_COMPAT */ { @@ -2402,7 +2402,7 @@ done: transformation, etc. A single 'get' or 'set' callback could handle multiple properties by performing different actions based on the property name or other properties in the property list. - + There is no 'create' callback routine for temporary property list objects, the initial value is assumed to have any necessary setup already performed on it. @@ -2420,7 +2420,7 @@ done: herr_t H5P_insert(H5P_genplist_t *plist, const char *name, size_t size, void *value, H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, - H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, + H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, H5P_prp_compare_func_t prp_cmp, H5P_prp_close_func_t prp_close) { H5P_genprop_t *new_prop=NULL; /* Temporary property pointer */ @@ -2615,7 +2615,7 @@ done: transformation, etc. A single 'get' or 'set' callback could handle multiple properties by performing different actions based on the property name or other properties in the property list. - + There is no 'create' callback routine for temporary property list objects, the initial value is assumed to have any necessary setup already performed on it. @@ -2634,13 +2634,13 @@ done: herr_t H5Pinsert(hid_t plist_id, const char *name, size_t size, void *value, H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, - H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, + H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, H5P_prp_close_func_t prp_close) #else /* H5_WANT_H5_V1_6_COMPAT */ herr_t H5Pinsert(hid_t plist_id, const char *name, size_t size, void *value, H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, - H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, + H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, H5P_prp_compare_func_t prp_cmp, H5P_prp_close_func_t prp_close) #endif /* H5_WANT_H5_V1_6_COMPAT */ { @@ -3042,7 +3042,7 @@ H5Pexist(hid_t id, const char *name) if ((ret_value=H5P_exist_plist(plist,name))<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "property does not exist in list"); } /* end if */ - else + else if(H5I_GENPROP_CLS == H5I_get_type(id)) { if (NULL == (pclass = H5I_object(id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property class"); @@ -3198,7 +3198,7 @@ H5Pget_size(hid_t id, const char *name, size_t *size) if ((ret_value=H5P_get_size_plist(plist,name,size))<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to query size in plist"); } /* end if */ - else + else if (H5I_GENPROP_CLS == H5I_get_type(id)) { if (NULL == (pclass = H5I_object(id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); @@ -3207,7 +3207,7 @@ H5Pget_size(hid_t id, const char *name, size_t *size) if ((ret_value=H5P_get_size_pclass(pclass,name,size))<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to query size in plist"); } /* end if */ - else + else HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property object"); done: @@ -3430,7 +3430,7 @@ H5Pget_nprops(hid_t id, size_t *nprops) if (H5P_get_nprops_plist(plist,nprops)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to query # of properties in plist"); } /* end if */ - else + else if(H5I_GENPROP_CLS == H5I_get_type(id)) { if (NULL == (pclass = H5I_object(id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property class"); @@ -3539,7 +3539,7 @@ done: NAME H5P_cmp_class PURPOSE - Internal routine to compare two generic property classes + Internal routine to compare two generic property classes USAGE int H5P_cmp_class(pclass1, pclass2) H5P_genclass_t *pclass1; IN: 1st property class to compare @@ -3645,7 +3645,7 @@ done: NAME H5P_cmp_plist PURPOSE - Internal routine to compare two generic property lists + Internal routine to compare two generic property lists USAGE int H5P_cmp_plist(plist1, plist2) H5P_genplist_t *plist1; IN: 1st property list to compare @@ -4018,27 +4018,27 @@ The iteration begins with the IDX property in the object and the next element to be processed by the operator is returned in IDX. If IDX is NULL, then the iterator starts at the first property; since no stopping point is returned in this case, the iterator cannot be restarted if one of the calls to its operator -returns non-zero. +returns non-zero. -The prototype for H5P_iterate_t is: - typedef herr_t (*H5P_iterate_t)(hid_t id, const char *name, void *iter_data); +The prototype for H5P_iterate_t is: + typedef herr_t (*H5P_iterate_t)(hid_t id, const char *name, void *iter_data); The operation receives the property list or class identifier for the object being iterated over, ID, the name of the current property within the object, -NAME, and the pointer to the operator data passed in to H5Piterate, ITER_DATA. +NAME, and the pointer to the operator data passed in to H5Piterate, ITER_DATA. -The return values from an operator are: +The return values from an operator are: Zero causes the iterator to continue, returning zero when all properties - have been processed. + have been processed. Positive causes the iterator to immediately return that positive value, indicating short-circuit success. The iterator can be restarted at the - index of the next property. + index of the next property. Negative causes the iterator to immediately return that value, indicating failure. The iterator can be restarted at the index of the next property. H5Piterate assumes that the properties in the object identified by ID remains unchanged through the iteration. If the membership changes during the -iteration, the function's behavior is undefined. +iteration, the function's behavior is undefined. GLOBAL VARIABLES COMMENTS, BUGS, ASSUMPTIONS @@ -4176,27 +4176,27 @@ The iteration begins with the IDX property in the object and the next element to be processed by the operator is returned in IDX. If IDX is NULL, then the iterator starts at the first property; since no stopping point is returned in this case, the iterator cannot be restarted if one of the calls to its operator -returns non-zero. +returns non-zero. -The prototype for H5P_iterate_t is: - typedef herr_t (*H5P_iterate_t)(hid_t id, const char *name, void *iter_data); +The prototype for H5P_iterate_t is: + typedef herr_t (*H5P_iterate_t)(hid_t id, const char *name, void *iter_data); The operation receives the property list or class identifier for the object being iterated over, ID, the name of the current property within the object, -NAME, and the pointer to the operator data passed in to H5Piterate, ITER_DATA. +NAME, and the pointer to the operator data passed in to H5Piterate, ITER_DATA. -The return values from an operator are: +The return values from an operator are: Zero causes the iterator to continue, returning zero when all properties - have been processed. + have been processed. Positive causes the iterator to immediately return that positive value, indicating short-circuit success. The iterator can be restarted at the - index of the next property. + index of the next property. Negative causes the iterator to immediately return that value, indicating failure. The iterator can be restarted at the index of the next property. H5Piterate assumes that the properties in the object identified by ID remains unchanged through the iteration. If the membership changes during the -iteration, the function's behavior is undefined. +iteration, the function's behavior is undefined. GLOBAL VARIABLES COMMENTS, BUGS, ASSUMPTIONS @@ -4280,25 +4280,25 @@ is returned in this case, the iterator cannot be restarted if one of the calls to its operator returns non-zero. The IDX value is 0-based (ie. to start at the "first" property, the IDX value should be 0). -The prototype for H5P_iterate_t is: - typedef herr_t (*H5P_iterate_t)(hid_t id, const char *name, void *iter_data); +The prototype for H5P_iterate_t is: + typedef herr_t (*H5P_iterate_t)(hid_t id, const char *name, void *iter_data); The operation receives the property list or class identifier for the object being iterated over, ID, the name of the current property within the object, -NAME, and the pointer to the operator data passed in to H5Piterate, ITER_DATA. +NAME, and the pointer to the operator data passed in to H5Piterate, ITER_DATA. -The return values from an operator are: +The return values from an operator are: Zero causes the iterator to continue, returning zero when all properties - have been processed. + have been processed. Positive causes the iterator to immediately return that positive value, indicating short-circuit success. The iterator can be restarted at the - index of the next property. + index of the next property. Negative causes the iterator to immediately return that value, indicating failure. The iterator can be restarted at the index of the next property. H5Piterate assumes that the properties in the object identified by ID remains unchanged through the iteration. If the membership changes during the -iteration, the function's behavior is undefined. +iteration, the function's behavior is undefined. GLOBAL VARIABLES COMMENTS, BUGS, ASSUMPTIONS @@ -4325,13 +4325,13 @@ H5Piterate(hid_t id, int *idx, H5P_iterate_t iter_func, void *iter_data) if ((ret_value=H5P_iterate_plist(id,(idx ? idx : &fake_idx),iter_func,iter_data))<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to iterate over list"); } /* end if */ - else + else if (H5I_GENPROP_CLS == H5I_get_type(id)) { /* Iterate over a property class */ if ((ret_value=H5P_iterate_pclass(id,(idx ? idx : &fake_idx),iter_func,iter_data))<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to iterate over class"); } /* end if */ - else + else HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property object"); done: @@ -4917,7 +4917,7 @@ done: Failure: negative value. DESCRIPTION Copies a property from one property list to another. - + If a property is copied from one list to another, the property will be first deleted from the destination list (generating a call to the 'close' callback for the property, if one exists) and then the property is copied @@ -5026,12 +5026,12 @@ done: Failure: negative value. DESCRIPTION Copies a property from one property class to another. - + If a property is copied from one class to another, all the property information will be first deleted from the destination class and then the property information will be copied from the source class into the destination class. - + If the property does not exist in the destination class or list, this call is equivalent to calling H5Pregister. @@ -5089,12 +5089,12 @@ done: Failure: negative value. DESCRIPTION Copies a property from one property list or class to another. - + If a property is copied from one class to another, all the property information will be first deleted from the destination class and then the property information will be copied from the source class into the destination class. - + If a property is copied from one list to another, the property will be first deleted from the destination list (generating a call to the 'close' callback for the property, if one exists) and then the property is copied diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 3359b52..8977a51 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -106,7 +106,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for + * Changed the way to check parameter and set property for * generic property list. * *------------------------------------------------------------------------- @@ -153,7 +153,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check parameter and get property for + * Changed the way to check parameter and get property for * generic property list. * *------------------------------------------------------------------------- @@ -199,7 +199,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for + * Changed the way to check parameter and set property for * generic property list. * *------------------------------------------------------------------------- @@ -268,7 +268,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for + * Changed the way to check parameter and set property for * generic property list. * *------------------------------------------------------------------------- @@ -289,10 +289,10 @@ H5Pget_chunk(hid_t plist_id, int max_ndims, hsize_t dim[]/*out*/) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); if(H5P_get(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't get layout"); - if(H5D_CHUNKED != layout) + HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't get layout"); + if(H5D_CHUNKED != layout) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a chunked storage layout"); - + if(H5P_get(plist, H5D_CRT_CHUNK_DIM_NAME, &ndims) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get chunk dimensionality"); @@ -341,7 +341,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for + * Changed the way to check parameter and set property for * generic property list. * *------------------------------------------------------------------------- @@ -382,7 +382,7 @@ H5Pset_external(hid_t plist_id, const char *name, off_t offset, hsize_t size) HGOTO_ERROR (H5E_EFL, H5E_OVERFLOW, FAIL, "total external data size overflowed"); } /* end for */ } /* end if */ - + /* Add to the list */ if (efl.nused >= efl.nalloc) { @@ -400,7 +400,7 @@ H5Pset_external(hid_t plist_id, const char *name, off_t offset, hsize_t size) efl.slot[idx].offset = offset; efl.slot[idx].size = size; efl.nused++; - + if(H5P_set(plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "can't set external file list"); @@ -425,7 +425,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for + * Changed the way to check parameter and set property for * generic property list. * *------------------------------------------------------------------------- @@ -439,7 +439,7 @@ H5Pget_external_count(hid_t plist_id) FUNC_ENTER_API(H5Pget_external_count, FAIL); H5TRACE1("Is","i",plist_id); - + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); @@ -447,10 +447,10 @@ H5Pget_external_count(hid_t plist_id) /* Get value */ if(H5P_get(plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external file list"); - + /* Set return value */ ret_value=(int)efl.nused; - + done: FUNC_LEAVE_API(ret_value); } @@ -482,7 +482,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check parameter and get property for + * Changed the way to check parameter and get property for * generic property list. * *------------------------------------------------------------------------- @@ -497,7 +497,7 @@ H5Pget_external(hid_t plist_id, unsigned idx, size_t name_size, char *name/*out* FUNC_ENTER_API(H5Pget_external, FAIL); H5TRACE6("e","iIuzxxx",plist_id,idx,name_size,name,offset,size); - + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); @@ -505,7 +505,7 @@ H5Pget_external(hid_t plist_id, unsigned idx, size_t name_size, char *name/*out* /* Get value */ if(H5P_get(plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external file list"); - + if (idx>=efl.nused) HGOTO_ERROR (H5E_ARGS, H5E_BADRANGE, FAIL, "external file index is out of range"); @@ -638,7 +638,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for + * Changed the way to check parameter and set property for * generic property list. * *------------------------------------------------------------------------- @@ -747,7 +747,7 @@ done: * should be a value between zero and N-1 as described for * H5Pget_nfilters() and the function will return failure if the * filter number is out of range. - * + * * Return: Success: Filter identification number. * * Failure: H5Z_FILTER_ERROR (Negative) @@ -759,7 +759,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check paramter and set property for + * Changed the way to check paramter and set property for * generic property list. * * James Laird and Nat Furrer @@ -786,7 +786,7 @@ H5Pget_filter(hid_t plist_id, unsigned idx, unsigned int *flags/*out*/, H5P_genplist_t *plist; /* Property list pointer */ size_t i; /* Local index variable */ H5Z_filter_t ret_value; /* return value */ - + FUNC_ENTER_API(H5Pget_filter, H5Z_FILTER_ERROR); #ifdef H5_WANT_H5_V1_6_COMPAT H5TRACE7("Zf","iIux*zxzx",plist_id,idx,flags,cd_nelmts,cd_values,namelen, @@ -795,7 +795,7 @@ H5Pget_filter(hid_t plist_id, unsigned idx, unsigned int *flags/*out*/, H5TRACE7("Zf","iIux*zxzx",plist_id,idx,flags,cd_nelmts,cd_values,namelen, name); #endif /* H5_WANT_H5_V1_6_COMPAT */ - + /* Check args */ if (cd_nelmts || cd_values) { @@ -884,7 +884,7 @@ done: * field contaning encode/decode flags from H5Zpublic.h. The ID * should be the filter ID to retrieve the parameters for. If the * filter is not set for the property list, an error will be returned. - * + * * Return: Success: Non-negative * Failure: Negative * @@ -915,11 +915,11 @@ H5Pget_filter_by_id(hid_t plist_id, H5Z_filter_t id, unsigned int *flags/*out*/, H5P_genplist_t *plist; /* Property list pointer */ size_t i; /* Local index variable */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Pget_filter_by_id, FAIL); H5TRACE7("e","iZfx*zxzx",plist_id,id,flags,cd_nelmts,cd_values,namelen, name); - + /* Check args */ if (cd_nelmts || cd_values) { @@ -994,7 +994,7 @@ done: * * Purpose: This is a query routine to verify that all the filters set * in the dataset creation property list are available currently. - * + * * Return: Success: TRUE if all filters available, FALSE if one or * more filters not currently available. * Failure: FAIL on error @@ -1012,10 +1012,10 @@ H5Pall_filters_avail(hid_t plist_id) H5O_pline_t pline; /* Filter pipeline */ H5P_genplist_t *plist; /* Property list pointer */ hbool_t ret_value=TRUE; /* return value */ - + FUNC_ENTER_API(H5Pall_filters_avail, UFAIL); H5TRACE1("t","i",plist_id); - + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, UFAIL, "can't find object for ID"); @@ -1053,8 +1053,8 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for - * generic property list. + * Changed the way to check parameter and set property for + * generic property list. * *------------------------------------------------------------------------- */ @@ -1064,14 +1064,14 @@ H5Pset_deflate(hid_t plist_id, unsigned level) H5O_pline_t pline; H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_deflate, FAIL); H5TRACE2("e","iIu",plist_id,level); /* Check arguments */ if (level>9) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid deflate level"); - + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); @@ -1120,7 +1120,7 @@ H5Pset_szip(hid_t plist_id, unsigned options_mask, unsigned pixels_per_block) unsigned cd_values[2]; /* Filter parameters */ unsigned int config_flags; herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_szip, FAIL); H5TRACE3("e","iIuIu",plist_id,options_mask,pixels_per_block); @@ -1135,7 +1135,7 @@ H5Pset_szip(hid_t plist_id, unsigned options_mask, unsigned pixels_per_block) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "pixels_per_block is not even"); if (pixels_per_block>H5_SZIP_MAX_PIXELS_PER_BLOCK) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "pixels_per_block is too large"); - + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); @@ -1171,10 +1171,10 @@ done: /*------------------------------------------------------------------------- * Function: H5Pset_shuffle * - * Purpose: Sets the shuffling method for a permanent + * Purpose: Sets the shuffling method for a permanent * filter to H5Z_FILTER_SHUFFLE - * and bytes of the datatype of the array to be shuffled - * + * and bytes of the datatype of the array to be shuffled + * * Return: Non-negative on success/Negative on failure * * Programmer: Kent Yang @@ -1190,14 +1190,14 @@ H5Pset_shuffle(hid_t plist_id) H5O_pline_t pline; H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_shuffle, FAIL); H5TRACE1("e","i",plist_id); /* Check arguments */ if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_CREATE)) HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); - + /* Get the plist structure */ if(NULL == (plist = H5I_object(plist_id))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); @@ -1226,7 +1226,7 @@ done: * Wednesday, December 22, 2004 * * Modifications: - * + * * *------------------------------------------------------------------------- */ @@ -1267,28 +1267,28 @@ done: * Purpose: Sets scaleoffset filter for a dataset creation property list * and user-supplied parameters * - * Parameters: scale_factor: - for integer datatype, - this parameter will be - minimum-bits, if this value is set to 0, + * Parameters: scale_factor: + for integer datatype, + this parameter will be + minimum-bits, if this value is set to 0, scaleoffset filter will calculate the minimum-bits. - + For floating-point datatype, - For variable-minimum-bits method, this will be + For variable-minimum-bits method, this will be the decimal precision of the filter, - For fixed-minimum-bits method, this will be + For fixed-minimum-bits method, this will be the minimum-bit of the filter. scale_type: 0 for floating-point variable-minimum-bits, 1 for floating-point fixed-minimum-bits, other values, for integer datatype - + * Return: Non-negative on success/Negative on failure * * Programmer: Xiaowen Wu * Thursday, April 14, 2005 * * Modifications: - * + * * *------------------------------------------------------------------------- */ @@ -1311,13 +1311,13 @@ H5Pset_scaleoffset(hid_t plist_id, int scale_factor, unsigned scale_type) if(NULL == (plist = H5I_object(plist_id))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); - /* Set parameters for the filter + /* Set parameters for the filter * scale_type = 0: floating-point type, filter uses variable-minimum-bits method, * scale_factor is decimal scale factor * scale_type = 1: floating-point type, filter uses fixed-minimum-bits method, * scale_factor is the fixed minimum number of bits * scale type = other: integer type, scale_factor is minimum number of bits - * if scale_factor = 0, then filter calculates minimum number of bits + * if scale_factor = 0, then filter calculates minimum number of bits */ cd_values[0] = scale_factor; cd_values[1] = scale_type; @@ -1338,7 +1338,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Pset_fletcher32 * - * Purpose: Sets Fletcher32 checksum of EDC for a dataset creation + * Purpose: Sets Fletcher32 checksum of EDC for a dataset creation * property list. * * Return: Non-negative on success/Negative on failure @@ -1356,10 +1356,10 @@ H5Pset_fletcher32(hid_t plist_id) H5O_pline_t pline; H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_fletcher32, FAIL); H5TRACE1("e","i",plist_id); - + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); @@ -1384,7 +1384,7 @@ done: * VALUE is interpretted as being of type TYPE, which need not * be the same type as the dataset but the library must be able * to convert VALUE to the dataset type when the dataset is - * created. If VALUE is NULL, it will be interpreted as + * created. If VALUE is NULL, it will be interpreted as * undefining fill value. * * Return: Non-negative on success/Negative on failure @@ -1396,8 +1396,8 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for - * generic property list. + * Changed the way to check parameter and set property for + * generic property list. * *------------------------------------------------------------------------- */ @@ -1408,7 +1408,7 @@ H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value) H5T_t *type = NULL; H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_fill_value, FAIL); H5TRACE3("e","iix",plist_id,type_id,value); @@ -1442,7 +1442,7 @@ H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value) if(H5P_set(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set fill value"); - + done: FUNC_LEAVE_API(ret_value); } @@ -1466,7 +1466,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check parameter and get property for + * Changed the way to check parameter and get property for * generic property list. * *------------------------------------------------------------------------- @@ -1482,7 +1482,7 @@ H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/) hid_t src_id = -1; /*source data type id */ herr_t ret_value=SUCCEED; /* Return value */ H5P_genplist_t *plist; /* Property list pointer */ - + FUNC_ENTER_API(H5Pget_fill_value, FAIL); H5TRACE3("e","iix",plist_id,type_id,value); @@ -1491,7 +1491,7 @@ H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); if (!value) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,"no fill value output buffer"); - + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); @@ -1503,14 +1503,14 @@ H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/) * is undefined, also return error. */ if(H5P_get(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fill value"); + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fill value"); if(fill.size == (size_t)-1) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "fill value is undefined"); if(fill.size == 0) { HDmemset(value, 0, H5T_get_size(type)); HGOTO_DONE(SUCCEED); - } + } /* * Can we convert between the source and destination data types? */ @@ -1525,7 +1525,7 @@ H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/) * other than the fill value buffer that is large enough for both source * and destination. The app-supplied buffer might do okay. */ - if (H5T_get_size(type)>=H5T_get_size(fill.type)) { + if (H5T_get_size(type)>=H5T_get_size(fill.type)) { buf = value; if (H5T_path_bkg(tpath) && NULL==(bkg=H5MM_malloc(H5T_get_size(type)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion"); @@ -1536,7 +1536,7 @@ H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/) bkg = value; } HDmemcpy(buf, fill.buf, H5T_get_size(fill.type)); - + /* Do the conversion */ if (H5T_convert(tpath, src_id, type_id, 1, 0, 0, buf, bkg, H5AC_dxpl_id)<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "data type conversion failed"); @@ -1558,7 +1558,7 @@ done: * Function: H5P_is_fill_value_defined * * Purpose: Check if fill value is defined. Internal version of function - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Raymond Lu @@ -1590,7 +1590,7 @@ H5P_is_fill_value_defined(const struct H5O_fill_t *fill, H5D_fill_value_t *statu *status = H5D_FILL_VALUE_USER_DEFINED; else { *status = H5D_FILL_VALUE_ERROR; - HGOTO_ERROR(H5E_PLIST, H5E_BADRANGE, FAIL, "invalid combination of fill-value info"); + HGOTO_ERROR(H5E_PLIST, H5E_BADRANGE, FAIL, "invalid combination of fill-value info"); } done: @@ -1602,14 +1602,14 @@ done: * Function: H5Pfill_value_defined * * Purpose: Check if fill value is defined. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Raymond Lu * Wednesday, January 16, 2002 * * Modifications: - * + * * *------------------------------------------------------------------------- */ @@ -1631,11 +1631,11 @@ H5Pfill_value_defined(hid_t plist_id, H5D_fill_value_t *status) /* Get the fill value struct */ if(H5P_get(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fill value"); + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fill value"); /* Get the fill-value status */ if(H5P_is_fill_value_defined(&fill, status) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't check fill value status"); + HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't check fill value status"); done: FUNC_LEAVE_API(ret_value); @@ -1648,14 +1648,14 @@ done: * Purpose: Set space allocation time for dataset during creation. * Valid values are H5D_ALLOC_TIME_DEFAULT, H5D_ALLOC_TIME_EARLY, * H5D_ALLOC_TIME_LATE, H5D_ALLOC_TIME_INCR - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Raymond Lu * Wednesday, January 16, 2002 * * Modifications: - * + * * *------------------------------------------------------------------------- */ @@ -1676,7 +1676,7 @@ H5Pset_alloc_time(hid_t plist_id, H5D_alloc_time_t alloc_time) /* Check for resetting to default for layout type */ if(alloc_time==H5D_ALLOC_TIME_DEFAULT) { H5D_layout_t layout; /* Type of storage layout */ - + /* Retrieve the storage layout */ if(H5P_get(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get layout"); @@ -1713,7 +1713,7 @@ H5Pset_alloc_time(hid_t plist_id, H5D_alloc_time_t alloc_time) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set space allocation time"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value); } @@ -1723,14 +1723,14 @@ done: * Purpose: Get space allocation time for dataset creation. * Valid values are H5D_ALLOC_TIME_DEFAULT, H5D_ALLOC_TIME_EARLY, * H5D_ALLOC_TIME_LATE, H5D_ALLOC_TIME_INCR - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Raymond Lu * Wednesday, January 16, 2002 * * Modifications: - * + * * *------------------------------------------------------------------------- */ @@ -1838,8 +1838,8 @@ done: * Function: H5Premove_filter * * Purpose: Deletes a filter from the dataset creation property list; - * deletes all filters if FILTER is H5Z_FILTER_NONE - * + * deletes all filters if FILTER is H5Z_FILTER_NONE + * * Return: Non-negative on success/Negative on failure * * Programmer: Pedro Vicente diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index 3515c55..a9642ef 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -30,15 +30,15 @@ * Function: H5Pset_data_transform * * Purpose: - * Sets data transform expression. + * Sets data transform expression. + * + * + * Return: Returns a non-negative value if successful; otherwise returns a negative value. + * * - * - * Return: Returns a non-negative value if successful; otherwise returns a negative value. - * - * * Programmer: Leon Arber * Monday, March 07, 2004 - * + * * Modifications: * *------------------------------------------------------------------------- @@ -50,7 +50,7 @@ herr_t H5Pset_data_transform(hid_t plist_id, const char* expression) herr_t ret_value=SUCCEED; /* return value */ FUNC_ENTER_API(H5Pset_data_transform, FAIL); - + /* Check arguments */ if (expression == NULL) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "expression cannot be NULL"); @@ -82,10 +82,10 @@ done: * Function: H5Pget_data_transform * * Purpose: - * Gets data transform expression. - * - * Return: Returns a non-negative value if successful; otherwise returns a negative value. - * + * Gets data transform expression. + * + * Return: Returns a non-negative value if successful; otherwise returns a negative value. + * * Comments: * If `expression' is non-NULL then write up to `size' bytes into that * buffer and always return the length of the transform name. @@ -95,10 +95,10 @@ done: * is unchanged and the function returns a negative value. * If a zero is returned for the name's length, then there is no name * associated with the ID. - * + * * Programmer: Leon Arber * August 27, 2004 - * + * * Modifications: * October 20, 2004 LA: Changed API to use size and return ssize_t *------------------------------------------------------------------------- @@ -123,13 +123,13 @@ ssize_t H5Pget_data_transform(hid_t plist_id, char* expression /*out*/, size_t s if(NULL == data_xform_prop) HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Cannot get a data transform that has not been set"); - + /* Get the data transform string */ - pexp = H5Z_xform_extract_xform_str(data_xform_prop); + pexp = H5Z_xform_extract_xform_str(data_xform_prop); if(!pexp) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Failed to retrieve transform expression"); - + len = HDstrlen(pexp); if(expression) { @@ -137,9 +137,9 @@ ssize_t H5Pget_data_transform(hid_t plist_id, char* expression /*out*/, size_t s if(len >= size) expression[size-1]='\0'; } - + ret_value = (ssize_t)len; - + done: if(ret_value<0) { if(data_xform_prop) @@ -278,7 +278,7 @@ H5Pset_preserve(hid_t plist_id, hbool_t status) H5T_bkg_t need_bkg; /* Value for background buffer type */ H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_preserve, FAIL); H5TRACE2("e","ib",plist_id,status); @@ -318,7 +318,7 @@ H5Pget_preserve(hid_t plist_id) H5T_bkg_t need_bkg; /* Background value */ H5P_genplist_t *plist; /* Property list pointer */ int ret_value; /* return value */ - + FUNC_ENTER_API(H5Pget_preserve, FAIL); H5TRACE1("Is","i",plist_id); @@ -341,9 +341,9 @@ done: /*------------------------------------------------------------------------- * Function: H5Pset_edc_check * - * Purpose: Enable or disable error-detecting for a dataset reading - * process. This error-detecting algorithm is whichever - * user chooses earlier. This function cannot control + * Purpose: Enable or disable error-detecting for a dataset reading + * process. This error-detecting algorithm is whichever + * user chooses earlier. This function cannot control * writing process. * * Return: Non-negative on success/Negative on failure @@ -360,14 +360,14 @@ H5Pset_edc_check(hid_t plist_id, H5Z_EDC_t check) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_edc_check, FAIL); H5TRACE2("e","iZe",plist_id,check); /* Check argument */ if (check != H5Z_ENABLE_EDC && check != H5Z_DISABLE_EDC) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a valid value"); - + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); @@ -375,7 +375,7 @@ H5Pset_edc_check(hid_t plist_id, H5Z_EDC_t check) /* Update property list */ if (H5P_set(plist,H5D_XFER_EDC_NAME,&check)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value"); - + done: FUNC_LEAVE_API(ret_value); } @@ -384,9 +384,9 @@ done: /*------------------------------------------------------------------------- * Function: H5Pget_edc_check * - * Purpose: Enable or disable error-detecting for a dataset reading - * process. This error-detecting algorithm is whichever - * user chooses earlier. This function cannot control + * Purpose: Enable or disable error-detecting for a dataset reading + * process. This error-detecting algorithm is whichever + * user chooses earlier. This function cannot control * writing process. * * Return: Non-negative on success/Negative on failure @@ -403,7 +403,7 @@ H5Pget_edc_check(hid_t plist_id) { H5P_genplist_t *plist; /* Property list pointer */ H5Z_EDC_t ret_value; /* return value */ - + FUNC_ENTER_API(H5Pget_edc_check, H5Z_ERROR_EDC); H5TRACE1("Ze","i",plist_id); @@ -422,7 +422,7 @@ H5Pget_edc_check(hid_t plist_id) done: FUNC_LEAVE_API(ret_value); } - + /*------------------------------------------------------------------------- * Function: H5Pset_filter_callback @@ -446,7 +446,7 @@ H5Pset_filter_callback(hid_t plist_id, H5Z_filter_func_t func, void *op_data) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ H5Z_cb_t cb_struct; - + FUNC_ENTER_API(H5Pset_filter_callback, FAIL); H5TRACE3("e","ixx",plist_id,func,op_data); @@ -457,7 +457,7 @@ H5Pset_filter_callback(hid_t plist_id, H5Z_filter_func_t func, void *op_data) /* Update property list */ cb_struct.func = func; cb_struct.op_data = op_data; - + if (H5P_set(plist,H5D_XFER_FILTER_CB_NAME,&cb_struct)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value"); @@ -488,7 +488,7 @@ H5Pset_type_conv_cb(hid_t plist_id, H5T_conv_except_func_t op, void *operate_dat H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ H5T_conv_cb_t cb_struct; - + FUNC_ENTER_API(H5Pset_type_conv_cb, FAIL); H5TRACE3("e","ixx",plist_id,op,operate_data); @@ -499,7 +499,7 @@ H5Pset_type_conv_cb(hid_t plist_id, H5T_conv_except_func_t op, void *operate_dat /* Update property list */ cb_struct.func = op; cb_struct.user_data = operate_data; - + if (H5P_set(plist,H5D_XFER_CONV_CB_NAME,&cb_struct)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value"); @@ -530,7 +530,7 @@ H5Pget_type_conv_cb(hid_t plist_id, H5T_conv_except_func_t *op, void **operate_d H5P_genplist_t *plist; /* Property list pointer */ H5T_conv_cb_t cb_struct; herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pget_type_conv_cb, FAIL); H5TRACE3("e","i*xx",plist_id,op,operate_data); @@ -637,7 +637,7 @@ H5Pset_btree_ratios(hid_t plist_id, double left, double middle, if (left<0.0 || left>1.0 || middle<0.0 || middle>1.0 || right<0.0 || right>1.0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "split ratio must satisfy 0.0<=X<=1.0"); - + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 9868627..0a9e29e 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -62,7 +62,7 @@ static herr_t H5P_get_multi_type(H5P_genplist_t *plist, H5FD_mem_t *type); * * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed file access property list mechanism to the new + * Changed file access property list mechanism to the new * generic property list. *------------------------------------------------------------------------- */ @@ -71,7 +71,7 @@ H5Pset_alignment(hid_t fapl_id, hsize_t threshold, hsize_t alignment) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_alignment, FAIL); H5TRACE3("e","ihh",fapl_id,threshold,alignment); @@ -108,9 +108,9 @@ done: * * Modifications: * - * Raymond Lu + * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list design to the new generic + * Changed the file access list design to the new generic * property list. * *------------------------------------------------------------------------- @@ -164,7 +164,7 @@ done: * * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list design to the new generic + * Changed the file access list design to the new generic * property list. * *------------------------------------------------------------------------- @@ -175,7 +175,7 @@ H5P_set_driver(H5P_genplist_t *plist, hid_t new_driver_id, const void *new_drive hid_t driver_id; /* VFL driver ID */ void *driver_info; /* VFL driver info */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5P_set_driver, FAIL); if (NULL==H5I_object_verify(new_driver_id, H5I_VFL)) @@ -240,7 +240,7 @@ done: * * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list design to the new generic + * Changed the file access list design to the new generic * property list. * *------------------------------------------------------------------------- @@ -250,7 +250,7 @@ H5Pset_driver(hid_t plist_id, hid_t new_driver_id, const void *new_driver_info) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Pset_driver, FAIL); H5TRACE3("e","iix",plist_id,new_driver_id,new_driver_info); @@ -290,15 +290,15 @@ done: * Rewritten to use the virtual file layer. * * Robb Matzke, 1999-08-05 - * If the driver ID is H5FD_VFD_DEFAULT then substitute the + * If the driver ID is H5FD_VFD_DEFAULT then substitute the * current value of H5FD_SEC2. * * Quincey Koziol 2000-11-28 * Added internal function.. * * Raymond Lu, 2001-10-23 - * Changed the file access list design to the new generic - * property list. + * Changed the file access list design to the new generic + * property list. * *------------------------------------------------------------------------- */ @@ -396,9 +396,9 @@ done: * * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list design to the new generic + * Changed the file access list design to the new generic * property list. - * + * *------------------------------------------------------------------------- */ void * @@ -418,7 +418,7 @@ H5P_get_driver_info(H5P_genplist_t *plist) } else { HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access or data transfer property list"); } - + done: FUNC_LEAVE_NOAPI(ret_value); } /* end H5P_get_driver_info() */ @@ -445,9 +445,9 @@ done: * * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list design to the new generic + * Changed the file access list design to the new generic * property list. - * + * *------------------------------------------------------------------------- */ void * @@ -463,7 +463,7 @@ H5Pget_driver_info(hid_t plist_id) if((ret_value=H5P_get_driver_info(plist))==NULL) HGOTO_ERROR(H5E_PLIST,H5E_CANTGET,NULL,"can't get driver info"); - + done: FUNC_LEAVE_API(ret_value); } /* end H5Pget_driver_info() */ @@ -471,20 +471,20 @@ done: /*------------------------------------------------------------------------- * Function: H5Pset_family_offset - * + * * Purpose: Set offset for family driver. This file access property * list will be passed to H5Fget_vfd_handle or H5FDget_vfd_handle * to retrieve VFD file handle. - * - * Return: Success: Non-negative value. - * - * Failure: Negative value. - * - * Programmer: Raymond Lu - * Sep 17, 2002 - * + * + * Return: Success: Non-negative value. + * + * Failure: Negative value. + * + * Programmer: Raymond Lu + * Sep 17, 2002 + * * Modifications: - * + * *------------------------------------------------------------------------- */ herr_t @@ -504,7 +504,7 @@ H5Pset_family_offset(hid_t fapl_id, hsize_t offset) /* Set values */ if((ret_value=H5P_set_family_offset(plist, offset)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set family offset"); - + done: FUNC_LEAVE_API(ret_value); } @@ -512,19 +512,19 @@ done: /*------------------------------------------------------------------------- * Function: H5P_set_family_offset - * - * Purpose: Set offset for family driver. Private function for + * + * Purpose: Set offset for family driver. Private function for * H5Pset_family_offset - * + * * Return: Success: Non-negative value. - * + * * Failure: Negative value. - * - * Programmer: Raymond Lu + * + * Programmer: Raymond Lu * Sep 17, 2002 - * + * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -544,24 +544,24 @@ H5P_set_family_offset(H5P_genplist_t *plist, hsize_t offset) done: FUNC_LEAVE_NOAPI(ret_value); } - + /*------------------------------------------------------------------------- * Function: H5Pget_family_offset - * + * * Purpose: Get offset for family driver. This file access property * list will be passed to H5Fget_vfd_handle or H5FDget_vfd_handle * to retrieve VFD file handle. - * + * * Return: Success: Non-negative value. - * + * * Failure: Negative value. - * - * Programmer: Raymond Lu - * Sep 17, 2002 - * + * + * Programmer: Raymond Lu + * Sep 17, 2002 + * * Modifications: - * + * *------------------------------------------------------------------------- */ herr_t @@ -569,10 +569,10 @@ H5Pget_family_offset(hid_t fapl_id, hsize_t *offset) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pget_family_offset, FAIL); H5TRACE2("e","i*h",fapl_id,offset); - + /* Get the plist structure */ if(H5P_DEFAULT == fapl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list"); @@ -581,64 +581,64 @@ H5Pget_family_offset(hid_t fapl_id, hsize_t *offset) /* Set values */ if((ret_value=H5P_get_family_offset(plist, offset)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't get family offset"); - -done: + +done: FUNC_LEAVE_API(ret_value); -} +} /*------------------------------------------------------------------------- * Function: H5P_get_family_offset - * + * * Purpose: Get offset for family driver. Private function for * H5Pget_family_offset - * + * * Return: Success: Non-negative value. - * + * * Failure: Negative value. - * - * Programmer: Raymond Lu - * Sep 17, 2002 - * + * + * Programmer: Raymond Lu + * Sep 17, 2002 + * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t H5P_get_family_offset(H5P_genplist_t *plist, hsize_t *offset) { herr_t ret_value=SUCCEED; - + FUNC_ENTER_NOAPI(H5P_get_family_offset, FAIL); - + if( TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS) ) { if(H5P_get(plist, H5F_ACS_FAMILY_OFFSET_NAME, offset) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL,"can't set offset for family file"); - } else { + } else { HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access or data transfer property list"); - } - + } + done: FUNC_LEAVE_NOAPI(ret_value); } - + /*------------------------------------------------------------------------- * Function: H5Pset_multi_type - * + * * Purpose: Set data type for multi driver. This file access property * list will be passed to H5Fget_vfd_handle or H5FDget_vfd_handle * to retrieve VFD file handle. - * + * * Return: Success: Non-negative value. - * + * * Failure: Negative value. - * - * Programmer: Raymond Lu + * + * Programmer: Raymond Lu * Sep 17, 2002 - * + * * Modifications: - * + * *------------------------------------------------------------------------- */ herr_t @@ -658,7 +658,7 @@ H5Pset_multi_type(hid_t fapl_id, H5FD_mem_t type) /* Set values */ if((ret_value=H5P_set_multi_type(plist, type)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set data type for multi driver"); - + done: FUNC_LEAVE_API(ret_value); } @@ -666,19 +666,19 @@ done: /*------------------------------------------------------------------------- * Function: H5P_set_multi_type - * + * * Purpose: Set data type for multi file driver. Private function for * H5Pset_multi_type. - * + * * Return: Success: Non-negative value. - * + * * Failure: Negative value. - * - * Programmer: Raymond Lu + * + * Programmer: Raymond Lu * Sep 17, 2002 - * + * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -697,25 +697,25 @@ H5P_set_multi_type(H5P_genplist_t *plist, H5FD_mem_t type) done: FUNC_LEAVE_NOAPI(ret_value); -} +} /*------------------------------------------------------------------------- * Function: H5Pget_multi_type - * + * * Purpose: Get data type for multi driver. This file access property * list will be passed to H5Fget_vfd_handle or H5FDget_vfd_handle * to retrieve VFD file handle. - * + * * Return: Success: Non-negative value. - * + * * Failure: Negative value. - * - * Programmer: Raymond Lu - * Sep 17, 2002 - * + * + * Programmer: Raymond Lu + * Sep 17, 2002 + * * Modifications: - * + * *------------------------------------------------------------------------- */ herr_t @@ -723,10 +723,10 @@ H5Pget_multi_type(hid_t fapl_id, H5FD_mem_t *type) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pget_multi_type, FAIL); H5TRACE2("e","i*Mt",fapl_id,type); - + /* Get the plist structure */ if(H5P_DEFAULT == fapl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list"); @@ -735,46 +735,46 @@ H5Pget_multi_type(hid_t fapl_id, H5FD_mem_t *type) /* Set values */ if((ret_value=H5P_get_multi_type(plist, type)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't get data type for multi driver"); - -done: - FUNC_LEAVE_API(ret_value); -} + +done: + FUNC_LEAVE_API(ret_value); +} /*------------------------------------------------------------------------- * Function: H5P_get_multi_type - * + * * Purpose: Get data type for multi file driver. Private function for * H5Pget_multi_type. - * + * * Return: Success: Non-negative value. - * + * * Failure: Negative value. - * - * Programmer: Raymond Lu - * Sep 17, 2002 - * + * + * Programmer: Raymond Lu + * Sep 17, 2002 + * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t H5P_get_multi_type(H5P_genplist_t *plist, H5FD_mem_t *type) { herr_t ret_value=SUCCEED; - + FUNC_ENTER_NOAPI(H5P_get_multi_type, FAIL); - + if( TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS) ) { - if(H5P_get(plist, H5F_ACS_MULTI_TYPE_NAME, type) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL,"can't get type for multi driver"); - } else { - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); - } - + if(H5P_get(plist, H5F_ACS_MULTI_TYPE_NAME, type) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL,"can't get type for multi driver"); + } else { + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); + } + done: FUNC_LEAVE_NOAPI(ret_value); -} +} /*------------------------------------------------------------------------- @@ -799,7 +799,7 @@ done: * * Modifications: * - * Raymond Lu + * Raymond Lu * Tuesday, Oct 23, 2001 * Changed the file access list to the new generic property list. * @@ -807,7 +807,7 @@ done: * Thurs. 3/17/05 * The mdc_nelmts entry is no more in the FAPL, so I modified * the code to ignore it. - * + * *------------------------------------------------------------------------- */ herr_t @@ -816,7 +816,7 @@ H5Pset_cache(hid_t plist_id, int UNUSED mdc_nelmts, { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_cache, FAIL); H5TRACE5("e","iIszzd",plist_id,mdc_nelmts,rdcc_nelmts,rdcc_nbytes,rdcc_w0); @@ -859,14 +859,14 @@ done: * * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. * * J Mainzer * Thurs, 3/17/05 * The mdc_nelmts fapl entry is no more, so we now just * return a constant when that value is requested. - * + * *------------------------------------------------------------------------- */ herr_t @@ -875,7 +875,7 @@ H5Pget_cache(hid_t plist_id, int *mdc_nelmts, { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pget_cache, FAIL); H5TRACE5("e","i*Is*z*z*d",plist_id,mdc_nelmts,rdcc_nelmts,rdcc_nbytes, rdcc_w0); @@ -908,7 +908,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Pset_mdc_config * - * Purpose: Set the initial metadata cache resize configuration in the + * Purpose: Set the initial metadata cache resize configuration in the * target FAPL. * * Return: Non-negative on success/Negative on failure @@ -919,16 +919,16 @@ done: * Modifications: * * Done. - * + * *------------------------------------------------------------------------- */ herr_t -H5Pset_mdc_config(hid_t plist_id, +H5Pset_mdc_config(hid_t plist_id, H5AC_cache_config_t *config_ptr) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_mdc_config, FAIL); H5TRACE2("e","ix",plist_id,config_ptr); @@ -947,7 +947,7 @@ H5Pset_mdc_config(hid_t plist_id, /* set the modified config */ - /* If we ever support multiple versions of H5AC_cache_config_t, we + /* If we ever support multiple versions of H5AC_cache_config_t, we * will have to test the version and do translation here. */ @@ -956,7 +956,7 @@ H5Pset_mdc_config(hid_t plist_id, HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, \ "can't set metadata cache initial config"); } - + done: FUNC_LEAVE_API(ret_value); @@ -982,17 +982,17 @@ done: * Modifications: * * None. - * + * *------------------------------------------------------------------------- */ herr_t -H5Pget_mdc_config(hid_t plist_id, +H5Pget_mdc_config(hid_t plist_id, H5AC_cache_config_t *config_ptr) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pget_mdc_config, FAIL); H5TRACE2("e","ix",plist_id,config_ptr); @@ -1056,11 +1056,11 @@ done: * * Modifications: * - * Raymond Lu + * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. - * + * *------------------------------------------------------------------------- */ herr_t @@ -1100,9 +1100,9 @@ done: * * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. - * + * *------------------------------------------------------------------------- */ herr_t @@ -1135,8 +1135,8 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: Raymond Lu - * November, 2001 + * Programmer: Raymond Lu + * November, 2001 * * Modifications: * @@ -1167,12 +1167,12 @@ done: /*------------------------------------------------------------------------- * Function: H5Pget_fclose_degree * - * Purpose: Returns the degree for the file close behavior. + * Purpose: Returns the degree for the file close behavior. * * Return: Non-negative on success/Negative on failure * - * Programmer: Raymond Lu - * November, 2001 + * Programmer: Raymond Lu + * November, 2001 * * Modifications: * @@ -1189,12 +1189,12 @@ herr_t H5Pget_fclose_degree(hid_t plist_id, H5F_close_degree_t *degree) if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); - if( degree && (H5P_get(plist, H5F_CLOSE_DEGREE_NAME, degree) < 0) ) + if( degree && (H5P_get(plist, H5F_CLOSE_DEGREE_NAME, degree) < 0) ) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file close degree"); done: FUNC_LEAVE_API(ret_value); -} +} /*------------------------------------------------------------------------- @@ -1205,7 +1205,7 @@ done: * Each "raw" metadata block is allocated to be this size and then * specific pieces of metadata (object headers, local heaps, B-trees, etc) * are sub-allocated from this block. - * + * * The default value is set to 2048 (bytes), indicating that metadata * will be attempted to be bunched together in (at least) 2K blocks in * the file. Setting the value to 0 with this API function will @@ -1221,8 +1221,8 @@ done: * * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -1261,9 +1261,9 @@ done: * * Modifications: * - * Raymond Lu + * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. * *------------------------------------------------------------------------- @@ -1301,7 +1301,7 @@ done: * buffer which is large anough to hold several pieces of the dataset * being read in for hyperslab selections boosts performance by quite a * bit. - * + * * The default value is set to 64KB, indicating that file I/O for raw data * reads and writes will occur in at least 64KB blocks. * Setting the value to 0 with this API function will turn off the @@ -1314,9 +1314,9 @@ done: * * Modifications: * - * Raymond Lu + * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. * *------------------------------------------------------------------------- @@ -1326,7 +1326,7 @@ H5Pset_sieve_buf_size(hid_t plist_id, size_t size) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_sieve_buf_size, FAIL); H5TRACE2("e","iz",plist_id,size); @@ -1356,9 +1356,9 @@ done: * * Modifications: * - * Raymond Lu + * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. * *------------------------------------------------------------------------- @@ -1394,7 +1394,7 @@ done: * Each "small" raw data block is allocated to be this size and then * pieces of raw data which are small enough to fit are sub-allocated from * this block. - * + * * The default value is set to 2048 (bytes), indicating that raw data * smaller than this value will be attempted to be bunched together in (at * least) 2K blocks in the file. Setting the value to 0 with this API diff --git a/src/H5Pfcpl.c b/src/H5Pfcpl.c index 04f5d1d..48ae10d 100644 --- a/src/H5Pfcpl.c +++ b/src/H5Pfcpl.c @@ -53,7 +53,7 @@ * * Raymond Lu, Oct 14, 2001 * Change to the new generic property list. - * + * *------------------------------------------------------------------------- */ herr_t @@ -104,7 +104,7 @@ done: * * Raymond Lu, Oct 14, 2001 * Changed to the new generic property list. - * + * *------------------------------------------------------------------------- */ herr_t @@ -157,7 +157,7 @@ done: * * Raymond Lu, Oct 14, 2001 * Changed to the new generic property list. - * + * *------------------------------------------------------------------------- */ herr_t @@ -308,7 +308,7 @@ done: * Modifications: * * Raymond Lu, Oct 14, 2001 - * Changed to the new generic property list. + * Changed to the new generic property list. * *------------------------------------------------------------------------- */ @@ -325,7 +325,7 @@ H5Pset_sym_k(hid_t plist_id, unsigned ik, unsigned lk) /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); - + /* Set values */ if (ik > 0) { if(H5P_get(plist, H5F_CRT_BTREE_RANK_NAME, btree_k) < 0) @@ -360,7 +360,7 @@ done: * * Raymond Lu * Changed to the new generic property list. - * + * *------------------------------------------------------------------------- */ herr_t @@ -408,7 +408,7 @@ done: * * Raymond Lu, Oct 14, 2001 * Changed to the new generic property list. - * + * *------------------------------------------------------------------------- */ herr_t @@ -459,7 +459,7 @@ done: * * Raymond Lu, Oct 14, 2001 * Changed to the new generic property list. - * + * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c index e0f7da7..14a477d 100755 --- a/src/H5Pocpl.c +++ b/src/H5Pocpl.c @@ -26,15 +26,15 @@ /*------------------------------------------------------------------------- - * Function: H5Pset_create_intermediate_group + * Function: H5Pset_create_intermediate_group * * Purpose: set crt_intmd_group so that H5Gcreate(), H5Dcreate, etc. * will create missing groups along the given path "name" * * Return: Non-negative on success/Negative on failure * - * Programmer: Peter Cao - * May 08, 2005 + * Programmer: Peter Cao + * May 08, 2005 *------------------------------------------------------------------------- */ herr_t @@ -60,15 +60,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_create_intermediate_group + * Function: H5Pget_create_intermediate_group * - * Purpose: Returns the crt_intmd_group, which is set at H5Gcreate(hid_t loc_id, + * Purpose: Returns the crt_intmd_group, which is set at H5Gcreate(hid_t loc_id, * const char* name, ... ) for create missing groups * * Return: Non-negative on success/Negative on failure * - * Programmer: Peter Cao - * May 08, 2005 + * Programmer: Peter Cao + * May 08, 2005 *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Pprivate.h b/src/H5Pprivate.h index 0d09b96..12b3e93 100644 --- a/src/H5Pprivate.h +++ b/src/H5Pprivate.h @@ -40,7 +40,7 @@ H5_DLL herr_t H5P_get(H5P_genplist_t *plist, const char *name, void *value); H5_DLL herr_t H5P_set(H5P_genplist_t *plist, const char *name, const void *value); H5_DLL herr_t H5P_insert(H5P_genplist_t *plist, const char *name, size_t size, void *value, H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, - H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, + H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, H5P_prp_compare_func_t prp_cmp, H5P_prp_close_func_t prp_close); H5_DLL herr_t H5P_remove(hid_t plist_id, H5P_genplist_t *plist, const char *name); H5_DLL htri_t H5P_exist_plist(H5P_genplist_t *plist, const char *name); diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 49d8288..0a37721 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -47,7 +47,7 @@ extern "C" { /* Define property list class callback function pointer types */ typedef herr_t (*H5P_cls_create_func_t)(hid_t prop_id, void *create_data); -typedef herr_t (*H5P_cls_copy_func_t)(hid_t new_prop_id, hid_t old_prop_id, +typedef herr_t (*H5P_cls_copy_func_t)(hid_t new_prop_id, hid_t old_prop_id, void *copy_data); typedef herr_t (*H5P_cls_close_func_t)(hid_t prop_id, void *close_data); @@ -63,7 +63,7 @@ typedef int (*H5P_prp_compare_func_t)(const void *value1, const void *value2, si typedef H5P_prp_cb1_t H5P_prp_close_func_t; /* Define property list iteration function type */ -typedef herr_t (*H5P_iterate_t)(hid_t id, const char *name, void *iter_data); +typedef herr_t (*H5P_iterate_t)(hid_t id, const char *name, void *iter_data); /* * The library created property list classes @@ -134,7 +134,7 @@ H5_DLLVAR hid_t H5P_LST_DATATYPE_CREATE_g; H5_DLLVAR hid_t H5P_LST_DATATYPE_ACCESS_g; /* Public functions */ -H5_DLL hid_t H5Pcreate_class(hid_t parent, const char *name, +H5_DLL hid_t H5Pcreate_class(hid_t parent, const char *name, H5P_cls_create_func_t cls_create, void *create_data, H5P_cls_copy_func_t cls_copy, void *copy_data, H5P_cls_close_func_t cls_close, void *close_data); @@ -144,7 +144,7 @@ H5_DLL hid_t H5Pcreate(hid_t cls_id); H5_DLL herr_t H5Pregister(hid_t cls_id, const char *name, size_t size, void *def_value, H5P_prp_create_func_t prp_create, H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, - H5P_prp_delete_func_t prp_del, + H5P_prp_delete_func_t prp_del, H5P_prp_copy_func_t prp_copy, H5P_prp_close_func_t prp_close); H5_DLL herr_t H5Pinsert(hid_t plist_id, const char *name, size_t size, @@ -156,7 +156,7 @@ H5_DLL herr_t H5Pinsert(hid_t plist_id, const char *name, size_t size, H5_DLL herr_t H5Pregister(hid_t cls_id, const char *name, size_t size, void *def_value, H5P_prp_create_func_t prp_create, H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, - H5P_prp_delete_func_t prp_del, + H5P_prp_delete_func_t prp_del, H5P_prp_copy_func_t prp_copy, H5P_prp_compare_func_t prp_cmp, H5P_prp_close_func_t prp_close); @@ -272,10 +272,10 @@ H5_DLL herr_t H5Pset_scaleoffset(hid_t plist_id, int scale_factor, unsigned scal H5_DLL herr_t H5Pset_fletcher32(hid_t plist_id); H5_DLL herr_t H5Pset_edc_check(hid_t plist_id, H5Z_EDC_t check); H5_DLL H5Z_EDC_t H5Pget_edc_check(hid_t plist_id); -H5_DLL herr_t H5Pset_filter_callback(hid_t plist_id, H5Z_filter_func_t func, +H5_DLL herr_t H5Pset_filter_callback(hid_t plist_id, H5Z_filter_func_t func, void* op_data); H5_DLL herr_t H5Pset_cache(hid_t plist_id, int mdc_nelmts, - size_t rdcc_nelmts, size_t rdcc_nbytes, + size_t rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0); H5_DLL herr_t H5Pget_cache(hid_t plist_id, int *mdc_nelmts, /* out */ @@ -295,12 +295,12 @@ H5_DLL herr_t H5Pset_fill_value(hid_t plist_id, hid_t type_id, H5_DLL herr_t H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/); H5_DLL herr_t H5Pfill_value_defined(hid_t plist, H5D_fill_value_t *status); -H5_DLL herr_t H5Pset_alloc_time(hid_t plist_id, H5D_alloc_time_t +H5_DLL herr_t H5Pset_alloc_time(hid_t plist_id, H5D_alloc_time_t alloc_time); -H5_DLL herr_t H5Pget_alloc_time(hid_t plist_id, H5D_alloc_time_t +H5_DLL herr_t H5Pget_alloc_time(hid_t plist_id, H5D_alloc_time_t *alloc_time/*out*/); H5_DLL herr_t H5Pset_fill_time(hid_t plist_id, H5D_fill_time_t fill_time); -H5_DLL herr_t H5Pget_fill_time(hid_t plist_id, H5D_fill_time_t +H5_DLL herr_t H5Pget_fill_time(hid_t plist_id, H5D_fill_time_t *fill_time/*out*/); H5_DLL herr_t H5Pset_gc_references(hid_t fapl_id, unsigned gc_ref); H5_DLL herr_t H5Pget_gc_references(hid_t fapl_id, unsigned *gc_ref/*out*/); diff --git a/src/H5R.c b/src/H5R.c index 87a402c..c20e21e 100644 --- a/src/H5R.c +++ b/src/H5R.c @@ -43,7 +43,7 @@ NAME H5R_init_interface -- Initialize interface-specific information USAGE herr_t H5R_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -90,7 +90,7 @@ H5R_term_interface(void) int n=0; FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5R_term_interface); - + if (H5_interface_initialize_g) { if ((n=H5I_nmembers(H5I_REFERENCE))) { H5I_clear_type(H5I_REFERENCE, FALSE); @@ -100,7 +100,7 @@ H5R_term_interface(void) n = 1; /*H5I*/ } } - + FUNC_LEAVE_NOAPI(n); } @@ -119,7 +119,7 @@ H5R_term_interface(void) H5R_type_t ref_type; IN: Type of reference to create H5S_t *space; IN: Dataspace ID with selection, used for Dataset Region references. - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -177,7 +177,7 @@ H5R_create(void *_ref, H5G_entry_t *loc, const char *name, H5R_type_t ref_type, heapid_found=1; break; } /* end if */ - + if(heapid_found!=0) { /* Return heap block to free list */ } /* end if */ @@ -250,7 +250,7 @@ done: H5R_type_t ref_type; IN: Type of reference to create hid_t space_id; IN: Dataspace ID with selection, used for Dataset Region references. - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -306,7 +306,7 @@ done: H5F_t *file; IN: File the object being dereferenced is within H5R_type_t ref_type; IN: Type of reference void *ref; IN: Reference to open. - + RETURNS Valid ID on success, Negative on failure DESCRIPTION @@ -444,7 +444,7 @@ done: object that the dataset is located within. H5R_type_t ref_type; IN: Type of reference to create void *ref; IN: Reference to open. - + RETURNS Valid ID on success, Negative on failure DESCRIPTION @@ -495,7 +495,7 @@ done: H5F_t *file; IN: File the object being dereferenced is within H5R_type_t ref_type; UNUSED void *ref; IN: Reference to open. - + RETURNS Pointer to the dataspace on success, NULL on failure DESCRIPTION @@ -568,7 +568,7 @@ done: object that the dataset is located within. H5R_type_t ref_type; IN: Type of reference to get region of void *ref; IN: Reference to open. - + RETURNS Valid ID on success, Negative on failure DESCRIPTION @@ -625,7 +625,7 @@ done: H5F_t *file; IN: File the object being dereferenced is within H5R_type_t ref_type; IN: Type of reference to query void *ref; IN: Reference to query. - + RETURNS Success: An object type defined in H5Gpublic.h Failure: H5G_UNKNOWN @@ -721,7 +721,7 @@ done: object that the dataset is located within. H5R_type_t ref_type; IN: Type of reference to query void *ref; IN: Reference to query. - + RETURNS Success: An object type defined in H5Gpublic.h Failure: H5G_UNKNOWN @@ -757,7 +757,7 @@ H5Rget_obj_type(hid_t id, H5R_type_t ref_type, void *_ref) /* Get the object information */ if ((ret_value=H5R_get_obj_type(file,H5AC_ind_dxpl_id,ref_type,_ref))<0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, H5G_UNKNOWN, "unable to determine object type"); - + done: FUNC_LEAVE_API(ret_value); } /* end H5Rget_obj_type() */ diff --git a/src/H5S.c b/src/H5S.c index ef7f53c..db535f6 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -72,7 +72,7 @@ NAME H5S_init_interface -- Initialize interface-specific information USAGE herr_t H5S_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -182,8 +182,8 @@ H5S_term_interface(void) "%10s\n", "gather", path->stats[j].gath_nbytes, path->stats[j].gath_ncalls, - path->stats[j].gath_timer.utime, - path->stats[j].gath_timer.stime, + path->stats[j].gath_timer.utime, + path->stats[j].gath_timer.stime, path->stats[j].gath_timer.etime, buf); } @@ -198,8 +198,8 @@ H5S_term_interface(void) "%10s\n", "scatter", path->stats[j].scat_nbytes, path->stats[j].scat_ncalls, - path->stats[j].scat_timer.utime, - path->stats[j].scat_timer.stime, + path->stats[j].scat_timer.utime, + path->stats[j].scat_timer.stime, path->stats[j].scat_timer.etime, buf); } @@ -214,8 +214,8 @@ H5S_term_interface(void) "%10s\n", "background", path->stats[j].bkg_nbytes, path->stats[j].bkg_ncalls, - path->stats[j].bkg_timer.utime, - path->stats[j].bkg_timer.stime, + path->stats[j].bkg_timer.utime, + path->stats[j].bkg_timer.stime, path->stats[j].bkg_timer.etime, buf); } @@ -235,7 +235,7 @@ H5S_term_interface(void) path->stats[j].read_timer.etime, buf); } - + /* Write */ if (path->stats[j].write_ncalls) { H5_bandwidth(buf, @@ -272,7 +272,7 @@ H5S_term_interface(void) n = 1; /*H5I*/ } } - + FUNC_LEAVE_NOAPI(n); } @@ -514,7 +514,7 @@ H5Scopy(hid_t space_id) H5S_t *src = NULL; H5S_t *dst = NULL; hid_t ret_value; - + FUNC_ENTER_API(H5Scopy, FAIL); H5TRACE1("i","i",space_id); @@ -560,7 +560,7 @@ H5Sextent_copy(hid_t dst_id,hid_t src_id) H5S_t *src = NULL; H5S_t *dst = NULL; hid_t ret_value = SUCCEED; - + FUNC_ENTER_API(H5Sextent_copy, FAIL); H5TRACE2("e","ii",dst_id,src_id); @@ -1097,7 +1097,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5S_append(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh, const H5S_t *ds, +H5S_append(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh, const H5S_t *ds, unsigned * oh_flags_ptr) { herr_t ret_value=SUCCEED; /* Return value */ @@ -1404,7 +1404,7 @@ done: * Purpose: Given two data spaces (MEM_SPACE and FILE_SPACE) this * function returns a pointer to the conversion path information, * creating a new conversion path entry if necessary. - * + * * Return: Success: Ptr to a conversion path entry * * Failure: NULL @@ -1427,7 +1427,7 @@ done: * statistics). * * John Mainzer, 8/30/04 - * Modified code to check with all other processes that have the + * Modified code to check with all other processes that have the * file open before OKing collective I/O. * *------------------------------------------------------------------------- @@ -1438,7 +1438,7 @@ H5S_find (const H5S_t *mem_space, const H5S_t *file_space) H5S_iostats_t *path=NULL; /* Space conversion path */ size_t u; /* Index variable */ H5S_iostats_t *ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5S_find, NULL); /* Check args */ @@ -1457,7 +1457,7 @@ H5S_find (const H5S_t *mem_space, const H5S_t *file_space) if (H5S_iostats_g[u]->ftype==H5S_GET_SELECT_TYPE(file_space) && H5S_iostats_g[u]->mtype==H5S_GET_SELECT_TYPE(mem_space)) HGOTO_DONE(H5S_iostats_g[u]); - + /* * The path wasn't found. Create a new path. */ @@ -1517,7 +1517,7 @@ H5S_extend (H5S_t *space, const hsize_t *size) { int ret_value=0; unsigned u; - + FUNC_ENTER_NOAPI(H5S_extend, FAIL); /* Check args */ @@ -1619,11 +1619,11 @@ H5Screate_simple(int rank, const hsize_t dims[/*rank*/], /* Create the space and set the extent */ if(NULL==(space=H5S_create_simple((unsigned)rank,dims,maxdims))) HGOTO_ERROR (H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace"); - + /* Atomize */ if ((ret_value=H5I_register (H5I_DATASPACE, space))<0) HGOTO_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID"); - + done: if (ret_value<0) { if (space!=NULL) @@ -1669,7 +1669,7 @@ H5S_create_simple(unsigned rank, const hsize_t dims[/*rank*/], HGOTO_ERROR (H5E_DATASPACE, H5E_CANTCREATE, NULL, "can't create simple dataspace"); if(H5S_set_extent_simple(ret_value,rank,dims,maxdims)<0) HGOTO_ERROR (H5E_DATASPACE, H5E_CANTINIT, NULL, "can't set dimensions"); - + done: FUNC_LEAVE_NOAPI(ret_value); } /* end H5S_create_simple() */ @@ -1698,7 +1698,7 @@ H5Sencode(hid_t obj_id, void *buf, size_t *nalloc) { H5S_t *dspace; herr_t ret_value=SUCCEED; - + FUNC_ENTER_API (H5Sencode, FAIL); H5TRACE3("e","ix*z",obj_id,buf,nalloc); @@ -1717,8 +1717,8 @@ done: /*------------------------------------------------------------------------- * Function: H5S_encode * - * Purpose: Private function for H5Sencode. Converts an object - * description for data space and its selection into binary + * Purpose: Private function for H5Sencode. Converts an object + * description for data space and its selection into binary * in a buffer. * * Return: Success: non-negative @@ -1762,7 +1762,7 @@ H5S_encode(H5S_t *obj, unsigned char *buf, size_t *nalloc) *nalloc = extent_size+select_size+1+1+1+4; HGOTO_DONE(ret_value); } - + /* Encode the type of the information */ *buf++ = H5O_SDSPACE_ID; @@ -1774,7 +1774,7 @@ H5S_encode(H5S_t *obj, unsigned char *buf, size_t *nalloc) /* Encode size of extent information. Pointer is actually moved in this macro. */ UINT32ENCODE(buf, extent_size); - + /* Encode the extent part of dataspace */ if(H5O_encode(&f, buf, obj, H5O_SDSPACE_ID)<0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTENCODE, FAIL, "can't encode extent space"); @@ -1795,7 +1795,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Sdecode * - * Purpose: Decode a binary object description of data space and + * Purpose: Decode a binary object description of data space and * return a new object handle. * * Return: Success: dataspace ID(non-negative) @@ -1815,7 +1815,7 @@ H5Sdecode(const void *buf) { H5S_t *ds; hid_t ret_value; - + FUNC_ENTER_API (H5Sdecode, FAIL); H5TRACE1("i","x",buf); @@ -1824,7 +1824,7 @@ H5Sdecode(const void *buf) if((ds = H5S_decode(buf))==NULL) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDECODE, FAIL, "can't decode object"); - + /* Register the type and return the ID */ if ((ret_value=H5I_register (H5I_DATASPACE, ds))<0) HGOTO_ERROR (H5E_DATASPACE, H5E_CANTREGISTER, FAIL, "unable to register dataspace"); @@ -1838,7 +1838,7 @@ done: * Function: H5S_decode * * Purpose: Private function for H5Sdecode. Reconstructs a binary - * description of dataspace and returns a new object handle. + * description of dataspace and returns a new object handle. * * Return: Success: dataspace ID(non-negative) * @@ -1882,7 +1882,7 @@ H5S_decode(const unsigned char *buf) /* Decode size of extent information */ UINT32DECODE(buf, extent_size); - + /* Decode the extent part of dataspace */ if((extent = H5O_decode(&f, buf, H5O_SDSPACE_ID))==NULL) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDECODE, NULL, "can't decode object"); @@ -1978,7 +1978,7 @@ H5S_get_simple_extent_type(const H5S_t *space) assert(space); ret_value=H5S_GET_EXTENT_TYPE(space); - + done: FUNC_LEAVE_NOAPI(ret_value); } @@ -2016,7 +2016,7 @@ H5Sget_simple_extent_type(hid_t sid) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5S_NO_CLASS, "not a dataspace"); ret_value=H5S_GET_EXTENT_TYPE(space); - + done: FUNC_LEAVE_API(ret_value); } @@ -2123,7 +2123,7 @@ H5S_set_extent( H5S_t *space, const hsize_t *size ) { unsigned u; herr_t ret_value=0; - + FUNC_ENTER_NOAPI( H5S_set_extent, FAIL ); /* Check args */ @@ -2200,7 +2200,7 @@ H5S_set_extent_real( H5S_t *space, const hsize_t *size ) hsize_t nelem; /* Number of elements in extent */ unsigned u; /* Local index variable */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5S_set_extent_real, FAIL ); /* Check args */ @@ -2243,9 +2243,9 @@ H5S_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, int indent, { const H5S_t *mesg = (co