libmdbx  0.13.0.37 (2024-04-04T17:32:49+03:00)
One of the fastest compact embeddable key-value ACID database without WAL.
mdbx.h
Go to the documentation of this file.
1 
74 #pragma once
75 #ifndef LIBMDBX_H
76 #define LIBMDBX_H
77 
78 #if defined(__riscv) || defined(__riscv__) || defined(__RISCV) || \
79  defined(__RISCV__)
80 #warning "The RISC-V architecture is intentionally insecure by design. \
81  Please delete this admonition at your own risk, \
82  if you make such decision informed and consciously. \
83  Refer to https://clck.ru/32d9xH for more information."
84 #endif /* RISC-V */
85 
86 #ifdef _MSC_VER
87 #pragma warning(push, 1)
88 #pragma warning(disable : 4548) /* expression before comma has no effect; \
89  expected expression with side - effect */
90 #pragma warning(disable : 4530) /* C++ exception handler used, but unwind \
91  * semantics are not enabled. Specify /EHsc */
92 #pragma warning(disable : 4577) /* 'noexcept' used with no exception handling \
93  * mode specified; termination on exception is \
94  * not guaranteed. Specify /EHsc */
95 #endif /* _MSC_VER (warnings) */
96 
97 /* *INDENT-OFF* */
98 /* clang-format off */
181 /* *INDENT-ON* */
182 /* clang-format on */
183 
184 #include <stdarg.h>
185 #include <stddef.h>
186 #include <stdint.h>
187 #if !defined(NDEBUG) && !defined(assert)
188 #include <assert.h>
189 #endif /* NDEBUG */
190 
191 #if defined(_WIN32) || defined(_WIN64)
192 #include <windows.h>
193 #include <winnt.h>
194 #ifndef __mode_t_defined
195 typedef unsigned short mdbx_mode_t;
196 #else
197 typedef mode_t mdbx_mode_t;
198 #endif /* __mode_t_defined */
199 typedef HANDLE mdbx_filehandle_t;
200 typedef DWORD mdbx_pid_t;
201 typedef DWORD mdbx_tid_t;
202 #else /* Windows */
203 #include <errno.h> /* for error codes */
204 #include <pthread.h> /* for pthread_t */
205 #include <sys/types.h> /* for pid_t */
206 #include <sys/uio.h> /* for struct iovec */
207 #define HAVE_STRUCT_IOVEC 1
208 typedef int mdbx_filehandle_t;
209 typedef pid_t mdbx_pid_t;
210 typedef pthread_t mdbx_tid_t;
211 typedef mode_t mdbx_mode_t;
212 #endif /* !Windows */
213 
214 #ifdef _MSC_VER
215 #pragma warning(pop)
216 #endif
217 
223 /*----------------------------------------------------------------------------*/
224 
225 #ifndef __has_attribute
226 #define __has_attribute(x) (0)
227 #endif /* __has_attribute */
228 
229 #ifndef __has_cpp_attribute
230 #define __has_cpp_attribute(x) 0
231 #endif /* __has_cpp_attribute */
232 
233 #ifndef __has_feature
234 #define __has_feature(x) (0)
235 #endif /* __has_feature */
236 
237 #ifndef __has_extension
238 #define __has_extension(x) (0)
239 #endif /* __has_extension */
240 
241 #ifndef __has_builtin
242 #define __has_builtin(x) (0)
243 #endif /* __has_builtin */
244 
251 #if defined(DOXYGEN)
252 #define MDBX_PURE_FUNCTION [[gnu::pure]]
253 #elif (defined(__GNUC__) || __has_attribute(__pure__)) && \
254  (!defined(__clang__) /* https://bugs.llvm.org/show_bug.cgi?id=43275 */ \
255  || !defined(__cplusplus) || !__has_feature(cxx_exceptions))
256 #define MDBX_PURE_FUNCTION __attribute__((__pure__))
257 #elif defined(_MSC_VER) && !defined(__clang__) && _MSC_VER >= 1920
258 #define MDBX_PURE_FUNCTION
259 #elif defined(__cplusplus) && __has_cpp_attribute(gnu::pure) && \
260  (!defined(__clang__) || !__has_feature(cxx_exceptions))
261 #define MDBX_PURE_FUNCTION [[gnu::pure]]
262 #else
263 #define MDBX_PURE_FUNCTION
264 #endif /* MDBX_PURE_FUNCTION */
265 
269 #if defined(DOXYGEN)
270 #define MDBX_NOTHROW_PURE_FUNCTION [[gnu::pure, gnu::nothrow]]
271 #elif defined(__GNUC__) || \
272  (__has_attribute(__pure__) && __has_attribute(__nothrow__))
273 #define MDBX_NOTHROW_PURE_FUNCTION __attribute__((__pure__, __nothrow__))
274 #elif defined(_MSC_VER) && !defined(__clang__) && _MSC_VER >= 1920
275 #if __has_cpp_attribute(pure)
276 #define MDBX_NOTHROW_PURE_FUNCTION [[pure]]
277 #else
278 #define MDBX_NOTHROW_PURE_FUNCTION
279 #endif
280 #elif defined(__cplusplus) && __has_cpp_attribute(gnu::pure)
281 #if __has_cpp_attribute(gnu::nothrow)
282 #define MDBX_NOTHROW_PURE_FUNCTION [[gnu::pure, gnu::nothrow]]
283 #else
284 #define MDBX_NOTHROW_PURE_FUNCTION [[gnu::pure]]
285 #endif
286 #elif defined(__cplusplus) && __has_cpp_attribute(pure)
287 #define MDBX_NOTHROW_PURE_FUNCTION [[pure]]
288 #else
289 #define MDBX_NOTHROW_PURE_FUNCTION
290 #endif /* MDBX_NOTHROW_PURE_FUNCTION */
291 
302 #if defined(DOXYGEN)
303 #define MDBX_CONST_FUNCTION [[gnu::const]]
304 #elif (defined(__GNUC__) || __has_attribute(__pure__)) && \
305  (!defined(__clang__) /* https://bugs.llvm.org/show_bug.cgi?id=43275 */ \
306  || !defined(__cplusplus) || !__has_feature(cxx_exceptions))
307 #define MDBX_CONST_FUNCTION __attribute__((__const__))
308 #elif defined(_MSC_VER) && !defined(__clang__) && _MSC_VER >= 1920
309 #define MDBX_CONST_FUNCTION MDBX_PURE_FUNCTION
310 #elif defined(__cplusplus) && __has_cpp_attribute(gnu::const) && \
311  (!defined(__clang__) || !__has_feature(cxx_exceptions))
312 #define MDBX_CONST_FUNCTION [[gnu::const]]
313 #else
314 #define MDBX_CONST_FUNCTION MDBX_PURE_FUNCTION
315 #endif /* MDBX_CONST_FUNCTION */
316 
320 #if defined(DOXYGEN)
321 #define MDBX_NOTHROW_CONST_FUNCTION [[gnu::const, gnu::nothrow]]
322 #elif defined(__GNUC__) || \
323  (__has_attribute(__const__) && __has_attribute(__nothrow__))
324 #define MDBX_NOTHROW_CONST_FUNCTION __attribute__((__const__, __nothrow__))
325 #elif defined(_MSC_VER) && !defined(__clang__) && _MSC_VER >= 1920
326 #define MDBX_NOTHROW_CONST_FUNCTION MDBX_NOTHROW_PURE_FUNCTION
327 #elif defined(__cplusplus) && __has_cpp_attribute(gnu::const)
328 #if __has_cpp_attribute(gnu::nothrow)
329 #define MDBX_NOTHROW_PURE_FUNCTION [[gnu::const, gnu::nothrow]]
330 #else
331 #define MDBX_NOTHROW_PURE_FUNCTION [[gnu::const]]
332 #endif
333 #elif defined(__cplusplus) && __has_cpp_attribute(const)
334 #define MDBX_NOTHROW_CONST_FUNCTION [[const]]
335 #else
336 #define MDBX_NOTHROW_CONST_FUNCTION MDBX_NOTHROW_PURE_FUNCTION
337 #endif /* MDBX_NOTHROW_CONST_FUNCTION */
338 
342 #ifndef MDBX_DEPRECATED
343 #ifdef __deprecated
344 #define MDBX_DEPRECATED __deprecated
345 #elif defined(DOXYGEN) || \
346  (defined(__cplusplus) && __cplusplus >= 201403L && \
347  __has_cpp_attribute(deprecated) && \
348  __has_cpp_attribute(deprecated) >= 201309L) || \
349  (!defined(__cplusplus) && defined(__STDC_VERSION__) && \
350  __STDC_VERSION__ >= 202304L)
351 #define MDBX_DEPRECATED [[deprecated]]
352 #elif (defined(__GNUC__) && __GNUC__ > 5) || \
353  (__has_attribute(__deprecated__) && !defined(__GNUC__))
354 #define MDBX_DEPRECATED __attribute__((__deprecated__))
355 #elif defined(_MSC_VER)
356 #define MDBX_DEPRECATED __declspec(deprecated)
357 #else
358 #define MDBX_DEPRECATED
359 #endif
360 #endif /* MDBX_DEPRECATED */
361 
362 #ifndef __dll_export
363 #if defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__) || \
364  defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)
365 #if defined(__GNUC__) || __has_attribute(__dllexport__)
366 #define __dll_export __attribute__((__dllexport__))
367 #elif defined(_MSC_VER)
368 #define __dll_export __declspec(dllexport)
369 #else
370 #define __dll_export
371 #endif
372 #elif defined(__GNUC__) || __has_attribute(__visibility__)
373 #define __dll_export __attribute__((__visibility__("default")))
374 #else
375 #define __dll_export
376 #endif
377 #endif /* __dll_export */
378 
379 #ifndef __dll_import
380 #if defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__) || \
381  defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)
382 #if defined(__GNUC__) || __has_attribute(__dllimport__)
383 #define __dll_import __attribute__((__dllimport__))
384 #elif defined(_MSC_VER)
385 #define __dll_import __declspec(dllimport)
386 #else
387 #define __dll_import
388 #endif
389 #else
390 #define __dll_import
391 #endif
392 #endif /* __dll_import */
393 
397 #if defined(LIBMDBX_INTERNALS) && !defined(LIBMDBX_NO_EXPORTS_LEGACY_API)
398 #define LIBMDBX_INLINE_API(TYPE, NAME, ARGS) \
399  /* proto of exported which uses common impl */ LIBMDBX_API TYPE NAME ARGS; \
400  /* definition of common impl */ static __inline TYPE __inline_##NAME ARGS
401 #else
402 #define LIBMDBX_INLINE_API(TYPE, NAME, ARGS) static __inline TYPE NAME ARGS
403 #endif /* LIBMDBX_INLINE_API */
404 
406 #ifndef MDBX_STRINGIFY
407 #define MDBX_STRINGIFY_HELPER(x) #x
408 #define MDBX_STRINGIFY(x) MDBX_STRINGIFY_HELPER(x)
409 #endif /* MDBX_STRINGIFY */
410 
411 /*----------------------------------------------------------------------------*/
412 
413 #ifndef __cplusplus
414 #ifndef bool
415 #define bool _Bool
416 #endif
417 #ifndef true
418 #define true (1)
419 #endif
420 #ifndef false
421 #define false (0)
422 #endif
423 #endif /* bool without __cplusplus */
424 
426 #if defined(DOXYGEN)
427 #define MDBX_CXX17_NOEXCEPT noexcept
428 #elif !defined(__cpp_noexcept_function_type) || \
429  __cpp_noexcept_function_type < 201510L
430 #define MDBX_CXX17_NOEXCEPT
431 #else
432 #define MDBX_CXX17_NOEXCEPT noexcept
433 #endif /* MDBX_CXX17_NOEXCEPT */
434 
436 #if defined(DOXYGEN)
437 #define MDBX_CXX01_CONSTEXPR constexpr
438 #define MDBX_CXX01_CONSTEXPR_VAR constexpr
439 #elif !defined(__cplusplus)
440 #define MDBX_CXX01_CONSTEXPR __inline
441 #define MDBX_CXX01_CONSTEXPR_VAR const
442 #elif !defined(DOXYGEN) && \
443  ((__cplusplus < 201103L && defined(__cpp_constexpr) && \
444  __cpp_constexpr < 200704L) || \
445  (defined(__LCC__) && __LCC__ < 124) || \
446  (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ < 407) && \
447  !defined(__clang__) && !defined(__LCC__)) || \
448  (defined(_MSC_VER) && _MSC_VER < 1910) || \
449  (defined(__clang__) && __clang_major__ < 4))
450 #define MDBX_CXX01_CONSTEXPR inline
451 #define MDBX_CXX01_CONSTEXPR_VAR const
452 #else
453 #define MDBX_CXX01_CONSTEXPR constexpr
454 #define MDBX_CXX01_CONSTEXPR_VAR constexpr
455 #endif /* MDBX_CXX01_CONSTEXPR */
456 
459 #if defined(DOXYGEN)
460 #define MDBX_CXX11_CONSTEXPR constexpr
461 #define MDBX_CXX11_CONSTEXPR_VAR constexpr
462 #elif !defined(__cplusplus)
463 #define MDBX_CXX11_CONSTEXPR __inline
464 #define MDBX_CXX11_CONSTEXPR_VAR const
465 #elif !defined(DOXYGEN) && \
466  (!defined(__cpp_constexpr) || __cpp_constexpr < 201304L || \
467  (defined(__LCC__) && __LCC__ < 124) || \
468  (defined(__GNUC__) && __GNUC__ < 6 && !defined(__clang__) && \
469  !defined(__LCC__)) || \
470  (defined(_MSC_VER) && _MSC_VER < 1910) || \
471  (defined(__clang__) && __clang_major__ < 5))
472 #define MDBX_CXX11_CONSTEXPR inline
473 #define MDBX_CXX11_CONSTEXPR_VAR const
474 #else
475 #define MDBX_CXX11_CONSTEXPR constexpr
476 #define MDBX_CXX11_CONSTEXPR_VAR constexpr
477 #endif /* MDBX_CXX11_CONSTEXPR */
478 
481 #if defined(DOXYGEN)
482 #define MDBX_CXX14_CONSTEXPR constexpr
483 #define MDBX_CXX14_CONSTEXPR_VAR constexpr
484 #elif !defined(__cplusplus)
485 #define MDBX_CXX14_CONSTEXPR __inline
486 #define MDBX_CXX14_CONSTEXPR_VAR const
487 #elif defined(DOXYGEN) || \
488  defined(__cpp_constexpr) && __cpp_constexpr >= 201304L && \
489  ((defined(_MSC_VER) && _MSC_VER >= 1910) || \
490  (defined(__clang__) && __clang_major__ > 4) || \
491  (defined(__GNUC__) && __GNUC__ > 6) || \
492  (!defined(__GNUC__) && !defined(__clang__) && !defined(_MSC_VER)))
493 #define MDBX_CXX14_CONSTEXPR constexpr
494 #define MDBX_CXX14_CONSTEXPR_VAR constexpr
495 #else
496 #define MDBX_CXX14_CONSTEXPR inline
497 #define MDBX_CXX14_CONSTEXPR_VAR const
498 #endif /* MDBX_CXX14_CONSTEXPR */
499 
500 #if defined(__noreturn)
501 #define MDBX_NORETURN __noreturn
502 #elif defined(_Noreturn)
503 #define MDBX_NORETURN _Noreturn
504 #elif defined(DOXYGEN) || (defined(__cplusplus) && __cplusplus >= 201103L) || \
505  (!defined(__cplusplus) && defined(__STDC_VERSION__) && \
506  __STDC_VERSION__ > 202005L)
507 #define MDBX_NORETURN [[noreturn]]
508 #elif defined(__GNUC__) || __has_attribute(__noreturn__)
509 #define MDBX_NORETURN __attribute__((__noreturn__))
510 #elif defined(_MSC_VER) && !defined(__clang__)
511 #define MDBX_NORETURN __declspec(noreturn)
512 #else
513 #define MDBX_NORETURN
514 #endif /* MDBX_NORETURN */
515 
516 #ifndef MDBX_PRINTF_ARGS
517 #if defined(__GNUC__) || __has_attribute(__format__) || defined(DOXYGEN)
518 #if defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)
519 #define MDBX_PRINTF_ARGS(format_index, first_arg) \
520  __attribute__((__format__(__gnu_printf__, format_index, first_arg)))
521 #else
522 #define MDBX_PRINTF_ARGS(format_index, first_arg) \
523  __attribute__((__format__(__printf__, format_index, first_arg)))
524 #endif /* MinGW */
525 #else
526 #define MDBX_PRINTF_ARGS(format_index, first_arg)
527 #endif
528 #endif /* MDBX_PRINTF_ARGS */
529 
530 #if defined(DOXYGEN) || \
531  (defined(__cplusplus) && __cplusplus >= 201603L && \
532  __has_cpp_attribute(maybe_unused) && \
533  __has_cpp_attribute(maybe_unused) >= 201603L) || \
534  (!defined(__cplusplus) && defined(__STDC_VERSION__) && \
535  __STDC_VERSION__ > 202005L)
536 #define MDBX_MAYBE_UNUSED [[maybe_unused]]
537 #elif defined(__GNUC__) || __has_attribute(__unused__)
538 #define MDBX_MAYBE_UNUSED __attribute__((__unused__))
539 #else
540 #define MDBX_MAYBE_UNUSED
541 #endif /* MDBX_MAYBE_UNUSED */
542 
543 #if __has_attribute(no_sanitize) || defined(DOXYGEN)
544 #define MDBX_NOSANITIZE_ENUM __attribute((__no_sanitize__("enum")))
545 #else
546 #define MDBX_NOSANITIZE_ENUM
547 #endif /* MDBX_NOSANITIZE_ENUM */
548 
549 /* Oh, below are some songs and dances since:
550  * - C++ requires explicit definition of the necessary operators.
551  * - the proper implementation of DEFINE_ENUM_FLAG_OPERATORS for C++ required
552  * the constexpr feature which is broken in most old compilers;
553  * - DEFINE_ENUM_FLAG_OPERATORS may be defined broken as in the Windows SDK. */
554 #ifndef DEFINE_ENUM_FLAG_OPERATORS
555 
556 #ifdef __cplusplus
557 #if !defined(__cpp_constexpr) || __cpp_constexpr < 200704L || \
558  (defined(__LCC__) && __LCC__ < 124) || \
559  (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ < 407) && \
560  !defined(__clang__) && !defined(__LCC__)) || \
561  (defined(_MSC_VER) && _MSC_VER < 1910) || \
562  (defined(__clang__) && __clang_major__ < 4)
563 /* The constexpr feature is not available or (may be) broken */
564 #define CONSTEXPR_ENUM_FLAGS_OPERATIONS 0
565 #else
566 /* C always allows these operators for enums */
567 #define CONSTEXPR_ENUM_FLAGS_OPERATIONS 1
568 #endif /* __cpp_constexpr */
569 
572 #define DEFINE_ENUM_FLAG_OPERATORS(ENUM) \
573  extern "C++" { \
574  MDBX_NOSANITIZE_ENUM MDBX_CXX01_CONSTEXPR ENUM operator|(ENUM a, ENUM b) { \
575  return ENUM(unsigned(a) | unsigned(b)); \
576  } \
577  MDBX_NOSANITIZE_ENUM MDBX_CXX14_CONSTEXPR ENUM &operator|=(ENUM &a, \
578  ENUM b) { \
579  return a = a | b; \
580  } \
581  MDBX_NOSANITIZE_ENUM MDBX_CXX01_CONSTEXPR ENUM operator&(ENUM a, ENUM b) { \
582  return ENUM(unsigned(a) & unsigned(b)); \
583  } \
584  MDBX_NOSANITIZE_ENUM MDBX_CXX01_CONSTEXPR ENUM operator&(ENUM a, \
585  unsigned b) { \
586  return ENUM(unsigned(a) & b); \
587  } \
588  MDBX_NOSANITIZE_ENUM MDBX_CXX01_CONSTEXPR ENUM operator&(unsigned a, \
589  ENUM b) { \
590  return ENUM(a & unsigned(b)); \
591  } \
592  MDBX_NOSANITIZE_ENUM MDBX_CXX14_CONSTEXPR ENUM &operator&=(ENUM &a, \
593  ENUM b) { \
594  return a = a & b; \
595  } \
596  MDBX_NOSANITIZE_ENUM MDBX_CXX14_CONSTEXPR ENUM &operator&=(ENUM &a, \
597  unsigned b) { \
598  return a = a & b; \
599  } \
600  MDBX_CXX01_CONSTEXPR unsigned operator~(ENUM a) { return ~unsigned(a); } \
601  MDBX_NOSANITIZE_ENUM MDBX_CXX01_CONSTEXPR ENUM operator^(ENUM a, ENUM b) { \
602  return ENUM(unsigned(a) ^ unsigned(b)); \
603  } \
604  MDBX_NOSANITIZE_ENUM MDBX_CXX14_CONSTEXPR ENUM &operator^=(ENUM &a, \
605  ENUM b) { \
606  return a = a ^ b; \
607  } \
608  }
609 #else /* __cplusplus */
610 /* nope for C since it always allows these operators for enums */
611 #define DEFINE_ENUM_FLAG_OPERATORS(ENUM)
612 #define CONSTEXPR_ENUM_FLAGS_OPERATIONS 1
613 #endif /* !__cplusplus */
614 
615 #elif !defined(CONSTEXPR_ENUM_FLAGS_OPERATIONS)
616 
617 #ifdef __cplusplus
618 /* DEFINE_ENUM_FLAG_OPERATORS may be defined broken as in the Windows SDK */
619 #define CONSTEXPR_ENUM_FLAGS_OPERATIONS 0
620 #else
621 /* C always allows these operators for enums */
622 #define CONSTEXPR_ENUM_FLAGS_OPERATIONS 1
623 #endif
624 
625 #endif /* DEFINE_ENUM_FLAG_OPERATORS */
626 
629 /*----------------------------------------------------------------------------*/
630 
634 #ifdef __cplusplus
635 extern "C" {
636 #endif
637 
638 /* MDBX version 0.13.x */
639 #define MDBX_VERSION_MAJOR 0
640 #define MDBX_VERSION_MINOR 13
641 
642 #ifndef LIBMDBX_API
643 #if defined(LIBMDBX_EXPORTS)
644 #define LIBMDBX_API __dll_export
645 #elif defined(LIBMDBX_IMPORTS)
646 #define LIBMDBX_API __dll_import
647 #else
648 #define LIBMDBX_API
649 #endif
650 #endif /* LIBMDBX_API */
651 
652 #ifdef __cplusplus
653 #if defined(__clang__) || __has_attribute(type_visibility)
654 #define LIBMDBX_API_TYPE LIBMDBX_API __attribute__((type_visibility("default")))
655 #else
656 #define LIBMDBX_API_TYPE LIBMDBX_API
657 #endif
658 #else
659 #define LIBMDBX_API_TYPE
660 #endif /* LIBMDBX_API_TYPE */
661 
662 #if defined(LIBMDBX_IMPORTS)
663 #define LIBMDBX_VERINFO_API __dll_import
664 #else
665 #define LIBMDBX_VERINFO_API __dll_export
666 #endif /* LIBMDBX_VERINFO_API */
667 
670  uint8_t major;
671  uint8_t minor;
672  uint16_t release;
673  uint32_t revision;
674  struct {
675  const char *datetime;
676  const char *tree;
677  const char *commit;
678  const char *describe;
679  } git;
680  const char *sourcery;
682 
687  const char *datetime;
688  const char *target;
689  const char *options;
690  const char *compiler;
691  const char *flags;
693 
694 #if (defined(_WIN32) || defined(_WIN64)) && !MDBX_BUILD_SHARED_LIBRARY
695 /* MDBX internally uses global and thread local storage destructors to
696  * automatically (de)initialization, releasing reader lock table slots
697  * and so on.
698  *
699  * If MDBX built as a DLL this is done out-of-the-box by DllEntry() function,
700  * which called automatically by Windows core with passing corresponding reason
701  * argument.
702  *
703  * Otherwise, if MDBX was built not as a DLL, some black magic
704  * may be required depending of Windows version:
705  *
706  * - Modern Windows versions, including Windows Vista and later, provides
707  * support for "TLS Directory" (e.g .CRT$XL[A-Z] sections in executable
708  * or dll file). In this case, MDBX capable of doing all automatically,
709  * therefore you DON'T NEED to call mdbx_module_handler()
710  * so the MDBX_MANUAL_MODULE_HANDLER defined as 0.
711  *
712  * - Obsolete versions of Windows, prior to Windows Vista, REQUIRES calling
713  * mdbx_module_handler() manually from corresponding DllMain() or WinMain()
714  * of your DLL or application,
715  * so the MDBX_MANUAL_MODULE_HANDLER defined as 1.
716  *
717  * Therefore, building MDBX as a DLL is recommended for all version of Windows.
718  * So, if you doubt, just build MDBX as the separate DLL and don't care about
719  * the MDBX_MANUAL_MODULE_HANDLER. */
720 
721 #ifndef _WIN32_WINNT
722 #error Non-dll build libmdbx requires target Windows version \
723  to be explicitly defined via _WIN32_WINNT for properly \
724  handling thread local storage destructors.
725 #endif /* _WIN32_WINNT */
726 
727 #if _WIN32_WINNT >= 0x0600 /* Windows Vista */
728 /* As described above mdbx_module_handler() is NOT needed for Windows Vista
729  * and later. */
730 #define MDBX_MANUAL_MODULE_HANDLER 0
731 #else
732 /* As described above mdbx_module_handler() IS REQUIRED for Windows versions
733  * prior to Windows Vista. */
734 #define MDBX_MANUAL_MODULE_HANDLER 1
735 void LIBMDBX_API NTAPI mdbx_module_handler(PVOID module, DWORD reason,
736  PVOID reserved);
737 #endif
738 
739 #endif /* Windows && !DLL && MDBX_MANUAL_MODULE_HANDLER */
740 
741 /* OPACITY STRUCTURES *********************************************************/
742 
747 #ifndef __cplusplus
748 typedef struct MDBX_env MDBX_env;
749 #else
750 struct MDBX_env;
751 #endif
752 
758 #ifndef __cplusplus
759 typedef struct MDBX_txn MDBX_txn;
760 #else
761 struct MDBX_txn;
762 #endif
763 
771 typedef uint32_t MDBX_dbi;
772 
777 #ifndef __cplusplus
778 typedef struct MDBX_cursor MDBX_cursor;
779 #else
780 struct MDBX_cursor;
781 #endif
782 
797 #ifndef HAVE_STRUCT_IOVEC
798 struct iovec {
799  void *iov_base;
800  size_t iov_len;
801 };
802 #define HAVE_STRUCT_IOVEC
803 #endif /* HAVE_STRUCT_IOVEC */
804 
805 #if defined(__sun) || defined(__SVR4) || defined(__svr4__)
806 /* The `iov_len` is signed on Sun/Solaris.
807  * So define custom MDBX_val to avoid a lot of warnings. */
808 struct MDBX_val {
809  void *iov_base;
810  size_t iov_len;
811 };
812 #ifndef __cplusplus
813 typedef struct MDBX_val MDBX_val;
814 #endif
815 #else /* SunOS */
816 typedef struct iovec MDBX_val;
817 #endif /* ! SunOS */
818 
821  MDBX_MAX_DBI = UINT32_C(32765),
822 
824  MDBX_MAXDATASIZE = UINT32_C(0x7fff0000),
825 
828 
831 };
832 
833 /* THE FILES *******************************************************************
834  * At the file system level, the environment corresponds to a pair of files. */
835 
836 #ifndef MDBX_LOCKNAME
839 #if !(defined(_WIN32) || defined(_WIN64))
840 #define MDBX_LOCKNAME "/mdbx.lck"
841 #else
842 #define MDBX_LOCKNAME_W L"\\mdbx.lck"
843 #define MDBX_LOCKNAME_A "\\mdbx.lck"
844 #ifdef UNICODE
845 #define MDBX_LOCKNAME MDBX_LOCKNAME_W
846 #else
847 #define MDBX_LOCKNAME MDBX_LOCKNAME_A
848 #endif /* UNICODE */
849 #endif /* Windows */
850 #endif /* MDBX_LOCKNAME */
851 #ifndef MDBX_DATANAME
854 #if !(defined(_WIN32) || defined(_WIN64))
855 #define MDBX_DATANAME "/mdbx.dat"
856 #else
857 #define MDBX_DATANAME_W L"\\mdbx.dat"
858 #define MDBX_DATANAME_A "\\mdbx.dat"
859 #ifdef UNICODE
860 #define MDBX_DATANAME MDBX_DATANAME_W
861 #else
862 #define MDBX_DATANAME MDBX_DATANAME_A
863 #endif /* UNICODE */
864 #endif /* Windows */
865 #endif /* MDBX_DATANAME */
866 
867 #ifndef MDBX_LOCK_SUFFIX
869 #if !(defined(_WIN32) || defined(_WIN64))
870 #define MDBX_LOCK_SUFFIX "-lck"
871 #else
872 #define MDBX_LOCK_SUFFIX_W L"-lck"
873 #define MDBX_LOCK_SUFFIX_A "-lck"
874 #ifdef UNICODE
875 #define MDBX_LOCK_SUFFIX MDBX_LOCK_SUFFIX_W
876 #else
877 #define MDBX_LOCK_SUFFIX MDBX_LOCK_SUFFIX_A
878 #endif /* UNICODE */
879 #endif /* Windows */
880 #endif /* MDBX_LOCK_SUFFIX */
881 
882 /* DEBUG & LOGGING ************************************************************/
883 
896 
902 
908 
914 
919 
924 
929 
934 
935 #ifdef ENABLE_UBSAN
936  MDBX_LOG_MAX = 7 /* avoid UBSAN false-positive trap by a tests */,
937 #endif /* ENABLE_UBSAN */
938 
941 };
942 #ifndef __cplusplus
944 #endif
945 
953 
958 
962 
966 
970 
973 
976 
981 
982 #ifdef ENABLE_UBSAN
983  MDBX_DBG_MAX = ((unsigned)MDBX_LOG_MAX) << 16 |
984  127 /* avoid UBSAN false-positive trap by a tests */,
985 #endif /* ENABLE_UBSAN */
986 
989 };
990 #ifndef __cplusplus
992 #else
993 DEFINE_ENUM_FLAG_OPERATORS(MDBX_debug_flags_t)
994 #endif
995 
1010 typedef void MDBX_debug_func(MDBX_log_level_t loglevel, const char *function,
1011  int line, const char *fmt,
1012  va_list args) MDBX_CXX17_NOEXCEPT;
1013 
1015 #define MDBX_LOGGER_DONTCHANGE ((MDBX_debug_func *)(intptr_t)-1)
1016 #define MDBX_LOGGER_NOFMT_DONTCHANGE ((MDBX_debug_func_nofmt *)(intptr_t)-1)
1017 
1022  MDBX_debug_flags_t debug_flags,
1023  MDBX_debug_func *logger);
1024 
1026  const char *function, int line,
1027  const char *msg,
1028  unsigned length) MDBX_CXX17_NOEXCEPT;
1029 
1031  MDBX_debug_flags_t debug_flags,
1032  MDBX_debug_func_nofmt *logger,
1033  char *logger_buffer,
1034  size_t logger_buffer_size);
1035 
1046 typedef void MDBX_assert_func(const MDBX_env *env, const char *msg,
1047  const char *function,
1048  unsigned line) MDBX_CXX17_NOEXCEPT;
1049 
1060 
1070 LIBMDBX_API const char *mdbx_dump_val(const MDBX_val *key, char *const buf,
1071  const size_t bufsize);
1072 
1074 MDBX_NORETURN LIBMDBX_API void mdbx_panic(const char *fmt, ...)
1075  MDBX_PRINTF_ARGS(1, 2);
1076 
1080  const char *msg,
1081  const char *func,
1082  unsigned line);
1091 
1097  MDBX_VALIDATION = UINT32_C(0x00002000),
1098 
1115  MDBX_NOSUBDIR = UINT32_C(0x4000),
1116 
1133  MDBX_RDONLY = UINT32_C(0x20000),
1134 
1163  MDBX_EXCLUSIVE = UINT32_C(0x400000),
1164 
1178  MDBX_ACCEDE = UINT32_C(0x40000000),
1179 
1209  MDBX_WRITEMAP = UINT32_C(0x80000),
1210 
1280  MDBX_NOSTICKYTHREADS = UINT32_C(0x200000),
1281 #ifndef _MSC_VER /* avoid madness MSVC */
1284 #endif /* avoid madness MSVC */
1285 
1305  MDBX_NORDAHEAD = UINT32_C(0x800000),
1306 
1328  MDBX_NOMEMINIT = UINT32_C(0x1000000),
1329 
1330 #ifndef _MSC_VER /* avoid madness MSVC */
1342  MDBX_COALESCE MDBX_DEPRECATED = UINT32_C(0x2000000),
1343 #endif /* avoid madness MSVC */
1344 
1367  MDBX_LIFORECLAIM = UINT32_C(0x4000000),
1368 
1370  MDBX_PAGEPERTURB = UINT32_C(0x8000000),
1371 
1372  /* SYNC MODES****************************************************************/
1425 
1442  MDBX_NOMETASYNC = UINT32_C(0x40000),
1443 
1493  MDBX_SAFE_NOSYNC = UINT32_C(0x10000),
1494 
1501 
1543  MDBX_UTTERLY_NOSYNC = MDBX_SAFE_NOSYNC | UINT32_C(0x100000),
1544 
1546 };
1547 #ifndef __cplusplus
1549 typedef enum MDBX_env_flags_t MDBX_env_flags_t;
1550 #else
1551 DEFINE_ENUM_FLAG_OPERATORS(MDBX_env_flags_t)
1552 #endif
1553 
1564 
1570 
1577 #if CONSTEXPR_ENUM_FLAGS_OPERATIONS || defined(DOXYGEN)
1579 #else
1580  MDBX_TXN_RDONLY_PREPARE = uint32_t(MDBX_RDONLY) | uint32_t(MDBX_NOMEMINIT),
1581 #endif
1582 
1584  MDBX_TXN_TRY = UINT32_C(0x10000000),
1585 
1589 
1593 
1594  /* Transaction state flags ---------------------------------------------- */
1595 
1599  MDBX_TXN_INVALID = INT32_MIN,
1600 
1605 
1610 
1615 
1620 
1625 
1630 };
1631 #ifndef __cplusplus
1632 typedef enum MDBX_txn_flags_t MDBX_txn_flags_t;
1633 #else
1634 DEFINE_ENUM_FLAG_OPERATORS(MDBX_txn_flags_t)
1635 #endif
1636 
1644 
1646  MDBX_REVERSEKEY = UINT32_C(0x02),
1647 
1649  MDBX_DUPSORT = UINT32_C(0x04),
1650 
1656  MDBX_INTEGERKEY = UINT32_C(0x08),
1657 
1660  MDBX_DUPFIXED = UINT32_C(0x10),
1661 
1665  MDBX_INTEGERDUP = UINT32_C(0x20),
1666 
1668  MDBX_REVERSEDUP = UINT32_C(0x40),
1669 
1671  MDBX_CREATE = UINT32_C(0x40000),
1672 
1684 };
1685 #ifndef __cplusplus
1687 typedef enum MDBX_db_flags_t MDBX_db_flags_t;
1688 #else
1689 DEFINE_ENUM_FLAG_OPERATORS(MDBX_db_flags_t)
1690 #endif
1691 
1699 
1701  MDBX_NOOVERWRITE = UINT32_C(0x10),
1702 
1705  MDBX_NODUPDATA = UINT32_C(0x20),
1706 
1711  MDBX_CURRENT = UINT32_C(0x40),
1712 
1716  MDBX_ALLDUPS = UINT32_C(0x80),
1717 
1720  MDBX_RESERVE = UINT32_C(0x10000),
1721 
1724  MDBX_APPEND = UINT32_C(0x20000),
1725 
1729  MDBX_APPENDDUP = UINT32_C(0x40000),
1730 
1733  MDBX_MULTIPLE = UINT32_C(0x80000)
1734 };
1735 #ifndef __cplusplus
1737 typedef enum MDBX_put_flags_t MDBX_put_flags_t;
1738 #else
1739 DEFINE_ENUM_FLAG_OPERATORS(MDBX_put_flags_t)
1740 #endif
1741 
1747 
1751 
1754 };
1755 #ifndef __cplusplus
1758 #else
1759 DEFINE_ENUM_FLAG_OPERATORS(MDBX_copy_flags_t)
1760 #endif
1761 
1769 
1772 
1775 
1779 
1782 
1787 
1790 
1793 
1796 
1799 
1804 
1807 
1810 
1813 
1816 
1819 
1822 
1825 
1829 
1843 
1857 
1858  /* Doubtless cursor positioning at a specified key. */
1864 
1865  /* Doubtless cursor positioning at a specified key-value pair
1866  * for dupsort/multi-value hives. */
1872 
1878 };
1879 #ifndef __cplusplus
1881 typedef enum MDBX_cursor_op MDBX_cursor_op;
1882 #endif
1883 
1892 
1895 
1898 
1900  MDBX_KEYEXIST = -30799,
1901 
1904 
1906  MDBX_NOTFOUND = -30798,
1907 
1910 
1912  MDBX_CORRUPTED = -30796,
1913 
1916  MDBX_PANIC = -30795,
1917 
1920 
1922  MDBX_INVALID = -30793,
1923 
1925  MDBX_MAP_FULL = -30792,
1926 
1928  MDBX_DBS_FULL = -30791,
1929 
1932 
1934  MDBX_TXN_FULL = -30788,
1935 
1939 
1941  MDBX_PAGE_FULL = -30786,
1942 
1951 
1961 
1964  MDBX_BAD_RSLOT = -30783,
1965 
1969  MDBX_BAD_TXN = -30782,
1970 
1974 
1977  MDBX_BAD_DBI = -30780,
1978 
1980  MDBX_PROBLEM = -30779,
1981 
1984 
1987  MDBX_BUSY = -30778,
1988 
1991 
1993  MDBX_EMULTIVAL = -30421,
1994 
1998  MDBX_EBADSIGN = -30420,
1999 
2003 
2006 
2009  MDBX_TOO_LARGE = -30417,
2010 
2014 
2017 
2023 
2026 
2030 
2031  /* The last of MDBX-added error codes */
2033 
2034 #if defined(_WIN32) || defined(_WIN64)
2035  MDBX_ENODATA = ERROR_HANDLE_EOF,
2036  MDBX_EINVAL = ERROR_INVALID_PARAMETER,
2037  MDBX_EACCESS = ERROR_ACCESS_DENIED,
2038  MDBX_ENOMEM = ERROR_OUTOFMEMORY,
2039  MDBX_EROFS = ERROR_FILE_READ_ONLY,
2040  MDBX_ENOSYS = ERROR_NOT_SUPPORTED,
2041  MDBX_EIO = ERROR_WRITE_FAULT,
2042  MDBX_EPERM = ERROR_INVALID_FUNCTION,
2043  MDBX_EINTR = ERROR_CANCELLED,
2044  MDBX_ENOFILE = ERROR_FILE_NOT_FOUND,
2045  MDBX_EREMOTE = ERROR_REMOTE_STORAGE_MEDIA_ERROR,
2046  MDBX_EDEADLK = ERROR_POSSIBLE_DEADLOCK
2047 #else /* Windows */
2048 #ifdef ENODATA
2049  MDBX_ENODATA = ENODATA,
2050 #else
2051  MDBX_ENODATA = 9919 /* for compatibility with LLVM's C++ libraries/headers */,
2052 #endif /* ENODATA */
2053  MDBX_EINVAL = EINVAL,
2054  MDBX_EACCESS = EACCES,
2055  MDBX_ENOMEM = ENOMEM,
2056  MDBX_EROFS = EROFS,
2057  MDBX_ENOSYS = ENOSYS,
2058  MDBX_EIO = EIO,
2059  MDBX_EPERM = EPERM,
2060  MDBX_EINTR = EINTR,
2061  MDBX_ENOFILE = ENOENT,
2062  MDBX_EREMOTE = ENOTBLK,
2063  MDBX_EDEADLK = EDEADLK
2064 #endif /* !Windows */
2065 };
2066 #ifndef __cplusplus
2068 typedef enum MDBX_error_t MDBX_error_t;
2069 #endif
2070 
2075 MDBX_DEPRECATED static __inline int MDBX_MAP_RESIZED_is_deprecated(void) {
2077 }
2078 #define MDBX_MAP_RESIZED MDBX_MAP_RESIZED_is_deprecated()
2079 
2098 LIBMDBX_API const char *mdbx_strerror(int errnum);
2099 
2124 LIBMDBX_API const char *mdbx_strerror_r(int errnum, char *buf, size_t buflen);
2126 
2127 #if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
2132 LIBMDBX_API const char *mdbx_strerror_ANSI2OEM(int errnum);
2133 
2138 LIBMDBX_API const char *mdbx_strerror_r_ANSI2OEM(int errnum, char *buf,
2139  size_t buflen);
2140 #endif /* Bit of Windows' madness */
2141 
2157 
2171 
2188 
2194 
2200 
2221 
2234 
2248 
2262 
2266 
2282 
2298 
2321 
2332 
2360 
2365 
2392 };
2393 #ifndef __cplusplus
2395 typedef enum MDBX_option_t MDBX_option_t;
2396 #endif
2397 
2409  uint64_t value);
2410 
2422  const MDBX_option_t option,
2423  uint64_t *pvalue);
2424 
2497 LIBMDBX_API int mdbx_env_open(MDBX_env *env, const char *pathname,
2498  MDBX_env_flags_t flags, mdbx_mode_t mode);
2499 
2500 #if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
2504 LIBMDBX_API int mdbx_env_openW(MDBX_env *env, const wchar_t *pathname,
2505  MDBX_env_flags_t flags, mdbx_mode_t mode);
2506 #endif /* Windows */
2507 
2525 };
2526 #ifndef __cplusplus
2529 #endif
2530 
2550 LIBMDBX_API int mdbx_env_delete(const char *pathname,
2551  MDBX_env_delete_mode_t mode);
2552 
2553 #if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
2557 LIBMDBX_API int mdbx_env_deleteW(const wchar_t *pathname,
2558  MDBX_env_delete_mode_t mode);
2559 #endif /* Windows */
2560 
2594 LIBMDBX_API int mdbx_env_copy(MDBX_env *env, const char *dest,
2595  MDBX_copy_flags_t flags);
2596 
2597 #if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
2601 LIBMDBX_API int mdbx_env_copyW(MDBX_env *env, const wchar_t *dest,
2602  MDBX_copy_flags_t flags);
2603 #endif /* Windows */
2604 
2629  MDBX_copy_flags_t flags);
2630 
2634 struct MDBX_stat {
2635  uint32_t ms_psize;
2637  uint32_t ms_depth;
2638  uint64_t ms_branch_pages;
2639  uint64_t ms_leaf_pages;
2641  uint64_t ms_entries;
2642  uint64_t ms_mod_txnid;
2643 };
2644 #ifndef __cplusplus
2646 typedef struct MDBX_stat MDBX_stat;
2647 #endif
2648 
2668 LIBMDBX_API int mdbx_env_stat_ex(const MDBX_env *env, const MDBX_txn *txn,
2669  MDBX_stat *stat, size_t bytes);
2670 
2674 MDBX_DEPRECATED inline int mdbx_env_stat(const MDBX_env *env, MDBX_stat *stat,
2675  size_t bytes) {
2676  return mdbx_env_stat_ex(env, NULL, stat, bytes);
2677 }
2678 
2683  struct {
2684  uint64_t lower;
2685  uint64_t upper;
2686  uint64_t current;
2687  uint64_t shrink;
2688  uint64_t grow;
2690  uint64_t mi_mapsize;
2691  uint64_t mi_last_pgno;
2692  uint64_t mi_recent_txnid;
2696  uint64_t mi_meta_txnid[3], mi_meta_sign[3];
2697  uint32_t mi_maxreaders;
2698  uint32_t mi_numreaders;
2699  uint32_t mi_dxb_pagesize;
2700  uint32_t mi_sys_pagesize;
2710  struct {
2711  struct {
2712  uint64_t x, y;
2713  } current, meta[3];
2715 
2732  uint32_t mi_mode;
2733 
2739  struct {
2740  uint64_t newly;
2741  uint64_t cow;
2742  uint64_t clone;
2744  uint64_t split;
2745  uint64_t merge;
2746  uint64_t spill;
2747  uint64_t unspill;
2748  uint64_t wops;
2750  uint64_t prefault;
2751  uint64_t mincore;
2752  uint64_t
2753  msync;
2754  uint64_t
2755  fsync;
2757 };
2758 #ifndef __cplusplus
2760 typedef struct MDBX_envinfo MDBX_envinfo;
2761 #endif
2762 
2783 LIBMDBX_API int mdbx_env_info_ex(const MDBX_env *env, const MDBX_txn *txn,
2784  MDBX_envinfo *info, size_t bytes);
2788 MDBX_DEPRECATED inline int mdbx_env_info(const MDBX_env *env, MDBX_envinfo *info,
2789  size_t bytes) {
2790  return mdbx_env_info_ex(env, NULL, info, bytes);
2791 }
2792 
2829 LIBMDBX_API int mdbx_env_sync_ex(MDBX_env *env, bool force, bool nonblock);
2830 
2834 inline int mdbx_env_sync(MDBX_env * env) {
2835  return mdbx_env_sync_ex(env, true, false);
2836 }
2837 
2841 inline int mdbx_env_sync_poll(MDBX_env * env) {
2842  return mdbx_env_sync_ex(env, false, true);
2843 }
2844 
2868 inline int mdbx_env_set_syncbytes(MDBX_env * env, size_t threshold) {
2869  return mdbx_env_set_option(env, MDBX_opt_sync_bytes, threshold);
2870 }
2871 
2886 inline int mdbx_env_get_syncbytes(const MDBX_env *env, size_t *threshold) {
2887  int rc = MDBX_EINVAL;
2888  if (threshold) {
2889  uint64_t proxy = 0;
2890  rc = mdbx_env_get_option(env, MDBX_opt_sync_bytes, &proxy);
2891 #ifdef assert
2892  assert(proxy <= SIZE_MAX);
2893 #endif /* assert */
2894  *threshold = (size_t)proxy;
2895  }
2896  return rc;
2897 }
2898 
2929 inline int mdbx_env_set_syncperiod(MDBX_env * env, unsigned seconds_16dot16) {
2930  return mdbx_env_set_option(env, MDBX_opt_sync_period, seconds_16dot16);
2931 }
2932 
2949 inline int mdbx_env_get_syncperiod(const MDBX_env *env, unsigned *period_seconds_16dot16) {
2950  int rc = MDBX_EINVAL;
2951  if (period_seconds_16dot16) {
2952  uint64_t proxy = 0;
2953  rc = mdbx_env_get_option(env, MDBX_opt_sync_period, &proxy);
2954 #ifdef assert
2955  assert(proxy <= UINT32_MAX);
2956 #endif /* assert */
2957  *period_seconds_16dot16 = (unsigned)proxy;
2958  }
2959  return rc;
2960 }
2961 
3001 LIBMDBX_API int mdbx_env_close_ex(MDBX_env *env, bool dont_sync);
3002 
3006 inline int mdbx_env_close(MDBX_env * env) {
3007  return mdbx_env_close_ex(env, false);
3008 }
3009 
3010 #if defined(DOXYGEN) || !(defined(_WIN32) || defined(_WIN64))
3088 #endif /* Windows */
3089 
3098 
3104 
3111 
3126 
3134 
3137 };
3138 #ifndef __cplusplus
3140 #else
3141 DEFINE_ENUM_FLAG_OPERATORS(MDBX_warmup_flags_t)
3142 #endif
3143 
3174 LIBMDBX_API int mdbx_env_warmup(const MDBX_env *env, const MDBX_txn *txn,
3175  MDBX_warmup_flags_t flags,
3176  unsigned timeout_seconds_16dot16);
3177 
3199  bool onoff);
3200 
3211 LIBMDBX_API int mdbx_env_get_flags(const MDBX_env *env, unsigned *flags);
3212 
3226 LIBMDBX_API int mdbx_env_get_path(const MDBX_env *env, const char **dest);
3227 
3228 #if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
3232 LIBMDBX_API int mdbx_env_get_pathW(const MDBX_env *env, const wchar_t **dest);
3233 #endif /* Windows */
3234 
3248 
3445 LIBMDBX_API int mdbx_env_set_geometry(MDBX_env *env, intptr_t size_lower,
3446  intptr_t size_now, intptr_t size_upper,
3447  intptr_t growth_step,
3448  intptr_t shrink_threshold,
3449  intptr_t pagesize);
3450 
3453 MDBX_DEPRECATED inline int mdbx_env_set_mapsize(MDBX_env * env, size_t size) {
3454  return mdbx_env_set_geometry(env, size, size, size, -1, -1, -1);
3455 }
3456 
3473  intptr_t redundancy);
3474 
3478  return MDBX_MIN_PAGESIZE;
3479 }
3480 
3484  return MDBX_MAX_PAGESIZE;
3485 }
3486 
3491 mdbx_limits_dbsize_min(intptr_t pagesize);
3492 
3497 mdbx_limits_dbsize_max(intptr_t pagesize);
3498 
3504 mdbx_limits_keysize_max(intptr_t pagesize, MDBX_db_flags_t flags);
3505 
3511 
3517 mdbx_limits_valsize_max(intptr_t pagesize, MDBX_db_flags_t flags);
3518 
3524 
3531 
3539 
3544 mdbx_limits_txnsize_max(intptr_t pagesize);
3545 
3569 inline int mdbx_env_set_maxreaders(MDBX_env * env, unsigned readers) {
3570  return mdbx_env_set_option(env, MDBX_opt_max_readers, readers);
3571 }
3572 
3584 inline int mdbx_env_get_maxreaders(const MDBX_env *env, unsigned *readers) {
3585  int rc = MDBX_EINVAL;
3586  if (readers) {
3587  uint64_t proxy = 0;
3588  rc = mdbx_env_get_option(env, MDBX_opt_max_readers, &proxy);
3589  *readers = (unsigned)proxy;
3590  }
3591  return rc;
3592 }
3593 
3615 inline int mdbx_env_set_maxdbs(MDBX_env * env, MDBX_dbi dbs) {
3616  return mdbx_env_set_option(env, MDBX_opt_max_db, dbs);
3617 }
3618 
3629 inline int mdbx_env_get_maxdbs(const MDBX_env *env, MDBX_dbi *dbs) {
3630  int rc = MDBX_EINVAL;
3631  if (dbs) {
3632  uint64_t proxy = 0;
3633  rc = mdbx_env_get_option(env, MDBX_opt_max_db, &proxy);
3634  *dbs = (MDBX_dbi)proxy;
3635  }
3636  return rc;
3637 }
3638 
3644 
3659 LIBMDBX_API int mdbx_get_sysraminfo(intptr_t *page_size, intptr_t *total_pages,
3660  intptr_t *avail_pages);
3661 
3673 
3685 
3689 MDBX_DEPRECATED MDBX_NOTHROW_PURE_FUNCTION LIBMDBX_API int
3691 
3704 
3717 
3728 
3739 
3800  MDBX_txn_flags_t flags, MDBX_txn **txn,
3801  void *context);
3802 
3857 inline int mdbx_txn_begin(MDBX_env * env, MDBX_txn *parent, MDBX_txn_flags_t flags,
3858  MDBX_txn **txn) {
3859  return mdbx_txn_begin_ex(env, parent, flags, txn, NULL);
3860 }
3861 
3873 
3886 
3893  uint64_t txn_id;
3894 
3899  uint64_t txn_reader_lag;
3900 
3903  uint64_t txn_space_used;
3904 
3907 
3911 
3919 
3926 
3933 };
3934 #ifndef __cplusplus
3936 typedef struct MDBX_txn_info MDBX_txn_info;
3937 #endif
3938 
3953  bool scan_rlt);
3954 
3961 
3972 
3985 mdbx_txn_id(const MDBX_txn *txn);
3986 
3994  uint32_t preparation;
3996  uint32_t gc_wallclock;
3998  uint32_t audit;
4001  uint32_t write;
4004  uint32_t sync;
4006  uint32_t ending;
4008  uint32_t whole;
4010  uint32_t gc_cputime;
4011 
4019  struct {
4022  uint32_t wloops;
4024  uint32_t coalescences;
4027  uint32_t wipes;
4031  uint32_t flushes;
4035  uint32_t kicks;
4036 
4039  uint32_t work_counter;
4042  uint32_t work_rtime_monotonic;
4046  uint32_t work_xtime_cpu;
4049  uint32_t work_rsteps;
4052  uint32_t work_xpages;
4055  uint32_t work_majflt;
4056 
4059  uint32_t self_counter;
4062  uint32_t self_rtime_monotonic;
4066  uint32_t self_xtime_cpu;
4069  uint32_t self_rsteps;
4072  uint32_t self_xpages;
4075  uint32_t self_majflt;
4077 };
4078 #ifndef __cplusplus
4081 #endif
4082 
4089 
4128 inline int mdbx_txn_commit(MDBX_txn * txn) {
4129  return mdbx_txn_commit_ex(txn, NULL);
4130 }
4131 
4166 
4179 
4214 
4236 
4247 struct MDBX_canary {
4248  uint64_t x, y, z, v;
4249 };
4250 #ifndef __cplusplus
4252 typedef struct MDBX_canary MDBX_canary;
4253 #endif
4254 
4274 
4286 
4307 typedef int(MDBX_cmp_func)(const MDBX_val *a,
4308  const MDBX_val *b) MDBX_CXX17_NOEXCEPT;
4309 
4399 LIBMDBX_API int mdbx_dbi_open(MDBX_txn *txn, const char *name,
4400  MDBX_db_flags_t flags, MDBX_dbi *dbi);
4403  MDBX_db_flags_t flags, MDBX_dbi *dbi);
4404 
4420 MDBX_DEPRECATED LIBMDBX_API int
4421 mdbx_dbi_open_ex(MDBX_txn *txn, const char *name, MDBX_db_flags_t flags,
4422  MDBX_dbi *dbi, MDBX_cmp_func *keycmp, MDBX_cmp_func *datacmp);
4424 MDBX_DEPRECATED LIBMDBX_API int
4426  MDBX_dbi *dbi, MDBX_cmp_func *keycmp, MDBX_cmp_func *datacmp);
4427 
4442 LIBMDBX_API int mdbx_dbi_rename(MDBX_txn *txn, MDBX_dbi dbi, const char *name);
4445  const MDBX_val *name);
4446 
4459 mdbx_key_from_jsonInteger(const int64_t json_integer);
4460 
4462 mdbx_key_from_double(const double ieee754_64bit);
4463 
4465 mdbx_key_from_ptrdouble(const double *const ieee754_64bit);
4466 
4468 mdbx_key_from_float(const float ieee754_32bit);
4469 
4471 mdbx_key_from_ptrfloat(const float *const ieee754_32bit);
4472 
4473 MDBX_NOTHROW_CONST_FUNCTION inline uint64_t mdbx_key_from_int64(const int64_t i64) {
4474  return UINT64_C(0x8000000000000000) + i64;
4475 }
4476 
4477 MDBX_NOTHROW_CONST_FUNCTION inline uint32_t mdbx_key_from_int32(const int32_t i32) {
4478  return UINT32_C(0x80000000) + i32;
4479 }
4489 
4492 
4495 
4498 
4518  MDBX_stat *stat, size_t bytes);
4519 
4536  uint32_t *mask);
4537 
4550 };
4551 #ifndef __cplusplus
4553 typedef enum MDBX_dbi_state_t MDBX_dbi_state_t;
4554 #else
4555 DEFINE_ENUM_FLAG_OPERATORS(MDBX_dbi_state_t)
4556 #endif
4557 
4568  unsigned *flags, unsigned *state);
4572 inline int mdbx_dbi_flags(const MDBX_txn *txn, MDBX_dbi dbi, unsigned *flags) {
4573  unsigned state;
4574  return mdbx_dbi_flags_ex(txn, dbi, flags, &state);
4575 }
4576 
4600 
4612 LIBMDBX_API int mdbx_drop(MDBX_txn *txn, MDBX_dbi dbi, bool del);
4613 
4648 LIBMDBX_API int mdbx_get(const MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *key,
4649  MDBX_val *data);
4650 
4682  MDBX_val *data, size_t *values_count);
4683 
4713  MDBX_val *key, MDBX_val *data);
4714 
4796 LIBMDBX_API int mdbx_put(MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *key,
4797  MDBX_val *data, MDBX_put_flags_t flags);
4798 
4843  MDBX_val *new_data, MDBX_val *old_data,
4844  MDBX_put_flags_t flags);
4845 
4846 typedef int (*MDBX_preserve_func)(void *context, MDBX_val *target,
4847  const void *src, size_t bytes);
4849  const MDBX_val *key, MDBX_val *new_data,
4850  MDBX_val *old_data, MDBX_put_flags_t flags,
4851  MDBX_preserve_func preserver,
4852  void *preserver_context);
4853 
4879 LIBMDBX_API int mdbx_del(MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *key,
4880  const MDBX_val *data);
4881 
4905 
4916 
4928 
4955  MDBX_dbi dbi);
4956 
4978 
5010  MDBX_cursor **cursor);
5011 
5027 
5048 
5074 
5081 
5087 
5099 
5122  const MDBX_cursor *right,
5123  bool ignore_multival);
5124 
5157  MDBX_val *data, MDBX_cursor_op op);
5158 
5188 typedef int(MDBX_predicate_func)(void *context, MDBX_val *key, MDBX_val *value,
5189  void *arg) MDBX_CXX17_NOEXCEPT;
5190 
5261  MDBX_predicate_func *predicate, void *context,
5262  MDBX_cursor_op start_op,
5263  MDBX_cursor_op turn_op, void *arg);
5264 
5351  MDBX_predicate_func *predicate,
5352  void *context, MDBX_cursor_op from_op,
5353  MDBX_val *from_key, MDBX_val *from_value,
5354  MDBX_cursor_op turn_op, void *arg);
5355 
5399 LIBMDBX_API int mdbx_cursor_get_batch(MDBX_cursor *cursor, size_t *count,
5400  MDBX_val *pairs, size_t limit,
5401  MDBX_cursor_op op);
5402 
5484  MDBX_val *data, MDBX_put_flags_t flags);
5485 
5517 
5533 LIBMDBX_API int mdbx_cursor_count(const MDBX_cursor *cursor, size_t *pcount);
5534 
5549 
5563 
5577 
5591 
5605 
5651  const MDBX_cursor *last,
5652  ptrdiff_t *distance_items);
5653 
5675  MDBX_val *data, MDBX_cursor_op move_op,
5676  ptrdiff_t *distance_items);
5677 
5703  const MDBX_val *begin_key,
5704  const MDBX_val *begin_data,
5705  const MDBX_val *end_key,
5706  const MDBX_val *end_data,
5707  ptrdiff_t *distance_items);
5708 
5711 #define MDBX_EPSILON ((MDBX_val *)((ptrdiff_t)-1))
5712 
5747  const void *ptr);
5748 
5770 LIBMDBX_API int mdbx_dbi_sequence(MDBX_txn *txn, MDBX_dbi dbi, uint64_t *result,
5771  uint64_t increment);
5772 
5789  MDBX_dbi dbi,
5790  const MDBX_val *a,
5791  const MDBX_val *b);
5792 
5797 
5814  MDBX_dbi dbi,
5815  const MDBX_val *a,
5816  const MDBX_val *b);
5817 
5822 
5848 typedef int(MDBX_reader_list_func)(void *ctx, int num, int slot, mdbx_pid_t pid,
5849  mdbx_tid_t thread, uint64_t txnid,
5850  uint64_t lag, size_t bytes_used,
5851  size_t bytes_retained) MDBX_CXX17_NOEXCEPT;
5852 
5865  MDBX_reader_list_func *func, void *ctx);
5866 
5876 
5889 MDBX_DEPRECATED LIBMDBX_API int mdbx_txn_straggler(const MDBX_txn *txn,
5890  int *percent);
5891 
5911 
5926 
5999 typedef int(MDBX_hsr_func)(const MDBX_env *env, const MDBX_txn *txn,
6000  mdbx_pid_t pid, mdbx_tid_t tid, uint64_t laggard,
6001  unsigned gap, size_t space,
6002  int retry) MDBX_CXX17_NOEXCEPT;
6003 
6022 
6036 
6046 LIBMDBX_API int mdbx_txn_lock(MDBX_env *env, bool dont_wait);
6047 
6052 
6062 LIBMDBX_API int mdbx_env_open_for_recovery(MDBX_env *env, const char *pathname,
6063  unsigned target_meta,
6064  bool writeable);
6065 
6066 #if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
6071  const wchar_t *pathname,
6072  unsigned target_meta,
6073  bool writeable);
6074 #endif /* Windows */
6075 
6081 LIBMDBX_API int mdbx_env_turn_for_recovery(MDBX_env *env, unsigned target_meta);
6082 
6114 LIBMDBX_API int mdbx_preopen_snapinfo(const char *pathname, MDBX_envinfo *info,
6115  size_t bytes);
6116 #if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
6120 LIBMDBX_API int mdbx_preopen_snapinfoW(const wchar_t *pathname,
6121  MDBX_envinfo *info, size_t bytes);
6122 #endif /* Windows */
6123 
6131 
6135 
6138 
6141 
6146 };
6147 #ifndef __cplusplus
6149 typedef enum MDBX_chk_flags_t MDBX_chk_flags_t;
6150 #else
6151 DEFINE_ENUM_FLAG_OPERATORS(MDBX_chk_flags_t)
6152 #endif
6153 
6167  MDBX_chk_info = 0x67u,
6170  MDBX_chk_extra = 0x9Au
6171 };
6172 
6189 };
6190 
6193 typedef struct MDBX_chk_line {
6194  struct MDBX_chk_context *ctx;
6195  uint8_t severity, scope_depth, empty;
6196  char *begin, *end, *out;
6197 } MDBX_chk_line_t;
6198 
6201 typedef struct MDBX_chk_issue {
6202  struct MDBX_chk_issue *next;
6203  size_t count;
6204  const char *caption;
6206 
6209 typedef struct MDBX_chk_scope {
6211  struct MDBX_chk_internal *internal;
6212  const void *object;
6213  enum MDBX_chk_stage stage;
6214  enum MDBX_chk_severity verbosity;
6216  union {
6217  void *ptr;
6218  size_t number;
6219  } usr_z, usr_v, usr_o;
6221 
6225 typedef struct MDBX_chk_user_subdb_cookie MDBX_chk_user_subdb_cookie_t;
6226 
6231  size_t amount, count, ones, pad;
6232  struct {
6233  size_t begin, end, amount, count;
6234  } ranges[9];
6235 };
6236 
6240 typedef struct MDBX_chk_subdb {
6242 
6244 #define MDBX_CHK_MAIN ((void *)((ptrdiff_t)0))
6246 #define MDBX_CHK_GC ((void *)((ptrdiff_t)-1))
6248 #define MDBX_CHK_META ((void *)((ptrdiff_t)-2))
6249 
6252  int id;
6253 
6254  size_t payload_bytes, lost_bytes;
6255  struct {
6256  size_t all, empty, other;
6257  size_t branch, leaf;
6258  size_t nested_branch, nested_leaf, nested_subleaf;
6259  } pages;
6260  struct {
6262  struct MDBX_chk_histogram deep;
6264  struct MDBX_chk_histogram large_pages;
6266  struct MDBX_chk_histogram nested_tree;
6268  struct MDBX_chk_histogram key_len;
6270  struct MDBX_chk_histogram val_len;
6271  } histogram;
6273 
6276 typedef struct MDBX_chk_context {
6277  struct MDBX_chk_internal *internal;
6281  uint8_t scope_nesting;
6282  struct {
6283  size_t total_payload_bytes;
6284  size_t subdb_total, subdb_processed;
6285  size_t total_unused_bytes, unused_pages;
6286  size_t processed_pages, reclaimable_pages, gc_pages, alloc_pages,
6287  backed_pages;
6288  size_t problems_meta, tree_problems, gc_tree_problems, kv_tree_problems,
6289  problems_gc, problems_kv, total_problems;
6290  uint64_t steady_txnid, recent_txnid;
6294  const MDBX_chk_subdb_t *const *subdbs;
6295  } result;
6297 
6313 typedef struct MDBX_chk_callbacks {
6314  bool (*check_break)(MDBX_chk_context_t *ctx);
6315  int (*scope_push)(MDBX_chk_context_t *ctx, MDBX_chk_scope_t *outer,
6316  MDBX_chk_scope_t *inner, const char *fmt, va_list args);
6317  int (*scope_conclude)(MDBX_chk_context_t *ctx, MDBX_chk_scope_t *outer,
6318  MDBX_chk_scope_t *inner, int err);
6319  void (*scope_pop)(MDBX_chk_context_t *ctx, MDBX_chk_scope_t *outer,
6320  MDBX_chk_scope_t *inner);
6321  void (*issue)(MDBX_chk_context_t *ctx, const char *object,
6322  uint64_t entry_number, const char *issue, const char *extra_fmt,
6323  va_list extra_args);
6325  const MDBX_val *name,
6326  MDBX_db_flags_t flags);
6327  int (*subdb_conclude)(MDBX_chk_context_t *ctx, const MDBX_chk_subdb_t *subdb,
6328  MDBX_cursor *cursor, int err);
6329  void (*subdb_dispose)(MDBX_chk_context_t *ctx, const MDBX_chk_subdb_t *subdb);
6330 
6331  int (*subdb_handle_kv)(MDBX_chk_context_t *ctx, const MDBX_chk_subdb_t *subdb,
6332  size_t entry_number, const MDBX_val *key,
6333  const MDBX_val *value);
6334 
6335  int (*stage_begin)(MDBX_chk_context_t *ctx, enum MDBX_chk_stage);
6336  int (*stage_end)(MDBX_chk_context_t *ctx, enum MDBX_chk_stage, int err);
6337 
6338  MDBX_chk_line_t *(*print_begin)(MDBX_chk_context_t *ctx,
6339  enum MDBX_chk_severity severity);
6340  void (*print_flush)(MDBX_chk_line_t *);
6341  void (*print_done)(MDBX_chk_line_t *);
6342  void (*print_chars)(MDBX_chk_line_t *, const char *str, size_t len);
6343  void (*print_format)(MDBX_chk_line_t *, const char *fmt, va_list args);
6344  void (*print_size)(MDBX_chk_line_t *, const char *prefix,
6345  const uint64_t value, const char *suffix);
6347 
6378  MDBX_chk_context_t *ctx,
6379  const enum MDBX_chk_flags_t flags,
6380  enum MDBX_chk_severity verbosity,
6381  unsigned timeout_seconds_16dot16);
6382 
6389 
6394 #ifdef __cplusplus
6395 } /* extern "C" */
6396 #endif
6397 
6398 #endif /* LIBMDBX_H */
#define MDBX_NOTHROW_CONST_FUNCTION
The 'const nothrow' function attribute for optimization.
Definition: mdbx.h:321
#define MDBX_CXX17_NOEXCEPT
Definition: mdbx.h:427
#define MDBX_NOTHROW_PURE_FUNCTION
The 'pure nothrow' function attribute for optimization.
Definition: mdbx.h:270
#define MDBX_NORETURN
Definition: mdbx.h:507
uint64_t mi_mapsize
Definition: mdbx.h:2690
uint64_t txn_space_dirty
Definition: mdbx.h:3932
uint32_t gc_cputime
User-mode CPU time spent on GC update.
Definition: mdbx.h:4010
uint32_t mi_dxb_pagesize
Definition: mdbx.h:2699
uint32_t mi_maxreaders
Definition: mdbx.h:2697
uint64_t v
Definition: mdbx.h:4248
uint32_t mi_numreaders
Definition: mdbx.h:2698
struct MDBX_envinfo::@3 mi_pgop_stat
uint32_t mi_since_sync_seconds16dot16
Definition: mdbx.h:2723
uint64_t txn_reader_lag
Definition: mdbx.h:3899
uint64_t mi_meta_txnid[3]
Definition: mdbx.h:2696
struct MDBX_envinfo::@2 mi_bootid
A mostly unique ID that is regenerated on each boot.
uint64_t txn_space_leftover
Definition: mdbx.h:3925
uint64_t txn_space_used
Definition: mdbx.h:3903
const char * datetime
Definition: mdbx.h:687
uint16_t release
Definition: mdbx.h:672
uint64_t mi_recent_txnid
Definition: mdbx.h:2692
uint64_t mi_autosync_threshold
Definition: mdbx.h:2719
uint64_t ms_branch_pages
Definition: mdbx.h:2638
uint64_t ms_entries
Definition: mdbx.h:2641
uint32_t gc_wallclock
Duration of GC update by wall clock.
Definition: mdbx.h:3996
uint32_t mi_since_reader_check_seconds16dot16
Definition: mdbx.h:2729
uint64_t y
Definition: mdbx.h:4248
uint32_t revision
Definition: mdbx.h:673
uint8_t minor
Definition: mdbx.h:671
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:4004
uint64_t txn_space_limit_soft
Definition: mdbx.h:3906
uint32_t mi_mode
Definition: mdbx.h:2732
const char * options
Definition: mdbx.h:689
uint64_t txn_id
Definition: mdbx.h:3893
const char * sourcery
Definition: mdbx.h:680
uint8_t major
Definition: mdbx.h:670
uint64_t mi_latter_reader_txnid
Definition: mdbx.h:2693
struct MDBX_envinfo::@1 mi_geo
uint64_t ms_overflow_pages
Definition: mdbx.h:2640
uint32_t preparation
Duration of preparation (commit child transactions, update sub-databases records and cursors destroyi...
Definition: mdbx.h:3994
uint64_t z
Definition: mdbx.h:4248
uint64_t txn_space_limit_hard
Definition: mdbx.h:3910
uint32_t whole
The total duration of a commit.
Definition: mdbx.h:4008
const char * flags
Definition: mdbx.h:691
uint64_t mi_meta_sign[3]
Definition: mdbx.h:2696
uint32_t ms_psize
Definition: mdbx.h:2635
uint32_t audit
Duration of internal audit if enabled.
Definition: mdbx.h:3998
const char * target
Definition: mdbx.h:688
uint32_t write
Duration of writing dirty/modified data pages to a filesystem, i.e. the summary duration of a write()...
Definition: mdbx.h:4001
uint64_t txn_space_retired
Definition: mdbx.h:3918
uint32_t ms_depth
Definition: mdbx.h:2637
struct MDBX_version_info::@0 git
uint64_t mi_last_pgno
Definition: mdbx.h:2691
uint32_t ending
Duration of transaction ending (releasing resources).
Definition: mdbx.h:4006
uint64_t ms_mod_txnid
Definition: mdbx.h:2642
struct MDBX_commit_latency::@5 gc_prof
Информация для профилирования работы GC.
uint64_t mi_self_latter_reader_txnid
Definition: mdbx.h:2694
uint64_t ms_leaf_pages
Definition: mdbx.h:2639
uint64_t x
Definition: mdbx.h:4248
uint32_t mi_autosync_period_seconds16dot16
Definition: mdbx.h:2726
uint64_t mi_unsync_volume
Definition: mdbx.h:2717
uint32_t mi_sys_pagesize
Definition: mdbx.h:2700
const char * compiler
Definition: mdbx.h:690
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)
MDBX_constants
Definition: mdbx.h:819
mode_t mdbx_mode_t
Definition: mdbx.h:211
int(* MDBX_preserve_func)(void *context, MDBX_val *target, const void *src, size_t bytes)
Definition: mdbx.h:4846
#define LIBMDBX_API
Definition: mdbx.h:648
LIBMDBX_API const char * mdbx_liberr2str(int errnum)
struct iovec MDBX_val
Generic structure used for passing keys and data in and out of the database. .
Definition: mdbx.h:816
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_API int mdbx_dbi_rename2(MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *name)
Переименовает таблицу по DBI-хендлу.
LIBMDBX_VERINFO_API const struct MDBX_version_info mdbx_version
libmdbx version information
pthread_t mdbx_tid_t
Definition: mdbx.h:210
LIBMDBX_API int mdbx_env_deleteW(const wchar_t *pathname, MDBX_env_delete_mode_t mode)
Delete the environment's files in a proper and multiprocess-safe way.
LIBMDBX_VERINFO_API const struct MDBX_build_info mdbx_build
libmdbx build information
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 database in the environment.
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...
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().
struct MDBX_env MDBX_env
Opaque structure for a database environment.
Definition: mdbx.h:748
int mdbx_filehandle_t
Definition: mdbx.h:208
LIBMDBX_API int mdbx_env_copyW(MDBX_env *env, const wchar_t *dest, MDBX_copy_flags_t flags)
Copy an MDBX environment to the specified path, with options.
pid_t mdbx_pid_t
Definition: mdbx.h:209
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:665
@ MDBX_MAX_PAGESIZE
Definition: mdbx.h:830
@ MDBX_MAXDATASIZE
Definition: mdbx.h:824
@ MDBX_MAX_DBI
Definition: mdbx.h:821
@ MDBX_MIN_PAGESIZE
Definition: mdbx.h:827
libmdbx build information
Definition: mdbx.h:686
The fours integers markers (aka "canary") associated with the environment.
Definition: mdbx.h:4247
Latency of commit stages in 1/65536 of seconds units.
Definition: mdbx.h:3991
Information about the environment.
Definition: mdbx.h:2682
Statistics for a database in the environment.
Definition: mdbx.h:2634
Information about the transaction.
Definition: mdbx.h:3890
libmdbx version information
Definition: mdbx.h:669
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 database.
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 database.
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:5188
MDBX_put_flags_t
Data changing flags.
Definition: mdbx.h:1696
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 database.
Definition: mdbx.h:4307
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 database.
LIBMDBX_API int mdbx_del(MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *key, const MDBX_val *data)
Delete items from a database.
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 database.
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 database 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 database.
LIBMDBX_API int mdbx_drop(MDBX_txn *txn, MDBX_dbi dbi, bool del)
Empty or delete and close a database.
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 database.
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 database.
@ MDBX_MULTIPLE
Definition: mdbx.h:1733
@ MDBX_ALLDUPS
Definition: mdbx.h:1716
@ MDBX_CURRENT
Definition: mdbx.h:1711
@ MDBX_APPENDDUP
Definition: mdbx.h:1729
@ MDBX_NODUPDATA
Definition: mdbx.h:1705
@ MDBX_APPEND
Definition: mdbx.h:1724
@ MDBX_UPSERT
Definition: mdbx.h:1698
@ MDBX_RESERVE
Definition: mdbx.h:1720
@ MDBX_NOOVERWRITE
Definition: mdbx.h:1701
LIBMDBX_API int mdbx_cursor_on_first_dup(const MDBX_cursor *cursor)
Определяет стоит ли курсор на первом или единственном мульти-значении соответствующем ключу.
LIBMDBX_API MDBX_txn * mdbx_cursor_txn(const MDBX_cursor *cursor)
Return the cursor's transaction handle.
LIBMDBX_API MDBX_cursor * mdbx_cursor_create(void *context)
Create a cursor handle but not bind it to transaction nor DBI-handle.
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 void * mdbx_cursor_get_userctx(const MDBX_cursor *cursor)
Get the application information associated with the MDBX_cursor.
LIBMDBX_API MDBX_dbi mdbx_cursor_dbi(const MDBX_cursor *cursor)
Return the cursor's database handle.
MDBX_cursor_op
Cursor operationsThis is the set of all operations for retrieving data using a cursor.
Definition: mdbx.h:1766
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.
struct MDBX_cursor MDBX_cursor
Opaque structure for navigating through a database.
Definition: mdbx.h:778
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_close(MDBX_cursor *cursor)
Close a cursor 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:1842
@ MDBX_GET_CURRENT
Definition: mdbx.h:1781
@ MDBX_GET_BOTH
Definition: mdbx.h:1774
@ MDBX_TO_KEY_EQUAL
Definition: mdbx.h:1861
@ MDBX_GET_BOTH_RANGE
Definition: mdbx.h:1778
@ MDBX_SET_KEY
Definition: mdbx.h:1821
@ MDBX_FIRST_DUP
Definition: mdbx.h:1771
@ MDBX_TO_KEY_LESSER_OR_EQUAL
Definition: mdbx.h:1860
@ MDBX_GET_MULTIPLE
Definition: mdbx.h:1786
@ MDBX_TO_EXACT_KEY_VALUE_GREATER_THAN
Definition: mdbx.h:1871
@ MDBX_NEXT_NODUP
Definition: mdbx.h:1806
@ MDBX_TO_EXACT_KEY_VALUE_LESSER_OR_EQUAL
Definition: mdbx.h:1868
@ MDBX_TO_EXACT_KEY_VALUE_EQUAL
Definition: mdbx.h:1869
@ MDBX_TO_PAIR_LESSER_OR_EQUAL
Definition: mdbx.h:1874
@ MDBX_PREV_MULTIPLE
Definition: mdbx.h:1828
@ MDBX_SET_RANGE
Definition: mdbx.h:1824
@ MDBX_LAST_DUP
Definition: mdbx.h:1792
@ MDBX_PREV
Definition: mdbx.h:1809
@ MDBX_TO_PAIR_GREATER_OR_EQUAL
Definition: mdbx.h:1876
@ MDBX_TO_PAIR_GREATER_THAN
Definition: mdbx.h:1877
@ MDBX_LAST
Definition: mdbx.h:1789
@ MDBX_TO_KEY_LESSER_THAN
Definition: mdbx.h:1859
@ MDBX_PREV_DUP
Definition: mdbx.h:1812
@ MDBX_TO_EXACT_KEY_VALUE_LESSER_THAN
Definition: mdbx.h:1867
@ MDBX_SET
Definition: mdbx.h:1818
@ MDBX_NEXT
Definition: mdbx.h:1795
@ MDBX_TO_KEY_GREATER_OR_EQUAL
Definition: mdbx.h:1862
@ MDBX_TO_PAIR_LESSER_THAN
Definition: mdbx.h:1873
@ MDBX_NEXT_MULTIPLE
Definition: mdbx.h:1803
@ MDBX_PREV_NODUP
Definition: mdbx.h:1815
@ MDBX_TO_PAIR_EQUAL
Definition: mdbx.h:1875
@ MDBX_NEXT_DUP
Definition: mdbx.h:1798
@ MDBX_TO_EXACT_KEY_VALUE_GREATER_OR_EQUAL
Definition: mdbx.h:1870
@ MDBX_SET_UPPERBOUND
Definition: mdbx.h:1856
@ MDBX_TO_KEY_GREATER_THAN
Definition: mdbx.h:1863
@ MDBX_FIRST
Definition: mdbx.h:1768
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)
LIBMDBX_API int mdbx_dbi_rename(MDBX_txn *txn, MDBX_dbi dbi, const char *name)
Переименовает таблицу по DBI-хендлу.
LIBMDBX_API int mdbx_dbi_close(MDBX_env *env, MDBX_dbi dbi)
Close a database 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 database in the environment.
uint32_t MDBX_dbi
A handle for an individual database (key-value spaces) in the environment.
Definition: mdbx.h:771
MDBX_db_flags_t
Database flags.
Definition: mdbx.h:1641
@ MDBX_INTEGERDUP
Definition: mdbx.h:1665
@ MDBX_DB_ACCEDE
Definition: mdbx.h:1683
@ MDBX_DB_DEFAULTS
Definition: mdbx.h:1643
@ MDBX_REVERSEKEY
Definition: mdbx.h:1646
@ MDBX_DUPFIXED
Definition: mdbx.h:1660
@ MDBX_INTEGERKEY
Definition: mdbx.h:1656
@ MDBX_REVERSEDUP
Definition: mdbx.h:1668
@ MDBX_CREATE
Definition: mdbx.h:1671
@ MDBX_DUPSORT
Definition: mdbx.h:1649
MDBX_NORETURN LIBMDBX_API void mdbx_panic(const char *fmt,...) MDBX_PRINTF_ARGS(1
Panics with message and causes abnormal process termination.
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.
void MDBX_debug_func_nofmt(MDBX_log_level_t loglevel, const char *function, int line, const char *msg, unsigned length) noexcept
Definition: mdbx.h:1025
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:1046
MDBX_log_level_t
Definition: mdbx.h:891
MDBX_debug_flags_t
Runtime debug flags.
Definition: mdbx.h:951
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:1010
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:933
@ MDBX_LOG_WARN
Definition: mdbx.h:907
@ MDBX_LOG_TRACE
Definition: mdbx.h:928
@ MDBX_LOG_DEBUG
Definition: mdbx.h:923
@ MDBX_LOG_FATAL
Definition: mdbx.h:895
@ MDBX_LOG_ERROR
Definition: mdbx.h:901
@ MDBX_LOG_NOTICE
Definition: mdbx.h:913
@ MDBX_LOG_DONTCHANGE
Definition: mdbx.h:940
@ MDBX_LOG_VERBOSE
Definition: mdbx.h:918
@ MDBX_DBG_ASSERT
Definition: mdbx.h:957
@ MDBX_DBG_DONT_UPGRADE
Definition: mdbx.h:980
@ MDBX_DBG_LEGACY_OVERLAP
Definition: mdbx.h:975
@ MDBX_DBG_LEGACY_MULTIOPEN
Definition: mdbx.h:972
@ MDBX_DBG_NONE
Definition: mdbx.h:952
@ MDBX_DBG_DUMP
Definition: mdbx.h:969
@ MDBX_DBG_DONTCHANGE
Definition: mdbx.h:988
@ MDBX_DBG_AUDIT
Definition: mdbx.h:961
@ MDBX_DBG_JITTER
Definition: mdbx.h:965
LIBMDBX_API const char * mdbx_strerror_ANSI2OEM(int errnum)
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:5999
LIBMDBX_API const char * mdbx_strerror(int errnum)
Return a string describing a given error code.
LIBMDBX_API const char * mdbx_strerror_r(int errnum, char *buf, size_t buflen)
Return a string describing a given error code.
MDBX_error_t
Errors and return codes.
Definition: mdbx.h:1889
LIBMDBX_API const char * mdbx_strerror_r_ANSI2OEM(int errnum, char *buf, size_t buflen)
@ MDBX_PANIC
Definition: mdbx.h:1916
@ MDBX_FIRST_LMDB_ERRCODE
Definition: mdbx.h:1903
@ MDBX_EKEYMISMATCH
Definition: mdbx.h:2005
@ MDBX_UNABLE_EXTEND_MAPSIZE
Definition: mdbx.h:1950
@ MDBX_EACCESS
Definition: mdbx.h:2054
@ MDBX_EIO
Definition: mdbx.h:2058
@ MDBX_PAGE_NOTFOUND
Definition: mdbx.h:1909
@ MDBX_TXN_FULL
Definition: mdbx.h:1934
@ MDBX_DUPLICATED_CLK
Definition: mdbx.h:2025
@ MDBX_VERSION_MISMATCH
Definition: mdbx.h:1919
@ MDBX_WANNA_RECOVERY
Definition: mdbx.h:2002
@ MDBX_TXN_OVERLAPPING
Definition: mdbx.h:2016
@ MDBX_EREMOTE
Definition: mdbx.h:2062
@ MDBX_TOO_LARGE
Definition: mdbx.h:2009
@ MDBX_EBADSIGN
Definition: mdbx.h:1998
@ MDBX_CURSOR_FULL
Definition: mdbx.h:1938
@ MDBX_ENOFILE
Definition: mdbx.h:2061
@ MDBX_BAD_TXN
Definition: mdbx.h:1969
@ MDBX_ENODATA
Definition: mdbx.h:2051
@ MDBX_LAST_LMDB_ERRCODE
Definition: mdbx.h:1983
@ MDBX_CORRUPTED
Definition: mdbx.h:1912
@ MDBX_EPERM
Definition: mdbx.h:2059
@ MDBX_THREAD_MISMATCH
Definition: mdbx.h:2013
@ MDBX_BACKLOG_DEPLETED
Definition: mdbx.h:2022
@ MDBX_SUCCESS
Definition: mdbx.h:1891
@ MDBX_NOTFOUND
Definition: mdbx.h:1906
@ MDBX_RESULT_TRUE
Definition: mdbx.h:1897
@ MDBX_INVALID
Definition: mdbx.h:1922
@ MDBX_BAD_VALSIZE
Definition: mdbx.h:1973
@ MDBX_BUSY
Definition: mdbx.h:1987
@ MDBX_DBS_FULL
Definition: mdbx.h:1928
@ MDBX_EINVAL
Definition: mdbx.h:2053
@ MDBX_BAD_RSLOT
Definition: mdbx.h:1964
@ MDBX_ENOMEM
Definition: mdbx.h:2055
@ MDBX_FIRST_ADDED_ERRCODE
Definition: mdbx.h:1990
@ MDBX_RESULT_FALSE
Definition: mdbx.h:1894
@ MDBX_EINTR
Definition: mdbx.h:2060
@ MDBX_READERS_FULL
Definition: mdbx.h:1931
@ MDBX_LAST_ADDED_ERRCODE
Definition: mdbx.h:2032
@ MDBX_BAD_DBI
Definition: mdbx.h:1977
@ MDBX_KEYEXIST
Definition: mdbx.h:1900
@ MDBX_DANGLING_DBI
Definition: mdbx.h:2029
@ MDBX_EDEADLK
Definition: mdbx.h:2063
@ MDBX_PAGE_FULL
Definition: mdbx.h:1941
@ MDBX_MAP_FULL
Definition: mdbx.h:1925
@ MDBX_PROBLEM
Definition: mdbx.h:1980
@ MDBX_ENOSYS
Definition: mdbx.h:2057
@ MDBX_EMULTIVAL
Definition: mdbx.h:1993
@ MDBX_EROFS
Definition: mdbx.h:2056
@ MDBX_INCOMPATIBLE
Definition: mdbx.h:1960
LIBMDBX_API int mdbx_reader_check(MDBX_env *env, int *dead)
Check for stale entries in the reader lock table.
LIBMDBX_API int mdbx_env_copy(MDBX_env *env, const char *dest, MDBX_copy_flags_t flags)
Copy an MDBX environment to the specified path, with options.
MDBX_copy_flags_t
Environment copy flags.
Definition: mdbx.h:1745
int mdbx_env_sync(MDBX_env *env)
The shortcut to calling mdbx_env_sync_ex() with the force=true and nonblock=false arguments.
Definition: mdbx.h:2834
LIBMDBX_API int mdbx_is_readahead_reasonable(size_t volume, intptr_t redundancy)
Find out whether to use readahead or not, based on the given database size and the amount of availabl...
LIBMDBX_API int mdbx_thread_register(const MDBX_env *env)
Registers the current thread as a reader for the environment.
int mdbx_env_sync_poll(MDBX_env *env)
The shortcut to calling mdbx_env_sync_ex() with the force=false and nonblock=true arguments.
Definition: mdbx.h:2841
LIBMDBX_API MDBX_cmp_func * mdbx_get_keycmp(MDBX_db_flags_t flags)
Returns default internal key's comparator for given database flags.
LIBMDBX_API int mdbx_env_resurrect_after_fork(MDBX_env *env)
Восстанавливает экземпляр среды в дочернем процессе после ветвления родительского процесса посредство...
LIBMDBX_API MDBX_cmp_func * mdbx_get_datacmp(MDBX_db_flags_t flags)
Returns default internal data's comparator for given database flags.
MDBX_env_delete_mode_t
Deletion modes for mdbx_env_delete().
Definition: mdbx.h:2511
LIBMDBX_API int mdbx_env_copy2fd(MDBX_env *env, mdbx_filehandle_t fd, MDBX_copy_flags_t flags)
Copy an environment to the specified file descriptor, with options.
LIBMDBX_API int mdbx_thread_unregister(const MDBX_env *env)
Unregisters the current thread as a reader for the environment.
LIBMDBX_API int mdbx_env_sync_ex(MDBX_env *env, bool force, bool nonblock)
Flush the environment data buffers to disk.
LIBMDBX_API int mdbx_env_delete(const char *pathname, MDBX_env_delete_mode_t mode)
Delete the environment's files in a proper and multiprocess-safe way.
@ MDBX_CP_DEFAULTS
Definition: mdbx.h:1746
@ MDBX_CP_COMPACT
Definition: mdbx.h:1750
@ MDBX_CP_FORCE_DYNAMIC_SIZE
Definition: mdbx.h:1753
@ MDBX_ENV_WAIT_FOR_UNUSED
Wait until other processes closes the environment before deletion.
Definition: mdbx.h:2524
@ MDBX_ENV_JUST_DELETE
Just delete the environment's files and directory if any.
Definition: mdbx.h:2518
@ MDBX_ENV_ENSURE_UNUSED
Make sure that the environment is not being used by other processes, or return an error otherwise.
Definition: mdbx.h:2521
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:3006
MDBX_env_flags_t
Environment flags.
Definition: mdbx.h:1089
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_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:1305
@ MDBX_ENV_DEFAULTS
Definition: mdbx.h:1090
@ MDBX_COALESCE
Definition: mdbx.h:1342
@ MDBX_NOMETASYNC
Definition: mdbx.h:1442
@ MDBX_LIFORECLAIM
Definition: mdbx.h:1367
@ MDBX_SAFE_NOSYNC
Definition: mdbx.h:1493
@ MDBX_NOTLS
Definition: mdbx.h:1283
@ MDBX_SYNC_DURABLE
Definition: mdbx.h:1424
@ MDBX_PAGEPERTURB
Definition: mdbx.h:1370
@ MDBX_WRITEMAP
Definition: mdbx.h:1209
@ MDBX_NOSTICKYTHREADS
Definition: mdbx.h:1280
@ MDBX_EXCLUSIVE
Definition: mdbx.h:1163
@ MDBX_NOMEMINIT
Definition: mdbx.h:1328
@ MDBX_MAPASYNC
Definition: mdbx.h:1500
@ MDBX_ACCEDE
Definition: mdbx.h:1178
@ MDBX_NOSUBDIR
Definition: mdbx.h:1115
@ MDBX_RDONLY
Definition: mdbx.h:1133
@ MDBX_UTTERLY_NOSYNC
Definition: mdbx.h:1543
@ MDBX_VALIDATION
Definition: mdbx.h:1097
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:3453
int mdbx_env_set_maxdbs(MDBX_env *env, MDBX_dbi dbs)
Set the maximum number of named databases for the environment.
Definition: mdbx.h:3615
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:2929
MDBX_option_t
MDBX environment extra runtime options.
Definition: mdbx.h:2161
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:2868
MDBX_warmup_flags_t
Warming up options.
Definition: mdbx.h:3094
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:3569
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:2265
@ MDBX_opt_txn_dp_limit
Controls the in-process limit of dirty pages for a write transaction.
Definition: mdbx.h:2261
@ 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:2364
@ MDBX_opt_max_db
Controls the maximum number of named databases for the environment.
Definition: mdbx.h:2170
@ MDBX_opt_merge_threshold_16dot16_percent
Controls the in-process threshold of semi-empty pages merge.
Definition: mdbx.h:2331
@ MDBX_opt_sync_bytes
Controls interprocess/shared threshold to force flush the data buffers to disk, if MDBX_SAFE_NOSYNC i...
Definition: mdbx.h:2193
@ MDBX_opt_spill_min_denominator
Controls the in-process how minimal part of the dirty pages should be spilled when necessary.
Definition: mdbx.h:2297
@ 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:2320
@ 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:2233
@ 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:2220
@ MDBX_opt_max_readers
Defines the maximum number of threads/reader slots for all processes interacting with the database.
Definition: mdbx.h:2187
@ MDBX_opt_spill_max_denominator
Controls the in-process how maximal part of the dirty pages may be spilled when necessary.
Definition: mdbx.h:2281
@ MDBX_opt_sync_period
Controls interprocess/shared relative period since the last unsteady commit to force flush the data b...
Definition: mdbx.h:2199
@ MDBX_opt_dp_reserve_limit
Controls the in-process limit of a pre-allocated memory items for dirty pages.
Definition: mdbx.h:2247
@ MDBX_opt_writethrough_threshold
Controls the choosing between use write-through disk writes and usual ones with followed flush by the...
Definition: mdbx.h:2359
@ MDBX_opt_gc_time_limit
Controls the in-process spending time limit of searching consecutive pages inside GC.
Definition: mdbx.h:2391
@ MDBX_warmup_touchlimit
Definition: mdbx.h:3133
@ MDBX_warmup_force
Definition: mdbx.h:3103
@ MDBX_warmup_oomsafe
Definition: mdbx.h:3110
@ MDBX_warmup_release
Definition: mdbx.h:3136
@ MDBX_warmup_lock
Definition: mdbx.h:3125
@ MDBX_warmup_default
Definition: mdbx.h:3097
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 database.
LIBMDBX_API intptr_t mdbx_limits_keysize_min(MDBX_db_flags_t flags)
Returns minimal key size in bytes for given database 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 database flags, or -1 if pagesize is inval...
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:3584
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:2949
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:4572
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 database flags.
LIBMDBX_API intptr_t mdbx_limits_valsize_min(MDBX_db_flags_t flags)
Returns minimal data size in bytes for given database flags.
int mdbx_env_info(const MDBX_env *env, MDBX_envinfo *info, size_t bytes)
Return information about the MDBX environment.
Definition: mdbx.h:2788
LIBMDBX_API void * mdbx_env_get_userctx(const MDBX_env *env)
Returns an application information (a context pointer) associated with the environment.
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:2886
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 overflow/large-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:3483
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 database.
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:4541
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 overflow/large-page for specified ...
intptr_t mdbx_limits_pgsize_min(void)
Returns the minimal database page size in bytes.
Definition: mdbx.h:3477
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.
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:5848
int mdbx_env_get_maxdbs(const MDBX_env *env, MDBX_dbi *dbs)
Get the maximum number of named databases for the environment.
Definition: mdbx.h:3629
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 database flags, or -1 if pagesize is invali...
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:2674
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 database 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 database handle.
@ MDBX_DBI_DIRTY
Definition: mdbx.h:4543
@ MDBX_DBI_FRESH
Definition: mdbx.h:4547
@ MDBX_DBI_STALE
Definition: mdbx.h:4545
@ MDBX_DBI_CREAT
Definition: mdbx.h:4549
LIBMDBX_API int mdbx_txn_break(MDBX_txn *txn)
Marks transaction as broken.
LIBMDBX_API void * mdbx_txn_get_userctx(const MDBX_txn *txn)
Returns an application information (a context pointer) associated with the transaction.
LIBMDBX_API int mdbx_txn_set_userctx(MDBX_txn *txn, void *ctx)
Sets application information associated (a context pointer) with the transaction.
LIBMDBX_API MDBX_env * mdbx_txn_env(const MDBX_txn *txn)
Returns the transaction's MDBX_env.
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:4128
LIBMDBX_API int mdbx_txn_flags(const MDBX_txn *txn)
Return the transaction's flags.
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.
MDBX_txn_flags_t
Definition: mdbx.h:1558
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:3857
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:759
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.
@ MDBX_TXN_RDONLY
Definition: mdbx.h:1569
@ MDBX_TXN_ERROR
Definition: mdbx.h:1609
@ MDBX_TXN_NOMETASYNC
Definition: mdbx.h:1588
@ MDBX_TXN_SPILLS
Definition: mdbx.h:1619
@ MDBX_TXN_HAS_CHILD
Definition: mdbx.h:1624
@ MDBX_TXN_RDONLY_PREPARE
Definition: mdbx.h:1578
@ MDBX_TXN_INVALID
Definition: mdbx.h:1599
@ MDBX_TXN_BLOCKED
Definition: mdbx.h:1629
@ MDBX_TXN_NOSYNC
Definition: mdbx.h:1592
@ MDBX_TXN_DIRTY
Definition: mdbx.h:1614
@ MDBX_TXN_READWRITE
Definition: mdbx.h:1563
@ MDBX_TXN_TRY
Definition: mdbx.h:1584
@ MDBX_TXN_FINISHED
Definition: mdbx.h:1604
MDBX_txn * txn
Definition: mdbx.h:6279
MDBX_chk_user_subdb_cookie_t * cookie
Definition: mdbx.h:6241
size_t pad
Definition: mdbx.h:6231
size_t lost_bytes
Definition: mdbx.h:6254
uint8_t scope_nesting
Definition: mdbx.h:6281
struct MDBX_chk_histogram::@7 ranges[9]
size_t ones
Definition: mdbx.h:6231
char * begin
Definition: mdbx.h:6196
size_t subtotal_issues
Definition: mdbx.h:6215
struct MDBX_chk_context * ctx
Definition: mdbx.h:6194
MDBX_val name
Definition: mdbx.h:6250
struct MDBX_chk_issue * next
Definition: mdbx.h:6202
const void * object
Definition: mdbx.h:6212
size_t count
Definition: mdbx.h:6231
const char * caption
Definition: mdbx.h:6204
int id
Definition: mdbx.h:6252
MDBX_env * env
Definition: mdbx.h:6278
uint8_t empty
Definition: mdbx.h:6195
size_t amount
Definition: mdbx.h:6231
MDBX_chk_scope_t * scope
Definition: mdbx.h:6280
MDBX_chk_issue_t * issues
Definition: mdbx.h:6210
size_t count
Definition: mdbx.h:6203
MDBX_db_flags_t flags
Definition: mdbx.h:6251
LIBMDBX_API int mdbx_env_chk_encount_problem(MDBX_chk_context_t *ctx)
Вспомогательная функция для подсчета проблем детектируемых приложением, в том числе,...
MDBX_chk_stage
Стадии проверки, сообщаемые через обратные вызовы при проверке целостности базы данных.
Definition: mdbx.h:6176
LIBMDBX_API int mdbx_txn_unlock(MDBX_env *env)
Releases write-transaction lock. Provided for custom and/or complex locking scenarios.
MDBX_chk_flags_t
Флаги/опции для проверки целостности базы данных.
Definition: mdbx.h:6128
LIBMDBX_API int mdbx_env_chk(MDBX_env *env, const MDBX_chk_callbacks_t *cb, MDBX_chk_context_t *ctx, const enum MDBX_chk_flags_t flags, enum MDBX_chk_severity verbosity, unsigned timeout_seconds_16dot16)
Проверяет целостность базы данных.
struct MDBX_chk_user_subdb_cookie MDBX_chk_user_subdb_cookie_t
Пользовательский тип для привязки дополнительных данных, связанных с некоторой таблицей ключ-значение...
Definition: mdbx.h:6225
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_preopen_snapinfoW(const wchar_t *pathname, MDBX_envinfo *info, size_t bytes)
Получает базовую информацию о БД не открывая её.
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_severity
Уровни логирование/детализации информации, поставляемой через обратные вызовы при проверке целостност...
Definition: mdbx.h:6157
LIBMDBX_API int mdbx_env_open_for_recoveryW(MDBX_env *env, const wchar_t *pathname, unsigned target_meta, bool writeable)
Open an environment instance using specific meta-page for checking and recovery.
@ MDBX_chk_traversal_subdbs
Definition: mdbx.h:6185
@ MDBX_chk_init
Definition: mdbx.h:6178
@ MDBX_chk_finalize
Definition: mdbx.h:6188
@ MDBX_chk_space
Definition: mdbx.h:6183
@ MDBX_chk_traversal_maindb
Definition: mdbx.h:6184
@ MDBX_chk_traversal_tree
Definition: mdbx.h:6181
@ MDBX_chk_traversal_freedb
Definition: mdbx.h:6182
@ MDBX_chk_lock
Definition: mdbx.h:6179
@ MDBX_chk_none
Definition: mdbx.h:6177
@ MDBX_chk_unlock
Definition: mdbx.h:6187
@ MDBX_chk_meta
Definition: mdbx.h:6180
@ MDBX_chk_conclude
Definition: mdbx.h:6186
@ MDBX_CHK_SKIP_BTREE_TRAVERSAL
Definition: mdbx.h:6137
@ MDBX_CHK_READWRITE
Definition: mdbx.h:6134
@ MDBX_CHK_DEFAULTS
Definition: mdbx.h:6130
@ MDBX_CHK_SKIP_KV_TRAVERSAL
Definition: mdbx.h:6140
@ MDBX_CHK_IGNORE_ORDER
Definition: mdbx.h:6145
@ MDBX_chk_processing
Definition: mdbx.h:6166
@ MDBX_chk_result
Definition: mdbx.h:6164
@ MDBX_chk_details
Definition: mdbx.h:6169
@ MDBX_chk_extra
Definition: mdbx.h:6170
@ MDBX_chk_severity_prio_shift
Definition: mdbx.h:6158
@ MDBX_chk_severity_kind_mask
Definition: mdbx.h:6159
@ MDBX_chk_notice
Definition: mdbx.h:6163
@ MDBX_chk_resolution
Definition: mdbx.h:6165
@ MDBX_chk_warning
Definition: mdbx.h:6162
@ MDBX_chk_fatal
Definition: mdbx.h:6160
@ MDBX_chk_info
Definition: mdbx.h:6167
@ MDBX_chk_error
Definition: mdbx.h:6161
@ MDBX_chk_verbose
Definition: mdbx.h:6168
Набор функций обратного вызова используемых при проверке целостности базы данных.
Definition: mdbx.h:6313
Контекст проверки целостности базы данных.
Definition: mdbx.h:6276
Гистограмма с некоторой статистической информацией, собираемой при проверке целостности БД.
Definition: mdbx.h:6230
Проблема обнаруженная при проверке целостности базы данных.
Definition: mdbx.h:6201
Виртуальная строка отчета, формируемого при проверке целостности базы данных.
Definition: mdbx.h:6193
Иерархический контекст при проверке целостности базы данных.
Definition: mdbx.h:6209
Информация о некоторой таблицей ключ-значение, при проверке целостности базы данных.
Definition: mdbx.h:6240
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:4473
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:4477
LIBMDBX_API uint64_t mdbx_key_from_jsonInteger(const int64_t json_integer)