libmdbx 0.13.1.73 (2024-11-15T15:58:48+03:00)
One of the fastest compact embeddable key-value ACID database without WAL.
 
Loading...
Searching...
No Matches
mdbx.h
Go to the documentation of this file.
1
37#pragma once
38#ifndef LIBMDBX_H
39#define LIBMDBX_H
40
41#if defined(__riscv) || defined(__riscv__) || defined(__RISCV) || \
42 defined(__RISCV__)
43#warning "The RISC-V architecture is intentionally insecure by design. \
44 Please delete this admonition at your own risk, \
45 if you make such decision informed and consciously. \
46 Refer to https://clck.ru/32d9xH for more information."
47#endif /* RISC-V */
48
49#ifdef _MSC_VER
50#pragma warning(push, 1)
51#pragma warning(disable : 4548) /* expression before comma has no effect; \
52 expected expression with side - effect */
53#pragma warning(disable : 4530) /* C++ exception handler used, but unwind \
54 * semantics are not enabled. Specify /EHsc */
55#pragma warning(disable : 4577) /* 'noexcept' used with no exception handling \
56 * mode specified; termination on exception is \
57 * not guaranteed. Specify /EHsc */
58#endif /* _MSC_VER (warnings) */
59
60/* *INDENT-OFF* */
61/* clang-format off */
144/* *INDENT-ON* */
145/* clang-format on */
146
147#include <stdarg.h>
148#include <stddef.h>
149#include <stdint.h>
150#if !defined(NDEBUG) && !defined(assert)
151#include <assert.h>
152#endif /* NDEBUG */
153
154#if defined(_WIN32) || defined(_WIN64)
155#include <windows.h>
156#include <winnt.h>
157#ifndef __mode_t_defined
158typedef unsigned short mdbx_mode_t;
159#else
160typedef mode_t mdbx_mode_t;
161#endif /* __mode_t_defined */
162typedef HANDLE mdbx_filehandle_t;
163typedef DWORD mdbx_pid_t;
164typedef DWORD mdbx_tid_t;
165#else /* Windows */
166#include <errno.h> /* for error codes */
167#include <pthread.h> /* for pthread_t */
168#include <sys/types.h> /* for pid_t */
169#include <sys/uio.h> /* for struct iovec */
170#define HAVE_STRUCT_IOVEC 1
172typedef pid_t mdbx_pid_t;
173typedef pthread_t mdbx_tid_t;
174typedef mode_t mdbx_mode_t;
175#endif /* !Windows */
176
177#ifdef _MSC_VER
178#pragma warning(pop)
179#endif
180
186/*----------------------------------------------------------------------------*/
187
188#ifndef __has_attribute
189#define __has_attribute(x) (0)
190#endif /* __has_attribute */
191
192#ifndef __has_c_attribute
193#define __has_c_attribute(x) (0)
194#endif /* __has_c_attribute */
195
196#ifndef __has_cpp_attribute
197#define __has_cpp_attribute(x) 0
198#endif /* __has_cpp_attribute */
199
200#ifndef __has_CXX_attribute
201#if defined(__cplusplus) && \
202 (!defined(_MSC_VER) || defined(__clang__) || _MSC_VER >= 1942)
203#define __has_CXX_attribute(x) __has_cpp_attribute(x)
204#else
205#define __has_CXX_attribute(x) 0
206#endif
207#endif /* __has_CXX_attribute */
208
209#ifndef __has_C23_or_CXX_attribute
210#if defined(__cplusplus)
211#define __has_C23_or_CXX_attribute(x) __has_CXX_attribute(x)
212#elif defined(__STDC_VERSION__) && __STDC_VERSION__ > 202311L
213#define __has_C23_or_CXX_attribute(x) __has_c_attribute(x)
214#else
215#define __has_C23_or_CXX_attribute(x) 0
216#endif
217#endif /* __has_C23_or_CXX_attribute */
218
219#ifndef __has_feature
220#define __has_feature(x) (0)
221#define __has_exceptions_disabled (0)
222#else
223#define __has_exceptions_disabled \
224 (__has_feature(cxx_noexcept) && !__has_feature(cxx_exceptions))
225#endif /* __has_feature */
226
227#ifndef __has_extension
228#define __has_extension(x) __has_feature(x)
229#endif /* __has_extension */
230
231#ifndef __has_builtin
232#define __has_builtin(x) (0)
233#endif /* __has_builtin */
234
241#if defined(DOXYGEN)
242#define MDBX_PURE_FUNCTION [[gnu::pure]]
243#elif __has_C23_or_CXX_attribute(gnu::pure) && \
244 (!defined(__apple_build_version__) || !defined(__clang_major__) || \
245 __clang_major__ > 17)
246#define MDBX_PURE_FUNCTION [[gnu::pure]]
247#elif (defined(__GNUC__) || __has_attribute(__pure__)) && \
248 (!defined(__clang__) /* https://bugs.llvm.org/show_bug.cgi?id=43275 */ || \
249 !defined(__cplusplus) || __has_exceptions_disabled)
250#define MDBX_PURE_FUNCTION __attribute__((__pure__))
251#else
252#define MDBX_PURE_FUNCTION
253#endif /* MDBX_PURE_FUNCTION */
254
258#if defined(DOXYGEN)
259#define MDBX_NOTHROW_PURE_FUNCTION [[gnu::pure, gnu::nothrow]]
260#elif __has_C23_or_CXX_attribute(gnu::pure)
261#if __has_C23_or_CXX_attribute(gnu::nothrow)
262#define MDBX_NOTHROW_PURE_FUNCTION [[gnu::pure, gnu::nothrow]]
263#else
264#define MDBX_NOTHROW_PURE_FUNCTION [[gnu::pure]]
265#endif
266#elif defined(__GNUC__) || \
267 (__has_attribute(__pure__) && __has_attribute(__nothrow__))
268#define MDBX_NOTHROW_PURE_FUNCTION __attribute__((__pure__, __nothrow__))
269#elif __has_CXX_attribute(pure)
270#define MDBX_NOTHROW_PURE_FUNCTION [[pure]]
271#else
272#define MDBX_NOTHROW_PURE_FUNCTION
273#endif /* MDBX_NOTHROW_PURE_FUNCTION */
274
285#if defined(DOXYGEN)
286#define MDBX_CONST_FUNCTION [[gnu::const]]
287#elif __has_C23_or_CXX_attribute(gnu::const) && \
288 (!defined(__apple_build_version__) || !defined(__clang_major__) || \
289 __clang_major__ > 17)
290#define MDBX_CONST_FUNCTION [[gnu::const]]
291#elif (defined(__GNUC__) || __has_attribute(__const__)) && \
292 (!defined(__clang__) /* https://bugs.llvm.org/show_bug.cgi?id=43275 */ || \
293 !defined(__cplusplus) || __has_exceptions_disabled)
294#define MDBX_CONST_FUNCTION __attribute__((__const__))
295#else
296#define MDBX_CONST_FUNCTION MDBX_PURE_FUNCTION
297#endif /* MDBX_CONST_FUNCTION */
298
302#if defined(DOXYGEN)
303#define MDBX_NOTHROW_CONST_FUNCTION [[gnu::const, gnu::nothrow]]
304#elif __has_C23_or_CXX_attribute(gnu::const)
305#if __has_C23_or_CXX_attribute(gnu::nothrow)
306#define MDBX_NOTHROW_CONST_FUNCTION [[gnu::const, gnu::nothrow]]
307#else
308#define MDBX_NOTHROW_CONST_FUNCTION [[gnu::const]]
309#endif
310#elif defined(__GNUC__) || \
311 (__has_attribute(__const__) && __has_attribute(__nothrow__))
312#define MDBX_NOTHROW_CONST_FUNCTION __attribute__((__const__, __nothrow__))
313#elif __has_CXX_attribute(const)
314#define MDBX_NOTHROW_CONST_FUNCTION [[const]]
315#else
316#define MDBX_NOTHROW_CONST_FUNCTION MDBX_NOTHROW_PURE_FUNCTION
317#endif /* MDBX_NOTHROW_CONST_FUNCTION */
318
322#ifndef MDBX_DEPRECATED
323#ifdef __deprecated
324#define MDBX_DEPRECATED __deprecated
325#elif defined(DOXYGEN) || \
326 ((!defined(__GNUC__) || defined(__clang__) || __GNUC__ > 5) && \
327 ((defined(__cplusplus) && __cplusplus >= 201403L && \
328 __has_cpp_attribute(deprecated) && \
329 __has_cpp_attribute(deprecated) >= 201309L) || \
330 (!defined(__cplusplus) && defined(__STDC_VERSION__) && \
331 __STDC_VERSION__ >= 202304L)))
332#define MDBX_DEPRECATED [[deprecated]]
333#elif (defined(__GNUC__) && __GNUC__ > 5) || \
334 (__has_attribute(__deprecated__) && \
335 (!defined(__GNUC__) || defined(__clang__) || __GNUC__ > 5))
336#define MDBX_DEPRECATED __attribute__((__deprecated__))
337#elif defined(_MSC_VER)
338#define MDBX_DEPRECATED __declspec(deprecated)
339#else
340#define MDBX_DEPRECATED
341#endif
342#endif /* MDBX_DEPRECATED */
343
344#ifndef MDBX_DEPRECATED_ENUM
345#if !defined(DOXYGEN) && \
346 (!defined(_MSC_VER) || (defined(__cplusplus) && __cplusplus >= 201403L && \
347 __has_cpp_attribute(deprecated) && \
348 __has_cpp_attribute(deprecated) >= 201309L))
349#define MDBX_DEPRECATED_ENUM MDBX_DEPRECATED
350#else
351#define MDBX_DEPRECATED_ENUM /* avoid madness MSVC */
352#endif
353#endif /* MDBX_DEPRECATED_ENUM */
354
355#ifndef __dll_export
356#if defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__) || \
357 defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)
358#if defined(__GNUC__) || __has_attribute(__dllexport__)
359#define __dll_export __attribute__((__dllexport__))
360#elif defined(_MSC_VER)
361#define __dll_export __declspec(dllexport)
362#else
363#define __dll_export
364#endif
365#elif defined(__GNUC__) || __has_attribute(__visibility__)
366#define __dll_export __attribute__((__visibility__("default")))
367#else
368#define __dll_export
369#endif
370#endif /* __dll_export */
371
372#ifndef __dll_import
373#if defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__) || \
374 defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)
375#if defined(__GNUC__) || __has_attribute(__dllimport__)
376#define __dll_import __attribute__((__dllimport__))
377#elif defined(_MSC_VER)
378#define __dll_import __declspec(dllimport)
379#else
380#define __dll_import
381#endif
382#else
383#define __dll_import
384#endif
385#endif /* __dll_import */
386
391#if defined(LIBMDBX_INTERNALS) && !defined(LIBMDBX_NO_EXPORTS_LEGACY_API)
392#define LIBMDBX_INLINE_API(TYPE, NAME, ARGS) \
393 /* proto of exported which uses common impl */ LIBMDBX_API TYPE NAME ARGS; \
394 /* definition of common impl */ static __inline TYPE __inline_##NAME ARGS
395#else
396#define LIBMDBX_INLINE_API(TYPE, NAME, ARGS) static __inline TYPE NAME ARGS
397#endif /* LIBMDBX_INLINE_API */
398
400#ifndef MDBX_STRINGIFY
401#define MDBX_STRINGIFY_HELPER(x) #x
402#define MDBX_STRINGIFY(x) MDBX_STRINGIFY_HELPER(x)
403#endif /* MDBX_STRINGIFY */
404
405/*----------------------------------------------------------------------------*/
406
407#ifndef __cplusplus
408#ifndef bool
409#define bool _Bool
410#endif
411#ifndef true
412#define true (1)
413#endif
414#ifndef false
415#define false (0)
416#endif
417#endif /* bool without __cplusplus */
418
420#if defined(DOXYGEN)
421#define MDBX_CXX17_NOEXCEPT noexcept
422#elif !defined(__cpp_noexcept_function_type) || \
423 __cpp_noexcept_function_type < 201510L
424#define MDBX_CXX17_NOEXCEPT
425#else
426#define MDBX_CXX17_NOEXCEPT noexcept
427#endif /* MDBX_CXX17_NOEXCEPT */
428
430#if defined(DOXYGEN)
431#define MDBX_CXX01_CONSTEXPR constexpr
432#define MDBX_CXX01_CONSTEXPR_VAR constexpr
433#elif !defined(__cplusplus)
434#define MDBX_CXX01_CONSTEXPR __inline
435#define MDBX_CXX01_CONSTEXPR_VAR const
436#elif !defined(DOXYGEN) && \
437 ((__cplusplus < 201103L && defined(__cpp_constexpr) && \
438 __cpp_constexpr < 200704L) || \
439 (defined(__LCC__) && __LCC__ < 124) || \
440 (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ < 407) && \
441 !defined(__clang__) && !defined(__LCC__)) || \
442 (defined(_MSC_VER) && _MSC_VER < 1910) || \
443 (defined(__clang__) && __clang_major__ < 4))
444#define MDBX_CXX01_CONSTEXPR inline
445#define MDBX_CXX01_CONSTEXPR_VAR const
446#else
447#define MDBX_CXX01_CONSTEXPR constexpr
448#define MDBX_CXX01_CONSTEXPR_VAR constexpr
449#endif /* MDBX_CXX01_CONSTEXPR */
450
453#if defined(DOXYGEN)
454#define MDBX_CXX11_CONSTEXPR constexpr
455#define MDBX_CXX11_CONSTEXPR_VAR constexpr
456#elif !defined(__cplusplus)
457#define MDBX_CXX11_CONSTEXPR __inline
458#define MDBX_CXX11_CONSTEXPR_VAR const
459#elif !defined(DOXYGEN) && \
460 (!defined(__cpp_constexpr) || __cpp_constexpr < 201304L || \
461 (defined(__LCC__) && __LCC__ < 124) || \
462 (defined(__GNUC__) && __GNUC__ < 6 && !defined(__clang__) && \
463 !defined(__LCC__)) || \
464 (defined(_MSC_VER) && _MSC_VER < 1910) || \
465 (defined(__clang__) && __clang_major__ < 5))
466#define MDBX_CXX11_CONSTEXPR inline
467#define MDBX_CXX11_CONSTEXPR_VAR const
468#else
469#define MDBX_CXX11_CONSTEXPR constexpr
470#define MDBX_CXX11_CONSTEXPR_VAR constexpr
471#endif /* MDBX_CXX11_CONSTEXPR */
472
475#if defined(DOXYGEN)
476#define MDBX_CXX14_CONSTEXPR constexpr
477#define MDBX_CXX14_CONSTEXPR_VAR constexpr
478#elif !defined(__cplusplus)
479#define MDBX_CXX14_CONSTEXPR __inline
480#define MDBX_CXX14_CONSTEXPR_VAR const
481#elif defined(DOXYGEN) || \
482 defined(__cpp_constexpr) && __cpp_constexpr >= 201304L && \
483 ((defined(_MSC_VER) && _MSC_VER >= 1910) || \
484 (defined(__clang__) && __clang_major__ > 4) || \
485 (defined(__GNUC__) && __GNUC__ > 6) || \
486 (!defined(__GNUC__) && !defined(__clang__) && !defined(_MSC_VER)))
487#define MDBX_CXX14_CONSTEXPR constexpr
488#define MDBX_CXX14_CONSTEXPR_VAR constexpr
489#else
490#define MDBX_CXX14_CONSTEXPR inline
491#define MDBX_CXX14_CONSTEXPR_VAR const
492#endif /* MDBX_CXX14_CONSTEXPR */
493
494#if defined(__noreturn)
495#define MDBX_NORETURN __noreturn
496#elif defined(_Noreturn)
497#define MDBX_NORETURN _Noreturn
498#elif defined(DOXYGEN) || (defined(__cplusplus) && __cplusplus >= 201103L) || \
499 (!defined(__cplusplus) && defined(__STDC_VERSION__) && \
500 __STDC_VERSION__ > 202005L)
501#define MDBX_NORETURN [[noreturn]]
502#elif defined(__GNUC__) || __has_attribute(__noreturn__)
503#define MDBX_NORETURN __attribute__((__noreturn__))
504#elif defined(_MSC_VER) && !defined(__clang__)
505#define MDBX_NORETURN __declspec(noreturn)
506#else
507#define MDBX_NORETURN
508#endif /* MDBX_NORETURN */
509
510#ifndef MDBX_PRINTF_ARGS
511#if defined(__GNUC__) || __has_attribute(__format__) || defined(DOXYGEN)
512#if defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)
513#define MDBX_PRINTF_ARGS(format_index, first_arg) \
514 __attribute__((__format__(__gnu_printf__, format_index, first_arg)))
515#else
516#define MDBX_PRINTF_ARGS(format_index, first_arg) \
517 __attribute__((__format__(__printf__, format_index, first_arg)))
518#endif /* MinGW */
519#else
520#define MDBX_PRINTF_ARGS(format_index, first_arg)
521#endif
522#endif /* MDBX_PRINTF_ARGS */
523
524#if defined(DOXYGEN) || \
525 (defined(__cplusplus) && __cplusplus >= 201603L && \
526 __has_cpp_attribute(maybe_unused) && \
527 __has_cpp_attribute(maybe_unused) >= 201603L) || \
528 (!defined(__cplusplus) && defined(__STDC_VERSION__) && \
529 __STDC_VERSION__ > 202005L)
530#define MDBX_MAYBE_UNUSED [[maybe_unused]]
531#elif defined(__GNUC__) || __has_attribute(__unused__)
532#define MDBX_MAYBE_UNUSED __attribute__((__unused__))
533#else
534#define MDBX_MAYBE_UNUSED
535#endif /* MDBX_MAYBE_UNUSED */
536
537#if __has_attribute(no_sanitize) || defined(DOXYGEN)
538#define MDBX_NOSANITIZE_ENUM __attribute((__no_sanitize__("enum")))
539#else
540#define MDBX_NOSANITIZE_ENUM
541#endif /* MDBX_NOSANITIZE_ENUM */
542
543/* Oh, below are some songs and dances since:
544 * - C++ requires explicit definition of the necessary operators.
545 * - the proper implementation of DEFINE_ENUM_FLAG_OPERATORS for C++ required
546 * the constexpr feature which is broken in most old compilers;
547 * - DEFINE_ENUM_FLAG_OPERATORS may be defined broken as in the Windows SDK. */
548#if !defined(DEFINE_ENUM_FLAG_OPERATORS) && !defined(DOXYGEN)
549
550#ifdef __cplusplus
551#if !defined(__cpp_constexpr) || __cpp_constexpr < 200704L || \
552 (defined(__LCC__) && __LCC__ < 124) || \
553 (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ < 407) && \
554 !defined(__clang__) && !defined(__LCC__)) || \
555 (defined(_MSC_VER) && _MSC_VER < 1910) || \
556 (defined(__clang__) && __clang_major__ < 4)
557/* The constexpr feature is not available or (may be) broken */
558#define CONSTEXPR_ENUM_FLAGS_OPERATIONS 0
559#else
560/* C always allows these operators for enums */
561#define CONSTEXPR_ENUM_FLAGS_OPERATIONS 1
562#endif /* __cpp_constexpr */
563
566#define DEFINE_ENUM_FLAG_OPERATORS(ENUM) \
567 extern "C++" { \
568 MDBX_NOSANITIZE_ENUM MDBX_CXX01_CONSTEXPR ENUM operator|(ENUM a, ENUM b) { \
569 return ENUM(unsigned(a) | unsigned(b)); \
570 } \
571 MDBX_NOSANITIZE_ENUM MDBX_CXX14_CONSTEXPR ENUM &operator|=(ENUM &a, \
572 ENUM b) { \
573 return a = a | b; \
574 } \
575 MDBX_NOSANITIZE_ENUM MDBX_CXX01_CONSTEXPR ENUM operator&(ENUM a, ENUM b) { \
576 return ENUM(unsigned(a) & unsigned(b)); \
577 } \
578 MDBX_NOSANITIZE_ENUM MDBX_CXX01_CONSTEXPR ENUM operator&(ENUM a, \
579 unsigned b) { \
580 return ENUM(unsigned(a) & b); \
581 } \
582 MDBX_NOSANITIZE_ENUM MDBX_CXX01_CONSTEXPR ENUM operator&(unsigned a, \
583 ENUM b) { \
584 return ENUM(a & unsigned(b)); \
585 } \
586 MDBX_NOSANITIZE_ENUM MDBX_CXX14_CONSTEXPR ENUM &operator&=(ENUM &a, \
587 ENUM b) { \
588 return a = a & b; \
589 } \
590 MDBX_NOSANITIZE_ENUM MDBX_CXX14_CONSTEXPR ENUM &operator&=(ENUM &a, \
591 unsigned b) { \
592 return a = a & b; \
593 } \
594 MDBX_CXX01_CONSTEXPR unsigned operator~(ENUM a) { return ~unsigned(a); } \
595 MDBX_NOSANITIZE_ENUM MDBX_CXX01_CONSTEXPR ENUM operator^(ENUM a, ENUM b) { \
596 return ENUM(unsigned(a) ^ unsigned(b)); \
597 } \
598 MDBX_NOSANITIZE_ENUM MDBX_CXX14_CONSTEXPR ENUM &operator^=(ENUM &a, \
599 ENUM b) { \
600 return a = a ^ b; \
601 } \
602 }
603#else /* __cplusplus */
604/* nope for C since it always allows these operators for enums */
605#define DEFINE_ENUM_FLAG_OPERATORS(ENUM)
606#define CONSTEXPR_ENUM_FLAGS_OPERATIONS 1
607#endif /* !__cplusplus */
608
609#elif !defined(CONSTEXPR_ENUM_FLAGS_OPERATIONS)
610
611#ifdef __cplusplus
612/* DEFINE_ENUM_FLAG_OPERATORS may be defined broken as in the Windows SDK */
613#define CONSTEXPR_ENUM_FLAGS_OPERATIONS 0
614#else
615/* C always allows these operators for enums */
616#define CONSTEXPR_ENUM_FLAGS_OPERATIONS 1
617#endif
618
619#endif /* DEFINE_ENUM_FLAG_OPERATORS */
620
623/*----------------------------------------------------------------------------*/
624
628#ifdef __cplusplus
629extern "C" {
630#endif
631
632/* MDBX version 0.13.x */
633#define MDBX_VERSION_MAJOR 0
634#define MDBX_VERSION_MINOR 13
635
636#ifndef LIBMDBX_API
637#if defined(LIBMDBX_EXPORTS) || defined(DOXYGEN)
638#define LIBMDBX_API __dll_export
639#elif defined(LIBMDBX_IMPORTS)
640#define LIBMDBX_API __dll_import
641#else
642#define LIBMDBX_API
643#endif
644#endif /* LIBMDBX_API */
645
646#ifdef __cplusplus
647#if defined(__clang__) || __has_attribute(type_visibility) || defined(DOXYGEN)
648#define LIBMDBX_API_TYPE LIBMDBX_API __attribute__((type_visibility("default")))
649#else
650#define LIBMDBX_API_TYPE LIBMDBX_API
651#endif
652#else
653#define LIBMDBX_API_TYPE
654#endif /* LIBMDBX_API_TYPE */
655
656#if defined(LIBMDBX_IMPORTS)
657#define LIBMDBX_VERINFO_API __dll_import
658#else
659#define LIBMDBX_VERINFO_API __dll_export
660#endif /* LIBMDBX_VERINFO_API */
661
664 uint8_t major;
665 uint8_t minor;
666 uint16_t release;
667 uint32_t revision;
668 struct {
669 const char *datetime;
670 const char *tree;
671 const char *commit;
672 const char *describe;
673 } git;
674 const char *sourcery;
676
681 const char *datetime;
682 const char *target;
683 const char *options;
684 const char *compiler;
685 const char *flags;
687
688#if (defined(_WIN32) || defined(_WIN64)) && !MDBX_BUILD_SHARED_LIBRARY
689/* MDBX internally uses global and thread local storage destructors to
690 * automatically (de)initialization, releasing reader lock table slots
691 * and so on.
692 *
693 * If MDBX built as a DLL this is done out-of-the-box by DllEntry() function,
694 * which called automatically by Windows core with passing corresponding reason
695 * argument.
696 *
697 * Otherwise, if MDBX was built not as a DLL, some black magic
698 * may be required depending of Windows version:
699 *
700 * - Modern Windows versions, including Windows Vista and later, provides
701 * support for "TLS Directory" (e.g .CRT$XL[A-Z] sections in executable
702 * or dll file). In this case, MDBX capable of doing all automatically,
703 * therefore you DON'T NEED to call mdbx_module_handler()
704 * so the MDBX_MANUAL_MODULE_HANDLER defined as 0.
705 *
706 * - Obsolete versions of Windows, prior to Windows Vista, REQUIRES calling
707 * mdbx_module_handler() manually from corresponding DllMain() or WinMain()
708 * of your DLL or application,
709 * so the MDBX_MANUAL_MODULE_HANDLER defined as 1.
710 *
711 * Therefore, building MDBX as a DLL is recommended for all version of Windows.
712 * So, if you doubt, just build MDBX as the separate DLL and don't care about
713 * the MDBX_MANUAL_MODULE_HANDLER. */
714
715#ifndef _WIN32_WINNT
716#error Non-dll build libmdbx requires target Windows version \
717 to be explicitly defined via _WIN32_WINNT for properly \
718 handling thread local storage destructors.
719#endif /* _WIN32_WINNT */
720
721#if _WIN32_WINNT >= 0x0600 /* Windows Vista */
722/* As described above mdbx_module_handler() is NOT needed for Windows Vista
723 * and later. */
724#define MDBX_MANUAL_MODULE_HANDLER 0
725#else
726/* As described above mdbx_module_handler() IS REQUIRED for Windows versions
727 * prior to Windows Vista. */
728#define MDBX_MANUAL_MODULE_HANDLER 1
729void LIBMDBX_API NTAPI mdbx_module_handler(PVOID module, DWORD reason,
730 PVOID reserved);
731#endif
732
733#endif /* Windows && !DLL && MDBX_MANUAL_MODULE_HANDLER */
734
735/* OPACITY STRUCTURES *********************************************************/
736
741#ifndef __cplusplus
742typedef struct MDBX_env MDBX_env;
743#else
744struct MDBX_env;
745#endif
746
752#ifndef __cplusplus
753typedef struct MDBX_txn MDBX_txn;
754#else
755struct MDBX_txn;
756#endif
757
765typedef uint32_t MDBX_dbi;
766
771#ifndef __cplusplus
773#else
774struct MDBX_cursor;
775#endif
776
791#ifndef HAVE_STRUCT_IOVEC
792struct iovec {
793 void *iov_base;
794 size_t iov_len;
795};
796#define HAVE_STRUCT_IOVEC
797#endif /* HAVE_STRUCT_IOVEC */
798
799#if defined(__sun) || defined(__SVR4) || defined(__svr4__)
800/* The `iov_len` is signed on Sun/Solaris.
801 * So define custom MDBX_val to avoid a lot of warnings. */
802struct MDBX_val {
803 void *iov_base;
804 size_t iov_len;
805};
806#ifndef __cplusplus
807typedef struct MDBX_val MDBX_val;
808#endif
809#else /* SunOS */
810typedef struct iovec MDBX_val;
811#endif /* ! SunOS */
812
815 MDBX_MAX_DBI = UINT32_C(32765),
816
818 MDBX_MAXDATASIZE = UINT32_C(0x7fff0000),
819
822
825};
826
827/* THE FILES *******************************************************************
828 * At the file system level, the environment corresponds to a pair of files. */
829
830#ifndef MDBX_LOCKNAME
833#if !(defined(_WIN32) || defined(_WIN64))
834#define MDBX_LOCKNAME "/mdbx.lck"
835#else
836#define MDBX_LOCKNAME_W L"\\mdbx.lck"
837#define MDBX_LOCKNAME_A "\\mdbx.lck"
838#ifdef UNICODE
839#define MDBX_LOCKNAME MDBX_LOCKNAME_W
840#else
841#define MDBX_LOCKNAME MDBX_LOCKNAME_A
842#endif /* UNICODE */
843#endif /* Windows */
844#endif /* MDBX_LOCKNAME */
845#ifndef MDBX_DATANAME
848#if !(defined(_WIN32) || defined(_WIN64))
849#define MDBX_DATANAME "/mdbx.dat"
850#else
851#define MDBX_DATANAME_W L"\\mdbx.dat"
852#define MDBX_DATANAME_A "\\mdbx.dat"
853#ifdef UNICODE
854#define MDBX_DATANAME MDBX_DATANAME_W
855#else
856#define MDBX_DATANAME MDBX_DATANAME_A
857#endif /* UNICODE */
858#endif /* Windows */
859#endif /* MDBX_DATANAME */
860
861#ifndef MDBX_LOCK_SUFFIX
863#if !(defined(_WIN32) || defined(_WIN64))
864#define MDBX_LOCK_SUFFIX "-lck"
865#else
866#define MDBX_LOCK_SUFFIX_W L"-lck"
867#define MDBX_LOCK_SUFFIX_A "-lck"
868#ifdef UNICODE
869#define MDBX_LOCK_SUFFIX MDBX_LOCK_SUFFIX_W
870#else
871#define MDBX_LOCK_SUFFIX MDBX_LOCK_SUFFIX_A
872#endif /* UNICODE */
873#endif /* Windows */
874#endif /* MDBX_LOCK_SUFFIX */
875
876/* DEBUG & LOGGING ************************************************************/
877
885typedef enum MDBX_log_level {
890
896
902
908
913
918
923
928
929#ifdef ENABLE_UBSAN
930 MDBX_LOG_MAX = 7 /* avoid UBSAN false-positive trap by a tests */,
931#endif /* ENABLE_UBSAN */
932
936
942typedef enum MDBX_debug_flags {
944
949
953
957
961
964
967
972
973#ifdef ENABLE_UBSAN
974 MDBX_DBG_MAX = ((unsigned)MDBX_LOG_MAX) << 16 |
975 127 /* avoid UBSAN false-positive trap by a tests */,
976#endif /* ENABLE_UBSAN */
977
981DEFINE_ENUM_FLAG_OPERATORS(MDBX_debug_flags)
982
983
997typedef void MDBX_debug_func(MDBX_log_level_t loglevel, const char *function,
998 int line, const char *fmt,
999 va_list args) MDBX_CXX17_NOEXCEPT;
1000
1002#define MDBX_LOGGER_DONTCHANGE ((MDBX_debug_func *)(intptr_t)-1)
1003#define MDBX_LOGGER_NOFMT_DONTCHANGE ((MDBX_debug_func_nofmt *)(intptr_t)-1)
1004
1009 MDBX_debug_flags_t debug_flags,
1010 MDBX_debug_func *logger);
1011
1013 const char *function, int line,
1014 const char *msg,
1015 unsigned length) MDBX_CXX17_NOEXCEPT;
1016
1018 MDBX_debug_flags_t debug_flags,
1019 MDBX_debug_func_nofmt *logger,
1020 char *logger_buffer,
1021 size_t logger_buffer_size);
1022
1033typedef void MDBX_assert_func(const MDBX_env *env, const char *msg,
1034 const char *function,
1035 unsigned line) MDBX_CXX17_NOEXCEPT;
1036
1047
1057LIBMDBX_API const char *mdbx_dump_val(const MDBX_val *key, char *const buf,
1058 const size_t bufsize);
1059
1061MDBX_NORETURN LIBMDBX_API void mdbx_panic(const char *fmt, ...)
1062 MDBX_PRINTF_ARGS(1, 2);
1063
1067 const char *msg,
1068 const char *func,
1069 unsigned line);
1076typedef enum MDBX_env_flags {
1078
1084 MDBX_VALIDATION = UINT32_C(0x00002000),
1085
1102 MDBX_NOSUBDIR = UINT32_C(0x4000),
1103
1120 MDBX_RDONLY = UINT32_C(0x20000),
1121
1150 MDBX_EXCLUSIVE = UINT32_C(0x400000),
1151
1165 MDBX_ACCEDE = UINT32_C(0x40000000),
1166
1196 MDBX_WRITEMAP = UINT32_C(0x80000),
1197
1267 MDBX_NOSTICKYTHREADS = UINT32_C(0x200000),
1268
1270 MDBX_NOTLS MDBX_DEPRECATED_ENUM = MDBX_NOSTICKYTHREADS,
1271
1291 MDBX_NORDAHEAD = UINT32_C(0x800000),
1292
1314 MDBX_NOMEMINIT = UINT32_C(0x1000000),
1315
1327 MDBX_COALESCE MDBX_DEPRECATED_ENUM = UINT32_C(0x2000000),
1328
1351 MDBX_LIFORECLAIM = UINT32_C(0x4000000),
1352
1354 MDBX_PAGEPERTURB = UINT32_C(0x8000000),
1355
1356 /* SYNC MODES****************************************************************/
1409
1426 MDBX_NOMETASYNC = UINT32_C(0x40000),
1427
1477 MDBX_SAFE_NOSYNC = UINT32_C(0x10000),
1478
1485
1528
1531DEFINE_ENUM_FLAG_OPERATORS(MDBX_env_flags)
1532
1533
1537typedef enum MDBX_txn_flags {
1543
1549
1556#if CONSTEXPR_ENUM_FLAGS_OPERATIONS || defined(DOXYGEN)
1558#else
1559 MDBX_TXN_RDONLY_PREPARE = uint32_t(MDBX_RDONLY) | uint32_t(MDBX_NOMEMINIT),
1560#endif
1561
1563 MDBX_TXN_TRY = UINT32_C(0x10000000),
1564
1568
1572
1573 /* Transaction state flags ---------------------------------------------- */
1574
1578 MDBX_TXN_INVALID = INT32_MIN,
1579
1584
1589
1594
1599
1604
1609
1616
1623
1630DEFINE_ENUM_FLAG_OPERATORS(MDBX_txn_flags)
1631
1632
1636typedef enum MDBX_db_flags {
1639
1641 MDBX_REVERSEKEY = UINT32_C(0x02),
1642
1644 MDBX_DUPSORT = UINT32_C(0x04),
1645
1651 MDBX_INTEGERKEY = UINT32_C(0x08),
1652
1655 MDBX_DUPFIXED = UINT32_C(0x10),
1656
1660 MDBX_INTEGERDUP = UINT32_C(0x20),
1661
1663 MDBX_REVERSEDUP = UINT32_C(0x40),
1664
1666 MDBX_CREATE = UINT32_C(0x40000),
1667
1680DEFINE_ENUM_FLAG_OPERATORS(MDBX_db_flags)
1681
1682
1686typedef enum MDBX_put_flags {
1689
1691 MDBX_NOOVERWRITE = UINT32_C(0x10),
1692
1695 MDBX_NODUPDATA = UINT32_C(0x20),
1696
1701 MDBX_CURRENT = UINT32_C(0x40),
1702
1706 MDBX_ALLDUPS = UINT32_C(0x80),
1707
1710 MDBX_RESERVE = UINT32_C(0x10000),
1711
1714 MDBX_APPEND = UINT32_C(0x20000),
1715
1719 MDBX_APPENDDUP = UINT32_C(0x40000),
1720
1723 MDBX_MULTIPLE = UINT32_C(0x80000)
1725DEFINE_ENUM_FLAG_OPERATORS(MDBX_put_flags)
1726
1727
1757DEFINE_ENUM_FLAG_OPERATORS(MDBX_copy_flags)
1758
1759
1876
1882typedef enum MDBX_error {
1885
1888
1891
1894
1897
1900
1903
1906
1909 MDBX_PANIC = -30795,
1910
1913
1916
1919
1922
1925
1928
1932
1935
1944
1954
1958
1963
1967
1971
1974
1977
1980 MDBX_BUSY = -30778,
1981
1984
1987
1992
1996
1999
2003
2007
2010
2016
2019
2023
2026 MDBX_OUSTED = -30411,
2027
2031
2032 /* The last of MDBX-added error codes */
2034
2035#if defined(_WIN32) || defined(_WIN64)
2036 MDBX_ENODATA = ERROR_HANDLE_EOF,
2037 MDBX_EINVAL = ERROR_INVALID_PARAMETER,
2038 MDBX_EACCESS = ERROR_ACCESS_DENIED,
2039 MDBX_ENOMEM = ERROR_OUTOFMEMORY,
2040 MDBX_EROFS = ERROR_FILE_READ_ONLY,
2041 MDBX_ENOSYS = ERROR_NOT_SUPPORTED,
2042 MDBX_EIO = ERROR_WRITE_FAULT,
2043 MDBX_EPERM = ERROR_INVALID_FUNCTION,
2044 MDBX_EINTR = ERROR_CANCELLED,
2045 MDBX_ENOFILE = ERROR_FILE_NOT_FOUND,
2046 MDBX_EREMOTE = ERROR_REMOTE_STORAGE_MEDIA_ERROR,
2047 MDBX_EDEADLK = ERROR_POSSIBLE_DEADLOCK
2048#else /* Windows */
2049#ifdef ENODATA
2050 MDBX_ENODATA = ENODATA,
2051#else
2052 MDBX_ENODATA = 9919 /* for compatibility with LLVM's C++ libraries/headers */,
2053#endif /* ENODATA */
2054 MDBX_EINVAL = EINVAL,
2056 MDBX_ENOMEM = ENOMEM,
2057 MDBX_EROFS = EROFS,
2058 MDBX_ENOSYS = ENOSYS,
2060 MDBX_EPERM = EPERM,
2061 MDBX_EINTR = EINTR,
2063 MDBX_EREMOTE = ENOTBLK,
2064 MDBX_EDEADLK = EDEADLK
2065#endif /* !Windows */
2067
2072MDBX_DEPRECATED static __inline int MDBX_MAP_RESIZED_is_deprecated(void) {
2074}
2075#define MDBX_MAP_RESIZED MDBX_MAP_RESIZED_is_deprecated()
2076
2095LIBMDBX_API const char *mdbx_strerror(int errnum);
2096
2121LIBMDBX_API const char *mdbx_strerror_r(int errnum, char *buf, size_t buflen);
2123
2124#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
2129LIBMDBX_API const char *mdbx_strerror_ANSI2OEM(int errnum);
2130
2135LIBMDBX_API const char *mdbx_strerror_r_ANSI2OEM(int errnum, char *buf,
2136 size_t buflen);
2137#endif /* Bit of Windows' madness */
2138
2154
2458
2470 uint64_t value);
2471
2483 const MDBX_option_t option,
2484 uint64_t *pvalue);
2485
2558LIBMDBX_API int mdbx_env_open(MDBX_env *env, const char *pathname,
2559 MDBX_env_flags_t flags, mdbx_mode_t mode);
2560
2561#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
2565LIBMDBX_API int mdbx_env_openW(MDBX_env *env, const wchar_t *pathname,
2566 MDBX_env_flags_t flags, mdbx_mode_t mode);
2567#define mdbx_env_openT(env, pathname, flags, mode) \
2568 mdbx_env_openW(env, pathname, flags, mode)
2569#else
2570#define mdbx_env_openT(env, pathname, flags, mode) \
2571 mdbx_env_open(env, pathname, flags, mode)
2572#endif /* Windows */
2573
2592
2612LIBMDBX_API int mdbx_env_delete(const char *pathname,
2614
2615#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
2620LIBMDBX_API int mdbx_env_deleteW(const wchar_t *pathname,
2622#define mdbx_env_deleteT(pathname, mode) mdbx_env_deleteW(pathname, mode)
2623#else
2624#define mdbx_env_deleteT(pathname, mode) mdbx_env_delete(pathname, mode)
2625#endif /* Windows */
2626
2680LIBMDBX_API int mdbx_env_copy(MDBX_env *env, const char *dest,
2681 MDBX_copy_flags_t flags);
2682
2737 MDBX_copy_flags_t flags);
2738
2739#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
2744LIBMDBX_API int mdbx_env_copyW(MDBX_env *env, const wchar_t *dest,
2745 MDBX_copy_flags_t flags);
2746#define mdbx_env_copyT(env, dest, flags) mdbx_env_copyW(env, dest, flags)
2747
2752LIBMDBX_API int mdbx_txn_copy2pathnameW(MDBX_txn *txn, const wchar_t *dest,
2753 MDBX_copy_flags_t flags);
2754#define mdbx_txn_copy2pathnameT(txn, dest, flags) \
2755 mdbx_txn_copy2pathnameW(txn, dest, path)
2756#else
2757#define mdbx_env_copyT(env, dest, flags) mdbx_env_copy(env, dest, flags)
2758#define mdbx_txn_copy2pathnameT(txn, dest, flags) \
2759 mdbx_txn_copy2pathname(txn, dest, path)
2760#endif /* Windows */
2761
2787 MDBX_copy_flags_t flags);
2788
2813 MDBX_copy_flags_t flags);
2814
2819 uint32_t ms_psize;
2821 uint32_t ms_depth;
2823 uint64_t ms_leaf_pages;
2825 uint64_t ms_entries;
2826 uint64_t ms_mod_txnid;
2827};
2828#ifndef __cplusplus
2830typedef struct MDBX_stat MDBX_stat;
2831#endif
2832
2853 MDBX_stat *stat, size_t bytes);
2854
2858MDBX_DEPRECATED inline int mdbx_env_stat(const MDBX_env *env, MDBX_stat *stat,
2859 size_t bytes) {
2860 return mdbx_env_stat_ex(env, NULL, stat, bytes);
2861}
2862
2867 struct {
2868 uint64_t lower;
2869 uint64_t upper;
2870 uint64_t current;
2871 uint64_t shrink;
2872 uint64_t grow;
2874 uint64_t mi_mapsize;
2875 uint64_t mi_last_pgno;
2881 uint32_t mi_maxreaders;
2882 uint32_t mi_numreaders;
2894 struct {
2895 struct {
2896 uint64_t x, y;
2897 } current, meta[3];
2899
2916 uint32_t mi_mode;
2917
2923 struct {
2924 uint64_t newly;
2925 uint64_t cow;
2926 uint64_t clone;
2928 uint64_t split;
2929 uint64_t merge;
2930 uint64_t spill;
2931 uint64_t unspill;
2932 uint64_t wops;
2934 uint64_t prefault;
2935 uint64_t mincore;
2936 uint64_t
2937 msync;
2938 uint64_t
2939 fsync;
2941
2942 /* GUID of the database DXB file. */
2943 struct {
2944 uint64_t x, y;
2946};
2947#ifndef __cplusplus
2949typedef struct MDBX_envinfo MDBX_envinfo;
2950#endif
2951
2973 MDBX_envinfo *info, size_t bytes);
2977MDBX_DEPRECATED inline int mdbx_env_info(const MDBX_env *env, MDBX_envinfo *info,
2978 size_t bytes) {
2979 return mdbx_env_info_ex(env, NULL, info, bytes);
2980}
2981
3018LIBMDBX_API int mdbx_env_sync_ex(MDBX_env *env, bool force, bool nonblock);
3019
3023inline int mdbx_env_sync(MDBX_env * env) {
3024 return mdbx_env_sync_ex(env, true, false);
3025}
3026
3030inline int mdbx_env_sync_poll(MDBX_env * env) {
3031 return mdbx_env_sync_ex(env, false, true);
3032}
3033
3057inline int mdbx_env_set_syncbytes(MDBX_env * env, size_t threshold) {
3058 return mdbx_env_set_option(env, MDBX_opt_sync_bytes, threshold);
3059}
3060
3075inline int mdbx_env_get_syncbytes(const MDBX_env *env, size_t *threshold) {
3076 int rc = MDBX_EINVAL;
3077 if (threshold) {
3078 uint64_t proxy = 0;
3079 rc = mdbx_env_get_option(env, MDBX_opt_sync_bytes, &proxy);
3080#ifdef assert
3081 assert(proxy <= SIZE_MAX);
3082#endif /* assert */
3083 *threshold = (size_t)proxy;
3084 }
3085 return rc;
3086}
3087
3118inline int mdbx_env_set_syncperiod(MDBX_env * env, unsigned seconds_16dot16) {
3119 return mdbx_env_set_option(env, MDBX_opt_sync_period, seconds_16dot16);
3120}
3121
3138inline int mdbx_env_get_syncperiod(const MDBX_env *env, unsigned *period_seconds_16dot16) {
3139 int rc = MDBX_EINVAL;
3140 if (period_seconds_16dot16) {
3141 uint64_t proxy = 0;
3142 rc = mdbx_env_get_option(env, MDBX_opt_sync_period, &proxy);
3143#ifdef assert
3144 assert(proxy <= UINT32_MAX);
3145#endif /* assert */
3146 *period_seconds_16dot16 = (unsigned)proxy;
3147 }
3148 return rc;
3149}
3150
3190LIBMDBX_API int mdbx_env_close_ex(MDBX_env *env, bool dont_sync);
3191
3195inline int mdbx_env_close(MDBX_env * env) {
3196 return mdbx_env_close_ex(env, false);
3197}
3198
3199#if defined(DOXYGEN) || !(defined(_WIN32) || defined(_WIN64))
3277#endif /* Windows */
3278
3327DEFINE_ENUM_FLAG_OPERATORS(MDBX_warmup_flags)
3328
3329
3361 MDBX_warmup_flags_t flags,
3362 unsigned timeout_seconds_16dot16);
3363
3385 bool onoff);
3386
3397LIBMDBX_API int mdbx_env_get_flags(const MDBX_env *env, unsigned *flags);
3398
3412LIBMDBX_API int mdbx_env_get_path(const MDBX_env *env, const char **dest);
3413
3414#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
3419LIBMDBX_API int mdbx_env_get_pathW(const MDBX_env *env, const wchar_t **dest);
3420#define mdbx_env_get_pathT(env, dest) mdbx_env_get_pathW(env, dest)
3421#else
3422#define mdbx_env_get_pathT(env, dest) mdbx_env_get_path(env, dest)
3423#endif /* Windows */
3424
3438
3635LIBMDBX_API int mdbx_env_set_geometry(MDBX_env *env, intptr_t size_lower,
3636 intptr_t size_now, intptr_t size_upper,
3637 intptr_t growth_step,
3638 intptr_t shrink_threshold,
3639 intptr_t pagesize);
3640
3643MDBX_DEPRECATED inline int mdbx_env_set_mapsize(MDBX_env * env, size_t size) {
3644 return mdbx_env_set_geometry(env, size, size, size, -1, -1, -1);
3645}
3646
3663 intptr_t redundancy);
3664
3670
3676
3681mdbx_limits_dbsize_min(intptr_t pagesize);
3682
3687mdbx_limits_dbsize_max(intptr_t pagesize);
3688
3695
3701
3708
3714
3721
3729
3734mdbx_limits_txnsize_max(intptr_t pagesize);
3735
3759inline int mdbx_env_set_maxreaders(MDBX_env * env, unsigned readers) {
3760 return mdbx_env_set_option(env, MDBX_opt_max_readers, readers);
3761}
3762
3774inline int mdbx_env_get_maxreaders(const MDBX_env *env, unsigned *readers) {
3775 int rc = MDBX_EINVAL;
3776 if (readers) {
3777 uint64_t proxy = 0;
3778 rc = mdbx_env_get_option(env, MDBX_opt_max_readers, &proxy);
3779 *readers = (unsigned)proxy;
3780 }
3781 return rc;
3782}
3783
3805inline int mdbx_env_set_maxdbs(MDBX_env * env, MDBX_dbi dbs) {
3806 return mdbx_env_set_option(env, MDBX_opt_max_db, dbs);
3807}
3808
3819inline int mdbx_env_get_maxdbs(const MDBX_env *env, MDBX_dbi *dbs) {
3820 int rc = MDBX_EINVAL;
3821 if (dbs) {
3822 uint64_t proxy = 0;
3823 rc = mdbx_env_get_option(env, MDBX_opt_max_db, &proxy);
3824 *dbs = (MDBX_dbi)proxy;
3825 }
3826 return rc;
3827}
3828
3834
3849LIBMDBX_API int mdbx_get_sysraminfo(intptr_t *page_size, intptr_t *total_pages,
3850 intptr_t *avail_pages);
3851
3863
3875
3879MDBX_NOTHROW_PURE_FUNCTION MDBX_DEPRECATED LIBMDBX_API int
3881
3894
3907
3918
3929
3990 MDBX_txn_flags_t flags, MDBX_txn **txn,
3991 void *context);
3992
4047inline int mdbx_txn_begin(MDBX_env * env, MDBX_txn *parent, MDBX_txn_flags_t flags,
4048 MDBX_txn **txn) {
4049 return mdbx_txn_begin_ex(env, parent, flags, txn, NULL);
4050}
4051
4063
4076
4083 uint64_t txn_id;
4084
4090
4094
4097
4101
4109
4116
4123};
4124#ifndef __cplusplus
4126typedef struct MDBX_txn_info MDBX_txn_info;
4127#endif
4128
4143 bool scan_rlt);
4144
4151
4163
4177
4185 uint32_t preparation;
4189 uint32_t audit;
4192 uint32_t write;
4195 uint32_t sync;
4197 uint32_t ending;
4199 uint32_t whole;
4201 uint32_t gc_cputime;
4202
4210 struct {
4213 uint32_t wloops;
4215 uint32_t coalescences;
4218 uint32_t wipes;
4222 uint32_t flushes;
4226 uint32_t kicks;
4227
4230 uint32_t work_counter;
4233 uint32_t work_rtime_monotonic;
4237 uint32_t work_xtime_cpu;
4240 uint32_t work_rsteps;
4243 uint32_t work_xpages;
4246 uint32_t work_majflt;
4247
4250 uint32_t self_counter;
4253 uint32_t self_rtime_monotonic;
4257 uint32_t self_xtime_cpu;
4260 uint32_t self_rsteps;
4263 uint32_t self_xpages;
4266 uint32_t self_majflt;
4268};
4269#ifndef __cplusplus
4272#endif
4273
4280
4319inline int mdbx_txn_commit(MDBX_txn * txn) {
4320 return mdbx_txn_commit_ex(txn, NULL);
4321}
4322
4357
4370
4405
4449LIBMDBX_API int mdbx_txn_park(MDBX_txn *txn, bool autounpark);
4450
4492LIBMDBX_API int mdbx_txn_unpark(MDBX_txn *txn, bool restart_if_ousted);
4493
4515
4527 uint64_t x, y, z, v;
4528};
4529#ifndef __cplusplus
4531typedef struct MDBX_canary MDBX_canary;
4532#endif
4533
4553
4565
4586typedef int(MDBX_cmp_func)(const MDBX_val *a,
4587 const MDBX_val *b) MDBX_CXX17_NOEXCEPT;
4588
4678LIBMDBX_API int mdbx_dbi_open(MDBX_txn *txn, const char *name,
4679 MDBX_db_flags_t flags, MDBX_dbi *dbi);
4683 MDBX_db_flags_t flags, MDBX_dbi *dbi);
4684
4701MDBX_DEPRECATED LIBMDBX_API int
4702mdbx_dbi_open_ex(MDBX_txn *txn, const char *name, MDBX_db_flags_t flags,
4703 MDBX_dbi *dbi, MDBX_cmp_func *keycmp, MDBX_cmp_func *datacmp);
4706MDBX_DEPRECATED LIBMDBX_API int
4708 MDBX_dbi *dbi, MDBX_cmp_func *keycmp, MDBX_cmp_func *datacmp);
4709
4725LIBMDBX_API int mdbx_dbi_rename(MDBX_txn *txn, MDBX_dbi dbi, const char *name);
4729 const MDBX_val *name);
4730
4750typedef int(MDBX_table_enum_func)(void *ctx, const MDBX_txn *txn,
4751 const MDBX_val *name, MDBX_db_flags_t flags,
4752 const struct MDBX_stat *stat,
4754
4776 MDBX_table_enum_func *func, void *ctx);
4777
4790mdbx_key_from_jsonInteger(const int64_t json_integer);
4791
4793mdbx_key_from_double(const double ieee754_64bit);
4794
4796mdbx_key_from_ptrdouble(const double *const ieee754_64bit);
4797
4799mdbx_key_from_float(const float ieee754_32bit);
4800
4802mdbx_key_from_ptrfloat(const float *const ieee754_32bit);
4803
4804MDBX_NOTHROW_CONST_FUNCTION inline uint64_t mdbx_key_from_int64(const int64_t i64) {
4805 return UINT64_C(0x8000000000000000) + i64;
4806}
4807
4808MDBX_NOTHROW_CONST_FUNCTION inline uint32_t mdbx_key_from_int32(const int32_t i32) {
4809 return UINT32_C(0x80000000) + i32;
4810}
4820
4823
4826
4829
4849 MDBX_stat *stat, size_t bytes);
4850
4867 uint32_t *mask);
4868
4872typedef enum MDBX_dbi_state {
4882DEFINE_ENUM_FLAG_OPERATORS(MDBX_dbi_state)
4883
4884
4896 unsigned *flags, unsigned *state);
4901inline int mdbx_dbi_flags(const MDBX_txn *txn, MDBX_dbi dbi, unsigned *flags) {
4902 unsigned state;
4903 return mdbx_dbi_flags_ex(txn, dbi, flags, &state);
4904}
4905
4932
4944LIBMDBX_API int mdbx_drop(MDBX_txn *txn, MDBX_dbi dbi, bool del);
4945
4980LIBMDBX_API int mdbx_get(const MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *key,
4981 MDBX_val *data);
4982
5014 MDBX_val *data, size_t *values_count);
5015
5045 MDBX_val *key, MDBX_val *data);
5046
5129 MDBX_val *data, MDBX_put_flags_t flags);
5130
5175 MDBX_val *new_data, MDBX_val *old_data,
5176 MDBX_put_flags_t flags);
5177
5178typedef int (*MDBX_preserve_func)(void *context, MDBX_val *target,
5179 const void *src, size_t bytes);
5181 const MDBX_val *key, MDBX_val *new_data,
5182 MDBX_val *old_data, MDBX_put_flags_t flags,
5183 MDBX_preserve_func preserver,
5184 void *preserver_context);
5185
5212 const MDBX_val *data);
5213
5237
5248
5260
5287 MDBX_dbi dbi);
5288
5311
5325
5357 MDBX_cursor **cursor);
5358
5374
5395
5421
5428
5434
5446
5469 const MDBX_cursor *right,
5470 bool ignore_multival);
5471
5504 MDBX_val *data, MDBX_cursor_op op);
5505
5520
5550typedef int(MDBX_predicate_func)(void *context, MDBX_val *key, MDBX_val *value,
5551 void *arg) MDBX_CXX17_NOEXCEPT;
5552
5622 MDBX_predicate_func *predicate, void *context,
5623 MDBX_cursor_op start_op,
5624 MDBX_cursor_op turn_op, void *arg);
5625
5711 MDBX_predicate_func *predicate,
5712 void *context, MDBX_cursor_op from_op,
5713 MDBX_val *from_key, MDBX_val *from_value,
5714 MDBX_cursor_op turn_op, void *arg);
5715
5758 MDBX_val *pairs, size_t limit,
5759 MDBX_cursor_op op);
5760
5842 MDBX_val *data, MDBX_put_flags_t flags);
5843
5875
5891LIBMDBX_API int mdbx_cursor_count(const MDBX_cursor *cursor, size_t *pcount);
5892
5907
5921
5935
5949
5963
6009 const MDBX_cursor *last,
6010 ptrdiff_t *distance_items);
6011
6033 MDBX_val *data, MDBX_cursor_op move_op,
6034 ptrdiff_t *distance_items);
6035
6061 const MDBX_val *begin_key,
6062 const MDBX_val *begin_data,
6063 const MDBX_val *end_key,
6064 const MDBX_val *end_data,
6065 ptrdiff_t *distance_items);
6066
6069#define MDBX_EPSILON ((MDBX_val *)((ptrdiff_t)-1))
6070
6105 const void *ptr);
6106
6128LIBMDBX_API int mdbx_dbi_sequence(MDBX_txn *txn, MDBX_dbi dbi, uint64_t *result,
6129 uint64_t increment);
6130
6147 MDBX_dbi dbi,
6148 const MDBX_val *a,
6149 const MDBX_val *b);
6150
6155
6172 MDBX_dbi dbi,
6173 const MDBX_val *a,
6174 const MDBX_val *b);
6175
6180
6206typedef int(MDBX_reader_list_func)(void *ctx, int num, int slot, mdbx_pid_t pid,
6207 mdbx_tid_t thread, uint64_t txnid,
6208 uint64_t lag, size_t bytes_used,
6209 size_t bytes_retained) MDBX_CXX17_NOEXCEPT;
6210
6223 MDBX_reader_list_func *func, void *ctx);
6224
6234
6247MDBX_DEPRECATED LIBMDBX_API int mdbx_txn_straggler(const MDBX_txn *txn,
6248 int *percent);
6249
6269
6284
6358typedef int(MDBX_hsr_func)(const MDBX_env *env, const MDBX_txn *txn,
6359 mdbx_pid_t pid, mdbx_tid_t tid, uint64_t laggard,
6360 unsigned gap, size_t space,
6361 int retry) MDBX_CXX17_NOEXCEPT;
6362
6382
6397
6407LIBMDBX_API int mdbx_txn_lock(MDBX_env *env, bool dont_wait);
6408
6413
6423LIBMDBX_API int mdbx_env_open_for_recovery(MDBX_env *env, const char *pathname,
6424 unsigned target_meta,
6425 bool writeable);
6426
6427#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
6433 const wchar_t *pathname,
6434 unsigned target_meta,
6435 bool writeable);
6436#define mdbx_env_open_for_recoveryT(env, pathname, target_mets, writeable) \
6437 mdbx_env_open_for_recoveryW(env, pathname, target_mets, writeable)
6438#else
6439#define mdbx_env_open_for_recoveryT(env, pathname, target_mets, writeable) \
6440 mdbx_env_open_for_recovery(env, pathname, target_mets, writeable)
6441#endif /* Windows */
6442
6448LIBMDBX_API int mdbx_env_turn_for_recovery(MDBX_env *env, unsigned target_meta);
6449
6481LIBMDBX_API int mdbx_preopen_snapinfo(const char *pathname, MDBX_envinfo *info,
6482 size_t bytes);
6483#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
6488LIBMDBX_API int mdbx_preopen_snapinfoW(const wchar_t *pathname,
6489 MDBX_envinfo *info, size_t bytes);
6490#define mdbx_preopen_snapinfoT(pathname, info, bytes) \
6491 mdbx_preopen_snapinfoW(pathname, info, bytes)
6492#else
6493#define mdbx_preopen_snapinfoT(pathname, info, bytes) \
6494 mdbx_preopen_snapinfo(pathname, info, bytes)
6495#endif /* Windows */
6496
6520DEFINE_ENUM_FLAG_OPERATORS(MDBX_chk_flags)
6521
6522
6540
6558
6561typedef struct MDBX_chk_line {
6562 struct MDBX_chk_context *ctx;
6563 uint8_t severity, scope_depth, empty;
6564 char *begin, *end, *out;
6566
6569typedef struct MDBX_chk_issue {
6570 struct MDBX_chk_issue *next;
6571 size_t count;
6572 const char *caption;
6574
6577typedef struct MDBX_chk_scope {
6579 struct MDBX_chk_internal *internal;
6580 const void *object;
6584 union {
6585 void *ptr;
6586 size_t number;
6587 } usr_z, usr_v, usr_o;
6589
6593typedef struct MDBX_chk_user_table_cookie MDBX_chk_user_table_cookie_t;
6594
6600 struct {
6601 size_t begin, end, amount, count;
6603};
6604
6608typedef struct MDBX_chk_table {
6610
6612#define MDBX_CHK_MAIN ((void *)((ptrdiff_t)0))
6614#define MDBX_CHK_GC ((void *)((ptrdiff_t)-1))
6616#define MDBX_CHK_META ((void *)((ptrdiff_t)-2))
6617
6620 int id;
6621
6622 size_t payload_bytes, lost_bytes;
6623 struct {
6624 size_t all, empty, other;
6625 size_t branch, leaf;
6626 size_t nested_branch, nested_leaf, nested_subleaf;
6627 } pages;
6628 struct {
6630 struct MDBX_chk_histogram deep;
6632 struct MDBX_chk_histogram large_pages;
6634 struct MDBX_chk_histogram nested_tree;
6636 struct MDBX_chk_histogram key_len;
6638 struct MDBX_chk_histogram val_len;
6639 } histogram;
6641
6644typedef struct MDBX_chk_context {
6645 struct MDBX_chk_internal *internal;
6650 struct {
6651 size_t total_payload_bytes;
6652 size_t table_total, table_processed;
6653 size_t total_unused_bytes, unused_pages;
6654 size_t processed_pages, reclaimable_pages, gc_pages, alloc_pages,
6655 backed_pages;
6656 size_t problems_meta, tree_problems, gc_tree_problems, kv_tree_problems,
6657 problems_gc, problems_kv, total_problems;
6658 uint64_t steady_txnid, recent_txnid;
6662 const MDBX_chk_table_t *const *tables;
6663 } result;
6665
6681typedef struct MDBX_chk_callbacks {
6682 bool (*check_break)(MDBX_chk_context_t *ctx);
6683 int (*scope_push)(MDBX_chk_context_t *ctx, MDBX_chk_scope_t *outer,
6684 MDBX_chk_scope_t *inner, const char *fmt, va_list args);
6685 int (*scope_conclude)(MDBX_chk_context_t *ctx, MDBX_chk_scope_t *outer,
6686 MDBX_chk_scope_t *inner, int err);
6687 void (*scope_pop)(MDBX_chk_context_t *ctx, MDBX_chk_scope_t *outer,
6688 MDBX_chk_scope_t *inner);
6689 void (*issue)(MDBX_chk_context_t *ctx, const char *object,
6690 uint64_t entry_number, const char *issue, const char *extra_fmt,
6691 va_list extra_args);
6693 const MDBX_val *name,
6694 MDBX_db_flags_t flags);
6695 int (*table_conclude)(MDBX_chk_context_t *ctx, const MDBX_chk_table_t *table,
6696 MDBX_cursor *cursor, int err);
6697 void (*table_dispose)(MDBX_chk_context_t *ctx, const MDBX_chk_table_t *table);
6698
6699 int (*table_handle_kv)(MDBX_chk_context_t *ctx, const MDBX_chk_table_t *table,
6700 size_t entry_number, const MDBX_val *key,
6701 const MDBX_val *value);
6702
6703 int (*stage_begin)(MDBX_chk_context_t *ctx, MDBX_chk_stage_t);
6704 int (*stage_end)(MDBX_chk_context_t *ctx, MDBX_chk_stage_t, int err);
6705
6707 MDBX_chk_severity_t severity);
6708 void (*print_flush)(MDBX_chk_line_t *);
6709 void (*print_done)(MDBX_chk_line_t *);
6710 void (*print_chars)(MDBX_chk_line_t *, const char *str, size_t len);
6711 void (*print_format)(MDBX_chk_line_t *, const char *fmt, va_list args);
6712 void (*print_size)(MDBX_chk_line_t *, const char *prefix,
6713 const uint64_t value, const char *suffix);
6715
6746 MDBX_chk_context_t *ctx,
6747 const MDBX_chk_flags_t flags,
6748 MDBX_chk_severity_t verbosity,
6749 unsigned timeout_seconds_16dot16);
6750
6757
6762#ifdef __cplusplus
6763} /* extern "C" */
6764#endif
6765
6766#endif /* LIBMDBX_H */
#define MDBX_NOTHROW_CONST_FUNCTION
The 'const nothrow' function attribute for optimization.
Definition mdbx.h:303
#define MDBX_CXX17_NOEXCEPT
Definition mdbx.h:421
#define MDBX_NOTHROW_PURE_FUNCTION
The 'pure nothrow' function attribute for optimization.
Definition mdbx.h:259
#define MDBX_NORETURN
Definition mdbx.h:501
uint64_t mi_mapsize
Definition mdbx.h:2874
uint64_t txn_space_dirty
Definition mdbx.h:4122
uint32_t gc_cputime
User-mode CPU time spent on GC update.
Definition mdbx.h:4201
uint32_t mi_dxb_pagesize
Definition mdbx.h:2883
uint32_t mi_maxreaders
Definition mdbx.h:2881
uint64_t v
Definition mdbx.h:4527
uint32_t mi_numreaders
Definition mdbx.h:2882
struct MDBX_envinfo::@3 mi_pgop_stat
uint32_t mi_since_sync_seconds16dot16
Definition mdbx.h:2907
uint64_t txn_reader_lag
Definition mdbx.h:4089
uint64_t mi_meta_txnid[3]
Definition mdbx.h:2880
struct MDBX_envinfo::@2 mi_bootid
A mostly unique ID that is regenerated on each boot.
uint64_t txn_space_leftover
Definition mdbx.h:4115
uint64_t txn_space_used
Definition mdbx.h:4093
const char * datetime
Definition mdbx.h:681
uint16_t release
Definition mdbx.h:666
uint64_t mi_recent_txnid
Definition mdbx.h:2876
uint64_t mi_autosync_threshold
Definition mdbx.h:2903
uint64_t ms_branch_pages
Definition mdbx.h:2822
uint64_t ms_entries
Definition mdbx.h:2825
uint32_t gc_wallclock
Duration of GC update by wall clock.
Definition mdbx.h:4187
struct MDBX_commit_latency::@6 gc_prof
Информация для профилирования работы GC.
uint32_t mi_since_reader_check_seconds16dot16
Definition mdbx.h:2913
uint64_t y
Definition mdbx.h:4527
uint32_t revision
Definition mdbx.h:667
uint8_t minor
Definition mdbx.h:665
uint32_t sync
Duration of syncing written data to the disk/storage, i.e. the duration of a fdatasync() or a msync()...
Definition mdbx.h:4195
uint64_t txn_space_limit_soft
Definition mdbx.h:4096
uint32_t mi_mode
Definition mdbx.h:2916
const char * options
Definition mdbx.h:683
uint64_t txn_id
Definition mdbx.h:4083
const char * sourcery
Definition mdbx.h:674
uint8_t major
Definition mdbx.h:664
uint64_t mi_latter_reader_txnid
Definition mdbx.h:2877
struct MDBX_envinfo::@1 mi_geo
uint64_t ms_overflow_pages
Definition mdbx.h:2824
uint32_t preparation
Duration of preparation (commit child transactions, update table's records and cursors destroying).
Definition mdbx.h:4185
uint64_t z
Definition mdbx.h:4527
uint64_t txn_space_limit_hard
Definition mdbx.h:4100
uint32_t whole
The total duration of a commit.
Definition mdbx.h:4199
const char * flags
Definition mdbx.h:685
uint64_t mi_meta_sign[3]
Definition mdbx.h:2880
uint32_t ms_psize
Definition mdbx.h:2819
uint32_t audit
Duration of internal audit if enabled.
Definition mdbx.h:4189
const char * target
Definition mdbx.h:682
uint32_t write
Duration of writing dirty/modified data pages to a filesystem, i.e. the summary duration of a write()...
Definition mdbx.h:4192
uint64_t txn_space_retired
Definition mdbx.h:4108
uint32_t ms_depth
Definition mdbx.h:2821
struct MDBX_version_info::@0 git
uint64_t mi_last_pgno
Definition mdbx.h:2875
uint32_t ending
Duration of transaction ending (releasing resources).
Definition mdbx.h:4197
uint64_t ms_mod_txnid
Definition mdbx.h:2826
uint64_t mi_self_latter_reader_txnid
Definition mdbx.h:2878
uint64_t ms_leaf_pages
Definition mdbx.h:2823
uint64_t x
Definition mdbx.h:4527
uint32_t mi_autosync_period_seconds16dot16
Definition mdbx.h:2910
uint64_t mi_unsync_volume
Definition mdbx.h:2901
uint32_t mi_sys_pagesize
Definition mdbx.h:2884
struct MDBX_envinfo::@4 mi_dxbid
const char * compiler
Definition mdbx.h:684
LIBMDBX_API MDBX_hsr_func * mdbx_env_get_hsr(const MDBX_env *env)
Gets current Handle-Slow-Readers callback used to resolve database full/overflow issue due to a reade...
MDBX_constants
Definition mdbx.h:813
mode_t mdbx_mode_t
Definition mdbx.h:174
int(* MDBX_preserve_func)(void *context, MDBX_val *target, const void *src, size_t bytes)
Definition mdbx.h:5178
#define LIBMDBX_API
Definition mdbx.h:638
struct iovec MDBX_val
Generic structure used for passing keys and data in and out of the table. .
Definition mdbx.h:810
LIBMDBX_API int mdbx_replace_ex(MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *key, MDBX_val *new_data, MDBX_val *old_data, MDBX_put_flags_t flags, MDBX_preserve_func preserver, void *preserver_context)
LIBMDBX_VERINFO_API const struct MDBX_version_info mdbx_version
libmdbx version information
pthread_t mdbx_tid_t
Definition mdbx.h:173
LIBMDBX_VERINFO_API const struct MDBX_build_info mdbx_build
libmdbx build information
struct MDBX_env MDBX_env
Opaque structure for a database environment.
Definition mdbx.h:742
int mdbx_filehandle_t
Definition mdbx.h:171
LIBMDBX_API const char * mdbx_liberr2str(int errnum)
pid_t mdbx_pid_t
Definition mdbx.h:172
LIBMDBX_API int mdbx_env_openW(MDBX_env *env, const wchar_t *pathname, MDBX_env_flags_t flags, mdbx_mode_t mode)
Open an environment instance.
#define LIBMDBX_VERINFO_API
Definition mdbx.h:659
@ MDBX_MAX_PAGESIZE
Definition mdbx.h:824
@ MDBX_MAXDATASIZE
Definition mdbx.h:818
@ MDBX_MAX_DBI
Definition mdbx.h:815
@ MDBX_MIN_PAGESIZE
Definition mdbx.h:821
libmdbx build information
Definition mdbx.h:680
The fours integers markers (aka "canary") associated with the environment.
Definition mdbx.h:4526
Latency of commit stages in 1/65536 of seconds units.
Definition mdbx.h:4182
Information about the environment.
Definition mdbx.h:2866
Statistics for a table in the environment.
Definition mdbx.h:2818
Information about the transaction.
Definition mdbx.h:4080
libmdbx version information
Definition mdbx.h:663
LIBMDBX_API int mdbx_cursor_del(MDBX_cursor *cursor, MDBX_put_flags_t flags)
Delete current key/data pair.
LIBMDBX_API int mdbx_dbi_sequence(MDBX_txn *txn, MDBX_dbi dbi, uint64_t *result, uint64_t increment)
Sequence generation for a table.
LIBMDBX_API int mdbx_get_equal_or_great(const MDBX_txn *txn, MDBX_dbi dbi, MDBX_val *key, MDBX_val *data)
Get equal or great item from a table.
LIBMDBX_API int mdbx_cursor_scan(MDBX_cursor *cursor, MDBX_predicate_func *predicate, void *context, MDBX_cursor_op start_op, MDBX_cursor_op turn_op, void *arg)
Сканирует таблицу с использованием передаваемого предиката, с уменьшением сопутствующих накладных рас...
LIBMDBX_API int mdbx_canary_put(MDBX_txn *txn, const MDBX_canary *canary)
Set integers markers (aka "canary") associated with the environment.
LIBMDBX_API int mdbx_canary_get(const MDBX_txn *txn, MDBX_canary *canary)
Returns fours integers markers (aka "canary") associated with the environment.
int() MDBX_predicate_func(void *context, MDBX_val *key, MDBX_val *value, void *arg) noexcept
Тип предикативных функций обратного вызова используемых mdbx_cursor_scan() и mdbx_cursor_scan_from() ...
Definition mdbx.h:5550
MDBX_put_flags_t
Data changing flags.
Definition mdbx.h:1686
LIBMDBX_API int mdbx_cursor_get_batch(MDBX_cursor *cursor, size_t *count, MDBX_val *pairs, size_t limit, MDBX_cursor_op op)
Retrieve multiple non-dupsort key/value pairs by cursor.
int() MDBX_cmp_func(const MDBX_val *a, const MDBX_val *b) noexcept
A callback function used to compare two keys in a table.
Definition mdbx.h:4586
LIBMDBX_API int mdbx_cursor_scan_from(MDBX_cursor *cursor, MDBX_predicate_func *predicate, void *context, MDBX_cursor_op from_op, MDBX_val *from_key, MDBX_val *from_value, MDBX_cursor_op turn_op, void *arg)
LIBMDBX_API int mdbx_cmp(const MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *a, const MDBX_val *b)
Compare two keys according to a particular table.
LIBMDBX_API int mdbx_del(MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *key, const MDBX_val *data)
Delete items from a table.
LIBMDBX_API int mdbx_replace(MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *key, MDBX_val *new_data, MDBX_val *old_data, MDBX_put_flags_t flags)
Replace items in a table.
LIBMDBX_API int mdbx_get_ex(const MDBX_txn *txn, MDBX_dbi dbi, MDBX_val *key, MDBX_val *data, size_t *values_count)
Get items from a table and optionally number of data items for a given key.
LIBMDBX_API int mdbx_cursor_count(const MDBX_cursor *cursor, size_t *pcount)
Return count of duplicates for current key.
LIBMDBX_API int mdbx_cursor_put(MDBX_cursor *cursor, const MDBX_val *key, MDBX_val *data, MDBX_put_flags_t flags)
Store by cursor.
LIBMDBX_API int mdbx_put(MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *key, MDBX_val *data, MDBX_put_flags_t flags)
Store items into a table.
LIBMDBX_API int mdbx_drop(MDBX_txn *txn, MDBX_dbi dbi, bool del)
Empty or delete and close a table.
LIBMDBX_API int mdbx_dcmp(const MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *a, const MDBX_val *b)
Compare two data items according to a particular table.
LIBMDBX_API int mdbx_cursor_get(MDBX_cursor *cursor, MDBX_val *key, MDBX_val *data, MDBX_cursor_op op)
Retrieve by cursor.
LIBMDBX_API int mdbx_get(const MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *key, MDBX_val *data)
Get items from a table.
@ MDBX_MULTIPLE
Definition mdbx.h:1723
@ MDBX_ALLDUPS
Definition mdbx.h:1706
@ MDBX_CURRENT
Definition mdbx.h:1701
@ MDBX_APPENDDUP
Definition mdbx.h:1719
@ MDBX_NODUPDATA
Definition mdbx.h:1695
@ MDBX_APPEND
Definition mdbx.h:1714
@ MDBX_UPSERT
Definition mdbx.h:1688
@ MDBX_RESERVE
Definition mdbx.h:1710
@ MDBX_NOOVERWRITE
Definition mdbx.h:1691
LIBMDBX_API int mdbx_cursor_on_first_dup(const MDBX_cursor *cursor)
Определяет стоит ли курсор на первом или единственном мульти-значении соответствующем ключу.
LIBMDBX_API int mdbx_cursor_renew(const MDBX_txn *txn, MDBX_cursor *cursor)
Renew a cursor handle for use within the given transaction.
LIBMDBX_API int mdbx_cursor_unbind(MDBX_cursor *cursor)
Unbind cursor from a transaction.
LIBMDBX_API MDBX_cursor * mdbx_cursor_create(void *context)
Create a cursor handle but not bind it to transaction nor DBI-handle.
LIBMDBX_API MDBX_dbi mdbx_cursor_dbi(const MDBX_cursor *cursor)
Return the cursor's table handle.
MDBX_cursor_op
Cursor operationsThis is the set of all operations for retrieving data using a cursor.
Definition mdbx.h:1763
LIBMDBX_API int mdbx_cursor_compare(const MDBX_cursor *left, const MDBX_cursor *right, bool ignore_multival)
Сравнивает позицию курсоров.
LIBMDBX_API int mdbx_cursor_on_last_dup(const MDBX_cursor *cursor)
Определяет стоит ли курсор на последнем или единственном мульти-значении соответствующем ключу.
LIBMDBX_API int mdbx_cursor_on_first(const MDBX_cursor *cursor)
Determines whether the cursor is pointed to the first key-value pair or not.
LIBMDBX_API int mdbx_cursor_reset(MDBX_cursor *cursor)
Сбрасывает состояние курсора.
struct MDBX_cursor MDBX_cursor
Opaque structure for navigating through a table.
Definition mdbx.h:772
LIBMDBX_API int mdbx_cursor_set_userctx(MDBX_cursor *cursor, void *ctx)
Set application information associated with the cursor.
LIBMDBX_API int mdbx_cursor_open(const MDBX_txn *txn, MDBX_dbi dbi, MDBX_cursor **cursor)
Create a cursor handle for the specified transaction and DBI handle.
LIBMDBX_API int mdbx_cursor_eof(const MDBX_cursor *cursor)
Determines whether the cursor is pointed to a key-value pair or not, i.e. was not positioned or point...
LIBMDBX_API int mdbx_cursor_bind(const MDBX_txn *txn, MDBX_cursor *cursor, MDBX_dbi dbi)
Bind cursor to specified transaction and DBI-handle.
LIBMDBX_API void * mdbx_cursor_get_userctx(const MDBX_cursor *cursor)
Get the application information associated with the MDBX_cursor.
LIBMDBX_API void mdbx_cursor_close(MDBX_cursor *cursor)
Close a cursor handle.
LIBMDBX_API MDBX_txn * mdbx_cursor_txn(const MDBX_cursor *cursor)
Return the cursor's transaction handle.
LIBMDBX_API int mdbx_txn_release_all_cursors(const MDBX_txn *txn, bool unbind)
Unbind or closes all cursors of a given transaction.
LIBMDBX_API int mdbx_cursor_on_last(const MDBX_cursor *cursor)
Determines whether the cursor is pointed to the last key-value pair or not.
LIBMDBX_API int mdbx_cursor_copy(const MDBX_cursor *src, MDBX_cursor *dest)
Copy cursor position and state.
@ MDBX_SET_LOWERBOUND
Definition mdbx.h:1839
@ MDBX_GET_CURRENT
Definition mdbx.h:1778
@ MDBX_GET_BOTH
Definition mdbx.h:1771
@ MDBX_TO_KEY_EQUAL
Definition mdbx.h:1858
@ MDBX_GET_BOTH_RANGE
Definition mdbx.h:1775
@ MDBX_SET_KEY
Definition mdbx.h:1818
@ MDBX_FIRST_DUP
Definition mdbx.h:1768
@ MDBX_TO_KEY_LESSER_OR_EQUAL
Definition mdbx.h:1857
@ MDBX_GET_MULTIPLE
Definition mdbx.h:1783
@ MDBX_TO_EXACT_KEY_VALUE_GREATER_THAN
Definition mdbx.h:1868
@ MDBX_NEXT_NODUP
Definition mdbx.h:1803
@ MDBX_TO_EXACT_KEY_VALUE_LESSER_OR_EQUAL
Definition mdbx.h:1865
@ MDBX_TO_EXACT_KEY_VALUE_EQUAL
Definition mdbx.h:1866
@ MDBX_TO_PAIR_LESSER_OR_EQUAL
Definition mdbx.h:1871
@ MDBX_PREV_MULTIPLE
Definition mdbx.h:1825
@ MDBX_SET_RANGE
Definition mdbx.h:1821
@ MDBX_LAST_DUP
Definition mdbx.h:1789
@ MDBX_PREV
Definition mdbx.h:1806
@ MDBX_TO_PAIR_GREATER_OR_EQUAL
Definition mdbx.h:1873
@ MDBX_TO_PAIR_GREATER_THAN
Definition mdbx.h:1874
@ MDBX_LAST
Definition mdbx.h:1786
@ MDBX_TO_KEY_LESSER_THAN
Definition mdbx.h:1856
@ MDBX_PREV_DUP
Definition mdbx.h:1809
@ MDBX_TO_EXACT_KEY_VALUE_LESSER_THAN
Definition mdbx.h:1864
@ MDBX_SET
Definition mdbx.h:1815
@ MDBX_NEXT
Definition mdbx.h:1792
@ MDBX_TO_KEY_GREATER_OR_EQUAL
Definition mdbx.h:1859
@ MDBX_TO_PAIR_LESSER_THAN
Definition mdbx.h:1870
@ MDBX_NEXT_MULTIPLE
Definition mdbx.h:1800
@ MDBX_PREV_NODUP
Definition mdbx.h:1812
@ MDBX_TO_PAIR_EQUAL
Definition mdbx.h:1872
@ MDBX_NEXT_DUP
Definition mdbx.h:1795
@ MDBX_TO_EXACT_KEY_VALUE_GREATER_OR_EQUAL
Definition mdbx.h:1867
@ MDBX_SET_UPPERBOUND
Definition mdbx.h:1853
@ MDBX_TO_KEY_GREATER_THAN
Definition mdbx.h:1860
@ MDBX_FIRST
Definition mdbx.h:1765
LIBMDBX_API int mdbx_dbi_open_ex2(MDBX_txn *txn, const MDBX_val *name, MDBX_db_flags_t flags, MDBX_dbi *dbi, MDBX_cmp_func *keycmp, MDBX_cmp_func *datacmp)
Open or Create a named table in the environment with using custom comparison functions.
LIBMDBX_API int mdbx_dbi_open_ex(MDBX_txn *txn, const char *name, MDBX_db_flags_t flags, MDBX_dbi *dbi, MDBX_cmp_func *keycmp, MDBX_cmp_func *datacmp)
Open or Create a named table in the environment with using custom comparison functions.
LIBMDBX_API int mdbx_dbi_rename(MDBX_txn *txn, MDBX_dbi dbi, const char *name)
Переименовает таблицу по DBI-дескриптору
LIBMDBX_API int mdbx_dbi_rename2(MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *name)
Переименовает таблицу по DBI-дескриптору
LIBMDBX_API int mdbx_dbi_close(MDBX_env *env, MDBX_dbi dbi)
Close a table handle. Normally unnecessary.
LIBMDBX_API int mdbx_dbi_open(MDBX_txn *txn, const char *name, MDBX_db_flags_t flags, MDBX_dbi *dbi)
Open or Create a named table in the environment.
LIBMDBX_API int mdbx_dbi_open2(MDBX_txn *txn, const MDBX_val *name, MDBX_db_flags_t flags, MDBX_dbi *dbi)
Open or Create a named table in the environment.
uint32_t MDBX_dbi
A handle for an individual table (key-value spaces) in the environment.
Definition mdbx.h:765
MDBX_db_flags_t
Table flags.
Definition mdbx.h:1636
@ MDBX_INTEGERDUP
Definition mdbx.h:1660
@ MDBX_DB_ACCEDE
Definition mdbx.h:1678
@ MDBX_DB_DEFAULTS
Definition mdbx.h:1638
@ MDBX_REVERSEKEY
Definition mdbx.h:1641
@ MDBX_DUPFIXED
Definition mdbx.h:1655
@ MDBX_INTEGERKEY
Definition mdbx.h:1651
@ MDBX_REVERSEDUP
Definition mdbx.h:1663
@ MDBX_CREATE
Definition mdbx.h:1666
@ MDBX_DUPSORT
Definition mdbx.h:1644
LIBMDBX_API const char * mdbx_dump_val(const MDBX_val *key, char *const buf, const size_t bufsize)
Dump given MDBX_val to the buffer.
MDBX_NORETURN LIBMDBX_API void mdbx_panic(const char *fmt,...) MDBX_PRINTF_ARGS(1
Panics with message and causes abnormal process termination.
void MDBX_debug_func_nofmt(MDBX_log_level_t loglevel, const char *function, int line, const char *msg, unsigned length) noexcept
Definition mdbx.h:1012
void MDBX_assert_func(const MDBX_env *env, const char *msg, const char *function, unsigned line) noexcept
A callback function for most MDBX assert() failures, called before printing the message and aborting.
Definition mdbx.h:1033
MDBX_log_level_t
Definition mdbx.h:885
MDBX_debug_flags_t
Runtime debug flags.
Definition mdbx.h:942
LIBMDBX_API int mdbx_env_set_assert(MDBX_env *env, MDBX_assert_func *func)
Set or reset the assert() callback of the environment.
MDBX_NORETURN LIBMDBX_API void MDBX_NORETURN LIBMDBX_API void mdbx_assert_fail(const MDBX_env *env, const char *msg, const char *func, unsigned line)
Panics with asserton failed message and causes abnormal process termination.
void MDBX_debug_func(MDBX_log_level_t loglevel, const char *function, int line, const char *fmt, va_list args) noexcept
A debug-logger callback function, called before printing the message and aborting.
Definition mdbx.h:997
LIBMDBX_API int mdbx_setup_debug(MDBX_log_level_t log_level, MDBX_debug_flags_t debug_flags, MDBX_debug_func *logger)
Setup global log-level, debug options and debug logger.
LIBMDBX_API int mdbx_setup_debug_nofmt(MDBX_log_level_t log_level, MDBX_debug_flags_t debug_flags, MDBX_debug_func_nofmt *logger, char *logger_buffer, size_t logger_buffer_size)
@ MDBX_LOG_EXTRA
Definition mdbx.h:927
@ MDBX_LOG_WARN
Definition mdbx.h:901
@ MDBX_LOG_TRACE
Definition mdbx.h:922
@ MDBX_LOG_DEBUG
Definition mdbx.h:917
@ MDBX_LOG_FATAL
Definition mdbx.h:889
@ MDBX_LOG_ERROR
Definition mdbx.h:895
@ MDBX_LOG_NOTICE
Definition mdbx.h:907
@ MDBX_LOG_DONTCHANGE
Definition mdbx.h:934
@ MDBX_LOG_VERBOSE
Definition mdbx.h:912
@ MDBX_DBG_ASSERT
Definition mdbx.h:948
@ MDBX_DBG_DONT_UPGRADE
Definition mdbx.h:971
@ MDBX_DBG_LEGACY_OVERLAP
Definition mdbx.h:966
@ MDBX_DBG_LEGACY_MULTIOPEN
Definition mdbx.h:963
@ MDBX_DBG_NONE
Definition mdbx.h:943
@ MDBX_DBG_DUMP
Definition mdbx.h:960
@ MDBX_DBG_DONTCHANGE
Definition mdbx.h:979
@ MDBX_DBG_AUDIT
Definition mdbx.h:952
@ MDBX_DBG_JITTER
Definition mdbx.h:956
LIBMDBX_API int mdbx_env_set_hsr(MDBX_env *env, MDBX_hsr_func *hsr_callback)
Sets a Handle-Slow-Readers callback to resolve database full/overflow issue due to a reader(s) which ...
int() MDBX_hsr_func(const MDBX_env *env, const MDBX_txn *txn, mdbx_pid_t pid, mdbx_tid_t tid, uint64_t laggard, unsigned gap, size_t space, int retry) noexcept
A Handle-Slow-Readers callback function to resolve database full/overflow issue due to a reader(s) wh...
Definition mdbx.h:6358
LIBMDBX_API const char * mdbx_strerror(int errnum)
Return a string describing a given error code.
LIBMDBX_API const char * mdbx_strerror_ANSI2OEM(int errnum)
MDBX_error_t
Errors and return codes.
Definition mdbx.h:1882
LIBMDBX_API const char * mdbx_strerror_r(int errnum, char *buf, size_t buflen)
Return a string describing a given error code.
LIBMDBX_API const char * mdbx_strerror_r_ANSI2OEM(int errnum, char *buf, size_t buflen)
@ MDBX_PANIC
Definition mdbx.h:1909
@ MDBX_FIRST_LMDB_ERRCODE
Definition mdbx.h:1896
@ MDBX_EKEYMISMATCH
Definition mdbx.h:1998
@ MDBX_UNABLE_EXTEND_MAPSIZE
Definition mdbx.h:1943
@ MDBX_EACCESS
Definition mdbx.h:2055
@ MDBX_EIO
Definition mdbx.h:2059
@ MDBX_PAGE_NOTFOUND
Definition mdbx.h:1902
@ MDBX_TXN_FULL
Definition mdbx.h:1927
@ MDBX_DUPLICATED_CLK
Definition mdbx.h:2018
@ MDBX_VERSION_MISMATCH
Definition mdbx.h:1912
@ MDBX_WANNA_RECOVERY
Definition mdbx.h:1995
@ MDBX_TXN_OVERLAPPING
Definition mdbx.h:2009
@ MDBX_EREMOTE
Definition mdbx.h:2063
@ MDBX_TOO_LARGE
Definition mdbx.h:2002
@ MDBX_EBADSIGN
Definition mdbx.h:1991
@ MDBX_CURSOR_FULL
Definition mdbx.h:1931
@ MDBX_ENOFILE
Definition mdbx.h:2062
@ MDBX_BAD_TXN
Definition mdbx.h:1962
@ MDBX_ENODATA
Definition mdbx.h:2052
@ MDBX_LAST_LMDB_ERRCODE
Definition mdbx.h:1976
@ MDBX_CORRUPTED
Definition mdbx.h:1905
@ MDBX_EPERM
Definition mdbx.h:2060
@ MDBX_THREAD_MISMATCH
Definition mdbx.h:2006
@ MDBX_BACKLOG_DEPLETED
Definition mdbx.h:2015
@ MDBX_SUCCESS
Definition mdbx.h:1884
@ MDBX_NOTFOUND
Definition mdbx.h:1899
@ MDBX_RESULT_TRUE
Definition mdbx.h:1890
@ MDBX_INVALID
Definition mdbx.h:1915
@ MDBX_BAD_VALSIZE
Definition mdbx.h:1966
@ MDBX_BUSY
Definition mdbx.h:1980
@ MDBX_OUSTED
Definition mdbx.h:2026
@ MDBX_DBS_FULL
Definition mdbx.h:1921
@ MDBX_EINVAL
Definition mdbx.h:2054
@ MDBX_BAD_RSLOT
Definition mdbx.h:1957
@ MDBX_ENOMEM
Definition mdbx.h:2056
@ MDBX_FIRST_ADDED_ERRCODE
Definition mdbx.h:1983
@ MDBX_RESULT_FALSE
Definition mdbx.h:1887
@ MDBX_EINTR
Definition mdbx.h:2061
@ MDBX_READERS_FULL
Definition mdbx.h:1924
@ MDBX_LAST_ADDED_ERRCODE
Definition mdbx.h:2033
@ MDBX_BAD_DBI
Definition mdbx.h:1970
@ MDBX_KEYEXIST
Definition mdbx.h:1893
@ MDBX_DANGLING_DBI
Definition mdbx.h:2022
@ MDBX_EDEADLK
Definition mdbx.h:2064
@ MDBX_PAGE_FULL
Definition mdbx.h:1934
@ MDBX_MAP_FULL
Definition mdbx.h:1918
@ MDBX_PROBLEM
Definition mdbx.h:1973
@ MDBX_ENOSYS
Definition mdbx.h:2058
@ MDBX_EMULTIVAL
Definition mdbx.h:1986
@ MDBX_EROFS
Definition mdbx.h:2057
@ MDBX_MVCC_RETARDED
Definition mdbx.h:2030
@ MDBX_INCOMPATIBLE
Definition mdbx.h:1953
LIBMDBX_API MDBX_cmp_func * mdbx_get_datacmp(MDBX_db_flags_t flags)
Returns default internal data's comparator for given table flags.
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.
LIBMDBX_API int mdbx_txn_copy2pathname(MDBX_txn *txn, const char *dest, MDBX_copy_flags_t flags)
Copy an MDBX environment by given read transaction to the specified path, with options.
MDBX_copy_flags_t
Environment copy flags.
Definition mdbx.h:1730
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:3023
LIBMDBX_API MDBX_cmp_func * mdbx_get_keycmp(MDBX_db_flags_t flags)
Returns default internal key's comparator for given table flags.
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:3030
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_API int mdbx_env_resurrect_after_fork(MDBX_env *env)
Восстанавливает экземпляр среды в дочернем процессе после ветвления родительского процесса посредство...
MDBX_env_delete_mode_t
Deletion modes for mdbx_env_delete().
Definition mdbx.h:2577
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_cursor_ignord(MDBX_cursor *cursor)
Служебная функция для использования в утилитах.
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.
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_txn_copy2fd(MDBX_txn *txn, mdbx_filehandle_t fd, MDBX_copy_flags_t flags)
Copy an environment by given read transaction to the specified file descriptor, with options.
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.
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.
LIBMDBX_API int mdbx_txn_copy2pathnameW(MDBX_txn *txn, const wchar_t *dest, MDBX_copy_flags_t flags)
Copy an MDBX environment by given read transaction to the specified path, with options.
@ MDBX_CP_DISPOSE_TXN
Definition mdbx.h:1749
@ MDBX_CP_DEFAULTS
Definition mdbx.h:1731
@ MDBX_CP_COMPACT
Definition mdbx.h:1735
@ MDBX_CP_RENEW_TXN
Definition mdbx.h:1754
@ MDBX_CP_THROTTLE_MVCC
Definition mdbx.h:1745
@ MDBX_CP_FORCE_DYNAMIC_SIZE
Definition mdbx.h:1738
@ MDBX_CP_DONT_FLUSH
Definition mdbx.h:1741
@ MDBX_ENV_WAIT_FOR_UNUSED
Wait until other processes closes the environment before deletion.
Definition mdbx.h:2590
@ MDBX_ENV_JUST_DELETE
Just delete the environment's files and directory if any.
Definition mdbx.h:2584
@ MDBX_ENV_ENSURE_UNUSED
Make sure that the environment is not being used by other processes, or return an error otherwise.
Definition mdbx.h:2587
LIBMDBX_API int mdbx_env_create(MDBX_env **penv)
Create an MDBX environment instance.
int mdbx_env_close(MDBX_env *env)
The shortcut to calling mdbx_env_close_ex() with the dont_sync=false argument.
Definition mdbx.h:3195
MDBX_env_flags_t
Environment flags.
Definition mdbx.h:1076
LIBMDBX_API int mdbx_env_close_ex(MDBX_env *env, bool dont_sync)
Close the environment and release the memory map.
LIBMDBX_API int mdbx_preopen_snapinfoW(const wchar_t *pathname, MDBX_envinfo *info, size_t bytes)
Получает базовую информацию о БД не открывая её.
LIBMDBX_API int mdbx_env_open(MDBX_env *env, const char *pathname, MDBX_env_flags_t flags, mdbx_mode_t mode)
Open an environment instance.
LIBMDBX_API int mdbx_preopen_snapinfo(const char *pathname, MDBX_envinfo *info, size_t bytes)
Получает базовую информацию о БД не открывая её.
@ MDBX_NORDAHEAD
Definition mdbx.h:1291
@ MDBX_ENV_DEFAULTS
Definition mdbx.h:1077
@ MDBX_COALESCE
Definition mdbx.h:1327
@ MDBX_NOMETASYNC
Definition mdbx.h:1426
@ MDBX_LIFORECLAIM
Definition mdbx.h:1351
@ MDBX_SAFE_NOSYNC
Definition mdbx.h:1477
@ MDBX_NOTLS
Definition mdbx.h:1270
@ MDBX_SYNC_DURABLE
Definition mdbx.h:1408
@ MDBX_PAGEPERTURB
Definition mdbx.h:1354
@ MDBX_WRITEMAP
Definition mdbx.h:1196
@ MDBX_NOSTICKYTHREADS
Definition mdbx.h:1267
@ MDBX_EXCLUSIVE
Definition mdbx.h:1150
@ MDBX_NOMEMINIT
Definition mdbx.h:1314
@ MDBX_MAPASYNC
Definition mdbx.h:1484
@ MDBX_ACCEDE
Definition mdbx.h:1165
@ MDBX_NOSUBDIR
Definition mdbx.h:1102
@ MDBX_RDONLY
Definition mdbx.h:1120
@ MDBX_UTTERLY_NOSYNC
Definition mdbx.h:1527
@ MDBX_VALIDATION
Definition mdbx.h:1084
LIBMDBX_API int mdbx_estimate_distance(const MDBX_cursor *first, const MDBX_cursor *last, ptrdiff_t *distance_items)
Estimates the distance between cursors as a number of elements.
LIBMDBX_API int mdbx_estimate_move(const MDBX_cursor *cursor, MDBX_val *key, MDBX_val *data, MDBX_cursor_op move_op, ptrdiff_t *distance_items)
Estimates the move distance.
LIBMDBX_API int mdbx_estimate_range(const MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *begin_key, const MDBX_val *begin_data, const MDBX_val *end_key, const MDBX_val *end_data, ptrdiff_t *distance_items)
Estimates the size of a range as a number of elements.
int mdbx_env_set_mapsize(MDBX_env *env, size_t size)
Definition mdbx.h:3643
int mdbx_env_set_maxdbs(MDBX_env *env, MDBX_dbi dbs)
Set the maximum number of named tables for the environment.
Definition mdbx.h:3805
LIBMDBX_API int mdbx_env_warmup(const MDBX_env *env, const MDBX_txn *txn, MDBX_warmup_flags_t flags, unsigned timeout_seconds_16dot16)
Warms up the database by loading pages into memory, optionally lock ones.
LIBMDBX_API int mdbx_env_get_option(const MDBX_env *env, const MDBX_option_t option, uint64_t *pvalue)
Gets the value of extra runtime options from an environment.
int mdbx_env_set_syncperiod(MDBX_env *env, unsigned seconds_16dot16)
Sets relative period since the last unsteady commit to force flush the data buffers to disk,...
Definition mdbx.h:3118
MDBX_option_t
MDBX environment extra runtime options.
Definition mdbx.h:2158
LIBMDBX_API int mdbx_env_set_geometry(MDBX_env *env, intptr_t size_lower, intptr_t size_now, intptr_t size_upper, intptr_t growth_step, intptr_t shrink_threshold, intptr_t pagesize)
Set all size-related parameters of environment, including page size and the min/max size of the memor...
int mdbx_env_set_syncbytes(MDBX_env *env, size_t threshold)
Sets threshold to force flush the data buffers to disk, even any of MDBX_SAFE_NOSYNC flag in the envi...
Definition mdbx.h:3057
MDBX_warmup_flags_t
Warming up options.
Definition mdbx.h:3283
LIBMDBX_API int mdbx_env_set_option(MDBX_env *env, const MDBX_option_t option, uint64_t value)
Sets the value of a extra runtime options for an environment.
LIBMDBX_API int mdbx_env_set_userctx(MDBX_env *env, void *ctx)
Sets application information (a context pointer) associated with the environment.
int mdbx_env_set_maxreaders(MDBX_env *env, unsigned readers)
Set the maximum number of threads/reader slots for for all processes interacts with the database.
Definition mdbx.h:3759
LIBMDBX_API int mdbx_env_set_flags(MDBX_env *env, MDBX_env_flags_t flags, bool onoff)
Set environment flags.
@ MDBX_opt_txn_dp_initial
Controls the in-process initial allocation size for dirty pages list of a write transaction....
Definition mdbx.h:2262
@ MDBX_opt_subpage_room_threshold
Задаёт в % минимальный объём свободного места на основной странице, при отсутствии которого вложенные...
Definition mdbx.h:2435
@ MDBX_opt_subpage_limit
Задаёт в % максимальный размер вложенных страниц, используемых для размещения небольшого количества м...
Definition mdbx.h:2429
@ MDBX_opt_txn_dp_limit
Controls the in-process limit of dirty pages for a write transaction.
Definition mdbx.h:2258
@ MDBX_opt_prefer_waf_insteadof_balance
Управляет выбором между стремлением к равномерности наполнения страниц, либо уменьшением количества и...
Definition mdbx.h:2414
@ MDBX_opt_prefault_write_enable
Controls prevention of page-faults of reclaimed and allocated pages in the MDBX_WRITEMAP mode by clea...
Definition mdbx.h:2362
@ MDBX_opt_max_db
Controls the maximum number of named tables for the environment.
Definition mdbx.h:2167
@ MDBX_opt_merge_threshold_16dot16_percent
Controls the in-process threshold of semi-empty pages merge.
Definition mdbx.h:2329
@ MDBX_opt_subpage_reserve_prereq
Задаёт в % минимальный объём свободного места на основной странице, при наличии которого,...
Definition mdbx.h:2451
@ MDBX_opt_sync_bytes
Controls interprocess/shared threshold to force flush the data buffers to disk, if MDBX_SAFE_NOSYNC i...
Definition mdbx.h:2190
@ MDBX_opt_spill_min_denominator
Controls the in-process how minimal part of the dirty pages should be spilled when necessary.
Definition mdbx.h:2294
@ MDBX_opt_spill_parent4child_denominator
Controls the in-process how much of the parent transaction dirty pages will be spilled while start ea...
Definition mdbx.h:2317
@ MDBX_opt_loose_limit
Controls the in-process limit to grow a cache of dirty pages for reuse in the current transaction.
Definition mdbx.h:2230
@ MDBX_opt_rp_augment_limit
Controls the in-process limit to grow a list of reclaimed/recycled page's numbers for finding a seque...
Definition mdbx.h:2217
@ MDBX_opt_max_readers
Defines the maximum number of threads/reader slots for all processes interacting with the database.
Definition mdbx.h:2184
@ MDBX_opt_subpage_reserve_limit
Задаёт в % ограничение резервирования места на вложенных страницах.
Definition mdbx.h:2456
@ MDBX_opt_spill_max_denominator
Controls the in-process how maximal part of the dirty pages may be spilled when necessary.
Definition mdbx.h:2278
@ MDBX_opt_sync_period
Controls interprocess/shared relative period since the last unsteady commit to force flush the data b...
Definition mdbx.h:2196
@ MDBX_opt_dp_reserve_limit
Controls the in-process limit of a pre-allocated memory items for dirty pages.
Definition mdbx.h:2244
@ MDBX_opt_writethrough_threshold
Controls the choosing between use write-through disk writes and usual ones with followed flush by the...
Definition mdbx.h:2357
@ MDBX_opt_gc_time_limit
Controls the in-process spending time limit of searching consecutive pages inside GC.
Definition mdbx.h:2389
@ MDBX_warmup_touchlimit
Definition mdbx.h:3322
@ MDBX_warmup_force
Definition mdbx.h:3292
@ MDBX_warmup_oomsafe
Definition mdbx.h:3299
@ MDBX_warmup_release
Definition mdbx.h:3325
@ MDBX_warmup_lock
Definition mdbx.h:3314
@ MDBX_warmup_default
Definition mdbx.h:3286
LIBMDBX_API int mdbx_env_get_path(const MDBX_env *env, const char **dest)
Return the path that was used in mdbx_env_open().
LIBMDBX_API int mdbx_dbi_stat(const MDBX_txn *txn, MDBX_dbi dbi, MDBX_stat *stat, size_t bytes)
Retrieve statistics for a table.
LIBMDBX_API intptr_t mdbx_limits_keysize_min(MDBX_db_flags_t flags)
Returns minimal key size in bytes for given table flags.
LIBMDBX_API uint64_t mdbx_txn_id(const MDBX_txn *txn)
Return the transaction's ID.
LIBMDBX_API intptr_t mdbx_limits_valsize_max(intptr_t pagesize, MDBX_db_flags_t flags)
Returns maximal data size in bytes for given page size and table flags, or -1 if pagesize is invalid.
LIBMDBX_API int mdbx_env_info_ex(const MDBX_env *env, const MDBX_txn *txn, MDBX_envinfo *info, size_t bytes)
Return information about the MDBX environment.
int mdbx_env_get_maxreaders(const MDBX_env *env, unsigned *readers)
Get the maximum number of threads/reader slots for the environment.
Definition mdbx.h:3774
int mdbx_env_get_syncperiod(const MDBX_env *env, unsigned *period_seconds_16dot16)
Get relative period since the last unsteady commit to force flush the data buffers to disk,...
Definition mdbx.h:3138
LIBMDBX_API int mdbx_env_get_maxkeysize_ex(const MDBX_env *env, MDBX_db_flags_t flags)
Returns the maximum size of keys can put.
LIBMDBX_API int mdbx_txn_straggler(const MDBX_txn *txn, int *percent)
Returns a lag of the reading for the given transaction.
LIBMDBX_API int mdbx_env_get_maxvalsize_ex(const MDBX_env *env, MDBX_db_flags_t flags)
Returns the maximum size of data we can put.
LIBMDBX_API int mdbx_env_stat_ex(const MDBX_env *env, const MDBX_txn *txn, MDBX_stat *stat, size_t bytes)
Return statistics about the MDBX environment.
int mdbx_dbi_flags(const MDBX_txn *txn, MDBX_dbi dbi, unsigned *flags)
The shortcut to calling mdbx_dbi_flags_ex() with state=NULL for discarding it result.
Definition mdbx.h:4901
LIBMDBX_API int mdbx_env_get_pairsize4page_max(const MDBX_env *env, MDBX_db_flags_t flags)
Returns maximal size of key-value pair to fit in a single page for specified table flags.
LIBMDBX_API intptr_t mdbx_limits_valsize_min(MDBX_db_flags_t flags)
Returns minimal data size in bytes for given table flags.
int mdbx_env_info(const MDBX_env *env, MDBX_envinfo *info, size_t bytes)
Return information about the MDBX environment.
Definition mdbx.h:2977
int mdbx_env_get_syncbytes(const MDBX_env *env, size_t *threshold)
Get threshold to force flush the data buffers to disk, even any of MDBX_SAFE_NOSYNC flag in the envir...
Definition mdbx.h:3075
LIBMDBX_API int mdbx_enumerate_tables(const MDBX_txn *txn, MDBX_table_enum_func *func, void *ctx)
Перечисляет пользовательские именнованные таблицы.
LIBMDBX_API intptr_t mdbx_limits_valsize4page_max(intptr_t pagesize, MDBX_db_flags_t flags)
Returns maximal data size in bytes to fit in a leaf-page or single large/overflow-page with the given...
LIBMDBX_API intptr_t mdbx_limits_txnsize_max(intptr_t pagesize)
Returns maximal write transaction size (i.e. limit for summary volume of dirty pages) in bytes for gi...
intptr_t mdbx_limits_pgsize_max(void)
Returns the maximal database page size in bytes.
Definition mdbx.h:3673
LIBMDBX_API int mdbx_dbi_dupsort_depthmask(const MDBX_txn *txn, MDBX_dbi dbi, uint32_t *mask)
Retrieve depth (bitmask) information of nested dupsort (multi-value) B+trees for given table.
LIBMDBX_API int mdbx_txn_info(const MDBX_txn *txn, MDBX_txn_info *info, bool scan_rlt)
Return information about the MDBX transaction.
LIBMDBX_API int mdbx_is_dirty(const MDBX_txn *txn, const void *ptr)
Determines whether the given address is on a dirty database page of the transaction or not.
MDBX_dbi_state_t
DBI state bits returted by mdbx_dbi_flags_ex()
Definition mdbx.h:4872
LIBMDBX_API int mdbx_env_get_valsize4page_max(const MDBX_env *env, MDBX_db_flags_t flags)
Returns maximal data size in bytes to fit in a leaf-page or single large/overflow-page for specified ...
intptr_t mdbx_limits_pgsize_min(void)
Returns the minimal database page size in bytes.
Definition mdbx.h:3667
LIBMDBX_API int mdbx_env_get_maxkeysize(const MDBX_env *env)
LIBMDBX_API int mdbx_env_get_fd(const MDBX_env *env, mdbx_filehandle_t *fd)
Return the file descriptor for the given environment.
LIBMDBX_API void * mdbx_env_get_userctx(const MDBX_env *env)
Returns an application information (a context pointer) associated with the environment.
int() MDBX_table_enum_func(void *ctx, const MDBX_txn *txn, const MDBX_val *name, MDBX_db_flags_t flags, const struct MDBX_stat *stat, MDBX_dbi dbi) noexcept
Функция обратного вызова для перечисления пользовательских именованных таблиц.
Definition mdbx.h:4750
int() MDBX_reader_list_func(void *ctx, int num, int slot, mdbx_pid_t pid, mdbx_tid_t thread, uint64_t txnid, uint64_t lag, size_t bytes_used, size_t bytes_retained) noexcept
A callback function used to enumerate the reader lock table.
Definition mdbx.h:6206
int mdbx_env_get_maxdbs(const MDBX_env *env, MDBX_dbi *dbs)
Get the maximum number of named tables for the environment.
Definition mdbx.h:3819
LIBMDBX_API int mdbx_env_get_pathW(const MDBX_env *env, const wchar_t **dest)
Return the path that was used in mdbx_env_open().
LIBMDBX_API intptr_t mdbx_limits_keysize_max(intptr_t pagesize, MDBX_db_flags_t flags)
Returns maximal key size in bytes for given page size and table flags, or -1 if pagesize is invalid.
LIBMDBX_API size_t mdbx_default_pagesize(void)
Returns the default size of database page for the current system.
LIBMDBX_API int mdbx_reader_list(const MDBX_env *env, MDBX_reader_list_func *func, void *ctx)
Enumerate the entries in the reader lock table.
LIBMDBX_API int mdbx_get_sysraminfo(intptr_t *page_size, intptr_t *total_pages, intptr_t *avail_pages)
Returns basic information about system RAM. This function provides a portable way to get information ...
int mdbx_env_stat(const MDBX_env *env, MDBX_stat *stat, size_t bytes)
Return statistics about the MDBX environment.
Definition mdbx.h:2858
LIBMDBX_API intptr_t mdbx_limits_pairsize4page_max(intptr_t pagesize, MDBX_db_flags_t flags)
Returns maximal size of key-value pair to fit in a single page with the given size and table flags,...
LIBMDBX_API intptr_t mdbx_limits_dbsize_max(intptr_t pagesize)
Returns maximal database size in bytes for given page size, or -1 if pagesize is invalid.
LIBMDBX_API intptr_t mdbx_limits_dbsize_min(intptr_t pagesize)
Returns minimal database size in bytes for given page size, or -1 if pagesize is invalid.
LIBMDBX_API int mdbx_env_get_flags(const MDBX_env *env, unsigned *flags)
Get environment flags.
LIBMDBX_API int mdbx_dbi_flags_ex(const MDBX_txn *txn, MDBX_dbi dbi, unsigned *flags, unsigned *state)
Retrieve the DB flags and status for a table handle.
@ MDBX_DBI_DIRTY
Definition mdbx.h:4874
@ MDBX_DBI_FRESH
Definition mdbx.h:4878
@ MDBX_DBI_STALE
Definition mdbx.h:4876
@ MDBX_DBI_CREAT
Definition mdbx.h:4880
LIBMDBX_API int mdbx_txn_break(MDBX_txn *txn)
Marks transaction as broken.
LIBMDBX_API int mdbx_txn_set_userctx(MDBX_txn *txn, void *ctx)
Sets application information associated (a context pointer) with the transaction.
LIBMDBX_API int mdbx_txn_park(MDBX_txn *txn, bool autounpark)
Переводит читающую транзакцию в "припаркованное" состояние.
LIBMDBX_API int mdbx_txn_begin_ex(MDBX_env *env, MDBX_txn *parent, MDBX_txn_flags_t flags, MDBX_txn **txn, void *context)
Create a transaction with a user provided context pointer for use with the environment.
int mdbx_txn_commit(MDBX_txn *txn)
Commit all the operations of a transaction into the database.
Definition mdbx.h:4319
LIBMDBX_API int mdbx_txn_commit_ex(MDBX_txn *txn, MDBX_commit_latency *latency)
Commit all the operations of a transaction into the database and collect latency information.
LIBMDBX_API MDBX_env * mdbx_txn_env(const MDBX_txn *txn)
Returns the transaction's MDBX_env.
LIBMDBX_API int mdbx_txn_unpark(MDBX_txn *txn, bool restart_if_ousted)
Распарковывает ранее припаркованную читающую транзакцию.
MDBX_txn_flags_t
Definition mdbx.h:1537
LIBMDBX_API void * mdbx_txn_get_userctx(const MDBX_txn *txn)
Returns an application information (a context pointer) associated with the transaction.
int mdbx_txn_begin(MDBX_env *env, MDBX_txn *parent, MDBX_txn_flags_t flags, MDBX_txn **txn)
Create a transaction for use with the environment.
Definition mdbx.h:4047
LIBMDBX_API int mdbx_txn_abort(MDBX_txn *txn)
Abandon all the operations of the transaction instead of saving them.
struct MDBX_txn MDBX_txn
Opaque structure for a transaction handle.
Definition mdbx.h:753
LIBMDBX_API int mdbx_txn_reset(MDBX_txn *txn)
Reset a read-only transaction.
LIBMDBX_API int mdbx_txn_renew(MDBX_txn *txn)
Renew a read-only transaction.
LIBMDBX_API MDBX_txn_flags_t mdbx_txn_flags(const MDBX_txn *txn)
Return the transaction's flags.
@ MDBX_TXN_RDONLY
Definition mdbx.h:1548
@ MDBX_TXN_ERROR
Definition mdbx.h:1588
@ MDBX_TXN_NOMETASYNC
Definition mdbx.h:1567
@ MDBX_TXN_SPILLS
Definition mdbx.h:1598
@ MDBX_TXN_OUSTED
Definition mdbx.h:1622
@ MDBX_TXN_HAS_CHILD
Definition mdbx.h:1603
@ MDBX_TXN_RDONLY_PREPARE
Definition mdbx.h:1557
@ MDBX_TXN_INVALID
Definition mdbx.h:1578
@ MDBX_TXN_BLOCKED
Definition mdbx.h:1627
@ MDBX_TXN_PARKED
Definition mdbx.h:1608
@ MDBX_TXN_NOSYNC
Definition mdbx.h:1571
@ MDBX_TXN_DIRTY
Definition mdbx.h:1593
@ MDBX_TXN_READWRITE
Definition mdbx.h:1542
@ MDBX_TXN_AUTOUNPARK
Definition mdbx.h:1615
@ MDBX_TXN_TRY
Definition mdbx.h:1563
@ MDBX_TXN_FINISHED
Definition mdbx.h:1583
MDBX_chk_severity_t verbosity
Definition mdbx.h:6582
MDBX_txn * txn
Definition mdbx.h:6647
size_t pad
Definition mdbx.h:6599
struct MDBX_chk_internal * internal
Definition mdbx.h:6645
uint8_t scope_nesting
Definition mdbx.h:6649
size_t ones
Definition mdbx.h:6599
struct MDBX_chk_histogram::@8 ranges[9]
struct MDBX_chk_internal * internal
Definition mdbx.h:6579
char * begin
Definition mdbx.h:6564
size_t subtotal_issues
Definition mdbx.h:6583
MDBX_chk_user_table_cookie_t * cookie
Definition mdbx.h:6609
struct MDBX_chk_context * ctx
Definition mdbx.h:6562
MDBX_db_flags_t flags
Definition mdbx.h:6619
struct MDBX_chk_issue * next
Definition mdbx.h:6570
const void * object
Definition mdbx.h:6580
size_t count
Definition mdbx.h:6599
const char * caption
Definition mdbx.h:6572
MDBX_chk_stage_t stage
Definition mdbx.h:6581
MDBX_env * env
Definition mdbx.h:6646
uint8_t empty
Definition mdbx.h:6563
size_t amount
Definition mdbx.h:6599
MDBX_chk_scope_t * scope
Definition mdbx.h:6648
MDBX_chk_issue_t * issues
Definition mdbx.h:6578
size_t count
Definition mdbx.h:6571
MDBX_val name
Definition mdbx.h:6618
size_t lost_bytes
Definition mdbx.h:6622
int id
Definition mdbx.h:6620
LIBMDBX_API int mdbx_env_chk_encount_problem(MDBX_chk_context_t *ctx)
Вспомогательная функция для подсчета проблем детектируемых приложением, в том числе,...
LIBMDBX_API int mdbx_env_chk(MDBX_env *env, const MDBX_chk_callbacks_t *cb, MDBX_chk_context_t *ctx, const MDBX_chk_flags_t flags, MDBX_chk_severity_t verbosity, unsigned timeout_seconds_16dot16)
Проверяет целостность базы данных.
MDBX_chk_stage_t
Стадии проверки, сообщаемые через обратные вызовы при проверке целостности базы данных.
Definition mdbx.h:6544
LIBMDBX_API int mdbx_txn_unlock(MDBX_env *env)
Releases write-transaction lock. Provided for custom and/or complex locking scenarios.
struct MDBX_chk_user_table_cookie MDBX_chk_user_table_cookie_t
Пользовательский тип для привязки дополнительных данных, связанных с некоторой таблицей ключ-значение...
Definition mdbx.h:6593
MDBX_chk_flags_t
Флаги/опции для проверки целостности базы данных.
Definition mdbx.h:6501
MDBX_chk_severity_t
Уровни логирование/детализации информации, поставляемой через обратные вызовы при проверке целостност...
Definition mdbx.h:6525
LIBMDBX_API int mdbx_txn_lock(MDBX_env *env, bool dont_wait)
Acquires write-transaction lock. Provided for custom and/or complex locking scenarios.
LIBMDBX_API int mdbx_env_turn_for_recovery(MDBX_env *env, unsigned target_meta)
Turn database to the specified meta-page.
LIBMDBX_API int mdbx_env_open_for_recovery(MDBX_env *env, const char *pathname, unsigned target_meta, bool writeable)
Open an environment instance using specific meta-page for checking and recovery.
@ MDBX_chk_gc
Definition mdbx.h:6550
@ MDBX_chk_init
Definition mdbx.h:6546
@ MDBX_chk_finalize
Definition mdbx.h:6556
@ MDBX_chk_space
Definition mdbx.h:6551
@ MDBX_chk_lock
Definition mdbx.h:6547
@ MDBX_chk_none
Definition mdbx.h:6545
@ MDBX_chk_maindb
Definition mdbx.h:6552
@ MDBX_chk_unlock
Definition mdbx.h:6555
@ MDBX_chk_meta
Definition mdbx.h:6548
@ MDBX_chk_conclude
Definition mdbx.h:6554
@ MDBX_chk_tree
Definition mdbx.h:6549
@ MDBX_chk_tables
Definition mdbx.h:6553
@ MDBX_CHK_SKIP_BTREE_TRAVERSAL
Definition mdbx.h:6510
@ MDBX_CHK_READWRITE
Definition mdbx.h:6507
@ MDBX_CHK_DEFAULTS
Definition mdbx.h:6503
@ MDBX_CHK_SKIP_KV_TRAVERSAL
Definition mdbx.h:6513
@ MDBX_CHK_IGNORE_ORDER
Definition mdbx.h:6518
@ MDBX_chk_processing
Definition mdbx.h:6534
@ MDBX_chk_result
Definition mdbx.h:6532
@ MDBX_chk_details
Definition mdbx.h:6537
@ MDBX_chk_extra
Definition mdbx.h:6538
@ MDBX_chk_severity_prio_shift
Definition mdbx.h:6526
@ MDBX_chk_severity_kind_mask
Definition mdbx.h:6527
@ MDBX_chk_notice
Definition mdbx.h:6531
@ MDBX_chk_resolution
Definition mdbx.h:6533
@ MDBX_chk_warning
Definition mdbx.h:6530
@ MDBX_chk_fatal
Definition mdbx.h:6528
@ MDBX_chk_info
Definition mdbx.h:6535
@ MDBX_chk_error
Definition mdbx.h:6529
@ MDBX_chk_verbose
Definition mdbx.h:6536
Набор функций обратного вызова используемых при проверке целостности базы данных.
Definition mdbx.h:6681
Контекст проверки целостности базы данных.
Definition mdbx.h:6644
Гистограмма с некоторой статистической информацией, собираемой при проверке целостности БД.
Definition mdbx.h:6598
Проблема обнаруженная при проверке целостности базы данных.
Definition mdbx.h:6569
Виртуальная строка отчета, формируемого при проверке целостности базы данных.
Definition mdbx.h:6561
Иерархический контекст при проверке целостности базы данных.
Definition mdbx.h:6577
Информация о некоторой таблицей ключ-значение, при проверке целостности базы данных.
Definition mdbx.h:6608
LIBMDBX_API float mdbx_float_from_key(const MDBX_val)
LIBMDBX_API int32_t mdbx_int32_from_key(const MDBX_val)
LIBMDBX_API int64_t mdbx_int64_from_key(const MDBX_val)
LIBMDBX_API double mdbx_double_from_key(const MDBX_val)
LIBMDBX_API int64_t mdbx_jsonInteger_from_key(const MDBX_val)
uint64_t mdbx_key_from_int64(const int64_t i64)
Definition mdbx.h:4804
LIBMDBX_API uint32_t mdbx_key_from_ptrfloat(const float *const ieee754_32bit)
LIBMDBX_API uint64_t mdbx_key_from_double(const double ieee754_64bit)
LIBMDBX_API uint32_t mdbx_key_from_float(const float ieee754_32bit)
LIBMDBX_API uint64_t mdbx_key_from_ptrdouble(const double *const ieee754_64bit)
uint32_t mdbx_key_from_int32(const int32_t i32)
Definition mdbx.h:4808
LIBMDBX_API uint64_t mdbx_key_from_jsonInteger(const int64_t json_integer)