mirror of
https://github.com/isar/libmdbx.git
synced 2025-10-18 22:09:03 +08:00
mdbx: add key-to-value functions.
Change-Id: Ie0acd8c58833047931444fd9d94d5b82e6d541bb
This commit is contained in:
9
mdbx.h
9
mdbx.h
@@ -2681,7 +2681,7 @@ LIBMDBX_API int mdbx_dbi_open_ex(MDBX_txn *txn, const char *name,
|
||||
LIBMDBX_API int mdbx_dbi_open(MDBX_txn *txn, const char *name, unsigned flags,
|
||||
MDBX_dbi *dbi);
|
||||
|
||||
/* Key-making functions to avoid custom comparators.
|
||||
/* Key-making (value-to-key) functions to avoid custom comparators.
|
||||
*
|
||||
* The mdbx_key_from_jsonInteger() build key which are comparable with
|
||||
* keys created by mdbx_key_from_double(). So this allow mix int64 and IEEE754
|
||||
@@ -2700,6 +2700,13 @@ __inline uint32_t mdbx_key_from_int32(const int32_t i32) {
|
||||
return UINT32_C(0x80000000) + i32;
|
||||
}
|
||||
|
||||
/* Key-reverse (key-to-value) functions to avoid custom comparators. */
|
||||
LIBMDBX_API int64_t mdbx_jsonInteger_from_key(const MDBX_val);
|
||||
LIBMDBX_API double mdbx_double_from_key(const MDBX_val);
|
||||
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);
|
||||
|
||||
/* Retrieve statistics for a database.
|
||||
*
|
||||
* [in] txn A transaction handle returned by mdbx_txn_begin().
|
||||
|
Reference in New Issue
Block a user