41#if 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_cpp_attribute
193#define __has_cpp_attribute(x) 0
197#define __has_feature(x) (0)
200#ifndef __has_extension
201#define __has_extension(x) (0)
205#define __has_builtin(x) (0)
215#define MDBX_PURE_FUNCTION [[gnu::pure]]
216#elif (defined(__GNUC__) || __has_attribute(__pure__)) && \
217 (!defined(__clang__) \
218 || !defined(__cplusplus) || !__has_feature(cxx_exceptions))
219#define MDBX_PURE_FUNCTION __attribute__((__pure__))
220#elif defined(_MSC_VER) && !defined(__clang__) && _MSC_VER >= 1920
221#define MDBX_PURE_FUNCTION
222#elif defined(__cplusplus) && __has_cpp_attribute(gnu::pure) && \
223 (!defined(__clang__) || !__has_feature(cxx_exceptions))
224#define MDBX_PURE_FUNCTION [[gnu::pure]]
226#define MDBX_PURE_FUNCTION
233#define MDBX_NOTHROW_PURE_FUNCTION [[gnu::pure, gnu::nothrow]]
234#elif defined(__GNUC__) || \
235 (__has_attribute(__pure__) && __has_attribute(__nothrow__))
236#define MDBX_NOTHROW_PURE_FUNCTION __attribute__((__pure__, __nothrow__))
237#elif defined(_MSC_VER) && !defined(__clang__) && _MSC_VER >= 1920
238#if __has_cpp_attribute(pure)
239#define MDBX_NOTHROW_PURE_FUNCTION [[pure]]
241#define MDBX_NOTHROW_PURE_FUNCTION
243#elif defined(__cplusplus) && __has_cpp_attribute(gnu::pure)
244#if __has_cpp_attribute(gnu::nothrow)
245#define MDBX_NOTHROW_PURE_FUNCTION [[gnu::pure, gnu::nothrow]]
247#define MDBX_NOTHROW_PURE_FUNCTION [[gnu::pure]]
249#elif defined(__cplusplus) && __has_cpp_attribute(pure)
250#define MDBX_NOTHROW_PURE_FUNCTION [[pure]]
252#define MDBX_NOTHROW_PURE_FUNCTION
266#define MDBX_CONST_FUNCTION [[gnu::const]]
267#elif (defined(__GNUC__) || __has_attribute(__pure__)) && \
268 (!defined(__clang__) \
269 || !defined(__cplusplus) || !__has_feature(cxx_exceptions))
270#define MDBX_CONST_FUNCTION __attribute__((__const__))
271#elif defined(_MSC_VER) && !defined(__clang__) && _MSC_VER >= 1920
272#define MDBX_CONST_FUNCTION MDBX_PURE_FUNCTION
273#elif defined(__cplusplus) && __has_cpp_attribute(gnu::const) && \
274 (!defined(__clang__) || !__has_feature(cxx_exceptions))
275#define MDBX_CONST_FUNCTION [[gnu::const]]
277#define MDBX_CONST_FUNCTION MDBX_PURE_FUNCTION
284#define MDBX_NOTHROW_CONST_FUNCTION [[gnu::const, gnu::nothrow]]
285#elif defined(__GNUC__) || \
286 (__has_attribute(__const__) && __has_attribute(__nothrow__))
287#define MDBX_NOTHROW_CONST_FUNCTION __attribute__((__const__, __nothrow__))
288#elif defined(_MSC_VER) && !defined(__clang__) && _MSC_VER >= 1920
289#define MDBX_NOTHROW_CONST_FUNCTION MDBX_NOTHROW_PURE_FUNCTION
290#elif defined(__cplusplus) && __has_cpp_attribute(gnu::const)
291#if __has_cpp_attribute(gnu::nothrow)
292#define MDBX_NOTHROW_PURE_FUNCTION [[gnu::const, gnu::nothrow]]
294#define MDBX_NOTHROW_PURE_FUNCTION [[gnu::const]]
296#elif defined(__cplusplus) && __has_cpp_attribute(const)
297#define MDBX_NOTHROW_CONST_FUNCTION [[const]]
299#define MDBX_NOTHROW_CONST_FUNCTION MDBX_NOTHROW_PURE_FUNCTION
305#ifndef MDBX_DEPRECATED
307#define MDBX_DEPRECATED __deprecated
308#elif defined(DOXYGEN) || \
309 (defined(__cplusplus) && __cplusplus >= 201403L && \
310 __has_cpp_attribute(deprecated) && \
311 __has_cpp_attribute(deprecated) >= 201309L) || \
312 (!defined(__cplusplus) && defined(__STDC_VERSION__) && \
313 __STDC_VERSION__ >= 202304L)
314#define MDBX_DEPRECATED [[deprecated]]
315#elif (defined(__GNUC__) && __GNUC__ > 5) || \
316 (__has_attribute(__deprecated__) && !defined(__GNUC__))
317#define MDBX_DEPRECATED __attribute__((__deprecated__))
318#elif defined(_MSC_VER)
319#define MDBX_DEPRECATED __declspec(deprecated)
321#define MDBX_DEPRECATED
325#ifndef MDBX_DEPRECATED_ENUM
326#if !defined(DOXYGEN) && (!defined(_MSC_VER) || _MSC_VER >= 1930)
327#define MDBX_DEPRECATED_ENUM MDBX_DEPRECATED
329#define MDBX_DEPRECATED_ENUM
334#if defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__) || \
335 defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)
336#if defined(__GNUC__) || __has_attribute(__dllexport__)
337#define __dll_export __attribute__((__dllexport__))
338#elif defined(_MSC_VER)
339#define __dll_export __declspec(dllexport)
343#elif defined(__GNUC__) || __has_attribute(__visibility__)
344#define __dll_export __attribute__((__visibility__("default")))
351#if defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__) || \
352 defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)
353#if defined(__GNUC__) || __has_attribute(__dllimport__)
354#define __dll_import __attribute__((__dllimport__))
355#elif defined(_MSC_VER)
356#define __dll_import __declspec(dllimport)
369#if defined(LIBMDBX_INTERNALS) && !defined(LIBMDBX_NO_EXPORTS_LEGACY_API)
370#define LIBMDBX_INLINE_API(TYPE, NAME, ARGS) \
371 LIBMDBX_API TYPE NAME ARGS; \
372 static __inline TYPE __inline_##NAME ARGS
374#define LIBMDBX_INLINE_API(TYPE, NAME, ARGS) static __inline TYPE NAME ARGS
378#ifndef MDBX_STRINGIFY
379#define MDBX_STRINGIFY_HELPER(x) #x
380#define MDBX_STRINGIFY(x) MDBX_STRINGIFY_HELPER(x)
399#define MDBX_CXX17_NOEXCEPT noexcept
400#elif !defined(__cpp_noexcept_function_type) || \
401 __cpp_noexcept_function_type < 201510L
402#define MDBX_CXX17_NOEXCEPT
404#define MDBX_CXX17_NOEXCEPT noexcept
409#define MDBX_CXX01_CONSTEXPR constexpr
410#define MDBX_CXX01_CONSTEXPR_VAR constexpr
411#elif !defined(__cplusplus)
412#define MDBX_CXX01_CONSTEXPR __inline
413#define MDBX_CXX01_CONSTEXPR_VAR const
414#elif !defined(DOXYGEN) && \
415 ((__cplusplus < 201103L && defined(__cpp_constexpr) && \
416 __cpp_constexpr < 200704L) || \
417 (defined(__LCC__) && __LCC__ < 124) || \
418 (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ < 407) && \
419 !defined(__clang__) && !defined(__LCC__)) || \
420 (defined(_MSC_VER) && _MSC_VER < 1910) || \
421 (defined(__clang__) && __clang_major__ < 4))
422#define MDBX_CXX01_CONSTEXPR inline
423#define MDBX_CXX01_CONSTEXPR_VAR const
425#define MDBX_CXX01_CONSTEXPR constexpr
426#define MDBX_CXX01_CONSTEXPR_VAR constexpr
432#define MDBX_CXX11_CONSTEXPR constexpr
433#define MDBX_CXX11_CONSTEXPR_VAR constexpr
434#elif !defined(__cplusplus)
435#define MDBX_CXX11_CONSTEXPR __inline
436#define MDBX_CXX11_CONSTEXPR_VAR const
437#elif !defined(DOXYGEN) && \
438 (!defined(__cpp_constexpr) || __cpp_constexpr < 201304L || \
439 (defined(__LCC__) && __LCC__ < 124) || \
440 (defined(__GNUC__) && __GNUC__ < 6 && !defined(__clang__) && \
441 !defined(__LCC__)) || \
442 (defined(_MSC_VER) && _MSC_VER < 1910) || \
443 (defined(__clang__) && __clang_major__ < 5))
444#define MDBX_CXX11_CONSTEXPR inline
445#define MDBX_CXX11_CONSTEXPR_VAR const
447#define MDBX_CXX11_CONSTEXPR constexpr
448#define MDBX_CXX11_CONSTEXPR_VAR constexpr
454#define MDBX_CXX14_CONSTEXPR constexpr
455#define MDBX_CXX14_CONSTEXPR_VAR constexpr
456#elif !defined(__cplusplus)
457#define MDBX_CXX14_CONSTEXPR __inline
458#define MDBX_CXX14_CONSTEXPR_VAR const
459#elif defined(DOXYGEN) || \
460 defined(__cpp_constexpr) && __cpp_constexpr >= 201304L && \
461 ((defined(_MSC_VER) && _MSC_VER >= 1910) || \
462 (defined(__clang__) && __clang_major__ > 4) || \
463 (defined(__GNUC__) && __GNUC__ > 6) || \
464 (!defined(__GNUC__) && !defined(__clang__) && !defined(_MSC_VER)))
465#define MDBX_CXX14_CONSTEXPR constexpr
466#define MDBX_CXX14_CONSTEXPR_VAR constexpr
468#define MDBX_CXX14_CONSTEXPR inline
469#define MDBX_CXX14_CONSTEXPR_VAR const
472#if defined(__noreturn)
473#define MDBX_NORETURN __noreturn
474#elif defined(_Noreturn)
475#define MDBX_NORETURN _Noreturn
476#elif defined(DOXYGEN) || (defined(__cplusplus) && __cplusplus >= 201103L) || \
477 (!defined(__cplusplus) && defined(__STDC_VERSION__) && \
478 __STDC_VERSION__ > 202005L)
479#define MDBX_NORETURN [[noreturn]]
480#elif defined(__GNUC__) || __has_attribute(__noreturn__)
481#define MDBX_NORETURN __attribute__((__noreturn__))
482#elif defined(_MSC_VER) && !defined(__clang__)
483#define MDBX_NORETURN __declspec(noreturn)
488#ifndef MDBX_PRINTF_ARGS
489#if defined(__GNUC__) || __has_attribute(__format__) || defined(DOXYGEN)
490#if defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)
491#define MDBX_PRINTF_ARGS(format_index, first_arg) \
492 __attribute__((__format__(__gnu_printf__, format_index, first_arg)))
494#define MDBX_PRINTF_ARGS(format_index, first_arg) \
495 __attribute__((__format__(__printf__, format_index, first_arg)))
498#define MDBX_PRINTF_ARGS(format_index, first_arg)
502#if defined(DOXYGEN) || \
503 (defined(__cplusplus) && __cplusplus >= 201603L && \
504 __has_cpp_attribute(maybe_unused) && \
505 __has_cpp_attribute(maybe_unused) >= 201603L) || \
506 (!defined(__cplusplus) && defined(__STDC_VERSION__) && \
507 __STDC_VERSION__ > 202005L)
508#define MDBX_MAYBE_UNUSED [[maybe_unused]]
509#elif defined(__GNUC__) || __has_attribute(__unused__)
510#define MDBX_MAYBE_UNUSED __attribute__((__unused__))
512#define MDBX_MAYBE_UNUSED
515#if __has_attribute(no_sanitize) || defined(DOXYGEN)
516#define MDBX_NOSANITIZE_ENUM __attribute((__no_sanitize__("enum")))
518#define MDBX_NOSANITIZE_ENUM
526#if !defined(DEFINE_ENUM_FLAG_OPERATORS) && !defined(DOXYGEN)
529#if !defined(__cpp_constexpr) || __cpp_constexpr < 200704L || \
530 (defined(__LCC__) && __LCC__ < 124) || \
531 (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ < 407) && \
532 !defined(__clang__) && !defined(__LCC__)) || \
533 (defined(_MSC_VER) && _MSC_VER < 1910) || \
534 (defined(__clang__) && __clang_major__ < 4)
536#define CONSTEXPR_ENUM_FLAGS_OPERATIONS 0
539#define CONSTEXPR_ENUM_FLAGS_OPERATIONS 1
544#define DEFINE_ENUM_FLAG_OPERATORS(ENUM) \
546 MDBX_NOSANITIZE_ENUM MDBX_CXX01_CONSTEXPR ENUM operator|(ENUM a, ENUM b) { \
547 return ENUM(unsigned(a) | unsigned(b)); \
549 MDBX_NOSANITIZE_ENUM MDBX_CXX14_CONSTEXPR ENUM &operator|=(ENUM &a, \
553 MDBX_NOSANITIZE_ENUM MDBX_CXX01_CONSTEXPR ENUM operator&(ENUM a, ENUM b) { \
554 return ENUM(unsigned(a) & unsigned(b)); \
556 MDBX_NOSANITIZE_ENUM MDBX_CXX01_CONSTEXPR ENUM operator&(ENUM a, \
558 return ENUM(unsigned(a) & b); \
560 MDBX_NOSANITIZE_ENUM MDBX_CXX01_CONSTEXPR ENUM operator&(unsigned a, \
562 return ENUM(a & unsigned(b)); \
564 MDBX_NOSANITIZE_ENUM MDBX_CXX14_CONSTEXPR ENUM &operator&=(ENUM &a, \
568 MDBX_NOSANITIZE_ENUM MDBX_CXX14_CONSTEXPR ENUM &operator&=(ENUM &a, \
572 MDBX_CXX01_CONSTEXPR unsigned operator~(ENUM a) { return ~unsigned(a); } \
573 MDBX_NOSANITIZE_ENUM MDBX_CXX01_CONSTEXPR ENUM operator^(ENUM a, ENUM b) { \
574 return ENUM(unsigned(a) ^ unsigned(b)); \
576 MDBX_NOSANITIZE_ENUM MDBX_CXX14_CONSTEXPR ENUM &operator^=(ENUM &a, \
583#define DEFINE_ENUM_FLAG_OPERATORS(ENUM)
584#define CONSTEXPR_ENUM_FLAGS_OPERATIONS 1
587#elif !defined(CONSTEXPR_ENUM_FLAGS_OPERATIONS)
591#define CONSTEXPR_ENUM_FLAGS_OPERATIONS 0
594#define CONSTEXPR_ENUM_FLAGS_OPERATIONS 1
611#define MDBX_VERSION_MAJOR 0
612#define MDBX_VERSION_MINOR 13
615#if defined(LIBMDBX_EXPORTS)
616#define LIBMDBX_API __dll_export
617#elif defined(LIBMDBX_IMPORTS)
618#define LIBMDBX_API __dll_import
625#if defined(__clang__) || __has_attribute(type_visibility)
626#define LIBMDBX_API_TYPE LIBMDBX_API __attribute__((type_visibility("default")))
628#define LIBMDBX_API_TYPE LIBMDBX_API
631#define LIBMDBX_API_TYPE
634#if defined(LIBMDBX_IMPORTS)
635#define LIBMDBX_VERINFO_API __dll_import
637#define LIBMDBX_VERINFO_API __dll_export
647 const char *datetime;
650 const char *describe;
666#if (defined(_WIN32) || defined(_WIN64)) && !MDBX_BUILD_SHARED_LIBRARY
694#error Non-dll build libmdbx requires target Windows version \
695 to be explicitly defined via _WIN32_WINNT for properly \
696 handling thread local storage destructors.
699#if _WIN32_WINNT >= 0x0600
702#define MDBX_MANUAL_MODULE_HANDLER 0
706#define MDBX_MANUAL_MODULE_HANDLER 1
707void LIBMDBX_API NTAPI mdbx_module_handler(PVOID module, DWORD reason,
769#ifndef HAVE_STRUCT_IOVEC
774#define HAVE_STRUCT_IOVEC
777#if defined(__sun) || defined(__SVR4) || defined(__svr4__)
811#if !(defined(_WIN32) || defined(_WIN64))
812#define MDBX_LOCKNAME "/mdbx.lck"
814#define MDBX_LOCKNAME_W L"\\mdbx.lck"
815#define MDBX_LOCKNAME_A "\\mdbx.lck"
817#define MDBX_LOCKNAME MDBX_LOCKNAME_W
819#define MDBX_LOCKNAME MDBX_LOCKNAME_A
826#if !(defined(_WIN32) || defined(_WIN64))
827#define MDBX_DATANAME "/mdbx.dat"
829#define MDBX_DATANAME_W L"\\mdbx.dat"
830#define MDBX_DATANAME_A "\\mdbx.dat"
832#define MDBX_DATANAME MDBX_DATANAME_W
834#define MDBX_DATANAME MDBX_DATANAME_A
839#ifndef MDBX_LOCK_SUFFIX
841#if !(defined(_WIN32) || defined(_WIN64))
842#define MDBX_LOCK_SUFFIX "-lck"
844#define MDBX_LOCK_SUFFIX_W L"-lck"
845#define MDBX_LOCK_SUFFIX_A "-lck"
847#define MDBX_LOCK_SUFFIX MDBX_LOCK_SUFFIX_W
849#define MDBX_LOCK_SUFFIX MDBX_LOCK_SUFFIX_A
863typedef enum MDBX_log_level {
920typedef enum MDBX_debug_flags {
952 MDBX_DBG_MAX = ((unsigned)MDBX_LOG_MAX) << 16 |
959DEFINE_ENUM_FLAG_OPERATORS(MDBX_debug_flags)
976 int line, const
char *fmt,
980#define MDBX_LOGGER_DONTCHANGE ((MDBX_debug_func *)(intptr_t)-1)
981#define MDBX_LOGGER_NOFMT_DONTCHANGE ((MDBX_debug_func_nofmt *)(intptr_t)-1)
991 const char *function,
int line,
999 size_t logger_buffer_size);
1012 const char *function,
1036 const size_t bufsize);
1040 MDBX_PRINTF_ARGS(1, 2);
1054typedef enum MDBX_env_flags {
1509DEFINE_ENUM_FLAG_OPERATORS(MDBX_env_flags)
1515typedef enum MDBX_txn_flags {
1534#if CONSTEXPR_ENUM_FLAGS_OPERATIONS || defined(DOXYGEN)
1608DEFINE_ENUM_FLAG_OPERATORS(MDBX_txn_flags)
1614typedef enum MDBX_db_flags {
1658DEFINE_ENUM_FLAG_OPERATORS(MDBX_db_flags)
1664typedef enum MDBX_put_flags {
1703DEFINE_ENUM_FLAG_OPERATORS(MDBX_put_flags)
1708typedef enum MDBX_copy_flags {
1735DEFINE_ENUM_FLAG_OPERATORS(MDBX_copy_flags)
1860typedef enum MDBX_error {
2013#if defined(_WIN32) || defined(_WIN64)
2050MDBX_DEPRECATED
static __inline
int MDBX_MAP_RESIZED_is_deprecated(
void) {
2053#define MDBX_MAP_RESIZED MDBX_MAP_RESIZED_is_deprecated()
2102#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
2136typedef enum MDBX_option {
2539#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
2550typedef enum MDBX_env_delete_mode {
2588#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
2709#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
3044 assert(proxy <= SIZE_MAX);
3046 *threshold = (size_t)proxy;
3103 if (period_seconds_16dot16) {
3107 assert(proxy <= UINT32_MAX);
3109 *period_seconds_16dot16 = (unsigned)proxy;
3162#if defined(DOXYGEN) || !(defined(_WIN32) || defined(_WIN64))
3246typedef enum MDBX_warmup_flags {
3290DEFINE_ENUM_FLAG_OPERATORS(MDBX_warmup_flags)
3325 unsigned timeout_seconds_16dot16);
3377#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
3596 intptr_t size_now, intptr_t size_upper,
3597 intptr_t growth_step,
3598 intptr_t shrink_threshold,
3623 intptr_t redundancy);
3739 *readers = (unsigned)proxy;
3810 intptr_t *avail_pages);
4175 uint32_t coalescences;
4190 uint32_t work_counter;
4193 uint32_t work_rtime_monotonic;
4197 uint32_t work_xtime_cpu;
4200 uint32_t work_rsteps;
4203 uint32_t work_xpages;
4206 uint32_t work_majflt;
4210 uint32_t self_counter;
4213 uint32_t self_rtime_monotonic;
4217 uint32_t self_xtime_cpu;
4220 uint32_t self_rsteps;
4223 uint32_t self_xpages;
4226 uint32_t self_majflt;
4765 return UINT64_C(0x8000000000000000) + i64;
4769 return UINT32_C(0x80000000) + i32;
4832typedef enum MDBX_dbi_state {
4842DEFINE_ENUM_FLAG_OPERATORS(MDBX_dbi_state)
4856 unsigned *flags,
unsigned *state);
4971 MDBX_val *data,
size_t *values_count);
5136 const void *src,
size_t bytes);
5141 void *preserver_context);
5427 bool ignore_multival);
5967 ptrdiff_t *distance_items);
5991 ptrdiff_t *distance_items);
6022 ptrdiff_t *distance_items);
6026#define MDBX_EPSILON ((MDBX_val *)((ptrdiff_t)-1))
6086 uint64_t increment);
6165 uint64_t lag,
size_t bytes_used,
6317 unsigned gap,
size_t space,
6381 unsigned target_meta,
6384#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
6390 const wchar_t *pathname,
6391 unsigned target_meta,
6435#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
6448typedef enum MDBX_chk_flags {
6467DEFINE_ENUM_FLAG_OPERATORS(MDBX_chk_flags)
6472typedef enum MDBX_chk_severity {
6491typedef enum MDBX_chk_stage {
6508typedef struct MDBX_chk_line {
6516typedef struct MDBX_chk_issue {
6524typedef struct MDBX_chk_scope {
6534 } usr_z, usr_v, usr_o;
6555typedef struct MDBX_chk_table {
6559#define MDBX_CHK_MAIN ((void *)((ptrdiff_t)0))
6561#define MDBX_CHK_GC ((void *)((ptrdiff_t)-1))
6563#define MDBX_CHK_META ((void *)((ptrdiff_t)-2))
6571 size_t all, empty, other;
6572 size_t branch, leaf;
6573 size_t nested_branch, nested_leaf, nested_subleaf;
6591typedef struct MDBX_chk_context {
6598 size_t total_payload_bytes;
6599 size_t table_total, table_processed;
6600 size_t total_unused_bytes, unused_pages;
6601 size_t processed_pages, reclaimable_pages, gc_pages, alloc_pages,
6603 size_t problems_meta, tree_problems, gc_tree_problems, kv_tree_problems,
6604 problems_gc, problems_kv, total_problems;
6605 uint64_t steady_txnid, recent_txnid;
6628typedef struct MDBX_chk_callbacks {
6637 uint64_t entry_number,
const char *issue,
const char *extra_fmt,
6638 va_list extra_args);
6647 size_t entry_number,
const MDBX_val *key,
6660 const uint64_t value,
const char *suffix);
6696 unsigned timeout_seconds_16dot16);
#define MDBX_NOTHROW_CONST_FUNCTION
The 'const nothrow' function attribute for optimization.
Definition mdbx.h:284
#define MDBX_CXX17_NOEXCEPT
Definition mdbx.h:399
#define MDBX_NOTHROW_PURE_FUNCTION
The 'pure nothrow' function attribute for optimization.
Definition mdbx.h:233
#define MDBX_NORETURN
Definition mdbx.h:479
uint64_t mi_mapsize
Definition mdbx.h:2837
uint64_t txn_space_dirty
Definition mdbx.h:4082
uint32_t gc_cputime
User-mode CPU time spent on GC update.
Definition mdbx.h:4161
uint32_t mi_dxb_pagesize
Definition mdbx.h:2846
uint32_t mi_maxreaders
Definition mdbx.h:2844
uint64_t v
Definition mdbx.h:4487
uint32_t mi_numreaders
Definition mdbx.h:2845
struct MDBX_envinfo::@3 mi_pgop_stat
uint32_t mi_since_sync_seconds16dot16
Definition mdbx.h:2870
uint64_t txn_reader_lag
Definition mdbx.h:4049
uint64_t mi_meta_txnid[3]
Definition mdbx.h:2843
struct MDBX_envinfo::@2 mi_bootid
A mostly unique ID that is regenerated on each boot.
uint64_t txn_space_leftover
Definition mdbx.h:4075
uint64_t txn_space_used
Definition mdbx.h:4053
const char * datetime
Definition mdbx.h:659
uint16_t release
Definition mdbx.h:644
uint64_t mi_recent_txnid
Definition mdbx.h:2839
uint64_t mi_autosync_threshold
Definition mdbx.h:2866
uint64_t ms_branch_pages
Definition mdbx.h:2785
uint64_t ms_entries
Definition mdbx.h:2788
uint32_t gc_wallclock
Duration of GC update by wall clock.
Definition mdbx.h:4147
struct MDBX_commit_latency::@6 gc_prof
Информация для профилирования работы GC.
uint32_t mi_since_reader_check_seconds16dot16
Definition mdbx.h:2876
uint64_t y
Definition mdbx.h:4487
uint32_t revision
Definition mdbx.h:645
uint8_t minor
Definition mdbx.h:643
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:4155
uint64_t txn_space_limit_soft
Definition mdbx.h:4056
uint32_t mi_mode
Definition mdbx.h:2879
const char * options
Definition mdbx.h:661
uint64_t txn_id
Definition mdbx.h:4043
const char * sourcery
Definition mdbx.h:652
uint8_t major
Definition mdbx.h:642
uint64_t mi_latter_reader_txnid
Definition mdbx.h:2840
struct MDBX_envinfo::@1 mi_geo
uint64_t ms_overflow_pages
Definition mdbx.h:2787
uint32_t preparation
Duration of preparation (commit child transactions, update table's records and cursors destroying).
Definition mdbx.h:4145
uint64_t z
Definition mdbx.h:4487
uint64_t txn_space_limit_hard
Definition mdbx.h:4060
uint32_t whole
The total duration of a commit.
Definition mdbx.h:4159
const char * flags
Definition mdbx.h:663
uint64_t mi_meta_sign[3]
Definition mdbx.h:2843
uint32_t ms_psize
Definition mdbx.h:2782
uint32_t audit
Duration of internal audit if enabled.
Definition mdbx.h:4149
const char * target
Definition mdbx.h:660
uint32_t write
Duration of writing dirty/modified data pages to a filesystem, i.e. the summary duration of a write()...
Definition mdbx.h:4152
uint64_t txn_space_retired
Definition mdbx.h:4068
uint32_t ms_depth
Definition mdbx.h:2784
struct MDBX_version_info::@0 git
uint64_t mi_last_pgno
Definition mdbx.h:2838
uint32_t ending
Duration of transaction ending (releasing resources).
Definition mdbx.h:4157
uint64_t ms_mod_txnid
Definition mdbx.h:2789
uint64_t mi_self_latter_reader_txnid
Definition mdbx.h:2841
uint64_t ms_leaf_pages
Definition mdbx.h:2786
uint64_t x
Definition mdbx.h:4487
uint32_t mi_autosync_period_seconds16dot16
Definition mdbx.h:2873
uint64_t mi_unsync_volume
Definition mdbx.h:2864
uint32_t mi_sys_pagesize
Definition mdbx.h:2847
struct MDBX_envinfo::@4 mi_dxbid
const char * compiler
Definition mdbx.h:662
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:791
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:5135
#define LIBMDBX_API
Definition mdbx.h:620
struct iovec MDBX_val
Generic structure used for passing keys and data in and out of the table. .
Definition mdbx.h:788
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:720
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:637
@ MDBX_MAX_PAGESIZE
Definition mdbx.h:802
@ MDBX_MAXDATASIZE
Definition mdbx.h:796
@ MDBX_MAX_DBI
Definition mdbx.h:793
@ MDBX_MIN_PAGESIZE
Definition mdbx.h:799
libmdbx build information
Definition mdbx.h:658
The fours integers markers (aka "canary") associated with the environment.
Definition mdbx.h:4486
Latency of commit stages in 1/65536 of seconds units.
Definition mdbx.h:4142
Information about the environment.
Definition mdbx.h:2829
Statistics for a table in the environment.
Definition mdbx.h:2781
Information about the transaction.
Definition mdbx.h:4040
libmdbx version information
Definition mdbx.h:641
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.
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:5507
MDBX_put_flags_t
Data changing flags.
Definition mdbx.h:1664
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.
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:4546
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.
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.
LIBMDBX_API int mdbx_cursor_count(const MDBX_cursor *cursor, size_t *pcount)
Return count of duplicates for current key.
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:1701
@ MDBX_ALLDUPS
Definition mdbx.h:1684
@ MDBX_CURRENT
Definition mdbx.h:1679
@ MDBX_APPENDDUP
Definition mdbx.h:1697
@ MDBX_NODUPDATA
Definition mdbx.h:1673
@ MDBX_APPEND
Definition mdbx.h:1692
@ MDBX_UPSERT
Definition mdbx.h:1666
@ MDBX_RESERVE
Definition mdbx.h:1688
@ MDBX_NOOVERWRITE
Definition mdbx.h:1669
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:1741
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:750
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:1817
@ MDBX_GET_CURRENT
Definition mdbx.h:1756
@ MDBX_GET_BOTH
Definition mdbx.h:1749
@ MDBX_TO_KEY_EQUAL
Definition mdbx.h:1836
@ MDBX_GET_BOTH_RANGE
Definition mdbx.h:1753
@ MDBX_SET_KEY
Definition mdbx.h:1796
@ MDBX_FIRST_DUP
Definition mdbx.h:1746
@ MDBX_TO_KEY_LESSER_OR_EQUAL
Definition mdbx.h:1835
@ MDBX_GET_MULTIPLE
Definition mdbx.h:1761
@ MDBX_TO_EXACT_KEY_VALUE_GREATER_THAN
Definition mdbx.h:1846
@ MDBX_NEXT_NODUP
Definition mdbx.h:1781
@ MDBX_TO_EXACT_KEY_VALUE_LESSER_OR_EQUAL
Definition mdbx.h:1843
@ MDBX_TO_EXACT_KEY_VALUE_EQUAL
Definition mdbx.h:1844
@ MDBX_TO_PAIR_LESSER_OR_EQUAL
Definition mdbx.h:1849
@ MDBX_PREV_MULTIPLE
Definition mdbx.h:1803
@ MDBX_SET_RANGE
Definition mdbx.h:1799
@ MDBX_LAST_DUP
Definition mdbx.h:1767
@ MDBX_PREV
Definition mdbx.h:1784
@ MDBX_TO_PAIR_GREATER_OR_EQUAL
Definition mdbx.h:1851
@ MDBX_TO_PAIR_GREATER_THAN
Definition mdbx.h:1852
@ MDBX_LAST
Definition mdbx.h:1764
@ MDBX_TO_KEY_LESSER_THAN
Definition mdbx.h:1834
@ MDBX_PREV_DUP
Definition mdbx.h:1787
@ MDBX_TO_EXACT_KEY_VALUE_LESSER_THAN
Definition mdbx.h:1842
@ MDBX_SET
Definition mdbx.h:1793
@ MDBX_NEXT
Definition mdbx.h:1770
@ MDBX_TO_KEY_GREATER_OR_EQUAL
Definition mdbx.h:1837
@ MDBX_TO_PAIR_LESSER_THAN
Definition mdbx.h:1848
@ MDBX_NEXT_MULTIPLE
Definition mdbx.h:1778
@ MDBX_PREV_NODUP
Definition mdbx.h:1790
@ MDBX_TO_PAIR_EQUAL
Definition mdbx.h:1850
@ MDBX_NEXT_DUP
Definition mdbx.h:1773
@ MDBX_TO_EXACT_KEY_VALUE_GREATER_OR_EQUAL
Definition mdbx.h:1845
@ MDBX_SET_UPPERBOUND
Definition mdbx.h:1831
@ MDBX_TO_KEY_GREATER_THAN
Definition mdbx.h:1838
@ MDBX_FIRST
Definition mdbx.h:1743
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:743
MDBX_db_flags_t
Table flags.
Definition mdbx.h:1614
@ MDBX_INTEGERDUP
Definition mdbx.h:1638
@ MDBX_DB_ACCEDE
Definition mdbx.h:1656
@ MDBX_DB_DEFAULTS
Definition mdbx.h:1616
@ MDBX_REVERSEKEY
Definition mdbx.h:1619
@ MDBX_DUPFIXED
Definition mdbx.h:1633
@ MDBX_INTEGERKEY
Definition mdbx.h:1629
@ MDBX_REVERSEDUP
Definition mdbx.h:1641
@ MDBX_CREATE
Definition mdbx.h:1644
@ MDBX_DUPSORT
Definition mdbx.h:1622
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:990
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:1011
MDBX_log_level_t
Definition mdbx.h:863
MDBX_debug_flags_t
Runtime debug flags.
Definition mdbx.h:920
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:975
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:905
@ MDBX_LOG_WARN
Definition mdbx.h:879
@ MDBX_LOG_TRACE
Definition mdbx.h:900
@ MDBX_LOG_DEBUG
Definition mdbx.h:895
@ MDBX_LOG_FATAL
Definition mdbx.h:867
@ MDBX_LOG_ERROR
Definition mdbx.h:873
@ MDBX_LOG_NOTICE
Definition mdbx.h:885
@ MDBX_LOG_DONTCHANGE
Definition mdbx.h:912
@ MDBX_LOG_VERBOSE
Definition mdbx.h:890
@ MDBX_DBG_ASSERT
Definition mdbx.h:926
@ MDBX_DBG_DONT_UPGRADE
Definition mdbx.h:949
@ MDBX_DBG_LEGACY_OVERLAP
Definition mdbx.h:944
@ MDBX_DBG_LEGACY_MULTIOPEN
Definition mdbx.h:941
@ MDBX_DBG_NONE
Definition mdbx.h:921
@ MDBX_DBG_DUMP
Definition mdbx.h:938
@ MDBX_DBG_DONTCHANGE
Definition mdbx.h:957
@ MDBX_DBG_AUDIT
Definition mdbx.h:930
@ MDBX_DBG_JITTER
Definition mdbx.h:934
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 ...
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:6315
LIBMDBX_API const char * mdbx_strerror(int errnum)
Return a string describing a given error code.
LIBMDBX_API const char * mdbx_strerror_ANSI2OEM(int errnum)
MDBX_error_t
Errors and return codes.
Definition mdbx.h:1860
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:1887
@ MDBX_FIRST_LMDB_ERRCODE
Definition mdbx.h:1874
@ MDBX_EKEYMISMATCH
Definition mdbx.h:1976
@ MDBX_UNABLE_EXTEND_MAPSIZE
Definition mdbx.h:1921
@ MDBX_EACCESS
Definition mdbx.h:2033
@ MDBX_EIO
Definition mdbx.h:2037
@ MDBX_PAGE_NOTFOUND
Definition mdbx.h:1880
@ MDBX_TXN_FULL
Definition mdbx.h:1905
@ MDBX_DUPLICATED_CLK
Definition mdbx.h:1996
@ MDBX_VERSION_MISMATCH
Definition mdbx.h:1890
@ MDBX_WANNA_RECOVERY
Definition mdbx.h:1973
@ MDBX_TXN_OVERLAPPING
Definition mdbx.h:1987
@ MDBX_EREMOTE
Definition mdbx.h:2041
@ MDBX_TOO_LARGE
Definition mdbx.h:1980
@ MDBX_EBADSIGN
Definition mdbx.h:1969
@ MDBX_CURSOR_FULL
Definition mdbx.h:1909
@ MDBX_ENOFILE
Definition mdbx.h:2040
@ MDBX_BAD_TXN
Definition mdbx.h:1940
@ MDBX_ENODATA
Definition mdbx.h:2030
@ MDBX_LAST_LMDB_ERRCODE
Definition mdbx.h:1954
@ MDBX_CORRUPTED
Definition mdbx.h:1883
@ MDBX_EPERM
Definition mdbx.h:2038
@ MDBX_THREAD_MISMATCH
Definition mdbx.h:1984
@ MDBX_BACKLOG_DEPLETED
Definition mdbx.h:1993
@ MDBX_SUCCESS
Definition mdbx.h:1862
@ MDBX_NOTFOUND
Definition mdbx.h:1877
@ MDBX_RESULT_TRUE
Definition mdbx.h:1868
@ MDBX_INVALID
Definition mdbx.h:1893
@ MDBX_BAD_VALSIZE
Definition mdbx.h:1944
@ MDBX_BUSY
Definition mdbx.h:1958
@ MDBX_OUSTED
Definition mdbx.h:2004
@ MDBX_DBS_FULL
Definition mdbx.h:1899
@ MDBX_EINVAL
Definition mdbx.h:2032
@ MDBX_BAD_RSLOT
Definition mdbx.h:1935
@ MDBX_ENOMEM
Definition mdbx.h:2034
@ MDBX_FIRST_ADDED_ERRCODE
Definition mdbx.h:1961
@ MDBX_RESULT_FALSE
Definition mdbx.h:1865
@ MDBX_EINTR
Definition mdbx.h:2039
@ MDBX_READERS_FULL
Definition mdbx.h:1902
@ MDBX_LAST_ADDED_ERRCODE
Definition mdbx.h:2011
@ MDBX_BAD_DBI
Definition mdbx.h:1948
@ MDBX_KEYEXIST
Definition mdbx.h:1871
@ MDBX_DANGLING_DBI
Definition mdbx.h:2000
@ MDBX_EDEADLK
Definition mdbx.h:2042
@ MDBX_PAGE_FULL
Definition mdbx.h:1912
@ MDBX_MAP_FULL
Definition mdbx.h:1896
@ MDBX_PROBLEM
Definition mdbx.h:1951
@ MDBX_ENOSYS
Definition mdbx.h:2036
@ MDBX_EMULTIVAL
Definition mdbx.h:1964
@ MDBX_EROFS
Definition mdbx.h:2035
@ MDBX_MVCC_RETARDED
Definition mdbx.h:2008
@ MDBX_INCOMPATIBLE
Definition mdbx.h:1931
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:3158
MDBX_env_flags_t
Environment flags.
Definition mdbx.h:1054
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:1269
@ MDBX_ENV_DEFAULTS
Definition mdbx.h:1055
@ MDBX_COALESCE
Definition mdbx.h:1305
@ MDBX_NOMETASYNC
Definition mdbx.h:1404
@ MDBX_LIFORECLAIM
Definition mdbx.h:1329
@ MDBX_SAFE_NOSYNC
Definition mdbx.h:1455
@ MDBX_NOTLS
Definition mdbx.h:1248
@ MDBX_SYNC_DURABLE
Definition mdbx.h:1386
@ MDBX_PAGEPERTURB
Definition mdbx.h:1332
@ MDBX_WRITEMAP
Definition mdbx.h:1174
@ MDBX_NOSTICKYTHREADS
Definition mdbx.h:1245
@ MDBX_EXCLUSIVE
Definition mdbx.h:1128
@ MDBX_NOMEMINIT
Definition mdbx.h:1292
@ MDBX_MAPASYNC
Definition mdbx.h:1462
@ MDBX_ACCEDE
Definition mdbx.h:1143
@ MDBX_NOSUBDIR
Definition mdbx.h:1080
@ MDBX_RDONLY
Definition mdbx.h:1098
@ MDBX_UTTERLY_NOSYNC
Definition mdbx.h:1505
@ MDBX_VALIDATION
Definition mdbx.h:1062
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:3603
int mdbx_env_set_maxdbs(MDBX_env *env, MDBX_dbi dbs)
Set the maximum number of named tables for the environment.
Definition mdbx.h:3765
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:3081
MDBX_option_t
MDBX environment extra runtime options.
Definition mdbx.h:2136
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:3020
MDBX_warmup_flags_t
Warming up options.
Definition mdbx.h:3246
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:3719
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:2240
@ MDBX_opt_subpage_room_threshold
Задаёт в % минимальный объём свободного места на основной странице, при отсутствии которого вложенные...
Definition mdbx.h:2413
@ MDBX_opt_subpage_limit
Задаёт в % максимальный размер вложенных страниц, используемых для размещения небольшого количества м...
Definition mdbx.h:2407
@ MDBX_opt_txn_dp_limit
Controls the in-process limit of dirty pages for a write transaction.
Definition mdbx.h:2236
@ MDBX_opt_prefer_waf_insteadof_balance
Управляет выбором между стремлением к равномерности наполнения страниц, либо уменьшением количества и...
Definition mdbx.h:2392
@ 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:2340
@ MDBX_opt_max_db
Controls the maximum number of named tables for the environment.
Definition mdbx.h:2145
@ MDBX_opt_merge_threshold_16dot16_percent
Controls the in-process threshold of semi-empty pages merge.
Definition mdbx.h:2307
@ MDBX_opt_subpage_reserve_prereq
Задаёт в % минимальный объём свободного места на основной странице, при наличии которого,...
Definition mdbx.h:2429
@ MDBX_opt_sync_bytes
Controls interprocess/shared threshold to force flush the data buffers to disk, if MDBX_SAFE_NOSYNC i...
Definition mdbx.h:2168
@ MDBX_opt_spill_min_denominator
Controls the in-process how minimal part of the dirty pages should be spilled when necessary.
Definition mdbx.h:2272
@ 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:2295
@ 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:2208
@ 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:2195
@ MDBX_opt_max_readers
Defines the maximum number of threads/reader slots for all processes interacting with the database.
Definition mdbx.h:2162
@ MDBX_opt_subpage_reserve_limit
Задаёт в % ограничение резервирования места на вложенных страницах.
Definition mdbx.h:2434
@ MDBX_opt_spill_max_denominator
Controls the in-process how maximal part of the dirty pages may be spilled when necessary.
Definition mdbx.h:2256
@ MDBX_opt_sync_period
Controls interprocess/shared relative period since the last unsteady commit to force flush the data b...
Definition mdbx.h:2174
@ MDBX_opt_dp_reserve_limit
Controls the in-process limit of a pre-allocated memory items for dirty pages.
Definition mdbx.h:2222
@ MDBX_opt_writethrough_threshold
Controls the choosing between use write-through disk writes and usual ones with followed flush by the...
Definition mdbx.h:2335
@ MDBX_opt_gc_time_limit
Controls the in-process spending time limit of searching consecutive pages inside GC.
Definition mdbx.h:2367
@ MDBX_warmup_touchlimit
Definition mdbx.h:3285
@ MDBX_warmup_force
Definition mdbx.h:3255
@ MDBX_warmup_oomsafe
Definition mdbx.h:3262
@ MDBX_warmup_release
Definition mdbx.h:3288
@ MDBX_warmup_lock
Definition mdbx.h:3277
@ MDBX_warmup_default
Definition mdbx.h:3249
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:3734
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:3101
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:4861
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:2940
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:3038
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:3633
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:4832
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:3627
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_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:4710
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:6163
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:3779
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:2821
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.
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:4834
@ MDBX_DBI_FRESH
Definition mdbx.h:4838
@ MDBX_DBI_STALE
Definition mdbx.h:4836
@ MDBX_DBI_CREAT
Definition mdbx.h:4840
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:4279
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:1515
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:4007
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:731
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:1526
@ MDBX_TXN_ERROR
Definition mdbx.h:1566
@ MDBX_TXN_NOMETASYNC
Definition mdbx.h:1545
@ MDBX_TXN_SPILLS
Definition mdbx.h:1576
@ MDBX_TXN_OUSTED
Definition mdbx.h:1600
@ MDBX_TXN_HAS_CHILD
Definition mdbx.h:1581
@ MDBX_TXN_RDONLY_PREPARE
Definition mdbx.h:1535
@ MDBX_TXN_INVALID
Definition mdbx.h:1556
@ MDBX_TXN_BLOCKED
Definition mdbx.h:1605
@ MDBX_TXN_PARKED
Definition mdbx.h:1586
@ MDBX_TXN_NOSYNC
Definition mdbx.h:1549
@ MDBX_TXN_DIRTY
Definition mdbx.h:1571
@ MDBX_TXN_READWRITE
Definition mdbx.h:1520
@ MDBX_TXN_AUTOUNPARK
Definition mdbx.h:1593
@ MDBX_TXN_TRY
Definition mdbx.h:1541
@ MDBX_TXN_FINISHED
Definition mdbx.h:1561
MDBX_chk_severity_t verbosity
Definition mdbx.h:6529
MDBX_txn * txn
Definition mdbx.h:6594
size_t pad
Definition mdbx.h:6546
struct MDBX_chk_internal * internal
Definition mdbx.h:6592
uint8_t scope_nesting
Definition mdbx.h:6596
size_t ones
Definition mdbx.h:6546
struct MDBX_chk_histogram::@8 ranges[9]
struct MDBX_chk_internal * internal
Definition mdbx.h:6526
char * begin
Definition mdbx.h:6511
size_t subtotal_issues
Definition mdbx.h:6530
MDBX_chk_user_table_cookie_t * cookie
Definition mdbx.h:6556
struct MDBX_chk_context * ctx
Definition mdbx.h:6509
MDBX_db_flags_t flags
Definition mdbx.h:6566
struct MDBX_chk_issue * next
Definition mdbx.h:6517
const void * object
Definition mdbx.h:6527
size_t count
Definition mdbx.h:6546
const char * caption
Definition mdbx.h:6519
MDBX_chk_stage_t stage
Definition mdbx.h:6528
MDBX_env * env
Definition mdbx.h:6593
uint8_t empty
Definition mdbx.h:6510
size_t amount
Definition mdbx.h:6546
MDBX_chk_scope_t * scope
Definition mdbx.h:6595
MDBX_chk_issue_t * issues
Definition mdbx.h:6525
size_t count
Definition mdbx.h:6518
MDBX_val name
Definition mdbx.h:6565
size_t lost_bytes
Definition mdbx.h:6569
int id
Definition mdbx.h:6567
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:6491
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:6540
MDBX_chk_flags_t
Флаги/опции для проверки целостности базы данных.
Definition mdbx.h:6448
MDBX_chk_severity_t
Уровни логирование/детализации информации, поставляемой через обратные вызовы при проверке целостност...
Definition mdbx.h:6472
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:6497
@ MDBX_chk_init
Definition mdbx.h:6493
@ MDBX_chk_finalize
Definition mdbx.h:6503
@ MDBX_chk_space
Definition mdbx.h:6498
@ MDBX_chk_lock
Definition mdbx.h:6494
@ MDBX_chk_none
Definition mdbx.h:6492
@ MDBX_chk_maindb
Definition mdbx.h:6499
@ MDBX_chk_unlock
Definition mdbx.h:6502
@ MDBX_chk_meta
Definition mdbx.h:6495
@ MDBX_chk_conclude
Definition mdbx.h:6501
@ MDBX_chk_tree
Definition mdbx.h:6496
@ MDBX_chk_tables
Definition mdbx.h:6500
@ MDBX_CHK_SKIP_BTREE_TRAVERSAL
Definition mdbx.h:6457
@ MDBX_CHK_READWRITE
Definition mdbx.h:6454
@ MDBX_CHK_DEFAULTS
Definition mdbx.h:6450
@ MDBX_CHK_SKIP_KV_TRAVERSAL
Definition mdbx.h:6460
@ MDBX_CHK_IGNORE_ORDER
Definition mdbx.h:6465
@ MDBX_chk_processing
Definition mdbx.h:6481
@ MDBX_chk_result
Definition mdbx.h:6479
@ MDBX_chk_details
Definition mdbx.h:6484
@ MDBX_chk_extra
Definition mdbx.h:6485
@ MDBX_chk_severity_prio_shift
Definition mdbx.h:6473
@ MDBX_chk_severity_kind_mask
Definition mdbx.h:6474
@ MDBX_chk_notice
Definition mdbx.h:6478
@ MDBX_chk_resolution
Definition mdbx.h:6480
@ MDBX_chk_warning
Definition mdbx.h:6477
@ MDBX_chk_fatal
Definition mdbx.h:6475
@ MDBX_chk_info
Definition mdbx.h:6482
@ MDBX_chk_error
Definition mdbx.h:6476
@ MDBX_chk_verbose
Definition mdbx.h:6483
Набор функций обратного вызова используемых при проверке целостности базы данных.
Definition mdbx.h:6628
Контекст проверки целостности базы данных.
Definition mdbx.h:6591
Гистограмма с некоторой статистической информацией, собираемой при проверке целостности БД.
Definition mdbx.h:6545
Проблема обнаруженная при проверке целостности базы данных.
Definition mdbx.h:6516
Виртуальная строка отчета, формируемого при проверке целостности базы данных.
Definition mdbx.h:6508
Иерархический контекст при проверке целостности базы данных.
Definition mdbx.h:6524
Информация о некоторой таблицей ключ-значение, при проверке целостности базы данных.
Definition mdbx.h:6555
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:4764
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:4768
LIBMDBX_API uint64_t mdbx_key_from_jsonInteger(const int64_t json_integer)