summaryrefslogtreecommitdiffstats
path: root/doc/html/RM_H5Z.html
blob: fbfebf27e2a29b7b568ecf50457c436ac336135e (plain)
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
<html>
<head>
<title>
HDF5/H5Z 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>&nbsp;<br>
<a href="H5.intro.html">Introduction to HDF5</a>&nbsp;<br>
<a href="http://hdf.ncsa.uiuc.edu/HDF5/doc/UG/index.html">HDF5 User Guide</a>&nbsp;<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>&nbsp;&nbsp;<br>
<a href="RM_H5.html">H5</a>&nbsp;&nbsp;
<a href="RM_H5A.html">H5A</a>&nbsp;&nbsp;
<a href="RM_H5D.html">H5D</a>&nbsp;&nbsp;
<a href="RM_H5E.html">H5E</a>&nbsp;&nbsp;
<a href="RM_H5F.html">H5F</a>&nbsp;&nbsp;
<a href="RM_H5G.html">H5G</a>&nbsp;&nbsp;
<a href="RM_H5I.html">H5I</a>&nbsp;&nbsp;
<a href="RM_H5P.html">H5P</a>&nbsp;&nbsp;<br>
<a href="RM_H5R.html">H5R</a>&nbsp;&nbsp;
<a href="RM_H5S.html">H5S</a>&nbsp;&nbsp;
<a href="RM_H5T.html">H5T</a>&nbsp;&nbsp;
<a href="RM_H5Z.html">H5Z</a>&nbsp;&nbsp;
<a href="Tools.html">Tools</a>&nbsp;&nbsp;
<a href="PredefDTypes.html">Datatypes</a>&nbsp;&nbsp;
</td></tr>
<tr><td colspan="2" align="right">
<i><small>(<a href="http://hdf.ncsa.uiuc.edu/HDF5/doc/PSandPDF/">PDF</a>
of complete manual formatted as print volume)&nbsp;&nbsp;&nbsp;</small></i>
</td></tr>
</table>
</center>
<hr>
<!-- #EndLibraryItem --><center>
<h1>H5Z: Filter and Compression Interface</h1>
</center>

<h2>Filter and Compression API Functions</h2>

These functions enable the user to configure new filters
for the local environment.

<table border=0 width=80%>
<tr><td valign=top width="30%">
<ul>
    <li><a href="#Compression-FilterAvail">H5Zfilter_avail</a><br>
    <li><a href="#Compression-GetFilterInfo">H5Zget_filter_info</a>
</ul>
</td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td valign=top width="30%">
<ul>
    <li><a href="#Compression-Register">H5Zregister</a>
</ul>
</td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td valign=top width="30%">
<ul>
    <li><a href="#Compression-Unregister">H5Zunregister</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="30%">
    <ul>
    <li><a href="#Compression-FilterAvail">h5zfilter_avail_f</a>
    </ul>
</td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td valign=top width="30%">
    <ul>
<!--<li><a href="#Compression-Register">h5zregister_f</a><br>    -->
    <li><a href="#Compression-GetFilterInfo">h5zget_filter_info_f</a>
    </ul>
</td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td valign=top width="30%">
    <ul>
    <li><a href="#Compression-Unregister">h5zunregister_f</a>
    </ul>
</td></tr>
</table>

<p>
HDF5 supports a filter pipeline that provides the capability for standard 
and customized raw data processing during I/O operations.  
HDF5 is distributed with a small set of standard filters such as 
compression (gzip, SZIP, and a shuffling algorithm) and 
error checking (Fletcher32 checksum).
For further flexibility, the library allows a 
user application to extend the pipeline through the 
creation and registration of customized filters.
<p>
The flexibility of the filter pipeline implementation enables the 
definition of additional filters by a user application.
A filter
  <ul>
    <li>is associated with a dataset when the dataset is created,
    <li>can be used only with chunked data
        <br>(i.e., datasets stored in the <code>H5D_CHUNKED</code> 
        storage layout), and
    <li>is applied independently to each chunk of the dataset.
  </ul>
<p>
The HDF5 library does not support filters for contiguous datasets 
because of the difficulty of implementing random access for partial I/O. 
Compact dataset filters are not supported because it would not produce 
significant results.
<p>
Filter identifiers for the filters distributed with the HDF5 Library
are as follows:
<table align=center border=0>
  <tr valign=top align=left>
  <td>
    <code>H5Z_FILTER_DEFLATE</code></td><td>The gzip compression,
          or deflation, filter
  </td></tr><tr><td>
    <code>H5Z_FILTER_SZIP</code></td><td>The SZIP compression filter
  </td></tr><tr><td>
    <code>H5Z_FILTER_SHUFFLE</code></td><td>The shuffle algorithm filter
  </td></tr><tr><td>
    <code>H5Z_FILTER_FLETCHER32&nbsp;&nbsp;</code></td><td>The Fletcher32 checksum,
          or error checking, filter
  </td></tr>
</table>
Custom filters that have been registered with the library will have
additional unique identifiers.
<p>
See <a href="Datasets.html"><cite>The Dataset Interface (H5D)</cite></a> 
in the <cite>HDF5 User's Guide</cite> for further information regarding 
data compression.

<!-- NEW PAGE -->
<!-- HEADER RIGHT " " -->
<!-- NEW PAGE -->
<!-- HEADER RIGHT "H5Zfilter_avail" -->
<hr>
<dl>
  <dt><strong>Name:</strong> <a name="Compression-FilterAvail">H5Zfilter_avail</a>
  <dt><strong>Signature:</strong>
    <dd><em>herr_t</em> <code>H5Zfilter_avail</code>(<em>H5Z_filter_t</em> <code>filter</code>)
  <dt><strong>Purpose:</strong>
    <dd>Determines whether a filter is available.
  <dt><strong>Description:</strong>
    <dd><code>H5Zfilter_avail</code> determines whether the filter 
        specified in <code>filter</code> is available to the application.
  <dt><strong>Parameters:</strong>
    <ul><table>
        <tr>
		    <td valign="top"><em>H5Z_filter_t</em>&nbsp;<code>filter&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
            <td valign="top">IN: Filter identifier.
              See the introduction to this section of the reference manual 
              for a list of valid filter identifiers.</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> h5zfilter_avail_f
    <dd>
	<pre>
SUBROUTINE h5zfilter_avail_f(filter, status, hdferr)
  IMPLICIT NONE
  INTEGER, INTENT(IN)  :: filter     ! Filter
                                     ! Valid values are:
                                     !    H5Z_FILTER_DEFLATE_F
                                     !    H5Z_FILTER_SHUFFLE_F
                                     !    H5Z_FILTER_FLETCHER32_F
                                     !    H5Z_FILTER_SZIP_F
  LOGICAL, INTENT(OUT) :: status     ! Flag indicating whether 
                                     ! filter is available: 
                                     !    .TRUE.
                                     !    .FALSE.
END SUBROUTINE h5zfilter_avail_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>&nbsp;&nbsp;&nbsp;&nbsp;</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 "H5Zget_filter_info" -->
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Compression-GetFilterInfo">H5Zget_filter_info</a>
<dt><strong>Signature:</strong> 
    <dd><em>herr_t</em> 
        <code>H5Zget_filter_info</code>(
        <em>H5Z_filter_t</em> <code>filter</code>, 
        <em>unsigned int *</em><code>filter_config_flags</code>
        )
<dt><strong>Purpose:</strong>
    <dd>Retrieves information about a filter.
<dt><strong>Description:</strong>
    <dd>
      <code>H5Zget_filter_info</code> retrieves information about a filter.  
      At present, this means that the function retrieves a 
      filter's configuration flags, indicating whether the filter is  
      configured to decode data, to encode data, neither, or both.
      <p>
      If <code>filter_config_flags</code> is not set to <small>NULL</small>
      prior to the function call, the returned parameter contains a 
      bit field specifying the available filter configuration. 
      The configuration flag values can then be determined through
      a series of bitwise <small>AND</small> operations, as described below. 
      <p>
      Valid filter configuration flags include the following:
      <table>
        <tr><td><code>&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
          <td><code>H5Z_FILTER_CONFIG_ENCODE_ENABLED</code></td>
          <td>Encoding is enabled for this filter
        </td></tr>
        <tr><td>&nbsp;</td>
          <td><code>H5Z_FILTER_CONFIG_DECODE_ENABLED</code>&nbsp;&nbsp;&nbsp;&nbsp;</td>
          <td>Decoding is enabled for this filter
        </td></tr>
        <tr><td>&nbsp;</td>
          <td colspan="2" align="right"><small>(These flags 
          are defined in the HDF5 Library source code file 
          <code>H5Zpublic.h</code>.)</small>
        </td></tr>
       </table>
      A bitwise <small>AND</small> of the returned 
      <code>filter_config_flags</code> and a valid 
      filter configuration flag will reveal whether
      the related configuration option is available.
      For example, if the value of 
      <br>
      <code>&nbsp;&nbsp;&nbsp;&nbsp;
            H5Z_FILTER_CONFIG_ENCODE_ENABLED 
            &amp; 
            filter_config_flags</code>
      <br>
      is true, i.e., greater than <code>0</code> (zero), 
      the queried filter is configured to encode data;  
      if the value is <code>FALSE</code>, 
      i.e., equal to <code>0</code> (zero), 
      the filter is not so configured.
      <p>
      If a filter is not encode-enabled, the corresponding
      <code>H5Pset_*</code> function will return an error if the
      filter is added to a dataset creation property list (which is
      required if the filter is to be used to encode that dataset).
      For example, if the <code>H5Z_FILTER_CONFIG_ENCODE_ENABLED</code>
      flag is not returned for the SZIP filter,
      <code>H5Z_FILTER_SZIP</code>, a call to <code>H5Pset_szip</code>
      will fail.
      <p>
      If a filter is not decode-enabled, the application will not be
      able to read an existing file encoded with that filter.
      <p>
      This function should be called, and the returned
      <code>filter_config_flags</code> analyzed, before calling
      any other function, such as <code>H5Pset_szip</code>,
      that might require a particular filter configuration.

<dt><strong>Parameters:</strong>
    <dl>
      <dt><em>H5Z_filter_t</em> <code>filter</code>
        <dd>IN: Identifier of the filter to query.
            See the introduction to this section of the reference manual
            for a list of valid filter identifiers.
      <dt><em>unsigned int *</em><code>filter_config_flags</code>
        <dd>OUT: A bit field encoding the returned filter information
    </dl>
<dt><strong>Returns:</strong>
    <dd>Returns a non-negative value on success,
        a negative value on failure.

<!-- NEW PAGE -->
<dt><strong>Fortran90 Interface:</strong> 
    <dd>
    <pre>
SUBROUTINE h5zget_filter_info_f(filter, config_flags, hdferr)

  IMPLICIT NONE
  INTEGER, INTENT(IN)  :: filter        ! Filter, may be one of the
                                        ! following:
                                        !     H5Z_FILTER_DEFLATE_F
                                        !     H5Z_FILTER_SHUFFLE_F
                                        !     H5Z_FILTER_FLETCHER32_F
                                        !     H5Z_FILTER_SZIP_F
  INTEGER, INTENT(OUT) :: config_flags  ! Bit field indicating whether
                                        ! a filter's encoder and/or
                                        ! decoder are available
  INTEGER, INTENT(OUT) :: hdferr        ! Error code

END SUBROUTINE h5zfilter_avail_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>&nbsp;&nbsp;&nbsp;&nbsp;</td>
          <td valign="top" align="left">
		    <strong>C</strong></td>
		  <td valign="top" align="left">
		    &nbsp;&nbsp;&nbsp;&nbsp;</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">&nbsp;</td>
		  <td valign="top">
		    Fortran subroutine introduced in this 
			release.</td></tr>
    </table></ul>
</dl>


<!-- NEW PAGE -->
<!-- HEADER RIGHT "H5Zregister" -->
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Compression-Register">H5Zregister</a>
<dt><strong>Signature:</strong>
    <dd><em>herr_t</em> <code>H5Zregister</code>(<em>const H5Z_class_t</em> <code>filter_class</code>)
    )
<dt><strong>Purpose:</strong>
    <dd>Registers new filter.
<dt><strong>Description:</strong>
    <dd><code>H5Zregister</code> registers a new filter with the
      HDF5 library.  
      <p>
      Making a new filter available to an application is a two-step 
      process.  The first step is to write
      the three filter callback functions described below:
      <code>can_apply_func</code>, <code>set_local_func</code>, and
      <code>filter_func</code>.
      This call to <code>H5Zregister</code>, 
      <span class="termEmphasis">registering</span> the filter with the
      library, is the second step.  
      The <code>can_apply_func</code> and <code>set_local_func</code>
      fields can be set to <code>NULL</code> 
      if they are not required for the filter being registered.
      <p>
      <code>H5Zregister</code> accepts a single parameter, 
      the <code>filter_class</code> data structure, 
      which is defined as follows:
      <pre>
   &nbsp;   typedef struct H5Z_class_t {
   &nbsp;       H5Z_filter_t filter_id;
   &nbsp;       const char  *comment;
   &nbsp;       H5Z_can_apply_func_t can_apply_func;
   &nbsp;       H5Z_set_local_func_t set_local_func;
   &nbsp;       H5Z_func_t filter_func;            
   &nbsp;   } H5Z_class_t;
      </pre>
        
      <p>
      <code>filter_id</code> is the identifier for the new filter. 
      This is a user-defined value between 
      <code>H5Z_FILTER_RESERVED</code> and <code>H5Z_FILTER_MAX</code>, 
      both of which are defined in the HDF5 source file 
      <code>H5Zpublic.h</code>.
      <p>
      <code>comment</code> is used for debugging, 
      may contain a descriptive name for the filter, 
      and may be the null pointer. 
      <p>
      <code>can_apply_func</code>, described in detail below, 
      is a user-defined callback function which determines whether 
      the combination of the dataset creation property list values, 
      the datatype, and the dataspace represent a valid combination 
      to apply this filter to.
      <p>
      <code>set_local_func</code>, described in detail below, 
      is a user-defined callback function which sets any parameters that 
      are specific to this dataset, based on the combination of the 
      dataset creation property list values, the datatype, and the 
      dataspace.
      <p>
      <code>filter_func</code>, described in detail below, 
      is a user-defined callback function which performs the action 
      of the filter.
      <p>
      The statistics associated with a filter are not reset
      by this function; they accumulate over the life of the library.

      <p>
      <strong>The callback functions</strong> 
      <br>
      Before <code>H5Zregister</code> can link a filter into an 
      application, three callback functions must be defined 
      as described in the HDF5 Library header file <code>H5Zpublic.h</code>.

      <p>
      <u>The <i>can apply</i> callback function</u> is defined as follows:<br>
      <dir>
          <em>typedef herr_t</em> (*<code>H5Z_can_apply_func_t</code>)
          (<em>hid_t</em> <code>dcpl_id</code>,
          <em>hid_t</em> <code>type_id</code>,
          <em>hid_t</em> <code>space_id</code>)
      </dir>
      <p>
      Before a dataset is created, the <i>can apply</i> callbacks for 
      any filters used in the dataset creation property list are called
      with the dataset's dataset creation property list, <code>dcpl_id</code>,
      the dataset's datatype, <code>type_id</code>, and
      a dataspace describing a chunk, <code>space_id</code>,
      (for chunked dataset storage).
      <p>
      This callback must determine whether the combination of the 
      dataset creation property list settings, the datatype, and the 
      dataspace represent a valid combination to which to apply this filter.  
      For example, an invalid combination may involve 
      the filter not operating correctly on certain datatypes,
      on certain datatype sizes, or on certain sizes of the chunk dataspace.
      <p>
      This callback can be the <code>NULL</code> pointer, in which case 
      the library will assume that the filter can be applied to a dataset with 
      any combination of dataset creation property list values, datatypes, 
      and dataspaces.
      <p>
      The <i>can apply</i> callback function must return 
      a positive value for a valid combination, 
      zero for an invalid combination, and 
      a negative value for an error.

      <p>
      <u>The <i>set local</i> callback function</u> is defined as follows:<br>
      <dir>
          <em>typedef herr_t</em> (*<code>H5Z_set_local_func_t</code>)
          (<em>hid_t</em> <code>dcpl_id</code>,
          <em>hid_t</em> <code>type_id</code>,
          <em>hid_t</em> <code>space_id</code>)
      </dir>
      <p>
      After the <i>can apply</i> callbacks are checked for a new dataset, 
      the <i>set local</i> callback functions for any filters used in the 
      dataset creation property list are called.  
      These callbacks receive 
      <code>dcpl_id</code>, the dataset's private copy of the dataset
      creation property list passed in to <code>H5Dcreate</code> 
      (i.e. not the actual property list passed in to <code>H5Dcreate</code>);
      <code>type_id</code>, the datatype identifier passed in to 
      <code>H5Dcreate</code>, 
      which is not copied and should not be modified; and 
      <code>space_id</code>, a dataspace describing the chunk 
      (for chunked dataset storage), which should also not be modified.
      <p>
      The <i>set local</i> callback must set any filter parameters that are  
      specific to this dataset, based on the combination of the 
      dataset creation property list values, the datatype, and the dataspace.  
      For example, some filters perform different actions based on 
      different datatypes, datatype sizes, numbers of dimensions, 
      or dataspace sizes.
      <p>
      The <i>set local</i> callback may be the <code>NULL</code> pointer, 
      in which case, the library will assume that there are 
      no dataset-specific settings for this filter.
      <p>
      The <i>set local</i> callback function must return 
      a non-negative value on success and 
      a negative value for an error.

      <p>
      <u>The <i>filter operation</i> callback function</u>, 
      defining the filter's operation on the data, is defined as follows:
      <dir>
          <em>typedef size_t</em> (*<code>H5Z_func_t</code>)
          (<em>unsigned int</em> <code>flags</code>,
          <em>size_t</em> <code>cd_nelmts</code>,
          <em>const unsigned int</em> <code>cd_values[]</code>,
          <em>size_t</em> <code>nbytes</code>,
          <em>size_t *</em><code>buf_size</code>,
          <em>void **</em><code>buf</code>)
      </dir>

      <p>
      The parameters <code>flags</code>, <code>cd_nelmts</code>, 
      and <code>cd_values</code> are the same as for the function
      <a href="RM_H5P.html#Property-SetFilter"><code>H5Pset_filter</code></a>.
      The one exception is that an additional flag, 
      <code>H5Z_FLAG_REVERSE</code>, is set when 
      the filter is called as part of the input pipeline. 
      <p>
      The parameter <code>*buf</code> points to the input buffer 
      which has a size of <code>*buf_size</code> bytes,
      <code>nbytes</code> of which are valid data. 
      <p>
      The filter should perform the transformation in place if
      possible.  If the transformation cannot be done in place, 
      then the filter should allocate a new buffer with
      <code>malloc()</code> and assign it to <code>*buf</code>,
      assigning the allocated size of that buffer to
      <code>*buf_size</code>. 
      The old buffer should be freed by calling <code>free()</code>.
      <p>
      If successful, the <i>filter operation</i> callback function 
      returns the number of valid bytes of data contained in <code>*buf</code>.
      In the case of failure, the return value is <code>0</code> (zero)
      and all pointer arguments are left unchanged.
<dt><strong>Note:</strong>
    <dd>The <code>H5Zregister</code> interface is substantially revised 
      from the HDF5 Release 1.4.x series.  
      The <code>H5Z_class_t</code> struct and 
      the <i>set local</i> and <i>can apply</i> callback functions
      first appeared in HDF5 Release 1.6.
<dt><strong>Parameters:</strong>
    <ul><table>
        <tr>
		    <td valign="top"><em>const&nbsp;H5Z_class_t</em>&nbsp;<code>filter_class&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
            <td valign="top">IN: Struct containing filter-definition information.</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>
    <dd>None.
<!--
	<pre>

	</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>&nbsp;&nbsp;&nbsp;&nbsp;</td>
          <td valign="top" align="left">
		    <strong>C</strong></td></tr>
        <tr>
		  <td valign="top">1.6.0</td>
          <td valign="top">
		    This function is substantially revised in 
			Release 1.6.0 with a new <code>H5Z_class_t</code> 
			struct and new <em>set local</em> and <em>can apply</em> 
			callback functions.</td></tr>
    </table></ul>
</dl>

<!-- NEW PAGE -->
<!-- HEADER RIGHT "H5Zunregister" -->
<hr>
<dl>
  <dt><strong>Name:</strong> <a name="Compression-Unregister">H5Zunregister</a>
  <dt><strong>Signature:</strong>
    <dd><em>herr_t</em> <code>H5Zunregister</code>(<em>H5Z_filter_t</em> <code>filter</code>)
  <dt><strong>Purpose:</strong>
    <dd>Unregisters a filter.
  <dt><strong>Description:</strong>
    <dd><code>H5Zunregister</code> unregisters the filter 
        specified in <code>filter</code>.  
	<p>
	After a call to <code>H5Zunregister</code>, the filter
	specified in <code>filter</code> will no longer be 
	available to the application.
  <dt><strong>Parameters:</strong>
    <ul><table>
        <tr>
		    <td valign="top"><em>H5Z_filter_t</em>&nbsp;<code>filter&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
            <td valign="top">IN: Identifier of the filter to be unregistered.
                See the introduction to this section of the reference manual 
                for a list of identifiers for standard filters
                distributed with the HDF5 Library.</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> h5zunregister_f
    <dd>
	<pre>
SUBROUTINE h5zunregister_f(filter, hdferr) 
  IMPLICIT NONE
  INTEGER, INTENT(IN)  :: filter  ! Filter; one of the possible values:
                                  !    H5Z_FILTER_DEFLATE_F
                                  !    H5Z_FILTER_SHUFFLE_F
                                  !    H5Z_FILTER_FLETCHER32_F
                                  !    H5Z_FILTER_SZIP_F
  INTEGER, INTENT(OUT) :: hdferr  ! Error code
                                  ! 0 on success, and -1 on failure
END SUBROUTINE h5zunregister_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>&nbsp;&nbsp;&nbsp;&nbsp;</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>


<!-- #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>&nbsp;<br>
<a href="H5.intro.html">Introduction to HDF5</a>&nbsp;<br>
<a href="http://hdf.ncsa.uiuc.edu/HDF5/doc/UG/index.html">HDF5 User Guide</a>&nbsp;<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>&nbsp;&nbsp;<br>
<a href="RM_H5.html">H5</a>&nbsp;&nbsp;
<a href="RM_H5A.html">H5A</a>&nbsp;&nbsp;
<a href="RM_H5D.html">H5D</a>&nbsp;&nbsp;
<a href="RM_H5E.html">H5E</a>&nbsp;&nbsp;
<a href="RM_H5F.html">H5F</a>&nbsp;&nbsp;
<a href="RM_H5G.html">H5G</a>&nbsp;&nbsp;
<a href="RM_H5I.html">H5I</a>&nbsp;&nbsp;
<a href="RM_H5P.html">H5P</a>&nbsp;&nbsp;<br>
<a href="RM_H5R.html">H5R</a>&nbsp;&nbsp;
<a href="RM_H5S.html">H5S</a>&nbsp;&nbsp;
<a href="RM_H5T.html">H5T</a>&nbsp;&nbsp;
<a href="RM_H5Z.html">H5Z</a>&nbsp;&nbsp;
<a href="Tools.html">Tools</a>&nbsp;&nbsp;
<a href="PredefDTypes.html">Datatypes</a>&nbsp;&nbsp;
</td></tr>
<tr><td colspan="2" align="right">
<i><small>(<a href="http://hdf.ncsa.uiuc.edu/HDF5/doc/PSandPDF/">PDF</a>
of complete manual formatted as print volume)&nbsp;&nbsp;&nbsp;</small></i>
</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.6.5, November 2005
</address>
<!-- #EndLibraryItem --><SCRIPT LANGUAGE="JAVASCRIPT">
<!--
document.writeln("Last modified:  2 September 2004");
-->
</SCRIPT>
 
</body>
</html>