File: encode.htm

package info (click to toggle)
hdf5 1.8.13%2Bdocs-15
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 171,520 kB
  • sloc: ansic: 387,158; f90: 35,195; sh: 20,035; xml: 17,780; cpp: 13,516; makefile: 1,487; perl: 1,299; yacc: 327; lex: 178; ruby: 37
file content (1036 lines) | stat: -rwxr-xr-x 52,408 bytes parent folder | download | duplicates (3)
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
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns:st1="urn:schemas-microsoft-com:office:smarttags"
xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 10">
<meta name=Originator content="Microsoft Word 10">
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="date"/>
<!--[if gte mso 9]><xml>
 <o:DocumentProperties>
  <o:Author>slu</o:Author>
  <o:Template>Normal</o:Template>
  <o:LastAuthor>slu</o:LastAuthor>
  <o:Revision>2</o:Revision>
  <o:TotalTime>597</o:TotalTime>
  <o:Created>2004-07-28T21:14:00Z</o:Created>
  <o:LastSaved>2004-07-28T21:14:00Z</o:LastSaved>
  <o:Pages>1</o:Pages>
  <o:Words>1714</o:Words>
  <o:Characters>9775</o:Characters>
  <o:Company>NCSA</o:Company>
  <o:Lines>81</o:Lines>
  <o:Paragraphs>22</o:Paragraphs>
  <o:CharactersWithSpaces>11467</o:CharactersWithSpaces>
  <o:Version>10.2625</o:Version>
 </o:DocumentProperties>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:SpellingState>Clean</w:SpellingState>
  <w:GrammarState>Clean</w:GrammarState>
  <w:Compatibility>
   <w:UseFELayout/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]--><!--[if !mso]><object
 classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D" id=ieooui></object>
<style>
st1\:*{behavior:url(#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:Wingdings;
	panose-1:5 0 0 0 0 0 0 0 0 0;
	mso-font-charset:2;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:0 268435456 0 0 -2147483648 0;}
@font-face
	{font-family:SimSun;
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-alt:\5B8B\4F53;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
	{font-family:"\@SimSun";
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:3 135135232 16 0 262145 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:SimSun;}
p.MsoDate, li.MsoDate, div.MsoDate
	{mso-style-next:Normal;
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:SimSun;}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;
	text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;
	text-underline:single;}
p
	{mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:SimSun;}
code
	{font-family:"Courier New";
	mso-ascii-font-family:"Courier New";
	mso-fareast-font-family:SimSun;
	mso-hansi-font-family:"Courier New";
	mso-bidi-font-family:"Courier New";}
span.SpellE
	{mso-style-name:"";
	mso-spl-e:yes;}
span.GramE
	{mso-style-name:"";
	mso-gram-e:yes;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
 /* List Definitions */
 @list l0
	{mso-list-id:240533194;
	mso-list-type:hybrid;
	mso-list-template-ids:-1335209324 1284547292 67698689 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
	{mso-level-number-format:roman-upper;
	mso-level-tab-stop:.75in;
	mso-level-number-position:left;
	margin-left:.75in;
	text-indent:-.5in;}
@list l0:level2
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:1.0in;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:Symbol;}
@list l0:level3
	{mso-level-number-format:roman-lower;
	mso-level-tab-stop:1.5in;
	mso-level-number-position:right;
	text-indent:-9.0pt;}
@list l1
	{mso-list-id:1085297296;
	mso-list-type:hybrid;
	mso-list-template-ids:-244408772 2064827866 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l1:level1
	{mso-level-number-format:bullet;
	mso-level-text:-;
	mso-level-tab-stop:.5in;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:"Times New Roman";
	mso-fareast-font-family:SimSun;}
ol
	{margin-bottom:0in;}
ul
	{margin-bottom:0in;}
-->
</style>
<!--[if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0in 5.4pt 0in 5.4pt;
	mso-para-margin:0in;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";}
</style>
<![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple style='tab-interval:.5in'>

<div class=Section1>

<p class=MsoNormal><span style='mso-tab-count:2'> </span><b
style='mso-bidi-font-weight:normal'><span style='font-size:14.0pt'>Encode and
Decode HDF5 Objects<o:p></o:p></span></b></p>

<p class=MsoNormal><span style='mso-tab-count:3'> </span><b
style='mso-bidi-font-weight:normal'>Raymond Lu &amp; <span class=SpellE>Quincey</span>
<span class=SpellE>Koziol</span><o:p></o:p></b></p>


<p class=MsoNormal><span style='mso-tab-count:3'> </span><st1:date
Month="7" Day="27" Year="2004">July 27, 2004</st1:date></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal style='margin-left:.75in;text-indent:-.5in;mso-list:l0 level1 lfo1;
tab-stops:list .75in'><![if !supportLists]><b style='mso-bidi-font-weight:normal'><span
style='mso-fareast-font-family:"Times New Roman"'><span style='mso-list:Ignore'>I.<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span></b><![endif]><b style='mso-bidi-font-weight:normal'>Documents
Audience<o:p></o:p></b></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><span class=GramE>Current HDF5 library designers and
knowledgeable external developers.</span></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal style='margin-left:.75in;text-indent:-.5in;mso-list:l0 level1 lfo1;
tab-stops:list .75in'><![if !supportLists]><b style='mso-bidi-font-weight:normal'><span
style='mso-fareast-font-family:"Times New Roman"'><span style='mso-list:Ignore'>II.<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span></b><![endif]><b style='mso-bidi-font-weight:normal'>Functionality<o:p></o:p></b></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>The functions described in this document encode and decode
the description of HDF5 objects given by their ID into a binary buffer.<span
style='mso-spacerun:yes'> </span>At this stage, these functions deal only with
datatype and dataspace objects.<span style='mso-spacerun:yes'> </span>In the
future, we may expand the coverage of the objects.</p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal style='margin-left:.75in;text-indent:-.5in;mso-list:l0 level1 lfo1;
tab-stops:list .75in'><![if !supportLists]><b style='mso-bidi-font-weight:normal'><span
style='mso-fareast-font-family:"Times New Roman"'><span style='mso-list:Ignore'>III.<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span></b><![endif]><b style='mso-bidi-font-weight:normal'>Motivations
and Use Cases<o:p></o:p></b></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>The motivation of these functions is to provide a way to
transmit object description between two tasks.<span style='mso-spacerun:yes'>
</span>The second task can reconstruct the object and return its ID.<span
style='mso-spacerun:yes'> </span>This can happen among different processes in
an MPI program.<span style='mso-spacerun:yes'> </span>Another useful case is
to do checksum on the object.<span style='mso-spacerun:yes'> </span></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>It is possible to allow users program to decode the binary
description of the object if there is need to do so.<span
style='mso-spacerun:yes'> </span>See below for a description of the encoding
of the objects.</p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Below are some use cases (borrowed from Robb Matzke),</p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>1.<span style='mso-spacerun:yes'> </span>In a parallel
program (plain old PHDF5 and not FPHDF5) datasets must be created collectively
over the file communicator, but sometimes conceptually only one MPI task (call
it the &quot;root&quot; task) wants to create the object.&nbsp; Therefore the
non-root tasks need to jump into the <span class=GramE><span style='font-size:
10.0pt;font-family:"Courier New";mso-bidi-font-family:"Times New Roman"'>H5Dcreate(</span></span><span
style='font-size:10.0pt;font-family:"Courier New";mso-bidi-font-family:"Times New Roman"'>)</span>
call too, and they need to all supply various parameters including a datatype. <span
style='mso-spacerun:yes'></span>HDF5 <span class=SpellE>datatypes</span> have
such a rich expressive power that it would be easiest if HDF5 provided some way
to help the root task broadcast the datatype to the other tasks rather than the
programmer dissect the datatype, broadcast its description, then construct it
on the other tasks.&nbsp; That's where the encode/decode functions come in: the
encode takes a datatype and converts it into some task-independent
representation</p>

<p class=MsoNormal><span class=GramE>that</span> can be broadcast to the other
tasks, which then decode that representation back into an <span class=SpellE><i
style='mso-bidi-font-style:normal'>hid_t</i></span> handle to a datatype.</p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>2.<span style='mso-spacerun:yes'> </span>This second use
case is similar in that one MPI task has a datatype that it would like to save
in a file. Normally <span class=GramE><span style='font-size:10.0pt;font-family:
"Courier New";mso-bidi-font-family:"Times New Roman"'>H5Tcommit(</span></span><span
style='font-size:10.0pt;font-family:"Courier New";mso-bidi-font-family:"Times New Roman"'>)</span>
is a file-collective operation. However, writing to an existing dataset is
independent, so a programmer could encode a datatype into the</p>

<p class=MsoNormal><span class=GramE>task-independent</span> representation and
independently write that into an existing dataset. Obviously in this situation
a reader program would have to know that the sequence of bytes is an encoded
datatype in order to do anything useful with it.</p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>3.<span style='mso-spacerun:yes'> </span>In order to
compare whether two <span class=SpellE>datatypes</span> on different tasks are
equivalent you could byte-compare their task-independent encodings.</p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>4.<span style='mso-spacerun:yes'> </span>If you have <i
style='mso-bidi-font-style:normal'>lots</i> of <span class=SpellE>datatypes</span>
to compare (e.g., sorting an array of <span class=SpellE>datatypes</span>) it
would probably be faster to encode them all first, then sort based on the
encoding since <span class=SpellE><span class=GramE><span style='font-size:
10.0pt;font-family:"Courier New";mso-bidi-font-family:"Times New Roman"'>memcmp</span></span></span><span
class=GramE><span style='font-size:10.0pt;font-family:"Courier New";mso-bidi-font-family:
"Times New Roman"'>(</span></span><span style='font-size:10.0pt;font-family:
"Courier New";mso-bidi-font-family:"Times New Roman"'>)</span> is almost certainly
faster than <span style='font-size:10.0pt;font-family:"Courier New";mso-bidi-font-family:
"Times New Roman"'>H5T_cmp().</span></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>5.<span style='mso-spacerun:yes'> </span>If you have <i
style='mso-bidi-font-style:normal'>lots</i> of <span class=SpellE>datatypes</span>
to save in a file and those types are distributed among MPI tasks then its
probably fastest to have each task encode its <span class=SpellE>datatypes</span>,
<span class=SpellE><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'>MPI_Gather</span></span><span
style='font-size:10.0pt;font-family:"Courier New";mso-bidi-font-family:"Times New Roman"'>()</span>
them to a single I/O task, then that task independently writes the encoded
types to a</p>

<p class=MsoNormal><span class=GramE>pre-existing</span> dataset.</p>

<p class=MsoNormal><span style='mso-spacerun:yes'></span></p>

<p class=MsoNormal style='margin-left:.75in;text-indent:-.5in;mso-list:l0 level1 lfo1;
tab-stops:list .75in'><![if !supportLists]><b style='mso-bidi-font-weight:normal'><span
style='mso-fareast-font-family:"Times New Roman"'><span style='mso-list:Ignore'>IV.<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span></b><![endif]><b style='mso-bidi-font-weight:normal'>Release<o:p></o:p></b></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>There functions are for release 1.8 of the library.<o:p></o:p></p>

<p class=MsoNormal><b style='mso-bidi-font-weight:normal'><o:p>&nbsp;</o:p></b></p>

<p class=MsoNormal style='margin-left:.75in;text-indent:-.5in;mso-list:l0 level1 lfo1;
tab-stops:list .75in'><![if !supportLists]><b style='mso-bidi-font-weight:normal'><span
style='mso-fareast-font-family:"Times New Roman"'><span style='mso-list:Ignore'>V.<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span></b><![endif]><b style='mso-bidi-font-weight:normal'>Algorithms
&amp; Format of Data<o:p></o:p></b></p>

<p class=MsoNormal><b style='mso-bidi-font-weight:normal'><o:p>&nbsp;</o:p></b></p>

<p class=MsoNormal>For the internal library design, we are going to borrow the
algorithm of encoding and decoding object header messages.<span
style='mso-spacerun:yes'> </span>It will be helpful to take a look at the data
object part (Part IV) of the HDF5 File Format document.<span
style='mso-spacerun:yes'> </span>The data objects we are interested in here
are datatype and dataspace.<o:p></o:p></p>

<p class=MsoNormal><b style='mso-bidi-font-weight:normal'><o:p>&nbsp;</o:p></b></p>

<p class=MsoNormal>Format of the datatype information:</p>

<p class=MsoNormal><span style='mso-tab-count:1'> </span>The encoded
datatype is composed of the following information:</p>

<p class=MsoNormal style='margin-left:1.0in;text-indent:-.25in;mso-list:l0 level2 lfo1;
tab-stops:list 1.0in'><![if !supportLists]><span style='font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol'><span
style='mso-list:Ignore'><span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]>A single byte indicating the buffer is a
datatype which is the same value (3) as the datatype message ID in object
headers in the file format.</p>

<p class=MsoNormal style='margin-left:1.0in;text-indent:-.25in;mso-list:l0 level2 lfo1;
tab-stops:list 1.0in'><![if !supportLists]><span style='font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol'><span
style='mso-list:Ignore'><span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]>A single byte indicating the version of the
datatype information, currently set to 0.</p>

<p class=MsoNormal style='margin-left:1.0in;text-indent:-.25in;mso-list:l0 level2 lfo1;
tab-stops:list 1.0in'><![if !supportLists]><span style='font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol'><span
style='mso-list:Ignore'><span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]>A sequence of bytes that have the same format as
the datatype message in the object header.<span style='mso-spacerun:yes'>
</span>See the HDF5 file format document for the exact format.</p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Format of the dataspace information:</p>

<p class=MsoNormal><span style='mso-tab-count:1'> </span>The encoded
dataspace is composed of the following information:</p>

<p class=MsoNormal style='margin-left:1.0in;text-indent:-.25in;mso-list:l0 level2 lfo1;
tab-stops:list 1.0in'><![if !supportLists]><span style='font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol'><span
style='mso-list:Ignore'><span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]>A single byte indicating the buffer is a
dataspace which is the same value (1) as the dataspace message ID in object
headers in the file format.</p>

<p class=MsoNormal style='margin-left:1.0in;text-indent:-.25in;mso-list:l0 level2 lfo1;
tab-stops:list 1.0in'><![if !supportLists]><span style='font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol'><span
style='mso-list:Ignore'><span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]>A single byte indicating the version of the
dataspace information, currently set to 0.</p>

<p class=MsoNormal style='margin-left:1.0in;text-indent:-.25in;mso-list:l0 level2 lfo1;
tab-stops:list 1.0in'><![if !supportLists]><span style='font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol'><span
style='mso-list:Ignore'><span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]>A single indicating the size in bytes of the
size of lengths information for the rest of the information encoded in the
buffer.</p>

<p class=MsoNormal style='margin-left:1.0in;text-indent:-.25in;mso-list:l0 level2 lfo1;
tab-stops:list 1.0in'><![if !supportLists]><span style='font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol'><span
style='mso-list:Ignore'><span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]>A 16-bit value indicating the size in bytes of
the dataspace extent information.</p>

<p class=MsoNormal style='margin-left:1.0in;text-indent:-.25in;mso-list:l0 level2 lfo1;
tab-stops:list 1.0in'><![if !supportLists]><span style='font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol'><span
style='mso-list:Ignore'><span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]>A sequence of bytes that store the extent of the
dataspace and that have the same format as the dataspace message in the object
header.<span style='mso-spacerun:yes'> </span>See the HDF5 file format
document for the exact format.</p>

<p class=MsoNormal style='margin-left:1.0in;text-indent:-.25in;mso-list:l0 level2 lfo1;
tab-stops:list 1.0in'><![if !supportLists]><span style='font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol'><span
style='mso-list:Ignore'><span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]>A sequence of bytes that store the selection
within the dataspace and that have the same format as the region portion of a
region reference.<span style='mso-spacerun:yes'> </span>See the HDF5 file
format document for the exact format.</p>

<p class=MsoNormal><b style='mso-bidi-font-weight:normal'><o:p>&nbsp;</o:p></b></p>

<p class=MsoNormal style='margin-left:.75in;text-indent:-.5in;mso-list:l0 level1 lfo1;
tab-stops:list .75in'><![if !supportLists]><b style='mso-bidi-font-weight:normal'><span
style='mso-fareast-font-family:"Times New Roman"'><span style='mso-list:Ignore'>VI.<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span></b><![endif]><b style='mso-bidi-font-weight:normal'>Examples<o:p></o:p></b></p>

<p class=MsoNormal><b style='mso-bidi-font-weight:normal'><o:p>&nbsp;</o:p></b></p>

<p class=MsoNormal>Here is an example for <span class=GramE><span
style='font-size:10.0pt;font-family:"Courier New";mso-bidi-font-family:"Times New Roman"'>H5Tencode(</span></span><span
style='font-size:10.0pt;font-family:"Courier New";mso-bidi-font-family:"Times New Roman"'>)</span>
and <span style='font-size:10.0pt;font-family:"Courier New";mso-bidi-font-family:
"Times New Roman"'>H5Tdecode()</span>.<span style='mso-spacerun:yes'>
</span>In this piece of code, it creates a compound datatype and encodes
it.<span style='mso-spacerun:yes'> </span>Then it decodes the buffer and
returns a new object ID.<span style='mso-spacerun:yes'> </span></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span><span class=SpellE><span class=GramE>struct</span></span> s1 {<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span><span class=SpellE><span class=GramE>int</span></span><span
style='mso-spacerun:yes'> </span>a;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span><span class=GramE>float<span style='mso-spacerun:yes'> </span>b</span>;<o:p></o:p></span></p>

<p class=MsoNormal style='text-indent:24.0pt'><span style='font-size:10.0pt;
font-family:"Courier New";mso-bidi-font-family:"Times New Roman"'>};<o:p></o:p></span></p>

<p class=MsoNormal style='text-indent:24.0pt'><span class=GramE><span
style='font-size:10.0pt;font-family:"Courier New";mso-bidi-font-family:"Times New Roman"'>hid</span></span><span
style='font-size:10.0pt;font-family:"Courier New";mso-bidi-font-family:"Times New Roman"'>
tid1, decoded_tid1;<o:p></o:p></span></p>

<p class=MsoNormal style='text-indent:24.0pt'><span style='font-size:10.0pt;
font-family:"Courier New";mso-bidi-font-family:"Times New Roman"'><span
style='mso-tab-count:2'> </span>:<o:p></o:p></span></p>

<p class=MsoNormal style='text-indent:24.0pt'><span style='font-size:10.0pt;
font-family:"Courier New";mso-bidi-font-family:"Times New Roman"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span>/* <span class=GramE>Create</span> a compound datatype */<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span><span class=GramE>if(</span>(tid1=H5Tcreate(H5T_COMPOUND, <span
class=SpellE>sizeof</span>(<span class=SpellE>struct</span> s1)))&lt;0) <o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span><span class=SpellE><span class=GramE>goto</span></span> error;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span><span class=GramE>if(</span>H5Tinsert(tid1, &quot;a&quot;, HOFFSET(<span
class=SpellE>struct</span> s1, a), H5T_NATIVE_INT)&lt;0)<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span><span class=SpellE><span class=GramE>goto</span></span> error;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span><span class=GramE>if(</span>H5Tinsert(tid1, &quot;b&quot;, HOFFSET(<span
class=SpellE>struct</span> s1, b), H5T_NATIVE_FLOAT)&lt;0)<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span><span class=SpellE><span class=GramE>goto</span></span> error;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span>/* <span class=GramE>Encode</span> compound type in a buffer */<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span><span class=GramE>if(</span>H5Tencode(tid1, NULL, &amp;<span
class=SpellE>cmpd_buf_size</span>)&lt;0)<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span><span class=SpellE><span class=GramE>goto</span></span> error;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span><span class=GramE>if(</span><span class=SpellE>cmpd_buf_size</span>&gt;0)<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span><span class=SpellE>cmpd_buf</span> = (unsigned char*<span class=GramE>)<span
class=SpellE>calloc</span></span>(1, <span class=SpellE>cmpd_buf_size</span>);<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span><span class=GramE>if(</span>H5Tencode(tid1, <span class=SpellE>cmpd_buf</span>,
&amp;<span class=SpellE>cmpd_buf_size</span>)&lt;0)<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span><span class=SpellE><span class=GramE>goto</span></span> error;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span>/* <span class=GramE>Decode</span> from the compound buffer and return
an object handle */<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span><span class=GramE>if(</span>(decoded_tid1=H5Tdecode(<span class=SpellE>cmpd_buf</span>))&lt;0)<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span><span class=SpellE><span class=GramE>goto</span></span> error;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal>Below is an example for encoding and decoding a simple
dataspace using <span class=GramE><span style='font-size:10.0pt;font-family:
"Courier New";mso-bidi-font-family:"Times New Roman"'>H5Sencode(</span></span><span
style='font-size:10.0pt;font-family:"Courier New";mso-bidi-font-family:"Times New Roman"'>)</span>
and <span style='font-size:10.0pt;font-family:"Courier New";mso-bidi-font-family:
"Times New Roman"'>H5Sdecode()</span>.<span style='mso-spacerun:yes'>
</span>Notice that dataspace <span class=GramE>selection(</span><span
class=SpellE>hyperslab</span> in this case) can also be encoded and decoded.<o:p></o:p></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-indent:24.0pt'><span class=SpellE><span
style='font-size:10.0pt;font-family:"Courier New";mso-bidi-font-family:"Times New Roman"'>hid_t</span></span><span
style='font-size:10.0pt;font-family:"Courier New";mso-bidi-font-family:"Times New Roman"'><span
style='mso-tab-count:1'> </span>sid1, decoded_sid1;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span><span style='mso-spacerun:yes'></span><span class=SpellE>hsize_t</span><span
style='mso-spacerun:yes'> </span><span class=GramE>dims1[</span>] =
{3, 15, 13};<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span><span class=SpellE><span class=GramE>hssize_t</span></span><span
style='mso-spacerun:yes'> </span>start[] = {0, 0, 0};<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span><span class=SpellE><span class=GramE>hsize_t</span></span><span
style='mso-spacerun:yes'> </span>stride[] = {2, 5, 3};<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span><span class=SpellE><span class=GramE>hsize_t</span></span><span
style='mso-spacerun:yes'> </span>count[] = {2, 2, 2};<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span><span class=SpellE><span class=GramE>hsize_t</span></span><span
style='mso-spacerun:yes'> </span>block[] = {1, 3, 1};<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span>/* <span class=GramE>Create</span> a simple data space of 3x15x13 */<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span>sid1 = H5Screate_<span class=GramE>simple(</span>SPACE1_RANK, dims1,
NULL);<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span><span class=GramE>CHECK(</span>sid1, FAIL,
&quot;H5Screate_simple&quot;);<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-tab-count:1'> </span><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span>/* Make a <span class=SpellE>hyperslab</span> selection */<o:p></o:p></span></p>

<p class=MsoNormal style='text-indent:24.0pt'><span class=GramE><span
style='font-size:10.0pt;font-family:"Courier New";mso-bidi-font-family:"Times New Roman"'>ret</span></span><span
style='font-size:10.0pt;font-family:"Courier New";mso-bidi-font-family:"Times New Roman"'>
= H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, stride,<o:p></o:p></span></p>

<p class=MsoNormal style='text-indent:24.0pt'><span style='font-size:10.0pt;
font-family:"Courier New";mso-bidi-font-family:"Times New Roman"'><span
style='mso-tab-count:2'> </span><span class=GramE>count</span>, block);<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span><span class=GramE>CHECK(</span>ret, FAIL,
&quot;H5Sselect_hyperslab&quot;);<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span>/* Find out the size of buffer needed for encoding */<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span><span class=GramE>ret</span> = H5Sencode(sid1, NULL, &amp;<span
class=SpellE>sbuf_size</span>);<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span><span class=GramE>CHECK(</span>ret, FAIL, &quot;H5Sencode&quot;);<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span><span class=GramE>if(</span><span class=SpellE>sbuf_size</span>&gt;0)<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span><span class=SpellE><span class=GramE>sbuf</span></span> = (unsigned
char*)<span class=SpellE>calloc</span>(1, <span class=SpellE>sbuf_size</span>);<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span>/* <span class=GramE>Encode</span> simple data space in a buffer */<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span><span class=GramE>ret</span> = H5Sencode(sid1, <span class=SpellE>sbuf</span>,
&amp;<span class=SpellE>sbuf_size</span>);<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span><span class=GramE>CHECK(</span>ret, FAIL, &quot;H5Sencode&quot;);<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span>/* <span class=GramE>Decode</span> from the dataspace buffer and return
an object handle */<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span>decoded_sid1=<span class=GramE>H5Sdecode(</span><span class=SpellE>sbuf</span>);<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
mso-bidi-font-family:"Times New Roman"'><span style='mso-spacerun:yes'>
</span><span class=GramE>CHECK(</span>decoded_sid1, FAIL, &quot;H5Sdecode&quot;);<o:p></o:p></span></p>

<p class=MsoNormal><b style='mso-bidi-font-weight:normal'><o:p>&nbsp;</o:p></b></p>

<p class=MsoNormal style='margin-left:.75in;text-indent:-.5in;mso-list:l0 level1 lfo1;
tab-stops:list .75in'><![if !supportLists]><b style='mso-bidi-font-weight:normal'><span
style='mso-fareast-font-family:"Times New Roman"'><span style='mso-list:Ignore'>VII.<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span></b><![endif]><b style='mso-bidi-font-weight:normal'>API
Functions<o:p></o:p></b></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><strong>Name:</strong> <a name=Dataset-GetType>H5</a>Tencode</p>

<p class=MsoNormal><strong>Signature:</strong> </p>

<p class=MsoNormal style='margin-left:.5in'><span class=SpellE><em>herr_<span
class=GramE>t</span></em></span><span class=GramE><em><span
style='mso-spacerun:yes'> </span></em><code><span style='font-size:10.0pt'>H5Tencode</span></code></span>(<span
class=SpellE><em>hid_t</em></span><em> </em><span class=SpellE><code><span
style='font-size:10.0pt'>obj_id</span></code></span><code><span
style='font-size:10.0pt'>, </span></code><code><i style='mso-bidi-font-style:
normal'><span style='mso-ansi-font-size:12.0pt;mso-bidi-font-size:12.0pt;
font-family:"Times New Roman"'>unsigned char*</span></i></code><code><span
style='font-size:10.0pt'> <span class=SpellE>buf</span>, </span></code><span
class=SpellE><code><i style='mso-bidi-font-style:normal'><span
style='mso-ansi-font-size:12.0pt;mso-bidi-font-size:12.0pt;font-family:"Times New Roman"'>size_t</span></i></code></span><code><i
style='mso-bidi-font-style:normal'><span style='mso-ansi-font-size:12.0pt;
mso-bidi-font-size:12.0pt;font-family:"Times New Roman"'>*</span></i></code><code><span
style='font-size:10.0pt'> <span class=SpellE>nalloc</span></span></code>) </p>

<p class=MsoNormal><strong>Purpose:</strong> </p>

<p class=MsoNormal style='margin-left:.5in'>Encode a data type object
description into a binary buffer. </p>

<p class=MsoNormal><strong>Description:</strong> </p>

<p class=MsoNormal style='margin-left:.5in'>Given data type ID, <span
style='font-size:10.0pt;font-family:"Courier New"'>H5Tencode</span> converts a data
type description into binary form in a buffer.<span style='mso-spacerun:yes'>
</span>Using this binary form in the buffer, a data type object can be
reconstructed using <span style='font-size:10.0pt;font-family:"Courier New"'>H5Tdecode</span>
to return a new object <span class=GramE>handle(</span><span class=SpellE><i
style='mso-bidi-font-style:normal'>hid_t</i></span>) for this data type.</p>

<p class=MsoNormal style='margin-left:.5in'><o:p>&nbsp;</o:p></p>

<p class=MsoNormal style='margin-left:.5in'>A preliminary <code><span
style='font-size:10.0pt'>H5Tencode</span></code> call can be made to find out
the size of the buffer needed. This value is returned as <span class=SpellE><span
style='font-size:10.0pt;font-family:"Courier New"'>nalloc</span></span>.<span
style='mso-spacerun:yes'> </span>That value can then be assigned to <span
class=SpellE><code><span style='font-size:10.0pt'>nalloc</span></code></span>
for a second <code><span style='font-size:10.0pt'>H5Tencode</span></code> call,
which will retrieve the actual encoded object.<span style='mso-spacerun:yes'>
</span></p>

<p class=MsoNormal style='margin-left:.5in'><o:p>&nbsp;</o:p></p>

<p class=MsoNormal style='margin-left:.5in'>If the library finds out <span
class=SpellE><span style='font-size:10.0pt;font-family:"Courier New"'>nalloc</span></span>
is not big enough for the object, it simply returns the size of the buffer
needed through <span class=SpellE><span style='font-size:10.0pt;font-family:
"Courier New"'>nalloc</span></span> without encoding the provided buffer.<strong><span
style='font-weight:normal'><o:p></o:p></span></strong></p>

<p class=MsoNormal><strong>Parameters:</strong> </p>

<p class=MsoNormal><span class=SpellE><em>hid_t</em></span> <span class=SpellE><code><span
style='font-size:10.0pt'>obj_id</span></code></span> </p>

<p class=MsoNormal style='margin-left:.5in'>IN: Identifier of the object to be
encoded.</p>

<p class=MsoNormal><span class=GramE><em>unsigned</em></span><em> char*</em> <span
class=SpellE><code><span style='font-size:10.0pt'>buf</span></code></span> </p>

<p class=MsoNormal style='margin-left:.5in'>IN/OUT: Buffer for the object to be
encoded into.<span style='mso-spacerun:yes'> </span>If the provided buffer is
NULL, </p>

<p class=MsoNormal style='margin-left:.5in'><span class=GramE>only</span> the
size of buffer needed is returned through <span class=SpellE><span
style='font-size:10.0pt;font-family:"Courier New"'>nalloc</span></span>. </p>

<p class=MsoNormal><span class=SpellE><em>size_t</em></span><em>*</em> <span
class=SpellE><code><span style='font-size:10.0pt'>nalloc</span></code></span> </p>

<p class=MsoNormal style='margin-left:.5in'>IN: The size of the allocated
buffer.</p>

<p class=MsoNormal style='margin-left:.5in'>OUT: The size of the buffer needed.
</p>

<p class=MsoNormal><strong>Returns:</strong> </p>

<p class=MsoNormal style='margin-left:.5in'>Returns a non-negative value if
successful; otherwise returns a negative value.</p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><strong>Name:</strong> H5Tdecode</p>

<p class=MsoNormal><strong>Signature:</strong> </p>

<p class=MsoNormal style='margin-left:.5in'><span class=SpellE><em>hid_<span
class=GramE>t</span></em></span><span class=GramE><em><span
style='mso-spacerun:yes'> </span></em><code><span style='font-size:10.0pt'>H5Tdecode</span></code></span>(<code><i
style='mso-bidi-font-style:normal'><span style='mso-ansi-font-size:12.0pt;
mso-bidi-font-size:12.0pt;font-family:"Times New Roman"'>unsigned char*</span></i></code><code><span
style='font-size:10.0pt'> <span class=SpellE>buf</span></span></code>) </p>

<p class=MsoNormal><strong>Purpose:</strong> </p>

<p class=MsoNormal style='margin-left:.5in'>Decode a binary object description of
data type and return a new object handle. </p>

<p class=MsoNormal><strong>Description:</strong> </p>

<p class=MsoNormal style='margin-left:.5in'>Given an object description of data
type in binary in a buffer, <span style='font-size:10.0pt;font-family:"Courier New"'>H5Tdecode</span>
reconstructs the HDF5 data type object and returns a new object handle for
it.<span style='mso-spacerun:yes'> </span>The binary description of the object
is encoded by <span style='font-size:10.0pt;font-family:"Courier New"'>H5Tencode</span>.<span
style='mso-spacerun:yes'> </span>User is responsible for passing in the right
buffer.</p>

<p class=MsoNormal><strong>Parameters:</strong> </p>

<p class=MsoNormal><span class=GramE><em>unsigned</em></span><em> char*</em> <span
class=SpellE><code><span style='font-size:10.0pt'>buf</span></code></span> </p>

<p class=MsoNormal style='margin-left:.5in'>IN: Buffer for the data type object
to be decoded. </p>

<p class=MsoNormal><strong>Returns:</strong> </p>

<p class=MsoNormal style='margin-left:.5in'>Returns an object <span
class=GramE>ID(</span>non-negative) if successful; otherwise returns a negative
value.</p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><strong>Name:</strong> H5Sencode</p>

<p class=MsoNormal><strong>Signature:</strong> </p>

<p class=MsoNormal style='margin-left:.5in'><span class=SpellE><em>herr_<span
class=GramE>t</span></em></span><span class=GramE><em><span
style='mso-spacerun:yes'> </span></em><code><span style='font-size:10.0pt'>H5Sencode</span></code></span>(<span
class=SpellE><em>hid_t</em></span><em> </em><span class=SpellE><code><span
style='font-size:10.0pt'>obj_id</span></code></span><code><span
style='font-size:10.0pt'>, </span></code><code><i style='mso-bidi-font-style:
normal'><span style='mso-ansi-font-size:12.0pt;mso-bidi-font-size:12.0pt;
font-family:"Times New Roman"'>unsigned char*</span></i></code><code><span
style='font-size:10.0pt'> <span class=SpellE>buf</span>, </span></code><span
class=SpellE><code><i style='mso-bidi-font-style:normal'><span
style='mso-ansi-font-size:12.0pt;mso-bidi-font-size:12.0pt;font-family:"Times New Roman"'>size_t</span></i></code></span><code><i
style='mso-bidi-font-style:normal'><span style='mso-ansi-font-size:12.0pt;
mso-bidi-font-size:12.0pt;font-family:"Times New Roman"'>*</span></i></code><code><span
style='font-size:10.0pt'> <span class=SpellE>nalloc</span></span></code>) </p>

<p class=MsoNormal><strong>Purpose:</strong> </p>

<p class=MsoNormal style='margin-left:.5in'>Encode a data space object
description into a binary buffer. </p>

<p class=MsoNormal><strong>Description:</strong> </p>

<p class=MsoNormal style='margin-left:.5in'>Given the data space ID, <span
style='font-size:10.0pt;font-family:"Courier New"'>H5Sencode</span> converts a
data space description into binary form in a buffer.<span
style='mso-spacerun:yes'> </span>Using this binary form in the buffer, a data
space object can be reconstructed using <span style='font-size:10.0pt;
font-family:"Courier New"'>H5Sdecode</span> to return a new object <span
class=GramE>handle(</span><span class=SpellE><i style='mso-bidi-font-style:
normal'>hid_t</i></span>) for this data space.</p>

<p class=MsoNormal style='margin-left:.5in'><o:p>&nbsp;</o:p></p>

<p class=MsoNormal style='margin-left:.5in'>A preliminary <code><span
style='font-size:10.0pt'>H5Sencode</span></code> call can be made to find out
the size of the buffer needed. This value is returned as <span class=SpellE><span
style='font-size:10.0pt;font-family:"Courier New"'>nalloc</span></span>.<span
style='mso-spacerun:yes'> </span>That value can then be assigned to <span
class=SpellE><code><span style='font-size:10.0pt'>nalloc</span></code></span>
for a second <code><span style='font-size:10.0pt'>H5Sencode</span></code> call,
which will retrieve the actual encoded object.<span style='mso-spacerun:yes'>
</span></p>

<p class=MsoNormal style='margin-left:.5in'><o:p>&nbsp;</o:p></p>

<p class=MsoNormal style='margin-left:.5in'>If the library finds out <span
class=SpellE><span style='font-size:10.0pt;font-family:"Courier New"'>nalloc</span></span>
is not big enough for the object, it simply returns the size of the buffer
needed through <span class=SpellE><span style='font-size:10.0pt;font-family:
"Courier New"'>nalloc</span></span> without encoding the provided buffer.</p>

<p class=MsoNormal style='margin-left:.5in'><o:p>&nbsp;</o:p></p>

<p class=MsoNormal style='margin-left:.5in'><strong><span style='font-weight:
normal'>The types of data space we address in this function are null, scalar,
and simple space.<span style='mso-spacerun:yes'> </span>For simple data space,
the information of selection, for example, <span class=SpellE>hyperslab</span> <span
class=GramE>selection,</span> is also encoded and decoded.<span
style='mso-spacerun:yes'> </span>Complex data space has not been implemented
in the library.<o:p></o:p></span></strong></p>

<p class=MsoNormal><strong>Parameters:</strong> </p>

<p class=MsoNormal><span class=SpellE><em>hid_t</em></span> <span class=SpellE><code><span
style='font-size:10.0pt'>obj_id</span></code></span> </p>

<p class=MsoNormal style='margin-left:.5in'>IN: Identifier of the object to be
encoded.</p>

<p class=MsoNormal><span class=GramE><em>unsigned</em></span><em> char*</em> <span
class=SpellE><code><span style='font-size:10.0pt'>buf</span></code></span> </p>

<p class=MsoNormal style='margin-left:.5in'>IN/OUT: Buffer for the object to be
encoded into.<span style='mso-spacerun:yes'> </span>If the provided buffer is
NULL, </p>

<p class=MsoNormal style='margin-left:.5in'><span class=GramE>only</span> the
size of buffer needed is returned through <span class=SpellE><span
style='font-size:10.0pt;font-family:"Courier New"'>nalloc</span></span>. </p>

<p class=MsoNormal><span class=SpellE><em>size_t</em></span><em>*</em> <span
class=SpellE><code><span style='font-size:10.0pt'>nalloc</span></code></span> </p>

<p class=MsoNormal style='margin-left:.5in'>IN: The size of the allocated
buffer.</p>

<p class=MsoNormal style='margin-left:.5in'>OUT: The size of the buffer needed.
</p>

<p class=MsoNormal><strong>Returns:</strong> </p>

<p class=MsoNormal style='margin-left:.5in'>Returns a non-negative value if
successful; otherwise returns a negative value.</p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><strong>Name:</strong> H5Sdecode</p>

<p class=MsoNormal><strong>Signature:</strong> </p>

<p class=MsoNormal style='margin-left:.5in'><span class=SpellE><em>hid_<span
class=GramE>t</span></em></span><span class=GramE><em><span
style='mso-spacerun:yes'> </span></em><code><span style='font-size:10.0pt'>H5Sdecode</span></code></span>(<code><i
style='mso-bidi-font-style:normal'><span style='mso-ansi-font-size:12.0pt;
mso-bidi-font-size:12.0pt;font-family:"Times New Roman"'>unsigned char*</span></i></code><code><span
style='font-size:10.0pt'> <span class=SpellE>buf</span></span></code>) </p>

<p class=MsoNormal><strong>Purpose:</strong> </p>

<p class=MsoNormal style='margin-left:.5in'>Decode a binary object description
of data space and return a new object handle. </p>

<p class=MsoNormal><strong>Description:</strong> </p>

<p class=MsoNormal style='margin-left:.5in'>Given an object description of data
space in binary in a buffer, <span style='font-size:10.0pt;font-family:"Courier New"'>H5Sdecode</span>
reconstructs the HDF5 data type object and returns a new object handle for
it.<span style='mso-spacerun:yes'> </span>The binary description of the object
is encoded by <span style='font-size:10.0pt;font-family:"Courier New"'>H5Sencode</span>.<span
style='mso-spacerun:yes'> </span>User is responsible for passing in the right
buffer.</p>

<p class=MsoNormal style='margin-left:.5in'><o:p>&nbsp;</o:p></p>

<p class=MsoNormal style='margin-left:.5in'><strong><span style='font-weight:
normal'>The types of data space we address in this function are null, scalar,
and simple space.<span style='mso-spacerun:yes'> </span>For simple data space,
the information of selection, for example, <span class=SpellE>hyperslab</span> <span
class=GramE>selection,</span> is also encoded and decoded.<span
style='mso-spacerun:yes'> </span>Complex data space has not been implemented
in the library.<o:p></o:p></span></strong></p>

<p class=MsoNormal><strong>Parameters:</strong> </p>

<p class=MsoNormal><span class=GramE><em>unsigned</em></span><em> char*</em> <span
class=SpellE><code><span style='font-size:10.0pt'>buf</span></code></span> </p>

<p class=MsoNormal style='margin-left:.5in'>IN: Buffer for the data space
object to be decoded. </p>

<p class=MsoNormal><strong>Returns:</strong> </p>

<p class=MsoNormal style='margin-left:.5in'>Returns an object <span
class=GramE>ID(</span>non-negative) if successful; otherwise returns a negative
value.</p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>