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
|
<html>
<head><title>
HDF5/H5R API Specification
</title>
<!-- #BeginLibraryItem "/ed_libs/styles_RM.lbi" -->
<!--
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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://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. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-->
<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://hdf.ncsa.uiuc.edu/HDF5/doc/UG/index.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="http://hdf.ncsa.uiuc.edu/HDF5/hdf5_hl/doc/RM_hdf5im.html">H5IM</a>
<a href="http://hdf.ncsa.uiuc.edu/HDF5/hdf5_hl/doc/RM_hdf5lt.html">H5LT</a>
<a href="http://hdf.ncsa.uiuc.edu/HDF5/hdf5_hl/doc/RM_hdf5pt.html">H5PT</a>
<a href="http://hdf.ncsa.uiuc.edu/HDF5/hdf5_hl/doc/RM_hdf5tb.html">H5TB</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>
</table>
</center>
<hr><!-- #EndLibraryItem --><center>
<h1>H5R: Reference Interface</h1>
</center>
<h2>Reference API Functions</h2>
The Reference interface allows the user to create references
to specific objects and data regions in an HDF5 file.
<p>
<strong>The C Interfaces:</strong>
<table border=0 width=80%>
<tr><td valign=top width=40%>
<ul>
<li><a href="#Reference-Create">H5Rcreate</a>
<li><a href="#Reference-Dereference">H5Rdereference</a>
</ul>
</td><td valign=top width=40%>
<ul>
<li><a href="#Reference-GetRegion">H5Rget_region</a>
<li><a href="#Reference-GetObjType">H5Rget_obj_type</a>
</ul>
</td><td valign=top width=20%>
<ul>
</ul>
</td></tr>
</table>
<p>
<i>Alphabetical Listing</i>
<table border="0">
<tr>
<td valign="top">
<ul>
<li><a href="#Reference-Create">H5Rcreate</a>
<li><a href="#Reference-Dereference">H5Rdereference</a>
</ul>
</td>
<td> </td>
<td valign="top">
<ul>
<li><a href="#Reference-GetObjType">H5Rget_obj_type</a>
</ul>
</td>
<td> </td>
<td valign="top">
<ul>
<li><a href="#Reference-GetRegion">H5Rget_region</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 width=80%>
<tr><td valign=top width=40%>
<ul>
<li><a href="#Reference-Create">h5rcreate_f</a>
<li><a href="#Reference-Dereference">h5rdereference_f</a>
</ul>
</td><td valign=top width=40%>
<ul>
<li><a href="#Reference-GetRegion">h5rget_region_f</a>
<li><a href="#Reference-GetObjType">h5rget_object_type_f</a>
</ul>
</td><td valign=top width=20%>
<ul>
</ul>
</td></tr>
</table>
<p>
<!-- NEW PAGE -->
<!-- HEADER RIGHT " " -->
<!-- NEW PAGE -->
<!-- HEADER RIGHT "H5Rcreate" -->
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Reference-Create">H5Rcreate</a>
<dt><strong>Signature:</strong>
<dd><em>herr_t</em> <code>H5Rcreate</code>(<em>void *</em><code>ref</code>,
<em>hid_t</em> <code>loc_id</code>,
<em>const char *</em><code>name</code>,
<em>H5R_type_t</em> <code>ref_type</code>,
<em>hid_t</em> <code>space_id</code>
)
<dt><strong>Purpose:</strong>
<dd>Creates a reference.
<dt><strong>Description:</strong>
<dd><code>H5Rcreate</code> creates the reference, <code>ref</code>,
of the type specified in <code>ref_type</code>, pointing to
the object <code>name</code> located at <code>loc_id</code>.
<p>
The HDF5 library maps the <em>void</em> type specified above
for <code>ref</code> to the type specified in <code>ref_type</code>,
which will be one of those appearing in the first column of
the following table.
The second column of the table lists the HDF5 constant associated
with each reference type.
<dir>
<table border=0>
<tr><td><em>hdset_reg_ref_t</em> </td>
<td><code>H5R_DATASET_REGION</code> </td>
<td>Dataset region reference</td></tr>
<tr><td><em>hobj_ref_t</em></td>
<td><code>H5R_OBJECT</code></td>
<td>Object reference</td></tr>
</table>
</dir>
<p>
The parameters <code>loc_id</code> and <code>name</code> are
used to locate the object.
<p>
The parameter <code>space_id</code> identifies the region
to be pointed to for a dataset region reference.
This parameter is unused with object references.
<dt><strong>Parameters:</strong>
<ul><table>
<tr>
<td valign="top"><em>void *</em><code>ref</code></td>
<td valign="top">OUT: Reference created by the function call.</td></tr>
<tr>
<td valign="top"><em>hid_t</em> <code>loc_id</code></td>
<td valign="top">IN: Location identifier used to locate the object being
pointed to.</td></tr>
<tr>
<td valign="top"><em>const char *</em><code>name</code></td>
<td valign="top">IN: Name of object at location <code>loc_id</code>.</td></tr>
<tr>
<td valign="top"><em>H5R_type_t</em> <code>ref_type </code></td>
<td valign="top">IN: Type of reference.</td></tr>
<tr>
<td valign="top"><em>hid_t</em> <code>space_id</code></td>
<td valign="top">IN: Dataspace identifier with selection.
Used for dataset region references.</td></tr>
</table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
<dt><strong>Fortran90 Interface:</strong> h5rcreate_f
<p><strong>To create an object reference</strong>
<dd>
<pre>
SUBROUTINE h5rcreate_f(loc_id, name, ref, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: loc_id ! Location identifier
CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the object at location
! specified by loc_id identifier
TYPE(hobj_ref_t_f), INTENT(OUT) :: ref ! Object reference
INTEGER, INTENT(OUT) :: hdferr ! Error code
END SUBROUTINE h5rcreate_f
</pre></dt>
<!-- NEW PAGE -->
<dt><strong>To create a region reference</strong>
<dd>
<pre>
SUBROUTINE h5rcreate_f(loc_id, name, space_id, ref, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: loc_id ! Location identifier
CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the dataset at location
! specified by loc_id identifier
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataset's dataspace identifier
TYPE(hdset_reg_ref_t_f), INTENT(OUT) :: ref ! Dataset region reference
INTEGER, INTENT(OUT) :: hdferr ! Error code
END SUBROUTINE h5rcreate_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 "H5Rdereference" -->
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Reference-Dereference">H5Rdereference</a>
<dt><strong>Signature:</strong>
<dd><em>hid_t</em> <code>H5Rdereference</code>(<em>hid_t</em> <code>dataset</code>,
<em>H5R_type_t</em> <code>ref_type</code>,
<em>void *</em><code>ref</code>
)
<dt><strong>Purpose:</strong>
<dd>Opens the HDF5 object referenced.
<dt><strong>Description:</strong>
<dd>Given a reference to some object, <code>H5Rdereference</code>
opens that object and returns an identifier.
<p>
The parameter <code>ref_type</code> specifies the reference type
of <code>ref</code>.
<code>ref_type</code> may contain either of the following values:
<ul>
<li><code>H5R_OBJECT</code> (<code>0</code>)
<li><code>H5R_DATASET_REGION</code> (<code>1</code>)
</ul>
<dt><strong>Parameters:</strong>
<ul><table>
<tr>
<td valign="top"><em>hid_t</em> <code>dataset</code></td>
<td valign="top">IN: Dataset containing reference object.</td></tr>
<tr>
<td valign="top"><em>H5R_type_t</em> <code>ref_type </code></td>
<td valign="top">IN: The reference type of <code>ref</code>.</td></tr>
<tr>
<td valign="top"><em>void *</em><code>ref</code></td>
<td valign="top">IN: Reference to open.</td></tr>
</table></ul>
<dt><strong>Returns:</strong>
<dd>Returns valid identifier if successful;
otherwise returns a negative value.
<dt><strong>Fortran90 Interface:</strong> h5rdereference_f
<p><strong>To dereference an object</strong>
<dd>
<pre>
SUBROUTINE h5rdereference_f(dset_id, ref, obj_id, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier
TYPE(hobj_ref_t_f), INTENT(IN) :: ref ! Object reference
INTEGER(HID_T), INTENT(OUT) :: obj_id ! Object identifier
INTEGER, INTENT(OUT) :: hdferr ! Error code
END SUBROUTINE h5rdereference_f
</pre>
</dt>
<dt><strong>To dereference a region</strong>
<dd>
<pre>
SUBROUTINE h5rdereference_f(dset_id, ref, obj_id, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier
TYPE(hdset_reg_ref_t_f), INTENT(IN) :: ref ! Object reference
INTEGER(HID_T), INTENT(OUT) :: obj_id ! Object identifier
INTEGER, INTENT(OUT) :: hdferr ! Error code
END SUBROUTINE h5rdereference_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 "H5Rget_obj_type" -->
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Reference-GetObjType">H5Rget_obj_type</a>
<dt><strong>Signature:</strong>
<dd><em>H5G_obj_t</em> <code>H5Rget_obj_type</code>(<em>hid_t</em> <code>id</code>,
<em>H5R_type_t</em> <code>ref_type</code>,
<em>void *</em><code>ref</code>
)
<dt><strong>Purpose:</strong>
<dd>Retrieves the type of object that an object reference points to.
<dt><strong>Description:</strong>
<dd>Given type of object reference, <code>ref_type</code>,
and a reference to an object, <code>ref</code>,
<code>H5Rget_obj_type</code>
returns the type of the referenced object.
<p>
Valid object reference types, to pass in as <code>ref_type</code>,
include the following:
<table border="0">
<tr align=left valign=top><td> </td><td>
<code>H5R_OBJECT</code></td><td>
Reference is an object reference.
</td></tr>
<tr align=left valign=top><td> </td><td>
<code>H5R_DATASET_REGION </code></td><td>
Reference is a dataset region reference.
</td></tr>
</table>
<p>
Valid object type return values include the following:
<table border="0">
<tr align=left valign=top><td> </td><td>
<code>H5G_LINK</code></td><td>
Object is a symbolic link.
</td></tr>
<tr align=left valign=top><td> </td><td>
<code>H5G_GROUP</code></td><td>
Object is a group.
</td></tr>
<tr align=left valign=top><td> </td><td>
<code>H5G_DATASET </code></td><td>
Object is a dataset.
</td></tr>
<tr align=left valign=top><td> </td><td>
<code>H5G_TYPE</code></td><td>
Object is a named datatype.
</td></tr>
</table>
<dt><strong>Parameters:</strong>
<ul><table>
<tr>
<td valign="top"><em>hid_t</em> <code>id</code>,</td>
<td valign="top">IN: The dataset containing the reference object or
the location identifier of the object that the
dataset is located within.</td></tr>
<tr>
<td valign="top"><em>H5R_type_t</em> <code>ref_type </code></td>
<td valign="top">IN: Type of reference to query.</td></tr>
<tr>
<td valign="top"><em>void *</em><code>ref</code></td>
<td valign="top">IN: Reference to query.</td></tr>
</table></ul>
<dt><strong>Returns:</strong>
<dd>Returns an object type as defined in <code>H5Gpublic.h</code> if successful;
otherwise returns <code>H5G_UNKNOWN</code>.
<dt><strong>Fortran90 Interface:</strong> h5rget_object_type_f
<dd>
<pre>
SUBROUTINE h5rget_object_type_f(dset_id, ref, obj_type, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier
TYPE(hobj_ref_t_f), INTENT(IN) :: ref ! Object reference
INTEGER, INTENT(OUT) :: obj_type ! Object type
! H5G_UNKNOWN_F (-1)
! H5G_LINK_F 0
! H5G_GROUP_F 1
! H5G_DATASET_F 2
! H5G_TYPE_F 3
INTEGER, INTENT(OUT) :: hdferr ! Error code
END SUBROUTINE h5rget_object_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 "H5Rget_region" -->
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Reference-GetRegion">H5Rget_region</a>
<dt><strong>Signature:</strong>
<dd><em>hid_t</em> <code>H5Rget_region</code>(<em>hid_t</em> <code>dataset</code>,
<em>H5R_type_t</em> <code>ref_type</code>,
<em>void *</em><code>ref</code>
)
<dt><strong>Purpose:</strong>
<dd>Retrieves a dataspace with the specified region selected.
<dt><strong>Description:</strong>
<dd>Given a reference to an object <code>ref</code>,
<code>H5Rget_region</code> creates a copy of the dataspace
of the dataset pointed to and defines a selection in the copy
which is the region pointed to.
<p>
The parameter <code>ref_type</code> specifies the reference type
of <code>ref</code>.
<code>ref_type</code> may contain the following value:
<ul>
<li><code>H5R_DATASET_REGION</code> (<code>1</code>)
</ul>
<dt><strong>Parameters:</strong>
<ul><table>
<tr>
<td valign="top"><em>hid_t</em> <code>dataset</code></td>
<td valign="top">IN: Dataset containing reference object.</td></tr>
<tr>
<td valign="top"><em>H5R_type_t</em> <code>ref_type </code></td>
<td valign="top">IN: The reference type of <code>ref</code>.</td></tr>
<tr>
<td valign="top"><em>void *</em><code>ref</code></td>
<td valign="top">IN: Reference to open.</td></tr>
</table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a valid identifier if successful;
otherwise returns a negative value.
<dt><strong>Fortran90 Interface:</strong> h5rget_region_f
<dd>
<pre>
SUBROUTINE h5rget_region_f(dset_id, ref, space_id, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier
TYPE(hdset_reg_ref_t_f), INTENT(IN) :: ref ! Dataset region reference
INTEGER(HID_T), INTENT(OUT) :: space_id ! Space identifier
INTEGER, INTENT(OUT) :: hdferr ! Error code
END SUBROUTINE h5rget_region_f
</pre>
<!--<dt><strong>Non-C API(s):</strong>
<dd>
<img src="Graphics/Java.gif">
<img src="Graphics/C++.gif">
-->
</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://hdf.ncsa.uiuc.edu/HDF5/doc/UG/index.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="http://hdf.ncsa.uiuc.edu/HDF5/hdf5_hl/doc/RM_hdf5im.html">H5IM</a>
<a href="http://hdf.ncsa.uiuc.edu/HDF5/hdf5_hl/doc/RM_hdf5lt.html">H5LT</a>
<a href="http://hdf.ncsa.uiuc.edu/HDF5/hdf5_hl/doc/RM_hdf5pt.html">H5PT</a>
<a href="http://hdf.ncsa.uiuc.edu/HDF5/hdf5_hl/doc/RM_hdf5tb.html">H5TB</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>
</table>
</center>
<hr><!-- #EndLibraryItem --><!-- #BeginLibraryItem "/ed_libs/Footer.lbi" --><address>
<a href="mailto:hdfhelp@ncsa.uiuc.edu">HDF Help Desk</a>
<br>
Describes HDF5 Release 1.7, the unreleased development branch; working toward HDF5 Release 1.8.0
</address><!-- #EndLibraryItem --><SCRIPT LANGUAGE="JAVASCRIPT">
<!--
document.writeln("Last modified: 24 February 2004");
-->
</SCRIPT>
</body>
</html>
|