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
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
|
<html>
<head><title>
HDF5/H5I API Specification
</title>
<!-- #BeginLibraryItem "/ed_libs/styles_RM.lbi" -->
<!--
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-->
<link href="ed_styles/RMelect.css" rel="stylesheet" type="text/css">
<!-- #EndLibraryItem --></head>
<body bgcolor="#FFFFFF">
<!-- HEADER RIGHT " " -->
<!-- #BeginLibraryItem "/ed_libs/NavBar_RM.lbi" -->
<hr>
<center>
<table border=0 width=98%>
<tr><td valign=top align=left>
<a href="index.html">HDF5 documents and links</a> <br>
<a href="H5.intro.html">Introduction to HDF5</a> <br>
<a href="http://www.hdfgroup.org/HDF5/doc1.6/UG/UG_frame.html">HDF5 User Guide</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>
<a href="RM_H5.html">H5</a>
<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>
<tr><td colspan="2" align="right">
<i><small>(<a href="http://www.hdfgroup.org/HDF5/doc1.6/PSandPDF/">PDF</a>
of complete manual formatted as print volume) </small></i>
</td></tr>
</table>
</center>
<hr>
<!-- #EndLibraryItem --><center>
<h1>H5I: Identifier Interface</h1>
</center>
<h2>Identifier API Functions</h2>
These functions provides tools for working with object identifiers and
object names.
<p>
<strong>The C Interface:</strong>
<table border=0>
<tr><td valign=top>
<ul>
<li><a href="#Identify-GetName">H5Iget_name</a>
<li><a href="#Identify-GetType">H5Iget_type</a>
</ul>
</td><td> </td><td valign=top>
<ul>
<li><a href="#Identify-GetFileId">H5Iget_file_id</a>
<li><a href="#Identify-GetRef">H5Iget_ref</a>
</ul>
</td><td> </td><td valign=top>
<ul>
<li><a href="#Identify-IncRef">H5Iinc_ref</a>
<li><a href="#Identify-DecRef">H5Idec_ref</a>
</ul>
</td></tr>
</table>
<br>
<i>Alphabetical Listing</i>
<table border="0">
<tr>
<td valign="top">
<ul>
<li><a href="#Identify-DecRef">H5Idec_ref</a>
<li><a href="#Identify-GetFileId">H5Iget_file_id</a>
</ul>
</td>
<td> </td>
<td valign="top">
<ul>
<li><a href="#Identify-GetName">H5Iget_name</a>
<li><a href="#Identify-GetRef">H5Iget_ref</a>
</ul>
</td>
<td> </td>
<td valign="top">
<ul>
<li><a href="#Identify-GetType">H5Iget_type</a>
<li><a href="#Identify-IncRef">H5Iinc_ref</a>
</ul>
</td>
</tr>
</table>
<br>
<strong>The FORTRAN90 Interfaces:</strong>
<br>
In general, each FORTRAN90 subroutine performs exactly the same task
as the corresponding C function.
<br>
<table border=0>
<tr><td valign=top>
<ul>
<li><a href="#Identify-GetName">h5iget_name_f</a>
<li><a href="#Identify-GetType">h5iget_type_f</a>
</ul>
</td><td> </td><td valign=top>
<ul>
<li><a href="#Identify-GetFileId">H5Iget_file_id</a>
<li><a href="#Identify-GetRef">h5iget_ref_f</a>
</ul>
</td><td> </td><td valign=top>
<ul>
<li><a href="#Identify-IncRef">h5iinc_ref_f</a>
<li><a href="#Identify-DecRef">h5idec_ref_f</a>
</ul>
</td></tr>
</table>
<!-- NEW PAGE -->
<!-- HEADER RIGHT " " -->
<!-- NEW PAGE -->
<!-- HEADER RIGHT "H5Idec_ref" -->
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Identify-DecRef">H5Idec_ref</a>
<dt><strong>Signature:</strong>
<dd><em>int</em> <code>H5Idec_ref</code>(<em>hid_t</em> <code>obj_id</code>)
<dt><strong>Purpose:</strong>
<dd>Decrements the reference count for an object.
<dt><strong>Description:</strong>
<dd><code>H5Idec_ref</code> decrements the reference count of the object
identified by <code>obj_id</code>.
<p>
The reference count for an object ID is attached to the information
about an object in memory and has no relation to the number of links to
an object on disk.
<p>
The reference count for a newly created object will be 1.
Reference counts for objects may be explicitly modified with this
function or with <code>H5Iinc_ref</code>.
When an object ID's reference count reaches zero, the object will be
closed.
Calling an object ID's 'close' function decrements the reference count
for the ID which normally closes the object, but
if the reference count for the ID has been incremented with
<code>H5Iinc_ref</code>, the object will only be closed when the
reference count
reaches zero with further calls to this function or the
object ID's 'close' function.
<p>
If the object ID was created by a collective parallel call (such as
<code>H5Dcreate</code>, <code>H5Gopen</code>, etc.), the reference
count should be modified by all the processes which have copies of
the ID. Generally this means that group, dataset, attribute, file
and named datatype IDs should be modified by all the processes and
that all other types of IDs are safe to modify by individual processes.
<p>
This function is of particular value when an application is maintaining
multiple copies of an object ID. The object ID can be incremented when
a copy is made. Each copy of the ID can then be safely closed or
decremented and the HDF5 object will be closed when the reference count
for that that object drops to zero.
<dt><strong>Parameters:</strong>
<ul><table>
<tr>
<td valign="top"><em>hid_t</em> <code>obj_id </code></td>
<td valign="top">IN: Object identifier whose reference count will be modified.</td></tr>
</table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative reference count of the object ID after
decrementing it if successful; otherwise a negative value is returned.
<dt><strong>Fortran90 Interface:</strong> h5idec_ref_f
<dd>
<pre>
SUBROUTINE h5idec_ref_f(obj_id, ref_count, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: obj_id !Object identifier
INTEGER, INTENT(OUT) :: ref_count !Reference count of object ID
INTEGER, INTENT(OUT) :: hdferr ! Error code
! 0 on success, and -1 on failure
END SUBROUTINE h5idec_ref_f
</pre>
<!--<dt><strong>Non-C API(s):</strong>
<dd>
<img src="Graphics/Java.gif">
<img src="Graphics/C++.gif">
-->
<dt><strong>History:</strong>
<ul><table width="90%">
<tr>
<td valign="top" align="left" width="10%">
<strong>Release</strong> </td>
<td valign="top" align="left">
<strong>C</strong></td>
<td valign="top" align="left">
</td>
<td valign="top" align="left">
<strong>Fortran90</strong></td></tr>
<tr>
<td valign="top">1.6.2</td>
<td valign="top">
Function introduced in this release.</td>
<td valign="top"> </td>
<td valign="top">
Fortran subroutine introduced in this
release.</td></tr>
</table></ul>
</dl>
<!-- NEW PAGE -->
<!-- HEADER RIGHT "H5Iget_file_id" -->
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Identify-GetFileId">H5Iget_file_id</a>
<dt><strong>Signature:</strong>
<dd><em>hid_t</em> <code>H5Iget_file_id</code>(<em>hid_t</em> <code>obj_id</code>)
<dt><strong>Purpose:</strong>
<dd>Retrieves an identifier for the file containing the specified object.
<dt><strong>Description:</strong>
<dd><code>H5Iget_file_id</code> returns the identifier of the file
associated with the object referenced by <code>obj_id</code>.
<p>
<code>obj_id</code> can be a file, group, dataset, named datatype,
or attribute identifier.
<p>
Note that the HDF5 Library permits an application to close a file
while objects within the file remain open.
If the file containing the object <code>obj_id</code>
is still open, <code>H5Iget_file_id</code> will retrieve the
existing file identifier.
If there is no existing file identifier for the file,
i.e., the file has been closed,
<code>H5Iget_file_id</code> will reopen the file and
return a new file identifier.
In either case, the file identifier must eventually be released
using <code>H5Fclose</code>.
<dt><strong>Parameters:</strong>
<ul>
<table>
<tr>
<td valign="top"><em>hid_t</em> <code>obj_id </code></td>
<td valign="top">IN: Identifier of the object whose associated
file identifier will be returned.</td>
</tr>
</table>
</ul>
<dt><strong>Returns:</strong>
<dd>Returns a file identifier on success, negative on failure.
<dt><strong>Fortran90 Interface:</strong>
<dd>
<pre>
SUBROUTINE h5iget_file_id_f(obj_id, file_id, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier
INTEGER(HID_T), INTENT(OUT) :: file_id ! File identifier
INTEGER, INTENT(OUT) :: hdferr ! Error code
END SUBROUTINE h5iget_file_id_f
</pre>
<!--<dt><strong>Non-C API(s):</strong>
<dd>
<img src="Graphics/Java.gif">
<img src="Graphics/C++.gif">
-->
<dt><strong>History:</strong>
<ul><table width="90%">
<tr>
<td valign="top" align="left" width="10%">
<strong>Release</strong> </td>
<td valign="top" align="left">
<strong>C</strong></td>
<td valign="top" align="left">
</td>
<td valign="top" align="left">
<strong>Fortran90</strong></td></tr>
<tr>
<td valign="top">1.6.3</td>
<td valign="top">
Function introduced in this release.</td>
<td valign="top"> </td>
<td valign="top">
Fortran subroutine introduced in this
release.</td></tr>
</table></ul>
</dl>
<!-- NEW PAGE -->
<!-- HEADER RIGHT "H5Iget_name" -->
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Identify-GetName">H5Iget_name</a>
<dt><strong>Signature:</strong>
<dd><em>ssize_t</em> <code>H5Iget_name</code>(
<em>hid_t</em> <code>obj_id</code>,
<em>char *</em><code>name</code>,
<em>size_t</em> <code>size</code>
)
<dt><strong>Purpose:</strong> </dt>
<dd>Retrieves a name of an object based on the object identifier.
<dt><strong>Description:</strong>
<dd><code>H5Iget_name</code> retrieves a name for the object identified
by <code>obj_id</code>.
<p>
Up to <code>size</code> characters of the name are returned in
<code>name</code>; additional characters, if any, are not returned
to the user application.
<p>
If the length of the name, which determines the required
value of <code>size</code>, is unknown, a preliminary
<code>H5Iget_name</code> call can be made.
The return value of this call will be the size of the
object name.
That value can then be assigned to <code>size</code>
for a second <code>H5Iget_name</code> call,
which will retrieve the actual name.
<p>
If the object identified by <code>obj_id</code> is an attribute,
as determined via
<a href="#Identify-GetType"><code>H5Iget_type</code></a>,
<code>H5Iget_name</code> retrieves the name of the object
to which that attribute is attached.
To retrieve the name of the attribute itself, use
<a href="RM_H5A.html#Annot-GetName"><code>H5Aget_name</code></a>.
<p>
If there is no name associated with the object identifier
or if the name is <code>NULL</code>, <code>H5Iget_name</code>
returns <code>0</code> (zero).
<p>
<code>H5Iget_name</code> cannot be used with an object identifier
returned by <code>H5Rdereference</code>;
the function will not be able to determine a valid object name.
<p>
Note that an object in an HDF5 file may have multiple names,
varying according to the path through the HDF5 group
hierarchy used to reach that object.
<dt><strong>Parameters:</strong>
<ul><table>
<tr>
<td valign="top"><em>hid_t</em> <code>obj_id </code></td>
<td valign="top">IN: Identifier of the object.
This identifier can refer to a group, dataset,
or named datatype.</td></tr>
<tr>
<td valign="top"><em>char *</em><code>name</code></td>
<td valign="top">OUT: A name associated with the identifier.</td></tr>
<tr>
<td valign="top"><em>size_t</em> <code>size</code></td>
<td valign="top">IN: The size of the <code>name</code> buffer.</td></tr>
</table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the length of the name if successful, returning <code>0</code>
(zero) if no name is associated with the identifier.
Otherwise returns a negative value.
<dt><strong>Fortran90 Interface:</strong> h5iget_name_f
<dd>
<pre>
SUBROUTINE h5iget_name_f(obj_id, buf, buf_size, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier
CHARACTER(LEN=*), INTENT(OUT) :: buf ! Buffer to hold object name
INTEGER(SIZE_T), INTENT(IN) :: buf_size ! Buffer size
INTEGER(SIZE_T), INTENT(OUT) :: name_size ! Name size
INTEGER, INTENT(OUT) :: hdferr ! Error code
! 0 on success, and -1 on failure
END SUBROUTINE h5iget_name_f
</pre>
<!--<dt><strong>Non-C API(s):</strong>
<dd>
<img src="Graphics/Java.gif">
<img src="Graphics/C++.gif">
-->
<!-- NEW PAGE -->
<dt><strong>History:</strong>
<ul><table width="90%">
<tr>
<td valign="top" align="left" width="10%">
<strong>Release</strong> </td>
<td valign="top" align="left">
<strong>C</strong></td></tr>
<tr>
<td valign="top">1.6.0</td>
<td valign="top">
Function introduced in this release.</td></tr>
</table></ul>
</dl>
<!-- NEW PAGE -->
<!-- HEADER RIGHT "H5Iget_ref" -->
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Identify-GetRef">H5Iget_ref</a>
<dt><strong>Signature:</strong>
<dd><em>int</em> <code>H5Iget_ref</code>(<em>hid_t</em> <code>obj_id</code>)
<dt><strong>Purpose:</strong>
<dd>Retrieves the reference count for an object.
<dt><strong>Description:</strong>
<dd><code>H5Iget_ref</code> retrieves the reference count of the object
identified by <code>obj_id</code>.
<p>
The reference count for an object ID is attached to the information
about an object in memory and has no relation to the number of links to
an object on disk.
<p>
This function can also be used to check if an object ID is still valid.
A non-negative return value from this function indicates that the ID
is still valid.
<dt><strong>Parameters:</strong>
<ul><table>
<tr>
<td valign="top"><em>hid_t</em> <code>obj_id </code></td>
<td valign="top">IN: Object identifier whose reference count will be retrieved.</td></tr>
</table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative current reference count of the object ID
if successful; otherwise a negative value is returned.
<dt><strong>Fortran90 Interface:</strong> h5iget_ref_f
<dd>
<pre>
SUBROUTINE h5iget_ref_f(obj_id, ref_count, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: obj_id !Object identifier
INTEGER, INTENT(OUT) :: ref_count !Reference count of object ID
INTEGER, INTENT(OUT) :: hdferr ! Error code
! 0 on success, and -1 on failure
END SUBROUTINE h5iget_ref_f
</pre>
<!--<dt><strong>Non-C API(s):</strong>
<dd>
<img src="Graphics/Java.gif">
<img src="Graphics/C++.gif">
-->
<dt><strong>History:</strong>
<ul><table width="90%">
<tr>
<td valign="top" align="left" width="10%">
<strong>Release</strong> </td>
<td valign="top" align="left">
<strong>C</strong></td>
<td valign="top" align="left">
</td>
<td valign="top" align="left">
<strong>Fortran90</strong></td></tr>
<tr>
<td valign="top">1.6.2</td>
<td valign="top">
Function introduced in this release.</td>
<td valign="top"> </td>
<td valign="top">
Fortran subroutine introduced in this
release.</td></tr>
</table></ul>
</dl>
<!-- NEW PAGE -->
<!-- HEADER RIGHT "H5Iget_type" -->
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Identify-GetType">H5Iget_type</a>
<dt><strong>Signature:</strong>
<dd><em>H5I_type_t</em> <code>H5Iget_type</code>(<em>hid_t</em> <code>obj_id</code>)
<dt><strong>Purpose:</strong>
<dd>Retrieves the type of an object.
<dt><strong>Description:</strong>
<dd><code>H5Iget_type</code> retrieves the type of the object
identified by <code>obj_id</code>.
<p>
Valid types returned by the function are
<table>
<tr><td width=200><code> H5I_FILE</code>
</td><td>File</td></tr>
<tr><td><code> H5I_GROUP</code>
</td><td>Group</td></tr>
<tr><td><code> H5I_DATATYPE</code>
</td><td>Datatype</td></tr>
<tr><td><code> H5I_DATASPACE</code>
</td><td>Dataspace</td></tr>
<tr><td><code> H5I_DATASET</code>
</td><td>Dataset</td></tr>
<tr><td><code> H5I_ATTR</code>
</td><td>Attribute</td></tr>
</table>
If no valid type can be determined or the identifier
submitted is invalid, the function returns
<table>
<tr><td width=200><code> H5I_BADID</code>
</td><td>Invalid identifier</td></tr>
</table>
<p>
This function is of particular value in determining the
type of object closing function (<code>H5Dclose</code>,
<code>H5Gclose</code>, etc.) to call after a call to
<code>H5Rdereference</code>.
<dt><strong>Parameters:</strong>
<ul><table>
<tr>
<td valign="top"><em>hid_t</em> <code>obj_id </code></td>
<td valign="top">IN: Object identifier whose type is to be determined.</td></tr>
</table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the object type if successful;
otherwise <code>H5I_BADID</code>.
<dt><strong>Fortran90 Interface:</strong> h5iget_type_f
<dd>
<pre>
SUBROUTINE h5iget_type_f(obj_id, type, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: obj_id !Object identifier
INTEGER, INTENT(OUT) :: type !type of an object.
!possible values are:
!H5I_FILE_F
!H5I_GROUP_F
!H5I_DATATYPE_F
!H5I_DATASPACE_F
!H5I_DATASET_F
!H5I_ATTR_F
!H5I_BADID_F
INTEGER, INTENT(OUT) :: hdferr ! E rror code
! 0 on success, and -1 on failure
END SUBROUTINE h5iget_type_f
</pre>
<!--<dt><strong>Non-C API(s):</strong>
<dd>
<img src="Graphics/Java.gif">
<img src="Graphics/C++.gif">
-->
</dl>
<!-- NEW PAGE -->
<!-- HEADER RIGHT "H5Iinc_ref" -->
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Identify-IncRef">H5Iinc_ref</a>
<dt><strong>Signature:</strong>
<dd><em>int</em> <code>H5Iinc_ref</code>(<em>hid_t</em> <code>obj_id</code>)
<dt><strong>Purpose:</strong>
<dd>Increments the reference count for an object.
<dt><strong>Description:</strong>
<dd><code>H5Iinc_ref</code> increments the reference count of the object
identified by <code>obj_id</code>.
<p>
The reference count for an object ID is attached to the information
about an object in memory and has no relation to the number of links to
an object on disk.
<p>
The reference count for a newly created object will be 1.
Reference counts for objects may be explicitly modified with this
function or with <code>H5Idec_ref</code>.
When an object ID's reference count reaches zero, the object will be
closed.
Calling an object ID's 'close' function decrements the reference count
for the ID which normally closes the object, but
if the reference count for the ID has been incremented with this
function, the object will only be closed when the reference count
reaches zero with further calls to <code>H5Idec_ref</code> or the
object ID's 'close' function.
<p>
If the object ID was created by a collective parallel call (such as
<code>H5Dcreate</code>, <code>H5Gopen</code>, etc.), the reference
count should be modified by all the processes which have copies of
the ID. Generally this means that group, dataset, attribute, file
and named datatype IDs should be modified by all the processes and
that all other types of IDs are safe to modify by individual processes.
<p>
This function is of particular value when an application is maintaining
multiple copies of an object ID. The object ID can be incremented when
a copy is made. Each copy of the ID can then be safely closed or
decremented and the HDF5 object will be closed when the reference count
for that that object drops to zero.
<dt><strong>Parameters:</strong>
<ul><table>
<tr>
<td valign="top"><em>hid_t</em> <code>obj_id </code></td>
<td valign="top">IN: Object identifier whose reference count will be modified.</td></tr>
</table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative reference count of the object ID after
incrementing it if successful; otherwise a negative value is returned.
<dt><strong>Fortran90 Interface:</strong> h5iinc_ref_f
<dd>
<pre>
SUBROUTINE h5iinc_ref_f(obj_id, ref_count, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: obj_id !Object identifier
INTEGER, INTENT(OUT) :: ref_count !Reference count of object ID
INTEGER, INTENT(OUT) :: hdferr ! Error code
! 0 on success, and -1 on failure
END SUBROUTINE h5iinc_ref_f
</pre>
<!--<dt><strong>Non-C API(s):</strong>
<dd>
<img src="Graphics/Java.gif">
<img src="Graphics/C++.gif">
-->
<dt><strong>History:</strong>
<ul><table width="90%">
<tr>
<td valign="top" align="left" width="10%">
<strong>Release</strong> </td>
<td valign="top" align="left">
<strong>C</strong></td>
<td valign="top" align="left">
</td>
<td valign="top" align="left">
<strong>Fortran90</strong></td></tr>
<tr>
<td valign="top">1.6.2</td>
<td valign="top">
Function introduced in this release.</td>
<td valign="top"> </td>
<td valign="top">
Fortran subroutine introduced in this
release.</td></tr>
</table></ul>
</dl>
<!-- #BeginLibraryItem "/ed_libs/NavBar_RM.lbi" -->
<hr>
<center>
<table border=0 width=98%>
<tr><td valign=top align=left>
<a href="index.html">HDF5 documents and links</a> <br>
<a href="H5.intro.html">Introduction to HDF5</a> <br>
<a href="http://www.hdfgroup.org/HDF5/doc1.6/UG/UG_frame.html">HDF5 User Guide</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>
<a href="RM_H5.html">H5</a>
<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>
<tr><td colspan="2" align="right">
<i><small>(<a href="http://www.hdfgroup.org/HDF5/doc1.6/PSandPDF/">PDF</a>
of complete manual formatted as print volume) </small></i>
</td></tr>
</table>
</center>
<hr>
<!-- #EndLibraryItem --><!-- #BeginLibraryItem "/ed_libs/Footer.lbi" -->
<address>
THG Help Desk: <img src="Graphics/help.png" align=top height=16>
<br>
Describes HDF5 Release 1.6.7, January 2008
</address>
<!-- #EndLibraryItem --><SCRIPT LANGUAGE="JAVASCRIPT">
<!--
document.writeln("Last modified: 12 October 2006");
-->
</SCRIPT>
</body>
</html>
|