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_c_attribute
193#define __has_c_attribute(x) (0)
196#ifndef __has_cpp_attribute
197#define __has_cpp_attribute(x) 0
200#ifndef __has_CXX_attribute
201#if defined(__cplusplus) && \
202 (!defined(_MSC_VER) || defined(__clang__) || _MSC_VER >= 1942)
203#define __has_CXX_attribute(x) __has_cpp_attribute(x)
205#define __has_CXX_attribute(x) 0
209#ifndef __has_C23_or_CXX_attribute
210#if defined(__cplusplus)
211#define __has_C23_or_CXX_attribute(x) __has_CXX_attribute(x)
212#elif defined(__STDC_VERSION__) && __STDC_VERSION__ > 202311L
213#define __has_C23_or_CXX_attribute(x) __has_c_attribute(x)
215#define __has_C23_or_CXX_attribute(x) 0
220#define __has_feature(x) (0)
221#define __has_exceptions_disabled (0)
223#define __has_exceptions_disabled \
224 (__has_feature(cxx_noexcept) && !__has_feature(cxx_exceptions))
227#ifndef __has_extension
228#define __has_extension(x) __has_feature(x)
232#define __has_builtin(x) (0)
242#define MDBX_PURE_FUNCTION [[gnu::pure]]
243#elif __has_C23_or_CXX_attribute(gnu::pure) && \
244 (!defined(__apple_build_version__) || !defined(__clang_major__) || \
245 __clang_major__ > 17)
246#define MDBX_PURE_FUNCTION [[gnu::pure]]
247#elif (defined(__GNUC__) || __has_attribute(__pure__)) && \
248 (!defined(__clang__) || \
249 !defined(__cplusplus) || __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__) || \
267 (__has_attribute(__pure__) && __has_attribute(__nothrow__))
268#define MDBX_NOTHROW_PURE_FUNCTION __attribute__((__pure__, __nothrow__))
269#elif __has_CXX_attribute(pure)
270#define MDBX_NOTHROW_PURE_FUNCTION [[pure]]
272#define MDBX_NOTHROW_PURE_FUNCTION
286#define MDBX_CONST_FUNCTION [[gnu::const]]
287#elif __has_C23_or_CXX_attribute(gnu::const) && \
288 (!defined(__apple_build_version__) || !defined(__clang_major__) || \
289 __clang_major__ > 17)
290#define MDBX_CONST_FUNCTION [[gnu::const]]
291#elif (defined(__GNUC__) || __has_attribute(__const__)) && \
292 (!defined(__clang__) || \
293 !defined(__cplusplus) || __has_exceptions_disabled)
294#define MDBX_CONST_FUNCTION __attribute__((__const__))
296#define MDBX_CONST_FUNCTION MDBX_PURE_FUNCTION
303#define MDBX_NOTHROW_CONST_FUNCTION [[gnu::const, gnu::nothrow]]
304#elif __has_C23_or_CXX_attribute(gnu::const)
305#if __has_C23_or_CXX_attribute(gnu::nothrow)
306#define MDBX_NOTHROW_CONST_FUNCTION [[gnu::const, gnu::nothrow]]
308#define MDBX_NOTHROW_CONST_FUNCTION [[gnu::const]]
310#elif defined(__GNUC__) || \
311 (__has_attribute(__const__) && __has_attribute(__nothrow__))
312#define MDBX_NOTHROW_CONST_FUNCTION __attribute__((__const__, __nothrow__))
313#elif __has_CXX_attribute(const)
314#define MDBX_NOTHROW_CONST_FUNCTION [[const]]
316#define MDBX_NOTHROW_CONST_FUNCTION MDBX_NOTHROW_PURE_FUNCTION
322#ifndef MDBX_DEPRECATED
324#define MDBX_DEPRECATED __deprecated
325#elif defined(DOXYGEN) || \
326 ((!defined(__GNUC__) || defined(__clang__) || __GNUC__ > 5) && \
327 ((defined(__cplusplus) && __cplusplus >= 201403L && \
328 __has_cpp_attribute(deprecated) && \
329 __has_cpp_attribute(deprecated) >= 201309L) || \
330 (!defined(__cplusplus) && defined(__STDC_VERSION__) && \
331 __STDC_VERSION__ >= 202304L)))
332#define MDBX_DEPRECATED [[deprecated]]
333#elif (defined(__GNUC__) && __GNUC__ > 5) || \
334 (__has_attribute(__deprecated__) && \
335 (!defined(__GNUC__) || defined(__clang__) || __GNUC__ > 5))
336#define MDBX_DEPRECATED __attribute__((__deprecated__))
337#elif defined(_MSC_VER)
338#define MDBX_DEPRECATED __declspec(deprecated)
340#define MDBX_DEPRECATED
344#ifndef MDBX_DEPRECATED_ENUM
345#if !defined(DOXYGEN) && \
346 (!defined(_MSC_VER) || (defined(__cplusplus) && __cplusplus >= 201403L && \
347 __has_cpp_attribute(deprecated) && \
348 __has_cpp_attribute(deprecated) >= 201309L))
349#define MDBX_DEPRECATED_ENUM MDBX_DEPRECATED
351#define MDBX_DEPRECATED_ENUM
356#if defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__) || \
357 defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)
358#if defined(__GNUC__) || __has_attribute(__dllexport__)
359#define __dll_export __attribute__((__dllexport__))
360#elif defined(_MSC_VER)
361#define __dll_export __declspec(dllexport)
365#elif defined(__GNUC__) || __has_attribute(__visibility__)
366#define __dll_export __attribute__((__visibility__("default")))
373#if defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__) || \
374 defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)
375#if defined(__GNUC__) || __has_attribute(__dllimport__)
376#define __dll_import __attribute__((__dllimport__))
377#elif defined(_MSC_VER)
378#define __dll_import __declspec(dllimport)
391#if defined(LIBMDBX_INTERNALS) && !defined(LIBMDBX_NO_EXPORTS_LEGACY_API)
392#define LIBMDBX_INLINE_API(TYPE, NAME, ARGS) \
393 LIBMDBX_API TYPE NAME ARGS; \
394 static __inline TYPE __inline_##NAME ARGS
396#define LIBMDBX_INLINE_API(TYPE, NAME, ARGS) static __inline TYPE NAME ARGS
400#ifndef MDBX_STRINGIFY
401#define MDBX_STRINGIFY_HELPER(x) #x
402#define MDBX_STRINGIFY(x) MDBX_STRINGIFY_HELPER(x)
421#define MDBX_CXX17_NOEXCEPT noexcept
422#elif !defined(__cpp_noexcept_function_type) || \
423 __cpp_noexcept_function_type < 201510L
424#define MDBX_CXX17_NOEXCEPT
426#define MDBX_CXX17_NOEXCEPT noexcept
431#define MDBX_CXX01_CONSTEXPR constexpr
432#define MDBX_CXX01_CONSTEXPR_VAR constexpr
433#elif !defined(__cplusplus)
434#define MDBX_CXX01_CONSTEXPR __inline
435#define MDBX_CXX01_CONSTEXPR_VAR const
436#elif !defined(DOXYGEN) && \
437 ((__cplusplus < 201103L && defined(__cpp_constexpr) && \
438 __cpp_constexpr < 200704L) || \
439 (defined(__LCC__) && __LCC__ < 124) || \
440 (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ < 407) && \
441 !defined(__clang__) && !defined(__LCC__)) || \
442 (defined(_MSC_VER) && _MSC_VER < 1910) || \
443 (defined(__clang__) && __clang_major__ < 4))
444#define MDBX_CXX01_CONSTEXPR inline
445#define MDBX_CXX01_CONSTEXPR_VAR const
447#define MDBX_CXX01_CONSTEXPR constexpr
448#define MDBX_CXX01_CONSTEXPR_VAR constexpr
454#define MDBX_CXX11_CONSTEXPR constexpr
455#define MDBX_CXX11_CONSTEXPR_VAR constexpr
456#elif !defined(__cplusplus)
457#define MDBX_CXX11_CONSTEXPR __inline
458#define MDBX_CXX11_CONSTEXPR_VAR const
459#elif !defined(DOXYGEN) && \
460 (!defined(__cpp_constexpr) || __cpp_constexpr < 201304L || \
461 (defined(__LCC__) && __LCC__ < 124) || \
462 (defined(__GNUC__) && __GNUC__ < 6 && !defined(__clang__) && \
463 !defined(__LCC__)) || \
464 (defined(_MSC_VER) && _MSC_VER < 1910) || \
465 (defined(__clang__) && __clang_major__ < 5))
466#define MDBX_CXX11_CONSTEXPR inline
467#define MDBX_CXX11_CONSTEXPR_VAR const
469#define MDBX_CXX11_CONSTEXPR constexpr
470#define MDBX_CXX11_CONSTEXPR_VAR constexpr
476#define MDBX_CXX14_CONSTEXPR constexpr
477#define MDBX_CXX14_CONSTEXPR_VAR constexpr
478#elif !defined(__cplusplus)
479#define MDBX_CXX14_CONSTEXPR __inline
480#define MDBX_CXX14_CONSTEXPR_VAR const
481#elif defined(DOXYGEN) || \
482 defined(__cpp_constexpr) && __cpp_constexpr >= 201304L && \
483 ((defined(_MSC_VER) && _MSC_VER >= 1910) || \
484 (defined(__clang__) && __clang_major__ > 4) || \
485 (defined(__GNUC__) && __GNUC__ > 6) || \
486 (!defined(__GNUC__) && !defined(__clang__) && !defined(_MSC_VER)))
487#define MDBX_CXX14_CONSTEXPR constexpr
488#define MDBX_CXX14_CONSTEXPR_VAR constexpr
490#define MDBX_CXX14_CONSTEXPR inline
491#define MDBX_CXX14_CONSTEXPR_VAR const
494#if defined(__noreturn)
495#define MDBX_NORETURN __noreturn
496#elif defined(_Noreturn)
497#define MDBX_NORETURN _Noreturn
498#elif defined(DOXYGEN) || (defined(__cplusplus) && __cplusplus >= 201103L) || \
499 (!defined(__cplusplus) && defined(__STDC_VERSION__) && \
500 __STDC_VERSION__ > 202005L)
501#define MDBX_NORETURN [[noreturn]]
502#elif defined(__GNUC__) || __has_attribute(__noreturn__)
503#define MDBX_NORETURN __attribute__((__noreturn__))
504#elif defined(_MSC_VER) && !defined(__clang__)
505#define MDBX_NORETURN __declspec(noreturn)
510#ifndef MDBX_PRINTF_ARGS
511#if defined(__GNUC__) || __has_attribute(__format__) || defined(DOXYGEN)
512#if defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)
513#define MDBX_PRINTF_ARGS(format_index, first_arg) \
514 __attribute__((__format__(__gnu_printf__, format_index, first_arg)))
516#define MDBX_PRINTF_ARGS(format_index, first_arg) \
517 __attribute__((__format__(__printf__, format_index, first_arg)))
520#define MDBX_PRINTF_ARGS(format_index, first_arg)
524#if defined(DOXYGEN) || \
525 (defined(__cplusplus) && __cplusplus >= 201603L && \
526 __has_cpp_attribute(maybe_unused) && \
527 __has_cpp_attribute(maybe_unused) >= 201603L) || \
528 (!defined(__cplusplus) && defined(__STDC_VERSION__) && \
529 __STDC_VERSION__ > 202005L)
530#define MDBX_MAYBE_UNUSED [[maybe_unused]]
531#elif defined(__GNUC__) || __has_attribute(__unused__)
532#define MDBX_MAYBE_UNUSED __attribute__((__unused__))
534#define MDBX_MAYBE_UNUSED
537#if __has_attribute(no_sanitize) || defined(DOXYGEN)
538#define MDBX_NOSANITIZE_ENUM __attribute((__no_sanitize__("enum")))
540#define MDBX_NOSANITIZE_ENUM
548#if !defined(DEFINE_ENUM_FLAG_OPERATORS) && !defined(DOXYGEN)
551#if !defined(__cpp_constexpr) || __cpp_constexpr < 200704L || \
552 (defined(__LCC__) && __LCC__ < 124) || \
553 (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ < 407) && \
554 !defined(__clang__) && !defined(__LCC__)) || \
555 (defined(_MSC_VER) && _MSC_VER < 1910) || \
556 (defined(__clang__) && __clang_major__ < 4)
558#define CONSTEXPR_ENUM_FLAGS_OPERATIONS 0
561#define CONSTEXPR_ENUM_FLAGS_OPERATIONS 1
566#define DEFINE_ENUM_FLAG_OPERATORS(ENUM) \
568 MDBX_NOSANITIZE_ENUM MDBX_CXX01_CONSTEXPR ENUM operator|(ENUM a, ENUM b) { \
569 return ENUM(unsigned(a) | unsigned(b)); \
571 MDBX_NOSANITIZE_ENUM MDBX_CXX14_CONSTEXPR ENUM &operator|=(ENUM &a, \
575 MDBX_NOSANITIZE_ENUM MDBX_CXX01_CONSTEXPR ENUM operator&(ENUM a, ENUM b) { \
576 return ENUM(unsigned(a) & unsigned(b)); \
578 MDBX_NOSANITIZE_ENUM MDBX_CXX01_CONSTEXPR ENUM operator&(ENUM a, \
580 return ENUM(unsigned(a) & b); \
582 MDBX_NOSANITIZE_ENUM MDBX_CXX01_CONSTEXPR ENUM operator&(unsigned a, \
584 return ENUM(a & unsigned(b)); \
586 MDBX_NOSANITIZE_ENUM MDBX_CXX14_CONSTEXPR ENUM &operator&=(ENUM &a, \
590 MDBX_NOSANITIZE_ENUM MDBX_CXX14_CONSTEXPR ENUM &operator&=(ENUM &a, \
594 MDBX_CXX01_CONSTEXPR unsigned operator~(ENUM a) { return ~unsigned(a); } \
595 MDBX_NOSANITIZE_ENUM MDBX_CXX01_CONSTEXPR ENUM operator^(ENUM a, ENUM b) { \
596 return ENUM(unsigned(a) ^ unsigned(b)); \
598 MDBX_NOSANITIZE_ENUM MDBX_CXX14_CONSTEXPR ENUM &operator^=(ENUM &a, \
605#define DEFINE_ENUM_FLAG_OPERATORS(ENUM)
606#define CONSTEXPR_ENUM_FLAGS_OPERATIONS 1
609#elif !defined(CONSTEXPR_ENUM_FLAGS_OPERATIONS)
613#define CONSTEXPR_ENUM_FLAGS_OPERATIONS 0
616#define CONSTEXPR_ENUM_FLAGS_OPERATIONS 1
633#define MDBX_VERSION_MAJOR 0
634#define MDBX_VERSION_MINOR 13
637#if defined(LIBMDBX_EXPORTS) || defined(DOXYGEN)
638#define LIBMDBX_API __dll_export
639#elif defined(LIBMDBX_IMPORTS)
640#define LIBMDBX_API __dll_import
647#if defined(__clang__) || __has_attribute(type_visibility) || defined(DOXYGEN)
648#define LIBMDBX_API_TYPE LIBMDBX_API __attribute__((type_visibility("default")))
650#define LIBMDBX_API_TYPE LIBMDBX_API
653#define LIBMDBX_API_TYPE
656#if defined(LIBMDBX_IMPORTS)
657#define LIBMDBX_VERINFO_API __dll_import
659#define LIBMDBX_VERINFO_API __dll_export
669 const char *datetime;
672 const char *describe;
688#if (defined(_WIN32) || defined(_WIN64)) && !MDBX_BUILD_SHARED_LIBRARY
716#error Non-dll build libmdbx requires target Windows version \
717 to be explicitly defined via _WIN32_WINNT for properly \
718 handling thread local storage destructors.
721#if _WIN32_WINNT >= 0x0600
724#define MDBX_MANUAL_MODULE_HANDLER 0
728#define MDBX_MANUAL_MODULE_HANDLER 1
729void LIBMDBX_API NTAPI mdbx_module_handler(PVOID module, DWORD reason,
791#ifndef HAVE_STRUCT_IOVEC
796#define HAVE_STRUCT_IOVEC
799#if defined(__sun) || defined(__SVR4) || defined(__svr4__)
833#if !(defined(_WIN32) || defined(_WIN64))
834#define MDBX_LOCKNAME "/mdbx.lck"
836#define MDBX_LOCKNAME_W L"\\mdbx.lck"
837#define MDBX_LOCKNAME_A "\\mdbx.lck"
839#define MDBX_LOCKNAME MDBX_LOCKNAME_W
841#define MDBX_LOCKNAME MDBX_LOCKNAME_A
848#if !(defined(_WIN32) || defined(_WIN64))
849#define MDBX_DATANAME "/mdbx.dat"
851#define MDBX_DATANAME_W L"\\mdbx.dat"
852#define MDBX_DATANAME_A "\\mdbx.dat"
854#define MDBX_DATANAME MDBX_DATANAME_W
856#define MDBX_DATANAME MDBX_DATANAME_A
861#ifndef MDBX_LOCK_SUFFIX
863#if !(defined(_WIN32) || defined(_WIN64))
864#define MDBX_LOCK_SUFFIX "-lck"
866#define MDBX_LOCK_SUFFIX_W L"-lck"
867#define MDBX_LOCK_SUFFIX_A "-lck"
869#define MDBX_LOCK_SUFFIX MDBX_LOCK_SUFFIX_W
871#define MDBX_LOCK_SUFFIX MDBX_LOCK_SUFFIX_A
885typedef enum MDBX_log_level {
942typedef enum MDBX_debug_flags {
974 MDBX_DBG_MAX = ((unsigned)MDBX_LOG_MAX) << 16 |
981DEFINE_ENUM_FLAG_OPERATORS(MDBX_debug_flags)
998 int line, const
char *fmt,
1002#define MDBX_LOGGER_DONTCHANGE ((MDBX_debug_func *)(intptr_t)-1)
1003#define MDBX_LOGGER_NOFMT_DONTCHANGE ((MDBX_debug_func_nofmt *)(intptr_t)-1)
1013 const char *function,
int line,
1020 char *logger_buffer,
1021 size_t logger_buffer_size);
1034 const char *function,
1058 const size_t bufsize);
1062 MDBX_PRINTF_ARGS(1, 2);
1076typedef enum MDBX_env_flags {
1531DEFINE_ENUM_FLAG_OPERATORS(MDBX_env_flags)
1537typedef enum MDBX_txn_flags {
1556#if CONSTEXPR_ENUM_FLAGS_OPERATIONS || defined(DOXYGEN)
1630DEFINE_ENUM_FLAG_OPERATORS(MDBX_txn_flags)
1636typedef enum MDBX_db_flags {
1680DEFINE_ENUM_FLAG_OPERATORS(MDBX_db_flags)
1686typedef enum MDBX_put_flags {
1725DEFINE_ENUM_FLAG_OPERATORS(MDBX_put_flags)
1730typedef enum MDBX_copy_flags {
1757DEFINE_ENUM_FLAG_OPERATORS(MDBX_copy_flags)
1882typedef enum MDBX_error {
2035#if defined(_WIN32) || defined(_WIN64)
2072MDBX_DEPRECATED
static __inline
int MDBX_MAP_RESIZED_is_deprecated(
void) {
2075#define MDBX_MAP_RESIZED MDBX_MAP_RESIZED_is_deprecated()
2124#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
2158typedef enum MDBX_option {
2561#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
2567#define mdbx_env_openT(env, pathname, flags, mode) \
2568 mdbx_env_openW(env, pathname, flags, mode)
2570#define mdbx_env_openT(env, pathname, flags, mode) \
2571 mdbx_env_open(env, pathname, flags, mode)
2577typedef enum MDBX_env_delete_mode {
2615#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
2622#define mdbx_env_deleteT(pathname, mode) mdbx_env_deleteW(pathname, mode)
2624#define mdbx_env_deleteT(pathname, mode) mdbx_env_delete(pathname, mode)
2739#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
2746#define mdbx_env_copyT(env, dest, flags) mdbx_env_copyW(env, dest, flags)
2754#define mdbx_txn_copy2pathnameT(txn, dest, flags) \
2755 mdbx_txn_copy2pathnameW(txn, dest, path)
2757#define mdbx_env_copyT(env, dest, flags) mdbx_env_copy(env, dest, flags)
2758#define mdbx_txn_copy2pathnameT(txn, dest, flags) \
2759 mdbx_txn_copy2pathname(txn, dest, path)
3081 assert(proxy <= SIZE_MAX);
3083 *threshold = (size_t)proxy;
3140 if (period_seconds_16dot16) {
3144 assert(proxy <= UINT32_MAX);
3146 *period_seconds_16dot16 = (unsigned)proxy;
3199#if defined(DOXYGEN) || !(defined(_WIN32) || defined(_WIN64))
3283typedef enum MDBX_warmup_flags {
3327DEFINE_ENUM_FLAG_OPERATORS(MDBX_warmup_flags)
3362 unsigned timeout_seconds_16dot16);
3414#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
3420#define mdbx_env_get_pathT(env, dest) mdbx_env_get_pathW(env, dest)
3422#define mdbx_env_get_pathT(env, dest) mdbx_env_get_path(env, dest)
3636 intptr_t size_now, intptr_t size_upper,
3637 intptr_t growth_step,
3638 intptr_t shrink_threshold,
3663 intptr_t redundancy);
3779 *readers = (unsigned)proxy;
3850 intptr_t *avail_pages);
4215 uint32_t coalescences;
4230 uint32_t work_counter;
4233 uint32_t work_rtime_monotonic;
4237 uint32_t work_xtime_cpu;
4240 uint32_t work_rsteps;
4243 uint32_t work_xpages;
4246 uint32_t work_majflt;
4250 uint32_t self_counter;
4253 uint32_t self_rtime_monotonic;
4257 uint32_t self_xtime_cpu;
4260 uint32_t self_rsteps;
4263 uint32_t self_xpages;
4266 uint32_t self_majflt;
4805 return UINT64_C(0x8000000000000000) + i64;
4809 return UINT32_C(0x80000000) + i32;
4872typedef enum MDBX_dbi_state {
4882DEFINE_ENUM_FLAG_OPERATORS(MDBX_dbi_state)
4896 unsigned *flags,
unsigned *state);
5014 MDBX_val *data,
size_t *values_count);
5179 const void *src,
size_t bytes);
5184 void *preserver_context);
5470 bool ignore_multival);
6010 ptrdiff_t *distance_items);
6034 ptrdiff_t *distance_items);
6065 ptrdiff_t *distance_items);
6069#define MDBX_EPSILON ((MDBX_val *)((ptrdiff_t)-1))
6129 uint64_t increment);
6208 uint64_t lag,
size_t bytes_used,
6360 unsigned gap,
size_t space,
6424 unsigned target_meta,
6427#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
6433 const wchar_t *pathname,
6434 unsigned target_meta,
6436#define mdbx_env_open_for_recoveryT(env, pathname, target_mets, writeable) \
6437 mdbx_env_open_for_recoveryW(env, pathname, target_mets, writeable)
6439#define mdbx_env_open_for_recoveryT(env, pathname, target_mets, writeable) \
6440 mdbx_env_open_for_recovery(env, pathname, target_mets, writeable)
6483#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
6490#define mdbx_preopen_snapinfoT(pathname, info, bytes) \
6491 mdbx_preopen_snapinfoW(pathname, info, bytes)
6493#define mdbx_preopen_snapinfoT(pathname, info, bytes) \
6494 mdbx_preopen_snapinfo(pathname, info, bytes)
6501typedef enum MDBX_chk_flags {
6520DEFINE_ENUM_FLAG_OPERATORS(MDBX_chk_flags)
6525typedef enum MDBX_chk_severity {
6544typedef enum MDBX_chk_stage {
6561typedef struct MDBX_chk_line {
6569typedef struct MDBX_chk_issue {
6577typedef struct MDBX_chk_scope {
6587 } usr_z, usr_v, usr_o;
6608typedef struct MDBX_chk_table {
6612#define MDBX_CHK_MAIN ((void *)((ptrdiff_t)0))
6614#define MDBX_CHK_GC ((void *)((ptrdiff_t)-1))
6616#define MDBX_CHK_META ((void *)((ptrdiff_t)-2))
6624 size_t all, empty, other;
6625 size_t branch, leaf;
6626 size_t nested_branch, nested_leaf, nested_subleaf;
6644typedef struct MDBX_chk_context {
6651 size_t total_payload_bytes;
6652 size_t table_total, table_processed;
6653 size_t total_unused_bytes, unused_pages;
6654 size_t processed_pages, reclaimable_pages, gc_pages, alloc_pages,
6656 size_t problems_meta, tree_problems, gc_tree_problems, kv_tree_problems,
6657 problems_gc, problems_kv, total_problems;
6658 uint64_t steady_txnid, recent_txnid;
6681typedef struct MDBX_chk_callbacks {
6690 uint64_t entry_number,
const char *issue,
const char *extra_fmt,
6691 va_list extra_args);
6700 size_t entry_number,
const MDBX_val *key,
6713 const uint64_t value,
const char *suffix);
6749 unsigned timeout_seconds_16dot16);
#define MDBX_NOTHROW_CONST_FUNCTION
The 'const nothrow' function attribute for optimization.
Definition mdbx.h:303
#define MDBX_CXX17_NOEXCEPT
Definition mdbx.h:421
#define MDBX_NOTHROW_PURE_FUNCTION
The 'pure nothrow' function attribute for optimization.
Definition mdbx.h:259
#define MDBX_NORETURN
Definition mdbx.h:501
uint64_t mi_mapsize
Definition mdbx.h:2874
uint64_t txn_space_dirty
Definition mdbx.h:4122
uint32_t gc_cputime
User-mode CPU time spent on GC update.
Definition mdbx.h:4201
uint32_t mi_dxb_pagesize
Definition mdbx.h:2883
uint32_t mi_maxreaders
Definition mdbx.h:2881
uint64_t v
Definition mdbx.h:4527
uint32_t mi_numreaders
Definition mdbx.h:2882
struct MDBX_envinfo::@3 mi_pgop_stat
uint32_t mi_since_sync_seconds16dot16
Definition mdbx.h:2907
uint64_t txn_reader_lag
Definition mdbx.h:4089
uint64_t mi_meta_txnid[3]
Definition mdbx.h:2880
struct MDBX_envinfo::@2 mi_bootid
A mostly unique ID that is regenerated on each boot.
uint64_t txn_space_leftover
Definition mdbx.h:4115
uint64_t txn_space_used
Definition mdbx.h:4093
const char * datetime
Definition mdbx.h:681
uint16_t release
Definition mdbx.h:666
uint64_t mi_recent_txnid
Definition mdbx.h:2876
uint64_t mi_autosync_threshold
Definition mdbx.h:2903
uint64_t ms_branch_pages
Definition mdbx.h:2822
uint64_t ms_entries
Definition mdbx.h:2825
uint32_t gc_wallclock
Duration of GC update by wall clock.
Definition mdbx.h:4187
struct MDBX_commit_latency::@6 gc_prof
Информация для профилирования работы GC.
uint32_t mi_since_reader_check_seconds16dot16
Definition mdbx.h:2913
uint64_t y
Definition mdbx.h:4527
uint32_t revision
Definition mdbx.h:667
uint8_t minor
Definition mdbx.h:665
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:4195
uint64_t txn_space_limit_soft
Definition mdbx.h:4096
uint32_t mi_mode
Definition mdbx.h:2916
const char * options
Definition mdbx.h:683
uint64_t txn_id
Definition mdbx.h:4083
const char * sourcery
Definition mdbx.h:674
uint8_t major
Definition mdbx.h:664
uint64_t mi_latter_reader_txnid
Definition mdbx.h:2877
struct MDBX_envinfo::@1 mi_geo
uint64_t ms_overflow_pages
Definition mdbx.h:2824
uint32_t preparation
Duration of preparation (commit child transactions, update table's records and cursors destroying).
Definition mdbx.h:4185
uint64_t z
Definition mdbx.h:4527
uint64_t txn_space_limit_hard
Definition mdbx.h:4100
uint32_t whole
The total duration of a commit.
Definition mdbx.h:4199
const char * flags
Definition mdbx.h:685
uint64_t mi_meta_sign[3]
Definition mdbx.h:2880
uint32_t ms_psize
Definition mdbx.h:2819
uint32_t audit
Duration of internal audit if enabled.
Definition mdbx.h:4189
const char * target
Definition mdbx.h:682
uint32_t write
Duration of writing dirty/modified data pages to a filesystem, i.e. the summary duration of a write()...
Definition mdbx.h:4192
uint64_t txn_space_retired
Definition mdbx.h:4108
uint32_t ms_depth
Definition mdbx.h:2821
struct MDBX_version_info::@0 git
uint64_t mi_last_pgno
Definition mdbx.h:2875
uint32_t ending
Duration of transaction ending (releasing resources).
Definition mdbx.h:4197
uint64_t ms_mod_txnid
Definition mdbx.h:2826
uint64_t mi_self_latter_reader_txnid
Definition mdbx.h:2878
uint64_t ms_leaf_pages
Definition mdbx.h:2823
uint64_t x
Definition mdbx.h:4527
uint32_t mi_autosync_period_seconds16dot16
Definition mdbx.h:2910
uint64_t mi_unsync_volume
Definition mdbx.h:2901
uint32_t mi_sys_pagesize
Definition mdbx.h:2884
struct MDBX_envinfo::@4 mi_dxbid
const char * compiler
Definition mdbx.h:684
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:813
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:5178
#define LIBMDBX_API
Definition mdbx.h:638
struct iovec MDBX_val
Generic structure used for passing keys and data in and out of the table. .
Definition mdbx.h:810
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:742
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:659
@ MDBX_MAX_PAGESIZE
Definition mdbx.h:824
@ MDBX_MAXDATASIZE
Definition mdbx.h:818
@ MDBX_MAX_DBI
Definition mdbx.h:815
@ MDBX_MIN_PAGESIZE
Definition mdbx.h:821
libmdbx build information
Definition mdbx.h:680
The fours integers markers (aka "canary") associated with the environment.
Definition mdbx.h:4526
Latency of commit stages in 1/65536 of seconds units.
Definition mdbx.h:4182
Information about the environment.
Definition mdbx.h:2866
Statistics for a table in the environment.
Definition mdbx.h:2818
Information about the transaction.
Definition mdbx.h:4080
libmdbx version information
Definition mdbx.h:663
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:5550
MDBX_put_flags_t
Data changing flags.
Definition mdbx.h:1686
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:4586
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:1723
@ MDBX_ALLDUPS
Definition mdbx.h:1706
@ MDBX_CURRENT
Definition mdbx.h:1701
@ MDBX_APPENDDUP
Definition mdbx.h:1719
@ MDBX_NODUPDATA
Definition mdbx.h:1695
@ MDBX_APPEND
Definition mdbx.h:1714
@ MDBX_UPSERT
Definition mdbx.h:1688
@ MDBX_RESERVE
Definition mdbx.h:1710
@ MDBX_NOOVERWRITE
Definition mdbx.h:1691
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:1763
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:772
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:1839
@ MDBX_GET_CURRENT
Definition mdbx.h:1778
@ MDBX_GET_BOTH
Definition mdbx.h:1771
@ MDBX_TO_KEY_EQUAL
Definition mdbx.h:1858
@ MDBX_GET_BOTH_RANGE
Definition mdbx.h:1775
@ MDBX_SET_KEY
Definition mdbx.h:1818
@ MDBX_FIRST_DUP
Definition mdbx.h:1768
@ MDBX_TO_KEY_LESSER_OR_EQUAL
Definition mdbx.h:1857
@ MDBX_GET_MULTIPLE
Definition mdbx.h:1783
@ MDBX_TO_EXACT_KEY_VALUE_GREATER_THAN
Definition mdbx.h:1868
@ MDBX_NEXT_NODUP
Definition mdbx.h:1803
@ MDBX_TO_EXACT_KEY_VALUE_LESSER_OR_EQUAL
Definition mdbx.h:1865
@ MDBX_TO_EXACT_KEY_VALUE_EQUAL
Definition mdbx.h:1866
@ MDBX_TO_PAIR_LESSER_OR_EQUAL
Definition mdbx.h:1871
@ MDBX_PREV_MULTIPLE
Definition mdbx.h:1825
@ MDBX_SET_RANGE
Definition mdbx.h:1821
@ MDBX_LAST_DUP
Definition mdbx.h:1789
@ MDBX_PREV
Definition mdbx.h:1806
@ MDBX_TO_PAIR_GREATER_OR_EQUAL
Definition mdbx.h:1873
@ MDBX_TO_PAIR_GREATER_THAN
Definition mdbx.h:1874
@ MDBX_LAST
Definition mdbx.h:1786
@ MDBX_TO_KEY_LESSER_THAN
Definition mdbx.h:1856
@ MDBX_PREV_DUP
Definition mdbx.h:1809
@ MDBX_TO_EXACT_KEY_VALUE_LESSER_THAN
Definition mdbx.h:1864
@ MDBX_SET
Definition mdbx.h:1815
@ MDBX_NEXT
Definition mdbx.h:1792
@ MDBX_TO_KEY_GREATER_OR_EQUAL
Definition mdbx.h:1859
@ MDBX_TO_PAIR_LESSER_THAN
Definition mdbx.h:1870
@ MDBX_NEXT_MULTIPLE
Definition mdbx.h:1800
@ MDBX_PREV_NODUP
Definition mdbx.h:1812
@ MDBX_TO_PAIR_EQUAL
Definition mdbx.h:1872
@ MDBX_NEXT_DUP
Definition mdbx.h:1795
@ MDBX_TO_EXACT_KEY_VALUE_GREATER_OR_EQUAL
Definition mdbx.h:1867
@ MDBX_SET_UPPERBOUND
Definition mdbx.h:1853
@ MDBX_TO_KEY_GREATER_THAN
Definition mdbx.h:1860
@ MDBX_FIRST
Definition mdbx.h:1765
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:765
MDBX_db_flags_t
Table flags.
Definition mdbx.h:1636
@ MDBX_INTEGERDUP
Definition mdbx.h:1660
@ MDBX_DB_ACCEDE
Definition mdbx.h:1678
@ MDBX_DB_DEFAULTS
Definition mdbx.h:1638
@ MDBX_REVERSEKEY
Definition mdbx.h:1641
@ MDBX_DUPFIXED
Definition mdbx.h:1655
@ MDBX_INTEGERKEY
Definition mdbx.h:1651
@ MDBX_REVERSEDUP
Definition mdbx.h:1663
@ MDBX_CREATE
Definition mdbx.h:1666
@ MDBX_DUPSORT
Definition mdbx.h:1644
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:1012
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:1033
MDBX_log_level_t
Definition mdbx.h:885
MDBX_debug_flags_t
Runtime debug flags.
Definition mdbx.h:942
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:997
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:927
@ MDBX_LOG_WARN
Definition mdbx.h:901
@ MDBX_LOG_TRACE
Definition mdbx.h:922
@ MDBX_LOG_DEBUG
Definition mdbx.h:917
@ MDBX_LOG_FATAL
Definition mdbx.h:889
@ MDBX_LOG_ERROR
Definition mdbx.h:895
@ MDBX_LOG_NOTICE
Definition mdbx.h:907
@ MDBX_LOG_DONTCHANGE
Definition mdbx.h:934
@ MDBX_LOG_VERBOSE
Definition mdbx.h:912
@ MDBX_DBG_ASSERT
Definition mdbx.h:948
@ MDBX_DBG_DONT_UPGRADE
Definition mdbx.h:971
@ MDBX_DBG_LEGACY_OVERLAP
Definition mdbx.h:966
@ MDBX_DBG_LEGACY_MULTIOPEN
Definition mdbx.h:963
@ MDBX_DBG_NONE
Definition mdbx.h:943
@ MDBX_DBG_DUMP
Definition mdbx.h:960
@ MDBX_DBG_DONTCHANGE
Definition mdbx.h:979
@ MDBX_DBG_AUDIT
Definition mdbx.h:952
@ MDBX_DBG_JITTER
Definition mdbx.h:956
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:6358
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:1882
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:1909
@ MDBX_FIRST_LMDB_ERRCODE
Definition mdbx.h:1896
@ MDBX_EKEYMISMATCH
Definition mdbx.h:1998
@ MDBX_UNABLE_EXTEND_MAPSIZE
Definition mdbx.h:1943
@ MDBX_EACCESS
Definition mdbx.h:2055
@ MDBX_EIO
Definition mdbx.h:2059
@ MDBX_PAGE_NOTFOUND
Definition mdbx.h:1902
@ MDBX_TXN_FULL
Definition mdbx.h:1927
@ MDBX_DUPLICATED_CLK
Definition mdbx.h:2018
@ MDBX_VERSION_MISMATCH
Definition mdbx.h:1912
@ MDBX_WANNA_RECOVERY
Definition mdbx.h:1995
@ MDBX_TXN_OVERLAPPING
Definition mdbx.h:2009
@ MDBX_EREMOTE
Definition mdbx.h:2063
@ MDBX_TOO_LARGE
Definition mdbx.h:2002
@ MDBX_EBADSIGN
Definition mdbx.h:1991
@ MDBX_CURSOR_FULL
Definition mdbx.h:1931
@ MDBX_ENOFILE
Definition mdbx.h:2062
@ MDBX_BAD_TXN
Definition mdbx.h:1962
@ MDBX_ENODATA
Definition mdbx.h:2052
@ MDBX_LAST_LMDB_ERRCODE
Definition mdbx.h:1976
@ MDBX_CORRUPTED
Definition mdbx.h:1905
@ MDBX_EPERM
Definition mdbx.h:2060
@ MDBX_THREAD_MISMATCH
Definition mdbx.h:2006
@ MDBX_BACKLOG_DEPLETED
Definition mdbx.h:2015
@ MDBX_SUCCESS
Definition mdbx.h:1884
@ MDBX_NOTFOUND
Definition mdbx.h:1899
@ MDBX_RESULT_TRUE
Definition mdbx.h:1890
@ MDBX_INVALID
Definition mdbx.h:1915
@ MDBX_BAD_VALSIZE
Definition mdbx.h:1966
@ MDBX_BUSY
Definition mdbx.h:1980
@ MDBX_OUSTED
Definition mdbx.h:2026
@ MDBX_DBS_FULL
Definition mdbx.h:1921
@ MDBX_EINVAL
Definition mdbx.h:2054
@ MDBX_BAD_RSLOT
Definition mdbx.h:1957
@ MDBX_ENOMEM
Definition mdbx.h:2056
@ MDBX_FIRST_ADDED_ERRCODE
Definition mdbx.h:1983
@ MDBX_RESULT_FALSE
Definition mdbx.h:1887
@ MDBX_EINTR
Definition mdbx.h:2061
@ MDBX_READERS_FULL
Definition mdbx.h:1924
@ MDBX_LAST_ADDED_ERRCODE
Definition mdbx.h:2033
@ MDBX_BAD_DBI
Definition mdbx.h:1970
@ MDBX_KEYEXIST
Definition mdbx.h:1893
@ MDBX_DANGLING_DBI
Definition mdbx.h:2022
@ MDBX_EDEADLK
Definition mdbx.h:2064
@ MDBX_PAGE_FULL
Definition mdbx.h:1934
@ MDBX_MAP_FULL
Definition mdbx.h:1918
@ MDBX_PROBLEM
Definition mdbx.h:1973
@ MDBX_ENOSYS
Definition mdbx.h:2058
@ MDBX_EMULTIVAL
Definition mdbx.h:1986
@ MDBX_EROFS
Definition mdbx.h:2057
@ MDBX_MVCC_RETARDED
Definition mdbx.h:2030
@ MDBX_INCOMPATIBLE
Definition mdbx.h:1953
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:3195
MDBX_env_flags_t
Environment flags.
Definition mdbx.h:1076
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:1291
@ MDBX_ENV_DEFAULTS
Definition mdbx.h:1077
@ MDBX_COALESCE
Definition mdbx.h:1327
@ MDBX_NOMETASYNC
Definition mdbx.h:1426
@ MDBX_LIFORECLAIM
Definition mdbx.h:1351
@ MDBX_SAFE_NOSYNC
Definition mdbx.h:1477
@ MDBX_NOTLS
Definition mdbx.h:1270
@ MDBX_SYNC_DURABLE
Definition mdbx.h:1408
@ MDBX_PAGEPERTURB
Definition mdbx.h:1354
@ MDBX_WRITEMAP
Definition mdbx.h:1196
@ MDBX_NOSTICKYTHREADS
Definition mdbx.h:1267
@ MDBX_EXCLUSIVE
Definition mdbx.h:1150
@ MDBX_NOMEMINIT
Definition mdbx.h:1314
@ MDBX_MAPASYNC
Definition mdbx.h:1484
@ MDBX_ACCEDE
Definition mdbx.h:1165
@ MDBX_NOSUBDIR
Definition mdbx.h:1102
@ MDBX_RDONLY
Definition mdbx.h:1120
@ MDBX_UTTERLY_NOSYNC
Definition mdbx.h:1527
@ MDBX_VALIDATION
Definition mdbx.h:1084
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:3643
int mdbx_env_set_maxdbs(MDBX_env *env, MDBX_dbi dbs)
Set the maximum number of named tables for the environment.
Definition mdbx.h:3805
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:3118
MDBX_option_t
MDBX environment extra runtime options.
Definition mdbx.h:2158
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:3057
MDBX_warmup_flags_t
Warming up options.
Definition mdbx.h:3283
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:3759
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:2262
@ MDBX_opt_subpage_room_threshold
Задаёт в % минимальный объём свободного места на основной странице, при отсутствии которого вложенные...
Definition mdbx.h:2435
@ MDBX_opt_subpage_limit
Задаёт в % максимальный размер вложенных страниц, используемых для размещения небольшого количества м...
Definition mdbx.h:2429
@ MDBX_opt_txn_dp_limit
Controls the in-process limit of dirty pages for a write transaction.
Definition mdbx.h:2258
@ MDBX_opt_prefer_waf_insteadof_balance
Управляет выбором между стремлением к равномерности наполнения страниц, либо уменьшением количества и...
Definition mdbx.h:2414
@ 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:2362
@ MDBX_opt_max_db
Controls the maximum number of named tables for the environment.
Definition mdbx.h:2167
@ MDBX_opt_merge_threshold_16dot16_percent
Controls the in-process threshold of semi-empty pages merge.
Definition mdbx.h:2329
@ MDBX_opt_subpage_reserve_prereq
Задаёт в % минимальный объём свободного места на основной странице, при наличии которого,...
Definition mdbx.h:2451
@ MDBX_opt_sync_bytes
Controls interprocess/shared threshold to force flush the data buffers to disk, if MDBX_SAFE_NOSYNC i...
Definition mdbx.h:2190
@ MDBX_opt_spill_min_denominator
Controls the in-process how minimal part of the dirty pages should be spilled when necessary.
Definition mdbx.h:2294
@ 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:2317
@ 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:2230
@ 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:2217
@ MDBX_opt_max_readers
Defines the maximum number of threads/reader slots for all processes interacting with the database.
Definition mdbx.h:2184
@ MDBX_opt_subpage_reserve_limit
Задаёт в % ограничение резервирования места на вложенных страницах.
Definition mdbx.h:2456
@ MDBX_opt_spill_max_denominator
Controls the in-process how maximal part of the dirty pages may be spilled when necessary.
Definition mdbx.h:2278
@ MDBX_opt_sync_period
Controls interprocess/shared relative period since the last unsteady commit to force flush the data b...
Definition mdbx.h:2196
@ MDBX_opt_dp_reserve_limit
Controls the in-process limit of a pre-allocated memory items for dirty pages.
Definition mdbx.h:2244
@ MDBX_opt_writethrough_threshold
Controls the choosing between use write-through disk writes and usual ones with followed flush by the...
Definition mdbx.h:2357
@ MDBX_opt_gc_time_limit
Controls the in-process spending time limit of searching consecutive pages inside GC.
Definition mdbx.h:2389
@ MDBX_warmup_touchlimit
Definition mdbx.h:3322
@ MDBX_warmup_force
Definition mdbx.h:3292
@ MDBX_warmup_oomsafe
Definition mdbx.h:3299
@ MDBX_warmup_release
Definition mdbx.h:3325
@ MDBX_warmup_lock
Definition mdbx.h:3314
@ MDBX_warmup_default
Definition mdbx.h:3286
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:3774
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:3138
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:4901
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:2977
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:3075
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:3673
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:4872
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:3667
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:4750
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:6206
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:3819
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:2858
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:4874
@ MDBX_DBI_FRESH
Definition mdbx.h:4878
@ MDBX_DBI_STALE
Definition mdbx.h:4876
@ MDBX_DBI_CREAT
Definition mdbx.h:4880
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:4319
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:1537
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:4047
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:753
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:1548
@ MDBX_TXN_ERROR
Definition mdbx.h:1588
@ MDBX_TXN_NOMETASYNC
Definition mdbx.h:1567
@ MDBX_TXN_SPILLS
Definition mdbx.h:1598
@ MDBX_TXN_OUSTED
Definition mdbx.h:1622
@ MDBX_TXN_HAS_CHILD
Definition mdbx.h:1603
@ MDBX_TXN_RDONLY_PREPARE
Definition mdbx.h:1557
@ MDBX_TXN_INVALID
Definition mdbx.h:1578
@ MDBX_TXN_BLOCKED
Definition mdbx.h:1627
@ MDBX_TXN_PARKED
Definition mdbx.h:1608
@ MDBX_TXN_NOSYNC
Definition mdbx.h:1571
@ MDBX_TXN_DIRTY
Definition mdbx.h:1593
@ MDBX_TXN_READWRITE
Definition mdbx.h:1542
@ MDBX_TXN_AUTOUNPARK
Definition mdbx.h:1615
@ MDBX_TXN_TRY
Definition mdbx.h:1563
@ MDBX_TXN_FINISHED
Definition mdbx.h:1583
MDBX_chk_severity_t verbosity
Definition mdbx.h:6582
MDBX_txn * txn
Definition mdbx.h:6647
size_t pad
Definition mdbx.h:6599
struct MDBX_chk_internal * internal
Definition mdbx.h:6645
uint8_t scope_nesting
Definition mdbx.h:6649
size_t ones
Definition mdbx.h:6599
struct MDBX_chk_histogram::@8 ranges[9]
struct MDBX_chk_internal * internal
Definition mdbx.h:6579
char * begin
Definition mdbx.h:6564
size_t subtotal_issues
Definition mdbx.h:6583
MDBX_chk_user_table_cookie_t * cookie
Definition mdbx.h:6609
struct MDBX_chk_context * ctx
Definition mdbx.h:6562
MDBX_db_flags_t flags
Definition mdbx.h:6619
struct MDBX_chk_issue * next
Definition mdbx.h:6570
const void * object
Definition mdbx.h:6580
size_t count
Definition mdbx.h:6599
const char * caption
Definition mdbx.h:6572
MDBX_chk_stage_t stage
Definition mdbx.h:6581
MDBX_env * env
Definition mdbx.h:6646
uint8_t empty
Definition mdbx.h:6563
size_t amount
Definition mdbx.h:6599
MDBX_chk_scope_t * scope
Definition mdbx.h:6648
MDBX_chk_issue_t * issues
Definition mdbx.h:6578
size_t count
Definition mdbx.h:6571
MDBX_val name
Definition mdbx.h:6618
size_t lost_bytes
Definition mdbx.h:6622
int id
Definition mdbx.h:6620
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:6544
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:6593
MDBX_chk_flags_t
Флаги/опции для проверки целостности базы данных.
Definition mdbx.h:6501
MDBX_chk_severity_t
Уровни логирование/детализации информации, поставляемой через обратные вызовы при проверке целостност...
Definition mdbx.h:6525
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:6550
@ MDBX_chk_init
Definition mdbx.h:6546
@ MDBX_chk_finalize
Definition mdbx.h:6556
@ MDBX_chk_space
Definition mdbx.h:6551
@ MDBX_chk_lock
Definition mdbx.h:6547
@ MDBX_chk_none
Definition mdbx.h:6545
@ MDBX_chk_maindb
Definition mdbx.h:6552
@ MDBX_chk_unlock
Definition mdbx.h:6555
@ MDBX_chk_meta
Definition mdbx.h:6548
@ MDBX_chk_conclude
Definition mdbx.h:6554
@ MDBX_chk_tree
Definition mdbx.h:6549
@ MDBX_chk_tables
Definition mdbx.h:6553
@ MDBX_CHK_SKIP_BTREE_TRAVERSAL
Definition mdbx.h:6510
@ MDBX_CHK_READWRITE
Definition mdbx.h:6507
@ MDBX_CHK_DEFAULTS
Definition mdbx.h:6503
@ MDBX_CHK_SKIP_KV_TRAVERSAL
Definition mdbx.h:6513
@ MDBX_CHK_IGNORE_ORDER
Definition mdbx.h:6518
@ MDBX_chk_processing
Definition mdbx.h:6534
@ MDBX_chk_result
Definition mdbx.h:6532
@ MDBX_chk_details
Definition mdbx.h:6537
@ MDBX_chk_extra
Definition mdbx.h:6538
@ MDBX_chk_severity_prio_shift
Definition mdbx.h:6526
@ MDBX_chk_severity_kind_mask
Definition mdbx.h:6527
@ MDBX_chk_notice
Definition mdbx.h:6531
@ MDBX_chk_resolution
Definition mdbx.h:6533
@ MDBX_chk_warning
Definition mdbx.h:6530
@ MDBX_chk_fatal
Definition mdbx.h:6528
@ MDBX_chk_info
Definition mdbx.h:6535
@ MDBX_chk_error
Definition mdbx.h:6529
@ MDBX_chk_verbose
Definition mdbx.h:6536
Набор функций обратного вызова используемых при проверке целостности базы данных.
Definition mdbx.h:6681
Контекст проверки целостности базы данных.
Definition mdbx.h:6644
Гистограмма с некоторой статистической информацией, собираемой при проверке целостности БД.
Definition mdbx.h:6598
Проблема обнаруженная при проверке целостности базы данных.
Definition mdbx.h:6569
Виртуальная строка отчета, формируемого при проверке целостности базы данных.
Definition mdbx.h:6561
Иерархический контекст при проверке целостности базы данных.
Definition mdbx.h:6577
Информация о некоторой таблицей ключ-значение, при проверке целостности базы данных.
Definition mdbx.h:6608
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:4804
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:4808
LIBMDBX_API uint64_t mdbx_key_from_jsonInteger(const int64_t json_integer)