netcdf_sys/
filter.rs

1use std::os::raw::{c_char, c_int, c_uint, c_void};
2
3extern "C" {
4    pub fn nc_inq_var_filter_ids(
5        ncid: c_int,
6        varid: c_int,
7        nfilters: *mut usize,
8        filterids: *mut c_uint,
9    ) -> c_int;
10
11    pub fn nc_inq_var_filter_info(
12        ncid: c_int,
13        varid: c_int,
14        id: c_uint,
15        nparams: *mut usize,
16        params: *mut c_uint,
17    ) -> c_int;
18
19    pub fn nc_inq_filter_avail(ncid: c_int, id: c_uint) -> c_int;
20
21}
22
23#[cfg(feature = "4.9.0")]
24extern "C" {
25    pub fn nc_def_var_bzip2(ncid: c_int, varid: c_int, level: c_int) -> c_int;
26    pub fn nc_inq_var_bzip2(
27        ncid: c_int,
28        varid: c_int,
29        hasfilterp: *mut c_int,
30        levelp: *mut c_int,
31    ) -> c_int;
32
33    pub fn nc_def_var_zstandard(ncid: c_int, varid: c_int, level: c_int) -> c_int;
34    pub fn nc_inq_var_zstandard(
35        ncid: c_int,
36        varid: c_int,
37        hasfilterp: *mut c_int,
38        levelp: *mut c_int,
39    ) -> c_int;
40
41    pub fn nc_def_var_blosc(
42        ncid: c_int,
43        varid: c_int,
44        subcompressor: c_uint,
45        level: c_uint,
46        blocksize: c_uint,
47        addshuffle: c_uint,
48    ) -> c_int;
49    pub fn nc_inq_var_blosc(
50        ncid: c_int,
51        varid: c_int,
52        hasfilterp: *mut c_int,
53        subpcompressorp: *mut c_uint,
54        levelp: *mut c_uint,
55        blocsizep: *mut c_uint,
56        addshufflep: *mut c_uint,
57    ) -> c_int;
58}
59
60pub const NCZ_CODEC_CLASS_VER: c_int = 1;
61pub const NCZ_CODEC_HDF5: c_int = 1;
62pub const NCZ_FILTER_DECODE: usize = 0x00000001;
63
64pub type NCZ_get_codec_info_proto = unsafe extern "C" fn() -> *const c_void;
65
66pub type NCZ_codec_info_defaults_proto = unsafe extern "C" fn() -> *const c_void;
67
68#[repr(C)]
69#[derive(Copy, Clone)]
70pub struct NCZ_codec_t {
71    pub version: c_int,
72    pub sort: c_int,
73
74    pub codecid: *const c_char,
75    pub hdf5id: c_uint,
76    pub NCZ_codec_initialize: Option<unsafe extern "C" fn() -> c_void>,
77    pub NCZ_codec_finalize: Option<unsafe extern "C" fn() -> c_void>,
78
79    pub NCZ_codec_to_hdf5: Option<
80        unsafe extern "C" fn(
81            codec: *const c_void,
82            nparamsp: *mut usize,
83            paramsp: *mut *mut c_uint,
84        ) -> c_int,
85    >,
86    pub NCZ_hdf5_to_codec: Option<
87        unsafe extern "C" fn(
88            nparams: usize,
89            params: *const c_uint,
90            codecp: *mut *mut c_char,
91        ) -> c_int,
92    >,
93    pub NCZ_modify_parameters: Option<
94        unsafe extern "C" fn(
95            ncid: c_int,
96            varid: c_int,
97            vnparamsp: *mut usize,
98            vparamsp: *mut *mut c_uint,
99            wnparamsp: *mut usize,
100            wparamsp: *mut *mut c_uint,
101        ) -> c_int,
102    >,
103}