sasl2_sys/
prop.rs

1// Copyright Materialize, Inc. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License in the LICENSE file at the
6// root of this repository, or online at
7//
8//     http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16//! Property request/response management routines.
17
18use libc::{c_char, c_uint};
19
20pub const PROP_DEFAULT: c_uint = 4;
21
22#[repr(C)]
23#[derive(Debug, Copy, Clone)]
24pub struct propval {
25    pub name: *const c_char,
26    pub values: *mut *const c_char,
27    pub nvalues: c_uint,
28    pub valsize: c_uint,
29}
30
31#[repr(C)]
32#[derive(Debug, Copy, Clone)]
33pub struct propctx {
34    _unused: [u8; 0],
35}
36
37extern "C" {
38    pub fn prop_new(estimate: c_uint) -> *mut propctx;
39
40    pub fn prop_dup(src_ctx: *mut propctx, dst_ctx: *mut *mut propctx) -> ::std::os::raw::c_int;
41
42    pub fn prop_request(ctx: *mut propctx, names: *mut *const c_char) -> ::std::os::raw::c_int;
43
44    pub fn prop_get(ctx: *mut propctx) -> *const propval;
45
46    pub fn prop_getnames(
47        ctx: *mut propctx,
48        names: *mut *const c_char,
49        vals: *mut propval,
50    ) -> ::std::os::raw::c_int;
51
52    pub fn prop_clear(ctx: *mut propctx, requests: ::std::os::raw::c_int);
53
54    pub fn prop_erase(ctx: *mut propctx, name: *const c_char);
55
56    pub fn prop_dispose(ctx: *mut *mut propctx);
57
58    pub fn prop_format(
59        ctx: *mut propctx,
60        sep: *const c_char,
61        seplen: ::std::os::raw::c_int,
62        outbuf: *mut c_char,
63        outmax: c_uint,
64        outlen: *mut c_uint,
65    ) -> ::std::os::raw::c_int;
66
67    pub fn prop_set(
68        ctx: *mut propctx,
69        name: *const c_char,
70        value: *const c_char,
71        vallen: ::std::os::raw::c_int,
72    ) -> ::std::os::raw::c_int;
73
74    pub fn prop_setvals(
75        ctx: *mut propctx,
76        name: *const c_char,
77        values: *mut *const c_char,
78    ) -> ::std::os::raw::c_int;
79}