summaryrefslogtreecommitdiffstats
path: root/fortran/src/H5Zf.c
blob: 607992f2d37f89794436b966c1a7b3309e988d50 (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
/****h* H5Zf/H5Zf
 * PURPOSE
 *  This file contains C stubs for H5Z Fortran APIs
 *
 * COPYRIGHT
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Copyright by The HDF Group.                                               *
 * 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 COPYING file, which can be found at the root of the source code       *
 * distribution tree, or in https://www.hdfgroup.org/licenses.               *
 * If you do not have access to either file, you may request a copy from     *
 * help@hdfgroup.org.                                                        *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *
 ******
 */

#include "H5f90.h"

/****if* H5Zf/h5zunregister_c
 * NAME
 *  h5zunregister_c
 * PURPOSE
 *  Call H5Zunregister to unregister filter
 * INPUTS
 *  filter identifier
 * RETURNS
 *  0 on success, -1 on failure
 * SOURCE
 */
int_f
h5zunregister_c(int_f *filter)
/******/
{
    int          ret_value = -1;
    herr_t       status;
    H5Z_filter_t c_filter;

    /*
     * Call H5Zunregister function.
     */
    c_filter = (H5Z_filter_t)*filter;
    status   = H5Zunregister(c_filter);
    if (status < 0)
        return ret_value;
    ret_value = 0;
    return ret_value;
}
/****if* H5Zf/h5zfiletr_avail_c
 * NAME
 *  h5zfiletr_avail_c
 * PURPOSE
 *  Call H5Zfilter_avail to find if filter is available
 * INPUTS
 *  filter - filter identifier
 * OUTPUTS
 *  flag - status flag
 * RETURNS
 *  0 on success, -1 on failure
 * SOURCE
 */

int_f
h5zfilter_avail_c(int_f *filter, int_f *flag)
/******/
{
    int          ret_value = 0;
    H5Z_filter_t c_filter;
    htri_t       status;

    c_filter = (H5Z_filter_t)*filter;
    status   = H5Zfilter_avail(c_filter);
    *flag    = (int_f)status;
    if (status < 0)
        ret_value = -1;
    return ret_value;
}

/****if* H5Zf/h5zget_filter_info_c
 * NAME
 *  h5zget_filter_info_c
 * PURPOSE
 *  Call H5Zget_filter_info to find if filter has its encoder
 *  and/or its decoder available
 * INPUTS
 *  filter - filter identifier
 * OUTPUTS
 *  flag - status flag
 * RETURNS
 *  0 on success, -1 on failure
 * SOURCE
 */

int_f
h5zget_filter_info_c(int_f *filter, int_f *flag)
/******/
{
    int          ret_value = 0;
    H5Z_filter_t c_filter;
    unsigned int c_flag;

    c_filter  = (H5Z_filter_t)*filter;
    ret_value = H5Zget_filter_info(c_filter, &c_flag);
    *flag     = (int_f)c_flag;

    return ret_value;
}