pub const MDBX_ENODATA: ::libc::c_uint = 96;
pub const MDBX_EINVAL: ::libc::c_uint = 22;
pub const MDBX_EACCESS: ::libc::c_uint = 13;
pub const MDBX_ENOMEM: ::libc::c_uint = 12;
pub const MDBX_EROFS: ::libc::c_uint = 30;
pub const MDBX_ENOSYS: ::libc::c_uint = 78;
pub const MDBX_EIO: ::libc::c_uint = 5;
pub const MDBX_EPERM: ::libc::c_uint = 1;
pub const MDBX_EINTR: ::libc::c_uint = 4;
pub const MDBX_ENOFILE: ::libc::c_uint = 2;
pub const MDBX_EREMOTE: ::libc::c_uint = 15;
pub const MDBX_VERSION_MAJOR: ::libc::c_uint = 0;
pub const MDBX_VERSION_MINOR: ::libc::c_uint = 7;
pub const MDBX_MAXDATASIZE: ::libc::c_uint = 2147483647;
pub const MDBX_LOG_FATAL: ::libc::c_uint = 0;
pub const MDBX_LOG_ERROR: ::libc::c_uint = 1;
pub const MDBX_LOG_WARN: ::libc::c_uint = 2;
pub const MDBX_LOG_NOTICE: ::libc::c_uint = 3;
pub const MDBX_LOG_VERBOSE: ::libc::c_uint = 4;
pub const MDBX_LOG_DEBUG: ::libc::c_uint = 5;
pub const MDBX_LOG_TRACE: ::libc::c_uint = 6;
pub const MDBX_LOG_EXTRA: ::libc::c_uint = 7;
pub const MDBX_DBG_ASSERT: ::libc::c_uint = 1;
pub const MDBX_DBG_AUDIT: ::libc::c_uint = 2;
pub const MDBX_DBG_JITTER: ::libc::c_uint = 4;
pub const MDBX_DBG_DUMP: ::libc::c_uint = 8;
pub const MDBX_DBG_LEGACY_MULTIOPEN: ::libc::c_uint = 16;
pub const MDBX_DBG_LEGACY_OVERLAP: ::libc::c_uint = 32;
pub const MDBX_LOG_DONTCHANGE: ::libc::c_int = -1;
pub const MDBX_DBG_DONTCHANGE: ::libc::c_int = -1;
pub const MDBX_LOCKNAME: &'static [u8; 10usize] = b"/mdbx.lck\0";
pub const MDBX_DATANAME: &'static [u8; 10usize] = b"/mdbx.dat\0";
pub const MDBX_LOCK_SUFFIX: &'static [u8; 5usize] = b"-lck\0";
pub const MDBX_NOSUBDIR: ::libc::c_uint = 16384;
pub const MDBX_RDONLY: ::libc::c_uint = 131072;
pub const MDBX_EXCLUSIVE: ::libc::c_uint = 4194304;
pub const MDBX_ACCEDE: ::libc::c_uint = 1073741824;
pub const MDBX_WRITEMAP: ::libc::c_uint = 524288;
pub const MDBX_NOTLS: ::libc::c_uint = 2097152;
pub const MDBX_NORDAHEAD: ::libc::c_uint = 8388608;
pub const MDBX_NOMEMINIT: ::libc::c_uint = 16777216;
pub const MDBX_COALESCE: ::libc::c_uint = 33554432;
pub const MDBX_LIFORECLAIM: ::libc::c_uint = 67108864;
pub const MDBX_PAGEPERTURB: ::libc::c_uint = 134217728;
pub const MDBX_NOMETASYNC: ::libc::c_uint = 262144;
pub const MDBX_SAFE_NOSYNC: ::libc::c_uint = 65536;
pub const MDBX_MAPASYNC: ::libc::c_uint = 1048576;
pub const MDBX_UTTERLY_NOSYNC: ::libc::c_uint = 1114112;
pub const MDBX_REVERSEKEY: ::libc::c_uint = 2;
pub const MDBX_DUPSORT: ::libc::c_uint = 4;
pub const MDBX_INTEGERKEY: ::libc::c_uint = 8;
pub const MDBX_DUPFIXED: ::libc::c_uint = 16;
pub const MDBX_INTEGERDUP: ::libc::c_uint = 32;
pub const MDBX_REVERSEDUP: ::libc::c_uint = 64;
pub const MDBX_CREATE: ::libc::c_uint = 262144;
pub const MDBX_NOOVERWRITE: ::libc::c_uint = 16;
pub const MDBX_NODUPDATA: ::libc::c_uint = 32;
pub const MDBX_CURRENT: ::libc::c_uint = 64;
pub const MDBX_RESERVE: ::libc::c_uint = 65536;
pub const MDBX_APPEND: ::libc::c_uint = 131072;
pub const MDBX_APPENDDUP: ::libc::c_uint = 262144;
pub const MDBX_MULTIPLE: ::libc::c_uint = 524288;
pub const MDBX_TRYTXN: ::libc::c_uint = 268435456;
pub const MDBX_CP_COMPACT: ::libc::c_uint = 1;
pub const MDBX_SUCCESS: ::libc::c_int = 0;
pub const MDBX_RESULT_FALSE: ::libc::c_uint = 0;
pub const MDBX_RESULT_TRUE: ::libc::c_int = -1;
pub const MDBX_KEYEXIST: ::libc::c_int = -30799;
pub const MDBX_NOTFOUND: ::libc::c_int = -30798;
pub const MDBX_PAGE_NOTFOUND: ::libc::c_int = -30797;
pub const MDBX_CORRUPTED: ::libc::c_int = -30796;
pub const MDBX_PANIC: ::libc::c_int = -30795;
pub const MDBX_VERSION_MISMATCH: ::libc::c_int = -30794;
pub const MDBX_INVALID: ::libc::c_int = -30793;
pub const MDBX_MAP_FULL: ::libc::c_int = -30792;
pub const MDBX_DBS_FULL: ::libc::c_int = -30791;
pub const MDBX_READERS_FULL: ::libc::c_int = -30790;
pub const MDBX_TXN_FULL: ::libc::c_int = -30788;
pub const MDBX_CURSOR_FULL: ::libc::c_int = -30787;
pub const MDBX_PAGE_FULL: ::libc::c_int = -30786;
pub const MDBX_UNABLE_EXTEND_MAPSIZE: ::libc::c_int = -30785;
pub const MDBX_INCOMPATIBLE: ::libc::c_int = -30784;
pub const MDBX_BAD_RSLOT: ::libc::c_int = -30783;
pub const MDBX_BAD_TXN: ::libc::c_int = -30782;
pub const MDBX_BAD_VALSIZE: ::libc::c_int = -30781;
pub const MDBX_BAD_DBI: ::libc::c_int = -30780;
pub const MDBX_PROBLEM: ::libc::c_int = -30779;
pub const MDBX_LAST_LMDB_ERRCODE: ::libc::c_int = -30779;
pub const MDBX_BUSY: ::libc::c_int = -30778;
pub const MDBX_EMULTIVAL: ::libc::c_int = -30421;
pub const MDBX_EBADSIGN: ::libc::c_int = -30420;
pub const MDBX_WANNA_RECOVERY: ::libc::c_int = -30419;
pub const MDBX_EKEYMISMATCH: ::libc::c_int = -30418;
pub const MDBX_TOO_LARGE: ::libc::c_int = -30417;
pub const MDBX_THREAD_MISMATCH: ::libc::c_int = -30416;
pub const MDBX_TXN_OVERLAPPING: ::libc::c_int = -30415;
pub const MDBX_MIN_PAGESIZE: ::libc::c_uint = 256;
pub const MDBX_MAX_PAGESIZE: ::libc::c_uint = 65536;
pub const MDBX_TBL_DIRTY: ::libc::c_uint = 1;
pub const MDBX_TBL_STALE: ::libc::c_uint = 2;
pub const MDBX_TBL_FRESH: ::libc::c_uint = 4;
pub const MDBX_TBL_CREAT: ::libc::c_uint = 8;
pub type va_list = __builtin_va_list;
pub type __uint16_t = ::libc::c_ushort;
pub type __int32_t = ::libc::c_int;
pub type __darwin_intptr_t = ::libc::c_long;
pub type __darwin_mode_t = __uint16_t;
pub type __darwin_pid_t = __int32_t;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct __darwin_pthread_handler_rec {
pub __routine: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::libc::c_void)>,
pub __arg: *mut ::libc::c_void,
pub __next: *mut __darwin_pthread_handler_rec,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct _opaque_pthread_t {
pub __sig: ::libc::c_long,
pub __cleanup_stack: *mut __darwin_pthread_handler_rec,
pub __opaque: [::libc::c_char; 8176usize],
}
pub type __darwin_pthread_t = *mut _opaque_pthread_t;
pub type pthread_t = __darwin_pthread_t;
pub type pid_t = __darwin_pid_t;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct iovec {
pub iov_base: *mut ::libc::c_void,
pub iov_len: usize,
}
pub type mdbx_pid_t = pid_t;
pub type mdbx_tid_t = pthread_t;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct mdbx_version_info {
pub major: u8,
pub minor: u8,
pub release: u16,
pub revision: u32,
pub git: mdbx_version_info__bindgen_ty_1,
pub sourcery: *const ::libc::c_char,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct mdbx_version_info__bindgen_ty_1 {
pub datetime: *const ::libc::c_char,
pub tree: *const ::libc::c_char,
pub commit: *const ::libc::c_char,
pub describe: *const ::libc::c_char,
}
extern "C" {
pub static mdbx_version: mdbx_version_info;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct mdbx_build_info {
pub datetime: *const ::libc::c_char,
pub target: *const ::libc::c_char,
pub options: *const ::libc::c_char,
pub compiler: *const ::libc::c_char,
pub flags: *const ::libc::c_char,
}
extern "C" {
pub static mdbx_build: mdbx_build_info;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MDBX_env {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MDBX_txn {
_unused: [u8; 0],
}
pub type MDBX_dbi = u32;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MDBX_cursor {
_unused: [u8; 0],
}
pub type MDBX_val = iovec;
pub type MDBX_debug_func = ::std::option::Option<
unsafe extern "C" fn(
loglevel: ::libc::c_int,
function: *const ::libc::c_char,
line: ::libc::c_int,
msg: *const ::libc::c_char,
args: *mut __va_list_tag,
),
>;
extern "C" {
pub fn mdbx_setup_debug(
loglevel: ::libc::c_int,
flags: ::libc::c_int,
logger: MDBX_debug_func,
) -> ::libc::c_int;
}
pub type MDBX_assert_func = ::std::option::Option<
unsafe extern "C" fn(
env: *const MDBX_env,
msg: *const ::libc::c_char,
function: *const ::libc::c_char,
line: ::libc::c_uint,
),
>;
extern "C" {
pub fn mdbx_env_set_assert(env: *mut MDBX_env, func: MDBX_assert_func) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_dump_val(
key: *const MDBX_val,
buf: *mut ::libc::c_char,
bufsize: usize,
) -> *const ::libc::c_char;
}
#[repr(u32)]
#[doc = " CURSOR OPERATIONS ********************************************************"]
#[doc = ""]
#[doc = " This is the set of all operations for retrieving data"]
#[doc = " using a cursor."]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum MDBX_cursor_op {
MDBX_FIRST = 0,
MDBX_FIRST_DUP = 1,
MDBX_GET_BOTH = 2,
MDBX_GET_BOTH_RANGE = 3,
MDBX_GET_CURRENT = 4,
MDBX_GET_MULTIPLE = 5,
MDBX_LAST = 6,
MDBX_LAST_DUP = 7,
MDBX_NEXT = 8,
MDBX_NEXT_DUP = 9,
MDBX_NEXT_MULTIPLE = 10,
MDBX_NEXT_NODUP = 11,
MDBX_PREV = 12,
MDBX_PREV_DUP = 13,
MDBX_PREV_NODUP = 14,
MDBX_SET = 15,
MDBX_SET_KEY = 16,
MDBX_SET_RANGE = 17,
MDBX_PREV_MULTIPLE = 18,
}
extern "C" {
#[doc = " FUNCTIONS & RELATED STRUCTURES"]
pub fn mdbx_strerror(errnum: ::libc::c_int) -> *const ::libc::c_char;
}
extern "C" {
pub fn mdbx_strerror_r(
errnum: ::libc::c_int,
buf: *mut ::libc::c_char,
buflen: usize,
) -> *const ::libc::c_char;
}
extern "C" {
pub fn mdbx_env_create(penv: *mut *mut MDBX_env) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_env_open(
env: *mut MDBX_env,
pathname: *const ::libc::c_char,
flags: ::libc::c_uint,
mode: mode_t,
) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_env_copy(
env: *mut MDBX_env,
dest: *const ::libc::c_char,
flags: ::libc::c_uint,
) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_env_copy2fd(
env: *mut MDBX_env,
fd: mdbx_filehandle_t,
flags: ::libc::c_uint,
) -> ::libc::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MDBX_stat {
pub ms_psize: u32,
pub ms_depth: u32,
pub ms_branch_pages: u64,
pub ms_leaf_pages: u64,
pub ms_overflow_pages: u64,
pub ms_entries: u64,
pub ms_mod_txnid: u64,
}
extern "C" {
pub fn mdbx_env_stat_ex(
env: *const MDBX_env,
txn: *const MDBX_txn,
stat: *mut MDBX_stat,
bytes: usize,
) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_env_stat(env: *mut MDBX_env, stat: *mut MDBX_stat, bytes: usize) -> ::libc::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MDBX_envinfo {
pub mi_geo: MDBX_envinfo__bindgen_ty_1,
pub mi_mapsize: u64,
pub mi_last_pgno: u64,
pub mi_recent_txnid: u64,
pub mi_latter_reader_txnid: u64,
pub mi_self_latter_reader_txnid: u64,
pub mi_meta0_txnid: u64,
pub mi_meta0_sign: u64,
pub mi_meta1_txnid: u64,
pub mi_meta1_sign: u64,
pub mi_meta2_txnid: u64,
pub mi_meta2_sign: u64,
pub mi_maxreaders: u32,
pub mi_numreaders: u32,
pub mi_dxb_pagesize: u32,
pub mi_sys_pagesize: u32,
pub mi_bootid: MDBX_envinfo__bindgen_ty_2,
pub mi_unsync_volume: u64,
pub mi_autosync_threshold: u64,
pub mi_since_sync_seconds16dot16: u32,
pub mi_autosync_period_seconds16dot16: u32,
pub mi_since_reader_check_seconds16dot16: u32,
pub mi_mode: u32,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MDBX_envinfo__bindgen_ty_1 {
pub lower: u64,
pub upper: u64,
pub current: u64,
pub shrink: u64,
pub grow: u64,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MDBX_envinfo__bindgen_ty_2 {
pub current: MDBX_envinfo__bindgen_ty_2__bindgen_ty_1,
pub meta0: MDBX_envinfo__bindgen_ty_2__bindgen_ty_1,
pub meta1: MDBX_envinfo__bindgen_ty_2__bindgen_ty_1,
pub meta2: MDBX_envinfo__bindgen_ty_2__bindgen_ty_1,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MDBX_envinfo__bindgen_ty_2__bindgen_ty_1 {
pub l: u64,
pub h: u64,
}
extern "C" {
pub fn mdbx_env_info_ex(
env: *const MDBX_env,
txn: *const MDBX_txn,
info: *mut MDBX_envinfo,
bytes: usize,
) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_env_info(
env: *mut MDBX_env,
info: *mut MDBX_envinfo,
bytes: usize,
) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_env_sync_ex(
env: *mut MDBX_env,
force: ::libc::c_int,
nonblock: ::libc::c_int,
) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_env_sync(env: *mut MDBX_env) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_env_sync_poll(env: *mut MDBX_env) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_env_set_syncbytes(env: *mut MDBX_env, threshold: usize) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_env_set_syncperiod(
env: *mut MDBX_env,
seconds_16dot16: ::libc::c_uint,
) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_env_close_ex(env: *mut MDBX_env, dont_sync: ::libc::c_int) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_env_close(env: *mut MDBX_env) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_env_set_flags(
env: *mut MDBX_env,
flags: ::libc::c_uint,
onoff: ::libc::c_int,
) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_env_get_flags(env: *mut MDBX_env, flags: *mut ::libc::c_uint) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_env_get_path(env: *mut MDBX_env, dest: *mut *const ::libc::c_char)
-> ::libc::c_int;
}
extern "C" {
pub fn mdbx_env_get_fd(env: *mut MDBX_env, fd: *mut mdbx_filehandle_t) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_env_set_geometry(
env: *mut MDBX_env,
size_lower: isize,
size_now: isize,
size_upper: isize,
growth_step: isize,
shrink_threshold: isize,
pagesize: isize,
) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_env_set_mapsize(env: *mut MDBX_env, size: usize) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_is_readahead_reasonable(volume: usize, redundancy: isize) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_limits_dbsize_min(pagesize: isize) -> isize;
}
extern "C" {
pub fn mdbx_limits_dbsize_max(pagesize: isize) -> isize;
}
extern "C" {
pub fn mdbx_limits_keysize_max(pagesize: isize, flags: ::libc::c_uint) -> isize;
}
extern "C" {
pub fn mdbx_limits_valsize_max(pagesize: isize, flags: ::libc::c_uint) -> isize;
}
extern "C" {
pub fn mdbx_limits_txnsize_max(pagesize: isize) -> isize;
}
extern "C" {
pub fn mdbx_env_set_maxreaders(env: *mut MDBX_env, readers: ::libc::c_uint) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_env_get_maxreaders(
env: *mut MDBX_env,
readers: *mut ::libc::c_uint,
) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_env_set_maxdbs(env: *mut MDBX_env, dbs: MDBX_dbi) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_env_get_maxkeysize_ex(env: *mut MDBX_env, flags: ::libc::c_uint) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_env_get_maxvalsize_ex(env: *mut MDBX_env, flags: ::libc::c_uint) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_env_get_maxkeysize(env: *mut MDBX_env) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_env_set_userctx(env: *mut MDBX_env, ctx: *mut ::libc::c_void) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_env_get_userctx(env: *mut MDBX_env) -> *mut ::libc::c_void;
}
extern "C" {
pub fn mdbx_txn_begin(
env: *mut MDBX_env,
parent: *mut MDBX_txn,
flags: ::libc::c_uint,
txn: *mut *mut MDBX_txn,
) -> ::libc::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MDBX_txn_info {
pub txn_id: u64,
pub txn_reader_lag: u64,
pub txn_space_used: u64,
pub txn_space_limit_soft: u64,
pub txn_space_limit_hard: u64,
pub txn_space_retired: u64,
pub txn_space_leftover: u64,
pub txn_space_dirty: u64,
}
extern "C" {
pub fn mdbx_txn_info(
txn: *mut MDBX_txn,
info: *mut MDBX_txn_info,
scan_rlt: ::libc::c_int,
) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_txn_env(txn: *mut MDBX_txn) -> *mut MDBX_env;
}
extern "C" {
pub fn mdbx_txn_flags(txn: *mut MDBX_txn) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_txn_id(txn: *mut MDBX_txn) -> u64;
}
extern "C" {
pub fn mdbx_txn_commit(txn: *mut MDBX_txn) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_txn_abort(txn: *mut MDBX_txn) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_txn_reset(txn: *mut MDBX_txn) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_txn_renew(txn: *mut MDBX_txn) -> ::libc::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct mdbx_canary {
pub x: u64,
pub y: u64,
pub z: u64,
pub v: u64,
}
extern "C" {
pub fn mdbx_canary_put(txn: *mut MDBX_txn, canary: *const mdbx_canary) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_canary_get(txn: *mut MDBX_txn, canary: *mut mdbx_canary) -> ::libc::c_int;
}
pub type MDBX_cmp_func = ::std::option::Option<
unsafe extern "C" fn(a: *const MDBX_val, b: *const MDBX_val) -> ::libc::c_int,
>;
extern "C" {
pub fn mdbx_dbi_open_ex(
txn: *mut MDBX_txn,
name: *const ::libc::c_char,
flags: ::libc::c_uint,
dbi: *mut MDBX_dbi,
keycmp: MDBX_cmp_func,
datacmp: MDBX_cmp_func,
) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_dbi_open(
txn: *mut MDBX_txn,
name: *const ::libc::c_char,
flags: ::libc::c_uint,
dbi: *mut MDBX_dbi,
) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_key_from_jsonInteger(json_integer: i64) -> u64;
}
extern "C" {
pub fn mdbx_key_from_double(ieee754_64bit: f64) -> u64;
}
extern "C" {
pub fn mdbx_key_from_ptrdouble(ieee754_64bit: *const f64) -> u64;
}
extern "C" {
pub fn mdbx_key_from_float(ieee754_32bit: f32) -> u32;
}
extern "C" {
pub fn mdbx_key_from_ptrfloat(ieee754_32bit: *const f32) -> u32;
}
extern "C" {
pub fn mdbx_dbi_stat(
txn: *mut MDBX_txn,
dbi: MDBX_dbi,
stat: *mut MDBX_stat,
bytes: usize,
) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_dbi_flags_ex(
txn: *mut MDBX_txn,
dbi: MDBX_dbi,
flags: *mut ::libc::c_uint,
state: *mut ::libc::c_uint,
) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_dbi_flags(
txn: *mut MDBX_txn,
dbi: MDBX_dbi,
flags: *mut ::libc::c_uint,
) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_dbi_close(env: *mut MDBX_env, dbi: MDBX_dbi) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_drop(txn: *mut MDBX_txn, dbi: MDBX_dbi, del: ::libc::c_int) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_get(
txn: *mut MDBX_txn,
dbi: MDBX_dbi,
key: *mut MDBX_val,
data: *mut MDBX_val,
) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_get_ex(
txn: *mut MDBX_txn,
dbi: MDBX_dbi,
key: *mut MDBX_val,
data: *mut MDBX_val,
values_count: *mut usize,
) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_get_nearest(
txn: *mut MDBX_txn,
dbi: MDBX_dbi,
key: *mut MDBX_val,
data: *mut MDBX_val,
) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_put(
txn: *mut MDBX_txn,
dbi: MDBX_dbi,
key: *mut MDBX_val,
data: *mut MDBX_val,
flags: ::libc::c_uint,
) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_replace(
txn: *mut MDBX_txn,
dbi: MDBX_dbi,
key: *mut MDBX_val,
new_data: *mut MDBX_val,
old_data: *mut MDBX_val,
flags: ::libc::c_uint,
) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_del(
txn: *mut MDBX_txn,
dbi: MDBX_dbi,
key: *mut MDBX_val,
data: *mut MDBX_val,
) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_cursor_open(
txn: *mut MDBX_txn,
dbi: MDBX_dbi,
cursor: *mut *mut MDBX_cursor,
) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_cursor_close(cursor: *mut MDBX_cursor);
}
extern "C" {
pub fn mdbx_cursor_renew(txn: *mut MDBX_txn, cursor: *mut MDBX_cursor) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_cursor_txn(cursor: *mut MDBX_cursor) -> *mut MDBX_txn;
}
extern "C" {
pub fn mdbx_cursor_dbi(cursor: *mut MDBX_cursor) -> MDBX_dbi;
}
extern "C" {
pub fn mdbx_cursor_get(
cursor: *mut MDBX_cursor,
key: *mut MDBX_val,
data: *mut MDBX_val,
op: MDBX_cursor_op,
) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_cursor_put(
cursor: *mut MDBX_cursor,
key: *mut MDBX_val,
data: *mut MDBX_val,
flags: ::libc::c_uint,
) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_cursor_del(cursor: *mut MDBX_cursor, flags: ::libc::c_uint) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_cursor_count(cursor: *mut MDBX_cursor, countp: *mut usize) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_cursor_eof(mc: *mut MDBX_cursor) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_cursor_on_first(mc: *mut MDBX_cursor) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_cursor_on_last(mc: *mut MDBX_cursor) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_estimate_distance(
first: *const MDBX_cursor,
last: *const MDBX_cursor,
distance_items: *mut isize,
) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_estimate_move(
cursor: *const MDBX_cursor,
key: *mut MDBX_val,
data: *mut MDBX_val,
move_op: MDBX_cursor_op,
distance_items: *mut isize,
) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_estimate_range(
txn: *mut MDBX_txn,
dbi: MDBX_dbi,
begin_key: *mut MDBX_val,
begin_data: *mut MDBX_val,
end_key: *mut MDBX_val,
end_data: *mut MDBX_val,
size_items: *mut isize,
) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_is_dirty(txn: *const MDBX_txn, ptr: *const ::libc::c_void) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_dbi_sequence(
txn: *mut MDBX_txn,
dbi: MDBX_dbi,
result: *mut u64,
increment: u64,
) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_cmp(
txn: *mut MDBX_txn,
dbi: MDBX_dbi,
a: *const MDBX_val,
b: *const MDBX_val,
) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_dcmp(
txn: *mut MDBX_txn,
dbi: MDBX_dbi,
a: *const MDBX_val,
b: *const MDBX_val,
) -> ::libc::c_int;
}
pub type MDBX_reader_list_func = ::std::option::Option<
unsafe extern "C" fn(
ctx: *mut ::libc::c_void,
num: ::libc::c_int,
slot: ::libc::c_int,
pid: mdbx_pid_t,
thread: mdbx_tid_t,
txnid: u64,
lag: u64,
bytes_used: usize,
bytes_retained: usize,
) -> ::libc::c_int,
>;
extern "C" {
pub fn mdbx_reader_list(
env: *mut MDBX_env,
func: MDBX_reader_list_func,
ctx: *mut ::libc::c_void,
) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_reader_check(env: *mut MDBX_env, dead: *mut ::libc::c_int) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_txn_straggler(txn: *mut MDBX_txn, percent: *mut ::libc::c_int) -> ::libc::c_int;
}
pub type MDBX_oom_func = ::std::option::Option<
unsafe extern "C" fn(
env: *mut MDBX_env,
pid: mdbx_pid_t,
tid: mdbx_tid_t,
txn: u64,
gap: ::libc::c_uint,
space: usize,
retry: ::libc::c_int,
) -> ::libc::c_int,
>;
extern "C" {
pub fn mdbx_env_set_oomfunc(env: *mut MDBX_env, oom_func: MDBX_oom_func) -> ::libc::c_int;
}
extern "C" {
pub fn mdbx_env_get_oomfunc(env: *mut MDBX_env) -> MDBX_oom_func;
}
#[repr(u32)]
#[doc = " B-tree Traversal *********************************************************"]
#[doc = " This is internal API for mdbx_chk tool. You should avoid to use it, except"]
#[doc = " some extremal special cases."]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum MDBX_page_type_t {
MDBX_page_void = 0,
MDBX_page_meta = 1,
MDBX_page_large = 2,
MDBX_page_branch = 3,
MDBX_page_leaf = 4,
MDBX_page_dupfixed_leaf = 5,
MDBX_subpage_leaf = 6,
MDBX_subpage_dupfixed_leaf = 7,
}
pub type MDBX_pgvisitor_func = ::std::option::Option<
unsafe extern "C" fn(
pgno: u64,
number: ::libc::c_uint,
ctx: *mut ::libc::c_void,
deep: ::libc::c_int,
dbi: *const ::libc::c_char,
page_size: usize,
type_: MDBX_page_type_t,
nentries: usize,
payload_bytes: usize,
header_bytes: usize,
unused_bytes: usize,
) -> ::libc::c_int,
>;
extern "C" {
pub fn mdbx_env_pgwalk(
txn: *mut MDBX_txn,
visitor: MDBX_pgvisitor_func,
ctx: *mut ::libc::c_void,
) -> ::libc::c_int;
}
pub type __builtin_va_list = [__va_list_tag; 1usize];
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct __va_list_tag {
pub gp_offset: ::libc::c_uint,
pub fp_offset: ::libc::c_uint,
pub overflow_arg_area: *mut ::libc::c_void,
pub reg_save_area: *mut ::libc::c_void,
}