Skip to main content

cqdb_sys/
lib.rs

1/* automatically generated by rust-bindgen 0.70.1 */
2#![allow(non_camel_case_types)]
3#![allow(non_upper_case_globals)]
4#![allow(non_snake_case)]
5
6use libc::{c_char, c_int, c_uint, c_void, FILE};
7
8#[doc = "< No flag."]
9pub const CQDB_NONE: c_uint = 0;
10#[doc = "< A reverse lookup array is omitted."]
11pub const CQDB_ONEWAY: c_uint = 1;
12#[doc = "< An error has occurred."]
13pub const CQDB_ERROR_OCCURRED: c_uint = 65536;
14
15#[doc = "< Success."]
16pub const CQDB_SUCCESS: c_int = 0;
17#[doc = "< Unspecified error."]
18pub const CQDB_ERROR: c_int = -1024;
19#[doc = "< String not found."]
20pub const CQDB_ERROR_NOTFOUND: c_int = -1023;
21#[doc = "< Insufficient memory."]
22pub const CQDB_ERROR_OUTOFMEMORY: c_int = -1022;
23#[doc = "< Error in fwrite() operations."]
24pub const CQDB_ERROR_FILEWRITE: c_int = -1021;
25#[doc = "< Error in ftell() operations."]
26pub const CQDB_ERROR_FILETELL: c_int = -1020;
27#[doc = "< Error in fseek() operations."]
28pub const CQDB_ERROR_FILESEEK: c_int = -1019;
29#[doc = "< Invalid parameters."]
30pub const CQDB_ERROR_INVALIDID: c_int = -1018;
31
32#[doc = " CQDB Writer API\n\n    The CQDB Writer API constructs a CQDB chunk on a seekable stream."]
33#[repr(C)]
34#[derive(Debug, Copy, Clone)]
35pub struct tag_cqdb_writer {
36    _unused: [u8; 0],
37}
38pub type cqdb_writer_t = tag_cqdb_writer;
39
40extern "C" {
41    #[doc = " Create a new CQDB writer on a seekable stream."]
42    pub fn cqdb_writer(fp: *mut FILE, flag: c_int) -> *mut cqdb_writer_t;
43}
44extern "C" {
45    #[doc = " Put a string/identifier association to the database."]
46    pub fn cqdb_writer_put(
47        dbw: *mut cqdb_writer_t,
48        str_: *const c_char,
49        id: c_int,
50    ) -> c_int;
51}
52extern "C" {
53    #[doc = " Close a CQDB writer."]
54    pub fn cqdb_writer_close(dbw: *mut cqdb_writer_t) -> c_int;
55}
56
57#[doc = " CQDB Reader API\n\n    The CQDB reader API provides a read access to the database."]
58#[repr(C)]
59#[derive(Debug, Copy, Clone)]
60pub struct tag_cqdb {
61    _unused: [u8; 0],
62}
63pub type cqdb_t = tag_cqdb;
64
65extern "C" {
66    #[doc = " Open a new CQDB reader on a memory block."]
67    pub fn cqdb_reader(buffer: *const c_void, size: usize) -> *mut cqdb_t;
68}
69extern "C" {
70    #[doc = " Delete the CQDB reader."]
71    pub fn cqdb_delete(db: *mut cqdb_t);
72}
73extern "C" {
74    #[doc = " Retrieve the identifier associated with a string."]
75    pub fn cqdb_to_id(db: *mut cqdb_t, str_: *const c_char) -> c_int;
76}
77extern "C" {
78    #[doc = " Retrieve the string associated with an identifier."]
79    pub fn cqdb_to_string(db: *mut cqdb_t, id: c_int) -> *const c_char;
80}
81extern "C" {
82    #[doc = " Get the number of associations in the database."]
83    pub fn cqdb_num(db: *mut cqdb_t) -> c_int;
84}