1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
|
<html>
<head><title>
HDF5/H5 API Specification
</title></head>
<body bgcolor="#FFFFFF">
<hr>
<center>
<table border=0 width=98%>
<tr><td valign=top align=left>
<a href="H5.intro.html">Introduction to HDF5</a> <br>
<a href="H5.user.html">HDF5 User Guide</a> <br>
<a href="index.html">Other HDF5 documents and links</a> <br>
<!--
<a href="Glossary.html">Glossary</a><br>
-->
</td>
<td valign=top align=right>
And in this document, the
<a href="RM_H5Front.html">HDF5 Reference Manual</a>
<br>
H5
<a href="RM_H5A.html">H5A</a>
<a href="RM_H5D.html">H5D</a>
<a href="RM_H5E.html">H5E</a>
<a href="RM_H5F.html">H5F</a>
<a href="RM_H5G.html">H5G</a>
<a href="RM_H5I.html">H5I</a>
<a href="RM_H5P.html">H5P</a>
<br>
<a href="RM_H5R.html">H5R</a>
<a href="RM_H5S.html">H5S</a>
<a href="RM_H5T.html">H5T</a>
<a href="RM_H5Z.html">H5Z</a>
<a href="Tools.html">Tools</a>
<a href="PredefDTypes.html">Datatypes</a>
</td></tr>
</table>
</center>
<hr>
<center>
<h1>H5: General Library Functions</h1>
</center>
These functions serve general-purpose needs of the HDF5 library
and it users.
<p>
<strong>The C Interfaces:</strong>
<table border=0>
<tr><td valign=top>
<ul>
<li><a href="#Library-Open">H5open</a>
<li><a href="#Library-Close">H5close</a>
</ul>
</td><td> </td><td valign=top>
<ul>
<li><a href="#Library-Version">H5get_libversion</a>
<li><a href="#Library-VersCheck">H5check_version</a>
</ul>
</td><td> </td><td valign=top>
<ul>
<li><a href="#Library-GarbageCollect">H5garbage_collect</a>
<li><a href="#Library-DontAtExit">H5dont_atexit</a>
</ul>
</td></tr>
</table>
<p>
<strong>The FORTRAN90 Interfaces:</strong>
<br>
<font size=-1>
<i>In general, each FORTRAN90 subroutine performs exactly the same task
as the corresponding C function. The links below go to the C function
descriptions, which serve as general descriptions for both. A button,
under <strong>Non-C API(s)</strong> at the end of the C function description,
opens an external browser window displaying the FORTRAN90-specific
information. You will probably want to adjust the size and location of
this external window so that both browser windows are visible and to
facilitate moving easily between them.</i>
</font>
<table border=0>
<tr><td valign=top>
<ul>
<li><a href="#Library-Open">h5open_f</a>
</ul>
</td><td> </td><td valign=top>
<ul>
<li><a href="#Library-Close">h5close_f</a>
</ul>
</td><td> </td><td valign=top>
<ul>
</ul>
</td></tr>
</table>
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Library-Open">H5open</a>
<dt><strong>Signature:</strong>
<dd><em>herr_t</em> <code>H5open</code>(<em>void</em>)
<dt><strong>Purpose:</strong>
<dd>Initializes the HDF5 library.
<dt><strong>Description:</strong>
<dd><code>H5open</code> initialize the library. This function is
normally called automatically, but if you find that an
HDF5 library function is failing inexplicably, try calling
this function first.
<dt><strong>Parameters:</strong>
<dl>
<dt>None.
</dl>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
<dt><strong>Non-C API(s):</strong>
<dd><a href="fortran/h5_FORTRAN.html#h5open_f"
target="FortranWin"><img src="Graphics/FORTRAN.gif" border=0></a>
<!--
<img src="Graphics/Java.gif">
<img src="Graphics/C++.gif">
-->
</dl>
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Library-Close">H5close</a>
<dt><strong>Signature:</strong>
<dd><em>herr_t</em> <code>H5close</code>(<em>void</em>)
<dt><strong>Purpose:</strong>
<dd>Flushes all data to disk, closes file identifiers, and cleans up memory.
<dt><strong>Description:</strong>
<dd><code>H5close</code> flushes all data to disk,
closes all file identifiers, and cleans up all memory used by
the library. This function is generally called when the
application calls <code>exit</code>, but may be called earlier
in event of an emergency shutdown or out of desire to free all
resources used by the HDF5 library.
<dt><strong>Parameters:</strong>
<dl>
<dt>None.
</dl>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
<dt><strong>Non-C API(s):</strong>
<dd><a href="fortran/h5_FORTRAN.html#h5close_f"
target="FortranWin"><img src="Graphics/FORTRAN.gif" border=0></a>
<!--
<img src="Graphics/Java.gif">
<img src="Graphics/C++.gif">
-->
</dl>
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Library-GarbageCollect">H5garbage_collect</a>
<dt><strong>Signature:</strong>
<dd><em>herr_t</em> <code>H5garbage_collect</code>(<em>void</em>)
<dt><strong>Purpose:</strong>
<dd>Garbage collects on all free-lists of all types.
<dt><strong>Description:</strong>
<dd><code>H5garbage_collect</code> walks through all the garbage
collection routines of the library, freeing any unused memory.
<p>
It is not required that <code>H5garbage_collect</code> be called
at any particular time; it is only necessary in certain situations
where the application has performed actions that cause the library
to allocate many objects. The application should call
<code>H5garbage_collect</code> if it eventually releases those
objects and wants to reduce the memory used by the library from
the peak usage required.
<p>
The library automatically garbage collects all the free lists
when the application ends.
<dt><strong>Parameters:</strong>
<dl>
<dt>None.
</dl>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
<!--
<dt><strong>Non-C API(s):</strong>
<dd><a href="fortran/h5_FORTRAN.html#h5xxx_f"
target="FortranWin"><img src="Graphics/FORTRAN.gif" border=0></a>
-->
<!--
<img src="Graphics/Java.gif">
<img src="Graphics/C++.gif">
-->
</dl>
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Library-DontAtExit">H5dont_atexit</a>
<dt><strong>Signature:</strong>
<dd><em>herr_t</em> <code>H5dont_atexit</code>(<em>void</em>)
<dt><strong>Purpose:</strong>
<dd>Instructs library not to install <code>atexit</code> cleanup routine.
<dt><strong>Description:</strong>
<dd><code>H5dont_atexit</code> indicates to the library that an
<code>atexit()</code> cleanup routine should not be installed.
The major purpose for this is in situations where the
library is dynamically linked into an application and is
un-linked from the application before <code>exit()</code> gets
called. In those situations, a routine installed with
<code>atexit()</code> would jump to a routine which was
no longer in memory, causing errors.
<p>
In order to be effective, this routine <em>must</em> be called
before any other HDF function calls, and must be called each
time the library is loaded/linked into the application
(the first time and after it's been un-loaded).
<dt><strong>Parameters:</strong>
<dl>
<dt>None.
</dl>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
<!--
<dt><strong>Non-C API(s):</strong>
<dd><a href="fortran/h5_FORTRAN.html#h5xxx_f"
target="FortranWin"><img src="Graphics/FORTRAN.gif" border=0></a>
-->
<!--
<img src="Graphics/Java.gif">
<img src="Graphics/C++.gif">
-->
</dl>
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Library-Version">H5get_libversion</a>
<dt><strong>Signature:</strong>
<dd><em>herr_t</em> <code>H5get_libversion</code>(<em>unsigned *</em><code>majnum</code>,
<em>unsigned *</em><code>minnum</code>,
<em>unsigned *</em><code>relnum</code>
)
<dt><strong>Purpose:</strong>
<dd>Returns the HDF library release number.
<dt><strong>Description:</strong>
<dd><code>H5get_libversion</code> retrieves the major, minor, and release
numbers of the version of the HDF library which is linked to
the application.
<dt><strong>Parameters:</strong>
<dl>
<dt><em>unsigned *</em><code>majnum</code>
<dd>OUT: The major version of the library.
<dt><em>unsigned *</em><code>minnum</code>
<dd>OUT: The minor version of the library.
<dt><em>unsigned *</em><code>relnum</code>
<dd>OUT: The release number of the library.
</dl>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
<!--
<dt><strong>Non-C API(s):</strong>
<dd><a href="fortran/h5_FORTRAN.html#h5xxx_f"
target="FortranWin"><img src="Graphics/FORTRAN.gif" border=0></a>
-->
<!--
<img src="Graphics/Java.gif">
<img src="Graphics/C++.gif">
-->
</dl>
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Library-VersCheck">H5check_version</a>
<dt><strong>Signature:</strong>
<dd><em>herr_t</em> <code>H5check_version</code>(<em>unsigned</em> <code>majnum</code>,
<em>unsigned</em> <code>minnum</code>,
<em>unsigned</em> <code>relnum</code>
)
<dt><strong>Purpose:</strong>
<dd>Verifies that library versions are consistent.
<dt><strong>Description:</strong>
<dd><code>H5check_version</code> verifies that the arguments provided
with the function call match the version numbers compiled into
the library.
<p>
<code>H5check_version</code> serves two slightly differing purposes.
<p>
First, the function is intended to be called by the user to verify
that the version of the header files compiled into an application
matches the version of the HDF5 library being used.
One may look at the <code>H5check</code> definition in the file
<code>H5public.h</code> as an example.
<p>
Due to the risks of data corruption or segmentation faults,
<code>H5check_version</code> causes the application to abort if the
version numbers do not match.
The abort is achieved by means of a call to the
standard C function <code>abort()</code>.
<p>
Note that <code>H5check_version</code> verifies only the
major and minor version numbers and the release number;
it does not verify the sub-release value as that should be
an empty string for any official release.
This means that any two incompatible library versions must
have different {major,minor,release} numbers. (Notice the
reverse is not necessarily true.)
<p>
Secondarily, <code>H5check_version</code> verifies that the
library version identifiers <code>H5_VERS_MAJOR</code>,
<code>H5_VERS_MINOR</code>, <code>H5_VERS_RELEASE</code>,
<code>H5_VERS_SUBRELEASE</code>, and <code>H5_VERS_INFO</code>
are consistent.
This is designed to catch source code inconsistencies,
but does not generate the fatal error as in the first stage
because this inconsistency does not cause errors in the data files.
If this check reveals inconsistencies, the library issues a warning
but the function does not fail.
<!--
<p>
<strong><em>Alternate to preceding paragraph / More to the point?</em></strong>
<br>
If the function passes the above test and does not generate
an <code>abort()</code> call, the function's second purpose
comes into play.
<code>H5check_version</code> then procedes to verify
that the additional library version identifiers
<code>H5_VERS_SUBRELEASE</code>, and <code>H5_VERS_INFO</code>
are consistent.
This is designed to catch source code inconsistencies,
but does not generate the fatal error
that is generated under the first function.
<p>
The version and release numbers passed as
<code>H5check_version</code> parameters have the
following relationsips to each other:
<dir>
An official HDF5 release is labelled as
<br>
HDF5 Release <<code>majnum</code>><strong>.</strong><<code>minnum</code>><strong>.</strong><<code>relnum</code>>
</dir>
For example, in the version of the library known as HDF5 Release 1.4.2,
the 1 is the major version number, <code>majnum</code>;
the 1 is the minor version number, <code>minnum</code>; and
the 1 is the release number, <code>relnum</code>.
-->
<dt><strong>Parameters:</strong>
<dl>
<dt><em>unsigned </em><code>majnum</code>
<dd>IN: The major version of the library.
<dt><em>unsigned </em><code>minnum</code>
<dd>IN: The minor version of the library.
<dt><em>unsigned </em><code>relnum</code>
<dd>IN: The release number of the library.
</dl>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful.
Upon failure, this function causes the application to abort.
<!--
<dt><strong>Non-C API(s):</strong>
<dd><a href="fortran/h5_FORTRAN.html#h5xxx_f"
target="FortranWin"><img src="Graphics/FORTRAN.gif" border=0></a>
-->
<!--
<img src="Graphics/Java.gif">
<img src="Graphics/C++.gif">
-->
</dl>
<hr>
<center>
<table border=0 width=98%>
<tr><td valign=top align=left>
<a href="H5.intro.html">Introduction to HDF5</a> <br>
<a href="H5.user.html">HDF5 User Guide</a> <br>
<a href="index.html">Other HDF5 documents and links</a> <br>
<!--
<a href="Glossary.html">Glossary</a><br>
-->
</td>
<td valign=top align=right>
And in this document, the
<a href="RM_H5Front.html">HDF5 Reference Manual</a>
<br>
H5
<a href="RM_H5A.html">H5A</a>
<a href="RM_H5D.html">H5D</a>
<a href="RM_H5E.html">H5E</a>
<a href="RM_H5F.html">H5F</a>
<a href="RM_H5G.html">H5G</a>
<a href="RM_H5I.html">H5I</a>
<a href="RM_H5P.html">H5P</a>
<br>
<a href="RM_H5R.html">H5R</a>
<a href="RM_H5S.html">H5S</a>
<a href="RM_H5T.html">H5T</a>
<a href="RM_H5Z.html">H5Z</a>
<a href="Tools.html">Tools</a>
<a href="PredefDTypes.html">Datatypes</a>
</td></tr>
</table>
</center>
<hr>
<address>
<a href="mailto:hdfhelp@ncsa.uiuc.edu">HDF Help Desk</a>
<br>
Last modified: 2 August 2001
<br>
Describes HDF5 Release 1.5, Unreleased Development Branch
</body>
</html>
|