42#if defined(__riscv) || defined(__riscv__) || defined(__RISCV) || defined(__RISCV__)
43#warning "The RISC-V architecture is intentionally insecure by design. \
44 Please delete this admonition at your own risk, \
45 if you make such decision informed and consciously. \
46 Refer to https://clck.ru/32d9xH for more information."
50#pragma warning(push, 1)
51#pragma warning(disable : 4548)
53#pragma warning(disable : 4530)
55#pragma warning(disable : 4577)
150#if !defined(NDEBUG) && !defined(assert)
154#if defined(_WIN32) || defined(_WIN64)
157#ifndef __mode_t_defined
168#include <sys/types.h>
170#define HAVE_STRUCT_IOVEC 1
188#ifndef __has_attribute
189#define __has_attribute(x) (0)
192#ifndef __has_c_attribute
193#define __has_c_attribute(x) (0)
194#define __has_c_attribute_qualified(x) 0
195#elif !defined(__STDC_VERSION__) || __STDC_VERSION__ < 202311L
196#define __has_c_attribute_qualified(x) 0
197#elif defined(_MSC_VER)
199#define __has_c_attribute_qualified(x) 0
201#define __has_c_attribute_qualified(x) __has_c_attribute(x)
204#ifndef __has_cpp_attribute
205#define __has_cpp_attribute(x) 0
206#define __has_cpp_attribute_qualified(x) 0
207#elif defined(_MSC_VER)
209#define __has_cpp_attribute_qualified(x) 0
211#define __has_cpp_attribute_qualified(x) __has_cpp_attribute(x)
214#ifndef __has_C23_or_CXX_attribute
215#if defined(__cplusplus)
216#define __has_C23_or_CXX_attribute(x) __has_cpp_attribute_qualified(x)
218#define __has_C23_or_CXX_attribute(x) __has_c_attribute_qualified(x)
223#define __has_feature(x) (0)
224#define __has_exceptions_disabled (0)
225#elif !defined(__has_exceptions_disabled)
226#define __has_exceptions_disabled (__has_feature(cxx_noexcept) && !__has_feature(cxx_exceptions))
229#ifndef __has_extension
230#define __has_extension(x) __has_feature(x)
234#define __has_builtin(x) (0)
244#define MDBX_PURE_FUNCTION [[gnu::pure]]
245#elif __has_C23_or_CXX_attribute(gnu::pure)
246#define MDBX_PURE_FUNCTION [[gnu::pure]]
247#elif (defined(__GNUC__) || __has_attribute(__pure__)) && \
248 (!defined(__clang__) || !defined(__cplusplus) || \
249 __has_exceptions_disabled)
250#define MDBX_PURE_FUNCTION __attribute__((__pure__))
252#define MDBX_PURE_FUNCTION
259#define MDBX_NOTHROW_PURE_FUNCTION [[gnu::pure, gnu::nothrow]]
260#elif __has_C23_or_CXX_attribute(gnu::pure)
261#if __has_C23_or_CXX_attribute(gnu::nothrow)
262#define MDBX_NOTHROW_PURE_FUNCTION [[gnu::pure, gnu::nothrow]]
264#define MDBX_NOTHROW_PURE_FUNCTION [[gnu::pure]]
266#elif defined(__GNUC__) || (__has_attribute(__pure__) && __has_attribute(__nothrow__))
267#define MDBX_NOTHROW_PURE_FUNCTION __attribute__((__pure__, __nothrow__))
268#elif __has_cpp_attribute(pure)
269#define MDBX_NOTHROW_PURE_FUNCTION [[pure]]
271#define MDBX_NOTHROW_PURE_FUNCTION
285#define MDBX_CONST_FUNCTION [[gnu::const]]
286#elif __has_C23_or_CXX_attribute(gnu::const)
287#define MDBX_CONST_FUNCTION [[gnu::const]]
288#elif (defined(__GNUC__) || __has_attribute(__const__)) && \
289 (!defined(__clang__) || !defined(__cplusplus) || \
290 __has_exceptions_disabled)
291#define MDBX_CONST_FUNCTION __attribute__((__const__))
293#define MDBX_CONST_FUNCTION MDBX_PURE_FUNCTION
300#define MDBX_NOTHROW_CONST_FUNCTION [[gnu::const, gnu::nothrow]]
301#elif __has_C23_or_CXX_attribute(gnu::const)
302#if __has_C23_or_CXX_attribute(gnu::nothrow)
303#define MDBX_NOTHROW_CONST_FUNCTION [[gnu::const, gnu::nothrow]]
305#define MDBX_NOTHROW_CONST_FUNCTION [[gnu::const]]
307#elif defined(__GNUC__) || (__has_attribute(__const__) && __has_attribute(__nothrow__))
308#define MDBX_NOTHROW_CONST_FUNCTION __attribute__((__const__, __nothrow__))
309#elif __has_cpp_attribute_qualified(const)
310#define MDBX_NOTHROW_CONST_FUNCTION [[const]]
312#define MDBX_NOTHROW_CONST_FUNCTION MDBX_NOTHROW_PURE_FUNCTION
318#ifndef MDBX_DEPRECATED
320#define MDBX_DEPRECATED __deprecated
321#elif defined(DOXYGEN) || ((!defined(__GNUC__) || defined(__clang__) || __GNUC__ > 5) && \
322 ((defined(__cplusplus) && __cplusplus >= 201403L && __has_cpp_attribute(deprecated) && \
323 __has_cpp_attribute(deprecated) >= 201309L) || \
324 (!defined(__cplusplus) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202304L)))
325#define MDBX_DEPRECATED [[deprecated]]
326#elif (defined(__GNUC__) && __GNUC__ > 5) || \
327 (__has_attribute(__deprecated__) && (!defined(__GNUC__) || defined(__clang__) || __GNUC__ > 5))
328#define MDBX_DEPRECATED __attribute__((__deprecated__))
329#elif defined(_MSC_VER)
330#define MDBX_DEPRECATED __declspec(deprecated)
332#define MDBX_DEPRECATED
336#ifndef MDBX_DEPRECATED_ENUM
337#ifdef __deprecated_enum
338#define MDBX_DEPRECATED_ENUM __deprecated_enum
339#elif defined(DOXYGEN) || \
340 (!defined(_MSC_VER) || (defined(__cplusplus) && __cplusplus >= 201403L && __has_cpp_attribute(deprecated) && \
341 __has_cpp_attribute(deprecated) >= 201309L))
342#define MDBX_DEPRECATED_ENUM MDBX_DEPRECATED
344#define MDBX_DEPRECATED_ENUM
349#if defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__) || defined(__MINGW__) || defined(__MINGW32__) || \
351#if defined(__GNUC__) || __has_attribute(__dllexport__)
352#define __dll_export __attribute__((__dllexport__))
353#elif defined(_MSC_VER)
354#define __dll_export __declspec(dllexport)
358#elif defined(__GNUC__) || __has_attribute(__visibility__)
359#define __dll_export __attribute__((__visibility__("default")))
366#if defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__) || defined(__MINGW__) || defined(__MINGW32__) || \
368#if defined(__GNUC__) || __has_attribute(__dllimport__)
369#define __dll_import __attribute__((__dllimport__))
370#elif defined(_MSC_VER)
371#define __dll_import __declspec(dllimport)
384#if defined(LIBMDBX_INTERNALS) && !defined(LIBMDBX_NO_EXPORTS_LEGACY_API)
385#define LIBMDBX_INLINE_API(TYPE, NAME, ARGS) \
386 LIBMDBX_API TYPE NAME ARGS; \
387 static __inline TYPE __inline_##NAME ARGS
389#define LIBMDBX_INLINE_API(TYPE, NAME, ARGS) static __inline TYPE NAME ARGS
393#ifndef MDBX_STRINGIFY
394#define MDBX_STRINGIFY_HELPER(x) #x
395#define MDBX_STRINGIFY(x) MDBX_STRINGIFY_HELPER(x)
414#define MDBX_CXX17_NOEXCEPT noexcept
415#elif !defined(__cpp_noexcept_function_type) || __cpp_noexcept_function_type < 201510L
416#define MDBX_CXX17_NOEXCEPT
418#define MDBX_CXX17_NOEXCEPT noexcept
423#define MDBX_CXX01_CONSTEXPR constexpr
424#define MDBX_CXX01_CONSTEXPR_VAR constexpr
425#elif !defined(__cplusplus)
426#define MDBX_CXX01_CONSTEXPR __inline
427#define MDBX_CXX01_CONSTEXPR_VAR const
428#elif !defined(DOXYGEN) && \
429 ((__cplusplus < 201103L && defined(__cpp_constexpr) && __cpp_constexpr < 200704L) || \
430 (defined(__LCC__) && __LCC__ < 124) || \
431 (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ < 407) && !defined(__clang__) && !defined(__LCC__)) || \
432 (defined(_MSC_VER) && _MSC_VER < 1910) || (defined(__clang__) && __clang_major__ < 4))
433#define MDBX_CXX01_CONSTEXPR inline
434#define MDBX_CXX01_CONSTEXPR_VAR const
436#define MDBX_CXX01_CONSTEXPR constexpr
437#define MDBX_CXX01_CONSTEXPR_VAR constexpr
443#define MDBX_CXX11_CONSTEXPR constexpr
444#define MDBX_CXX11_CONSTEXPR_VAR constexpr
445#elif !defined(__cplusplus)
446#define MDBX_CXX11_CONSTEXPR __inline
447#define MDBX_CXX11_CONSTEXPR_VAR const
448#elif !defined(DOXYGEN) && \
449 (!defined(__cpp_constexpr) || __cpp_constexpr < 201304L || (defined(__LCC__) && __LCC__ < 124) || \
450 (defined(__GNUC__) && __GNUC__ < 6 && !defined(__clang__) && !defined(__LCC__)) || \
451 (defined(_MSC_VER) && _MSC_VER < 1910) || (defined(__clang__) && __clang_major__ < 5))
452#define MDBX_CXX11_CONSTEXPR inline
453#define MDBX_CXX11_CONSTEXPR_VAR const
455#define MDBX_CXX11_CONSTEXPR constexpr
456#define MDBX_CXX11_CONSTEXPR_VAR constexpr
462#define MDBX_CXX14_CONSTEXPR constexpr
463#define MDBX_CXX14_CONSTEXPR_VAR constexpr
464#elif !defined(__cplusplus)
465#define MDBX_CXX14_CONSTEXPR __inline
466#define MDBX_CXX14_CONSTEXPR_VAR const
467#elif defined(DOXYGEN) || \
468 defined(__cpp_constexpr) && __cpp_constexpr >= 201304L && \
469 ((defined(_MSC_VER) && _MSC_VER >= 1910) || (defined(__clang__) && __clang_major__ > 4) || \
470 (defined(__GNUC__) && __GNUC__ > 6) || (!defined(__GNUC__) && !defined(__clang__) && !defined(_MSC_VER)))
471#define MDBX_CXX14_CONSTEXPR constexpr
472#define MDBX_CXX14_CONSTEXPR_VAR constexpr
474#define MDBX_CXX14_CONSTEXPR inline
475#define MDBX_CXX14_CONSTEXPR_VAR const
478#if defined(__noreturn)
479#define MDBX_NORETURN __noreturn
480#elif defined(_Noreturn)
481#define MDBX_NORETURN _Noreturn
482#elif defined(DOXYGEN) || (defined(__cplusplus) && __cplusplus >= 201103L) || \
483 (!defined(__cplusplus) && defined(__STDC_VERSION__) && __STDC_VERSION__ > 202005L)
484#define MDBX_NORETURN [[noreturn]]
485#elif defined(__GNUC__) || __has_attribute(__noreturn__)
486#define MDBX_NORETURN __attribute__((__noreturn__))
487#elif defined(_MSC_VER) && !defined(__clang__)
488#define MDBX_NORETURN __declspec(noreturn)
493#ifndef MDBX_PRINTF_ARGS
494#if defined(__GNUC__) || __has_attribute(__format__) || defined(DOXYGEN)
495#if defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)
496#define MDBX_PRINTF_ARGS(format_index, first_arg) __attribute__((__format__(__gnu_printf__, format_index, first_arg)))
498#define MDBX_PRINTF_ARGS(format_index, first_arg) __attribute__((__format__(__printf__, format_index, first_arg)))
501#define MDBX_PRINTF_ARGS(format_index, first_arg)
505#if defined(DOXYGEN) || \
506 (defined(__cplusplus) && __cplusplus >= 201603L && __has_cpp_attribute(maybe_unused) && \
507 __has_cpp_attribute(maybe_unused) >= 201603L) || \
508 (!defined(__cplusplus) && defined(__STDC_VERSION__) && __STDC_VERSION__ > 202005L)
509#define MDBX_MAYBE_UNUSED [[maybe_unused]]
510#elif defined(__GNUC__) || __has_attribute(__unused__)
511#define MDBX_MAYBE_UNUSED __attribute__((__unused__))
513#define MDBX_MAYBE_UNUSED
516#if __has_attribute(no_sanitize) || defined(DOXYGEN)
517#define MDBX_NOSANITIZE_ENUM __attribute((__no_sanitize__("enum")))
519#define MDBX_NOSANITIZE_ENUM
527#if !defined(DEFINE_ENUM_FLAG_OPERATORS) && !defined(DOXYGEN)
530#if !defined(__cpp_constexpr) || __cpp_constexpr < 200704L || (defined(__LCC__) && __LCC__ < 124) || \
531 (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ < 407) && !defined(__clang__) && !defined(__LCC__)) || \
532 (defined(_MSC_VER) && _MSC_VER < 1910) || (defined(__clang__) && __clang_major__ < 4)
534#define CONSTEXPR_ENUM_FLAGS_OPERATIONS 0
537#define CONSTEXPR_ENUM_FLAGS_OPERATIONS 1
542#define DEFINE_ENUM_FLAG_OPERATORS(ENUM) \
544 MDBX_NOSANITIZE_ENUM MDBX_CXX01_CONSTEXPR ENUM operator|(ENUM a, ENUM b) { return ENUM(unsigned(a) | unsigned(b)); } \
545 MDBX_NOSANITIZE_ENUM MDBX_CXX14_CONSTEXPR ENUM &operator|=(ENUM &a, ENUM b) { return a = a | b; } \
546 MDBX_NOSANITIZE_ENUM MDBX_CXX01_CONSTEXPR ENUM operator&(ENUM a, ENUM b) { return ENUM(unsigned(a) & unsigned(b)); } \
547 MDBX_NOSANITIZE_ENUM MDBX_CXX01_CONSTEXPR ENUM operator&(ENUM a, unsigned b) { return ENUM(unsigned(a) & b); } \
548 MDBX_NOSANITIZE_ENUM MDBX_CXX01_CONSTEXPR ENUM operator&(unsigned a, ENUM b) { return ENUM(a & unsigned(b)); } \
549 MDBX_NOSANITIZE_ENUM MDBX_CXX14_CONSTEXPR ENUM &operator&=(ENUM &a, ENUM b) { return a = a & b; } \
550 MDBX_NOSANITIZE_ENUM MDBX_CXX14_CONSTEXPR ENUM &operator&=(ENUM &a, unsigned b) { return a = a & b; } \
551 MDBX_CXX01_CONSTEXPR unsigned operator~(ENUM a) { return ~unsigned(a); } \
552 MDBX_NOSANITIZE_ENUM MDBX_CXX01_CONSTEXPR ENUM operator^(ENUM a, ENUM b) { return ENUM(unsigned(a) ^ unsigned(b)); } \
553 MDBX_NOSANITIZE_ENUM MDBX_CXX14_CONSTEXPR ENUM &operator^=(ENUM &a, ENUM b) { return a = a ^ b; } \
557#define DEFINE_ENUM_FLAG_OPERATORS(ENUM)
558#define CONSTEXPR_ENUM_FLAGS_OPERATIONS 1
561#elif !defined(CONSTEXPR_ENUM_FLAGS_OPERATIONS)
565#define CONSTEXPR_ENUM_FLAGS_OPERATIONS 0
568#define CONSTEXPR_ENUM_FLAGS_OPERATIONS 1
585#define MDBX_VERSION_MAJOR 0
586#define MDBX_VERSION_MINOR 13
589#if defined(LIBMDBX_EXPORTS) || defined(DOXYGEN)
590#define LIBMDBX_API __dll_export
591#elif defined(LIBMDBX_IMPORTS)
592#define LIBMDBX_API __dll_import
599#if defined(__clang__) || __has_attribute(type_visibility) || defined(DOXYGEN)
600#define LIBMDBX_API_TYPE LIBMDBX_API __attribute__((type_visibility("default")))
602#define LIBMDBX_API_TYPE LIBMDBX_API
605#define LIBMDBX_API_TYPE
608#if defined(LIBMDBX_IMPORTS)
609#define LIBMDBX_VERINFO_API __dll_import
611#define LIBMDBX_VERINFO_API __dll_export
622 const char *datetime;
625 const char *describe;
644#if (defined(_WIN32) || defined(_WIN64)) && !MDBX_BUILD_SHARED_LIBRARY
672#error Non-dll build libmdbx requires target Windows version \
673 to be explicitly defined via _WIN32_WINNT for properly \
674 handling thread local storage destructors.
677#if _WIN32_WINNT >= 0x0600
680#define MDBX_MANUAL_MODULE_HANDLER 0
684#define MDBX_MANUAL_MODULE_HANDLER 1
685void LIBMDBX_API NTAPI mdbx_module_handler(PVOID module, DWORD reason, PVOID reserved);
746#ifndef HAVE_STRUCT_IOVEC
751#define HAVE_STRUCT_IOVEC
754#if defined(__sun) || defined(__SVR4) || defined(__svr4__)
788#if !(defined(_WIN32) || defined(_WIN64))
789#define MDBX_LOCKNAME "/mdbx.lck"
791#define MDBX_LOCKNAME_W L"\\mdbx.lck"
792#define MDBX_LOCKNAME_A "\\mdbx.lck"
794#define MDBX_LOCKNAME MDBX_LOCKNAME_W
796#define MDBX_LOCKNAME MDBX_LOCKNAME_A
803#if !(defined(_WIN32) || defined(_WIN64))
804#define MDBX_DATANAME "/mdbx.dat"
806#define MDBX_DATANAME_W L"\\mdbx.dat"
807#define MDBX_DATANAME_A "\\mdbx.dat"
809#define MDBX_DATANAME MDBX_DATANAME_W
811#define MDBX_DATANAME MDBX_DATANAME_A
816#ifndef MDBX_LOCK_SUFFIX
818#if !(defined(_WIN32) || defined(_WIN64))
819#define MDBX_LOCK_SUFFIX "-lck"
821#define MDBX_LOCK_SUFFIX_W L"-lck"
822#define MDBX_LOCK_SUFFIX_A "-lck"
824#define MDBX_LOCK_SUFFIX MDBX_LOCK_SUFFIX_W
826#define MDBX_LOCK_SUFFIX MDBX_LOCK_SUFFIX_A
840typedef enum MDBX_log_level {
897typedef enum MDBX_debug_flags {
929 MDBX_DBG_MAX = ((unsigned)MDBX_LOG_MAX) << 16 | 127 ,
935DEFINE_ENUM_FLAG_OPERATORS(MDBX_debug_flags)
955#define MDBX_LOGGER_DONTCHANGE ((MDBX_debug_func *)(intptr_t)-1)
956#define MDBX_LOGGER_NOFMT_DONTCHANGE ((MDBX_debug_func_nofmt *)(intptr_t)-1)
1016typedef enum MDBX_env_flags {
1471DEFINE_ENUM_FLAG_OPERATORS(MDBX_env_flags)
1477typedef enum MDBX_txn_flags {
1496#if CONSTEXPR_ENUM_FLAGS_OPERATIONS || defined(DOXYGEN)
1569DEFINE_ENUM_FLAG_OPERATORS(MDBX_txn_flags)
1575typedef enum MDBX_db_flags {
1619DEFINE_ENUM_FLAG_OPERATORS(MDBX_db_flags)
1625typedef enum MDBX_put_flags {
1664DEFINE_ENUM_FLAG_OPERATORS(MDBX_put_flags)
1669typedef enum MDBX_copy_flags {
1696DEFINE_ENUM_FLAG_OPERATORS(MDBX_copy_flags)
1821typedef enum MDBX_error {
1974#if defined(_WIN32) || defined(_WIN64)
2012#define MDBX_MAP_RESIZED MDBX_MAP_RESIZED_is_deprecated()
2061#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
2094typedef enum MDBX_option {
2493#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
2498#define mdbx_env_openT(env, pathname, flags, mode) mdbx_env_openW(env, pathname, flags, mode)
2500#define mdbx_env_openT(env, pathname, flags, mode) mdbx_env_open(env, pathname, flags, mode)
2506typedef enum MDBX_env_delete_mode {
2543#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
2549#define mdbx_env_deleteT(pathname, mode) mdbx_env_deleteW(pathname, mode)
2551#define mdbx_env_deleteT(pathname, mode) mdbx_env_delete(pathname, mode)
2664#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
2670#define mdbx_env_copyT(env, dest, flags) mdbx_env_copyW(env, dest, flags)
2677#define mdbx_txn_copy2pathnameT(txn, dest, flags) mdbx_txn_copy2pathnameW(txn, dest, path)
2679#define mdbx_env_copyT(env, dest, flags) mdbx_env_copy(env, dest, flags)
2680#define mdbx_txn_copy2pathnameT(txn, dest, flags) mdbx_txn_copy2pathname(txn, dest, path)
2990 assert(proxy <= SIZE_MAX);
2992 *threshold = (size_t)proxy;
3049 if (period_seconds_16dot16) {
3053 assert(proxy <= UINT32_MAX);
3055 *period_seconds_16dot16 = (unsigned)proxy;
3106#if defined(DOXYGEN) || !(defined(_WIN32) || defined(_WIN64))
3190typedef enum MDBX_warmup_flags {
3234DEFINE_ENUM_FLAG_OPERATORS(MDBX_warmup_flags)
3268 unsigned timeout_seconds_16dot16);
3319#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
3325#define mdbx_env_get_pathT(env, dest) mdbx_env_get_pathW(env, dest)
3327#define mdbx_env_get_pathT(env, dest) mdbx_env_get_path(env, dest)
3541 intptr_t growth_step, intptr_t shrink_threshold, intptr_t pagesize);
3668 *readers = (unsigned)proxy;
4090 uint32_t coalescences;
4105 uint32_t work_counter;
4108 uint32_t work_rtime_monotonic;
4112 uint32_t work_xtime_cpu;
4115 uint32_t work_rsteps;
4118 uint32_t work_xpages;
4121 uint32_t work_majflt;
4125 uint32_t self_counter;
4128 uint32_t self_rtime_monotonic;
4132 uint32_t self_xtime_cpu;
4135 uint32_t self_rsteps;
4138 uint32_t self_xpages;
4141 uint32_t self_majflt;
4147 } pnl_merge_work, pnl_merge_self;
4670 return UINT64_C(0x8000000000000000) + i64;
4674 return UINT32_C(0x80000000) + i32;
4730typedef enum MDBX_dbi_state {
4740DEFINE_ENUM_FLAG_OPERATORS(MDBX_dbi_state)
5033 void *preserver_context);
5886 ptrdiff_t *distance_items);
5914 ptrdiff_t *distance_items);
5918#define MDBX_EPSILON ((MDBX_val *)((ptrdiff_t)-1))
6259#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
6266#define mdbx_env_open_for_recoveryT(env, pathname, target_mets, writeable) \
6267 mdbx_env_open_for_recoveryW(env, pathname, target_mets, writeable)
6269#define mdbx_env_open_for_recoveryT(env, pathname, target_mets, writeable) \
6270 mdbx_env_open_for_recovery(env, pathname, target_mets, writeable)
6312#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
6318#define mdbx_preopen_snapinfoT(pathname, info, bytes) mdbx_preopen_snapinfoW(pathname, info, bytes)
6320#define mdbx_preopen_snapinfoT(pathname, info, bytes) mdbx_preopen_snapinfo(pathname, info, bytes)
6327typedef enum MDBX_chk_flags {
6346DEFINE_ENUM_FLAG_OPERATORS(MDBX_chk_flags)
6351typedef enum MDBX_chk_severity {
6370typedef enum MDBX_chk_stage {
6387typedef struct MDBX_chk_line {
6395typedef struct MDBX_chk_issue {
6403typedef struct MDBX_chk_scope {
6413 } usr_z, usr_v, usr_o;
6434typedef struct MDBX_chk_table {
6438#define MDBX_CHK_MAIN ((void *)((ptrdiff_t)0))
6440#define MDBX_CHK_GC ((void *)((ptrdiff_t)-1))
6442#define MDBX_CHK_META ((void *)((ptrdiff_t)-2))
6450 size_t all, empty, other;
6451 size_t branch, leaf;
6452 size_t nested_branch, nested_leaf, nested_subleaf;
6470typedef struct MDBX_chk_context {
6477 size_t total_payload_bytes;
6478 size_t table_total, table_processed;
6479 size_t total_unused_bytes, unused_pages;
6480 size_t processed_pages, reclaimable_pages, gc_pages, alloc_pages, backed_pages;
6481 size_t problems_meta, tree_problems, gc_tree_problems, kv_tree_problems, problems_gc, problems_kv, total_problems;
6482 uint64_t steady_txnid, recent_txnid;
6505typedef struct MDBX_chk_callbacks {
6512 const char *extra_fmt, va_list extra_args);
6528 void (*print_size)(
MDBX_chk_line_t *,
const char *prefix,
const uint64_t value,
const char *suffix);
6562 unsigned timeout_seconds_16dot16);
#define MDBX_NOTHROW_CONST_FUNCTION
The 'const nothrow' function attribute for optimization.
Definition mdbx.h:300
#define MDBX_CXX17_NOEXCEPT
Definition mdbx.h:414
#define MDBX_NOTHROW_PURE_FUNCTION
The 'pure nothrow' function attribute for optimization.
Definition mdbx.h:259
#define MDBX_NORETURN
Definition mdbx.h:484
uint64_t mi_mapsize
Definition mdbx.h:2791
uint64_t txn_space_dirty
Definition mdbx.h:4001
uint32_t gc_cputime
User-mode CPU time spent on GC update.
Definition mdbx.h:4076
uint32_t mi_dxb_pagesize
Definition mdbx.h:2800
uint32_t mi_maxreaders
Definition mdbx.h:2798
uint64_t v
Definition mdbx.h:4406
uint32_t mi_numreaders
Definition mdbx.h:2799
struct MDBX_envinfo::@3 mi_pgop_stat
uint16_t patch
Definition mdbx.h:618
const char * metadata
Definition mdbx.h:639
uint32_t mi_since_sync_seconds16dot16
Definition mdbx.h:2824
uint16_t major
Definition mdbx.h:616
uint64_t txn_reader_lag
Definition mdbx.h:3968
uint64_t mi_meta_txnid[3]
Definition mdbx.h:2797
struct MDBX_envinfo::@2 mi_bootid
A mostly unique ID that is regenerated on each boot.
uint64_t txn_space_leftover
Definition mdbx.h:3994
uint64_t txn_space_used
Definition mdbx.h:3972
const char * datetime
Definition mdbx.h:634
uint64_t mi_recent_txnid
Definition mdbx.h:2793
uint64_t mi_autosync_threshold
Definition mdbx.h:2820
const char * semver_prerelease
Definition mdbx.h:620
uint64_t ms_branch_pages
Definition mdbx.h:2741
uint64_t ms_entries
Definition mdbx.h:2744
uint32_t gc_wallclock
Duration of GC update by wall clock.
Definition mdbx.h:4062
uint16_t minor
Definition mdbx.h:617
struct MDBX_commit_latency::@6 gc_prof
Информация для профилирования работы GC.
uint32_t mi_since_reader_check_seconds16dot16
Definition mdbx.h:2830
uint64_t y
Definition mdbx.h:4406
uint32_t sync
Duration of syncing written data to the disk/storage, i.e. the duration of a fdatasync() or a msync()...
Definition mdbx.h:4070
uint64_t txn_space_limit_soft
Definition mdbx.h:3975
uint32_t mi_mode
Definition mdbx.h:2833
const char * options
Definition mdbx.h:636
uint64_t txn_id
Definition mdbx.h:3962
const char * sourcery
Definition mdbx.h:627
uint64_t mi_latter_reader_txnid
Definition mdbx.h:2794
struct MDBX_envinfo::@1 mi_geo
uint64_t ms_overflow_pages
Definition mdbx.h:2743
uint32_t preparation
Duration of preparation (commit child transactions, update table's records and cursors destroying).
Definition mdbx.h:4060
uint64_t z
Definition mdbx.h:4406
uint64_t txn_space_limit_hard
Definition mdbx.h:3979
uint32_t whole
The total duration of a commit.
Definition mdbx.h:4074
const char * flags
Definition mdbx.h:638
uint64_t mi_meta_sign[3]
Definition mdbx.h:2797
uint32_t ms_psize
Definition mdbx.h:2738
uint32_t audit
Duration of internal audit if enabled.
Definition mdbx.h:4064
uint16_t tweak
Definition mdbx.h:619
const char * target
Definition mdbx.h:635
uint32_t write
Duration of writing dirty/modified data pages to a filesystem, i.e. the summary duration of a write()...
Definition mdbx.h:4067
uint64_t txn_space_retired
Definition mdbx.h:3987
uint32_t ms_depth
Definition mdbx.h:2740
struct MDBX_version_info::@0 git
uint64_t mi_last_pgno
Definition mdbx.h:2792
uint32_t ending
Duration of transaction ending (releasing resources).
Definition mdbx.h:4072
uint64_t ms_mod_txnid
Definition mdbx.h:2745
uint64_t mi_self_latter_reader_txnid
Definition mdbx.h:2795
uint64_t ms_leaf_pages
Definition mdbx.h:2742
uint64_t x
Definition mdbx.h:4406
uint32_t mi_autosync_period_seconds16dot16
Definition mdbx.h:2827
uint64_t mi_unsync_volume
Definition mdbx.h:2818
uint32_t mi_sys_pagesize
Definition mdbx.h:2801
struct MDBX_envinfo::@4 mi_dxbid
const char * compiler
Definition mdbx.h:637
LIBMDBX_API MDBX_hsr_func * mdbx_env_get_hsr(const MDBX_env *env)
Gets current Handle-Slow-Readers callback used to resolve database full/overflow issue due to a reade...
MDBX_constants
Definition mdbx.h:768
mode_t mdbx_mode_t
Definition mdbx.h:174
int(* MDBX_preserve_func)(void *context, MDBX_val *target, const void *src, size_t bytes)
Definition mdbx.h:5030
#define LIBMDBX_API
Definition mdbx.h:590
struct iovec MDBX_val
Generic structure used for passing keys and data in and out of the table. .
Definition mdbx.h:765
LIBMDBX_API int mdbx_replace_ex(MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *key, MDBX_val *new_data, MDBX_val *old_data, MDBX_put_flags_t flags, MDBX_preserve_func preserver, void *preserver_context)
LIBMDBX_VERINFO_API const struct MDBX_version_info mdbx_version
libmdbx version information
pthread_t mdbx_tid_t
Definition mdbx.h:173
LIBMDBX_VERINFO_API const struct MDBX_build_info mdbx_build
libmdbx build information
struct MDBX_env MDBX_env
Opaque structure for a database environment.
Definition mdbx.h:697
int mdbx_filehandle_t
Definition mdbx.h:171
LIBMDBX_API const char * mdbx_liberr2str(int errnum)
pid_t mdbx_pid_t
Definition mdbx.h:172
LIBMDBX_API int mdbx_env_openW(MDBX_env *env, const wchar_t *pathname, MDBX_env_flags_t flags, mdbx_mode_t mode)
Open an environment instance.
#define LIBMDBX_VERINFO_API
Definition mdbx.h:611
@ MDBX_MAX_PAGESIZE
Definition mdbx.h:779
@ MDBX_MAXDATASIZE
Definition mdbx.h:773
@ MDBX_MAX_DBI
Definition mdbx.h:770
@ MDBX_MIN_PAGESIZE
Definition mdbx.h:776
libmdbx build information
Definition mdbx.h:633
The fours integers markers (aka "canary") associated with the environment.
Definition mdbx.h:4405
Latency of commit stages in 1/65536 of seconds units.
Definition mdbx.h:4057
Information about the environment.
Definition mdbx.h:2783
Statistics for a table in the environment.
Definition mdbx.h:2737
Information about the transaction.
Definition mdbx.h:3959
libmdbx version information,
Definition mdbx.h:615
LIBMDBX_API int mdbx_cursor_del(MDBX_cursor *cursor, MDBX_put_flags_t flags)
Delete current key/data pair.
LIBMDBX_API int mdbx_dbi_sequence(MDBX_txn *txn, MDBX_dbi dbi, uint64_t *result, uint64_t increment)
Sequence generation for a table.
LIBMDBX_API int mdbx_get_equal_or_great(const MDBX_txn *txn, MDBX_dbi dbi, MDBX_val *key, MDBX_val *data)
Get equal or great item from a table.
LIBMDBX_API int mdbx_cursor_scan(MDBX_cursor *cursor, MDBX_predicate_func *predicate, void *context, MDBX_cursor_op start_op, MDBX_cursor_op turn_op, void *arg)
Сканирует таблицу с использованием передаваемого предиката, с уменьшением сопутствующих накладных рас...
LIBMDBX_API int mdbx_canary_put(MDBX_txn *txn, const MDBX_canary *canary)
Set integers markers (aka "canary") associated with the environment.
LIBMDBX_API int mdbx_canary_get(const MDBX_txn *txn, MDBX_canary *canary)
Returns fours integers markers (aka "canary") associated with the environment.
MDBX_put_flags_t
Data changing flags.
Definition mdbx.h:1625
LIBMDBX_API int mdbx_cursor_get_batch(MDBX_cursor *cursor, size_t *count, MDBX_val *pairs, size_t limit, MDBX_cursor_op op)
Retrieve multiple non-dupsort key/value pairs by cursor.
LIBMDBX_API int mdbx_cursor_count(const MDBX_cursor *cursor, size_t *count)
Return count values (aka duplicates) for current key.
LIBMDBX_API int mdbx_cursor_count_ex(const MDBX_cursor *cursor, size_t *count, MDBX_stat *stat, size_t bytes)
Return count values (aka duplicates) and nested b-tree statistics for current key.
LIBMDBX_API int mdbx_cursor_scan_from(MDBX_cursor *cursor, MDBX_predicate_func *predicate, void *context, MDBX_cursor_op from_op, MDBX_val *from_key, MDBX_val *from_value, MDBX_cursor_op turn_op, void *arg)
LIBMDBX_API int mdbx_cmp(const MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *a, const MDBX_val *b)
Compare two keys according to a particular table.
int MDBX_cmp_func(const MDBX_val *a, const MDBX_val *b) noexcept
A callback function used to compare two keys in a table.
Definition mdbx.h:4465
LIBMDBX_API int mdbx_del(MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *key, const MDBX_val *data)
Delete items from a table.
LIBMDBX_API int mdbx_replace(MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *key, MDBX_val *new_data, MDBX_val *old_data, MDBX_put_flags_t flags)
Replace items in a table.
LIBMDBX_API int mdbx_get_ex(const MDBX_txn *txn, MDBX_dbi dbi, MDBX_val *key, MDBX_val *data, size_t *values_count)
Get items from a table and optionally number of data items for a given key.
int MDBX_predicate_func(void *context, MDBX_val *key, MDBX_val *value, void *arg) noexcept
Тип предикативных функций обратного вызова используемых mdbx_cursor_scan() и mdbx_cursor_scan_from() ...
Definition mdbx.h:5391
LIBMDBX_API int mdbx_cursor_put(MDBX_cursor *cursor, const MDBX_val *key, MDBX_val *data, MDBX_put_flags_t flags)
Store by cursor.
LIBMDBX_API int mdbx_put(MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *key, MDBX_val *data, MDBX_put_flags_t flags)
Store items into a table.
LIBMDBX_API int mdbx_drop(MDBX_txn *txn, MDBX_dbi dbi, bool del)
Empty or delete and close a table.
LIBMDBX_API int mdbx_dcmp(const MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *a, const MDBX_val *b)
Compare two data items according to a particular table.
LIBMDBX_API int mdbx_cursor_get(MDBX_cursor *cursor, MDBX_val *key, MDBX_val *data, MDBX_cursor_op op)
Retrieve by cursor.
LIBMDBX_API int mdbx_get(const MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *key, MDBX_val *data)
Get items from a table.
@ MDBX_MULTIPLE
Definition mdbx.h:1662
@ MDBX_ALLDUPS
Definition mdbx.h:1645
@ MDBX_CURRENT
Definition mdbx.h:1640
@ MDBX_APPENDDUP
Definition mdbx.h:1658
@ MDBX_NODUPDATA
Definition mdbx.h:1634
@ MDBX_APPEND
Definition mdbx.h:1653
@ MDBX_UPSERT
Definition mdbx.h:1627
@ MDBX_RESERVE
Definition mdbx.h:1649
@ MDBX_NOOVERWRITE
Definition mdbx.h:1630
LIBMDBX_API int mdbx_cursor_on_first_dup(const MDBX_cursor *cursor)
Определяет стоит ли курсор на первом или единственном мульти-значении соответствующем ключу.
LIBMDBX_API int mdbx_cursor_renew(const MDBX_txn *txn, MDBX_cursor *cursor)
Renew a cursor handle for use within the given transaction.
LIBMDBX_API int mdbx_cursor_unbind(MDBX_cursor *cursor)
Unbind cursor from a transaction.
LIBMDBX_API MDBX_cursor * mdbx_cursor_create(void *context)
Create a cursor handle but not bind it to transaction nor DBI-handle.
LIBMDBX_API MDBX_dbi mdbx_cursor_dbi(const MDBX_cursor *cursor)
Return the cursor's table handle.
MDBX_cursor_op
Cursor operationsThis is the set of all operations for retrieving data using a cursor.
Definition mdbx.h:1702
LIBMDBX_API int mdbx_cursor_compare(const MDBX_cursor *left, const MDBX_cursor *right, bool ignore_multival)
Сравнивает позицию курсоров.
LIBMDBX_API int mdbx_cursor_on_last_dup(const MDBX_cursor *cursor)
Определяет стоит ли курсор на последнем или единственном мульти-значении соответствующем ключу.
LIBMDBX_API int mdbx_cursor_on_first(const MDBX_cursor *cursor)
Determines whether the cursor is pointed to the first key-value pair or not.
LIBMDBX_API int mdbx_cursor_reset(MDBX_cursor *cursor)
Сбрасывает состояние курсора.
struct MDBX_cursor MDBX_cursor
Opaque structure for navigating through a table.
Definition mdbx.h:727
LIBMDBX_API int mdbx_cursor_set_userctx(MDBX_cursor *cursor, void *ctx)
Set application information associated with the cursor.
LIBMDBX_API int mdbx_cursor_open(const MDBX_txn *txn, MDBX_dbi dbi, MDBX_cursor **cursor)
Create a cursor handle for the specified transaction and DBI handle.
LIBMDBX_API int mdbx_cursor_eof(const MDBX_cursor *cursor)
Determines whether the cursor is pointed to a key-value pair or not, i.e. was not positioned or point...
LIBMDBX_API int mdbx_cursor_bind(const MDBX_txn *txn, MDBX_cursor *cursor, MDBX_dbi dbi)
Bind cursor to specified transaction and DBI-handle.
LIBMDBX_API void * mdbx_cursor_get_userctx(const MDBX_cursor *cursor)
Get the application information associated with the MDBX_cursor.
LIBMDBX_API void mdbx_cursor_close(MDBX_cursor *cursor)
Close a cursor handle.
LIBMDBX_API MDBX_txn * mdbx_cursor_txn(const MDBX_cursor *cursor)
Return the cursor's transaction handle.
LIBMDBX_API int mdbx_txn_release_all_cursors(const MDBX_txn *txn, bool unbind)
Unbind or closes all cursors of a given transaction.
LIBMDBX_API int mdbx_cursor_on_last(const MDBX_cursor *cursor)
Determines whether the cursor is pointed to the last key-value pair or not.
LIBMDBX_API int mdbx_cursor_copy(const MDBX_cursor *src, MDBX_cursor *dest)
Copy cursor position and state.
@ MDBX_SET_LOWERBOUND
Definition mdbx.h:1778
@ MDBX_GET_CURRENT
Definition mdbx.h:1717
@ MDBX_GET_BOTH
Definition mdbx.h:1710
@ MDBX_TO_KEY_EQUAL
Definition mdbx.h:1797
@ MDBX_GET_BOTH_RANGE
Definition mdbx.h:1714
@ MDBX_SET_KEY
Definition mdbx.h:1757
@ MDBX_FIRST_DUP
Definition mdbx.h:1707
@ MDBX_TO_KEY_LESSER_OR_EQUAL
Definition mdbx.h:1796
@ MDBX_GET_MULTIPLE
Definition mdbx.h:1722
@ MDBX_TO_EXACT_KEY_VALUE_GREATER_THAN
Definition mdbx.h:1807
@ MDBX_NEXT_NODUP
Definition mdbx.h:1742
@ MDBX_TO_EXACT_KEY_VALUE_LESSER_OR_EQUAL
Definition mdbx.h:1804
@ MDBX_TO_EXACT_KEY_VALUE_EQUAL
Definition mdbx.h:1805
@ MDBX_TO_PAIR_LESSER_OR_EQUAL
Definition mdbx.h:1810
@ MDBX_PREV_MULTIPLE
Definition mdbx.h:1764
@ MDBX_SET_RANGE
Definition mdbx.h:1760
@ MDBX_LAST_DUP
Definition mdbx.h:1728
@ MDBX_PREV
Definition mdbx.h:1745
@ MDBX_TO_PAIR_GREATER_OR_EQUAL
Definition mdbx.h:1812
@ MDBX_TO_PAIR_GREATER_THAN
Definition mdbx.h:1813
@ MDBX_LAST
Definition mdbx.h:1725
@ MDBX_TO_KEY_LESSER_THAN
Definition mdbx.h:1795
@ MDBX_PREV_DUP
Definition mdbx.h:1748
@ MDBX_TO_EXACT_KEY_VALUE_LESSER_THAN
Definition mdbx.h:1803
@ MDBX_SET
Definition mdbx.h:1754
@ MDBX_NEXT
Definition mdbx.h:1731
@ MDBX_TO_KEY_GREATER_OR_EQUAL
Definition mdbx.h:1798
@ MDBX_TO_PAIR_LESSER_THAN
Definition mdbx.h:1809
@ MDBX_NEXT_MULTIPLE
Definition mdbx.h:1739
@ MDBX_PREV_NODUP
Definition mdbx.h:1751
@ MDBX_TO_PAIR_EQUAL
Definition mdbx.h:1811
@ MDBX_NEXT_DUP
Definition mdbx.h:1734
@ MDBX_TO_EXACT_KEY_VALUE_GREATER_OR_EQUAL
Definition mdbx.h:1806
@ MDBX_SET_UPPERBOUND
Definition mdbx.h:1792
@ MDBX_TO_KEY_GREATER_THAN
Definition mdbx.h:1799
@ MDBX_FIRST
Definition mdbx.h:1704
LIBMDBX_API int mdbx_dbi_open_ex2(MDBX_txn *txn, const MDBX_val *name, MDBX_db_flags_t flags, MDBX_dbi *dbi, MDBX_cmp_func *keycmp, MDBX_cmp_func *datacmp)
Open or Create a named table in the environment with using custom comparison functions.
LIBMDBX_API int mdbx_dbi_open_ex(MDBX_txn *txn, const char *name, MDBX_db_flags_t flags, MDBX_dbi *dbi, MDBX_cmp_func *keycmp, MDBX_cmp_func *datacmp)
Open or Create a named table in the environment with using custom comparison functions.
LIBMDBX_API int mdbx_dbi_rename(MDBX_txn *txn, MDBX_dbi dbi, const char *name)
Переименовает таблицу по DBI-дескриптору
LIBMDBX_API int mdbx_dbi_rename2(MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *name)
Переименовает таблицу по DBI-дескриптору
LIBMDBX_API int mdbx_dbi_close(MDBX_env *env, MDBX_dbi dbi)
Close a table handle. Normally unnecessary.
LIBMDBX_API int mdbx_dbi_open(MDBX_txn *txn, const char *name, MDBX_db_flags_t flags, MDBX_dbi *dbi)
Open or Create a named table in the environment.
LIBMDBX_API int mdbx_dbi_open2(MDBX_txn *txn, const MDBX_val *name, MDBX_db_flags_t flags, MDBX_dbi *dbi)
Open or Create a named table in the environment.
uint32_t MDBX_dbi
A handle for an individual table (key-value spaces) in the environment.
Definition mdbx.h:720
MDBX_db_flags_t
Table flags.
Definition mdbx.h:1575
@ MDBX_INTEGERDUP
Definition mdbx.h:1599
@ MDBX_DB_ACCEDE
Definition mdbx.h:1617
@ MDBX_DB_DEFAULTS
Definition mdbx.h:1577
@ MDBX_REVERSEKEY
Definition mdbx.h:1580
@ MDBX_DUPFIXED
Definition mdbx.h:1594
@ MDBX_INTEGERKEY
Definition mdbx.h:1590
@ MDBX_REVERSEDUP
Definition mdbx.h:1602
@ MDBX_CREATE
Definition mdbx.h:1605
@ MDBX_DUPSORT
Definition mdbx.h:1583
LIBMDBX_API const char * mdbx_dump_val(const MDBX_val *key, char *const buf, const size_t bufsize)
Dump given MDBX_val to the buffer.
MDBX_NORETURN LIBMDBX_API void mdbx_panic(const char *fmt,...) MDBX_PRINTF_ARGS(1
Panics with message and causes abnormal process termination.
void MDBX_debug_func_nofmt(MDBX_log_level_t loglevel, const char *function, int line, const char *msg, unsigned length) noexcept
Definition mdbx.h:963
void MDBX_assert_func(const MDBX_env *env, const char *msg, const char *function, unsigned line) noexcept
A callback function for most MDBX assert() failures, called before printing the message and aborting.
Definition mdbx.h:979
MDBX_log_level_t
Definition mdbx.h:840
MDBX_debug_flags_t
Runtime debug flags.
Definition mdbx.h:897
LIBMDBX_API int mdbx_env_set_assert(MDBX_env *env, MDBX_assert_func *func)
Set or reset the assert() callback of the environment.
MDBX_NORETURN LIBMDBX_API void MDBX_NORETURN LIBMDBX_API void mdbx_assert_fail(const MDBX_env *env, const char *msg, const char *func, unsigned line)
Panics with asserton failed message and causes abnormal process termination.
void MDBX_debug_func(MDBX_log_level_t loglevel, const char *function, int line, const char *fmt, va_list args) noexcept
A debug-logger callback function, called before printing the message and aborting.
Definition mdbx.h:951
LIBMDBX_API int mdbx_setup_debug(MDBX_log_level_t log_level, MDBX_debug_flags_t debug_flags, MDBX_debug_func *logger)
Setup global log-level, debug options and debug logger.
LIBMDBX_API int mdbx_setup_debug_nofmt(MDBX_log_level_t log_level, MDBX_debug_flags_t debug_flags, MDBX_debug_func_nofmt *logger, char *logger_buffer, size_t logger_buffer_size)
@ MDBX_LOG_EXTRA
Definition mdbx.h:882
@ MDBX_LOG_WARN
Definition mdbx.h:856
@ MDBX_LOG_TRACE
Definition mdbx.h:877
@ MDBX_LOG_DEBUG
Definition mdbx.h:872
@ MDBX_LOG_FATAL
Definition mdbx.h:844
@ MDBX_LOG_ERROR
Definition mdbx.h:850
@ MDBX_LOG_NOTICE
Definition mdbx.h:862
@ MDBX_LOG_DONTCHANGE
Definition mdbx.h:889
@ MDBX_LOG_VERBOSE
Definition mdbx.h:867
@ MDBX_DBG_ASSERT
Definition mdbx.h:903
@ MDBX_DBG_DONT_UPGRADE
Definition mdbx.h:926
@ MDBX_DBG_LEGACY_OVERLAP
Definition mdbx.h:921
@ MDBX_DBG_LEGACY_MULTIOPEN
Definition mdbx.h:918
@ MDBX_DBG_NONE
Definition mdbx.h:898
@ MDBX_DBG_DUMP
Definition mdbx.h:915
@ MDBX_DBG_DONTCHANGE
Definition mdbx.h:933
@ MDBX_DBG_AUDIT
Definition mdbx.h:907
@ MDBX_DBG_JITTER
Definition mdbx.h:911
LIBMDBX_API int mdbx_env_set_hsr(MDBX_env *env, MDBX_hsr_func *hsr_callback)
Sets a Handle-Slow-Readers callback to resolve database full/overflow issue due to a reader(s) which ...
LIBMDBX_API const char * mdbx_strerror(int errnum)
Return a string describing a given error code.
int MDBX_hsr_func(const MDBX_env *env, const MDBX_txn *txn, mdbx_pid_t pid, mdbx_tid_t tid, uint64_t laggard, unsigned gap, size_t space, int retry) noexcept
A Handle-Slow-Readers callback function to resolve database full/overflow issue due to a reader(s) wh...
Definition mdbx.h:6195
LIBMDBX_API const char * mdbx_strerror_ANSI2OEM(int errnum)
MDBX_error_t
Errors and return codes.
Definition mdbx.h:1821
LIBMDBX_API const char * mdbx_strerror_r(int errnum, char *buf, size_t buflen)
Return a string describing a given error code.
LIBMDBX_API const char * mdbx_strerror_r_ANSI2OEM(int errnum, char *buf, size_t buflen)
@ MDBX_PANIC
Definition mdbx.h:1848
@ MDBX_FIRST_LMDB_ERRCODE
Definition mdbx.h:1835
@ MDBX_EKEYMISMATCH
Definition mdbx.h:1937
@ MDBX_UNABLE_EXTEND_MAPSIZE
Definition mdbx.h:1882
@ MDBX_EACCESS
Definition mdbx.h:1994
@ MDBX_EIO
Definition mdbx.h:1998
@ MDBX_PAGE_NOTFOUND
Definition mdbx.h:1841
@ MDBX_TXN_FULL
Definition mdbx.h:1866
@ MDBX_DUPLICATED_CLK
Definition mdbx.h:1957
@ MDBX_VERSION_MISMATCH
Definition mdbx.h:1851
@ MDBX_WANNA_RECOVERY
Definition mdbx.h:1934
@ MDBX_TXN_OVERLAPPING
Definition mdbx.h:1948
@ MDBX_EREMOTE
Definition mdbx.h:2002
@ MDBX_TOO_LARGE
Definition mdbx.h:1941
@ MDBX_EBADSIGN
Definition mdbx.h:1930
@ MDBX_CURSOR_FULL
Definition mdbx.h:1870
@ MDBX_ENOFILE
Definition mdbx.h:2001
@ MDBX_BAD_TXN
Definition mdbx.h:1901
@ MDBX_ENODATA
Definition mdbx.h:1991
@ MDBX_LAST_LMDB_ERRCODE
Definition mdbx.h:1915
@ MDBX_CORRUPTED
Definition mdbx.h:1844
@ MDBX_EPERM
Definition mdbx.h:1999
@ MDBX_THREAD_MISMATCH
Definition mdbx.h:1945
@ MDBX_BACKLOG_DEPLETED
Definition mdbx.h:1954
@ MDBX_SUCCESS
Definition mdbx.h:1823
@ MDBX_NOTFOUND
Definition mdbx.h:1838
@ MDBX_RESULT_TRUE
Definition mdbx.h:1829
@ MDBX_INVALID
Definition mdbx.h:1854
@ MDBX_BAD_VALSIZE
Definition mdbx.h:1905
@ MDBX_BUSY
Definition mdbx.h:1919
@ MDBX_OUSTED
Definition mdbx.h:1965
@ MDBX_DBS_FULL
Definition mdbx.h:1860
@ MDBX_EINVAL
Definition mdbx.h:1993
@ MDBX_BAD_RSLOT
Definition mdbx.h:1896
@ MDBX_ENOMEM
Definition mdbx.h:1995
@ MDBX_FIRST_ADDED_ERRCODE
Definition mdbx.h:1922
@ MDBX_RESULT_FALSE
Definition mdbx.h:1826
@ MDBX_EINTR
Definition mdbx.h:2000
@ MDBX_READERS_FULL
Definition mdbx.h:1863
@ MDBX_LAST_ADDED_ERRCODE
Definition mdbx.h:1972
@ MDBX_BAD_DBI
Definition mdbx.h:1909
@ MDBX_KEYEXIST
Definition mdbx.h:1832
@ MDBX_DANGLING_DBI
Definition mdbx.h:1961
@ MDBX_EDEADLK
Definition mdbx.h:2003
@ MDBX_PAGE_FULL
Definition mdbx.h:1873
@ MDBX_MAP_FULL
Definition mdbx.h:1857
@ MDBX_PROBLEM
Definition mdbx.h:1912
@ MDBX_ENOSYS
Definition mdbx.h:1997
@ MDBX_EMULTIVAL
Definition mdbx.h:1925
@ MDBX_EROFS
Definition mdbx.h:1996
@ MDBX_MVCC_RETARDED
Definition mdbx.h:1969
@ MDBX_INCOMPATIBLE
Definition mdbx.h:1892
LIBMDBX_API int mdbx_env_create(MDBX_env **penv)
Create an MDBX environment instance.
int mdbx_env_close(MDBX_env *env)
The shortcut to calling mdbx_env_close_ex() with the dont_sync=false argument.
Definition mdbx.h:3104
MDBX_env_flags_t
Environment flags.
Definition mdbx.h:1016
LIBMDBX_API int mdbx_env_close_ex(MDBX_env *env, bool dont_sync)
Close the environment and release the memory map.
LIBMDBX_API int mdbx_preopen_snapinfoW(const wchar_t *pathname, MDBX_envinfo *info, size_t bytes)
Получает базовую информацию о БД не открывая её.
LIBMDBX_API int mdbx_env_open(MDBX_env *env, const char *pathname, MDBX_env_flags_t flags, mdbx_mode_t mode)
Open an environment instance.
LIBMDBX_API int mdbx_preopen_snapinfo(const char *pathname, MDBX_envinfo *info, size_t bytes)
Получает базовую информацию о БД не открывая её.
@ MDBX_NORDAHEAD
Definition mdbx.h:1231
@ MDBX_ENV_DEFAULTS
Definition mdbx.h:1017
@ MDBX_COALESCE
Definition mdbx.h:1267
@ MDBX_NOMETASYNC
Definition mdbx.h:1366
@ MDBX_LIFORECLAIM
Definition mdbx.h:1291
@ MDBX_SAFE_NOSYNC
Definition mdbx.h:1417
@ MDBX_NOTLS
Definition mdbx.h:1210
@ MDBX_SYNC_DURABLE
Definition mdbx.h:1348
@ MDBX_PAGEPERTURB
Definition mdbx.h:1294
@ MDBX_WRITEMAP
Definition mdbx.h:1136
@ MDBX_NOSTICKYTHREADS
Definition mdbx.h:1207
@ MDBX_EXCLUSIVE
Definition mdbx.h:1090
@ MDBX_NOMEMINIT
Definition mdbx.h:1254
@ MDBX_MAPASYNC
Definition mdbx.h:1424
@ MDBX_ACCEDE
Definition mdbx.h:1105
@ MDBX_NOSUBDIR
Definition mdbx.h:1042
@ MDBX_RDONLY
Definition mdbx.h:1060
@ MDBX_UTTERLY_NOSYNC
Definition mdbx.h:1467
@ MDBX_VALIDATION
Definition mdbx.h:1024
LIBMDBX_API int mdbx_estimate_distance(const MDBX_cursor *first, const MDBX_cursor *last, ptrdiff_t *distance_items)
Estimates the distance between cursors as a number of elements.
LIBMDBX_API int mdbx_estimate_move(const MDBX_cursor *cursor, MDBX_val *key, MDBX_val *data, MDBX_cursor_op move_op, ptrdiff_t *distance_items)
Estimates the move distance.
LIBMDBX_API int mdbx_estimate_range(const MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *begin_key, const MDBX_val *begin_data, const MDBX_val *end_key, const MDBX_val *end_data, ptrdiff_t *distance_items)
Estimates the size of a range as a number of elements.
int mdbx_env_set_mapsize(MDBX_env *env, size_t size)
Definition mdbx.h:3545
int mdbx_env_set_maxdbs(MDBX_env *env, MDBX_dbi dbs)
Set the maximum number of named tables for the environment.
Definition mdbx.h:3694
LIBMDBX_API int mdbx_env_warmup(const MDBX_env *env, const MDBX_txn *txn, MDBX_warmup_flags_t flags, unsigned timeout_seconds_16dot16)
Warms up the database by loading pages into memory, optionally lock ones.
LIBMDBX_API int mdbx_env_get_option(const MDBX_env *env, const MDBX_option_t option, uint64_t *pvalue)
Gets the value of extra runtime options from an environment.
int mdbx_env_set_syncperiod(MDBX_env *env, unsigned seconds_16dot16)
Sets relative period since the last unsteady commit to force flush the data buffers to disk,...
Definition mdbx.h:3027
MDBX_option_t
MDBX environment extra runtime options.
Definition mdbx.h:2094
LIBMDBX_API int mdbx_env_set_geometry(MDBX_env *env, intptr_t size_lower, intptr_t size_now, intptr_t size_upper, intptr_t growth_step, intptr_t shrink_threshold, intptr_t pagesize)
Set all size-related parameters of environment, including page size and the min/max size of the memor...
int mdbx_env_set_syncbytes(MDBX_env *env, size_t threshold)
Sets threshold to force flush the data buffers to disk, even any of MDBX_SAFE_NOSYNC flag in the envi...
Definition mdbx.h:2966
MDBX_warmup_flags_t
Warming up options.
Definition mdbx.h:3190
LIBMDBX_API int mdbx_env_set_option(MDBX_env *env, const MDBX_option_t option, uint64_t value)
Sets the value of a extra runtime options for an environment.
LIBMDBX_API int mdbx_env_set_userctx(MDBX_env *env, void *ctx)
Sets application information (a context pointer) associated with the environment.
int mdbx_env_set_maxreaders(MDBX_env *env, unsigned readers)
Set the maximum number of threads/reader slots for for all processes interacts with the database.
Definition mdbx.h:3648
LIBMDBX_API int mdbx_env_set_flags(MDBX_env *env, MDBX_env_flags_t flags, bool onoff)
Set environment flags.
@ MDBX_opt_txn_dp_initial
Controls the in-process initial allocation size for dirty pages list of a write transaction....
Definition mdbx.h:2198
@ MDBX_opt_subpage_room_threshold
Задаёт в % минимальный объём свободного места на основной странице, при отсутствии которого вложенные...
Definition mdbx.h:2371
@ MDBX_opt_subpage_limit
Задаёт в % максимальный размер вложенных страниц, используемых для размещения небольшого количества м...
Definition mdbx.h:2365
@ MDBX_opt_txn_dp_limit
Controls the in-process limit of dirty pages for a write transaction.
Definition mdbx.h:2194
@ MDBX_opt_prefer_waf_insteadof_balance
Управляет выбором между стремлением к равномерности наполнения страниц, либо уменьшением количества и...
Definition mdbx.h:2350
@ MDBX_opt_prefault_write_enable
Controls prevention of page-faults of reclaimed and allocated pages in the MDBX_WRITEMAP mode by clea...
Definition mdbx.h:2298
@ MDBX_opt_max_db
Controls the maximum number of named tables for the environment.
Definition mdbx.h:2103
@ MDBX_opt_merge_threshold_16dot16_percent
Controls the in-process threshold of semi-empty pages merge.
Definition mdbx.h:2265
@ MDBX_opt_subpage_reserve_prereq
Задаёт в % минимальный объём свободного места на основной странице, при наличии которого,...
Definition mdbx.h:2387
@ MDBX_opt_sync_bytes
Controls interprocess/shared threshold to force flush the data buffers to disk, if MDBX_SAFE_NOSYNC i...
Definition mdbx.h:2126
@ MDBX_opt_spill_min_denominator
Controls the in-process how minimal part of the dirty pages should be spilled when necessary.
Definition mdbx.h:2230
@ MDBX_opt_spill_parent4child_denominator
Controls the in-process how much of the parent transaction dirty pages will be spilled while start ea...
Definition mdbx.h:2253
@ MDBX_opt_loose_limit
Controls the in-process limit to grow a cache of dirty pages for reuse in the current transaction.
Definition mdbx.h:2166
@ MDBX_opt_rp_augment_limit
Controls the in-process limit to grow a list of reclaimed/recycled page's numbers for finding a seque...
Definition mdbx.h:2153
@ MDBX_opt_max_readers
Defines the maximum number of threads/reader slots for all processes interacting with the database.
Definition mdbx.h:2120
@ MDBX_opt_subpage_reserve_limit
Задаёт в % ограничение резервирования места на вложенных страницах.
Definition mdbx.h:2392
@ MDBX_opt_spill_max_denominator
Controls the in-process how maximal part of the dirty pages may be spilled when necessary.
Definition mdbx.h:2214
@ MDBX_opt_sync_period
Controls interprocess/shared relative period since the last unsteady commit to force flush the data b...
Definition mdbx.h:2132
@ MDBX_opt_dp_reserve_limit
Controls the in-process limit of a pre-allocated memory items for dirty pages.
Definition mdbx.h:2180
@ MDBX_opt_writethrough_threshold
Controls the choosing between use write-through disk writes and usual ones with followed flush by the...
Definition mdbx.h:2293
@ MDBX_opt_gc_time_limit
Controls the in-process spending time limit of searching consecutive pages inside GC.
Definition mdbx.h:2325
@ MDBX_warmup_touchlimit
Definition mdbx.h:3229
@ MDBX_warmup_force
Definition mdbx.h:3199
@ MDBX_warmup_oomsafe
Definition mdbx.h:3206
@ MDBX_warmup_release
Definition mdbx.h:3232
@ MDBX_warmup_lock
Definition mdbx.h:3221
@ MDBX_warmup_default
Definition mdbx.h:3193
LIBMDBX_API int mdbx_env_get_path(const MDBX_env *env, const char **dest)
Return the path that was used in mdbx_env_open().
LIBMDBX_API int mdbx_dbi_stat(const MDBX_txn *txn, MDBX_dbi dbi, MDBX_stat *stat, size_t bytes)
Retrieve statistics for a table.
LIBMDBX_API intptr_t mdbx_limits_keysize_min(MDBX_db_flags_t flags)
Returns minimal key size in bytes for given table flags.
LIBMDBX_API uint64_t mdbx_txn_id(const MDBX_txn *txn)
Return the transaction's ID.
LIBMDBX_API intptr_t mdbx_limits_valsize_max(intptr_t pagesize, MDBX_db_flags_t flags)
Returns maximal data size in bytes for given page size and table flags, or -1 if pagesize is invalid.
LIBMDBX_API int mdbx_env_info_ex(const MDBX_env *env, const MDBX_txn *txn, MDBX_envinfo *info, size_t bytes)
Return information about the MDBX environment.
int mdbx_env_get_maxreaders(const MDBX_env *env, unsigned *readers)
Get the maximum number of threads/reader slots for the environment.
Definition mdbx.h:3663
int mdbx_env_get_syncperiod(const MDBX_env *env, unsigned *period_seconds_16dot16)
Get relative period since the last unsteady commit to force flush the data buffers to disk,...
Definition mdbx.h:3047
LIBMDBX_API int mdbx_env_get_maxkeysize_ex(const MDBX_env *env, MDBX_db_flags_t flags)
Returns the maximum size of keys can put.
LIBMDBX_API int mdbx_txn_straggler(const MDBX_txn *txn, int *percent)
Returns a lag of the reading for the given transaction.
LIBMDBX_API int mdbx_env_get_maxvalsize_ex(const MDBX_env *env, MDBX_db_flags_t flags)
Returns the maximum size of data we can put.
LIBMDBX_API int mdbx_env_stat_ex(const MDBX_env *env, const MDBX_txn *txn, MDBX_stat *stat, size_t bytes)
Return statistics about the MDBX environment.
int mdbx_dbi_flags(const MDBX_txn *txn, MDBX_dbi dbi, unsigned *flags)
The shortcut to calling mdbx_dbi_flags_ex() with state=NULL for discarding it result.
Definition mdbx.h:4758
LIBMDBX_API int mdbx_env_get_pairsize4page_max(const MDBX_env *env, MDBX_db_flags_t flags)
Returns maximal size of key-value pair to fit in a single page for specified table flags.
LIBMDBX_API intptr_t mdbx_limits_valsize_min(MDBX_db_flags_t flags)
Returns minimal data size in bytes for given table flags.
int mdbx_env_info(const MDBX_env *env, MDBX_envinfo *info, size_t bytes)
Return information about the MDBX environment.
Definition mdbx.h:2891
int mdbx_env_get_syncbytes(const MDBX_env *env, size_t *threshold)
Get threshold to force flush the data buffers to disk, even any of MDBX_SAFE_NOSYNC flag in the envir...
Definition mdbx.h:2984
LIBMDBX_API int mdbx_enumerate_tables(const MDBX_txn *txn, MDBX_table_enum_func *func, void *ctx)
Перечисляет пользовательские именнованные таблицы.
LIBMDBX_API intptr_t mdbx_limits_valsize4page_max(intptr_t pagesize, MDBX_db_flags_t flags)
Returns maximal data size in bytes to fit in a leaf-page or single large/overflow-page with the given...
LIBMDBX_API intptr_t mdbx_limits_txnsize_max(intptr_t pagesize)
Returns maximal write transaction size (i.e. limit for summary volume of dirty pages) in bytes for gi...
intptr_t mdbx_limits_pgsize_max(void)
Returns the maximal database page size in bytes.
Definition mdbx.h:3572
LIBMDBX_API int mdbx_dbi_dupsort_depthmask(const MDBX_txn *txn, MDBX_dbi dbi, uint32_t *mask)
Retrieve depth (bitmask) information of nested dupsort (multi-value) B+trees for given table.
LIBMDBX_API int mdbx_txn_info(const MDBX_txn *txn, MDBX_txn_info *info, bool scan_rlt)
Return information about the MDBX transaction.
LIBMDBX_API int mdbx_is_dirty(const MDBX_txn *txn, const void *ptr)
Determines whether the given address is on a dirty database page of the transaction or not.
MDBX_dbi_state_t
DBI state bits returted by mdbx_dbi_flags_ex()
Definition mdbx.h:4730
LIBMDBX_API int mdbx_env_get_valsize4page_max(const MDBX_env *env, MDBX_db_flags_t flags)
Returns maximal data size in bytes to fit in a leaf-page or single large/overflow-page for specified ...
intptr_t mdbx_limits_pgsize_min(void)
Returns the minimal database page size in bytes.
Definition mdbx.h:3568
LIBMDBX_API int mdbx_env_get_maxkeysize(const MDBX_env *env)
LIBMDBX_API int mdbx_env_get_fd(const MDBX_env *env, mdbx_filehandle_t *fd)
Return the file descriptor for the given environment.
LIBMDBX_API void * mdbx_env_get_userctx(const MDBX_env *env)
Returns an application information (a context pointer) associated with the environment.
int MDBX_reader_list_func(void *ctx, int num, int slot, mdbx_pid_t pid, mdbx_tid_t thread, uint64_t txnid, uint64_t lag, size_t bytes_used, size_t bytes_retained) noexcept
A callback function used to enumerate the reader lock table.
Definition mdbx.h:6047
int mdbx_env_get_maxdbs(const MDBX_env *env, MDBX_dbi *dbs)
Get the maximum number of named tables for the environment.
Definition mdbx.h:3708
LIBMDBX_API int mdbx_env_get_pathW(const MDBX_env *env, const wchar_t **dest)
Return the path that was used in mdbx_env_open().
LIBMDBX_API intptr_t mdbx_limits_keysize_max(intptr_t pagesize, MDBX_db_flags_t flags)
Returns maximal key size in bytes for given page size and table flags, or -1 if pagesize is invalid.
LIBMDBX_API size_t mdbx_default_pagesize(void)
Returns the default size of database page for the current system.
LIBMDBX_API int mdbx_reader_list(const MDBX_env *env, MDBX_reader_list_func *func, void *ctx)
Enumerate the entries in the reader lock table.
LIBMDBX_API int mdbx_get_sysraminfo(intptr_t *page_size, intptr_t *total_pages, intptr_t *avail_pages)
Returns basic information about system RAM. This function provides a portable way to get information ...
int mdbx_env_stat(const MDBX_env *env, MDBX_stat *stat, size_t bytes)
Return statistics about the MDBX environment.
Definition mdbx.h:2776
LIBMDBX_API intptr_t mdbx_limits_pairsize4page_max(intptr_t pagesize, MDBX_db_flags_t flags)
Returns maximal size of key-value pair to fit in a single page with the given size and table flags,...
LIBMDBX_API intptr_t mdbx_limits_dbsize_max(intptr_t pagesize)
Returns maximal database size in bytes for given page size, or -1 if pagesize is invalid.
LIBMDBX_API intptr_t mdbx_limits_dbsize_min(intptr_t pagesize)
Returns minimal database size in bytes for given page size, or -1 if pagesize is invalid.
LIBMDBX_API int mdbx_env_get_flags(const MDBX_env *env, unsigned *flags)
Get environment flags.
int MDBX_table_enum_func(void *ctx, const MDBX_txn *txn, const MDBX_val *name, MDBX_db_flags_t flags, const struct MDBX_stat *stat, MDBX_dbi dbi) noexcept
Функция обратного вызова для перечисления пользовательских именованных таблиц.
Definition mdbx.h:4623
LIBMDBX_API int mdbx_dbi_flags_ex(const MDBX_txn *txn, MDBX_dbi dbi, unsigned *flags, unsigned *state)
Retrieve the DB flags and status for a table handle.
@ MDBX_DBI_DIRTY
Definition mdbx.h:4732
@ MDBX_DBI_FRESH
Definition mdbx.h:4736
@ MDBX_DBI_STALE
Definition mdbx.h:4734
@ MDBX_DBI_CREAT
Definition mdbx.h:4738
LIBMDBX_API int mdbx_txn_break(MDBX_txn *txn)
Marks transaction as broken.
LIBMDBX_API int mdbx_txn_set_userctx(MDBX_txn *txn, void *ctx)
Sets application information associated (a context pointer) with the transaction.
LIBMDBX_API int mdbx_txn_park(MDBX_txn *txn, bool autounpark)
Переводит читающую транзакцию в "припаркованное" состояние.
LIBMDBX_API int mdbx_txn_begin_ex(MDBX_env *env, MDBX_txn *parent, MDBX_txn_flags_t flags, MDBX_txn **txn, void *context)
Create a transaction with a user provided context pointer for use with the environment.
int mdbx_txn_commit(MDBX_txn *txn)
Commit all the operations of a transaction into the database.
Definition mdbx.h:4200
LIBMDBX_API int mdbx_txn_commit_ex(MDBX_txn *txn, MDBX_commit_latency *latency)
Commit all the operations of a transaction into the database and collect latency information.
LIBMDBX_API MDBX_env * mdbx_txn_env(const MDBX_txn *txn)
Returns the transaction's MDBX_env.
LIBMDBX_API int mdbx_txn_unpark(MDBX_txn *txn, bool restart_if_ousted)
Распарковывает ранее припаркованную читающую транзакцию.
MDBX_txn_flags_t
Definition mdbx.h:1477
LIBMDBX_API void * mdbx_txn_get_userctx(const MDBX_txn *txn)
Returns an application information (a context pointer) associated with the transaction.
int mdbx_txn_begin(MDBX_env *env, MDBX_txn *parent, MDBX_txn_flags_t flags, MDBX_txn **txn)
Create a transaction for use with the environment.
Definition mdbx.h:3928
LIBMDBX_API int mdbx_txn_abort(MDBX_txn *txn)
Abandon all the operations of the transaction instead of saving them.
struct MDBX_txn MDBX_txn
Opaque structure for a transaction handle.
Definition mdbx.h:708
LIBMDBX_API int mdbx_txn_reset(MDBX_txn *txn)
Reset a read-only transaction.
LIBMDBX_API int mdbx_txn_renew(MDBX_txn *txn)
Renew a read-only transaction.
LIBMDBX_API MDBX_txn_flags_t mdbx_txn_flags(const MDBX_txn *txn)
Return the transaction's flags.
@ MDBX_TXN_RDONLY
Definition mdbx.h:1488
@ MDBX_TXN_ERROR
Definition mdbx.h:1528
@ MDBX_TXN_NOMETASYNC
Definition mdbx.h:1507
@ MDBX_TXN_SPILLS
Definition mdbx.h:1538
@ MDBX_TXN_OUSTED
Definition mdbx.h:1562
@ MDBX_TXN_HAS_CHILD
Definition mdbx.h:1543
@ MDBX_TXN_RDONLY_PREPARE
Definition mdbx.h:1497
@ MDBX_TXN_INVALID
Definition mdbx.h:1518
@ MDBX_TXN_BLOCKED
Definition mdbx.h:1567
@ MDBX_TXN_PARKED
Definition mdbx.h:1548
@ MDBX_TXN_NOSYNC
Definition mdbx.h:1511
@ MDBX_TXN_DIRTY
Definition mdbx.h:1533
@ MDBX_TXN_READWRITE
Definition mdbx.h:1482
@ MDBX_TXN_AUTOUNPARK
Definition mdbx.h:1555
@ MDBX_TXN_TRY
Definition mdbx.h:1503
@ MDBX_TXN_FINISHED
Definition mdbx.h:1523
MDBX_chk_severity_t verbosity
Definition mdbx.h:6408
MDBX_txn * txn
Definition mdbx.h:6473
void(* issue)(MDBX_chk_context_t *ctx, const char *object, uint64_t entry_number, const char *issue, const char *extra_fmt, va_list extra_args)
Definition mdbx.h:6511
size_t pad
Definition mdbx.h:6425
struct MDBX_chk_internal * internal
Definition mdbx.h:6471
uint8_t scope_nesting
Definition mdbx.h:6475
size_t ones
Definition mdbx.h:6425
struct MDBX_chk_internal * internal
Definition mdbx.h:6405
char * begin
Definition mdbx.h:6390
size_t subtotal_issues
Definition mdbx.h:6409
MDBX_chk_user_table_cookie_t * cookie
Definition mdbx.h:6435
struct MDBX_chk_context * ctx
Definition mdbx.h:6388
MDBX_db_flags_t flags
Definition mdbx.h:6445
struct MDBX_chk_issue * next
Definition mdbx.h:6396
const void * object
Definition mdbx.h:6406
size_t count
Definition mdbx.h:6425
const char * caption
Definition mdbx.h:6398
struct MDBX_chk_histogram::@9 ranges[9]
MDBX_chk_stage_t stage
Definition mdbx.h:6407
MDBX_env * env
Definition mdbx.h:6472
uint8_t empty
Definition mdbx.h:6389
size_t amount
Definition mdbx.h:6425
MDBX_chk_scope_t * scope
Definition mdbx.h:6474
MDBX_chk_issue_t * issues
Definition mdbx.h:6404
size_t count
Definition mdbx.h:6397
MDBX_val name
Definition mdbx.h:6444
size_t lost_bytes
Definition mdbx.h:6448
int id
Definition mdbx.h:6446
LIBMDBX_API int mdbx_env_chk_encount_problem(MDBX_chk_context_t *ctx)
Вспомогательная функция для подсчета проблем детектируемых приложением, в том числе,...
LIBMDBX_API int mdbx_env_chk(MDBX_env *env, const MDBX_chk_callbacks_t *cb, MDBX_chk_context_t *ctx, const MDBX_chk_flags_t flags, MDBX_chk_severity_t verbosity, unsigned timeout_seconds_16dot16)
Проверяет целостность базы данных.
MDBX_chk_stage_t
Стадии проверки, сообщаемые через обратные вызовы при проверке целостности базы данных.
Definition mdbx.h:6370
LIBMDBX_API int mdbx_txn_unlock(MDBX_env *env)
Releases write-transaction lock. Provided for custom and/or complex locking scenarios.
struct MDBX_chk_user_table_cookie MDBX_chk_user_table_cookie_t
Пользовательский тип для привязки дополнительных данных, связанных с некоторой таблицей ключ-значение...
Definition mdbx.h:6419
MDBX_chk_flags_t
Флаги/опции для проверки целостности базы данных.
Definition mdbx.h:6327
MDBX_chk_severity_t
Уровни логирование/детализации информации, поставляемой через обратные вызовы при проверке целостност...
Definition mdbx.h:6351
LIBMDBX_API int mdbx_txn_lock(MDBX_env *env, bool dont_wait)
Acquires write-transaction lock. Provided for custom and/or complex locking scenarios.
LIBMDBX_API int mdbx_env_turn_for_recovery(MDBX_env *env, unsigned target_meta)
Turn database to the specified meta-page.
LIBMDBX_API int mdbx_env_open_for_recovery(MDBX_env *env, const char *pathname, unsigned target_meta, bool writeable)
Open an environment instance using specific meta-page for checking and recovery.
@ MDBX_chk_gc
Definition mdbx.h:6376
@ MDBX_chk_init
Definition mdbx.h:6372
@ MDBX_chk_finalize
Definition mdbx.h:6382
@ MDBX_chk_space
Definition mdbx.h:6377
@ MDBX_chk_lock
Definition mdbx.h:6373
@ MDBX_chk_none
Definition mdbx.h:6371
@ MDBX_chk_maindb
Definition mdbx.h:6378
@ MDBX_chk_unlock
Definition mdbx.h:6381
@ MDBX_chk_meta
Definition mdbx.h:6374
@ MDBX_chk_conclude
Definition mdbx.h:6380
@ MDBX_chk_tree
Definition mdbx.h:6375
@ MDBX_chk_tables
Definition mdbx.h:6379
@ MDBX_CHK_SKIP_BTREE_TRAVERSAL
Definition mdbx.h:6336
@ MDBX_CHK_READWRITE
Definition mdbx.h:6333
@ MDBX_CHK_DEFAULTS
Definition mdbx.h:6329
@ MDBX_CHK_SKIP_KV_TRAVERSAL
Definition mdbx.h:6339
@ MDBX_CHK_IGNORE_ORDER
Definition mdbx.h:6344
@ MDBX_chk_processing
Definition mdbx.h:6360
@ MDBX_chk_result
Definition mdbx.h:6358
@ MDBX_chk_details
Definition mdbx.h:6363
@ MDBX_chk_extra
Definition mdbx.h:6364
@ MDBX_chk_severity_prio_shift
Definition mdbx.h:6352
@ MDBX_chk_severity_kind_mask
Definition mdbx.h:6353
@ MDBX_chk_notice
Definition mdbx.h:6357
@ MDBX_chk_resolution
Definition mdbx.h:6359
@ MDBX_chk_warning
Definition mdbx.h:6356
@ MDBX_chk_fatal
Definition mdbx.h:6354
@ MDBX_chk_info
Definition mdbx.h:6361
@ MDBX_chk_error
Definition mdbx.h:6355
@ MDBX_chk_verbose
Definition mdbx.h:6362
Набор функций обратного вызова используемых при проверке целостности базы данных.
Definition mdbx.h:6505
Контекст проверки целостности базы данных.
Definition mdbx.h:6470
Гистограмма с некоторой статистической информацией, собираемой при проверке целостности БД.
Definition mdbx.h:6424
Проблема обнаруженная при проверке целостности базы данных.
Definition mdbx.h:6395
Виртуальная строка отчета, формируемого при проверке целостности базы данных.
Definition mdbx.h:6387
Иерархический контекст при проверке целостности базы данных.
Definition mdbx.h:6403
Информация о некоторой таблицей ключ-значение, при проверке целостности базы данных.
Definition mdbx.h:6434
LIBMDBX_API float mdbx_float_from_key(const MDBX_val)
LIBMDBX_API int32_t mdbx_int32_from_key(const MDBX_val)
LIBMDBX_API int64_t mdbx_int64_from_key(const MDBX_val)
LIBMDBX_API double mdbx_double_from_key(const MDBX_val)
LIBMDBX_API int64_t mdbx_jsonInteger_from_key(const MDBX_val)
uint64_t mdbx_key_from_int64(const int64_t i64)
Definition mdbx.h:4669
LIBMDBX_API uint32_t mdbx_key_from_ptrfloat(const float *const ieee754_32bit)
LIBMDBX_API uint64_t mdbx_key_from_double(const double ieee754_64bit)
LIBMDBX_API uint32_t mdbx_key_from_float(const float ieee754_32bit)
LIBMDBX_API uint64_t mdbx_key_from_ptrdouble(const double *const ieee754_64bit)
uint32_t mdbx_key_from_int32(const int32_t i32)
Definition mdbx.h:4673
LIBMDBX_API uint64_t mdbx_key_from_jsonInteger(const int64_t json_integer)