From 8ea3300ce03d7e664991a95aaf716f94e3933ae4 Mon Sep 17 00:00:00 2001 From: bhartnett <51288821+bhartnett@users.noreply.github.com> Date: Fri, 10 Jan 2025 13:27:57 +0800 Subject: [PATCH 01/11] Build static libraries during nimble install. --- rocksdb.nimble | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rocksdb.nimble b/rocksdb.nimble index 1d96528..574adeb 100644 --- a/rocksdb.nimble +++ b/rocksdb.nimble @@ -38,8 +38,8 @@ task test_static, "Run tests after static linking dependencies": before install: when defined(linux): - exec "scripts/build_shared_deps_linux.sh" + exec "scripts/build_static_deps.sh" when defined(macosx): - exec "scripts/build_shared_deps_osx.sh" + exec "scripts/build_static_deps.sh" when defined(windows): exec ".\\scripts\\build_dlls_windows.bat" From cbe54a0293699d3052a86997b9571086db63775a Mon Sep 17 00:00:00 2001 From: bhartnett <51288821+bhartnett@users.noreply.github.com> Date: Tue, 14 Jan 2025 16:42:35 +0800 Subject: [PATCH 02/11] Remove RocksDb dynamic library support on linux and MacOS. --- config.nims | 6 +----- rocksdb.nimble | 31 +++++++++--------------------- rocksdb/lib/librocksdb.nim | 15 ++++++++++----- rocksdb/lib/rocksdb.h | 8 -------- scripts/build_shared_deps_linux.sh | 27 -------------------------- scripts/build_shared_deps_osx.sh | 27 -------------------------- scripts/generate_wrapper.sh | 8 -------- 7 files changed, 20 insertions(+), 102 deletions(-) delete mode 100755 scripts/build_shared_deps_linux.sh delete mode 100755 scripts/build_shared_deps_osx.sh diff --git a/config.nims b/config.nims index 098d311..9d214ce 100644 --- a/config.nims +++ b/config.nims @@ -12,17 +12,13 @@ when fileExists("nimble.paths"): include "nimble.paths" # end Nimble config -when defined(rocksdb_static_linking): +when not defined(windows): # use the C++ linker profile because it's a C++ library when defined(macosx): switch("clang.linkerexe", "clang++") else: switch("gcc.linkerexe", "g++") - switch("dynlibOverride", "rocksdb") - switch("dynlibOverride", "lz4") - switch("dynlibOverride", "zstd") - --styleCheck: usages --styleCheck: diff --git a/rocksdb.nimble b/rocksdb.nimble index 5daaed0..b48a805 100644 --- a/rocksdb.nimble +++ b/rocksdb.nimble @@ -11,6 +11,12 @@ installDirs = @["build"] ### Dependencies requires "nim >= 2.0", "results", "tempfile", "unittest2" +before install: + when defined(windows): + exec ".\\scripts\\build_dlls_windows.bat" + else: + exec "scripts/build_static_deps.sh" + task format, "Format nim code using nph": exec "nimble install nph@0.6.0" exec "nph ." @@ -20,26 +26,7 @@ task clean, "Remove temporary files": exec "make -C vendor/rocksdb clean" task test, "Run tests": - let runTests = "nim c -d:nimDebugDlOpen -r --threads:on tests/test_all.nim" - when defined(linux): - exec "export LD_LIBRARY_PATH=build; " & runTests - when defined(macosx): - exec "export DYLD_LIBRARY_PATH=build; " & runTests - when defined(windows): - exec runTests - -task test_static, "Run tests after static linking dependencies": when defined(windows): - echo "Static linking is not supported on windows" - quit(1) - - exec "scripts/build_static_deps.sh" - exec "nim c -d:rocksdb_static_linking -r --threads:on tests/test_all.nim" - -before install: - when defined(linux): - exec "scripts/build_static_deps.sh" - when defined(macosx): - exec "scripts/build_static_deps.sh" - when defined(windows): - exec ".\\scripts\\build_dlls_windows.bat" + exec "nim c -d:nimDebugDlOpen -r --threads:on tests/test_all.nim" + else: + exec "nim c -r --threads:on tests/test_all.nim" diff --git a/rocksdb/lib/librocksdb.nim b/rocksdb/lib/librocksdb.nim index 89bd919..25a9275 100644 --- a/rocksdb/lib/librocksdb.nim +++ b/rocksdb/lib/librocksdb.nim @@ -89,7 +89,9 @@ type ## DB operations -when defined(rocksdb_static_linking): +when defined(windows): + {.pragma: importrocks, importc, cdecl, dynlib: librocksdb.} +else: {.pragma: importrocks, importc, cdecl.} import std/[os, strutils] @@ -101,9 +103,12 @@ when defined(rocksdb_static_linking): {.passl: libsDir & "/liblz4.a".} {.passl: libsDir & "/libzstd.a".} - when defined(windows): - {.passl: "-lshlwapi -lrpcrt4".} -else: - {.pragma: importrocks, importc, cdecl, dynlib: librocksdb.} + # This is require for static linking on windows + # when defined(windows): + # {.passl: "-lshlwapi -lrpcrt4".} + +if defined(windows): + {.push importc, dynlib: "librocksdb.so" .} +# Do I need importc for static lib? include ./rocksdb_gen.nim diff --git a/rocksdb/lib/rocksdb.h b/rocksdb/lib/rocksdb.h index d0d6a41..db4f3f2 100644 --- a/rocksdb/lib/rocksdb.h +++ b/rocksdb/lib/rocksdb.h @@ -46,15 +46,7 @@ #ifdef C2NIM # def ROCKSDB_LIBRARY_API -# dynlib librocksdb # cdecl -# if defined(windows) -# define librocksdb "librocksdb.dll" -# elif defined(macosx) -# define librocksdb "librocksdb.dylib" -# else -# define librocksdb "librocksdb.so" -# endif # mangle uint32_t uint32 # mangle uint16_t uint16 # mangle uint8_t uint8 diff --git a/scripts/build_shared_deps_linux.sh b/scripts/build_shared_deps_linux.sh deleted file mode 100755 index 9dbc429..0000000 --- a/scripts/build_shared_deps_linux.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -# Nim-RocksDB -# Copyright 2024 Status Research & Development GmbH -# Licensed under either of -# -# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) -# * GPL license, version 2.0, ([LICENSE-GPLv2](LICENSE-GPLv2) or https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) -# -# at your option. This file may not be copied, modified, or distributed except according to those terms. - -set -e - -cd "$(dirname "${BASH_SOURCE[0]}")"/.. - -REPO_DIR="${PWD}" -BUILD_DEST="${REPO_DIR}/build/" - -git submodule update --init - -${REPO_DIR}/vendor/vcpkg/bootstrap-vcpkg.sh -disableMetrics - -${REPO_DIR}/vendor/vcpkg/vcpkg install rocksdb[lz4,zstd]:x64-linux-rocksdb --recurse --overlay-triplets=${REPO_DIR}/triplets - -mkdir -p "${BUILD_DEST}" - -cp "${REPO_DIR}/vendor/vcpkg/installed/x64-linux-rocksdb/lib/librocksdb.so" "${BUILD_DEST}/" diff --git a/scripts/build_shared_deps_osx.sh b/scripts/build_shared_deps_osx.sh deleted file mode 100755 index 654a9eb..0000000 --- a/scripts/build_shared_deps_osx.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -# Nim-RocksDB -# Copyright 2024 Status Research & Development GmbH -# Licensed under either of -# -# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) -# * GPL license, version 2.0, ([LICENSE-GPLv2](LICENSE-GPLv2) or https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) -# -# at your option. This file may not be copied, modified, or distributed except according to those terms. - -set -e - -cd "$(dirname "${BASH_SOURCE[0]}")"/.. - -REPO_DIR="${PWD}" -BUILD_DEST="${REPO_DIR}/build/" - -git submodule update --init - -${REPO_DIR}/vendor/vcpkg/bootstrap-vcpkg.sh -disableMetrics - -${REPO_DIR}/vendor/vcpkg/vcpkg install rocksdb[lz4,zstd]:x64-osx-rocksdb --recurse --overlay-triplets=${REPO_DIR}/triplets - -mkdir -p "${BUILD_DEST}" - -cp "${REPO_DIR}/vendor/vcpkg/installed/x64-osx-rocksdb/lib/librocksdb.dylib" "${BUILD_DEST}/" diff --git a/scripts/generate_wrapper.sh b/scripts/generate_wrapper.sh index 2938cf5..85c1a3d 100755 --- a/scripts/generate_wrapper.sh +++ b/scripts/generate_wrapper.sh @@ -37,15 +37,7 @@ sed -i ':a;N;$!ba;s/#ifdef _WIN32\ #define ROCKSDB_LIBRARY_API\ #endif/#ifdef C2NIM\ # def ROCKSDB_LIBRARY_API\ -# dynlib librocksdb\ # cdecl\ -# if defined(windows)\ -# define librocksdb "librocksdb.dll"\ -# elif defined(macosx)\ -# define librocksdb "librocksdb.dylib"\ -# else\ -# define librocksdb "librocksdb.so"\ -# endif\ # mangle uint32_t uint32\ # mangle uint16_t uint16\ # mangle uint8_t uint8\ From b87067c3cf464e9118734f4dd1cb40f29e9b1fca Mon Sep 17 00:00:00 2001 From: bhartnett <51288821+bhartnett@users.noreply.github.com> Date: Tue, 14 Jan 2025 16:45:00 +0800 Subject: [PATCH 03/11] Update generated wrapper. --- rocksdb/lib/rocksdb_gen.nim | 7031 +++++++++-------------------------- 1 file changed, 1763 insertions(+), 5268 deletions(-) diff --git a/rocksdb/lib/rocksdb_gen.nim b/rocksdb/lib/rocksdb_gen.nim index a8f6c5d..c736517 100644 --- a/rocksdb/lib/rocksdb_gen.nim +++ b/rocksdb/lib/rocksdb_gen.nim @@ -41,699 +41,269 @@ ## (5) All of the pointer arguments must be non-NULL. ## -when defined(windows): - const librocksdb* = "librocksdb.dll" -elif defined(macosx): - const librocksdb* = "librocksdb.dylib" -else: - const librocksdb* = "librocksdb.so" ## Exported types -## DB operations - -proc rocksdb_open*( - options: ptr rocksdb_options_t, name: cstring, errptr: cstringArray -): ptr rocksdb_t {.cdecl, importc: "rocksdb_open", dynlib: librocksdb.} - -proc rocksdb_open_with_ttl*( - options: ptr rocksdb_options_t, name: cstring, ttl: cint, errptr: cstringArray -): ptr rocksdb_t {.cdecl, importc: "rocksdb_open_with_ttl", dynlib: librocksdb.} - -proc rocksdb_open_for_read_only*( - options: ptr rocksdb_options_t, - name: cstring, - error_if_wal_file_exists: uint8, - errptr: cstringArray, -): ptr rocksdb_t {.cdecl, importc: "rocksdb_open_for_read_only", dynlib: librocksdb.} - -proc rocksdb_open_as_secondary*( - options: ptr rocksdb_options_t, - name: cstring, - secondary_path: cstring, - errptr: cstringArray, -): ptr rocksdb_t {.cdecl, importc: "rocksdb_open_as_secondary", dynlib: librocksdb.} - -proc rocksdb_backup_engine_open*( - options: ptr rocksdb_options_t, path: cstring, errptr: cstringArray -): ptr rocksdb_backup_engine_t {. - cdecl, importc: "rocksdb_backup_engine_open", dynlib: librocksdb -.} -proc rocksdb_backup_engine_open_opts*( - options: ptr rocksdb_backup_engine_options_t, - env: ptr rocksdb_env_t, - errptr: cstringArray, -): ptr rocksdb_backup_engine_t {. - cdecl, importc: "rocksdb_backup_engine_open_opts", dynlib: librocksdb -.} - -proc rocksdb_backup_engine_create_new_backup*( - be: ptr rocksdb_backup_engine_t, db: ptr rocksdb_t, errptr: cstringArray -) {.cdecl, importc: "rocksdb_backup_engine_create_new_backup", dynlib: librocksdb.} +## DB operations +proc rocksdb_open*(options: ptr rocksdb_options_t; name: cstring; errptr: cstringArray): ptr rocksdb_t {. + cdecl.} +proc rocksdb_open_with_ttl*(options: ptr rocksdb_options_t; name: cstring; ttl: cint; + errptr: cstringArray): ptr rocksdb_t {.cdecl.} +proc rocksdb_open_for_read_only*(options: ptr rocksdb_options_t; name: cstring; + error_if_wal_file_exists: uint8; + errptr: cstringArray): ptr rocksdb_t {.cdecl.} +proc rocksdb_open_as_secondary*(options: ptr rocksdb_options_t; name: cstring; + secondary_path: cstring; errptr: cstringArray): ptr rocksdb_t {. + cdecl.} +proc rocksdb_backup_engine_open*(options: ptr rocksdb_options_t; path: cstring; + errptr: cstringArray): ptr rocksdb_backup_engine_t {. + cdecl.} +proc rocksdb_backup_engine_open_opts*(options: ptr rocksdb_backup_engine_options_t; + env: ptr rocksdb_env_t; errptr: cstringArray): ptr rocksdb_backup_engine_t {. + cdecl.} +proc rocksdb_backup_engine_create_new_backup*(be: ptr rocksdb_backup_engine_t; + db: ptr rocksdb_t; errptr: cstringArray) {.cdecl.} proc rocksdb_backup_engine_create_new_backup_flush*( - be: ptr rocksdb_backup_engine_t, - db: ptr rocksdb_t, - flush_before_backup: uint8, - errptr: cstringArray, -) {. - cdecl, importc: "rocksdb_backup_engine_create_new_backup_flush", dynlib: librocksdb -.} - -proc rocksdb_backup_engine_purge_old_backups*( - be: ptr rocksdb_backup_engine_t, num_backups_to_keep: uint32, errptr: cstringArray -) {.cdecl, importc: "rocksdb_backup_engine_purge_old_backups", dynlib: librocksdb.} - -proc rocksdb_restore_options_create*(): ptr rocksdb_restore_options_t {. - cdecl, importc: "rocksdb_restore_options_create", dynlib: librocksdb -.} - -proc rocksdb_restore_options_destroy*( - opt: ptr rocksdb_restore_options_t -) {.cdecl, importc: "rocksdb_restore_options_destroy", dynlib: librocksdb.} - + be: ptr rocksdb_backup_engine_t; db: ptr rocksdb_t; flush_before_backup: uint8; + errptr: cstringArray) {.cdecl.} +proc rocksdb_backup_engine_purge_old_backups*(be: ptr rocksdb_backup_engine_t; + num_backups_to_keep: uint32; errptr: cstringArray) {.cdecl.} +proc rocksdb_restore_options_create*(): ptr rocksdb_restore_options_t {.cdecl.} +proc rocksdb_restore_options_destroy*(opt: ptr rocksdb_restore_options_t) {.cdecl.} proc rocksdb_restore_options_set_keep_log_files*( - opt: ptr rocksdb_restore_options_t, v: cint -) {.cdecl, importc: "rocksdb_restore_options_set_keep_log_files", dynlib: librocksdb.} - -proc rocksdb_backup_engine_verify_backup*( - be: ptr rocksdb_backup_engine_t, backup_id: uint32, errptr: cstringArray -) {.cdecl, importc: "rocksdb_backup_engine_verify_backup", dynlib: librocksdb.} - + opt: ptr rocksdb_restore_options_t; v: cint) {.cdecl.} +proc rocksdb_backup_engine_verify_backup*(be: ptr rocksdb_backup_engine_t; + backup_id: uint32; errptr: cstringArray) {.cdecl.} proc rocksdb_backup_engine_restore_db_from_latest_backup*( - be: ptr rocksdb_backup_engine_t, - db_dir: cstring, - wal_dir: cstring, - restore_options: ptr rocksdb_restore_options_t, - errptr: cstringArray, -) {. - cdecl, - importc: "rocksdb_backup_engine_restore_db_from_latest_backup", - dynlib: librocksdb -.} - + be: ptr rocksdb_backup_engine_t; db_dir: cstring; wal_dir: cstring; + restore_options: ptr rocksdb_restore_options_t; errptr: cstringArray) {.cdecl.} proc rocksdb_backup_engine_restore_db_from_backup*( - be: ptr rocksdb_backup_engine_t, - db_dir: cstring, - wal_dir: cstring, - restore_options: ptr rocksdb_restore_options_t, - backup_id: uint32, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_backup_engine_restore_db_from_backup", dynlib: librocksdb.} - -proc rocksdb_backup_engine_get_backup_info*( - be: ptr rocksdb_backup_engine_t -): ptr rocksdb_backup_engine_info_t {. - cdecl, importc: "rocksdb_backup_engine_get_backup_info", dynlib: librocksdb -.} - -proc rocksdb_backup_engine_info_count*( - info: ptr rocksdb_backup_engine_info_t -): cint {.cdecl, importc: "rocksdb_backup_engine_info_count", dynlib: librocksdb.} - + be: ptr rocksdb_backup_engine_t; db_dir: cstring; wal_dir: cstring; + restore_options: ptr rocksdb_restore_options_t; backup_id: uint32; + errptr: cstringArray) {.cdecl.} +proc rocksdb_backup_engine_get_backup_info*(be: ptr rocksdb_backup_engine_t): ptr rocksdb_backup_engine_info_t {. + cdecl.} +proc rocksdb_backup_engine_info_count*(info: ptr rocksdb_backup_engine_info_t): cint {. + cdecl.} proc rocksdb_backup_engine_info_timestamp*( - info: ptr rocksdb_backup_engine_info_t, index: cint -): int64 {.cdecl, importc: "rocksdb_backup_engine_info_timestamp", dynlib: librocksdb.} - + info: ptr rocksdb_backup_engine_info_t; index: cint): int64 {.cdecl.} proc rocksdb_backup_engine_info_backup_id*( - info: ptr rocksdb_backup_engine_info_t, index: cint -): uint32 {.cdecl, importc: "rocksdb_backup_engine_info_backup_id", dynlib: librocksdb.} - -proc rocksdb_backup_engine_info_size*( - info: ptr rocksdb_backup_engine_info_t, index: cint -): uint64 {.cdecl, importc: "rocksdb_backup_engine_info_size", dynlib: librocksdb.} - + info: ptr rocksdb_backup_engine_info_t; index: cint): uint32 {.cdecl.} +proc rocksdb_backup_engine_info_size*(info: ptr rocksdb_backup_engine_info_t; + index: cint): uint64 {.cdecl.} proc rocksdb_backup_engine_info_number_files*( - info: ptr rocksdb_backup_engine_info_t, index: cint -): uint32 {. - cdecl, importc: "rocksdb_backup_engine_info_number_files", dynlib: librocksdb -.} - -proc rocksdb_backup_engine_info_destroy*( - info: ptr rocksdb_backup_engine_info_t -) {.cdecl, importc: "rocksdb_backup_engine_info_destroy", dynlib: librocksdb.} - -proc rocksdb_backup_engine_close*( - be: ptr rocksdb_backup_engine_t -) {.cdecl, importc: "rocksdb_backup_engine_close", dynlib: librocksdb.} - -proc rocksdb_put_with_ts*( - db: ptr rocksdb_t, - options: ptr rocksdb_writeoptions_t, - key: cstring, - keylen: csize_t, - ts: cstring, - tslen: csize_t, - val: cstring, - vallen: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_put_with_ts", dynlib: librocksdb.} - -proc rocksdb_put_cf_with_ts*( - db: ptr rocksdb_t, - options: ptr rocksdb_writeoptions_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - keylen: csize_t, - ts: cstring, - tslen: csize_t, - val: cstring, - vallen: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_put_cf_with_ts", dynlib: librocksdb.} - -proc rocksdb_delete_with_ts*( - db: ptr rocksdb_t, - options: ptr rocksdb_writeoptions_t, - key: cstring, - keylen: csize_t, - ts: cstring, - tslen: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_delete_with_ts", dynlib: librocksdb.} - -proc rocksdb_delete_cf_with_ts*( - db: ptr rocksdb_t, - options: ptr rocksdb_writeoptions_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - keylen: csize_t, - ts: cstring, - tslen: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_delete_cf_with_ts", dynlib: librocksdb.} - -proc rocksdb_singledelete*( - db: ptr rocksdb_t, - options: ptr rocksdb_writeoptions_t, - key: cstring, - keylen: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_singledelete", dynlib: librocksdb.} - -proc rocksdb_singledelete_cf*( - db: ptr rocksdb_t, - options: ptr rocksdb_writeoptions_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - keylen: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_singledelete_cf", dynlib: librocksdb.} - -proc rocksdb_singledelete_with_ts*( - db: ptr rocksdb_t, - options: ptr rocksdb_writeoptions_t, - key: cstring, - keylen: csize_t, - ts: cstring, - tslen: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_singledelete_with_ts", dynlib: librocksdb.} - -proc rocksdb_singledelete_cf_with_ts*( - db: ptr rocksdb_t, - options: ptr rocksdb_writeoptions_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - keylen: csize_t, - ts: cstring, - tslen: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_singledelete_cf_with_ts", dynlib: librocksdb.} - -proc rocksdb_increase_full_history_ts_low*( - db: ptr rocksdb_t, - column_family: ptr rocksdb_column_family_handle_t, - ts_low: cstring, - ts_lowlen: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_increase_full_history_ts_low", dynlib: librocksdb.} - -proc rocksdb_get_full_history_ts_low*( - db: ptr rocksdb_t, - column_family: ptr rocksdb_column_family_handle_t, - ts_lowlen: ptr csize_t, - errptr: cstringArray, -): cstring {.cdecl, importc: "rocksdb_get_full_history_ts_low", dynlib: librocksdb.} - + info: ptr rocksdb_backup_engine_info_t; index: cint): uint32 {.cdecl.} +proc rocksdb_backup_engine_info_destroy*(info: ptr rocksdb_backup_engine_info_t) {. + cdecl.} +proc rocksdb_backup_engine_close*(be: ptr rocksdb_backup_engine_t) {.cdecl.} +proc rocksdb_put_with_ts*(db: ptr rocksdb_t; options: ptr rocksdb_writeoptions_t; + key: cstring; keylen: csize_t; ts: cstring; tslen: csize_t; + val: cstring; vallen: csize_t; errptr: cstringArray) {.cdecl.} +proc rocksdb_put_cf_with_ts*(db: ptr rocksdb_t; options: ptr rocksdb_writeoptions_t; + column_family: ptr rocksdb_column_family_handle_t; + key: cstring; keylen: csize_t; ts: cstring; + tslen: csize_t; val: cstring; vallen: csize_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_delete_with_ts*(db: ptr rocksdb_t; options: ptr rocksdb_writeoptions_t; + key: cstring; keylen: csize_t; ts: cstring; + tslen: csize_t; errptr: cstringArray) {.cdecl.} +proc rocksdb_delete_cf_with_ts*(db: ptr rocksdb_t; + options: ptr rocksdb_writeoptions_t; column_family: ptr rocksdb_column_family_handle_t; + key: cstring; keylen: csize_t; ts: cstring; + tslen: csize_t; errptr: cstringArray) {.cdecl.} +proc rocksdb_singledelete*(db: ptr rocksdb_t; options: ptr rocksdb_writeoptions_t; + key: cstring; keylen: csize_t; errptr: cstringArray) {.cdecl.} +proc rocksdb_singledelete_cf*(db: ptr rocksdb_t; + options: ptr rocksdb_writeoptions_t; + column_family: ptr rocksdb_column_family_handle_t; + key: cstring; keylen: csize_t; errptr: cstringArray) {. + cdecl.} +proc rocksdb_singledelete_with_ts*(db: ptr rocksdb_t; + options: ptr rocksdb_writeoptions_t; + key: cstring; keylen: csize_t; ts: cstring; + tslen: csize_t; errptr: cstringArray) {.cdecl.} +proc rocksdb_singledelete_cf_with_ts*(db: ptr rocksdb_t; + options: ptr rocksdb_writeoptions_t; + column_family: ptr rocksdb_column_family_handle_t; key: cstring; keylen: csize_t; + ts: cstring; tslen: csize_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_increase_full_history_ts_low*(db: ptr rocksdb_t; + column_family: ptr rocksdb_column_family_handle_t; ts_low: cstring; + ts_lowlen: csize_t; errptr: cstringArray) {.cdecl.} +proc rocksdb_get_full_history_ts_low*(db: ptr rocksdb_t; column_family: ptr rocksdb_column_family_handle_t; + ts_lowlen: ptr csize_t; errptr: cstringArray): cstring {. + cdecl.} ## BackupEngineOptions -proc rocksdb_backup_engine_options_create*( - backup_dir: cstring -): ptr rocksdb_backup_engine_options_t {. - cdecl, importc: "rocksdb_backup_engine_options_create", dynlib: librocksdb -.} - +proc rocksdb_backup_engine_options_create*(backup_dir: cstring): ptr rocksdb_backup_engine_options_t {. + cdecl.} proc rocksdb_backup_engine_options_set_backup_dir*( - options: ptr rocksdb_backup_engine_options_t, backup_dir: cstring -) {.cdecl, importc: "rocksdb_backup_engine_options_set_backup_dir", dynlib: librocksdb.} - + options: ptr rocksdb_backup_engine_options_t; backup_dir: cstring) {.cdecl.} proc rocksdb_backup_engine_options_set_env*( - options: ptr rocksdb_backup_engine_options_t, env: ptr rocksdb_env_t -) {.cdecl, importc: "rocksdb_backup_engine_options_set_env", dynlib: librocksdb.} - + options: ptr rocksdb_backup_engine_options_t; env: ptr rocksdb_env_t) {.cdecl.} proc rocksdb_backup_engine_options_set_share_table_files*( - options: ptr rocksdb_backup_engine_options_t, val: uint8 -) {. - cdecl, - importc: "rocksdb_backup_engine_options_set_share_table_files", - dynlib: librocksdb -.} - + options: ptr rocksdb_backup_engine_options_t; val: uint8) {.cdecl.} proc rocksdb_backup_engine_options_get_share_table_files*( - options: ptr rocksdb_backup_engine_options_t -): uint8 {. - cdecl, - importc: "rocksdb_backup_engine_options_get_share_table_files", - dynlib: librocksdb -.} - + options: ptr rocksdb_backup_engine_options_t): uint8 {.cdecl.} proc rocksdb_backup_engine_options_set_sync*( - options: ptr rocksdb_backup_engine_options_t, val: uint8 -) {.cdecl, importc: "rocksdb_backup_engine_options_set_sync", dynlib: librocksdb.} - + options: ptr rocksdb_backup_engine_options_t; val: uint8) {.cdecl.} proc rocksdb_backup_engine_options_get_sync*( - options: ptr rocksdb_backup_engine_options_t -): uint8 {. - cdecl, importc: "rocksdb_backup_engine_options_get_sync", dynlib: librocksdb -.} - + options: ptr rocksdb_backup_engine_options_t): uint8 {.cdecl.} proc rocksdb_backup_engine_options_set_destroy_old_data*( - options: ptr rocksdb_backup_engine_options_t, val: uint8 -) {. - cdecl, - importc: "rocksdb_backup_engine_options_set_destroy_old_data", - dynlib: librocksdb -.} - + options: ptr rocksdb_backup_engine_options_t; val: uint8) {.cdecl.} proc rocksdb_backup_engine_options_get_destroy_old_data*( - options: ptr rocksdb_backup_engine_options_t -): uint8 {. - cdecl, - importc: "rocksdb_backup_engine_options_get_destroy_old_data", - dynlib: librocksdb -.} - + options: ptr rocksdb_backup_engine_options_t): uint8 {.cdecl.} proc rocksdb_backup_engine_options_set_backup_log_files*( - options: ptr rocksdb_backup_engine_options_t, val: uint8 -) {. - cdecl, - importc: "rocksdb_backup_engine_options_set_backup_log_files", - dynlib: librocksdb -.} - + options: ptr rocksdb_backup_engine_options_t; val: uint8) {.cdecl.} proc rocksdb_backup_engine_options_get_backup_log_files*( - options: ptr rocksdb_backup_engine_options_t -): uint8 {. - cdecl, - importc: "rocksdb_backup_engine_options_get_backup_log_files", - dynlib: librocksdb -.} - + options: ptr rocksdb_backup_engine_options_t): uint8 {.cdecl.} proc rocksdb_backup_engine_options_set_backup_rate_limit*( - options: ptr rocksdb_backup_engine_options_t, limit: uint64 -) {. - cdecl, - importc: "rocksdb_backup_engine_options_set_backup_rate_limit", - dynlib: librocksdb -.} - + options: ptr rocksdb_backup_engine_options_t; limit: uint64) {.cdecl.} proc rocksdb_backup_engine_options_get_backup_rate_limit*( - options: ptr rocksdb_backup_engine_options_t -): uint64 {. - cdecl, - importc: "rocksdb_backup_engine_options_get_backup_rate_limit", - dynlib: librocksdb -.} - + options: ptr rocksdb_backup_engine_options_t): uint64 {.cdecl.} proc rocksdb_backup_engine_options_set_restore_rate_limit*( - options: ptr rocksdb_backup_engine_options_t, limit: uint64 -) {. - cdecl, - importc: "rocksdb_backup_engine_options_set_restore_rate_limit", - dynlib: librocksdb -.} - + options: ptr rocksdb_backup_engine_options_t; limit: uint64) {.cdecl.} proc rocksdb_backup_engine_options_get_restore_rate_limit*( - options: ptr rocksdb_backup_engine_options_t -): uint64 {. - cdecl, - importc: "rocksdb_backup_engine_options_get_restore_rate_limit", - dynlib: librocksdb -.} - + options: ptr rocksdb_backup_engine_options_t): uint64 {.cdecl.} proc rocksdb_backup_engine_options_set_max_background_operations*( - options: ptr rocksdb_backup_engine_options_t, val: cint -) {. - cdecl, - importc: "rocksdb_backup_engine_options_set_max_background_operations", - dynlib: librocksdb -.} - + options: ptr rocksdb_backup_engine_options_t; val: cint) {.cdecl.} proc rocksdb_backup_engine_options_get_max_background_operations*( - options: ptr rocksdb_backup_engine_options_t -): cint {. - cdecl, - importc: "rocksdb_backup_engine_options_get_max_background_operations", - dynlib: librocksdb -.} - + options: ptr rocksdb_backup_engine_options_t): cint {.cdecl.} proc rocksdb_backup_engine_options_set_callback_trigger_interval_size*( - options: ptr rocksdb_backup_engine_options_t, size: uint64 -) {. - cdecl, - importc: "rocksdb_backup_engine_options_set_callback_trigger_interval_size", - dynlib: librocksdb -.} - + options: ptr rocksdb_backup_engine_options_t; size: uint64) {.cdecl.} proc rocksdb_backup_engine_options_get_callback_trigger_interval_size*( - options: ptr rocksdb_backup_engine_options_t -): uint64 {. - cdecl, - importc: "rocksdb_backup_engine_options_get_callback_trigger_interval_size", - dynlib: librocksdb -.} - + options: ptr rocksdb_backup_engine_options_t): uint64 {.cdecl.} proc rocksdb_backup_engine_options_set_max_valid_backups_to_open*( - options: ptr rocksdb_backup_engine_options_t, val: cint -) {. - cdecl, - importc: "rocksdb_backup_engine_options_set_max_valid_backups_to_open", - dynlib: librocksdb -.} - + options: ptr rocksdb_backup_engine_options_t; val: cint) {.cdecl.} proc rocksdb_backup_engine_options_get_max_valid_backups_to_open*( - options: ptr rocksdb_backup_engine_options_t -): cint {. - cdecl, - importc: "rocksdb_backup_engine_options_get_max_valid_backups_to_open", - dynlib: librocksdb -.} - + options: ptr rocksdb_backup_engine_options_t): cint {.cdecl.} proc rocksdb_backup_engine_options_set_share_files_with_checksum_naming*( - options: ptr rocksdb_backup_engine_options_t, val: cint -) {. - cdecl, - importc: "rocksdb_backup_engine_options_set_share_files_with_checksum_naming", - dynlib: librocksdb -.} - + options: ptr rocksdb_backup_engine_options_t; val: cint) {.cdecl.} proc rocksdb_backup_engine_options_get_share_files_with_checksum_naming*( - options: ptr rocksdb_backup_engine_options_t -): cint {. - cdecl, - importc: "rocksdb_backup_engine_options_get_share_files_with_checksum_naming", - dynlib: librocksdb -.} - + options: ptr rocksdb_backup_engine_options_t): cint {.cdecl.} proc rocksdb_backup_engine_options_destroy*( - a1: ptr rocksdb_backup_engine_options_t -) {.cdecl, importc: "rocksdb_backup_engine_options_destroy", dynlib: librocksdb.} - + a1: ptr rocksdb_backup_engine_options_t) {.cdecl.} ## Checkpoint -proc rocksdb_checkpoint_object_create*( - db: ptr rocksdb_t, errptr: cstringArray -): ptr rocksdb_checkpoint_t {. - cdecl, importc: "rocksdb_checkpoint_object_create", dynlib: librocksdb -.} - -proc rocksdb_checkpoint_create*( - checkpoint: ptr rocksdb_checkpoint_t, - checkpoint_dir: cstring, - log_size_for_flush: uint64, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_checkpoint_create", dynlib: librocksdb.} - -proc rocksdb_checkpoint_object_destroy*( - checkpoint: ptr rocksdb_checkpoint_t -) {.cdecl, importc: "rocksdb_checkpoint_object_destroy", dynlib: librocksdb.} - -proc rocksdb_open_and_trim_history*( - options: ptr rocksdb_options_t, - name: cstring, - num_column_families: cint, - column_family_names: cstringArray, - column_family_options: ptr ptr rocksdb_options_t, - column_family_handles: ptr ptr rocksdb_column_family_handle_t, - trim_ts: cstring, - trim_tslen: csize_t, - errptr: cstringArray, -): ptr rocksdb_t {.cdecl, importc: "rocksdb_open_and_trim_history", dynlib: librocksdb.} - -proc rocksdb_open_column_families*( - options: ptr rocksdb_options_t, - name: cstring, - num_column_families: cint, - column_family_names: cstringArray, - column_family_options: ptr ptr rocksdb_options_t, - column_family_handles: ptr ptr rocksdb_column_family_handle_t, - errptr: cstringArray, -): ptr rocksdb_t {.cdecl, importc: "rocksdb_open_column_families", dynlib: librocksdb.} - -proc rocksdb_open_column_families_with_ttl*( - options: ptr rocksdb_options_t, - name: cstring, - num_column_families: cint, - column_family_names: cstringArray, - column_family_options: ptr ptr rocksdb_options_t, - column_family_handles: ptr ptr rocksdb_column_family_handle_t, - ttls: ptr cint, - errptr: cstringArray, -): ptr rocksdb_t {. - cdecl, importc: "rocksdb_open_column_families_with_ttl", dynlib: librocksdb -.} - -proc rocksdb_open_for_read_only_column_families*( - options: ptr rocksdb_options_t, - name: cstring, - num_column_families: cint, - column_family_names: cstringArray, - column_family_options: ptr ptr rocksdb_options_t, - column_family_handles: ptr ptr rocksdb_column_family_handle_t, - error_if_wal_file_exists: uint8, - errptr: cstringArray, -): ptr rocksdb_t {. - cdecl, importc: "rocksdb_open_for_read_only_column_families", dynlib: librocksdb -.} - -proc rocksdb_open_as_secondary_column_families*( - options: ptr rocksdb_options_t, - name: cstring, - secondary_path: cstring, - num_column_families: cint, - column_family_names: cstringArray, - column_family_options: ptr ptr rocksdb_options_t, - column_family_handles: ptr ptr rocksdb_column_family_handle_t, - errptr: cstringArray, -): ptr rocksdb_t {. - cdecl, importc: "rocksdb_open_as_secondary_column_families", dynlib: librocksdb -.} - -proc rocksdb_list_column_families*( - options: ptr rocksdb_options_t, - name: cstring, - lencf: ptr csize_t, - errptr: cstringArray, -): cstringArray {.cdecl, importc: "rocksdb_list_column_families", dynlib: librocksdb.} - -proc rocksdb_list_column_families_destroy*( - list: cstringArray, len: csize_t -) {.cdecl, importc: "rocksdb_list_column_families_destroy", dynlib: librocksdb.} - -proc rocksdb_create_column_family*( - db: ptr rocksdb_t, - column_family_options: ptr rocksdb_options_t, - column_family_name: cstring, - errptr: cstringArray, -): ptr rocksdb_column_family_handle_t {. - cdecl, importc: "rocksdb_create_column_family", dynlib: librocksdb -.} - -proc rocksdb_create_column_families*( - db: ptr rocksdb_t, - column_family_options: ptr rocksdb_options_t, - num_column_families: cint, - column_family_names: cstringArray, - lencfs: ptr csize_t, - errptr: cstringArray, -): ptr ptr rocksdb_column_family_handle_t {. - cdecl, importc: "rocksdb_create_column_families", dynlib: librocksdb -.} - +proc rocksdb_checkpoint_object_create*(db: ptr rocksdb_t; errptr: cstringArray): ptr rocksdb_checkpoint_t {. + cdecl.} +proc rocksdb_checkpoint_create*(checkpoint: ptr rocksdb_checkpoint_t; + checkpoint_dir: cstring; + log_size_for_flush: uint64; errptr: cstringArray) {. + cdecl.} +proc rocksdb_checkpoint_object_destroy*(checkpoint: ptr rocksdb_checkpoint_t) {. + cdecl.} +proc rocksdb_open_and_trim_history*(options: ptr rocksdb_options_t; name: cstring; + num_column_families: cint; + column_family_names: cstringArray; + column_family_options: ptr ptr rocksdb_options_t; column_family_handles: ptr ptr rocksdb_column_family_handle_t; + trim_ts: cstring; trim_tslen: csize_t; + errptr: cstringArray): ptr rocksdb_t {.cdecl.} +proc rocksdb_open_column_families*(options: ptr rocksdb_options_t; name: cstring; + num_column_families: cint; + column_family_names: cstringArray; + column_family_options: ptr ptr rocksdb_options_t; column_family_handles: ptr ptr rocksdb_column_family_handle_t; + errptr: cstringArray): ptr rocksdb_t {.cdecl.} +proc rocksdb_open_column_families_with_ttl*(options: ptr rocksdb_options_t; + name: cstring; num_column_families: cint; column_family_names: cstringArray; + column_family_options: ptr ptr rocksdb_options_t; + column_family_handles: ptr ptr rocksdb_column_family_handle_t; ttls: ptr cint; + errptr: cstringArray): ptr rocksdb_t {.cdecl.} +proc rocksdb_open_for_read_only_column_families*(options: ptr rocksdb_options_t; + name: cstring; num_column_families: cint; column_family_names: cstringArray; + column_family_options: ptr ptr rocksdb_options_t; + column_family_handles: ptr ptr rocksdb_column_family_handle_t; + error_if_wal_file_exists: uint8; errptr: cstringArray): ptr rocksdb_t {.cdecl.} +proc rocksdb_open_as_secondary_column_families*(options: ptr rocksdb_options_t; + name: cstring; secondary_path: cstring; num_column_families: cint; + column_family_names: cstringArray; + column_family_options: ptr ptr rocksdb_options_t; + column_family_handles: ptr ptr rocksdb_column_family_handle_t; + errptr: cstringArray): ptr rocksdb_t {.cdecl.} +proc rocksdb_list_column_families*(options: ptr rocksdb_options_t; name: cstring; + lencf: ptr csize_t; errptr: cstringArray): cstringArray {. + cdecl.} +proc rocksdb_list_column_families_destroy*(list: cstringArray; len: csize_t) {.cdecl.} +proc rocksdb_create_column_family*(db: ptr rocksdb_t; + column_family_options: ptr rocksdb_options_t; + column_family_name: cstring; + errptr: cstringArray): ptr rocksdb_column_family_handle_t {. + cdecl.} +proc rocksdb_create_column_families*(db: ptr rocksdb_t; column_family_options: ptr rocksdb_options_t; + num_column_families: cint; + column_family_names: cstringArray; + lencfs: ptr csize_t; errptr: cstringArray): ptr ptr rocksdb_column_family_handle_t {. + cdecl.} proc rocksdb_create_column_families_destroy*( - list: ptr ptr rocksdb_column_family_handle_t -) {.cdecl, importc: "rocksdb_create_column_families_destroy", dynlib: librocksdb.} - -proc rocksdb_create_column_family_with_ttl*( - db: ptr rocksdb_t, - column_family_options: ptr rocksdb_options_t, - column_family_name: cstring, - ttl: cint, - errptr: cstringArray, -): ptr rocksdb_column_family_handle_t {. - cdecl, importc: "rocksdb_create_column_family_with_ttl", dynlib: librocksdb -.} - -proc rocksdb_drop_column_family*( - db: ptr rocksdb_t, handle: ptr rocksdb_column_family_handle_t, errptr: cstringArray -) {.cdecl, importc: "rocksdb_drop_column_family", dynlib: librocksdb.} - -proc rocksdb_get_default_column_family_handle*( - db: ptr rocksdb_t -): ptr rocksdb_column_family_handle_t {. - cdecl, importc: "rocksdb_get_default_column_family_handle", dynlib: librocksdb -.} - -proc rocksdb_column_family_handle_destroy*( - a1: ptr rocksdb_column_family_handle_t -) {.cdecl, importc: "rocksdb_column_family_handle_destroy", dynlib: librocksdb.} - + list: ptr ptr rocksdb_column_family_handle_t) {.cdecl.} +proc rocksdb_create_column_family_with_ttl*(db: ptr rocksdb_t; + column_family_options: ptr rocksdb_options_t; column_family_name: cstring; + ttl: cint; errptr: cstringArray): ptr rocksdb_column_family_handle_t {.cdecl.} +proc rocksdb_drop_column_family*(db: ptr rocksdb_t; + handle: ptr rocksdb_column_family_handle_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_get_default_column_family_handle*(db: ptr rocksdb_t): ptr rocksdb_column_family_handle_t {. + cdecl.} +proc rocksdb_column_family_handle_destroy*(a1: ptr rocksdb_column_family_handle_t) {. + cdecl.} proc rocksdb_column_family_handle_get_id*( - handle: ptr rocksdb_column_family_handle_t -): uint32 {.cdecl, importc: "rocksdb_column_family_handle_get_id", dynlib: librocksdb.} - + handle: ptr rocksdb_column_family_handle_t): uint32 {.cdecl.} proc rocksdb_column_family_handle_get_name*( - handle: ptr rocksdb_column_family_handle_t, name_len: ptr csize_t -): cstring {. - cdecl, importc: "rocksdb_column_family_handle_get_name", dynlib: librocksdb -.} - -proc rocksdb_close*( - db: ptr rocksdb_t -) {.cdecl, importc: "rocksdb_close", dynlib: librocksdb.} - -proc rocksdb_put*( - db: ptr rocksdb_t, - options: ptr rocksdb_writeoptions_t, - key: cstring, - keylen: csize_t, - val: cstring, - vallen: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_put", dynlib: librocksdb.} - -proc rocksdb_put_cf*( - db: ptr rocksdb_t, - options: ptr rocksdb_writeoptions_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - keylen: csize_t, - val: cstring, - vallen: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_put_cf", dynlib: librocksdb.} - -proc rocksdb_delete*( - db: ptr rocksdb_t, - options: ptr rocksdb_writeoptions_t, - key: cstring, - keylen: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_delete", dynlib: librocksdb.} - -proc rocksdb_delete_cf*( - db: ptr rocksdb_t, - options: ptr rocksdb_writeoptions_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - keylen: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_delete_cf", dynlib: librocksdb.} - -proc rocksdb_delete_range_cf*( - db: ptr rocksdb_t, - options: ptr rocksdb_writeoptions_t, - column_family: ptr rocksdb_column_family_handle_t, - start_key: cstring, - start_key_len: csize_t, - end_key: cstring, - end_key_len: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_delete_range_cf", dynlib: librocksdb.} - -proc rocksdb_merge*( - db: ptr rocksdb_t, - options: ptr rocksdb_writeoptions_t, - key: cstring, - keylen: csize_t, - val: cstring, - vallen: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_merge", dynlib: librocksdb.} - -proc rocksdb_merge_cf*( - db: ptr rocksdb_t, - options: ptr rocksdb_writeoptions_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - keylen: csize_t, - val: cstring, - vallen: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_merge_cf", dynlib: librocksdb.} - -proc rocksdb_write*( - db: ptr rocksdb_t, - options: ptr rocksdb_writeoptions_t, - batch: ptr rocksdb_writebatch_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_write", dynlib: librocksdb.} - + handle: ptr rocksdb_column_family_handle_t; name_len: ptr csize_t): cstring {.cdecl.} +proc rocksdb_close*(db: ptr rocksdb_t) {.cdecl.} +proc rocksdb_put*(db: ptr rocksdb_t; options: ptr rocksdb_writeoptions_t; key: cstring; + keylen: csize_t; val: cstring; vallen: csize_t; errptr: cstringArray) {. + cdecl.} +proc rocksdb_put_cf*(db: ptr rocksdb_t; options: ptr rocksdb_writeoptions_t; + column_family: ptr rocksdb_column_family_handle_t; + key: cstring; keylen: csize_t; val: cstring; vallen: csize_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_delete*(db: ptr rocksdb_t; options: ptr rocksdb_writeoptions_t; + key: cstring; keylen: csize_t; errptr: cstringArray) {.cdecl.} +proc rocksdb_delete_cf*(db: ptr rocksdb_t; options: ptr rocksdb_writeoptions_t; + column_family: ptr rocksdb_column_family_handle_t; + key: cstring; keylen: csize_t; errptr: cstringArray) {.cdecl.} +proc rocksdb_delete_range_cf*(db: ptr rocksdb_t; + options: ptr rocksdb_writeoptions_t; + column_family: ptr rocksdb_column_family_handle_t; + start_key: cstring; start_key_len: csize_t; + end_key: cstring; end_key_len: csize_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_merge*(db: ptr rocksdb_t; options: ptr rocksdb_writeoptions_t; + key: cstring; keylen: csize_t; val: cstring; vallen: csize_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_merge_cf*(db: ptr rocksdb_t; options: ptr rocksdb_writeoptions_t; + column_family: ptr rocksdb_column_family_handle_t; + key: cstring; keylen: csize_t; val: cstring; vallen: csize_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_write*(db: ptr rocksdb_t; options: ptr rocksdb_writeoptions_t; + batch: ptr rocksdb_writebatch_t; errptr: cstringArray) {.cdecl.} ## Returns NULL if not found. A malloc()ed array otherwise. ## Stores the length of the array in *vallen. -proc rocksdb_get*( - db: ptr rocksdb_t, - options: ptr rocksdb_readoptions_t, - key: cstring, - keylen: csize_t, - vallen: ptr csize_t, - errptr: cstringArray, -): cstring {.cdecl, importc: "rocksdb_get", dynlib: librocksdb.} - -proc rocksdb_get_with_ts*( - db: ptr rocksdb_t, - options: ptr rocksdb_readoptions_t, - key: cstring, - keylen: csize_t, - vallen: ptr csize_t, - ts: cstringArray, - tslen: ptr csize_t, - errptr: cstringArray, -): cstring {.cdecl, importc: "rocksdb_get_with_ts", dynlib: librocksdb.} - -proc rocksdb_get_cf*( - db: ptr rocksdb_t, - options: ptr rocksdb_readoptions_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - keylen: csize_t, - vallen: ptr csize_t, - errptr: cstringArray, -): cstring {.cdecl, importc: "rocksdb_get_cf", dynlib: librocksdb.} - -proc rocksdb_get_cf_with_ts*( - db: ptr rocksdb_t, - options: ptr rocksdb_readoptions_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - keylen: csize_t, - vallen: ptr csize_t, - ts: cstringArray, - tslen: ptr csize_t, - errptr: cstringArray, -): cstring {.cdecl, importc: "rocksdb_get_cf_with_ts", dynlib: librocksdb.} - +proc rocksdb_get*(db: ptr rocksdb_t; options: ptr rocksdb_readoptions_t; key: cstring; + keylen: csize_t; vallen: ptr csize_t; errptr: cstringArray): cstring {. + cdecl.} +proc rocksdb_get_with_ts*(db: ptr rocksdb_t; options: ptr rocksdb_readoptions_t; + key: cstring; keylen: csize_t; vallen: ptr csize_t; + ts: cstringArray; tslen: ptr csize_t; errptr: cstringArray): cstring {. + cdecl.} +proc rocksdb_get_cf*(db: ptr rocksdb_t; options: ptr rocksdb_readoptions_t; + column_family: ptr rocksdb_column_family_handle_t; + key: cstring; keylen: csize_t; vallen: ptr csize_t; + errptr: cstringArray): cstring {.cdecl.} +proc rocksdb_get_cf_with_ts*(db: ptr rocksdb_t; options: ptr rocksdb_readoptions_t; + column_family: ptr rocksdb_column_family_handle_t; + key: cstring; keylen: csize_t; vallen: ptr csize_t; + ts: cstringArray; tslen: ptr csize_t; + errptr: cstringArray): cstring {.cdecl.} ## ## Returns a malloc() buffer with the DB identity, assigning the length to ## *id_len. Returns NULL if an error occurred. ## -proc rocksdb_get_db_identity*( - db: ptr rocksdb_t, id_len: ptr csize_t -): cstring {.cdecl, importc: "rocksdb_get_db_identity", dynlib: librocksdb.} - +proc rocksdb_get_db_identity*(db: ptr rocksdb_t; id_len: ptr csize_t): cstring {.cdecl.} ## if values_list[i] == NULL and errs[i] == NULL, ## then we got status.IsNotFound(), which we will not return. ## all errors except status status.ok() and status.IsNotFound() are returned. @@ -746,56 +316,34 @@ proc rocksdb_get_db_identity*( ## each non-NULL values_list entry is a malloc()ed array, with ## the length for each stored in values_list_sizes[i]. -proc rocksdb_multi_get*( - db: ptr rocksdb_t, - options: ptr rocksdb_readoptions_t, - num_keys: csize_t, - keys_list: cstringArray, - keys_list_sizes: ptr csize_t, - values_list: cstringArray, - values_list_sizes: ptr csize_t, - errs: cstringArray, -) {.cdecl, importc: "rocksdb_multi_get", dynlib: librocksdb.} - -proc rocksdb_multi_get_with_ts*( - db: ptr rocksdb_t, - options: ptr rocksdb_readoptions_t, - num_keys: csize_t, - keys_list: cstringArray, - keys_list_sizes: ptr csize_t, - values_list: cstringArray, - values_list_sizes: ptr csize_t, - timestamp_list: cstringArray, - timestamp_list_sizes: ptr csize_t, - errs: cstringArray, -) {.cdecl, importc: "rocksdb_multi_get_with_ts", dynlib: librocksdb.} - -proc rocksdb_multi_get_cf*( - db: ptr rocksdb_t, - options: ptr rocksdb_readoptions_t, - column_families: ptr ptr rocksdb_column_family_handle_t, - num_keys: csize_t, - keys_list: cstringArray, - keys_list_sizes: ptr csize_t, - values_list: cstringArray, - values_list_sizes: ptr csize_t, - errs: cstringArray, -) {.cdecl, importc: "rocksdb_multi_get_cf", dynlib: librocksdb.} - -proc rocksdb_multi_get_cf_with_ts*( - db: ptr rocksdb_t, - options: ptr rocksdb_readoptions_t, - column_families: ptr ptr rocksdb_column_family_handle_t, - num_keys: csize_t, - keys_list: cstringArray, - keys_list_sizes: ptr csize_t, - values_list: cstringArray, - values_list_sizes: ptr csize_t, - timestamps_list: cstringArray, - timestamps_list_sizes: ptr csize_t, - errs: cstringArray, -) {.cdecl, importc: "rocksdb_multi_get_cf_with_ts", dynlib: librocksdb.} - +proc rocksdb_multi_get*(db: ptr rocksdb_t; options: ptr rocksdb_readoptions_t; + num_keys: csize_t; keys_list: cstringArray; + keys_list_sizes: ptr csize_t; values_list: cstringArray; + values_list_sizes: ptr csize_t; errs: cstringArray) {.cdecl.} +proc rocksdb_multi_get_with_ts*(db: ptr rocksdb_t; + options: ptr rocksdb_readoptions_t; + num_keys: csize_t; keys_list: cstringArray; + keys_list_sizes: ptr csize_t; + values_list: cstringArray; + values_list_sizes: ptr csize_t; + timestamp_list: cstringArray; + timestamp_list_sizes: ptr csize_t; + errs: cstringArray) {.cdecl.} +proc rocksdb_multi_get_cf*(db: ptr rocksdb_t; options: ptr rocksdb_readoptions_t; + column_families: ptr ptr rocksdb_column_family_handle_t; num_keys: csize_t; + keys_list: cstringArray; keys_list_sizes: ptr csize_t; + values_list: cstringArray; + values_list_sizes: ptr csize_t; errs: cstringArray) {.cdecl.} +proc rocksdb_multi_get_cf_with_ts*(db: ptr rocksdb_t; + options: ptr rocksdb_readoptions_t; + column_families: ptr ptr rocksdb_column_family_handle_t; num_keys: csize_t; + keys_list: cstringArray; + keys_list_sizes: ptr csize_t; + values_list: cstringArray; + values_list_sizes: ptr csize_t; + timestamps_list: cstringArray; + timestamps_list_sizes: ptr csize_t; + errs: cstringArray) {.cdecl.} ## The MultiGet API that improves performance by batching operations ## in the read path for greater efficiency. Currently, only the block based ## table format with full filters are supported. Other table formats such @@ -823,895 +371,374 @@ proc rocksdb_multi_get_cf_with_ts*( ## internally by the API - the input array will not be ## modified -proc rocksdb_batched_multi_get_cf*( - db: ptr rocksdb_t, - options: ptr rocksdb_readoptions_t, - column_family: ptr rocksdb_column_family_handle_t, - num_keys: csize_t, - keys_list: cstringArray, - keys_list_sizes: ptr csize_t, - values: ptr ptr rocksdb_pinnableslice_t, - errs: cstringArray, - sorted_input: bool, -) {.cdecl, importc: "rocksdb_batched_multi_get_cf", dynlib: librocksdb.} - +proc rocksdb_batched_multi_get_cf*(db: ptr rocksdb_t; + options: ptr rocksdb_readoptions_t; column_family: ptr rocksdb_column_family_handle_t; + num_keys: csize_t; keys_list: cstringArray; + keys_list_sizes: ptr csize_t; + values: ptr ptr rocksdb_pinnableslice_t; + errs: cstringArray; sorted_input: bool) {.cdecl.} ## The value is only allocated (using malloc) and returned if it is found and ## value_found isn't NULL. In that case the user is responsible for freeing it. -proc rocksdb_key_may_exist*( - db: ptr rocksdb_t, - options: ptr rocksdb_readoptions_t, - key: cstring, - key_len: csize_t, - value: cstringArray, - val_len: ptr csize_t, - timestamp: cstring, - timestamp_len: csize_t, - value_found: ptr uint8, -): uint8 {.cdecl, importc: "rocksdb_key_may_exist", dynlib: librocksdb.} - +proc rocksdb_key_may_exist*(db: ptr rocksdb_t; options: ptr rocksdb_readoptions_t; + key: cstring; key_len: csize_t; value: cstringArray; + val_len: ptr csize_t; timestamp: cstring; + timestamp_len: csize_t; value_found: ptr uint8): uint8 {. + cdecl.} ## The value is only allocated (using malloc) and returned if it is found and ## value_found isn't NULL. In that case the user is responsible for freeing it. -proc rocksdb_key_may_exist_cf*( - db: ptr rocksdb_t, - options: ptr rocksdb_readoptions_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - key_len: csize_t, - value: cstringArray, - val_len: ptr csize_t, - timestamp: cstring, - timestamp_len: csize_t, - value_found: ptr uint8, -): uint8 {.cdecl, importc: "rocksdb_key_may_exist_cf", dynlib: librocksdb.} - -proc rocksdb_create_iterator*( - db: ptr rocksdb_t, options: ptr rocksdb_readoptions_t -): ptr rocksdb_iterator_t {. - cdecl, importc: "rocksdb_create_iterator", dynlib: librocksdb -.} - -proc rocksdb_get_updates_since*( - db: ptr rocksdb_t, - seq_number: uint64, - options: ptr rocksdb_wal_readoptions_t, - errptr: cstringArray, -): ptr rocksdb_wal_iterator_t {. - cdecl, importc: "rocksdb_get_updates_since", dynlib: librocksdb -.} - -proc rocksdb_create_iterator_cf*( - db: ptr rocksdb_t, - options: ptr rocksdb_readoptions_t, - column_family: ptr rocksdb_column_family_handle_t, -): ptr rocksdb_iterator_t {. - cdecl, importc: "rocksdb_create_iterator_cf", dynlib: librocksdb -.} - -proc rocksdb_create_iterators*( - db: ptr rocksdb_t, - opts: ptr rocksdb_readoptions_t, - column_families: ptr ptr rocksdb_column_family_handle_t, - iterators: ptr ptr rocksdb_iterator_t, - size: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_create_iterators", dynlib: librocksdb.} - -proc rocksdb_create_snapshot*( - db: ptr rocksdb_t -): ptr rocksdb_snapshot_t {. - cdecl, importc: "rocksdb_create_snapshot", dynlib: librocksdb -.} - -proc rocksdb_release_snapshot*( - db: ptr rocksdb_t, snapshot: ptr rocksdb_snapshot_t -) {.cdecl, importc: "rocksdb_release_snapshot", dynlib: librocksdb.} - -proc rocksdb_snapshot_get_sequence_number*( - snapshot: ptr rocksdb_snapshot_t -): uint64 {.cdecl, importc: "rocksdb_snapshot_get_sequence_number", dynlib: librocksdb.} - +proc rocksdb_key_may_exist_cf*(db: ptr rocksdb_t; + options: ptr rocksdb_readoptions_t; column_family: ptr rocksdb_column_family_handle_t; + key: cstring; key_len: csize_t; value: cstringArray; + val_len: ptr csize_t; timestamp: cstring; + timestamp_len: csize_t; value_found: ptr uint8): uint8 {. + cdecl.} +proc rocksdb_create_iterator*(db: ptr rocksdb_t; options: ptr rocksdb_readoptions_t): ptr rocksdb_iterator_t {. + cdecl.} +proc rocksdb_get_updates_since*(db: ptr rocksdb_t; seq_number: uint64; + options: ptr rocksdb_wal_readoptions_t; + errptr: cstringArray): ptr rocksdb_wal_iterator_t {. + cdecl.} +proc rocksdb_create_iterator_cf*(db: ptr rocksdb_t; + options: ptr rocksdb_readoptions_t; column_family: ptr rocksdb_column_family_handle_t): ptr rocksdb_iterator_t {. + cdecl.} +proc rocksdb_create_iterators*(db: ptr rocksdb_t; opts: ptr rocksdb_readoptions_t; + column_families: ptr ptr rocksdb_column_family_handle_t; + iterators: ptr ptr rocksdb_iterator_t; size: csize_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_create_snapshot*(db: ptr rocksdb_t): ptr rocksdb_snapshot_t {.cdecl.} +proc rocksdb_release_snapshot*(db: ptr rocksdb_t; snapshot: ptr rocksdb_snapshot_t) {. + cdecl.} +proc rocksdb_snapshot_get_sequence_number*(snapshot: ptr rocksdb_snapshot_t): uint64 {. + cdecl.} ## Returns NULL if property name is unknown. ## Else returns a pointer to a malloc()-ed null-terminated value. -proc rocksdb_property_value*( - db: ptr rocksdb_t, propname: cstring -): cstring {.cdecl, importc: "rocksdb_property_value", dynlib: librocksdb.} - +proc rocksdb_property_value*(db: ptr rocksdb_t; propname: cstring): cstring {.cdecl.} ## returns 0 on success, -1 otherwise -proc rocksdb_property_int*( - db: ptr rocksdb_t, propname: cstring, out_val: ptr uint64 -): cint {.cdecl, importc: "rocksdb_property_int", dynlib: librocksdb.} - +proc rocksdb_property_int*(db: ptr rocksdb_t; propname: cstring; out_val: ptr uint64): cint {. + cdecl.} ## returns 0 on success, -1 otherwise -proc rocksdb_property_int_cf*( - db: ptr rocksdb_t, - column_family: ptr rocksdb_column_family_handle_t, - propname: cstring, - out_val: ptr uint64, -): cint {.cdecl, importc: "rocksdb_property_int_cf", dynlib: librocksdb.} - -proc rocksdb_property_value_cf*( - db: ptr rocksdb_t, - column_family: ptr rocksdb_column_family_handle_t, - propname: cstring, -): cstring {.cdecl, importc: "rocksdb_property_value_cf", dynlib: librocksdb.} - -proc rocksdb_approximate_sizes*( - db: ptr rocksdb_t, - num_ranges: cint, - range_start_key: cstringArray, - range_start_key_len: ptr csize_t, - range_limit_key: cstringArray, - range_limit_key_len: ptr csize_t, - sizes: ptr uint64, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_approximate_sizes", dynlib: librocksdb.} - -proc rocksdb_approximate_sizes_cf*( - db: ptr rocksdb_t, - column_family: ptr rocksdb_column_family_handle_t, - num_ranges: cint, - range_start_key: cstringArray, - range_start_key_len: ptr csize_t, - range_limit_key: cstringArray, - range_limit_key_len: ptr csize_t, - sizes: ptr uint64, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_approximate_sizes_cf", dynlib: librocksdb.} - +proc rocksdb_property_int_cf*(db: ptr rocksdb_t; + column_family: ptr rocksdb_column_family_handle_t; + propname: cstring; out_val: ptr uint64): cint {.cdecl.} +proc rocksdb_property_value_cf*(db: ptr rocksdb_t; column_family: ptr rocksdb_column_family_handle_t; + propname: cstring): cstring {.cdecl.} +proc rocksdb_approximate_sizes*(db: ptr rocksdb_t; num_ranges: cint; + range_start_key: cstringArray; + range_start_key_len: ptr csize_t; + range_limit_key: cstringArray; + range_limit_key_len: ptr csize_t; sizes: ptr uint64; + errptr: cstringArray) {.cdecl.} +proc rocksdb_approximate_sizes_cf*(db: ptr rocksdb_t; column_family: ptr rocksdb_column_family_handle_t; + num_ranges: cint; range_start_key: cstringArray; + range_start_key_len: ptr csize_t; + range_limit_key: cstringArray; + range_limit_key_len: ptr csize_t; + sizes: ptr uint64; errptr: cstringArray) {.cdecl.} const rocksdb_size_approximation_flags_none* = 0 rocksdb_size_approximation_flags_include_memtable* = 1 shl 0 rocksdb_size_approximation_flags_include_files* = 1 shl 1 -proc rocksdb_approximate_sizes_cf_with_flags*( - db: ptr rocksdb_t, - column_family: ptr rocksdb_column_family_handle_t, - num_ranges: cint, - range_start_key: cstringArray, - range_start_key_len: ptr csize_t, - range_limit_key: cstringArray, - range_limit_key_len: ptr csize_t, - include_flags: uint8, - sizes: ptr uint64, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_approximate_sizes_cf_with_flags", dynlib: librocksdb.} - -proc rocksdb_compact_range*( - db: ptr rocksdb_t, - start_key: cstring, - start_key_len: csize_t, - limit_key: cstring, - limit_key_len: csize_t, -) {.cdecl, importc: "rocksdb_compact_range", dynlib: librocksdb.} - -proc rocksdb_compact_range_cf*( - db: ptr rocksdb_t, - column_family: ptr rocksdb_column_family_handle_t, - start_key: cstring, - start_key_len: csize_t, - limit_key: cstring, - limit_key_len: csize_t, -) {.cdecl, importc: "rocksdb_compact_range_cf", dynlib: librocksdb.} - -proc rocksdb_suggest_compact_range*( - db: ptr rocksdb_t, - start_key: cstring, - start_key_len: csize_t, - limit_key: cstring, - limit_key_len: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_suggest_compact_range", dynlib: librocksdb.} - -proc rocksdb_suggest_compact_range_cf*( - db: ptr rocksdb_t, - column_family: ptr rocksdb_column_family_handle_t, - start_key: cstring, - start_key_len: csize_t, - limit_key: cstring, - limit_key_len: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_suggest_compact_range_cf", dynlib: librocksdb.} - -proc rocksdb_compact_range_opt*( - db: ptr rocksdb_t, - opt: ptr rocksdb_compactoptions_t, - start_key: cstring, - start_key_len: csize_t, - limit_key: cstring, - limit_key_len: csize_t, -) {.cdecl, importc: "rocksdb_compact_range_opt", dynlib: librocksdb.} - -proc rocksdb_compact_range_cf_opt*( - db: ptr rocksdb_t, - column_family: ptr rocksdb_column_family_handle_t, - opt: ptr rocksdb_compactoptions_t, - start_key: cstring, - start_key_len: csize_t, - limit_key: cstring, - limit_key_len: csize_t, -) {.cdecl, importc: "rocksdb_compact_range_cf_opt", dynlib: librocksdb.} - -proc rocksdb_delete_file*( - db: ptr rocksdb_t, name: cstring -) {.cdecl, importc: "rocksdb_delete_file", dynlib: librocksdb.} - -proc rocksdb_livefiles*( - db: ptr rocksdb_t -): ptr rocksdb_livefiles_t {.cdecl, importc: "rocksdb_livefiles", dynlib: librocksdb.} - -proc rocksdb_flush*( - db: ptr rocksdb_t, options: ptr rocksdb_flushoptions_t, errptr: cstringArray -) {.cdecl, importc: "rocksdb_flush", dynlib: librocksdb.} - -proc rocksdb_flush_cf*( - db: ptr rocksdb_t, - options: ptr rocksdb_flushoptions_t, - column_family: ptr rocksdb_column_family_handle_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_flush_cf", dynlib: librocksdb.} - -proc rocksdb_flush_cfs*( - db: ptr rocksdb_t, - options: ptr rocksdb_flushoptions_t, - column_family: ptr ptr rocksdb_column_family_handle_t, - num_column_families: cint, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_flush_cfs", dynlib: librocksdb.} - -proc rocksdb_flush_wal*( - db: ptr rocksdb_t, sync: uint8, errptr: cstringArray -) {.cdecl, importc: "rocksdb_flush_wal", dynlib: librocksdb.} - -proc rocksdb_disable_file_deletions*( - db: ptr rocksdb_t, errptr: cstringArray -) {.cdecl, importc: "rocksdb_disable_file_deletions", dynlib: librocksdb.} - -proc rocksdb_enable_file_deletions*( - db: ptr rocksdb_t, errptr: cstringArray -) {.cdecl, importc: "rocksdb_enable_file_deletions", dynlib: librocksdb.} - +proc rocksdb_approximate_sizes_cf_with_flags*(db: ptr rocksdb_t; + column_family: ptr rocksdb_column_family_handle_t; num_ranges: cint; + range_start_key: cstringArray; range_start_key_len: ptr csize_t; + range_limit_key: cstringArray; range_limit_key_len: ptr csize_t; + include_flags: uint8; sizes: ptr uint64; errptr: cstringArray) {.cdecl.} +proc rocksdb_compact_range*(db: ptr rocksdb_t; start_key: cstring; + start_key_len: csize_t; limit_key: cstring; + limit_key_len: csize_t) {.cdecl.} +proc rocksdb_compact_range_cf*(db: ptr rocksdb_t; column_family: ptr rocksdb_column_family_handle_t; + start_key: cstring; start_key_len: csize_t; + limit_key: cstring; limit_key_len: csize_t) {.cdecl.} +proc rocksdb_suggest_compact_range*(db: ptr rocksdb_t; start_key: cstring; + start_key_len: csize_t; limit_key: cstring; + limit_key_len: csize_t; errptr: cstringArray) {. + cdecl.} +proc rocksdb_suggest_compact_range_cf*(db: ptr rocksdb_t; column_family: ptr rocksdb_column_family_handle_t; + start_key: cstring; start_key_len: csize_t; + limit_key: cstring; limit_key_len: csize_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_compact_range_opt*(db: ptr rocksdb_t; + opt: ptr rocksdb_compactoptions_t; + start_key: cstring; start_key_len: csize_t; + limit_key: cstring; limit_key_len: csize_t) {.cdecl.} +proc rocksdb_compact_range_cf_opt*(db: ptr rocksdb_t; column_family: ptr rocksdb_column_family_handle_t; + opt: ptr rocksdb_compactoptions_t; + start_key: cstring; start_key_len: csize_t; + limit_key: cstring; limit_key_len: csize_t) {. + cdecl.} +proc rocksdb_delete_file*(db: ptr rocksdb_t; name: cstring) {.cdecl.} +proc rocksdb_livefiles*(db: ptr rocksdb_t): ptr rocksdb_livefiles_t {.cdecl.} +proc rocksdb_flush*(db: ptr rocksdb_t; options: ptr rocksdb_flushoptions_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_flush_cf*(db: ptr rocksdb_t; options: ptr rocksdb_flushoptions_t; + column_family: ptr rocksdb_column_family_handle_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_flush_cfs*(db: ptr rocksdb_t; options: ptr rocksdb_flushoptions_t; + column_family: ptr ptr rocksdb_column_family_handle_t; + num_column_families: cint; errptr: cstringArray) {.cdecl.} +proc rocksdb_flush_wal*(db: ptr rocksdb_t; sync: uint8; errptr: cstringArray) {.cdecl.} +proc rocksdb_disable_file_deletions*(db: ptr rocksdb_t; errptr: cstringArray) {.cdecl.} +proc rocksdb_enable_file_deletions*(db: ptr rocksdb_t; errptr: cstringArray) {.cdecl.} ## Management operations -proc rocksdb_destroy_db*( - options: ptr rocksdb_options_t, name: cstring, errptr: cstringArray -) {.cdecl, importc: "rocksdb_destroy_db", dynlib: librocksdb.} - -proc rocksdb_repair_db*( - options: ptr rocksdb_options_t, name: cstring, errptr: cstringArray -) {.cdecl, importc: "rocksdb_repair_db", dynlib: librocksdb.} - +proc rocksdb_destroy_db*(options: ptr rocksdb_options_t; name: cstring; + errptr: cstringArray) {.cdecl.} +proc rocksdb_repair_db*(options: ptr rocksdb_options_t; name: cstring; + errptr: cstringArray) {.cdecl.} ## Iterator -proc rocksdb_iter_destroy*( - a1: ptr rocksdb_iterator_t -) {.cdecl, importc: "rocksdb_iter_destroy", dynlib: librocksdb.} - -proc rocksdb_iter_valid*( - a1: ptr rocksdb_iterator_t -): uint8 {.cdecl, importc: "rocksdb_iter_valid", dynlib: librocksdb.} - -proc rocksdb_iter_seek_to_first*( - a1: ptr rocksdb_iterator_t -) {.cdecl, importc: "rocksdb_iter_seek_to_first", dynlib: librocksdb.} - -proc rocksdb_iter_seek_to_last*( - a1: ptr rocksdb_iterator_t -) {.cdecl, importc: "rocksdb_iter_seek_to_last", dynlib: librocksdb.} - -proc rocksdb_iter_seek*( - a1: ptr rocksdb_iterator_t, k: cstring, klen: csize_t -) {.cdecl, importc: "rocksdb_iter_seek", dynlib: librocksdb.} - -proc rocksdb_iter_seek_for_prev*( - a1: ptr rocksdb_iterator_t, k: cstring, klen: csize_t -) {.cdecl, importc: "rocksdb_iter_seek_for_prev", dynlib: librocksdb.} - -proc rocksdb_iter_next*( - a1: ptr rocksdb_iterator_t -) {.cdecl, importc: "rocksdb_iter_next", dynlib: librocksdb.} - -proc rocksdb_iter_prev*( - a1: ptr rocksdb_iterator_t -) {.cdecl, importc: "rocksdb_iter_prev", dynlib: librocksdb.} - -proc rocksdb_iter_key*( - a1: ptr rocksdb_iterator_t, klen: ptr csize_t -): cstring {.cdecl, importc: "rocksdb_iter_key", dynlib: librocksdb.} - -proc rocksdb_iter_value*( - a1: ptr rocksdb_iterator_t, vlen: ptr csize_t -): cstring {.cdecl, importc: "rocksdb_iter_value", dynlib: librocksdb.} - -proc rocksdb_iter_timestamp*( - a1: ptr rocksdb_iterator_t, tslen: ptr csize_t -): cstring {.cdecl, importc: "rocksdb_iter_timestamp", dynlib: librocksdb.} - -proc rocksdb_iter_get_error*( - a1: ptr rocksdb_iterator_t, errptr: cstringArray -) {.cdecl, importc: "rocksdb_iter_get_error", dynlib: librocksdb.} - -proc rocksdb_iter_refresh*( - iter: ptr rocksdb_iterator_t, errptr: cstringArray -) {.cdecl, importc: "rocksdb_iter_refresh", dynlib: librocksdb.} - -proc rocksdb_wal_iter_next*( - iter: ptr rocksdb_wal_iterator_t -) {.cdecl, importc: "rocksdb_wal_iter_next", dynlib: librocksdb.} - -proc rocksdb_wal_iter_valid*( - a1: ptr rocksdb_wal_iterator_t -): uint8 {.cdecl, importc: "rocksdb_wal_iter_valid", dynlib: librocksdb.} - -proc rocksdb_wal_iter_status*( - iter: ptr rocksdb_wal_iterator_t, errptr: cstringArray -) {.cdecl, importc: "rocksdb_wal_iter_status", dynlib: librocksdb.} - -proc rocksdb_wal_iter_get_batch*( - iter: ptr rocksdb_wal_iterator_t, seq: ptr uint64 -): ptr rocksdb_writebatch_t {. - cdecl, importc: "rocksdb_wal_iter_get_batch", dynlib: librocksdb -.} - -proc rocksdb_get_latest_sequence_number*( - db: ptr rocksdb_t -): uint64 {.cdecl, importc: "rocksdb_get_latest_sequence_number", dynlib: librocksdb.} - -proc rocksdb_wal_iter_destroy*( - iter: ptr rocksdb_wal_iterator_t -) {.cdecl, importc: "rocksdb_wal_iter_destroy", dynlib: librocksdb.} - +proc rocksdb_iter_destroy*(a1: ptr rocksdb_iterator_t) {.cdecl.} +proc rocksdb_iter_valid*(a1: ptr rocksdb_iterator_t): uint8 {.cdecl.} +proc rocksdb_iter_seek_to_first*(a1: ptr rocksdb_iterator_t) {.cdecl.} +proc rocksdb_iter_seek_to_last*(a1: ptr rocksdb_iterator_t) {.cdecl.} +proc rocksdb_iter_seek*(a1: ptr rocksdb_iterator_t; k: cstring; klen: csize_t) {.cdecl.} +proc rocksdb_iter_seek_for_prev*(a1: ptr rocksdb_iterator_t; k: cstring; klen: csize_t) {. + cdecl.} +proc rocksdb_iter_next*(a1: ptr rocksdb_iterator_t) {.cdecl.} +proc rocksdb_iter_prev*(a1: ptr rocksdb_iterator_t) {.cdecl.} +proc rocksdb_iter_key*(a1: ptr rocksdb_iterator_t; klen: ptr csize_t): cstring {.cdecl.} +proc rocksdb_iter_value*(a1: ptr rocksdb_iterator_t; vlen: ptr csize_t): cstring {.cdecl.} +proc rocksdb_iter_timestamp*(a1: ptr rocksdb_iterator_t; tslen: ptr csize_t): cstring {. + cdecl.} +proc rocksdb_iter_get_error*(a1: ptr rocksdb_iterator_t; errptr: cstringArray) {.cdecl.} +proc rocksdb_iter_refresh*(iter: ptr rocksdb_iterator_t; errptr: cstringArray) {.cdecl.} +proc rocksdb_wal_iter_next*(iter: ptr rocksdb_wal_iterator_t) {.cdecl.} +proc rocksdb_wal_iter_valid*(a1: ptr rocksdb_wal_iterator_t): uint8 {.cdecl.} +proc rocksdb_wal_iter_status*(iter: ptr rocksdb_wal_iterator_t; errptr: cstringArray) {. + cdecl.} +proc rocksdb_wal_iter_get_batch*(iter: ptr rocksdb_wal_iterator_t; seq: ptr uint64): ptr rocksdb_writebatch_t {. + cdecl.} +proc rocksdb_get_latest_sequence_number*(db: ptr rocksdb_t): uint64 {.cdecl.} +proc rocksdb_wal_iter_destroy*(iter: ptr rocksdb_wal_iterator_t) {.cdecl.} ## Write batch -proc rocksdb_writebatch_create*(): ptr rocksdb_writebatch_t {. - cdecl, importc: "rocksdb_writebatch_create", dynlib: librocksdb -.} - -proc rocksdb_writebatch_create_from*( - rep: cstring, size: csize_t -): ptr rocksdb_writebatch_t {. - cdecl, importc: "rocksdb_writebatch_create_from", dynlib: librocksdb -.} - -proc rocksdb_writebatch_create_with_params*( - reserved_bytes: csize_t, - max_bytes: csize_t, - protection_bytes_per_key: csize_t, - default_cf_ts_sz: csize_t, -): ptr rocksdb_writebatch_t {. - cdecl, importc: "rocksdb_writebatch_create_with_params", dynlib: librocksdb -.} - -proc rocksdb_writebatch_destroy*( - a1: ptr rocksdb_writebatch_t -) {.cdecl, importc: "rocksdb_writebatch_destroy", dynlib: librocksdb.} - -proc rocksdb_writebatch_clear*( - a1: ptr rocksdb_writebatch_t -) {.cdecl, importc: "rocksdb_writebatch_clear", dynlib: librocksdb.} - -proc rocksdb_writebatch_count*( - a1: ptr rocksdb_writebatch_t -): cint {.cdecl, importc: "rocksdb_writebatch_count", dynlib: librocksdb.} - -proc rocksdb_writebatch_put*( - a1: ptr rocksdb_writebatch_t, key: cstring, klen: csize_t, val: cstring, vlen: csize_t -) {.cdecl, importc: "rocksdb_writebatch_put", dynlib: librocksdb.} - -proc rocksdb_writebatch_put_cf*( - a1: ptr rocksdb_writebatch_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - klen: csize_t, - val: cstring, - vlen: csize_t, -) {.cdecl, importc: "rocksdb_writebatch_put_cf", dynlib: librocksdb.} - -proc rocksdb_writebatch_put_cf_with_ts*( - a1: ptr rocksdb_writebatch_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - klen: csize_t, - ts: cstring, - tslen: csize_t, - val: cstring, - vlen: csize_t, -) {.cdecl, importc: "rocksdb_writebatch_put_cf_with_ts", dynlib: librocksdb.} - -proc rocksdb_writebatch_putv*( - b: ptr rocksdb_writebatch_t, - num_keys: cint, - keys_list: cstringArray, - keys_list_sizes: ptr csize_t, - num_values: cint, - values_list: cstringArray, - values_list_sizes: ptr csize_t, -) {.cdecl, importc: "rocksdb_writebatch_putv", dynlib: librocksdb.} - -proc rocksdb_writebatch_putv_cf*( - b: ptr rocksdb_writebatch_t, - column_family: ptr rocksdb_column_family_handle_t, - num_keys: cint, - keys_list: cstringArray, - keys_list_sizes: ptr csize_t, - num_values: cint, - values_list: cstringArray, - values_list_sizes: ptr csize_t, -) {.cdecl, importc: "rocksdb_writebatch_putv_cf", dynlib: librocksdb.} - -proc rocksdb_writebatch_merge*( - a1: ptr rocksdb_writebatch_t, key: cstring, klen: csize_t, val: cstring, vlen: csize_t -) {.cdecl, importc: "rocksdb_writebatch_merge", dynlib: librocksdb.} - -proc rocksdb_writebatch_merge_cf*( - a1: ptr rocksdb_writebatch_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - klen: csize_t, - val: cstring, - vlen: csize_t, -) {.cdecl, importc: "rocksdb_writebatch_merge_cf", dynlib: librocksdb.} - -proc rocksdb_writebatch_mergev*( - b: ptr rocksdb_writebatch_t, - num_keys: cint, - keys_list: cstringArray, - keys_list_sizes: ptr csize_t, - num_values: cint, - values_list: cstringArray, - values_list_sizes: ptr csize_t, -) {.cdecl, importc: "rocksdb_writebatch_mergev", dynlib: librocksdb.} - -proc rocksdb_writebatch_mergev_cf*( - b: ptr rocksdb_writebatch_t, - column_family: ptr rocksdb_column_family_handle_t, - num_keys: cint, - keys_list: cstringArray, - keys_list_sizes: ptr csize_t, - num_values: cint, - values_list: cstringArray, - values_list_sizes: ptr csize_t, -) {.cdecl, importc: "rocksdb_writebatch_mergev_cf", dynlib: librocksdb.} - -proc rocksdb_writebatch_delete*( - a1: ptr rocksdb_writebatch_t, key: cstring, klen: csize_t -) {.cdecl, importc: "rocksdb_writebatch_delete", dynlib: librocksdb.} - -proc rocksdb_writebatch_singledelete*( - b: ptr rocksdb_writebatch_t, key: cstring, klen: csize_t -) {.cdecl, importc: "rocksdb_writebatch_singledelete", dynlib: librocksdb.} - -proc rocksdb_writebatch_delete_cf*( - a1: ptr rocksdb_writebatch_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - klen: csize_t, -) {.cdecl, importc: "rocksdb_writebatch_delete_cf", dynlib: librocksdb.} - -proc rocksdb_writebatch_delete_cf_with_ts*( - a1: ptr rocksdb_writebatch_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - klen: csize_t, - ts: cstring, - tslen: csize_t, -) {.cdecl, importc: "rocksdb_writebatch_delete_cf_with_ts", dynlib: librocksdb.} - -proc rocksdb_writebatch_singledelete_cf*( - b: ptr rocksdb_writebatch_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - klen: csize_t, -) {.cdecl, importc: "rocksdb_writebatch_singledelete_cf", dynlib: librocksdb.} - -proc rocksdb_writebatch_singledelete_cf_with_ts*( - b: ptr rocksdb_writebatch_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - klen: csize_t, - ts: cstring, - tslen: csize_t, -) {.cdecl, importc: "rocksdb_writebatch_singledelete_cf_with_ts", dynlib: librocksdb.} - -proc rocksdb_writebatch_deletev*( - b: ptr rocksdb_writebatch_t, - num_keys: cint, - keys_list: cstringArray, - keys_list_sizes: ptr csize_t, -) {.cdecl, importc: "rocksdb_writebatch_deletev", dynlib: librocksdb.} - -proc rocksdb_writebatch_deletev_cf*( - b: ptr rocksdb_writebatch_t, - column_family: ptr rocksdb_column_family_handle_t, - num_keys: cint, - keys_list: cstringArray, - keys_list_sizes: ptr csize_t, -) {.cdecl, importc: "rocksdb_writebatch_deletev_cf", dynlib: librocksdb.} - -proc rocksdb_writebatch_delete_range*( - b: ptr rocksdb_writebatch_t, - start_key: cstring, - start_key_len: csize_t, - end_key: cstring, - end_key_len: csize_t, -) {.cdecl, importc: "rocksdb_writebatch_delete_range", dynlib: librocksdb.} - -proc rocksdb_writebatch_delete_range_cf*( - b: ptr rocksdb_writebatch_t, - column_family: ptr rocksdb_column_family_handle_t, - start_key: cstring, - start_key_len: csize_t, - end_key: cstring, - end_key_len: csize_t, -) {.cdecl, importc: "rocksdb_writebatch_delete_range_cf", dynlib: librocksdb.} - -proc rocksdb_writebatch_delete_rangev*( - b: ptr rocksdb_writebatch_t, - num_keys: cint, - start_keys_list: cstringArray, - start_keys_list_sizes: ptr csize_t, - end_keys_list: cstringArray, - end_keys_list_sizes: ptr csize_t, -) {.cdecl, importc: "rocksdb_writebatch_delete_rangev", dynlib: librocksdb.} - -proc rocksdb_writebatch_delete_rangev_cf*( - b: ptr rocksdb_writebatch_t, - column_family: ptr rocksdb_column_family_handle_t, - num_keys: cint, - start_keys_list: cstringArray, - start_keys_list_sizes: ptr csize_t, - end_keys_list: cstringArray, - end_keys_list_sizes: ptr csize_t, -) {.cdecl, importc: "rocksdb_writebatch_delete_rangev_cf", dynlib: librocksdb.} - -proc rocksdb_writebatch_put_log_data*( - a1: ptr rocksdb_writebatch_t, blob: cstring, len: csize_t -) {.cdecl, importc: "rocksdb_writebatch_put_log_data", dynlib: librocksdb.} - -proc rocksdb_writebatch_iterate*( - a1: ptr rocksdb_writebatch_t, - state: pointer, - put: proc(a1: pointer, k: cstring, klen: csize_t, v: cstring, vlen: csize_t) {.cdecl.}, - deleted: proc(a1: pointer, k: cstring, klen: csize_t) {.cdecl.}, -) {.cdecl, importc: "rocksdb_writebatch_iterate", dynlib: librocksdb.} - -proc rocksdb_writebatch_iterate_cf*( - a1: ptr rocksdb_writebatch_t, - state: pointer, - put_cf: proc( - a1: pointer, cfid: uint32, k: cstring, klen: csize_t, v: cstring, vlen: csize_t - ) {.cdecl.}, - deleted_cf: proc(a1: pointer, cfid: uint32, k: cstring, klen: csize_t) {.cdecl.}, - merge_cf: proc( - a1: pointer, cfid: uint32, k: cstring, klen: csize_t, v: cstring, vlen: csize_t - ) {.cdecl.}, -) {.cdecl, importc: "rocksdb_writebatch_iterate_cf", dynlib: librocksdb.} - -proc rocksdb_writebatch_data*( - a1: ptr rocksdb_writebatch_t, size: ptr csize_t -): cstring {.cdecl, importc: "rocksdb_writebatch_data", dynlib: librocksdb.} - -proc rocksdb_writebatch_set_save_point*( - a1: ptr rocksdb_writebatch_t -) {.cdecl, importc: "rocksdb_writebatch_set_save_point", dynlib: librocksdb.} - -proc rocksdb_writebatch_rollback_to_save_point*( - a1: ptr rocksdb_writebatch_t, errptr: cstringArray -) {.cdecl, importc: "rocksdb_writebatch_rollback_to_save_point", dynlib: librocksdb.} - -proc rocksdb_writebatch_pop_save_point*( - a1: ptr rocksdb_writebatch_t, errptr: cstringArray -) {.cdecl, importc: "rocksdb_writebatch_pop_save_point", dynlib: librocksdb.} - -proc rocksdb_writebatch_update_timestamps*( - wb: ptr rocksdb_writebatch_t, - ts: cstring, - tslen: csize_t, - state: pointer, - get_ts_size: proc(a1: pointer, a2: uint32): csize_t {.cdecl.}, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_writebatch_update_timestamps", dynlib: librocksdb.} - +proc rocksdb_writebatch_create*(): ptr rocksdb_writebatch_t {.cdecl.} +proc rocksdb_writebatch_create_from*(rep: cstring; size: csize_t): ptr rocksdb_writebatch_t {. + cdecl.} +proc rocksdb_writebatch_create_with_params*(reserved_bytes: csize_t; + max_bytes: csize_t; protection_bytes_per_key: csize_t; default_cf_ts_sz: csize_t): ptr rocksdb_writebatch_t {. + cdecl.} +proc rocksdb_writebatch_destroy*(a1: ptr rocksdb_writebatch_t) {.cdecl.} +proc rocksdb_writebatch_clear*(a1: ptr rocksdb_writebatch_t) {.cdecl.} +proc rocksdb_writebatch_count*(a1: ptr rocksdb_writebatch_t): cint {.cdecl.} +proc rocksdb_writebatch_put*(a1: ptr rocksdb_writebatch_t; key: cstring; + klen: csize_t; val: cstring; vlen: csize_t) {.cdecl.} +proc rocksdb_writebatch_put_cf*(a1: ptr rocksdb_writebatch_t; column_family: ptr rocksdb_column_family_handle_t; + key: cstring; klen: csize_t; val: cstring; + vlen: csize_t) {.cdecl.} +proc rocksdb_writebatch_put_cf_with_ts*(a1: ptr rocksdb_writebatch_t; column_family: ptr rocksdb_column_family_handle_t; + key: cstring; klen: csize_t; ts: cstring; + tslen: csize_t; val: cstring; vlen: csize_t) {. + cdecl.} +proc rocksdb_writebatch_putv*(b: ptr rocksdb_writebatch_t; num_keys: cint; + keys_list: cstringArray; + keys_list_sizes: ptr csize_t; num_values: cint; + values_list: cstringArray; + values_list_sizes: ptr csize_t) {.cdecl.} +proc rocksdb_writebatch_putv_cf*(b: ptr rocksdb_writebatch_t; column_family: ptr rocksdb_column_family_handle_t; + num_keys: cint; keys_list: cstringArray; + keys_list_sizes: ptr csize_t; num_values: cint; + values_list: cstringArray; + values_list_sizes: ptr csize_t) {.cdecl.} +proc rocksdb_writebatch_merge*(a1: ptr rocksdb_writebatch_t; key: cstring; + klen: csize_t; val: cstring; vlen: csize_t) {.cdecl.} +proc rocksdb_writebatch_merge_cf*(a1: ptr rocksdb_writebatch_t; column_family: ptr rocksdb_column_family_handle_t; + key: cstring; klen: csize_t; val: cstring; + vlen: csize_t) {.cdecl.} +proc rocksdb_writebatch_mergev*(b: ptr rocksdb_writebatch_t; num_keys: cint; + keys_list: cstringArray; + keys_list_sizes: ptr csize_t; num_values: cint; + values_list: cstringArray; + values_list_sizes: ptr csize_t) {.cdecl.} +proc rocksdb_writebatch_mergev_cf*(b: ptr rocksdb_writebatch_t; column_family: ptr rocksdb_column_family_handle_t; + num_keys: cint; keys_list: cstringArray; + keys_list_sizes: ptr csize_t; num_values: cint; + values_list: cstringArray; + values_list_sizes: ptr csize_t) {.cdecl.} +proc rocksdb_writebatch_delete*(a1: ptr rocksdb_writebatch_t; key: cstring; + klen: csize_t) {.cdecl.} +proc rocksdb_writebatch_singledelete*(b: ptr rocksdb_writebatch_t; key: cstring; + klen: csize_t) {.cdecl.} +proc rocksdb_writebatch_delete_cf*(a1: ptr rocksdb_writebatch_t; column_family: ptr rocksdb_column_family_handle_t; + key: cstring; klen: csize_t) {.cdecl.} +proc rocksdb_writebatch_delete_cf_with_ts*(a1: ptr rocksdb_writebatch_t; + column_family: ptr rocksdb_column_family_handle_t; key: cstring; klen: csize_t; + ts: cstring; tslen: csize_t) {.cdecl.} +proc rocksdb_writebatch_singledelete_cf*(b: ptr rocksdb_writebatch_t; column_family: ptr rocksdb_column_family_handle_t; + key: cstring; klen: csize_t) {.cdecl.} +proc rocksdb_writebatch_singledelete_cf_with_ts*(b: ptr rocksdb_writebatch_t; + column_family: ptr rocksdb_column_family_handle_t; key: cstring; klen: csize_t; + ts: cstring; tslen: csize_t) {.cdecl.} +proc rocksdb_writebatch_deletev*(b: ptr rocksdb_writebatch_t; num_keys: cint; + keys_list: cstringArray; + keys_list_sizes: ptr csize_t) {.cdecl.} +proc rocksdb_writebatch_deletev_cf*(b: ptr rocksdb_writebatch_t; column_family: ptr rocksdb_column_family_handle_t; + num_keys: cint; keys_list: cstringArray; + keys_list_sizes: ptr csize_t) {.cdecl.} +proc rocksdb_writebatch_delete_range*(b: ptr rocksdb_writebatch_t; + start_key: cstring; start_key_len: csize_t; + end_key: cstring; end_key_len: csize_t) {.cdecl.} +proc rocksdb_writebatch_delete_range_cf*(b: ptr rocksdb_writebatch_t; column_family: ptr rocksdb_column_family_handle_t; + start_key: cstring; + start_key_len: csize_t; end_key: cstring; + end_key_len: csize_t) {.cdecl.} +proc rocksdb_writebatch_delete_rangev*(b: ptr rocksdb_writebatch_t; num_keys: cint; + start_keys_list: cstringArray; + start_keys_list_sizes: ptr csize_t; + end_keys_list: cstringArray; + end_keys_list_sizes: ptr csize_t) {.cdecl.} +proc rocksdb_writebatch_delete_rangev_cf*(b: ptr rocksdb_writebatch_t; + column_family: ptr rocksdb_column_family_handle_t; num_keys: cint; + start_keys_list: cstringArray; start_keys_list_sizes: ptr csize_t; + end_keys_list: cstringArray; end_keys_list_sizes: ptr csize_t) {.cdecl.} +proc rocksdb_writebatch_put_log_data*(a1: ptr rocksdb_writebatch_t; blob: cstring; + len: csize_t) {.cdecl.} +proc rocksdb_writebatch_iterate*(a1: ptr rocksdb_writebatch_t; state: pointer; put: proc ( + a1: pointer; k: cstring; klen: csize_t; v: cstring; vlen: csize_t) {.cdecl.}; deleted: proc ( + a1: pointer; k: cstring; klen: csize_t) {.cdecl.}) {.cdecl.} +proc rocksdb_writebatch_iterate_cf*(a1: ptr rocksdb_writebatch_t; state: pointer; + put_cf: proc (a1: pointer; cfid: uint32; k: cstring; klen: csize_t; v: cstring; + vlen: csize_t) {.cdecl.}; deleted_cf: proc (a1: pointer; cfid: uint32; + k: cstring; klen: csize_t) {.cdecl.}; merge_cf: proc (a1: pointer; cfid: uint32; + k: cstring; klen: csize_t; v: cstring; vlen: csize_t) {.cdecl.}) {.cdecl.} +proc rocksdb_writebatch_data*(a1: ptr rocksdb_writebatch_t; size: ptr csize_t): cstring {. + cdecl.} +proc rocksdb_writebatch_set_save_point*(a1: ptr rocksdb_writebatch_t) {.cdecl.} +proc rocksdb_writebatch_rollback_to_save_point*(a1: ptr rocksdb_writebatch_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_writebatch_pop_save_point*(a1: ptr rocksdb_writebatch_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_writebatch_update_timestamps*(wb: ptr rocksdb_writebatch_t; + ts: cstring; tslen: csize_t; state: pointer; + get_ts_size: proc (a1: pointer; a2: uint32): csize_t {.cdecl.}; errptr: cstringArray) {. + cdecl.} ## Write batch with index -proc rocksdb_writebatch_wi_create*( - reserved_bytes: csize_t, overwrite_keys: uint8 -): ptr rocksdb_writebatch_wi_t {. - cdecl, importc: "rocksdb_writebatch_wi_create", dynlib: librocksdb -.} - -proc rocksdb_writebatch_wi_create_from*( - rep: cstring, size: csize_t -): ptr rocksdb_writebatch_wi_t {. - cdecl, importc: "rocksdb_writebatch_wi_create_from", dynlib: librocksdb -.} - +proc rocksdb_writebatch_wi_create*(reserved_bytes: csize_t; overwrite_keys: uint8): ptr rocksdb_writebatch_wi_t {. + cdecl.} +proc rocksdb_writebatch_wi_create_from*(rep: cstring; size: csize_t): ptr rocksdb_writebatch_wi_t {. + cdecl.} proc rocksdb_writebatch_wi_create_with_params*( - backup_index_comparator: ptr rocksdb_comparator_t, - reserved_bytes: csize_t, - overwrite_key: uint8, - max_bytes: csize_t, - protection_bytes_per_key: csize_t, -): ptr rocksdb_writebatch_wi_t {. - cdecl, importc: "rocksdb_writebatch_wi_create_with_params", dynlib: librocksdb -.} - -proc rocksdb_writebatch_wi_destroy*( - a1: ptr rocksdb_writebatch_wi_t -) {.cdecl, importc: "rocksdb_writebatch_wi_destroy", dynlib: librocksdb.} - -proc rocksdb_writebatch_wi_clear*( - a1: ptr rocksdb_writebatch_wi_t -) {.cdecl, importc: "rocksdb_writebatch_wi_clear", dynlib: librocksdb.} - -proc rocksdb_writebatch_wi_count*( - b: ptr rocksdb_writebatch_wi_t -): cint {.cdecl, importc: "rocksdb_writebatch_wi_count", dynlib: librocksdb.} - -proc rocksdb_writebatch_wi_put*( - a1: ptr rocksdb_writebatch_wi_t, - key: cstring, - klen: csize_t, - val: cstring, - vlen: csize_t, -) {.cdecl, importc: "rocksdb_writebatch_wi_put", dynlib: librocksdb.} - -proc rocksdb_writebatch_wi_put_cf*( - a1: ptr rocksdb_writebatch_wi_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - klen: csize_t, - val: cstring, - vlen: csize_t, -) {.cdecl, importc: "rocksdb_writebatch_wi_put_cf", dynlib: librocksdb.} - -proc rocksdb_writebatch_wi_putv*( - b: ptr rocksdb_writebatch_wi_t, - num_keys: cint, - keys_list: cstringArray, - keys_list_sizes: ptr csize_t, - num_values: cint, - values_list: cstringArray, - values_list_sizes: ptr csize_t, -) {.cdecl, importc: "rocksdb_writebatch_wi_putv", dynlib: librocksdb.} - -proc rocksdb_writebatch_wi_putv_cf*( - b: ptr rocksdb_writebatch_wi_t, - column_family: ptr rocksdb_column_family_handle_t, - num_keys: cint, - keys_list: cstringArray, - keys_list_sizes: ptr csize_t, - num_values: cint, - values_list: cstringArray, - values_list_sizes: ptr csize_t, -) {.cdecl, importc: "rocksdb_writebatch_wi_putv_cf", dynlib: librocksdb.} - -proc rocksdb_writebatch_wi_merge*( - a1: ptr rocksdb_writebatch_wi_t, - key: cstring, - klen: csize_t, - val: cstring, - vlen: csize_t, -) {.cdecl, importc: "rocksdb_writebatch_wi_merge", dynlib: librocksdb.} - -proc rocksdb_writebatch_wi_merge_cf*( - a1: ptr rocksdb_writebatch_wi_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - klen: csize_t, - val: cstring, - vlen: csize_t, -) {.cdecl, importc: "rocksdb_writebatch_wi_merge_cf", dynlib: librocksdb.} - -proc rocksdb_writebatch_wi_mergev*( - b: ptr rocksdb_writebatch_wi_t, - num_keys: cint, - keys_list: cstringArray, - keys_list_sizes: ptr csize_t, - num_values: cint, - values_list: cstringArray, - values_list_sizes: ptr csize_t, -) {.cdecl, importc: "rocksdb_writebatch_wi_mergev", dynlib: librocksdb.} - -proc rocksdb_writebatch_wi_mergev_cf*( - b: ptr rocksdb_writebatch_wi_t, - column_family: ptr rocksdb_column_family_handle_t, - num_keys: cint, - keys_list: cstringArray, - keys_list_sizes: ptr csize_t, - num_values: cint, - values_list: cstringArray, - values_list_sizes: ptr csize_t, -) {.cdecl, importc: "rocksdb_writebatch_wi_mergev_cf", dynlib: librocksdb.} - -proc rocksdb_writebatch_wi_delete*( - a1: ptr rocksdb_writebatch_wi_t, key: cstring, klen: csize_t -) {.cdecl, importc: "rocksdb_writebatch_wi_delete", dynlib: librocksdb.} - -proc rocksdb_writebatch_wi_singledelete*( - a1: ptr rocksdb_writebatch_wi_t, key: cstring, klen: csize_t -) {.cdecl, importc: "rocksdb_writebatch_wi_singledelete", dynlib: librocksdb.} - -proc rocksdb_writebatch_wi_delete_cf*( - a1: ptr rocksdb_writebatch_wi_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - klen: csize_t, -) {.cdecl, importc: "rocksdb_writebatch_wi_delete_cf", dynlib: librocksdb.} - -proc rocksdb_writebatch_wi_singledelete_cf*( - a1: ptr rocksdb_writebatch_wi_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - klen: csize_t, -) {.cdecl, importc: "rocksdb_writebatch_wi_singledelete_cf", dynlib: librocksdb.} - -proc rocksdb_writebatch_wi_deletev*( - b: ptr rocksdb_writebatch_wi_t, - num_keys: cint, - keys_list: cstringArray, - keys_list_sizes: ptr csize_t, -) {.cdecl, importc: "rocksdb_writebatch_wi_deletev", dynlib: librocksdb.} - -proc rocksdb_writebatch_wi_deletev_cf*( - b: ptr rocksdb_writebatch_wi_t, - column_family: ptr rocksdb_column_family_handle_t, - num_keys: cint, - keys_list: cstringArray, - keys_list_sizes: ptr csize_t, -) {.cdecl, importc: "rocksdb_writebatch_wi_deletev_cf", dynlib: librocksdb.} - + backup_index_comparator: ptr rocksdb_comparator_t; reserved_bytes: csize_t; + overwrite_key: uint8; max_bytes: csize_t; protection_bytes_per_key: csize_t): ptr rocksdb_writebatch_wi_t {. + cdecl.} +proc rocksdb_writebatch_wi_destroy*(a1: ptr rocksdb_writebatch_wi_t) {.cdecl.} +proc rocksdb_writebatch_wi_clear*(a1: ptr rocksdb_writebatch_wi_t) {.cdecl.} +proc rocksdb_writebatch_wi_count*(b: ptr rocksdb_writebatch_wi_t): cint {.cdecl.} +proc rocksdb_writebatch_wi_put*(a1: ptr rocksdb_writebatch_wi_t; key: cstring; + klen: csize_t; val: cstring; vlen: csize_t) {.cdecl.} +proc rocksdb_writebatch_wi_put_cf*(a1: ptr rocksdb_writebatch_wi_t; column_family: ptr rocksdb_column_family_handle_t; + key: cstring; klen: csize_t; val: cstring; + vlen: csize_t) {.cdecl.} +proc rocksdb_writebatch_wi_putv*(b: ptr rocksdb_writebatch_wi_t; num_keys: cint; + keys_list: cstringArray; + keys_list_sizes: ptr csize_t; num_values: cint; + values_list: cstringArray; + values_list_sizes: ptr csize_t) {.cdecl.} +proc rocksdb_writebatch_wi_putv_cf*(b: ptr rocksdb_writebatch_wi_t; column_family: ptr rocksdb_column_family_handle_t; + num_keys: cint; keys_list: cstringArray; + keys_list_sizes: ptr csize_t; num_values: cint; + values_list: cstringArray; + values_list_sizes: ptr csize_t) {.cdecl.} +proc rocksdb_writebatch_wi_merge*(a1: ptr rocksdb_writebatch_wi_t; key: cstring; + klen: csize_t; val: cstring; vlen: csize_t) {.cdecl.} +proc rocksdb_writebatch_wi_merge_cf*(a1: ptr rocksdb_writebatch_wi_t; column_family: ptr rocksdb_column_family_handle_t; + key: cstring; klen: csize_t; val: cstring; + vlen: csize_t) {.cdecl.} +proc rocksdb_writebatch_wi_mergev*(b: ptr rocksdb_writebatch_wi_t; num_keys: cint; + keys_list: cstringArray; + keys_list_sizes: ptr csize_t; num_values: cint; + values_list: cstringArray; + values_list_sizes: ptr csize_t) {.cdecl.} +proc rocksdb_writebatch_wi_mergev_cf*(b: ptr rocksdb_writebatch_wi_t; column_family: ptr rocksdb_column_family_handle_t; + num_keys: cint; keys_list: cstringArray; + keys_list_sizes: ptr csize_t; + num_values: cint; values_list: cstringArray; + values_list_sizes: ptr csize_t) {.cdecl.} +proc rocksdb_writebatch_wi_delete*(a1: ptr rocksdb_writebatch_wi_t; key: cstring; + klen: csize_t) {.cdecl.} +proc rocksdb_writebatch_wi_singledelete*(a1: ptr rocksdb_writebatch_wi_t; + key: cstring; klen: csize_t) {.cdecl.} +proc rocksdb_writebatch_wi_delete_cf*(a1: ptr rocksdb_writebatch_wi_t; column_family: ptr rocksdb_column_family_handle_t; + key: cstring; klen: csize_t) {.cdecl.} +proc rocksdb_writebatch_wi_singledelete_cf*(a1: ptr rocksdb_writebatch_wi_t; + column_family: ptr rocksdb_column_family_handle_t; key: cstring; klen: csize_t) {. + cdecl.} +proc rocksdb_writebatch_wi_deletev*(b: ptr rocksdb_writebatch_wi_t; num_keys: cint; + keys_list: cstringArray; + keys_list_sizes: ptr csize_t) {.cdecl.} +proc rocksdb_writebatch_wi_deletev_cf*(b: ptr rocksdb_writebatch_wi_t; column_family: ptr rocksdb_column_family_handle_t; + num_keys: cint; keys_list: cstringArray; + keys_list_sizes: ptr csize_t) {.cdecl.} ## DO NOT USE - rocksdb_writebatch_wi_delete_range is not yet supported -proc rocksdb_writebatch_wi_delete_range*( - b: ptr rocksdb_writebatch_wi_t, - start_key: cstring, - start_key_len: csize_t, - end_key: cstring, - end_key_len: csize_t, -) {.cdecl, importc: "rocksdb_writebatch_wi_delete_range", dynlib: librocksdb.} - +proc rocksdb_writebatch_wi_delete_range*(b: ptr rocksdb_writebatch_wi_t; + start_key: cstring; + start_key_len: csize_t; end_key: cstring; + end_key_len: csize_t) {.cdecl.} ## DO NOT USE - rocksdb_writebatch_wi_delete_range_cf is not yet supported -proc rocksdb_writebatch_wi_delete_range_cf*( - b: ptr rocksdb_writebatch_wi_t, - column_family: ptr rocksdb_column_family_handle_t, - start_key: cstring, - start_key_len: csize_t, - end_key: cstring, - end_key_len: csize_t, -) {.cdecl, importc: "rocksdb_writebatch_wi_delete_range_cf", dynlib: librocksdb.} - +proc rocksdb_writebatch_wi_delete_range_cf*(b: ptr rocksdb_writebatch_wi_t; + column_family: ptr rocksdb_column_family_handle_t; start_key: cstring; + start_key_len: csize_t; end_key: cstring; end_key_len: csize_t) {.cdecl.} ## DO NOT USE - rocksdb_writebatch_wi_delete_rangev is not yet supported -proc rocksdb_writebatch_wi_delete_rangev*( - b: ptr rocksdb_writebatch_wi_t, - num_keys: cint, - start_keys_list: cstringArray, - start_keys_list_sizes: ptr csize_t, - end_keys_list: cstringArray, - end_keys_list_sizes: ptr csize_t, -) {.cdecl, importc: "rocksdb_writebatch_wi_delete_rangev", dynlib: librocksdb.} - +proc rocksdb_writebatch_wi_delete_rangev*(b: ptr rocksdb_writebatch_wi_t; + num_keys: cint; start_keys_list: cstringArray; + start_keys_list_sizes: ptr csize_t; end_keys_list: cstringArray; + end_keys_list_sizes: ptr csize_t) {.cdecl.} ## DO NOT USE - rocksdb_writebatch_wi_delete_rangev_cf is not yet supported -proc rocksdb_writebatch_wi_delete_rangev_cf*( - b: ptr rocksdb_writebatch_wi_t, - column_family: ptr rocksdb_column_family_handle_t, - num_keys: cint, - start_keys_list: cstringArray, - start_keys_list_sizes: ptr csize_t, - end_keys_list: cstringArray, - end_keys_list_sizes: ptr csize_t, -) {.cdecl, importc: "rocksdb_writebatch_wi_delete_rangev_cf", dynlib: librocksdb.} - -proc rocksdb_writebatch_wi_put_log_data*( - a1: ptr rocksdb_writebatch_wi_t, blob: cstring, len: csize_t -) {.cdecl, importc: "rocksdb_writebatch_wi_put_log_data", dynlib: librocksdb.} - -proc rocksdb_writebatch_wi_iterate*( - b: ptr rocksdb_writebatch_wi_t, - state: pointer, - put: proc(a1: pointer, k: cstring, klen: csize_t, v: cstring, vlen: csize_t) {.cdecl.}, - deleted: proc(a1: pointer, k: cstring, klen: csize_t) {.cdecl.}, -) {.cdecl, importc: "rocksdb_writebatch_wi_iterate", dynlib: librocksdb.} - -proc rocksdb_writebatch_wi_data*( - b: ptr rocksdb_writebatch_wi_t, size: ptr csize_t -): cstring {.cdecl, importc: "rocksdb_writebatch_wi_data", dynlib: librocksdb.} - -proc rocksdb_writebatch_wi_set_save_point*( - a1: ptr rocksdb_writebatch_wi_t -) {.cdecl, importc: "rocksdb_writebatch_wi_set_save_point", dynlib: librocksdb.} - +proc rocksdb_writebatch_wi_delete_rangev_cf*(b: ptr rocksdb_writebatch_wi_t; + column_family: ptr rocksdb_column_family_handle_t; num_keys: cint; + start_keys_list: cstringArray; start_keys_list_sizes: ptr csize_t; + end_keys_list: cstringArray; end_keys_list_sizes: ptr csize_t) {.cdecl.} +proc rocksdb_writebatch_wi_put_log_data*(a1: ptr rocksdb_writebatch_wi_t; + blob: cstring; len: csize_t) {.cdecl.} +proc rocksdb_writebatch_wi_iterate*(b: ptr rocksdb_writebatch_wi_t; state: pointer; + put: proc (a1: pointer; k: cstring; klen: csize_t; v: cstring; vlen: csize_t) {.cdecl.}; + deleted: proc (a1: pointer; k: cstring; klen: csize_t) {.cdecl.}) {.cdecl.} +proc rocksdb_writebatch_wi_data*(b: ptr rocksdb_writebatch_wi_t; size: ptr csize_t): cstring {. + cdecl.} +proc rocksdb_writebatch_wi_set_save_point*(a1: ptr rocksdb_writebatch_wi_t) {.cdecl.} proc rocksdb_writebatch_wi_rollback_to_save_point*( - a1: ptr rocksdb_writebatch_wi_t, errptr: cstringArray -) {.cdecl, importc: "rocksdb_writebatch_wi_rollback_to_save_point", dynlib: librocksdb.} - -proc rocksdb_writebatch_wi_get_from_batch*( - wbwi: ptr rocksdb_writebatch_wi_t, - options: ptr rocksdb_options_t, - key: cstring, - keylen: csize_t, - vallen: ptr csize_t, - errptr: cstringArray, -): cstring {. - cdecl, importc: "rocksdb_writebatch_wi_get_from_batch", dynlib: librocksdb -.} - -proc rocksdb_writebatch_wi_get_from_batch_cf*( - wbwi: ptr rocksdb_writebatch_wi_t, - options: ptr rocksdb_options_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - keylen: csize_t, - vallen: ptr csize_t, - errptr: cstringArray, -): cstring {. - cdecl, importc: "rocksdb_writebatch_wi_get_from_batch_cf", dynlib: librocksdb -.} - + a1: ptr rocksdb_writebatch_wi_t; errptr: cstringArray) {.cdecl.} +proc rocksdb_writebatch_wi_get_from_batch*(wbwi: ptr rocksdb_writebatch_wi_t; + options: ptr rocksdb_options_t; key: cstring; keylen: csize_t; vallen: ptr csize_t; + errptr: cstringArray): cstring {.cdecl.} +proc rocksdb_writebatch_wi_get_from_batch_cf*(wbwi: ptr rocksdb_writebatch_wi_t; + options: ptr rocksdb_options_t; + column_family: ptr rocksdb_column_family_handle_t; key: cstring; keylen: csize_t; + vallen: ptr csize_t; errptr: cstringArray): cstring {.cdecl.} proc rocksdb_writebatch_wi_get_from_batch_and_db*( - wbwi: ptr rocksdb_writebatch_wi_t, - db: ptr rocksdb_t, - options: ptr rocksdb_readoptions_t, - key: cstring, - keylen: csize_t, - vallen: ptr csize_t, - errptr: cstringArray, -): cstring {. - cdecl, importc: "rocksdb_writebatch_wi_get_from_batch_and_db", dynlib: librocksdb -.} - + wbwi: ptr rocksdb_writebatch_wi_t; db: ptr rocksdb_t; + options: ptr rocksdb_readoptions_t; key: cstring; keylen: csize_t; + vallen: ptr csize_t; errptr: cstringArray): cstring {.cdecl.} proc rocksdb_writebatch_wi_get_from_batch_and_db_cf*( - wbwi: ptr rocksdb_writebatch_wi_t, - db: ptr rocksdb_t, - options: ptr rocksdb_readoptions_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - keylen: csize_t, - vallen: ptr csize_t, - errptr: cstringArray, -): cstring {. - cdecl, importc: "rocksdb_writebatch_wi_get_from_batch_and_db_cf", dynlib: librocksdb -.} - -proc rocksdb_write_writebatch_wi*( - db: ptr rocksdb_t, - options: ptr rocksdb_writeoptions_t, - wbwi: ptr rocksdb_writebatch_wi_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_write_writebatch_wi", dynlib: librocksdb.} - + wbwi: ptr rocksdb_writebatch_wi_t; db: ptr rocksdb_t; + options: ptr rocksdb_readoptions_t; + column_family: ptr rocksdb_column_family_handle_t; key: cstring; keylen: csize_t; + vallen: ptr csize_t; errptr: cstringArray): cstring {.cdecl.} +proc rocksdb_write_writebatch_wi*(db: ptr rocksdb_t; + options: ptr rocksdb_writeoptions_t; + wbwi: ptr rocksdb_writebatch_wi_t; + errptr: cstringArray) {.cdecl.} proc rocksdb_writebatch_wi_create_iterator_with_base*( - wbwi: ptr rocksdb_writebatch_wi_t, base_iterator: ptr rocksdb_iterator_t -): ptr rocksdb_iterator_t {. - cdecl, importc: "rocksdb_writebatch_wi_create_iterator_with_base", dynlib: librocksdb -.} - + wbwi: ptr rocksdb_writebatch_wi_t; base_iterator: ptr rocksdb_iterator_t): ptr rocksdb_iterator_t {. + cdecl.} proc rocksdb_writebatch_wi_create_iterator_with_base_cf*( - wbwi: ptr rocksdb_writebatch_wi_t, - base_iterator: ptr rocksdb_iterator_t, - cf: ptr rocksdb_column_family_handle_t, -): ptr rocksdb_iterator_t {. - cdecl, - importc: "rocksdb_writebatch_wi_create_iterator_with_base_cf", - dynlib: librocksdb -.} - -proc rocksdb_writebatch_wi_update_timestamps*( - wbwi: ptr rocksdb_writebatch_wi_t, - ts: cstring, - tslen: csize_t, - state: pointer, - get_ts_size: proc(a1: pointer, a2: uint32): csize_t {.cdecl.}, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_writebatch_wi_update_timestamps", dynlib: librocksdb.} - + wbwi: ptr rocksdb_writebatch_wi_t; base_iterator: ptr rocksdb_iterator_t; + cf: ptr rocksdb_column_family_handle_t): ptr rocksdb_iterator_t {.cdecl.} +proc rocksdb_writebatch_wi_update_timestamps*(wbwi: ptr rocksdb_writebatch_wi_t; + ts: cstring; tslen: csize_t; state: pointer; + get_ts_size: proc (a1: pointer; a2: uint32): csize_t {.cdecl.}; errptr: cstringArray) {. + cdecl.} ## Options utils ## Load the latest rocksdb options from the specified db_path. ## @@ -1724,139 +751,66 @@ proc rocksdb_writebatch_wi_update_timestamps*( ## returned. db_options, column_family_names, and column_family_options ## will be set to NULL. -proc rocksdb_load_latest_options*( - db_path: cstring, - env: ptr rocksdb_env_t, - ignore_unknown_options: bool, - cache: ptr rocksdb_cache_t, - db_options: ptr ptr rocksdb_options_t, - num_column_families: ptr csize_t, - column_family_names: ptr cstringArray, - column_family_options: ptr ptr ptr rocksdb_options_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_load_latest_options", dynlib: librocksdb.} - -proc rocksdb_load_latest_options_destroy*( - db_options: ptr rocksdb_options_t, - list_column_family_names: cstringArray, - list_column_family_options: ptr ptr rocksdb_options_t, - len: csize_t, -) {.cdecl, importc: "rocksdb_load_latest_options_destroy", dynlib: librocksdb.} - +proc rocksdb_load_latest_options*(db_path: cstring; env: ptr rocksdb_env_t; + ignore_unknown_options: bool; + cache: ptr rocksdb_cache_t; + db_options: ptr ptr rocksdb_options_t; + num_column_families: ptr csize_t; + column_family_names: ptr cstringArray; + column_family_options: ptr ptr ptr rocksdb_options_t; errptr: cstringArray) {.cdecl.} +proc rocksdb_load_latest_options_destroy*(db_options: ptr rocksdb_options_t; + list_column_family_names: cstringArray; + list_column_family_options: ptr ptr rocksdb_options_t; len: csize_t) {.cdecl.} ## Block based table options proc rocksdb_block_based_options_create*(): ptr rocksdb_block_based_table_options_t {. - cdecl, importc: "rocksdb_block_based_options_create", dynlib: librocksdb -.} - + cdecl.} proc rocksdb_block_based_options_destroy*( - options: ptr rocksdb_block_based_table_options_t -) {.cdecl, importc: "rocksdb_block_based_options_destroy", dynlib: librocksdb.} - + options: ptr rocksdb_block_based_table_options_t) {.cdecl.} proc rocksdb_block_based_options_set_checksum*( - a1: ptr rocksdb_block_based_table_options_t, a2: char -) {.cdecl, importc: "rocksdb_block_based_options_set_checksum", dynlib: librocksdb.} - + a1: ptr rocksdb_block_based_table_options_t; a2: char) {.cdecl.} proc rocksdb_block_based_options_set_block_size*( - options: ptr rocksdb_block_based_table_options_t, block_size: csize_t -) {.cdecl, importc: "rocksdb_block_based_options_set_block_size", dynlib: librocksdb.} - + options: ptr rocksdb_block_based_table_options_t; block_size: csize_t) {.cdecl.} proc rocksdb_block_based_options_set_block_size_deviation*( - options: ptr rocksdb_block_based_table_options_t, block_size_deviation: cint -) {. - cdecl, - importc: "rocksdb_block_based_options_set_block_size_deviation", - dynlib: librocksdb -.} - + options: ptr rocksdb_block_based_table_options_t; block_size_deviation: cint) {. + cdecl.} proc rocksdb_block_based_options_set_block_restart_interval*( - options: ptr rocksdb_block_based_table_options_t, block_restart_interval: cint -) {. - cdecl, - importc: "rocksdb_block_based_options_set_block_restart_interval", - dynlib: librocksdb -.} - + options: ptr rocksdb_block_based_table_options_t; block_restart_interval: cint) {. + cdecl.} proc rocksdb_block_based_options_set_index_block_restart_interval*( - options: ptr rocksdb_block_based_table_options_t, index_block_restart_interval: cint -) {. - cdecl, - importc: "rocksdb_block_based_options_set_index_block_restart_interval", - dynlib: librocksdb -.} - + options: ptr rocksdb_block_based_table_options_t; + index_block_restart_interval: cint) {.cdecl.} proc rocksdb_block_based_options_set_metadata_block_size*( - options: ptr rocksdb_block_based_table_options_t, metadata_block_size: uint64 -) {. - cdecl, - importc: "rocksdb_block_based_options_set_metadata_block_size", - dynlib: librocksdb -.} - + options: ptr rocksdb_block_based_table_options_t; metadata_block_size: uint64) {. + cdecl.} proc rocksdb_block_based_options_set_partition_filters*( - options: ptr rocksdb_block_based_table_options_t, partition_filters: uint8 -) {. - cdecl, - importc: "rocksdb_block_based_options_set_partition_filters", - dynlib: librocksdb -.} - + options: ptr rocksdb_block_based_table_options_t; partition_filters: uint8) {. + cdecl.} proc rocksdb_block_based_options_set_optimize_filters_for_memory*( - options: ptr rocksdb_block_based_table_options_t, optimize_filters_for_memory: uint8 -) {. - cdecl, - importc: "rocksdb_block_based_options_set_optimize_filters_for_memory", - dynlib: librocksdb -.} - + options: ptr rocksdb_block_based_table_options_t; + optimize_filters_for_memory: uint8) {.cdecl.} proc rocksdb_block_based_options_set_use_delta_encoding*( - options: ptr rocksdb_block_based_table_options_t, use_delta_encoding: uint8 -) {. - cdecl, - importc: "rocksdb_block_based_options_set_use_delta_encoding", - dynlib: librocksdb -.} - + options: ptr rocksdb_block_based_table_options_t; use_delta_encoding: uint8) {. + cdecl.} proc rocksdb_block_based_options_set_filter_policy*( - options: ptr rocksdb_block_based_table_options_t, - filter_policy: ptr rocksdb_filterpolicy_t, -) {. - cdecl, importc: "rocksdb_block_based_options_set_filter_policy", dynlib: librocksdb -.} - + options: ptr rocksdb_block_based_table_options_t; + filter_policy: ptr rocksdb_filterpolicy_t) {.cdecl.} proc rocksdb_block_based_options_set_no_block_cache*( - options: ptr rocksdb_block_based_table_options_t, no_block_cache: uint8 -) {. - cdecl, importc: "rocksdb_block_based_options_set_no_block_cache", dynlib: librocksdb -.} - + options: ptr rocksdb_block_based_table_options_t; no_block_cache: uint8) {.cdecl.} proc rocksdb_block_based_options_set_block_cache*( - options: ptr rocksdb_block_based_table_options_t, block_cache: ptr rocksdb_cache_t -) {.cdecl, importc: "rocksdb_block_based_options_set_block_cache", dynlib: librocksdb.} - + options: ptr rocksdb_block_based_table_options_t; + block_cache: ptr rocksdb_cache_t) {.cdecl.} proc rocksdb_block_based_options_set_whole_key_filtering*( - a1: ptr rocksdb_block_based_table_options_t, a2: uint8 -) {. - cdecl, - importc: "rocksdb_block_based_options_set_whole_key_filtering", - dynlib: librocksdb -.} - + a1: ptr rocksdb_block_based_table_options_t; a2: uint8) {.cdecl.} proc rocksdb_block_based_options_set_format_version*( - a1: ptr rocksdb_block_based_table_options_t, a2: cint -) {. - cdecl, importc: "rocksdb_block_based_options_set_format_version", dynlib: librocksdb -.} - + a1: ptr rocksdb_block_based_table_options_t; a2: cint) {.cdecl.} const rocksdb_block_based_table_index_type_binary_search* = 0 rocksdb_block_based_table_index_type_hash_search* = 1 rocksdb_block_based_table_index_type_two_level_index_search* = 2 proc rocksdb_block_based_options_set_index_type*( - a1: ptr rocksdb_block_based_table_options_t, a2: cint -) {.cdecl, importc: "rocksdb_block_based_options_set_index_type", dynlib: librocksdb.} - + a1: ptr rocksdb_block_based_table_options_t; a2: cint) {.cdecl.} ## uses one of the above enums const @@ -1864,66 +818,25 @@ const rocksdb_block_based_table_data_block_index_type_binary_search_and_hash* = 1 proc rocksdb_block_based_options_set_data_block_index_type*( - a1: ptr rocksdb_block_based_table_options_t, a2: cint -) {. - cdecl, - importc: "rocksdb_block_based_options_set_data_block_index_type", - dynlib: librocksdb -.} - + a1: ptr rocksdb_block_based_table_options_t; a2: cint) {.cdecl.} ## uses one of the above enums proc rocksdb_block_based_options_set_data_block_hash_ratio*( - options: ptr rocksdb_block_based_table_options_t, v: cdouble -) {. - cdecl, - importc: "rocksdb_block_based_options_set_data_block_hash_ratio", - dynlib: librocksdb -.} - + options: ptr rocksdb_block_based_table_options_t; v: cdouble) {.cdecl.} ## rocksdb_block_based_options_set_hash_index_allow_collision() ## is removed since BlockBasedTableOptions.hash_index_allow_collision() ## is removed proc rocksdb_block_based_options_set_cache_index_and_filter_blocks*( - a1: ptr rocksdb_block_based_table_options_t, a2: uint8 -) {. - cdecl, - importc: "rocksdb_block_based_options_set_cache_index_and_filter_blocks", - dynlib: librocksdb -.} - + a1: ptr rocksdb_block_based_table_options_t; a2: uint8) {.cdecl.} proc rocksdb_block_based_options_set_cache_index_and_filter_blocks_with_high_priority*( - a1: ptr rocksdb_block_based_table_options_t, a2: uint8 -) {. - cdecl, - importc: - "rocksdb_block_based_options_set_cache_index_and_filter_blocks_with_high_priority", - dynlib: librocksdb -.} - + a1: ptr rocksdb_block_based_table_options_t; a2: uint8) {.cdecl.} proc rocksdb_block_based_options_set_pin_l0_filter_and_index_blocks_in_cache*( - a1: ptr rocksdb_block_based_table_options_t, a2: uint8 -) {. - cdecl, - importc: "rocksdb_block_based_options_set_pin_l0_filter_and_index_blocks_in_cache", - dynlib: librocksdb -.} - + a1: ptr rocksdb_block_based_table_options_t; a2: uint8) {.cdecl.} proc rocksdb_block_based_options_set_pin_top_level_index_and_filter*( - a1: ptr rocksdb_block_based_table_options_t, a2: uint8 -) {. - cdecl, - importc: "rocksdb_block_based_options_set_pin_top_level_index_and_filter", - dynlib: librocksdb -.} - -proc rocksdb_options_set_block_based_table_factory*( - opt: ptr rocksdb_options_t, table_options: ptr rocksdb_block_based_table_options_t -) {. - cdecl, importc: "rocksdb_options_set_block_based_table_factory", dynlib: librocksdb -.} - + a1: ptr rocksdb_block_based_table_options_t; a2: uint8) {.cdecl.} +proc rocksdb_options_set_block_based_table_factory*(opt: ptr rocksdb_options_t; + table_options: ptr rocksdb_block_based_table_options_t) {.cdecl.} const rocksdb_block_based_k_fallback_pinning_tier* = 0 rocksdb_block_based_k_none_pinning_tier* = 1 @@ -1931,568 +844,193 @@ const rocksdb_block_based_k_all_pinning_tier* = 3 proc rocksdb_block_based_options_set_top_level_index_pinning_tier*( - a1: ptr rocksdb_block_based_table_options_t, a2: cint -) {. - cdecl, - importc: "rocksdb_block_based_options_set_top_level_index_pinning_tier", - dynlib: librocksdb -.} - + a1: ptr rocksdb_block_based_table_options_t; a2: cint) {.cdecl.} proc rocksdb_block_based_options_set_partition_pinning_tier*( - a1: ptr rocksdb_block_based_table_options_t, a2: cint -) {. - cdecl, - importc: "rocksdb_block_based_options_set_partition_pinning_tier", - dynlib: librocksdb -.} - + a1: ptr rocksdb_block_based_table_options_t; a2: cint) {.cdecl.} proc rocksdb_block_based_options_set_unpartitioned_pinning_tier*( - a1: ptr rocksdb_block_based_table_options_t, a2: cint -) {. - cdecl, - importc: "rocksdb_block_based_options_set_unpartitioned_pinning_tier", - dynlib: librocksdb -.} - -proc rocksdb_options_set_write_buffer_manager*( - opt: ptr rocksdb_options_t, wbm: ptr rocksdb_write_buffer_manager_t -) {.cdecl, importc: "rocksdb_options_set_write_buffer_manager", dynlib: librocksdb.} - + a1: ptr rocksdb_block_based_table_options_t; a2: cint) {.cdecl.} +proc rocksdb_options_set_write_buffer_manager*(opt: ptr rocksdb_options_t; + wbm: ptr rocksdb_write_buffer_manager_t) {.cdecl.} ## Cuckoo table options -proc rocksdb_cuckoo_options_create*(): ptr rocksdb_cuckoo_table_options_t {. - cdecl, importc: "rocksdb_cuckoo_options_create", dynlib: librocksdb -.} - -proc rocksdb_cuckoo_options_destroy*( - options: ptr rocksdb_cuckoo_table_options_t -) {.cdecl, importc: "rocksdb_cuckoo_options_destroy", dynlib: librocksdb.} - +proc rocksdb_cuckoo_options_create*(): ptr rocksdb_cuckoo_table_options_t {.cdecl.} +proc rocksdb_cuckoo_options_destroy*(options: ptr rocksdb_cuckoo_table_options_t) {. + cdecl.} proc rocksdb_cuckoo_options_set_hash_ratio*( - options: ptr rocksdb_cuckoo_table_options_t, v: cdouble -) {.cdecl, importc: "rocksdb_cuckoo_options_set_hash_ratio", dynlib: librocksdb.} - + options: ptr rocksdb_cuckoo_table_options_t; v: cdouble) {.cdecl.} proc rocksdb_cuckoo_options_set_max_search_depth*( - options: ptr rocksdb_cuckoo_table_options_t, v: uint32 -) {.cdecl, importc: "rocksdb_cuckoo_options_set_max_search_depth", dynlib: librocksdb.} - + options: ptr rocksdb_cuckoo_table_options_t; v: uint32) {.cdecl.} proc rocksdb_cuckoo_options_set_cuckoo_block_size*( - options: ptr rocksdb_cuckoo_table_options_t, v: uint32 -) {.cdecl, importc: "rocksdb_cuckoo_options_set_cuckoo_block_size", dynlib: librocksdb.} - + options: ptr rocksdb_cuckoo_table_options_t; v: uint32) {.cdecl.} proc rocksdb_cuckoo_options_set_identity_as_first_hash*( - options: ptr rocksdb_cuckoo_table_options_t, v: uint8 -) {. - cdecl, - importc: "rocksdb_cuckoo_options_set_identity_as_first_hash", - dynlib: librocksdb -.} - + options: ptr rocksdb_cuckoo_table_options_t; v: uint8) {.cdecl.} proc rocksdb_cuckoo_options_set_use_module_hash*( - options: ptr rocksdb_cuckoo_table_options_t, v: uint8 -) {.cdecl, importc: "rocksdb_cuckoo_options_set_use_module_hash", dynlib: librocksdb.} - -proc rocksdb_options_set_cuckoo_table_factory*( - opt: ptr rocksdb_options_t, table_options: ptr rocksdb_cuckoo_table_options_t -) {.cdecl, importc: "rocksdb_options_set_cuckoo_table_factory", dynlib: librocksdb.} - + options: ptr rocksdb_cuckoo_table_options_t; v: uint8) {.cdecl.} +proc rocksdb_options_set_cuckoo_table_factory*(opt: ptr rocksdb_options_t; + table_options: ptr rocksdb_cuckoo_table_options_t) {.cdecl.} ## Options -proc rocksdb_set_options*( - db: ptr rocksdb_t, - count: cint, - keys: ptr cstring, - values: ptr cstring, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_set_options", dynlib: librocksdb.} - -proc rocksdb_set_options_cf*( - db: ptr rocksdb_t, - handle: ptr rocksdb_column_family_handle_t, - count: cint, - keys: ptr cstring, - values: ptr cstring, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_set_options_cf", dynlib: librocksdb.} - -proc rocksdb_options_create*(): ptr rocksdb_options_t {. - cdecl, importc: "rocksdb_options_create", dynlib: librocksdb -.} - -proc rocksdb_options_destroy*( - a1: ptr rocksdb_options_t -) {.cdecl, importc: "rocksdb_options_destroy", dynlib: librocksdb.} - -proc rocksdb_options_create_copy*( - a1: ptr rocksdb_options_t -): ptr rocksdb_options_t {. - cdecl, importc: "rocksdb_options_create_copy", dynlib: librocksdb -.} - -proc rocksdb_options_increase_parallelism*( - opt: ptr rocksdb_options_t, total_threads: cint -) {.cdecl, importc: "rocksdb_options_increase_parallelism", dynlib: librocksdb.} - -proc rocksdb_options_optimize_for_point_lookup*( - opt: ptr rocksdb_options_t, block_cache_size_mb: uint64 -) {.cdecl, importc: "rocksdb_options_optimize_for_point_lookup", dynlib: librocksdb.} - -proc rocksdb_options_optimize_level_style_compaction*( - opt: ptr rocksdb_options_t, memtable_memory_budget: uint64 -) {. - cdecl, importc: "rocksdb_options_optimize_level_style_compaction", dynlib: librocksdb -.} - +proc rocksdb_set_options*(db: ptr rocksdb_t; count: cint; keys: ptr cstring; + values: ptr cstring; errptr: cstringArray) {.cdecl.} +proc rocksdb_set_options_cf*(db: ptr rocksdb_t; + handle: ptr rocksdb_column_family_handle_t; + count: cint; keys: ptr cstring; values: ptr cstring; + errptr: cstringArray) {.cdecl.} +proc rocksdb_options_create*(): ptr rocksdb_options_t {.cdecl.} +proc rocksdb_options_destroy*(a1: ptr rocksdb_options_t) {.cdecl.} +proc rocksdb_options_create_copy*(a1: ptr rocksdb_options_t): ptr rocksdb_options_t {. + cdecl.} +proc rocksdb_options_increase_parallelism*(opt: ptr rocksdb_options_t; + total_threads: cint) {.cdecl.} +proc rocksdb_options_optimize_for_point_lookup*(opt: ptr rocksdb_options_t; + block_cache_size_mb: uint64) {.cdecl.} +proc rocksdb_options_optimize_level_style_compaction*(opt: ptr rocksdb_options_t; + memtable_memory_budget: uint64) {.cdecl.} proc rocksdb_options_optimize_universal_style_compaction*( - opt: ptr rocksdb_options_t, memtable_memory_budget: uint64 -) {. - cdecl, - importc: "rocksdb_options_optimize_universal_style_compaction", - dynlib: librocksdb -.} - -proc rocksdb_options_set_allow_ingest_behind*( - a1: ptr rocksdb_options_t, a2: uint8 -) {.cdecl, importc: "rocksdb_options_set_allow_ingest_behind", dynlib: librocksdb.} - -proc rocksdb_options_get_allow_ingest_behind*( - a1: ptr rocksdb_options_t -): uint8 {. - cdecl, importc: "rocksdb_options_get_allow_ingest_behind", dynlib: librocksdb -.} - -proc rocksdb_options_set_compaction_filter*( - a1: ptr rocksdb_options_t, a2: ptr rocksdb_compactionfilter_t -) {.cdecl, importc: "rocksdb_options_set_compaction_filter", dynlib: librocksdb.} - -proc rocksdb_options_set_compaction_filter_factory*( - a1: ptr rocksdb_options_t, a2: ptr rocksdb_compactionfilterfactory_t -) {. - cdecl, importc: "rocksdb_options_set_compaction_filter_factory", dynlib: librocksdb -.} - -proc rocksdb_options_compaction_readahead_size*( - a1: ptr rocksdb_options_t, a2: csize_t -) {.cdecl, importc: "rocksdb_options_compaction_readahead_size", dynlib: librocksdb.} - -proc rocksdb_options_get_compaction_readahead_size*( - a1: ptr rocksdb_options_t -): csize_t {. - cdecl, importc: "rocksdb_options_get_compaction_readahead_size", dynlib: librocksdb -.} - -proc rocksdb_options_set_comparator*( - a1: ptr rocksdb_options_t, a2: ptr rocksdb_comparator_t -) {.cdecl, importc: "rocksdb_options_set_comparator", dynlib: librocksdb.} - -proc rocksdb_options_set_merge_operator*( - a1: ptr rocksdb_options_t, a2: ptr rocksdb_mergeoperator_t -) {.cdecl, importc: "rocksdb_options_set_merge_operator", dynlib: librocksdb.} - -proc rocksdb_options_set_uint64add_merge_operator*( - a1: ptr rocksdb_options_t -) {.cdecl, importc: "rocksdb_options_set_uint64add_merge_operator", dynlib: librocksdb.} - -proc rocksdb_options_set_compression_per_level*( - opt: ptr rocksdb_options_t, level_values: ptr cint, num_levels: csize_t -) {.cdecl, importc: "rocksdb_options_set_compression_per_level", dynlib: librocksdb.} - -proc rocksdb_options_set_create_if_missing*( - a1: ptr rocksdb_options_t, a2: uint8 -) {.cdecl, importc: "rocksdb_options_set_create_if_missing", dynlib: librocksdb.} - -proc rocksdb_options_get_create_if_missing*( - a1: ptr rocksdb_options_t -): uint8 {.cdecl, importc: "rocksdb_options_get_create_if_missing", dynlib: librocksdb.} - + opt: ptr rocksdb_options_t; memtable_memory_budget: uint64) {.cdecl.} +proc rocksdb_options_set_allow_ingest_behind*(a1: ptr rocksdb_options_t; a2: uint8) {. + cdecl.} +proc rocksdb_options_get_allow_ingest_behind*(a1: ptr rocksdb_options_t): uint8 {. + cdecl.} +proc rocksdb_options_set_compaction_filter*(a1: ptr rocksdb_options_t; + a2: ptr rocksdb_compactionfilter_t) {.cdecl.} +proc rocksdb_options_set_compaction_filter_factory*(a1: ptr rocksdb_options_t; + a2: ptr rocksdb_compactionfilterfactory_t) {.cdecl.} +proc rocksdb_options_compaction_readahead_size*(a1: ptr rocksdb_options_t; + a2: csize_t) {.cdecl.} +proc rocksdb_options_get_compaction_readahead_size*(a1: ptr rocksdb_options_t): csize_t {. + cdecl.} +proc rocksdb_options_set_comparator*(a1: ptr rocksdb_options_t; + a2: ptr rocksdb_comparator_t) {.cdecl.} +proc rocksdb_options_set_merge_operator*(a1: ptr rocksdb_options_t; + a2: ptr rocksdb_mergeoperator_t) {.cdecl.} +proc rocksdb_options_set_uint64add_merge_operator*(a1: ptr rocksdb_options_t) {. + cdecl.} +proc rocksdb_options_set_compression_per_level*(opt: ptr rocksdb_options_t; + level_values: ptr cint; num_levels: csize_t) {.cdecl.} +proc rocksdb_options_set_create_if_missing*(a1: ptr rocksdb_options_t; a2: uint8) {. + cdecl.} +proc rocksdb_options_get_create_if_missing*(a1: ptr rocksdb_options_t): uint8 {.cdecl.} proc rocksdb_options_set_create_missing_column_families*( - a1: ptr rocksdb_options_t, a2: uint8 -) {. - cdecl, - importc: "rocksdb_options_set_create_missing_column_families", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t; a2: uint8) {.cdecl.} proc rocksdb_options_get_create_missing_column_families*( - a1: ptr rocksdb_options_t -): uint8 {. - cdecl, - importc: "rocksdb_options_get_create_missing_column_families", - dynlib: librocksdb -.} - -proc rocksdb_options_set_error_if_exists*( - a1: ptr rocksdb_options_t, a2: uint8 -) {.cdecl, importc: "rocksdb_options_set_error_if_exists", dynlib: librocksdb.} - -proc rocksdb_options_get_error_if_exists*( - a1: ptr rocksdb_options_t -): uint8 {.cdecl, importc: "rocksdb_options_get_error_if_exists", dynlib: librocksdb.} - -proc rocksdb_options_set_paranoid_checks*( - a1: ptr rocksdb_options_t, a2: uint8 -) {.cdecl, importc: "rocksdb_options_set_paranoid_checks", dynlib: librocksdb.} - -proc rocksdb_options_get_paranoid_checks*( - a1: ptr rocksdb_options_t -): uint8 {.cdecl, importc: "rocksdb_options_get_paranoid_checks", dynlib: librocksdb.} - -proc rocksdb_options_set_db_paths*( - a1: ptr rocksdb_options_t, path_values: ptr ptr rocksdb_dbpath_t, num_paths: csize_t -) {.cdecl, importc: "rocksdb_options_set_db_paths", dynlib: librocksdb.} - -proc rocksdb_options_set_cf_paths*( - a1: ptr rocksdb_options_t, path_values: ptr ptr rocksdb_dbpath_t, num_paths: csize_t -) {.cdecl, importc: "rocksdb_options_set_cf_paths", dynlib: librocksdb.} - -proc rocksdb_options_set_env*( - a1: ptr rocksdb_options_t, a2: ptr rocksdb_env_t -) {.cdecl, importc: "rocksdb_options_set_env", dynlib: librocksdb.} - -proc rocksdb_options_set_info_log*( - a1: ptr rocksdb_options_t, a2: ptr rocksdb_logger_t -) {.cdecl, importc: "rocksdb_options_set_info_log", dynlib: librocksdb.} - -proc rocksdb_options_get_info_log*( - opt: ptr rocksdb_options_t -): ptr rocksdb_logger_t {. - cdecl, importc: "rocksdb_options_get_info_log", dynlib: librocksdb -.} - -proc rocksdb_options_set_info_log_level*( - a1: ptr rocksdb_options_t, a2: cint -) {.cdecl, importc: "rocksdb_options_set_info_log_level", dynlib: librocksdb.} - -proc rocksdb_options_get_info_log_level*( - a1: ptr rocksdb_options_t -): cint {.cdecl, importc: "rocksdb_options_get_info_log_level", dynlib: librocksdb.} - -proc rocksdb_logger_create_stderr_logger*( - log_level: cint, prefix: cstring -): ptr rocksdb_logger_t {. - cdecl, importc: "rocksdb_logger_create_stderr_logger", dynlib: librocksdb -.} - -proc rocksdb_logger_create_callback_logger*( - log_level: cint, - a2: proc(priv: pointer, lev: cuint, msg: cstring, len: csize_t) {.cdecl.}, - priv: pointer, -): ptr rocksdb_logger_t {. - cdecl, importc: "rocksdb_logger_create_callback_logger", dynlib: librocksdb -.} - -proc rocksdb_logger_destroy*( - logger: ptr rocksdb_logger_t -) {.cdecl, importc: "rocksdb_logger_destroy", dynlib: librocksdb.} - -proc rocksdb_options_set_write_buffer_size*( - a1: ptr rocksdb_options_t, a2: csize_t -) {.cdecl, importc: "rocksdb_options_set_write_buffer_size", dynlib: librocksdb.} - -proc rocksdb_options_get_write_buffer_size*( - a1: ptr rocksdb_options_t -): csize_t {. - cdecl, importc: "rocksdb_options_get_write_buffer_size", dynlib: librocksdb -.} - -proc rocksdb_options_set_db_write_buffer_size*( - a1: ptr rocksdb_options_t, a2: csize_t -) {.cdecl, importc: "rocksdb_options_set_db_write_buffer_size", dynlib: librocksdb.} - -proc rocksdb_options_get_db_write_buffer_size*( - a1: ptr rocksdb_options_t -): csize_t {. - cdecl, importc: "rocksdb_options_get_db_write_buffer_size", dynlib: librocksdb -.} - -proc rocksdb_options_set_max_open_files*( - a1: ptr rocksdb_options_t, a2: cint -) {.cdecl, importc: "rocksdb_options_set_max_open_files", dynlib: librocksdb.} - -proc rocksdb_options_get_max_open_files*( - a1: ptr rocksdb_options_t -): cint {.cdecl, importc: "rocksdb_options_get_max_open_files", dynlib: librocksdb.} - -proc rocksdb_options_set_max_file_opening_threads*( - a1: ptr rocksdb_options_t, a2: cint -) {.cdecl, importc: "rocksdb_options_set_max_file_opening_threads", dynlib: librocksdb.} - -proc rocksdb_options_get_max_file_opening_threads*( - a1: ptr rocksdb_options_t -): cint {. - cdecl, importc: "rocksdb_options_get_max_file_opening_threads", dynlib: librocksdb -.} - -proc rocksdb_options_set_max_total_wal_size*( - opt: ptr rocksdb_options_t, n: uint64 -) {.cdecl, importc: "rocksdb_options_set_max_total_wal_size", dynlib: librocksdb.} - -proc rocksdb_options_get_max_total_wal_size*( - opt: ptr rocksdb_options_t -): uint64 {. - cdecl, importc: "rocksdb_options_get_max_total_wal_size", dynlib: librocksdb -.} - -proc rocksdb_options_set_compression_options*( - a1: ptr rocksdb_options_t, a2: cint, a3: cint, a4: cint, a5: cint -) {.cdecl, importc: "rocksdb_options_set_compression_options", dynlib: librocksdb.} - + a1: ptr rocksdb_options_t): uint8 {.cdecl.} +proc rocksdb_options_set_error_if_exists*(a1: ptr rocksdb_options_t; a2: uint8) {. + cdecl.} +proc rocksdb_options_get_error_if_exists*(a1: ptr rocksdb_options_t): uint8 {.cdecl.} +proc rocksdb_options_set_paranoid_checks*(a1: ptr rocksdb_options_t; a2: uint8) {. + cdecl.} +proc rocksdb_options_get_paranoid_checks*(a1: ptr rocksdb_options_t): uint8 {.cdecl.} +proc rocksdb_options_set_db_paths*(a1: ptr rocksdb_options_t; + path_values: ptr ptr rocksdb_dbpath_t; + num_paths: csize_t) {.cdecl.} +proc rocksdb_options_set_cf_paths*(a1: ptr rocksdb_options_t; + path_values: ptr ptr rocksdb_dbpath_t; + num_paths: csize_t) {.cdecl.} +proc rocksdb_options_set_env*(a1: ptr rocksdb_options_t; a2: ptr rocksdb_env_t) {.cdecl.} +proc rocksdb_options_set_info_log*(a1: ptr rocksdb_options_t; + a2: ptr rocksdb_logger_t) {.cdecl.} +proc rocksdb_options_get_info_log*(opt: ptr rocksdb_options_t): ptr rocksdb_logger_t {. + cdecl.} +proc rocksdb_options_set_info_log_level*(a1: ptr rocksdb_options_t; a2: cint) {.cdecl.} +proc rocksdb_options_get_info_log_level*(a1: ptr rocksdb_options_t): cint {.cdecl.} +proc rocksdb_logger_create_stderr_logger*(log_level: cint; prefix: cstring): ptr rocksdb_logger_t {. + cdecl.} +proc rocksdb_logger_create_callback_logger*(log_level: cint; + a2: proc (priv: pointer; lev: cuint; msg: cstring; len: csize_t) {.cdecl.}; + priv: pointer): ptr rocksdb_logger_t {.cdecl.} +proc rocksdb_logger_destroy*(logger: ptr rocksdb_logger_t) {.cdecl.} +proc rocksdb_options_set_write_buffer_size*(a1: ptr rocksdb_options_t; a2: csize_t) {. + cdecl.} +proc rocksdb_options_get_write_buffer_size*(a1: ptr rocksdb_options_t): csize_t {. + cdecl.} +proc rocksdb_options_set_db_write_buffer_size*(a1: ptr rocksdb_options_t; + a2: csize_t) {.cdecl.} +proc rocksdb_options_get_db_write_buffer_size*(a1: ptr rocksdb_options_t): csize_t {. + cdecl.} +proc rocksdb_options_set_max_open_files*(a1: ptr rocksdb_options_t; a2: cint) {.cdecl.} +proc rocksdb_options_get_max_open_files*(a1: ptr rocksdb_options_t): cint {.cdecl.} +proc rocksdb_options_set_max_file_opening_threads*(a1: ptr rocksdb_options_t; + a2: cint) {.cdecl.} +proc rocksdb_options_get_max_file_opening_threads*(a1: ptr rocksdb_options_t): cint {. + cdecl.} +proc rocksdb_options_set_max_total_wal_size*(opt: ptr rocksdb_options_t; n: uint64) {. + cdecl.} +proc rocksdb_options_get_max_total_wal_size*(opt: ptr rocksdb_options_t): uint64 {. + cdecl.} +proc rocksdb_options_set_compression_options*(a1: ptr rocksdb_options_t; a2: cint; + a3: cint; a4: cint; a5: cint) {.cdecl.} proc rocksdb_options_set_compression_options_zstd_max_train_bytes*( - a1: ptr rocksdb_options_t, a2: cint -) {. - cdecl, - importc: "rocksdb_options_set_compression_options_zstd_max_train_bytes", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t; a2: cint) {.cdecl.} proc rocksdb_options_get_compression_options_zstd_max_train_bytes*( - opt: ptr rocksdb_options_t -): cint {. - cdecl, - importc: "rocksdb_options_get_compression_options_zstd_max_train_bytes", - dynlib: librocksdb -.} - + opt: ptr rocksdb_options_t): cint {.cdecl.} proc rocksdb_options_set_compression_options_use_zstd_dict_trainer*( - a1: ptr rocksdb_options_t, a2: uint8 -) {. - cdecl, - importc: "rocksdb_options_set_compression_options_use_zstd_dict_trainer", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t; a2: uint8) {.cdecl.} proc rocksdb_options_get_compression_options_use_zstd_dict_trainer*( - opt: ptr rocksdb_options_t -): uint8 {. - cdecl, - importc: "rocksdb_options_get_compression_options_use_zstd_dict_trainer", - dynlib: librocksdb -.} - + opt: ptr rocksdb_options_t): uint8 {.cdecl.} proc rocksdb_options_set_compression_options_parallel_threads*( - a1: ptr rocksdb_options_t, a2: cint -) {. - cdecl, - importc: "rocksdb_options_set_compression_options_parallel_threads", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t; a2: cint) {.cdecl.} proc rocksdb_options_get_compression_options_parallel_threads*( - opt: ptr rocksdb_options_t -): cint {. - cdecl, - importc: "rocksdb_options_get_compression_options_parallel_threads", - dynlib: librocksdb -.} - + opt: ptr rocksdb_options_t): cint {.cdecl.} proc rocksdb_options_set_compression_options_max_dict_buffer_bytes*( - a1: ptr rocksdb_options_t, a2: uint64 -) {. - cdecl, - importc: "rocksdb_options_set_compression_options_max_dict_buffer_bytes", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t; a2: uint64) {.cdecl.} proc rocksdb_options_get_compression_options_max_dict_buffer_bytes*( - opt: ptr rocksdb_options_t -): uint64 {. - cdecl, - importc: "rocksdb_options_get_compression_options_max_dict_buffer_bytes", - dynlib: librocksdb -.} - + opt: ptr rocksdb_options_t): uint64 {.cdecl.} proc rocksdb_options_set_bottommost_compression_options*( - a1: ptr rocksdb_options_t, a2: cint, a3: cint, a4: cint, a5: cint, a6: uint8 -) {. - cdecl, - importc: "rocksdb_options_set_bottommost_compression_options", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t; a2: cint; a3: cint; a4: cint; a5: cint; a6: uint8) {.cdecl.} proc rocksdb_options_set_bottommost_compression_options_zstd_max_train_bytes*( - a1: ptr rocksdb_options_t, a2: cint, a3: uint8 -) {. - cdecl, - importc: "rocksdb_options_set_bottommost_compression_options_zstd_max_train_bytes", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t; a2: cint; a3: uint8) {.cdecl.} proc rocksdb_options_set_bottommost_compression_options_use_zstd_dict_trainer*( - a1: ptr rocksdb_options_t, a2: uint8, a3: uint8 -) {. - cdecl, - importc: "rocksdb_options_set_bottommost_compression_options_use_zstd_dict_trainer", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t; a2: uint8; a3: uint8) {.cdecl.} proc rocksdb_options_get_bottommost_compression_options_use_zstd_dict_trainer*( - opt: ptr rocksdb_options_t -): uint8 {. - cdecl, - importc: "rocksdb_options_get_bottommost_compression_options_use_zstd_dict_trainer", - dynlib: librocksdb -.} - + opt: ptr rocksdb_options_t): uint8 {.cdecl.} proc rocksdb_options_set_bottommost_compression_options_max_dict_buffer_bytes*( - a1: ptr rocksdb_options_t, a2: uint64, a3: uint8 -) {. - cdecl, - importc: "rocksdb_options_set_bottommost_compression_options_max_dict_buffer_bytes", - dynlib: librocksdb -.} - -proc rocksdb_options_set_prefix_extractor*( - a1: ptr rocksdb_options_t, a2: ptr rocksdb_slicetransform_t -) {.cdecl, importc: "rocksdb_options_set_prefix_extractor", dynlib: librocksdb.} - -proc rocksdb_options_set_num_levels*( - a1: ptr rocksdb_options_t, a2: cint -) {.cdecl, importc: "rocksdb_options_set_num_levels", dynlib: librocksdb.} - -proc rocksdb_options_get_num_levels*( - a1: ptr rocksdb_options_t -): cint {.cdecl, importc: "rocksdb_options_get_num_levels", dynlib: librocksdb.} - + a1: ptr rocksdb_options_t; a2: uint64; a3: uint8) {.cdecl.} +proc rocksdb_options_set_prefix_extractor*(a1: ptr rocksdb_options_t; + a2: ptr rocksdb_slicetransform_t) {.cdecl.} +proc rocksdb_options_set_num_levels*(a1: ptr rocksdb_options_t; a2: cint) {.cdecl.} +proc rocksdb_options_get_num_levels*(a1: ptr rocksdb_options_t): cint {.cdecl.} proc rocksdb_options_set_level0_file_num_compaction_trigger*( - a1: ptr rocksdb_options_t, a2: cint -) {. - cdecl, - importc: "rocksdb_options_set_level0_file_num_compaction_trigger", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t; a2: cint) {.cdecl.} proc rocksdb_options_get_level0_file_num_compaction_trigger*( - a1: ptr rocksdb_options_t -): cint {. - cdecl, - importc: "rocksdb_options_get_level0_file_num_compaction_trigger", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t): cint {.cdecl.} proc rocksdb_options_set_level0_slowdown_writes_trigger*( - a1: ptr rocksdb_options_t, a2: cint -) {. - cdecl, - importc: "rocksdb_options_set_level0_slowdown_writes_trigger", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t; a2: cint) {.cdecl.} proc rocksdb_options_get_level0_slowdown_writes_trigger*( - a1: ptr rocksdb_options_t -): cint {. - cdecl, - importc: "rocksdb_options_get_level0_slowdown_writes_trigger", - dynlib: librocksdb -.} - -proc rocksdb_options_set_level0_stop_writes_trigger*( - a1: ptr rocksdb_options_t, a2: cint -) {. - cdecl, importc: "rocksdb_options_set_level0_stop_writes_trigger", dynlib: librocksdb -.} - -proc rocksdb_options_get_level0_stop_writes_trigger*( - a1: ptr rocksdb_options_t -): cint {. - cdecl, importc: "rocksdb_options_get_level0_stop_writes_trigger", dynlib: librocksdb -.} - -proc rocksdb_options_set_target_file_size_base*( - a1: ptr rocksdb_options_t, a2: uint64 -) {.cdecl, importc: "rocksdb_options_set_target_file_size_base", dynlib: librocksdb.} - -proc rocksdb_options_get_target_file_size_base*( - a1: ptr rocksdb_options_t -): uint64 {. - cdecl, importc: "rocksdb_options_get_target_file_size_base", dynlib: librocksdb -.} - -proc rocksdb_options_set_target_file_size_multiplier*( - a1: ptr rocksdb_options_t, a2: cint -) {. - cdecl, importc: "rocksdb_options_set_target_file_size_multiplier", dynlib: librocksdb -.} - -proc rocksdb_options_get_target_file_size_multiplier*( - a1: ptr rocksdb_options_t -): cint {. - cdecl, importc: "rocksdb_options_get_target_file_size_multiplier", dynlib: librocksdb -.} - -proc rocksdb_options_set_max_bytes_for_level_base*( - a1: ptr rocksdb_options_t, a2: uint64 -) {.cdecl, importc: "rocksdb_options_set_max_bytes_for_level_base", dynlib: librocksdb.} - -proc rocksdb_options_get_max_bytes_for_level_base*( - a1: ptr rocksdb_options_t -): uint64 {. - cdecl, importc: "rocksdb_options_get_max_bytes_for_level_base", dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t): cint {.cdecl.} +proc rocksdb_options_set_level0_stop_writes_trigger*(a1: ptr rocksdb_options_t; + a2: cint) {.cdecl.} +proc rocksdb_options_get_level0_stop_writes_trigger*(a1: ptr rocksdb_options_t): cint {. + cdecl.} +proc rocksdb_options_set_target_file_size_base*(a1: ptr rocksdb_options_t; + a2: uint64) {.cdecl.} +proc rocksdb_options_get_target_file_size_base*(a1: ptr rocksdb_options_t): uint64 {. + cdecl.} +proc rocksdb_options_set_target_file_size_multiplier*(a1: ptr rocksdb_options_t; + a2: cint) {.cdecl.} +proc rocksdb_options_get_target_file_size_multiplier*(a1: ptr rocksdb_options_t): cint {. + cdecl.} +proc rocksdb_options_set_max_bytes_for_level_base*(a1: ptr rocksdb_options_t; + a2: uint64) {.cdecl.} +proc rocksdb_options_get_max_bytes_for_level_base*(a1: ptr rocksdb_options_t): uint64 {. + cdecl.} proc rocksdb_options_set_level_compaction_dynamic_level_bytes*( - a1: ptr rocksdb_options_t, a2: uint8 -) {. - cdecl, - importc: "rocksdb_options_set_level_compaction_dynamic_level_bytes", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t; a2: uint8) {.cdecl.} proc rocksdb_options_get_level_compaction_dynamic_level_bytes*( - a1: ptr rocksdb_options_t -): uint8 {. - cdecl, - importc: "rocksdb_options_get_level_compaction_dynamic_level_bytes", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t): uint8 {.cdecl.} proc rocksdb_options_set_max_bytes_for_level_multiplier*( - a1: ptr rocksdb_options_t, a2: cdouble -) {. - cdecl, - importc: "rocksdb_options_set_max_bytes_for_level_multiplier", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t; a2: cdouble) {.cdecl.} proc rocksdb_options_get_max_bytes_for_level_multiplier*( - a1: ptr rocksdb_options_t -): cdouble {. - cdecl, - importc: "rocksdb_options_get_max_bytes_for_level_multiplier", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t): cdouble {.cdecl.} proc rocksdb_options_set_max_bytes_for_level_multiplier_additional*( - a1: ptr rocksdb_options_t, level_values: ptr cint, num_levels: csize_t -) {. - cdecl, - importc: "rocksdb_options_set_max_bytes_for_level_multiplier_additional", - dynlib: librocksdb -.} - -proc rocksdb_options_enable_statistics*( - a1: ptr rocksdb_options_t -) {.cdecl, importc: "rocksdb_options_enable_statistics", dynlib: librocksdb.} - -proc rocksdb_options_set_ttl*( - a1: ptr rocksdb_options_t, a2: uint64 -) {.cdecl, importc: "rocksdb_options_set_ttl", dynlib: librocksdb.} - -proc rocksdb_options_get_ttl*( - a1: ptr rocksdb_options_t -): uint64 {.cdecl, importc: "rocksdb_options_get_ttl", dynlib: librocksdb.} - -proc rocksdb_options_set_periodic_compaction_seconds*( - a1: ptr rocksdb_options_t, a2: uint64 -) {. - cdecl, importc: "rocksdb_options_set_periodic_compaction_seconds", dynlib: librocksdb -.} - -proc rocksdb_options_get_periodic_compaction_seconds*( - a1: ptr rocksdb_options_t -): uint64 {. - cdecl, importc: "rocksdb_options_get_periodic_compaction_seconds", dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t; level_values: ptr cint; num_levels: csize_t) {.cdecl.} +proc rocksdb_options_enable_statistics*(a1: ptr rocksdb_options_t) {.cdecl.} +proc rocksdb_options_set_ttl*(a1: ptr rocksdb_options_t; a2: uint64) {.cdecl.} +proc rocksdb_options_get_ttl*(a1: ptr rocksdb_options_t): uint64 {.cdecl.} +proc rocksdb_options_set_periodic_compaction_seconds*(a1: ptr rocksdb_options_t; + a2: uint64) {.cdecl.} +proc rocksdb_options_get_periodic_compaction_seconds*(a1: ptr rocksdb_options_t): uint64 {. + cdecl.} const rocksdb_statistics_level_disable_all* = 0 rocksdb_statistics_level_except_tickers* = rocksdb_statistics_level_disable_all @@ -2502,846 +1040,298 @@ const rocksdb_statistics_level_except_time_for_mutex* = 4 rocksdb_statistics_level_all* = 5 -proc rocksdb_options_set_statistics_level*( - a1: ptr rocksdb_options_t, level: cint -) {.cdecl, importc: "rocksdb_options_set_statistics_level", dynlib: librocksdb.} - -proc rocksdb_options_get_statistics_level*( - a1: ptr rocksdb_options_t -): cint {.cdecl, importc: "rocksdb_options_get_statistics_level", dynlib: librocksdb.} - +proc rocksdb_options_set_statistics_level*(a1: ptr rocksdb_options_t; level: cint) {. + cdecl.} +proc rocksdb_options_get_statistics_level*(a1: ptr rocksdb_options_t): cint {.cdecl.} proc rocksdb_options_set_skip_stats_update_on_db_open*( - opt: ptr rocksdb_options_t, val: uint8 -) {. - cdecl, importc: "rocksdb_options_set_skip_stats_update_on_db_open", dynlib: librocksdb -.} - -proc rocksdb_options_get_skip_stats_update_on_db_open*( - opt: ptr rocksdb_options_t -): uint8 {. - cdecl, importc: "rocksdb_options_get_skip_stats_update_on_db_open", dynlib: librocksdb -.} - + opt: ptr rocksdb_options_t; val: uint8) {.cdecl.} +proc rocksdb_options_get_skip_stats_update_on_db_open*(opt: ptr rocksdb_options_t): uint8 {. + cdecl.} proc rocksdb_options_set_skip_checking_sst_file_sizes_on_db_open*( - opt: ptr rocksdb_options_t, val: uint8 -) {. - cdecl, - importc: "rocksdb_options_set_skip_checking_sst_file_sizes_on_db_open", - dynlib: librocksdb -.} - + opt: ptr rocksdb_options_t; val: uint8) {.cdecl.} proc rocksdb_options_get_skip_checking_sst_file_sizes_on_db_open*( - opt: ptr rocksdb_options_t -): uint8 {. - cdecl, - importc: "rocksdb_options_get_skip_checking_sst_file_sizes_on_db_open", - dynlib: librocksdb -.} - + opt: ptr rocksdb_options_t): uint8 {.cdecl.} ## Blob Options Settings -proc rocksdb_options_set_enable_blob_files*( - opt: ptr rocksdb_options_t, val: uint8 -) {.cdecl, importc: "rocksdb_options_set_enable_blob_files", dynlib: librocksdb.} - -proc rocksdb_options_get_enable_blob_files*( - opt: ptr rocksdb_options_t -): uint8 {.cdecl, importc: "rocksdb_options_get_enable_blob_files", dynlib: librocksdb.} - -proc rocksdb_options_set_min_blob_size*( - opt: ptr rocksdb_options_t, val: uint64 -) {.cdecl, importc: "rocksdb_options_set_min_blob_size", dynlib: librocksdb.} - -proc rocksdb_options_get_min_blob_size*( - opt: ptr rocksdb_options_t -): uint64 {.cdecl, importc: "rocksdb_options_get_min_blob_size", dynlib: librocksdb.} - -proc rocksdb_options_set_blob_file_size*( - opt: ptr rocksdb_options_t, val: uint64 -) {.cdecl, importc: "rocksdb_options_set_blob_file_size", dynlib: librocksdb.} - -proc rocksdb_options_get_blob_file_size*( - opt: ptr rocksdb_options_t -): uint64 {.cdecl, importc: "rocksdb_options_get_blob_file_size", dynlib: librocksdb.} - -proc rocksdb_options_set_blob_compression_type*( - opt: ptr rocksdb_options_t, val: cint -) {.cdecl, importc: "rocksdb_options_set_blob_compression_type", dynlib: librocksdb.} - -proc rocksdb_options_get_blob_compression_type*( - opt: ptr rocksdb_options_t -): cint {. - cdecl, importc: "rocksdb_options_get_blob_compression_type", dynlib: librocksdb -.} - -proc rocksdb_options_set_enable_blob_gc*( - opt: ptr rocksdb_options_t, val: uint8 -) {.cdecl, importc: "rocksdb_options_set_enable_blob_gc", dynlib: librocksdb.} - -proc rocksdb_options_get_enable_blob_gc*( - opt: ptr rocksdb_options_t -): uint8 {.cdecl, importc: "rocksdb_options_get_enable_blob_gc", dynlib: librocksdb.} - -proc rocksdb_options_set_blob_gc_age_cutoff*( - opt: ptr rocksdb_options_t, val: cdouble -) {.cdecl, importc: "rocksdb_options_set_blob_gc_age_cutoff", dynlib: librocksdb.} - -proc rocksdb_options_get_blob_gc_age_cutoff*( - opt: ptr rocksdb_options_t -): cdouble {. - cdecl, importc: "rocksdb_options_get_blob_gc_age_cutoff", dynlib: librocksdb -.} - -proc rocksdb_options_set_blob_gc_force_threshold*( - opt: ptr rocksdb_options_t, val: cdouble -) {.cdecl, importc: "rocksdb_options_set_blob_gc_force_threshold", dynlib: librocksdb.} - -proc rocksdb_options_get_blob_gc_force_threshold*( - opt: ptr rocksdb_options_t -): cdouble {. - cdecl, importc: "rocksdb_options_get_blob_gc_force_threshold", dynlib: librocksdb -.} - +proc rocksdb_options_set_enable_blob_files*(opt: ptr rocksdb_options_t; val: uint8) {. + cdecl.} +proc rocksdb_options_get_enable_blob_files*(opt: ptr rocksdb_options_t): uint8 {. + cdecl.} +proc rocksdb_options_set_min_blob_size*(opt: ptr rocksdb_options_t; val: uint64) {. + cdecl.} +proc rocksdb_options_get_min_blob_size*(opt: ptr rocksdb_options_t): uint64 {.cdecl.} +proc rocksdb_options_set_blob_file_size*(opt: ptr rocksdb_options_t; val: uint64) {. + cdecl.} +proc rocksdb_options_get_blob_file_size*(opt: ptr rocksdb_options_t): uint64 {.cdecl.} +proc rocksdb_options_set_blob_compression_type*(opt: ptr rocksdb_options_t; + val: cint) {.cdecl.} +proc rocksdb_options_get_blob_compression_type*(opt: ptr rocksdb_options_t): cint {. + cdecl.} +proc rocksdb_options_set_enable_blob_gc*(opt: ptr rocksdb_options_t; val: uint8) {. + cdecl.} +proc rocksdb_options_get_enable_blob_gc*(opt: ptr rocksdb_options_t): uint8 {.cdecl.} +proc rocksdb_options_set_blob_gc_age_cutoff*(opt: ptr rocksdb_options_t; + val: cdouble) {.cdecl.} +proc rocksdb_options_get_blob_gc_age_cutoff*(opt: ptr rocksdb_options_t): cdouble {. + cdecl.} +proc rocksdb_options_set_blob_gc_force_threshold*(opt: ptr rocksdb_options_t; + val: cdouble) {.cdecl.} +proc rocksdb_options_get_blob_gc_force_threshold*(opt: ptr rocksdb_options_t): cdouble {. + cdecl.} proc rocksdb_options_set_blob_compaction_readahead_size*( - opt: ptr rocksdb_options_t, val: uint64 -) {. - cdecl, - importc: "rocksdb_options_set_blob_compaction_readahead_size", - dynlib: librocksdb -.} - + opt: ptr rocksdb_options_t; val: uint64) {.cdecl.} proc rocksdb_options_get_blob_compaction_readahead_size*( - opt: ptr rocksdb_options_t -): uint64 {. - cdecl, - importc: "rocksdb_options_get_blob_compaction_readahead_size", - dynlib: librocksdb -.} - -proc rocksdb_options_set_blob_file_starting_level*( - opt: ptr rocksdb_options_t, val: cint -) {.cdecl, importc: "rocksdb_options_set_blob_file_starting_level", dynlib: librocksdb.} - -proc rocksdb_options_get_blob_file_starting_level*( - opt: ptr rocksdb_options_t -): cint {. - cdecl, importc: "rocksdb_options_get_blob_file_starting_level", dynlib: librocksdb -.} - -proc rocksdb_options_set_blob_cache*( - opt: ptr rocksdb_options_t, blob_cache: ptr rocksdb_cache_t -) {.cdecl, importc: "rocksdb_options_set_blob_cache", dynlib: librocksdb.} - -const - rocksdb_prepopulate_blob_disable* = 0 - rocksdb_prepopulate_blob_flush_only* = 1 - -proc rocksdb_options_set_prepopulate_blob_cache*( - opt: ptr rocksdb_options_t, val: cint -) {.cdecl, importc: "rocksdb_options_set_prepopulate_blob_cache", dynlib: librocksdb.} - -proc rocksdb_options_get_prepopulate_blob_cache*( - opt: ptr rocksdb_options_t -): cint {. - cdecl, importc: "rocksdb_options_get_prepopulate_blob_cache", dynlib: librocksdb -.} - -## returns a pointer to a malloc()-ed, null terminated string - -proc rocksdb_options_statistics_get_string*( - opt: ptr rocksdb_options_t -): cstring {. - cdecl, importc: "rocksdb_options_statistics_get_string", dynlib: librocksdb -.} - -proc rocksdb_options_statistics_get_ticker_count*( - opt: ptr rocksdb_options_t, ticker_type: uint32 -): uint64 {. - cdecl, importc: "rocksdb_options_statistics_get_ticker_count", dynlib: librocksdb -.} - -proc rocksdb_options_statistics_get_histogram_data*( - opt: ptr rocksdb_options_t, - histogram_type: uint32, - data: ptr rocksdb_statistics_histogram_data_t, -) {. - cdecl, importc: "rocksdb_options_statistics_get_histogram_data", dynlib: librocksdb -.} - -proc rocksdb_options_set_max_write_buffer_number*( - a1: ptr rocksdb_options_t, a2: cint -) {.cdecl, importc: "rocksdb_options_set_max_write_buffer_number", dynlib: librocksdb.} + opt: ptr rocksdb_options_t): uint64 {.cdecl.} +proc rocksdb_options_set_blob_file_starting_level*(opt: ptr rocksdb_options_t; + val: cint) {.cdecl.} +proc rocksdb_options_get_blob_file_starting_level*(opt: ptr rocksdb_options_t): cint {. + cdecl.} +proc rocksdb_options_set_blob_cache*(opt: ptr rocksdb_options_t; + blob_cache: ptr rocksdb_cache_t) {.cdecl.} +const + rocksdb_prepopulate_blob_disable* = 0 + rocksdb_prepopulate_blob_flush_only* = 1 -proc rocksdb_options_get_max_write_buffer_number*( - a1: ptr rocksdb_options_t -): cint {. - cdecl, importc: "rocksdb_options_get_max_write_buffer_number", dynlib: librocksdb -.} +proc rocksdb_options_set_prepopulate_blob_cache*(opt: ptr rocksdb_options_t; + val: cint) {.cdecl.} +proc rocksdb_options_get_prepopulate_blob_cache*(opt: ptr rocksdb_options_t): cint {. + cdecl.} +## returns a pointer to a malloc()-ed, null terminated string +proc rocksdb_options_statistics_get_string*(opt: ptr rocksdb_options_t): cstring {. + cdecl.} +proc rocksdb_options_statistics_get_ticker_count*(opt: ptr rocksdb_options_t; + ticker_type: uint32): uint64 {.cdecl.} +proc rocksdb_options_statistics_get_histogram_data*(opt: ptr rocksdb_options_t; + histogram_type: uint32; data: ptr rocksdb_statistics_histogram_data_t) {.cdecl.} +proc rocksdb_options_set_max_write_buffer_number*(a1: ptr rocksdb_options_t; + a2: cint) {.cdecl.} +proc rocksdb_options_get_max_write_buffer_number*(a1: ptr rocksdb_options_t): cint {. + cdecl.} proc rocksdb_options_set_min_write_buffer_number_to_merge*( - a1: ptr rocksdb_options_t, a2: cint -) {. - cdecl, - importc: "rocksdb_options_set_min_write_buffer_number_to_merge", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t; a2: cint) {.cdecl.} proc rocksdb_options_get_min_write_buffer_number_to_merge*( - a1: ptr rocksdb_options_t -): cint {. - cdecl, - importc: "rocksdb_options_get_min_write_buffer_number_to_merge", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t): cint {.cdecl.} proc rocksdb_options_set_max_write_buffer_number_to_maintain*( - a1: ptr rocksdb_options_t, a2: cint -) {. - cdecl, - importc: "rocksdb_options_set_max_write_buffer_number_to_maintain", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t; a2: cint) {.cdecl.} proc rocksdb_options_get_max_write_buffer_number_to_maintain*( - a1: ptr rocksdb_options_t -): cint {. - cdecl, - importc: "rocksdb_options_get_max_write_buffer_number_to_maintain", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t): cint {.cdecl.} proc rocksdb_options_set_max_write_buffer_size_to_maintain*( - a1: ptr rocksdb_options_t, a2: int64 -) {. - cdecl, - importc: "rocksdb_options_set_max_write_buffer_size_to_maintain", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t; a2: int64) {.cdecl.} proc rocksdb_options_get_max_write_buffer_size_to_maintain*( - a1: ptr rocksdb_options_t -): int64 {. - cdecl, - importc: "rocksdb_options_get_max_write_buffer_size_to_maintain", - dynlib: librocksdb -.} - -proc rocksdb_options_set_enable_pipelined_write*( - a1: ptr rocksdb_options_t, a2: uint8 -) {.cdecl, importc: "rocksdb_options_set_enable_pipelined_write", dynlib: librocksdb.} - -proc rocksdb_options_get_enable_pipelined_write*( - a1: ptr rocksdb_options_t -): uint8 {. - cdecl, importc: "rocksdb_options_get_enable_pipelined_write", dynlib: librocksdb -.} - -proc rocksdb_options_set_unordered_write*( - a1: ptr rocksdb_options_t, a2: uint8 -) {.cdecl, importc: "rocksdb_options_set_unordered_write", dynlib: librocksdb.} - -proc rocksdb_options_get_unordered_write*( - a1: ptr rocksdb_options_t -): uint8 {.cdecl, importc: "rocksdb_options_get_unordered_write", dynlib: librocksdb.} - -proc rocksdb_options_set_max_subcompactions*( - a1: ptr rocksdb_options_t, a2: uint32 -) {.cdecl, importc: "rocksdb_options_set_max_subcompactions", dynlib: librocksdb.} - -proc rocksdb_options_get_max_subcompactions*( - a1: ptr rocksdb_options_t -): uint32 {. - cdecl, importc: "rocksdb_options_get_max_subcompactions", dynlib: librocksdb -.} - -proc rocksdb_options_set_max_background_jobs*( - a1: ptr rocksdb_options_t, a2: cint -) {.cdecl, importc: "rocksdb_options_set_max_background_jobs", dynlib: librocksdb.} - -proc rocksdb_options_get_max_background_jobs*( - a1: ptr rocksdb_options_t -): cint {. - cdecl, importc: "rocksdb_options_get_max_background_jobs", dynlib: librocksdb -.} - -proc rocksdb_options_set_max_background_compactions*( - a1: ptr rocksdb_options_t, a2: cint -) {. - cdecl, importc: "rocksdb_options_set_max_background_compactions", dynlib: librocksdb -.} - -proc rocksdb_options_get_max_background_compactions*( - a1: ptr rocksdb_options_t -): cint {. - cdecl, importc: "rocksdb_options_get_max_background_compactions", dynlib: librocksdb -.} - -proc rocksdb_options_set_max_background_flushes*( - a1: ptr rocksdb_options_t, a2: cint -) {.cdecl, importc: "rocksdb_options_set_max_background_flushes", dynlib: librocksdb.} - -proc rocksdb_options_get_max_background_flushes*( - a1: ptr rocksdb_options_t -): cint {. - cdecl, importc: "rocksdb_options_get_max_background_flushes", dynlib: librocksdb -.} - -proc rocksdb_options_set_max_log_file_size*( - a1: ptr rocksdb_options_t, a2: csize_t -) {.cdecl, importc: "rocksdb_options_set_max_log_file_size", dynlib: librocksdb.} - -proc rocksdb_options_get_max_log_file_size*( - a1: ptr rocksdb_options_t -): csize_t {. - cdecl, importc: "rocksdb_options_get_max_log_file_size", dynlib: librocksdb -.} - -proc rocksdb_options_set_log_file_time_to_roll*( - a1: ptr rocksdb_options_t, a2: csize_t -) {.cdecl, importc: "rocksdb_options_set_log_file_time_to_roll", dynlib: librocksdb.} - -proc rocksdb_options_get_log_file_time_to_roll*( - a1: ptr rocksdb_options_t -): csize_t {. - cdecl, importc: "rocksdb_options_get_log_file_time_to_roll", dynlib: librocksdb -.} - -proc rocksdb_options_set_keep_log_file_num*( - a1: ptr rocksdb_options_t, a2: csize_t -) {.cdecl, importc: "rocksdb_options_set_keep_log_file_num", dynlib: librocksdb.} - -proc rocksdb_options_get_keep_log_file_num*( - a1: ptr rocksdb_options_t -): csize_t {. - cdecl, importc: "rocksdb_options_get_keep_log_file_num", dynlib: librocksdb -.} - -proc rocksdb_options_set_recycle_log_file_num*( - a1: ptr rocksdb_options_t, a2: csize_t -) {.cdecl, importc: "rocksdb_options_set_recycle_log_file_num", dynlib: librocksdb.} - -proc rocksdb_options_get_recycle_log_file_num*( - a1: ptr rocksdb_options_t -): csize_t {. - cdecl, importc: "rocksdb_options_get_recycle_log_file_num", dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t): int64 {.cdecl.} +proc rocksdb_options_set_enable_pipelined_write*(a1: ptr rocksdb_options_t; + a2: uint8) {.cdecl.} +proc rocksdb_options_get_enable_pipelined_write*(a1: ptr rocksdb_options_t): uint8 {. + cdecl.} +proc rocksdb_options_set_unordered_write*(a1: ptr rocksdb_options_t; a2: uint8) {. + cdecl.} +proc rocksdb_options_get_unordered_write*(a1: ptr rocksdb_options_t): uint8 {.cdecl.} +proc rocksdb_options_set_max_subcompactions*(a1: ptr rocksdb_options_t; a2: uint32) {. + cdecl.} +proc rocksdb_options_get_max_subcompactions*(a1: ptr rocksdb_options_t): uint32 {. + cdecl.} +proc rocksdb_options_set_max_background_jobs*(a1: ptr rocksdb_options_t; a2: cint) {. + cdecl.} +proc rocksdb_options_get_max_background_jobs*(a1: ptr rocksdb_options_t): cint {. + cdecl.} +proc rocksdb_options_set_max_background_compactions*(a1: ptr rocksdb_options_t; + a2: cint) {.cdecl.} +proc rocksdb_options_get_max_background_compactions*(a1: ptr rocksdb_options_t): cint {. + cdecl.} +proc rocksdb_options_set_max_background_flushes*(a1: ptr rocksdb_options_t; a2: cint) {. + cdecl.} +proc rocksdb_options_get_max_background_flushes*(a1: ptr rocksdb_options_t): cint {. + cdecl.} +proc rocksdb_options_set_max_log_file_size*(a1: ptr rocksdb_options_t; a2: csize_t) {. + cdecl.} +proc rocksdb_options_get_max_log_file_size*(a1: ptr rocksdb_options_t): csize_t {. + cdecl.} +proc rocksdb_options_set_log_file_time_to_roll*(a1: ptr rocksdb_options_t; + a2: csize_t) {.cdecl.} +proc rocksdb_options_get_log_file_time_to_roll*(a1: ptr rocksdb_options_t): csize_t {. + cdecl.} +proc rocksdb_options_set_keep_log_file_num*(a1: ptr rocksdb_options_t; a2: csize_t) {. + cdecl.} +proc rocksdb_options_get_keep_log_file_num*(a1: ptr rocksdb_options_t): csize_t {. + cdecl.} +proc rocksdb_options_set_recycle_log_file_num*(a1: ptr rocksdb_options_t; + a2: csize_t) {.cdecl.} +proc rocksdb_options_get_recycle_log_file_num*(a1: ptr rocksdb_options_t): csize_t {. + cdecl.} proc rocksdb_options_set_soft_pending_compaction_bytes_limit*( - opt: ptr rocksdb_options_t, v: csize_t -) {. - cdecl, - importc: "rocksdb_options_set_soft_pending_compaction_bytes_limit", - dynlib: librocksdb -.} - + opt: ptr rocksdb_options_t; v: csize_t) {.cdecl.} proc rocksdb_options_get_soft_pending_compaction_bytes_limit*( - opt: ptr rocksdb_options_t -): csize_t {. - cdecl, - importc: "rocksdb_options_get_soft_pending_compaction_bytes_limit", - dynlib: librocksdb -.} - + opt: ptr rocksdb_options_t): csize_t {.cdecl.} proc rocksdb_options_set_hard_pending_compaction_bytes_limit*( - opt: ptr rocksdb_options_t, v: csize_t -) {. - cdecl, - importc: "rocksdb_options_set_hard_pending_compaction_bytes_limit", - dynlib: librocksdb -.} - + opt: ptr rocksdb_options_t; v: csize_t) {.cdecl.} proc rocksdb_options_get_hard_pending_compaction_bytes_limit*( - opt: ptr rocksdb_options_t -): csize_t {. - cdecl, - importc: "rocksdb_options_get_hard_pending_compaction_bytes_limit", - dynlib: librocksdb -.} - -proc rocksdb_options_set_max_manifest_file_size*( - a1: ptr rocksdb_options_t, a2: csize_t -) {.cdecl, importc: "rocksdb_options_set_max_manifest_file_size", dynlib: librocksdb.} - -proc rocksdb_options_get_max_manifest_file_size*( - a1: ptr rocksdb_options_t -): csize_t {. - cdecl, importc: "rocksdb_options_get_max_manifest_file_size", dynlib: librocksdb -.} - -proc rocksdb_options_set_table_cache_numshardbits*( - a1: ptr rocksdb_options_t, a2: cint -) {.cdecl, importc: "rocksdb_options_set_table_cache_numshardbits", dynlib: librocksdb.} - -proc rocksdb_options_get_table_cache_numshardbits*( - a1: ptr rocksdb_options_t -): cint {. - cdecl, importc: "rocksdb_options_get_table_cache_numshardbits", dynlib: librocksdb -.} - -proc rocksdb_options_set_arena_block_size*( - a1: ptr rocksdb_options_t, a2: csize_t -) {.cdecl, importc: "rocksdb_options_set_arena_block_size", dynlib: librocksdb.} - -proc rocksdb_options_get_arena_block_size*( - a1: ptr rocksdb_options_t -): csize_t {. - cdecl, importc: "rocksdb_options_get_arena_block_size", dynlib: librocksdb -.} - -proc rocksdb_options_set_use_fsync*( - a1: ptr rocksdb_options_t, a2: cint -) {.cdecl, importc: "rocksdb_options_set_use_fsync", dynlib: librocksdb.} - -proc rocksdb_options_get_use_fsync*( - a1: ptr rocksdb_options_t -): cint {.cdecl, importc: "rocksdb_options_get_use_fsync", dynlib: librocksdb.} - -proc rocksdb_options_set_db_log_dir*( - a1: ptr rocksdb_options_t, a2: cstring -) {.cdecl, importc: "rocksdb_options_set_db_log_dir", dynlib: librocksdb.} - -proc rocksdb_options_set_wal_dir*( - a1: ptr rocksdb_options_t, a2: cstring -) {.cdecl, importc: "rocksdb_options_set_wal_dir", dynlib: librocksdb.} - -proc rocksdb_options_set_WAL_ttl_seconds*( - a1: ptr rocksdb_options_t, a2: uint64 -) {.cdecl, importc: "rocksdb_options_set_WAL_ttl_seconds", dynlib: librocksdb.} - -proc rocksdb_options_get_WAL_ttl_seconds*( - a1: ptr rocksdb_options_t -): uint64 {.cdecl, importc: "rocksdb_options_get_WAL_ttl_seconds", dynlib: librocksdb.} - -proc rocksdb_options_set_WAL_size_limit_MB*( - a1: ptr rocksdb_options_t, a2: uint64 -) {.cdecl, importc: "rocksdb_options_set_WAL_size_limit_MB", dynlib: librocksdb.} - -proc rocksdb_options_get_WAL_size_limit_MB*( - a1: ptr rocksdb_options_t -): uint64 {. - cdecl, importc: "rocksdb_options_get_WAL_size_limit_MB", dynlib: librocksdb -.} - -proc rocksdb_options_set_manifest_preallocation_size*( - a1: ptr rocksdb_options_t, a2: csize_t -) {. - cdecl, importc: "rocksdb_options_set_manifest_preallocation_size", dynlib: librocksdb -.} - -proc rocksdb_options_get_manifest_preallocation_size*( - a1: ptr rocksdb_options_t -): csize_t {. - cdecl, importc: "rocksdb_options_get_manifest_preallocation_size", dynlib: librocksdb -.} - -proc rocksdb_options_set_allow_mmap_reads*( - a1: ptr rocksdb_options_t, a2: uint8 -) {.cdecl, importc: "rocksdb_options_set_allow_mmap_reads", dynlib: librocksdb.} - -proc rocksdb_options_get_allow_mmap_reads*( - a1: ptr rocksdb_options_t -): uint8 {.cdecl, importc: "rocksdb_options_get_allow_mmap_reads", dynlib: librocksdb.} - -proc rocksdb_options_set_allow_mmap_writes*( - a1: ptr rocksdb_options_t, a2: uint8 -) {.cdecl, importc: "rocksdb_options_set_allow_mmap_writes", dynlib: librocksdb.} - -proc rocksdb_options_get_allow_mmap_writes*( - a1: ptr rocksdb_options_t -): uint8 {.cdecl, importc: "rocksdb_options_get_allow_mmap_writes", dynlib: librocksdb.} - -proc rocksdb_options_set_use_direct_reads*( - a1: ptr rocksdb_options_t, a2: uint8 -) {.cdecl, importc: "rocksdb_options_set_use_direct_reads", dynlib: librocksdb.} - -proc rocksdb_options_get_use_direct_reads*( - a1: ptr rocksdb_options_t -): uint8 {.cdecl, importc: "rocksdb_options_get_use_direct_reads", dynlib: librocksdb.} - + opt: ptr rocksdb_options_t): csize_t {.cdecl.} +proc rocksdb_options_set_max_manifest_file_size*(a1: ptr rocksdb_options_t; + a2: csize_t) {.cdecl.} +proc rocksdb_options_get_max_manifest_file_size*(a1: ptr rocksdb_options_t): csize_t {. + cdecl.} +proc rocksdb_options_set_table_cache_numshardbits*(a1: ptr rocksdb_options_t; + a2: cint) {.cdecl.} +proc rocksdb_options_get_table_cache_numshardbits*(a1: ptr rocksdb_options_t): cint {. + cdecl.} +proc rocksdb_options_set_arena_block_size*(a1: ptr rocksdb_options_t; a2: csize_t) {. + cdecl.} +proc rocksdb_options_get_arena_block_size*(a1: ptr rocksdb_options_t): csize_t {. + cdecl.} +proc rocksdb_options_set_use_fsync*(a1: ptr rocksdb_options_t; a2: cint) {.cdecl.} +proc rocksdb_options_get_use_fsync*(a1: ptr rocksdb_options_t): cint {.cdecl.} +proc rocksdb_options_set_db_log_dir*(a1: ptr rocksdb_options_t; a2: cstring) {.cdecl.} +proc rocksdb_options_set_wal_dir*(a1: ptr rocksdb_options_t; a2: cstring) {.cdecl.} +proc rocksdb_options_set_WAL_ttl_seconds*(a1: ptr rocksdb_options_t; a2: uint64) {. + cdecl.} +proc rocksdb_options_get_WAL_ttl_seconds*(a1: ptr rocksdb_options_t): uint64 {.cdecl.} +proc rocksdb_options_set_WAL_size_limit_MB*(a1: ptr rocksdb_options_t; a2: uint64) {. + cdecl.} +proc rocksdb_options_get_WAL_size_limit_MB*(a1: ptr rocksdb_options_t): uint64 {. + cdecl.} +proc rocksdb_options_set_manifest_preallocation_size*(a1: ptr rocksdb_options_t; + a2: csize_t) {.cdecl.} +proc rocksdb_options_get_manifest_preallocation_size*(a1: ptr rocksdb_options_t): csize_t {. + cdecl.} +proc rocksdb_options_set_allow_mmap_reads*(a1: ptr rocksdb_options_t; a2: uint8) {. + cdecl.} +proc rocksdb_options_get_allow_mmap_reads*(a1: ptr rocksdb_options_t): uint8 {.cdecl.} +proc rocksdb_options_set_allow_mmap_writes*(a1: ptr rocksdb_options_t; a2: uint8) {. + cdecl.} +proc rocksdb_options_get_allow_mmap_writes*(a1: ptr rocksdb_options_t): uint8 {.cdecl.} +proc rocksdb_options_set_use_direct_reads*(a1: ptr rocksdb_options_t; a2: uint8) {. + cdecl.} +proc rocksdb_options_get_use_direct_reads*(a1: ptr rocksdb_options_t): uint8 {.cdecl.} proc rocksdb_options_set_use_direct_io_for_flush_and_compaction*( - a1: ptr rocksdb_options_t, a2: uint8 -) {. - cdecl, - importc: "rocksdb_options_set_use_direct_io_for_flush_and_compaction", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t; a2: uint8) {.cdecl.} proc rocksdb_options_get_use_direct_io_for_flush_and_compaction*( - a1: ptr rocksdb_options_t -): uint8 {. - cdecl, - importc: "rocksdb_options_get_use_direct_io_for_flush_and_compaction", - dynlib: librocksdb -.} - -proc rocksdb_options_set_is_fd_close_on_exec*( - a1: ptr rocksdb_options_t, a2: uint8 -) {.cdecl, importc: "rocksdb_options_set_is_fd_close_on_exec", dynlib: librocksdb.} - -proc rocksdb_options_get_is_fd_close_on_exec*( - a1: ptr rocksdb_options_t -): uint8 {. - cdecl, importc: "rocksdb_options_get_is_fd_close_on_exec", dynlib: librocksdb -.} - -proc rocksdb_options_set_stats_dump_period_sec*( - a1: ptr rocksdb_options_t, a2: cuint -) {.cdecl, importc: "rocksdb_options_set_stats_dump_period_sec", dynlib: librocksdb.} - -proc rocksdb_options_get_stats_dump_period_sec*( - a1: ptr rocksdb_options_t -): cuint {. - cdecl, importc: "rocksdb_options_get_stats_dump_period_sec", dynlib: librocksdb -.} - -proc rocksdb_options_set_stats_persist_period_sec*( - a1: ptr rocksdb_options_t, a2: cuint -) {.cdecl, importc: "rocksdb_options_set_stats_persist_period_sec", dynlib: librocksdb.} - -proc rocksdb_options_get_stats_persist_period_sec*( - a1: ptr rocksdb_options_t -): cuint {. - cdecl, importc: "rocksdb_options_get_stats_persist_period_sec", dynlib: librocksdb -.} - -proc rocksdb_options_set_advise_random_on_open*( - a1: ptr rocksdb_options_t, a2: uint8 -) {.cdecl, importc: "rocksdb_options_set_advise_random_on_open", dynlib: librocksdb.} - -proc rocksdb_options_get_advise_random_on_open*( - a1: ptr rocksdb_options_t -): uint8 {. - cdecl, importc: "rocksdb_options_get_advise_random_on_open", dynlib: librocksdb -.} - -proc rocksdb_options_set_use_adaptive_mutex*( - a1: ptr rocksdb_options_t, a2: uint8 -) {.cdecl, importc: "rocksdb_options_set_use_adaptive_mutex", dynlib: librocksdb.} - -proc rocksdb_options_get_use_adaptive_mutex*( - a1: ptr rocksdb_options_t -): uint8 {. - cdecl, importc: "rocksdb_options_get_use_adaptive_mutex", dynlib: librocksdb -.} - -proc rocksdb_options_set_bytes_per_sync*( - a1: ptr rocksdb_options_t, a2: uint64 -) {.cdecl, importc: "rocksdb_options_set_bytes_per_sync", dynlib: librocksdb.} - -proc rocksdb_options_get_bytes_per_sync*( - a1: ptr rocksdb_options_t -): uint64 {.cdecl, importc: "rocksdb_options_get_bytes_per_sync", dynlib: librocksdb.} - -proc rocksdb_options_set_wal_bytes_per_sync*( - a1: ptr rocksdb_options_t, a2: uint64 -) {.cdecl, importc: "rocksdb_options_set_wal_bytes_per_sync", dynlib: librocksdb.} - -proc rocksdb_options_get_wal_bytes_per_sync*( - a1: ptr rocksdb_options_t -): uint64 {. - cdecl, importc: "rocksdb_options_get_wal_bytes_per_sync", dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t): uint8 {.cdecl.} +proc rocksdb_options_set_is_fd_close_on_exec*(a1: ptr rocksdb_options_t; a2: uint8) {. + cdecl.} +proc rocksdb_options_get_is_fd_close_on_exec*(a1: ptr rocksdb_options_t): uint8 {. + cdecl.} +proc rocksdb_options_set_stats_dump_period_sec*(a1: ptr rocksdb_options_t; a2: cuint) {. + cdecl.} +proc rocksdb_options_get_stats_dump_period_sec*(a1: ptr rocksdb_options_t): cuint {. + cdecl.} +proc rocksdb_options_set_stats_persist_period_sec*(a1: ptr rocksdb_options_t; + a2: cuint) {.cdecl.} +proc rocksdb_options_get_stats_persist_period_sec*(a1: ptr rocksdb_options_t): cuint {. + cdecl.} +proc rocksdb_options_set_advise_random_on_open*(a1: ptr rocksdb_options_t; a2: uint8) {. + cdecl.} +proc rocksdb_options_get_advise_random_on_open*(a1: ptr rocksdb_options_t): uint8 {. + cdecl.} +proc rocksdb_options_set_use_adaptive_mutex*(a1: ptr rocksdb_options_t; a2: uint8) {. + cdecl.} +proc rocksdb_options_get_use_adaptive_mutex*(a1: ptr rocksdb_options_t): uint8 {. + cdecl.} +proc rocksdb_options_set_bytes_per_sync*(a1: ptr rocksdb_options_t; a2: uint64) {. + cdecl.} +proc rocksdb_options_get_bytes_per_sync*(a1: ptr rocksdb_options_t): uint64 {.cdecl.} +proc rocksdb_options_set_wal_bytes_per_sync*(a1: ptr rocksdb_options_t; a2: uint64) {. + cdecl.} +proc rocksdb_options_get_wal_bytes_per_sync*(a1: ptr rocksdb_options_t): uint64 {. + cdecl.} proc rocksdb_options_set_writable_file_max_buffer_size*( - a1: ptr rocksdb_options_t, a2: uint64 -) {. - cdecl, - importc: "rocksdb_options_set_writable_file_max_buffer_size", - dynlib: librocksdb -.} - -proc rocksdb_options_get_writable_file_max_buffer_size*( - a1: ptr rocksdb_options_t -): uint64 {. - cdecl, - importc: "rocksdb_options_get_writable_file_max_buffer_size", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t; a2: uint64) {.cdecl.} +proc rocksdb_options_get_writable_file_max_buffer_size*(a1: ptr rocksdb_options_t): uint64 {. + cdecl.} proc rocksdb_options_set_allow_concurrent_memtable_write*( - a1: ptr rocksdb_options_t, a2: uint8 -) {. - cdecl, - importc: "rocksdb_options_set_allow_concurrent_memtable_write", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t; a2: uint8) {.cdecl.} proc rocksdb_options_get_allow_concurrent_memtable_write*( - a1: ptr rocksdb_options_t -): uint8 {. - cdecl, - importc: "rocksdb_options_get_allow_concurrent_memtable_write", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t): uint8 {.cdecl.} proc rocksdb_options_set_enable_write_thread_adaptive_yield*( - a1: ptr rocksdb_options_t, a2: uint8 -) {. - cdecl, - importc: "rocksdb_options_set_enable_write_thread_adaptive_yield", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t; a2: uint8) {.cdecl.} proc rocksdb_options_get_enable_write_thread_adaptive_yield*( - a1: ptr rocksdb_options_t -): uint8 {. - cdecl, - importc: "rocksdb_options_get_enable_write_thread_adaptive_yield", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t): uint8 {.cdecl.} proc rocksdb_options_set_max_sequential_skip_in_iterations*( - a1: ptr rocksdb_options_t, a2: uint64 -) {. - cdecl, - importc: "rocksdb_options_set_max_sequential_skip_in_iterations", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t; a2: uint64) {.cdecl.} proc rocksdb_options_get_max_sequential_skip_in_iterations*( - a1: ptr rocksdb_options_t -): uint64 {. - cdecl, - importc: "rocksdb_options_get_max_sequential_skip_in_iterations", - dynlib: librocksdb -.} - -proc rocksdb_options_set_disable_auto_compactions*( - a1: ptr rocksdb_options_t, a2: cint -) {.cdecl, importc: "rocksdb_options_set_disable_auto_compactions", dynlib: librocksdb.} - -proc rocksdb_options_get_disable_auto_compactions*( - a1: ptr rocksdb_options_t -): uint8 {. - cdecl, importc: "rocksdb_options_get_disable_auto_compactions", dynlib: librocksdb -.} - -proc rocksdb_options_set_optimize_filters_for_hits*( - a1: ptr rocksdb_options_t, a2: cint -) {. - cdecl, importc: "rocksdb_options_set_optimize_filters_for_hits", dynlib: librocksdb -.} - -proc rocksdb_options_get_optimize_filters_for_hits*( - a1: ptr rocksdb_options_t -): uint8 {. - cdecl, importc: "rocksdb_options_get_optimize_filters_for_hits", dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t): uint64 {.cdecl.} +proc rocksdb_options_set_disable_auto_compactions*(a1: ptr rocksdb_options_t; + a2: cint) {.cdecl.} +proc rocksdb_options_get_disable_auto_compactions*(a1: ptr rocksdb_options_t): uint8 {. + cdecl.} +proc rocksdb_options_set_optimize_filters_for_hits*(a1: ptr rocksdb_options_t; + a2: cint) {.cdecl.} +proc rocksdb_options_get_optimize_filters_for_hits*(a1: ptr rocksdb_options_t): uint8 {. + cdecl.} proc rocksdb_options_set_delete_obsolete_files_period_micros*( - a1: ptr rocksdb_options_t, a2: uint64 -) {. - cdecl, - importc: "rocksdb_options_set_delete_obsolete_files_period_micros", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t; a2: uint64) {.cdecl.} proc rocksdb_options_get_delete_obsolete_files_period_micros*( - a1: ptr rocksdb_options_t -): uint64 {. - cdecl, - importc: "rocksdb_options_get_delete_obsolete_files_period_micros", - dynlib: librocksdb -.} - -proc rocksdb_options_prepare_for_bulk_load*( - a1: ptr rocksdb_options_t -) {.cdecl, importc: "rocksdb_options_prepare_for_bulk_load", dynlib: librocksdb.} - -proc rocksdb_options_set_memtable_vector_rep*( - a1: ptr rocksdb_options_t -) {.cdecl, importc: "rocksdb_options_set_memtable_vector_rep", dynlib: librocksdb.} - + a1: ptr rocksdb_options_t): uint64 {.cdecl.} +proc rocksdb_options_prepare_for_bulk_load*(a1: ptr rocksdb_options_t) {.cdecl.} +proc rocksdb_options_set_memtable_vector_rep*(a1: ptr rocksdb_options_t) {.cdecl.} proc rocksdb_options_set_memtable_prefix_bloom_size_ratio*( - a1: ptr rocksdb_options_t, a2: cdouble -) {. - cdecl, - importc: "rocksdb_options_set_memtable_prefix_bloom_size_ratio", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t; a2: cdouble) {.cdecl.} proc rocksdb_options_get_memtable_prefix_bloom_size_ratio*( - a1: ptr rocksdb_options_t -): cdouble {. - cdecl, - importc: "rocksdb_options_get_memtable_prefix_bloom_size_ratio", - dynlib: librocksdb -.} - -proc rocksdb_options_set_max_compaction_bytes*( - a1: ptr rocksdb_options_t, a2: uint64 -) {.cdecl, importc: "rocksdb_options_set_max_compaction_bytes", dynlib: librocksdb.} - -proc rocksdb_options_get_max_compaction_bytes*( - a1: ptr rocksdb_options_t -): uint64 {. - cdecl, importc: "rocksdb_options_get_max_compaction_bytes", dynlib: librocksdb -.} - -proc rocksdb_options_set_hash_skip_list_rep*( - a1: ptr rocksdb_options_t, a2: csize_t, a3: int32, a4: int32 -) {.cdecl, importc: "rocksdb_options_set_hash_skip_list_rep", dynlib: librocksdb.} - -proc rocksdb_options_set_hash_link_list_rep*( - a1: ptr rocksdb_options_t, a2: csize_t -) {.cdecl, importc: "rocksdb_options_set_hash_link_list_rep", dynlib: librocksdb.} - -proc rocksdb_options_set_plain_table_factory*( - a1: ptr rocksdb_options_t, - a2: uint32, - a3: cint, - a4: cdouble, - a5: csize_t, - a6: csize_t, - a7: char, - a8: uint8, - a9: uint8, -) {.cdecl, importc: "rocksdb_options_set_plain_table_factory", dynlib: librocksdb.} - -proc rocksdb_options_get_write_dbid_to_manifest*( - a1: ptr rocksdb_options_t -): uint8 {. - cdecl, importc: "rocksdb_options_get_write_dbid_to_manifest", dynlib: librocksdb -.} - -proc rocksdb_options_set_write_dbid_to_manifest*( - a1: ptr rocksdb_options_t, a2: uint8 -) {.cdecl, importc: "rocksdb_options_set_write_dbid_to_manifest", dynlib: librocksdb.} - -proc rocksdb_options_get_write_identity_file*( - a1: ptr rocksdb_options_t -): uint8 {. - cdecl, importc: "rocksdb_options_get_write_identity_file", dynlib: librocksdb -.} - -proc rocksdb_options_set_write_identity_file*( - a1: ptr rocksdb_options_t, a2: uint8 -) {.cdecl, importc: "rocksdb_options_set_write_identity_file", dynlib: librocksdb.} - + a1: ptr rocksdb_options_t): cdouble {.cdecl.} +proc rocksdb_options_set_max_compaction_bytes*(a1: ptr rocksdb_options_t; a2: uint64) {. + cdecl.} +proc rocksdb_options_get_max_compaction_bytes*(a1: ptr rocksdb_options_t): uint64 {. + cdecl.} +proc rocksdb_options_set_hash_skip_list_rep*(a1: ptr rocksdb_options_t; a2: csize_t; + a3: int32; a4: int32) {.cdecl.} +proc rocksdb_options_set_hash_link_list_rep*(a1: ptr rocksdb_options_t; a2: csize_t) {. + cdecl.} +proc rocksdb_options_set_plain_table_factory*(a1: ptr rocksdb_options_t; a2: uint32; + a3: cint; a4: cdouble; a5: csize_t; a6: csize_t; a7: char; a8: uint8; a9: uint8) {.cdecl.} +proc rocksdb_options_get_write_dbid_to_manifest*(a1: ptr rocksdb_options_t): uint8 {. + cdecl.} +proc rocksdb_options_set_write_dbid_to_manifest*(a1: ptr rocksdb_options_t; + a2: uint8) {.cdecl.} +proc rocksdb_options_get_write_identity_file*(a1: ptr rocksdb_options_t): uint8 {. + cdecl.} +proc rocksdb_options_set_write_identity_file*(a1: ptr rocksdb_options_t; a2: uint8) {. + cdecl.} proc rocksdb_options_get_track_and_verify_wals_in_manifest*( - a1: ptr rocksdb_options_t -): uint8 {. - cdecl, - importc: "rocksdb_options_get_track_and_verify_wals_in_manifest", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t): uint8 {.cdecl.} proc rocksdb_options_set_track_and_verify_wals_in_manifest*( - a1: ptr rocksdb_options_t, a2: uint8 -) {. - cdecl, - importc: "rocksdb_options_set_track_and_verify_wals_in_manifest", - dynlib: librocksdb -.} - -proc rocksdb_options_set_min_level_to_compress*( - opt: ptr rocksdb_options_t, level: cint -) {.cdecl, importc: "rocksdb_options_set_min_level_to_compress", dynlib: librocksdb.} - -proc rocksdb_options_set_memtable_huge_page_size*( - a1: ptr rocksdb_options_t, a2: csize_t -) {.cdecl, importc: "rocksdb_options_set_memtable_huge_page_size", dynlib: librocksdb.} - -proc rocksdb_options_get_memtable_huge_page_size*( - a1: ptr rocksdb_options_t -): csize_t {. - cdecl, importc: "rocksdb_options_get_memtable_huge_page_size", dynlib: librocksdb -.} - -proc rocksdb_options_set_max_successive_merges*( - a1: ptr rocksdb_options_t, a2: csize_t -) {.cdecl, importc: "rocksdb_options_set_max_successive_merges", dynlib: librocksdb.} - -proc rocksdb_options_get_max_successive_merges*( - a1: ptr rocksdb_options_t -): csize_t {. - cdecl, importc: "rocksdb_options_get_max_successive_merges", dynlib: librocksdb -.} - -proc rocksdb_options_set_bloom_locality*( - a1: ptr rocksdb_options_t, a2: uint32 -) {.cdecl, importc: "rocksdb_options_set_bloom_locality", dynlib: librocksdb.} - -proc rocksdb_options_get_bloom_locality*( - a1: ptr rocksdb_options_t -): uint32 {.cdecl, importc: "rocksdb_options_get_bloom_locality", dynlib: librocksdb.} - -proc rocksdb_options_set_inplace_update_support*( - a1: ptr rocksdb_options_t, a2: uint8 -) {.cdecl, importc: "rocksdb_options_set_inplace_update_support", dynlib: librocksdb.} - -proc rocksdb_options_get_inplace_update_support*( - a1: ptr rocksdb_options_t -): uint8 {. - cdecl, importc: "rocksdb_options_get_inplace_update_support", dynlib: librocksdb -.} - -proc rocksdb_options_set_inplace_update_num_locks*( - a1: ptr rocksdb_options_t, a2: csize_t -) {.cdecl, importc: "rocksdb_options_set_inplace_update_num_locks", dynlib: librocksdb.} - -proc rocksdb_options_get_inplace_update_num_locks*( - a1: ptr rocksdb_options_t -): csize_t {. - cdecl, importc: "rocksdb_options_get_inplace_update_num_locks", dynlib: librocksdb -.} - -proc rocksdb_options_set_report_bg_io_stats*( - a1: ptr rocksdb_options_t, a2: cint -) {.cdecl, importc: "rocksdb_options_set_report_bg_io_stats", dynlib: librocksdb.} - -proc rocksdb_options_get_report_bg_io_stats*( - a1: ptr rocksdb_options_t -): uint8 {. - cdecl, importc: "rocksdb_options_get_report_bg_io_stats", dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t; a2: uint8) {.cdecl.} +proc rocksdb_options_set_min_level_to_compress*(opt: ptr rocksdb_options_t; + level: cint) {.cdecl.} +proc rocksdb_options_set_memtable_huge_page_size*(a1: ptr rocksdb_options_t; + a2: csize_t) {.cdecl.} +proc rocksdb_options_get_memtable_huge_page_size*(a1: ptr rocksdb_options_t): csize_t {. + cdecl.} +proc rocksdb_options_set_max_successive_merges*(a1: ptr rocksdb_options_t; + a2: csize_t) {.cdecl.} +proc rocksdb_options_get_max_successive_merges*(a1: ptr rocksdb_options_t): csize_t {. + cdecl.} +proc rocksdb_options_set_bloom_locality*(a1: ptr rocksdb_options_t; a2: uint32) {. + cdecl.} +proc rocksdb_options_get_bloom_locality*(a1: ptr rocksdb_options_t): uint32 {.cdecl.} +proc rocksdb_options_set_inplace_update_support*(a1: ptr rocksdb_options_t; + a2: uint8) {.cdecl.} +proc rocksdb_options_get_inplace_update_support*(a1: ptr rocksdb_options_t): uint8 {. + cdecl.} +proc rocksdb_options_set_inplace_update_num_locks*(a1: ptr rocksdb_options_t; + a2: csize_t) {.cdecl.} +proc rocksdb_options_get_inplace_update_num_locks*(a1: ptr rocksdb_options_t): csize_t {. + cdecl.} +proc rocksdb_options_set_report_bg_io_stats*(a1: ptr rocksdb_options_t; a2: cint) {. + cdecl.} +proc rocksdb_options_get_report_bg_io_stats*(a1: ptr rocksdb_options_t): uint8 {. + cdecl.} proc rocksdb_options_set_avoid_unnecessary_blocking_io*( - a1: ptr rocksdb_options_t, a2: uint8 -) {. - cdecl, - importc: "rocksdb_options_set_avoid_unnecessary_blocking_io", - dynlib: librocksdb -.} - -proc rocksdb_options_get_avoid_unnecessary_blocking_io*( - a1: ptr rocksdb_options_t -): uint8 {. - cdecl, - importc: "rocksdb_options_get_avoid_unnecessary_blocking_io", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t; a2: uint8) {.cdecl.} +proc rocksdb_options_get_avoid_unnecessary_blocking_io*(a1: ptr rocksdb_options_t): uint8 {. + cdecl.} proc rocksdb_options_set_experimental_mempurge_threshold*( - a1: ptr rocksdb_options_t, a2: cdouble -) {. - cdecl, - importc: "rocksdb_options_set_experimental_mempurge_threshold", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t; a2: cdouble) {.cdecl.} proc rocksdb_options_get_experimental_mempurge_threshold*( - a1: ptr rocksdb_options_t -): cdouble {. - cdecl, - importc: "rocksdb_options_get_experimental_mempurge_threshold", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t): cdouble {.cdecl.} const rocksdb_tolerate_corrupted_tail_records_recovery* = 0 rocksdb_absolute_consistency_recovery* = 1 rocksdb_point_in_time_recovery* = 2 rocksdb_skip_any_corrupted_records_recovery* = 3 -proc rocksdb_options_set_wal_recovery_mode*( - a1: ptr rocksdb_options_t, a2: cint -) {.cdecl, importc: "rocksdb_options_set_wal_recovery_mode", dynlib: librocksdb.} - -proc rocksdb_options_get_wal_recovery_mode*( - a1: ptr rocksdb_options_t -): cint {.cdecl, importc: "rocksdb_options_get_wal_recovery_mode", dynlib: librocksdb.} - +proc rocksdb_options_set_wal_recovery_mode*(a1: ptr rocksdb_options_t; a2: cint) {. + cdecl.} +proc rocksdb_options_get_wal_recovery_mode*(a1: ptr rocksdb_options_t): cint {.cdecl.} const rocksdb_no_compression* = 0 rocksdb_snappy_compression* = 1 @@ -3352,98 +1342,41 @@ const rocksdb_xpress_compression* = 6 rocksdb_zstd_compression* = 7 -proc rocksdb_options_set_compression*( - a1: ptr rocksdb_options_t, a2: cint -) {.cdecl, importc: "rocksdb_options_set_compression", dynlib: librocksdb.} - -proc rocksdb_options_get_compression*( - a1: ptr rocksdb_options_t -): cint {.cdecl, importc: "rocksdb_options_get_compression", dynlib: librocksdb.} - -proc rocksdb_options_set_bottommost_compression*( - a1: ptr rocksdb_options_t, a2: cint -) {.cdecl, importc: "rocksdb_options_set_bottommost_compression", dynlib: librocksdb.} - -proc rocksdb_options_get_bottommost_compression*( - a1: ptr rocksdb_options_t -): cint {. - cdecl, importc: "rocksdb_options_get_bottommost_compression", dynlib: librocksdb -.} - +proc rocksdb_options_set_compression*(a1: ptr rocksdb_options_t; a2: cint) {.cdecl.} +proc rocksdb_options_get_compression*(a1: ptr rocksdb_options_t): cint {.cdecl.} +proc rocksdb_options_set_bottommost_compression*(a1: ptr rocksdb_options_t; a2: cint) {. + cdecl.} +proc rocksdb_options_get_bottommost_compression*(a1: ptr rocksdb_options_t): cint {. + cdecl.} const rocksdb_level_compaction* = 0 rocksdb_universal_compaction* = 1 rocksdb_fifo_compaction* = 2 -proc rocksdb_options_set_compaction_style*( - a1: ptr rocksdb_options_t, a2: cint -) {.cdecl, importc: "rocksdb_options_set_compaction_style", dynlib: librocksdb.} - -proc rocksdb_options_get_compaction_style*( - a1: ptr rocksdb_options_t -): cint {.cdecl, importc: "rocksdb_options_get_compaction_style", dynlib: librocksdb.} - -proc rocksdb_options_set_universal_compaction_options*( - a1: ptr rocksdb_options_t, a2: ptr rocksdb_universal_compaction_options_t -) {. - cdecl, importc: "rocksdb_options_set_universal_compaction_options", dynlib: librocksdb -.} - -proc rocksdb_options_set_fifo_compaction_options*( - opt: ptr rocksdb_options_t, fifo: ptr rocksdb_fifo_compaction_options_t -) {.cdecl, importc: "rocksdb_options_set_fifo_compaction_options", dynlib: librocksdb.} - -proc rocksdb_options_set_ratelimiter*( - opt: ptr rocksdb_options_t, limiter: ptr rocksdb_ratelimiter_t -) {.cdecl, importc: "rocksdb_options_set_ratelimiter", dynlib: librocksdb.} - -proc rocksdb_options_set_atomic_flush*( - opt: ptr rocksdb_options_t, a2: uint8 -) {.cdecl, importc: "rocksdb_options_set_atomic_flush", dynlib: librocksdb.} - -proc rocksdb_options_get_atomic_flush*( - opt: ptr rocksdb_options_t -): uint8 {.cdecl, importc: "rocksdb_options_get_atomic_flush", dynlib: librocksdb.} - -proc rocksdb_options_set_row_cache*( - opt: ptr rocksdb_options_t, cache: ptr rocksdb_cache_t -) {.cdecl, importc: "rocksdb_options_set_row_cache", dynlib: librocksdb.} - +proc rocksdb_options_set_compaction_style*(a1: ptr rocksdb_options_t; a2: cint) {. + cdecl.} +proc rocksdb_options_get_compaction_style*(a1: ptr rocksdb_options_t): cint {.cdecl.} +proc rocksdb_options_set_universal_compaction_options*(a1: ptr rocksdb_options_t; + a2: ptr rocksdb_universal_compaction_options_t) {.cdecl.} +proc rocksdb_options_set_fifo_compaction_options*(opt: ptr rocksdb_options_t; + fifo: ptr rocksdb_fifo_compaction_options_t) {.cdecl.} +proc rocksdb_options_set_ratelimiter*(opt: ptr rocksdb_options_t; + limiter: ptr rocksdb_ratelimiter_t) {.cdecl.} +proc rocksdb_options_set_atomic_flush*(opt: ptr rocksdb_options_t; a2: uint8) {.cdecl.} +proc rocksdb_options_get_atomic_flush*(opt: ptr rocksdb_options_t): uint8 {.cdecl.} +proc rocksdb_options_set_row_cache*(opt: ptr rocksdb_options_t; + cache: ptr rocksdb_cache_t) {.cdecl.} proc rocksdb_options_add_compact_on_deletion_collector_factory*( - a1: ptr rocksdb_options_t, window_size: csize_t, num_dels_trigger: csize_t -) {. - cdecl, - importc: "rocksdb_options_add_compact_on_deletion_collector_factory", - dynlib: librocksdb -.} - + a1: ptr rocksdb_options_t; window_size: csize_t; num_dels_trigger: csize_t) {.cdecl.} proc rocksdb_options_add_compact_on_deletion_collector_factory_del_ratio*( - a1: ptr rocksdb_options_t, - window_size: csize_t, - num_dels_trigger: csize_t, - deletion_ratio: cdouble, -) {. - cdecl, - importc: "rocksdb_options_add_compact_on_deletion_collector_factory_del_ratio", - dynlib: librocksdb -.} - -proc rocksdb_options_set_manual_wal_flush*( - opt: ptr rocksdb_options_t, a2: uint8 -) {.cdecl, importc: "rocksdb_options_set_manual_wal_flush", dynlib: librocksdb.} - -proc rocksdb_options_get_manual_wal_flush*( - opt: ptr rocksdb_options_t -): uint8 {.cdecl, importc: "rocksdb_options_get_manual_wal_flush", dynlib: librocksdb.} - -proc rocksdb_options_set_wal_compression*( - opt: ptr rocksdb_options_t, a2: cint -) {.cdecl, importc: "rocksdb_options_set_wal_compression", dynlib: librocksdb.} - -proc rocksdb_options_get_wal_compression*( - opt: ptr rocksdb_options_t -): cint {.cdecl, importc: "rocksdb_options_get_wal_compression", dynlib: librocksdb.} - + a1: ptr rocksdb_options_t; window_size: csize_t; num_dels_trigger: csize_t; + deletion_ratio: cdouble) {.cdecl.} +proc rocksdb_options_set_manual_wal_flush*(opt: ptr rocksdb_options_t; a2: uint8) {. + cdecl.} +proc rocksdb_options_get_manual_wal_flush*(opt: ptr rocksdb_options_t): uint8 {.cdecl.} +proc rocksdb_options_set_wal_compression*(opt: ptr rocksdb_options_t; a2: cint) {. + cdecl.} +proc rocksdb_options_get_wal_compression*(opt: ptr rocksdb_options_t): cint {.cdecl.} const rocksdb_k_by_compensated_size_compaction_pri* = 0 rocksdb_k_oldest_largest_seq_first_compaction_pri* = 1 @@ -3451,42 +1384,19 @@ const rocksdb_k_min_overlapping_ratio_compaction_pri* = 3 rocksdb_k_round_robin_compaction_pri* = 4 -proc rocksdb_options_set_compaction_pri*( - a1: ptr rocksdb_options_t, a2: cint -) {.cdecl, importc: "rocksdb_options_set_compaction_pri", dynlib: librocksdb.} - -proc rocksdb_options_get_compaction_pri*( - a1: ptr rocksdb_options_t -): cint {.cdecl, importc: "rocksdb_options_get_compaction_pri", dynlib: librocksdb.} - +proc rocksdb_options_set_compaction_pri*(a1: ptr rocksdb_options_t; a2: cint) {.cdecl.} +proc rocksdb_options_get_compaction_pri*(a1: ptr rocksdb_options_t): cint {.cdecl.} ## RateLimiter -proc rocksdb_ratelimiter_create*( - rate_bytes_per_sec: int64, refill_period_us: int64, fairness: int32 -): ptr rocksdb_ratelimiter_t {. - cdecl, importc: "rocksdb_ratelimiter_create", dynlib: librocksdb -.} - -proc rocksdb_ratelimiter_create_auto_tuned*( - rate_bytes_per_sec: int64, refill_period_us: int64, fairness: int32 -): ptr rocksdb_ratelimiter_t {. - cdecl, importc: "rocksdb_ratelimiter_create_auto_tuned", dynlib: librocksdb -.} - -proc rocksdb_ratelimiter_create_with_mode*( - rate_bytes_per_sec: int64, - refill_period_us: int64, - fairness: int32, - mode: cint, - auto_tuned: bool, -): ptr rocksdb_ratelimiter_t {. - cdecl, importc: "rocksdb_ratelimiter_create_with_mode", dynlib: librocksdb -.} - -proc rocksdb_ratelimiter_destroy*( - a1: ptr rocksdb_ratelimiter_t -) {.cdecl, importc: "rocksdb_ratelimiter_destroy", dynlib: librocksdb.} - +proc rocksdb_ratelimiter_create*(rate_bytes_per_sec: int64; + refill_period_us: int64; fairness: int32): ptr rocksdb_ratelimiter_t {. + cdecl.} +proc rocksdb_ratelimiter_create_auto_tuned*(rate_bytes_per_sec: int64; + refill_period_us: int64; fairness: int32): ptr rocksdb_ratelimiter_t {.cdecl.} +proc rocksdb_ratelimiter_create_with_mode*(rate_bytes_per_sec: int64; + refill_period_us: int64; fairness: int32; mode: cint; auto_tuned: bool): ptr rocksdb_ratelimiter_t {. + cdecl.} +proc rocksdb_ratelimiter_destroy*(a1: ptr rocksdb_ratelimiter_t) {.cdecl.} ## PerfContext const @@ -3577,1063 +1487,402 @@ const rocksdb_block_read_cpu_time* = 76 rocksdb_total_metric_count* = 79 -proc rocksdb_set_perf_level*( - a1: cint -) {.cdecl, importc: "rocksdb_set_perf_level", dynlib: librocksdb.} - -proc rocksdb_perfcontext_create*(): ptr rocksdb_perfcontext_t {. - cdecl, importc: "rocksdb_perfcontext_create", dynlib: librocksdb -.} - -proc rocksdb_perfcontext_reset*( - context: ptr rocksdb_perfcontext_t -) {.cdecl, importc: "rocksdb_perfcontext_reset", dynlib: librocksdb.} - -proc rocksdb_perfcontext_report*( - context: ptr rocksdb_perfcontext_t, exclude_zero_counters: uint8 -): cstring {.cdecl, importc: "rocksdb_perfcontext_report", dynlib: librocksdb.} - -proc rocksdb_perfcontext_metric*( - context: ptr rocksdb_perfcontext_t, metric: cint -): uint64 {.cdecl, importc: "rocksdb_perfcontext_metric", dynlib: librocksdb.} - -proc rocksdb_perfcontext_destroy*( - context: ptr rocksdb_perfcontext_t -) {.cdecl, importc: "rocksdb_perfcontext_destroy", dynlib: librocksdb.} - +proc rocksdb_set_perf_level*(a1: cint) {.cdecl.} +proc rocksdb_perfcontext_create*(): ptr rocksdb_perfcontext_t {.cdecl.} +proc rocksdb_perfcontext_reset*(context: ptr rocksdb_perfcontext_t) {.cdecl.} +proc rocksdb_perfcontext_report*(context: ptr rocksdb_perfcontext_t; + exclude_zero_counters: uint8): cstring {.cdecl.} +proc rocksdb_perfcontext_metric*(context: ptr rocksdb_perfcontext_t; metric: cint): uint64 {. + cdecl.} +proc rocksdb_perfcontext_destroy*(context: ptr rocksdb_perfcontext_t) {.cdecl.} ## Compaction Filter -proc rocksdb_compactionfilter_create*( - state: pointer, - destructor: proc(a1: pointer) {.cdecl.}, - filter: proc( - a1: pointer, - level: cint, - key: cstring, - key_length: csize_t, - existing_value: cstring, - value_length: csize_t, - new_value: cstringArray, - new_value_length: ptr csize_t, - value_changed: ptr uint8, - ): uint8 {.cdecl.}, - name: proc(a1: pointer): cstring {.cdecl.}, -): ptr rocksdb_compactionfilter_t {. - cdecl, importc: "rocksdb_compactionfilter_create", dynlib: librocksdb -.} - +proc rocksdb_compactionfilter_create*(state: pointer; + destructor: proc (a1: pointer) {.cdecl.}; filter: proc ( + a1: pointer; level: cint; key: cstring; key_length: csize_t; + existing_value: cstring; value_length: csize_t; new_value: cstringArray; + new_value_length: ptr csize_t; value_changed: ptr uint8): uint8 {.cdecl.}; + name: proc (a1: pointer): cstring {.cdecl.}): ptr rocksdb_compactionfilter_t {. + cdecl.} proc rocksdb_compactionfilter_set_ignore_snapshots*( - a1: ptr rocksdb_compactionfilter_t, a2: uint8 -) {. - cdecl, importc: "rocksdb_compactionfilter_set_ignore_snapshots", dynlib: librocksdb -.} - -proc rocksdb_compactionfilter_destroy*( - a1: ptr rocksdb_compactionfilter_t -) {.cdecl, importc: "rocksdb_compactionfilter_destroy", dynlib: librocksdb.} - + a1: ptr rocksdb_compactionfilter_t; a2: uint8) {.cdecl.} +proc rocksdb_compactionfilter_destroy*(a1: ptr rocksdb_compactionfilter_t) {.cdecl.} ## Compaction Filter Context proc rocksdb_compactionfiltercontext_is_full_compaction*( - context: ptr rocksdb_compactionfiltercontext_t -): uint8 {. - cdecl, - importc: "rocksdb_compactionfiltercontext_is_full_compaction", - dynlib: librocksdb -.} - + context: ptr rocksdb_compactionfiltercontext_t): uint8 {.cdecl.} proc rocksdb_compactionfiltercontext_is_manual_compaction*( - context: ptr rocksdb_compactionfiltercontext_t -): uint8 {. - cdecl, - importc: "rocksdb_compactionfiltercontext_is_manual_compaction", - dynlib: librocksdb -.} - + context: ptr rocksdb_compactionfiltercontext_t): uint8 {.cdecl.} ## Compaction Filter Factory -proc rocksdb_compactionfilterfactory_create*( - state: pointer, - destructor: proc(a1: pointer) {.cdecl.}, - create_compaction_filter: proc( - a1: pointer, context: ptr rocksdb_compactionfiltercontext_t - ): ptr rocksdb_compactionfilter_t {.cdecl.}, - name: proc(a1: pointer): cstring {.cdecl.}, -): ptr rocksdb_compactionfilterfactory_t {. - cdecl, importc: "rocksdb_compactionfilterfactory_create", dynlib: librocksdb -.} - +proc rocksdb_compactionfilterfactory_create*(state: pointer; + destructor: proc (a1: pointer) {.cdecl.}; create_compaction_filter: proc ( + a1: pointer; context: ptr rocksdb_compactionfiltercontext_t): ptr rocksdb_compactionfilter_t {. + cdecl.}; name: proc (a1: pointer): cstring {.cdecl.}): ptr rocksdb_compactionfilterfactory_t {. + cdecl.} proc rocksdb_compactionfilterfactory_destroy*( - a1: ptr rocksdb_compactionfilterfactory_t -) {.cdecl, importc: "rocksdb_compactionfilterfactory_destroy", dynlib: librocksdb.} - + a1: ptr rocksdb_compactionfilterfactory_t) {.cdecl.} ## Comparator -proc rocksdb_comparator_create*( - state: pointer, - destructor: proc(a1: pointer) {.cdecl.}, - compare: proc(a1: pointer, a: cstring, alen: csize_t, b: cstring, blen: csize_t): cint {. - cdecl - .}, - name: proc(a1: pointer): cstring {.cdecl.}, -): ptr rocksdb_comparator_t {. - cdecl, importc: "rocksdb_comparator_create", dynlib: librocksdb -.} - -proc rocksdb_comparator_destroy*( - a1: ptr rocksdb_comparator_t -) {.cdecl, importc: "rocksdb_comparator_destroy", dynlib: librocksdb.} - -proc rocksdb_comparator_with_ts_create*( - state: pointer, - destructor: proc(a1: pointer) {.cdecl.}, - compare: proc(a1: pointer, a: cstring, alen: csize_t, b: cstring, blen: csize_t): cint {. - cdecl - .}, - compare_ts: proc( - a1: pointer, a_ts: cstring, a_tslen: csize_t, b_ts: cstring, b_tslen: csize_t - ): cint {.cdecl.}, - compare_without_ts: proc( - a1: pointer, - a: cstring, - alen: csize_t, - a_has_ts: uint8, - b: cstring, - blen: csize_t, - b_has_ts: uint8, - ): cint {.cdecl.}, - name: proc(a1: pointer): cstring {.cdecl.}, - timestamp_size: csize_t, -): ptr rocksdb_comparator_t {. - cdecl, importc: "rocksdb_comparator_with_ts_create", dynlib: librocksdb -.} - +proc rocksdb_comparator_create*(state: pointer; + destructor: proc (a1: pointer) {.cdecl.}; compare: proc ( + a1: pointer; a: cstring; alen: csize_t; b: cstring; blen: csize_t): cint {.cdecl.}; + name: proc (a1: pointer): cstring {.cdecl.}): ptr rocksdb_comparator_t {. + cdecl.} +proc rocksdb_comparator_destroy*(a1: ptr rocksdb_comparator_t) {.cdecl.} +proc rocksdb_comparator_with_ts_create*(state: pointer; + destructor: proc (a1: pointer) {.cdecl.}; + compare: proc (a1: pointer; a: cstring; alen: csize_t; b: cstring; blen: csize_t): cint {. + cdecl.}; compare_ts: proc (a1: pointer; a_ts: cstring; a_tslen: csize_t; + b_ts: cstring; b_tslen: csize_t): cint {.cdecl.}; + compare_without_ts: proc (a1: pointer; a: cstring; alen: csize_t; a_has_ts: uint8; + b: cstring; blen: csize_t; b_has_ts: uint8): cint {.cdecl.}; + name: proc (a1: pointer): cstring {.cdecl.}; timestamp_size: csize_t): ptr rocksdb_comparator_t {. + cdecl.} ## Filter policy -proc rocksdb_filterpolicy_destroy*( - a1: ptr rocksdb_filterpolicy_t -) {.cdecl, importc: "rocksdb_filterpolicy_destroy", dynlib: librocksdb.} - -proc rocksdb_filterpolicy_create_bloom*( - bits_per_key: cdouble -): ptr rocksdb_filterpolicy_t {. - cdecl, importc: "rocksdb_filterpolicy_create_bloom", dynlib: librocksdb -.} - -proc rocksdb_filterpolicy_create_bloom_full*( - bits_per_key: cdouble -): ptr rocksdb_filterpolicy_t {. - cdecl, importc: "rocksdb_filterpolicy_create_bloom_full", dynlib: librocksdb -.} - -proc rocksdb_filterpolicy_create_ribbon*( - bloom_equivalent_bits_per_key: cdouble -): ptr rocksdb_filterpolicy_t {. - cdecl, importc: "rocksdb_filterpolicy_create_ribbon", dynlib: librocksdb -.} - +proc rocksdb_filterpolicy_destroy*(a1: ptr rocksdb_filterpolicy_t) {.cdecl.} +proc rocksdb_filterpolicy_create_bloom*(bits_per_key: cdouble): ptr rocksdb_filterpolicy_t {. + cdecl.} +proc rocksdb_filterpolicy_create_bloom_full*(bits_per_key: cdouble): ptr rocksdb_filterpolicy_t {. + cdecl.} +proc rocksdb_filterpolicy_create_ribbon*(bloom_equivalent_bits_per_key: cdouble): ptr rocksdb_filterpolicy_t {. + cdecl.} proc rocksdb_filterpolicy_create_ribbon_hybrid*( - bloom_equivalent_bits_per_key: cdouble, bloom_before_level: cint -): ptr rocksdb_filterpolicy_t {. - cdecl, importc: "rocksdb_filterpolicy_create_ribbon_hybrid", dynlib: librocksdb -.} - + bloom_equivalent_bits_per_key: cdouble; bloom_before_level: cint): ptr rocksdb_filterpolicy_t {. + cdecl.} ## Merge Operator -proc rocksdb_mergeoperator_create*( - state: pointer, - destructor: proc(a1: pointer) {.cdecl.}, - full_merge: proc( - a1: pointer, - key: cstring, - key_length: csize_t, - existing_value: cstring, - existing_value_length: csize_t, - operands_list: cstringArray, - operands_list_length: ptr csize_t, - num_operands: cint, - success: ptr uint8, - new_value_length: ptr csize_t, - ): cstring {.cdecl.}, - partial_merge: proc( - a1: pointer, - key: cstring, - key_length: csize_t, - operands_list: cstringArray, - operands_list_length: ptr csize_t, - num_operands: cint, - success: ptr uint8, - new_value_length: ptr csize_t, - ): cstring {.cdecl.}, - delete_value: proc(a1: pointer, value: cstring, value_length: csize_t) {.cdecl.}, - name: proc(a1: pointer): cstring {.cdecl.}, -): ptr rocksdb_mergeoperator_t {. - cdecl, importc: "rocksdb_mergeoperator_create", dynlib: librocksdb -.} - -proc rocksdb_mergeoperator_destroy*( - a1: ptr rocksdb_mergeoperator_t -) {.cdecl, importc: "rocksdb_mergeoperator_destroy", dynlib: librocksdb.} - +proc rocksdb_mergeoperator_create*(state: pointer; + destructor: proc (a1: pointer) {.cdecl.}; + full_merge: proc (a1: pointer; key: cstring; key_length: csize_t; + existing_value: cstring; existing_value_length: csize_t; + operands_list: cstringArray; + operands_list_length: ptr csize_t; num_operands: cint; + success: ptr uint8; new_value_length: ptr csize_t): cstring {.cdecl.}; + partial_merge: proc (a1: pointer; key: cstring; key_length: csize_t; + operands_list: cstringArray; + operands_list_length: ptr csize_t; num_operands: cint; + success: ptr uint8; new_value_length: ptr csize_t): cstring {. + cdecl.}; delete_value: proc (a1: pointer; value: cstring; value_length: csize_t) {. + cdecl.}; name: proc (a1: pointer): cstring {.cdecl.}): ptr rocksdb_mergeoperator_t {. + cdecl.} +proc rocksdb_mergeoperator_destroy*(a1: ptr rocksdb_mergeoperator_t) {.cdecl.} ## Read options -proc rocksdb_readoptions_create*(): ptr rocksdb_readoptions_t {. - cdecl, importc: "rocksdb_readoptions_create", dynlib: librocksdb -.} - -proc rocksdb_readoptions_destroy*( - a1: ptr rocksdb_readoptions_t -) {.cdecl, importc: "rocksdb_readoptions_destroy", dynlib: librocksdb.} - -proc rocksdb_readoptions_set_verify_checksums*( - a1: ptr rocksdb_readoptions_t, a2: uint8 -) {.cdecl, importc: "rocksdb_readoptions_set_verify_checksums", dynlib: librocksdb.} - -proc rocksdb_readoptions_get_verify_checksums*( - a1: ptr rocksdb_readoptions_t -): uint8 {. - cdecl, importc: "rocksdb_readoptions_get_verify_checksums", dynlib: librocksdb -.} - -proc rocksdb_readoptions_set_fill_cache*( - a1: ptr rocksdb_readoptions_t, a2: uint8 -) {.cdecl, importc: "rocksdb_readoptions_set_fill_cache", dynlib: librocksdb.} - -proc rocksdb_readoptions_get_fill_cache*( - a1: ptr rocksdb_readoptions_t -): uint8 {.cdecl, importc: "rocksdb_readoptions_get_fill_cache", dynlib: librocksdb.} - -proc rocksdb_readoptions_set_snapshot*( - a1: ptr rocksdb_readoptions_t, a2: ptr rocksdb_snapshot_t -) {.cdecl, importc: "rocksdb_readoptions_set_snapshot", dynlib: librocksdb.} - -proc rocksdb_readoptions_set_iterate_upper_bound*( - a1: ptr rocksdb_readoptions_t, key: cstring, keylen: csize_t -) {.cdecl, importc: "rocksdb_readoptions_set_iterate_upper_bound", dynlib: librocksdb.} - -proc rocksdb_readoptions_set_iterate_lower_bound*( - a1: ptr rocksdb_readoptions_t, key: cstring, keylen: csize_t -) {.cdecl, importc: "rocksdb_readoptions_set_iterate_lower_bound", dynlib: librocksdb.} - -proc rocksdb_readoptions_set_read_tier*( - a1: ptr rocksdb_readoptions_t, a2: cint -) {.cdecl, importc: "rocksdb_readoptions_set_read_tier", dynlib: librocksdb.} - -proc rocksdb_readoptions_get_read_tier*( - a1: ptr rocksdb_readoptions_t -): cint {.cdecl, importc: "rocksdb_readoptions_get_read_tier", dynlib: librocksdb.} - -proc rocksdb_readoptions_set_tailing*( - a1: ptr rocksdb_readoptions_t, a2: uint8 -) {.cdecl, importc: "rocksdb_readoptions_set_tailing", dynlib: librocksdb.} - -proc rocksdb_readoptions_get_tailing*( - a1: ptr rocksdb_readoptions_t -): uint8 {.cdecl, importc: "rocksdb_readoptions_get_tailing", dynlib: librocksdb.} - +proc rocksdb_readoptions_create*(): ptr rocksdb_readoptions_t {.cdecl.} +proc rocksdb_readoptions_destroy*(a1: ptr rocksdb_readoptions_t) {.cdecl.} +proc rocksdb_readoptions_set_verify_checksums*(a1: ptr rocksdb_readoptions_t; + a2: uint8) {.cdecl.} +proc rocksdb_readoptions_get_verify_checksums*(a1: ptr rocksdb_readoptions_t): uint8 {. + cdecl.} +proc rocksdb_readoptions_set_fill_cache*(a1: ptr rocksdb_readoptions_t; a2: uint8) {. + cdecl.} +proc rocksdb_readoptions_get_fill_cache*(a1: ptr rocksdb_readoptions_t): uint8 {. + cdecl.} +proc rocksdb_readoptions_set_snapshot*(a1: ptr rocksdb_readoptions_t; + a2: ptr rocksdb_snapshot_t) {.cdecl.} +proc rocksdb_readoptions_set_iterate_upper_bound*(a1: ptr rocksdb_readoptions_t; + key: cstring; keylen: csize_t) {.cdecl.} +proc rocksdb_readoptions_set_iterate_lower_bound*(a1: ptr rocksdb_readoptions_t; + key: cstring; keylen: csize_t) {.cdecl.} +proc rocksdb_readoptions_set_read_tier*(a1: ptr rocksdb_readoptions_t; a2: cint) {. + cdecl.} +proc rocksdb_readoptions_get_read_tier*(a1: ptr rocksdb_readoptions_t): cint {.cdecl.} +proc rocksdb_readoptions_set_tailing*(a1: ptr rocksdb_readoptions_t; a2: uint8) {. + cdecl.} +proc rocksdb_readoptions_get_tailing*(a1: ptr rocksdb_readoptions_t): uint8 {.cdecl.} ## The functionality that this option controlled has been removed. -proc rocksdb_readoptions_set_managed*( - a1: ptr rocksdb_readoptions_t, a2: uint8 -) {.cdecl, importc: "rocksdb_readoptions_set_managed", dynlib: librocksdb.} - -proc rocksdb_readoptions_set_readahead_size*( - a1: ptr rocksdb_readoptions_t, a2: csize_t -) {.cdecl, importc: "rocksdb_readoptions_set_readahead_size", dynlib: librocksdb.} - -proc rocksdb_readoptions_get_readahead_size*( - a1: ptr rocksdb_readoptions_t -): csize_t {. - cdecl, importc: "rocksdb_readoptions_get_readahead_size", dynlib: librocksdb -.} - -proc rocksdb_readoptions_set_prefix_same_as_start*( - a1: ptr rocksdb_readoptions_t, a2: uint8 -) {.cdecl, importc: "rocksdb_readoptions_set_prefix_same_as_start", dynlib: librocksdb.} - -proc rocksdb_readoptions_get_prefix_same_as_start*( - a1: ptr rocksdb_readoptions_t -): uint8 {. - cdecl, importc: "rocksdb_readoptions_get_prefix_same_as_start", dynlib: librocksdb -.} - -proc rocksdb_readoptions_set_pin_data*( - a1: ptr rocksdb_readoptions_t, a2: uint8 -) {.cdecl, importc: "rocksdb_readoptions_set_pin_data", dynlib: librocksdb.} - -proc rocksdb_readoptions_get_pin_data*( - a1: ptr rocksdb_readoptions_t -): uint8 {.cdecl, importc: "rocksdb_readoptions_get_pin_data", dynlib: librocksdb.} - -proc rocksdb_readoptions_set_total_order_seek*( - a1: ptr rocksdb_readoptions_t, a2: uint8 -) {.cdecl, importc: "rocksdb_readoptions_set_total_order_seek", dynlib: librocksdb.} - -proc rocksdb_readoptions_get_total_order_seek*( - a1: ptr rocksdb_readoptions_t -): uint8 {. - cdecl, importc: "rocksdb_readoptions_get_total_order_seek", dynlib: librocksdb -.} - +proc rocksdb_readoptions_set_managed*(a1: ptr rocksdb_readoptions_t; a2: uint8) {. + cdecl.} +proc rocksdb_readoptions_set_readahead_size*(a1: ptr rocksdb_readoptions_t; + a2: csize_t) {.cdecl.} +proc rocksdb_readoptions_get_readahead_size*(a1: ptr rocksdb_readoptions_t): csize_t {. + cdecl.} +proc rocksdb_readoptions_set_prefix_same_as_start*(a1: ptr rocksdb_readoptions_t; + a2: uint8) {.cdecl.} +proc rocksdb_readoptions_get_prefix_same_as_start*(a1: ptr rocksdb_readoptions_t): uint8 {. + cdecl.} +proc rocksdb_readoptions_set_pin_data*(a1: ptr rocksdb_readoptions_t; a2: uint8) {. + cdecl.} +proc rocksdb_readoptions_get_pin_data*(a1: ptr rocksdb_readoptions_t): uint8 {.cdecl.} +proc rocksdb_readoptions_set_total_order_seek*(a1: ptr rocksdb_readoptions_t; + a2: uint8) {.cdecl.} +proc rocksdb_readoptions_get_total_order_seek*(a1: ptr rocksdb_readoptions_t): uint8 {. + cdecl.} proc rocksdb_readoptions_set_max_skippable_internal_keys*( - a1: ptr rocksdb_readoptions_t, a2: uint64 -) {. - cdecl, - importc: "rocksdb_readoptions_set_max_skippable_internal_keys", - dynlib: librocksdb -.} - + a1: ptr rocksdb_readoptions_t; a2: uint64) {.cdecl.} proc rocksdb_readoptions_get_max_skippable_internal_keys*( - a1: ptr rocksdb_readoptions_t -): uint64 {. - cdecl, - importc: "rocksdb_readoptions_get_max_skippable_internal_keys", - dynlib: librocksdb -.} - + a1: ptr rocksdb_readoptions_t): uint64 {.cdecl.} proc rocksdb_readoptions_set_background_purge_on_iterator_cleanup*( - a1: ptr rocksdb_readoptions_t, a2: uint8 -) {. - cdecl, - importc: "rocksdb_readoptions_set_background_purge_on_iterator_cleanup", - dynlib: librocksdb -.} - + a1: ptr rocksdb_readoptions_t; a2: uint8) {.cdecl.} proc rocksdb_readoptions_get_background_purge_on_iterator_cleanup*( - a1: ptr rocksdb_readoptions_t -): uint8 {. - cdecl, - importc: "rocksdb_readoptions_get_background_purge_on_iterator_cleanup", - dynlib: librocksdb -.} - + a1: ptr rocksdb_readoptions_t): uint8 {.cdecl.} proc rocksdb_readoptions_set_ignore_range_deletions*( - a1: ptr rocksdb_readoptions_t, a2: uint8 -) {. - cdecl, importc: "rocksdb_readoptions_set_ignore_range_deletions", dynlib: librocksdb -.} - + a1: ptr rocksdb_readoptions_t; a2: uint8) {.cdecl.} proc rocksdb_readoptions_get_ignore_range_deletions*( - a1: ptr rocksdb_readoptions_t -): uint8 {. - cdecl, importc: "rocksdb_readoptions_get_ignore_range_deletions", dynlib: librocksdb -.} - -proc rocksdb_readoptions_set_deadline*( - a1: ptr rocksdb_readoptions_t, microseconds: uint64 -) {.cdecl, importc: "rocksdb_readoptions_set_deadline", dynlib: librocksdb.} - -proc rocksdb_readoptions_get_deadline*( - a1: ptr rocksdb_readoptions_t -): uint64 {.cdecl, importc: "rocksdb_readoptions_get_deadline", dynlib: librocksdb.} - -proc rocksdb_readoptions_set_io_timeout*( - a1: ptr rocksdb_readoptions_t, microseconds: uint64 -) {.cdecl, importc: "rocksdb_readoptions_set_io_timeout", dynlib: librocksdb.} - -proc rocksdb_readoptions_get_io_timeout*( - a1: ptr rocksdb_readoptions_t -): uint64 {.cdecl, importc: "rocksdb_readoptions_get_io_timeout", dynlib: librocksdb.} - -proc rocksdb_readoptions_set_async_io*( - a1: ptr rocksdb_readoptions_t, a2: uint8 -) {.cdecl, importc: "rocksdb_readoptions_set_async_io", dynlib: librocksdb.} - -proc rocksdb_readoptions_get_async_io*( - a1: ptr rocksdb_readoptions_t -): uint8 {.cdecl, importc: "rocksdb_readoptions_get_async_io", dynlib: librocksdb.} - -proc rocksdb_readoptions_set_timestamp*( - a1: ptr rocksdb_readoptions_t, ts: cstring, tslen: csize_t -) {.cdecl, importc: "rocksdb_readoptions_set_timestamp", dynlib: librocksdb.} - -proc rocksdb_readoptions_set_iter_start_ts*( - a1: ptr rocksdb_readoptions_t, ts: cstring, tslen: csize_t -) {.cdecl, importc: "rocksdb_readoptions_set_iter_start_ts", dynlib: librocksdb.} - -proc rocksdb_readoptions_set_auto_readahead_size*( - a1: ptr rocksdb_readoptions_t, a2: uint8 -) {.cdecl, importc: "rocksdb_readoptions_set_auto_readahead_size", dynlib: librocksdb.} - + a1: ptr rocksdb_readoptions_t): uint8 {.cdecl.} +proc rocksdb_readoptions_set_deadline*(a1: ptr rocksdb_readoptions_t; + microseconds: uint64) {.cdecl.} +proc rocksdb_readoptions_get_deadline*(a1: ptr rocksdb_readoptions_t): uint64 {.cdecl.} +proc rocksdb_readoptions_set_io_timeout*(a1: ptr rocksdb_readoptions_t; + microseconds: uint64) {.cdecl.} +proc rocksdb_readoptions_get_io_timeout*(a1: ptr rocksdb_readoptions_t): uint64 {. + cdecl.} +proc rocksdb_readoptions_set_async_io*(a1: ptr rocksdb_readoptions_t; a2: uint8) {. + cdecl.} +proc rocksdb_readoptions_get_async_io*(a1: ptr rocksdb_readoptions_t): uint8 {.cdecl.} +proc rocksdb_readoptions_set_timestamp*(a1: ptr rocksdb_readoptions_t; ts: cstring; + tslen: csize_t) {.cdecl.} +proc rocksdb_readoptions_set_iter_start_ts*(a1: ptr rocksdb_readoptions_t; + ts: cstring; tslen: csize_t) {.cdecl.} +proc rocksdb_readoptions_set_auto_readahead_size*(a1: ptr rocksdb_readoptions_t; + a2: uint8) {.cdecl.} ## Write options -proc rocksdb_writeoptions_create*(): ptr rocksdb_writeoptions_t {. - cdecl, importc: "rocksdb_writeoptions_create", dynlib: librocksdb -.} - -proc rocksdb_writeoptions_destroy*( - a1: ptr rocksdb_writeoptions_t -) {.cdecl, importc: "rocksdb_writeoptions_destroy", dynlib: librocksdb.} - -proc rocksdb_writeoptions_set_sync*( - a1: ptr rocksdb_writeoptions_t, a2: uint8 -) {.cdecl, importc: "rocksdb_writeoptions_set_sync", dynlib: librocksdb.} - -proc rocksdb_writeoptions_get_sync*( - a1: ptr rocksdb_writeoptions_t -): uint8 {.cdecl, importc: "rocksdb_writeoptions_get_sync", dynlib: librocksdb.} - -proc rocksdb_writeoptions_disable_WAL*( - opt: ptr rocksdb_writeoptions_t, disable: cint -) {.cdecl, importc: "rocksdb_writeoptions_disable_WAL", dynlib: librocksdb.} - -proc rocksdb_writeoptions_get_disable_WAL*( - opt: ptr rocksdb_writeoptions_t -): uint8 {.cdecl, importc: "rocksdb_writeoptions_get_disable_WAL", dynlib: librocksdb.} - +proc rocksdb_writeoptions_create*(): ptr rocksdb_writeoptions_t {.cdecl.} +proc rocksdb_writeoptions_destroy*(a1: ptr rocksdb_writeoptions_t) {.cdecl.} +proc rocksdb_writeoptions_set_sync*(a1: ptr rocksdb_writeoptions_t; a2: uint8) {.cdecl.} +proc rocksdb_writeoptions_get_sync*(a1: ptr rocksdb_writeoptions_t): uint8 {.cdecl.} +proc rocksdb_writeoptions_disable_WAL*(opt: ptr rocksdb_writeoptions_t; + disable: cint) {.cdecl.} +proc rocksdb_writeoptions_get_disable_WAL*(opt: ptr rocksdb_writeoptions_t): uint8 {. + cdecl.} proc rocksdb_writeoptions_set_ignore_missing_column_families*( - a1: ptr rocksdb_writeoptions_t, a2: uint8 -) {. - cdecl, - importc: "rocksdb_writeoptions_set_ignore_missing_column_families", - dynlib: librocksdb -.} - + a1: ptr rocksdb_writeoptions_t; a2: uint8) {.cdecl.} proc rocksdb_writeoptions_get_ignore_missing_column_families*( - a1: ptr rocksdb_writeoptions_t -): uint8 {. - cdecl, - importc: "rocksdb_writeoptions_get_ignore_missing_column_families", - dynlib: librocksdb -.} - -proc rocksdb_writeoptions_set_no_slowdown*( - a1: ptr rocksdb_writeoptions_t, a2: uint8 -) {.cdecl, importc: "rocksdb_writeoptions_set_no_slowdown", dynlib: librocksdb.} - -proc rocksdb_writeoptions_get_no_slowdown*( - a1: ptr rocksdb_writeoptions_t -): uint8 {.cdecl, importc: "rocksdb_writeoptions_get_no_slowdown", dynlib: librocksdb.} - -proc rocksdb_writeoptions_set_low_pri*( - a1: ptr rocksdb_writeoptions_t, a2: uint8 -) {.cdecl, importc: "rocksdb_writeoptions_set_low_pri", dynlib: librocksdb.} - -proc rocksdb_writeoptions_get_low_pri*( - a1: ptr rocksdb_writeoptions_t -): uint8 {.cdecl, importc: "rocksdb_writeoptions_get_low_pri", dynlib: librocksdb.} - + a1: ptr rocksdb_writeoptions_t): uint8 {.cdecl.} +proc rocksdb_writeoptions_set_no_slowdown*(a1: ptr rocksdb_writeoptions_t; a2: uint8) {. + cdecl.} +proc rocksdb_writeoptions_get_no_slowdown*(a1: ptr rocksdb_writeoptions_t): uint8 {. + cdecl.} +proc rocksdb_writeoptions_set_low_pri*(a1: ptr rocksdb_writeoptions_t; a2: uint8) {. + cdecl.} +proc rocksdb_writeoptions_get_low_pri*(a1: ptr rocksdb_writeoptions_t): uint8 {.cdecl.} proc rocksdb_writeoptions_set_memtable_insert_hint_per_batch*( - a1: ptr rocksdb_writeoptions_t, a2: uint8 -) {. - cdecl, - importc: "rocksdb_writeoptions_set_memtable_insert_hint_per_batch", - dynlib: librocksdb -.} - + a1: ptr rocksdb_writeoptions_t; a2: uint8) {.cdecl.} proc rocksdb_writeoptions_get_memtable_insert_hint_per_batch*( - a1: ptr rocksdb_writeoptions_t -): uint8 {. - cdecl, - importc: "rocksdb_writeoptions_get_memtable_insert_hint_per_batch", - dynlib: librocksdb -.} - + a1: ptr rocksdb_writeoptions_t): uint8 {.cdecl.} ## Compact range options -proc rocksdb_compactoptions_create*(): ptr rocksdb_compactoptions_t {. - cdecl, importc: "rocksdb_compactoptions_create", dynlib: librocksdb -.} - -proc rocksdb_compactoptions_destroy*( - a1: ptr rocksdb_compactoptions_t -) {.cdecl, importc: "rocksdb_compactoptions_destroy", dynlib: librocksdb.} - +proc rocksdb_compactoptions_create*(): ptr rocksdb_compactoptions_t {.cdecl.} +proc rocksdb_compactoptions_destroy*(a1: ptr rocksdb_compactoptions_t) {.cdecl.} proc rocksdb_compactoptions_set_exclusive_manual_compaction*( - a1: ptr rocksdb_compactoptions_t, a2: uint8 -) {. - cdecl, - importc: "rocksdb_compactoptions_set_exclusive_manual_compaction", - dynlib: librocksdb -.} - + a1: ptr rocksdb_compactoptions_t; a2: uint8) {.cdecl.} proc rocksdb_compactoptions_get_exclusive_manual_compaction*( - a1: ptr rocksdb_compactoptions_t -): uint8 {. - cdecl, - importc: "rocksdb_compactoptions_get_exclusive_manual_compaction", - dynlib: librocksdb -.} - + a1: ptr rocksdb_compactoptions_t): uint8 {.cdecl.} proc rocksdb_compactoptions_set_bottommost_level_compaction*( - a1: ptr rocksdb_compactoptions_t, a2: uint8 -) {. - cdecl, - importc: "rocksdb_compactoptions_set_bottommost_level_compaction", - dynlib: librocksdb -.} - + a1: ptr rocksdb_compactoptions_t; a2: uint8) {.cdecl.} proc rocksdb_compactoptions_get_bottommost_level_compaction*( - a1: ptr rocksdb_compactoptions_t -): uint8 {. - cdecl, - importc: "rocksdb_compactoptions_get_bottommost_level_compaction", - dynlib: librocksdb -.} - -proc rocksdb_compactoptions_set_change_level*( - a1: ptr rocksdb_compactoptions_t, a2: uint8 -) {.cdecl, importc: "rocksdb_compactoptions_set_change_level", dynlib: librocksdb.} - -proc rocksdb_compactoptions_get_change_level*( - a1: ptr rocksdb_compactoptions_t -): uint8 {. - cdecl, importc: "rocksdb_compactoptions_get_change_level", dynlib: librocksdb -.} - -proc rocksdb_compactoptions_set_target_level*( - a1: ptr rocksdb_compactoptions_t, a2: cint -) {.cdecl, importc: "rocksdb_compactoptions_set_target_level", dynlib: librocksdb.} - -proc rocksdb_compactoptions_get_target_level*( - a1: ptr rocksdb_compactoptions_t -): cint {. - cdecl, importc: "rocksdb_compactoptions_get_target_level", dynlib: librocksdb -.} - + a1: ptr rocksdb_compactoptions_t): uint8 {.cdecl.} +proc rocksdb_compactoptions_set_change_level*(a1: ptr rocksdb_compactoptions_t; + a2: uint8) {.cdecl.} +proc rocksdb_compactoptions_get_change_level*(a1: ptr rocksdb_compactoptions_t): uint8 {. + cdecl.} +proc rocksdb_compactoptions_set_target_level*(a1: ptr rocksdb_compactoptions_t; + a2: cint) {.cdecl.} +proc rocksdb_compactoptions_get_target_level*(a1: ptr rocksdb_compactoptions_t): cint {. + cdecl.} proc rocksdb_compactoptions_set_full_history_ts_low*( - a1: ptr rocksdb_compactoptions_t, ts: cstring, tslen: csize_t -) {. - cdecl, importc: "rocksdb_compactoptions_set_full_history_ts_low", dynlib: librocksdb -.} - + a1: ptr rocksdb_compactoptions_t; ts: cstring; tslen: csize_t) {.cdecl.} ## Flush options -proc rocksdb_flushoptions_create*(): ptr rocksdb_flushoptions_t {. - cdecl, importc: "rocksdb_flushoptions_create", dynlib: librocksdb -.} - -proc rocksdb_flushoptions_destroy*( - a1: ptr rocksdb_flushoptions_t -) {.cdecl, importc: "rocksdb_flushoptions_destroy", dynlib: librocksdb.} - -proc rocksdb_flushoptions_set_wait*( - a1: ptr rocksdb_flushoptions_t, a2: uint8 -) {.cdecl, importc: "rocksdb_flushoptions_set_wait", dynlib: librocksdb.} - -proc rocksdb_flushoptions_get_wait*( - a1: ptr rocksdb_flushoptions_t -): uint8 {.cdecl, importc: "rocksdb_flushoptions_get_wait", dynlib: librocksdb.} - +proc rocksdb_flushoptions_create*(): ptr rocksdb_flushoptions_t {.cdecl.} +proc rocksdb_flushoptions_destroy*(a1: ptr rocksdb_flushoptions_t) {.cdecl.} +proc rocksdb_flushoptions_set_wait*(a1: ptr rocksdb_flushoptions_t; a2: uint8) {.cdecl.} +proc rocksdb_flushoptions_get_wait*(a1: ptr rocksdb_flushoptions_t): uint8 {.cdecl.} ## Memory allocator -proc rocksdb_jemalloc_nodump_allocator_create*( - errptr: cstringArray -): ptr rocksdb_memory_allocator_t {. - cdecl, importc: "rocksdb_jemalloc_nodump_allocator_create", dynlib: librocksdb -.} - -proc rocksdb_memory_allocator_destroy*( - a1: ptr rocksdb_memory_allocator_t -) {.cdecl, importc: "rocksdb_memory_allocator_destroy", dynlib: librocksdb.} - +proc rocksdb_jemalloc_nodump_allocator_create*(errptr: cstringArray): ptr rocksdb_memory_allocator_t {. + cdecl.} +proc rocksdb_memory_allocator_destroy*(a1: ptr rocksdb_memory_allocator_t) {.cdecl.} ## Cache -proc rocksdb_lru_cache_options_create*(): ptr rocksdb_lru_cache_options_t {. - cdecl, importc: "rocksdb_lru_cache_options_create", dynlib: librocksdb -.} - -proc rocksdb_lru_cache_options_destroy*( - a1: ptr rocksdb_lru_cache_options_t -) {.cdecl, importc: "rocksdb_lru_cache_options_destroy", dynlib: librocksdb.} - -proc rocksdb_lru_cache_options_set_capacity*( - a1: ptr rocksdb_lru_cache_options_t, a2: csize_t -) {.cdecl, importc: "rocksdb_lru_cache_options_set_capacity", dynlib: librocksdb.} - -proc rocksdb_lru_cache_options_set_num_shard_bits*( - a1: ptr rocksdb_lru_cache_options_t, a2: cint -) {.cdecl, importc: "rocksdb_lru_cache_options_set_num_shard_bits", dynlib: librocksdb.} - -proc rocksdb_lru_cache_options_set_memory_allocator*( - a1: ptr rocksdb_lru_cache_options_t, a2: ptr rocksdb_memory_allocator_t -) {. - cdecl, importc: "rocksdb_lru_cache_options_set_memory_allocator", dynlib: librocksdb -.} - -proc rocksdb_cache_create_lru*( - capacity: csize_t -): ptr rocksdb_cache_t {. - cdecl, importc: "rocksdb_cache_create_lru", dynlib: librocksdb -.} - -proc rocksdb_cache_create_lru_with_strict_capacity_limit*( - capacity: csize_t -): ptr rocksdb_cache_t {. - cdecl, - importc: "rocksdb_cache_create_lru_with_strict_capacity_limit", - dynlib: librocksdb -.} - -proc rocksdb_cache_create_lru_opts*( - a1: ptr rocksdb_lru_cache_options_t -): ptr rocksdb_cache_t {. - cdecl, importc: "rocksdb_cache_create_lru_opts", dynlib: librocksdb -.} - -proc rocksdb_cache_destroy*( - cache: ptr rocksdb_cache_t -) {.cdecl, importc: "rocksdb_cache_destroy", dynlib: librocksdb.} - -proc rocksdb_cache_disown_data*( - cache: ptr rocksdb_cache_t -) {.cdecl, importc: "rocksdb_cache_disown_data", dynlib: librocksdb.} - -proc rocksdb_cache_set_capacity*( - cache: ptr rocksdb_cache_t, capacity: csize_t -) {.cdecl, importc: "rocksdb_cache_set_capacity", dynlib: librocksdb.} - -proc rocksdb_cache_get_capacity*( - cache: ptr rocksdb_cache_t -): csize_t {.cdecl, importc: "rocksdb_cache_get_capacity", dynlib: librocksdb.} - -proc rocksdb_cache_get_usage*( - cache: ptr rocksdb_cache_t -): csize_t {.cdecl, importc: "rocksdb_cache_get_usage", dynlib: librocksdb.} - -proc rocksdb_cache_get_pinned_usage*( - cache: ptr rocksdb_cache_t -): csize_t {.cdecl, importc: "rocksdb_cache_get_pinned_usage", dynlib: librocksdb.} - -proc rocksdb_cache_get_table_address_count*( - cache: ptr rocksdb_cache_t -): csize_t {. - cdecl, importc: "rocksdb_cache_get_table_address_count", dynlib: librocksdb -.} - -proc rocksdb_cache_get_occupancy_count*( - cache: ptr rocksdb_cache_t -): csize_t {.cdecl, importc: "rocksdb_cache_get_occupancy_count", dynlib: librocksdb.} - -## WriteBufferManager - -proc rocksdb_write_buffer_manager_create*( - buffer_size: csize_t, allow_stall: bool -): ptr rocksdb_write_buffer_manager_t {. - cdecl, importc: "rocksdb_write_buffer_manager_create", dynlib: librocksdb -.} - -proc rocksdb_write_buffer_manager_create_with_cache*( - buffer_size: csize_t, cache: ptr rocksdb_cache_t, allow_stall: bool -): ptr rocksdb_write_buffer_manager_t {. - cdecl, importc: "rocksdb_write_buffer_manager_create_with_cache", dynlib: librocksdb -.} +proc rocksdb_lru_cache_options_create*(): ptr rocksdb_lru_cache_options_t {.cdecl.} +proc rocksdb_lru_cache_options_destroy*(a1: ptr rocksdb_lru_cache_options_t) {.cdecl.} +proc rocksdb_lru_cache_options_set_capacity*(a1: ptr rocksdb_lru_cache_options_t; + a2: csize_t) {.cdecl.} +proc rocksdb_lru_cache_options_set_num_shard_bits*( + a1: ptr rocksdb_lru_cache_options_t; a2: cint) {.cdecl.} +proc rocksdb_lru_cache_options_set_memory_allocator*( + a1: ptr rocksdb_lru_cache_options_t; a2: ptr rocksdb_memory_allocator_t) {.cdecl.} +proc rocksdb_cache_create_lru*(capacity: csize_t): ptr rocksdb_cache_t {.cdecl.} +proc rocksdb_cache_create_lru_with_strict_capacity_limit*(capacity: csize_t): ptr rocksdb_cache_t {. + cdecl.} +proc rocksdb_cache_create_lru_opts*(a1: ptr rocksdb_lru_cache_options_t): ptr rocksdb_cache_t {. + cdecl.} +proc rocksdb_cache_destroy*(cache: ptr rocksdb_cache_t) {.cdecl.} +proc rocksdb_cache_disown_data*(cache: ptr rocksdb_cache_t) {.cdecl.} +proc rocksdb_cache_set_capacity*(cache: ptr rocksdb_cache_t; capacity: csize_t) {. + cdecl.} +proc rocksdb_cache_get_capacity*(cache: ptr rocksdb_cache_t): csize_t {.cdecl.} +proc rocksdb_cache_get_usage*(cache: ptr rocksdb_cache_t): csize_t {.cdecl.} +proc rocksdb_cache_get_pinned_usage*(cache: ptr rocksdb_cache_t): csize_t {.cdecl.} +proc rocksdb_cache_get_table_address_count*(cache: ptr rocksdb_cache_t): csize_t {. + cdecl.} +proc rocksdb_cache_get_occupancy_count*(cache: ptr rocksdb_cache_t): csize_t {.cdecl.} +## WriteBufferManager +proc rocksdb_write_buffer_manager_create*(buffer_size: csize_t; allow_stall: bool): ptr rocksdb_write_buffer_manager_t {. + cdecl.} +proc rocksdb_write_buffer_manager_create_with_cache*(buffer_size: csize_t; + cache: ptr rocksdb_cache_t; allow_stall: bool): ptr rocksdb_write_buffer_manager_t {. + cdecl.} proc rocksdb_write_buffer_manager_destroy*( - wbm: ptr rocksdb_write_buffer_manager_t -) {.cdecl, importc: "rocksdb_write_buffer_manager_destroy", dynlib: librocksdb.} - + wbm: ptr rocksdb_write_buffer_manager_t) {.cdecl.} proc rocksdb_write_buffer_manager_enabled*( - wbm: ptr rocksdb_write_buffer_manager_t -): bool {.cdecl, importc: "rocksdb_write_buffer_manager_enabled", dynlib: librocksdb.} - + wbm: ptr rocksdb_write_buffer_manager_t): bool {.cdecl.} proc rocksdb_write_buffer_manager_cost_to_cache*( - wbm: ptr rocksdb_write_buffer_manager_t -): bool {. - cdecl, importc: "rocksdb_write_buffer_manager_cost_to_cache", dynlib: librocksdb -.} - + wbm: ptr rocksdb_write_buffer_manager_t): bool {.cdecl.} proc rocksdb_write_buffer_manager_memory_usage*( - wbm: ptr rocksdb_write_buffer_manager_t -): csize_t {. - cdecl, importc: "rocksdb_write_buffer_manager_memory_usage", dynlib: librocksdb -.} - + wbm: ptr rocksdb_write_buffer_manager_t): csize_t {.cdecl.} proc rocksdb_write_buffer_manager_mutable_memtable_memory_usage*( - wbm: ptr rocksdb_write_buffer_manager_t -): csize_t {. - cdecl, - importc: "rocksdb_write_buffer_manager_mutable_memtable_memory_usage", - dynlib: librocksdb -.} - + wbm: ptr rocksdb_write_buffer_manager_t): csize_t {.cdecl.} proc rocksdb_write_buffer_manager_dummy_entries_in_cache_usage*( - wbm: ptr rocksdb_write_buffer_manager_t -): csize_t {. - cdecl, - importc: "rocksdb_write_buffer_manager_dummy_entries_in_cache_usage", - dynlib: librocksdb -.} - + wbm: ptr rocksdb_write_buffer_manager_t): csize_t {.cdecl.} proc rocksdb_write_buffer_manager_buffer_size*( - wbm: ptr rocksdb_write_buffer_manager_t -): csize_t {. - cdecl, importc: "rocksdb_write_buffer_manager_buffer_size", dynlib: librocksdb -.} - + wbm: ptr rocksdb_write_buffer_manager_t): csize_t {.cdecl.} proc rocksdb_write_buffer_manager_set_buffer_size*( - wbm: ptr rocksdb_write_buffer_manager_t, new_size: csize_t -) {.cdecl, importc: "rocksdb_write_buffer_manager_set_buffer_size", dynlib: librocksdb.} - + wbm: ptr rocksdb_write_buffer_manager_t; new_size: csize_t) {.cdecl.} proc rocksdb_write_buffer_manager_set_allow_stall*( - wbm: ptr rocksdb_write_buffer_manager_t, new_allow_stall: bool -) {.cdecl, importc: "rocksdb_write_buffer_manager_set_allow_stall", dynlib: librocksdb.} - + wbm: ptr rocksdb_write_buffer_manager_t; new_allow_stall: bool) {.cdecl.} ## HyperClockCache -proc rocksdb_hyper_clock_cache_options_create*( - capacity: csize_t, estimated_entry_charge: csize_t -): ptr rocksdb_hyper_clock_cache_options_t {. - cdecl, importc: "rocksdb_hyper_clock_cache_options_create", dynlib: librocksdb -.} - +proc rocksdb_hyper_clock_cache_options_create*(capacity: csize_t; + estimated_entry_charge: csize_t): ptr rocksdb_hyper_clock_cache_options_t {. + cdecl.} proc rocksdb_hyper_clock_cache_options_destroy*( - a1: ptr rocksdb_hyper_clock_cache_options_t -) {.cdecl, importc: "rocksdb_hyper_clock_cache_options_destroy", dynlib: librocksdb.} - + a1: ptr rocksdb_hyper_clock_cache_options_t) {.cdecl.} proc rocksdb_hyper_clock_cache_options_set_capacity*( - a1: ptr rocksdb_hyper_clock_cache_options_t, a2: csize_t -) {. - cdecl, importc: "rocksdb_hyper_clock_cache_options_set_capacity", dynlib: librocksdb -.} - + a1: ptr rocksdb_hyper_clock_cache_options_t; a2: csize_t) {.cdecl.} proc rocksdb_hyper_clock_cache_options_set_estimated_entry_charge*( - a1: ptr rocksdb_hyper_clock_cache_options_t, a2: csize_t -) {. - cdecl, - importc: "rocksdb_hyper_clock_cache_options_set_estimated_entry_charge", - dynlib: librocksdb -.} - + a1: ptr rocksdb_hyper_clock_cache_options_t; a2: csize_t) {.cdecl.} proc rocksdb_hyper_clock_cache_options_set_num_shard_bits*( - a1: ptr rocksdb_hyper_clock_cache_options_t, a2: cint -) {. - cdecl, - importc: "rocksdb_hyper_clock_cache_options_set_num_shard_bits", - dynlib: librocksdb -.} - + a1: ptr rocksdb_hyper_clock_cache_options_t; a2: cint) {.cdecl.} proc rocksdb_hyper_clock_cache_options_set_memory_allocator*( - a1: ptr rocksdb_hyper_clock_cache_options_t, a2: ptr rocksdb_memory_allocator_t -) {. - cdecl, - importc: "rocksdb_hyper_clock_cache_options_set_memory_allocator", - dynlib: librocksdb -.} - -proc rocksdb_cache_create_hyper_clock*( - capacity: csize_t, estimated_entry_charge: csize_t -): ptr rocksdb_cache_t {. - cdecl, importc: "rocksdb_cache_create_hyper_clock", dynlib: librocksdb -.} - + a1: ptr rocksdb_hyper_clock_cache_options_t; a2: ptr rocksdb_memory_allocator_t) {. + cdecl.} +proc rocksdb_cache_create_hyper_clock*(capacity: csize_t; + estimated_entry_charge: csize_t): ptr rocksdb_cache_t {. + cdecl.} proc rocksdb_cache_create_hyper_clock_opts*( - a1: ptr rocksdb_hyper_clock_cache_options_t -): ptr rocksdb_cache_t {. - cdecl, importc: "rocksdb_cache_create_hyper_clock_opts", dynlib: librocksdb -.} - + a1: ptr rocksdb_hyper_clock_cache_options_t): ptr rocksdb_cache_t {.cdecl.} ## DBPath -proc rocksdb_dbpath_create*( - path: cstring, target_size: uint64 -): ptr rocksdb_dbpath_t {.cdecl, importc: "rocksdb_dbpath_create", dynlib: librocksdb.} - -proc rocksdb_dbpath_destroy*( - a1: ptr rocksdb_dbpath_t -) {.cdecl, importc: "rocksdb_dbpath_destroy", dynlib: librocksdb.} - +proc rocksdb_dbpath_create*(path: cstring; target_size: uint64): ptr rocksdb_dbpath_t {. + cdecl.} +proc rocksdb_dbpath_destroy*(a1: ptr rocksdb_dbpath_t) {.cdecl.} ## Env -proc rocksdb_create_default_env*(): ptr rocksdb_env_t {. - cdecl, importc: "rocksdb_create_default_env", dynlib: librocksdb -.} - -proc rocksdb_create_mem_env*(): ptr rocksdb_env_t {. - cdecl, importc: "rocksdb_create_mem_env", dynlib: librocksdb -.} - -proc rocksdb_env_set_background_threads*( - env: ptr rocksdb_env_t, n: cint -) {.cdecl, importc: "rocksdb_env_set_background_threads", dynlib: librocksdb.} - -proc rocksdb_env_get_background_threads*( - env: ptr rocksdb_env_t -): cint {.cdecl, importc: "rocksdb_env_get_background_threads", dynlib: librocksdb.} - -proc rocksdb_env_set_high_priority_background_threads*( - env: ptr rocksdb_env_t, n: cint -) {. - cdecl, importc: "rocksdb_env_set_high_priority_background_threads", dynlib: librocksdb -.} - -proc rocksdb_env_get_high_priority_background_threads*( - env: ptr rocksdb_env_t -): cint {. - cdecl, importc: "rocksdb_env_get_high_priority_background_threads", dynlib: librocksdb -.} - -proc rocksdb_env_set_low_priority_background_threads*( - env: ptr rocksdb_env_t, n: cint -) {. - cdecl, importc: "rocksdb_env_set_low_priority_background_threads", dynlib: librocksdb -.} - -proc rocksdb_env_get_low_priority_background_threads*( - env: ptr rocksdb_env_t -): cint {. - cdecl, importc: "rocksdb_env_get_low_priority_background_threads", dynlib: librocksdb -.} - -proc rocksdb_env_set_bottom_priority_background_threads*( - env: ptr rocksdb_env_t, n: cint -) {. - cdecl, - importc: "rocksdb_env_set_bottom_priority_background_threads", - dynlib: librocksdb -.} - -proc rocksdb_env_get_bottom_priority_background_threads*( - env: ptr rocksdb_env_t -): cint {. - cdecl, - importc: "rocksdb_env_get_bottom_priority_background_threads", - dynlib: librocksdb -.} - -proc rocksdb_env_join_all_threads*( - env: ptr rocksdb_env_t -) {.cdecl, importc: "rocksdb_env_join_all_threads", dynlib: librocksdb.} - -proc rocksdb_env_lower_thread_pool_io_priority*( - env: ptr rocksdb_env_t -) {.cdecl, importc: "rocksdb_env_lower_thread_pool_io_priority", dynlib: librocksdb.} - +proc rocksdb_create_default_env*(): ptr rocksdb_env_t {.cdecl.} +proc rocksdb_create_mem_env*(): ptr rocksdb_env_t {.cdecl.} +proc rocksdb_env_set_background_threads*(env: ptr rocksdb_env_t; n: cint) {.cdecl.} +proc rocksdb_env_get_background_threads*(env: ptr rocksdb_env_t): cint {.cdecl.} +proc rocksdb_env_set_high_priority_background_threads*(env: ptr rocksdb_env_t; + n: cint) {.cdecl.} +proc rocksdb_env_get_high_priority_background_threads*(env: ptr rocksdb_env_t): cint {. + cdecl.} +proc rocksdb_env_set_low_priority_background_threads*(env: ptr rocksdb_env_t; + n: cint) {.cdecl.} +proc rocksdb_env_get_low_priority_background_threads*(env: ptr rocksdb_env_t): cint {. + cdecl.} +proc rocksdb_env_set_bottom_priority_background_threads*(env: ptr rocksdb_env_t; + n: cint) {.cdecl.} +proc rocksdb_env_get_bottom_priority_background_threads*(env: ptr rocksdb_env_t): cint {. + cdecl.} +proc rocksdb_env_join_all_threads*(env: ptr rocksdb_env_t) {.cdecl.} +proc rocksdb_env_lower_thread_pool_io_priority*(env: ptr rocksdb_env_t) {.cdecl.} proc rocksdb_env_lower_high_priority_thread_pool_io_priority*( - env: ptr rocksdb_env_t -) {. - cdecl, - importc: "rocksdb_env_lower_high_priority_thread_pool_io_priority", - dynlib: librocksdb -.} - -proc rocksdb_env_lower_thread_pool_cpu_priority*( - env: ptr rocksdb_env_t -) {.cdecl, importc: "rocksdb_env_lower_thread_pool_cpu_priority", dynlib: librocksdb.} - + env: ptr rocksdb_env_t) {.cdecl.} +proc rocksdb_env_lower_thread_pool_cpu_priority*(env: ptr rocksdb_env_t) {.cdecl.} proc rocksdb_env_lower_high_priority_thread_pool_cpu_priority*( - env: ptr rocksdb_env_t -) {. - cdecl, - importc: "rocksdb_env_lower_high_priority_thread_pool_cpu_priority", - dynlib: librocksdb -.} - -proc rocksdb_env_destroy*( - a1: ptr rocksdb_env_t -) {.cdecl, importc: "rocksdb_env_destroy", dynlib: librocksdb.} - -proc rocksdb_envoptions_create*(): ptr rocksdb_envoptions_t {. - cdecl, importc: "rocksdb_envoptions_create", dynlib: librocksdb -.} - -proc rocksdb_envoptions_destroy*( - opt: ptr rocksdb_envoptions_t -) {.cdecl, importc: "rocksdb_envoptions_destroy", dynlib: librocksdb.} - -proc rocksdb_create_dir_if_missing*( - env: ptr rocksdb_env_t, path: cstring, errptr: cstringArray -) {.cdecl, importc: "rocksdb_create_dir_if_missing", dynlib: librocksdb.} - + env: ptr rocksdb_env_t) {.cdecl.} +proc rocksdb_env_destroy*(a1: ptr rocksdb_env_t) {.cdecl.} +proc rocksdb_envoptions_create*(): ptr rocksdb_envoptions_t {.cdecl.} +proc rocksdb_envoptions_destroy*(opt: ptr rocksdb_envoptions_t) {.cdecl.} +proc rocksdb_create_dir_if_missing*(env: ptr rocksdb_env_t; path: cstring; + errptr: cstringArray) {.cdecl.} ## SstFile -proc rocksdb_sstfilewriter_create*( - env: ptr rocksdb_envoptions_t, io_options: ptr rocksdb_options_t -): ptr rocksdb_sstfilewriter_t {. - cdecl, importc: "rocksdb_sstfilewriter_create", dynlib: librocksdb -.} - -proc rocksdb_sstfilewriter_create_with_comparator*( - env: ptr rocksdb_envoptions_t, - io_options: ptr rocksdb_options_t, - comparator: ptr rocksdb_comparator_t, -): ptr rocksdb_sstfilewriter_t {. - cdecl, importc: "rocksdb_sstfilewriter_create_with_comparator", dynlib: librocksdb -.} - -proc rocksdb_sstfilewriter_open*( - writer: ptr rocksdb_sstfilewriter_t, name: cstring, errptr: cstringArray -) {.cdecl, importc: "rocksdb_sstfilewriter_open", dynlib: librocksdb.} - -proc rocksdb_sstfilewriter_add*( - writer: ptr rocksdb_sstfilewriter_t, - key: cstring, - keylen: csize_t, - val: cstring, - vallen: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_sstfilewriter_add", dynlib: librocksdb.} - -proc rocksdb_sstfilewriter_put*( - writer: ptr rocksdb_sstfilewriter_t, - key: cstring, - keylen: csize_t, - val: cstring, - vallen: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_sstfilewriter_put", dynlib: librocksdb.} - -proc rocksdb_sstfilewriter_put_with_ts*( - writer: ptr rocksdb_sstfilewriter_t, - key: cstring, - keylen: csize_t, - ts: cstring, - tslen: csize_t, - val: cstring, - vallen: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_sstfilewriter_put_with_ts", dynlib: librocksdb.} - -proc rocksdb_sstfilewriter_merge*( - writer: ptr rocksdb_sstfilewriter_t, - key: cstring, - keylen: csize_t, - val: cstring, - vallen: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_sstfilewriter_merge", dynlib: librocksdb.} - -proc rocksdb_sstfilewriter_delete*( - writer: ptr rocksdb_sstfilewriter_t, - key: cstring, - keylen: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_sstfilewriter_delete", dynlib: librocksdb.} - -proc rocksdb_sstfilewriter_delete_with_ts*( - writer: ptr rocksdb_sstfilewriter_t, - key: cstring, - keylen: csize_t, - ts: cstring, - tslen: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_sstfilewriter_delete_with_ts", dynlib: librocksdb.} - -proc rocksdb_sstfilewriter_delete_range*( - writer: ptr rocksdb_sstfilewriter_t, - begin_key: cstring, - begin_keylen: csize_t, - end_key: cstring, - end_keylen: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_sstfilewriter_delete_range", dynlib: librocksdb.} - -proc rocksdb_sstfilewriter_finish*( - writer: ptr rocksdb_sstfilewriter_t, errptr: cstringArray -) {.cdecl, importc: "rocksdb_sstfilewriter_finish", dynlib: librocksdb.} - -proc rocksdb_sstfilewriter_file_size*( - writer: ptr rocksdb_sstfilewriter_t, file_size: ptr uint64 -) {.cdecl, importc: "rocksdb_sstfilewriter_file_size", dynlib: librocksdb.} - -proc rocksdb_sstfilewriter_destroy*( - writer: ptr rocksdb_sstfilewriter_t -) {.cdecl, importc: "rocksdb_sstfilewriter_destroy", dynlib: librocksdb.} - +proc rocksdb_sstfilewriter_create*(env: ptr rocksdb_envoptions_t; + io_options: ptr rocksdb_options_t): ptr rocksdb_sstfilewriter_t {. + cdecl.} +proc rocksdb_sstfilewriter_create_with_comparator*(env: ptr rocksdb_envoptions_t; + io_options: ptr rocksdb_options_t; comparator: ptr rocksdb_comparator_t): ptr rocksdb_sstfilewriter_t {. + cdecl.} +proc rocksdb_sstfilewriter_open*(writer: ptr rocksdb_sstfilewriter_t; name: cstring; + errptr: cstringArray) {.cdecl.} +proc rocksdb_sstfilewriter_add*(writer: ptr rocksdb_sstfilewriter_t; key: cstring; + keylen: csize_t; val: cstring; vallen: csize_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_sstfilewriter_put*(writer: ptr rocksdb_sstfilewriter_t; key: cstring; + keylen: csize_t; val: cstring; vallen: csize_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_sstfilewriter_put_with_ts*(writer: ptr rocksdb_sstfilewriter_t; + key: cstring; keylen: csize_t; ts: cstring; + tslen: csize_t; val: cstring; + vallen: csize_t; errptr: cstringArray) {. + cdecl.} +proc rocksdb_sstfilewriter_merge*(writer: ptr rocksdb_sstfilewriter_t; key: cstring; + keylen: csize_t; val: cstring; vallen: csize_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_sstfilewriter_delete*(writer: ptr rocksdb_sstfilewriter_t; + key: cstring; keylen: csize_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_sstfilewriter_delete_with_ts*(writer: ptr rocksdb_sstfilewriter_t; + key: cstring; keylen: csize_t; ts: cstring; tslen: csize_t; errptr: cstringArray) {. + cdecl.} +proc rocksdb_sstfilewriter_delete_range*(writer: ptr rocksdb_sstfilewriter_t; + begin_key: cstring; begin_keylen: csize_t; + end_key: cstring; end_keylen: csize_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_sstfilewriter_finish*(writer: ptr rocksdb_sstfilewriter_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_sstfilewriter_file_size*(writer: ptr rocksdb_sstfilewriter_t; + file_size: ptr uint64) {.cdecl.} +proc rocksdb_sstfilewriter_destroy*(writer: ptr rocksdb_sstfilewriter_t) {.cdecl.} proc rocksdb_ingestexternalfileoptions_create*(): ptr rocksdb_ingestexternalfileoptions_t {. - cdecl, importc: "rocksdb_ingestexternalfileoptions_create", dynlib: librocksdb -.} - + cdecl.} proc rocksdb_ingestexternalfileoptions_set_move_files*( - opt: ptr rocksdb_ingestexternalfileoptions_t, move_files: uint8 -) {. - cdecl, importc: "rocksdb_ingestexternalfileoptions_set_move_files", dynlib: librocksdb -.} - + opt: ptr rocksdb_ingestexternalfileoptions_t; move_files: uint8) {.cdecl.} proc rocksdb_ingestexternalfileoptions_set_snapshot_consistency*( - opt: ptr rocksdb_ingestexternalfileoptions_t, snapshot_consistency: uint8 -) {. - cdecl, - importc: "rocksdb_ingestexternalfileoptions_set_snapshot_consistency", - dynlib: librocksdb -.} - + opt: ptr rocksdb_ingestexternalfileoptions_t; snapshot_consistency: uint8) {. + cdecl.} proc rocksdb_ingestexternalfileoptions_set_allow_global_seqno*( - opt: ptr rocksdb_ingestexternalfileoptions_t, allow_global_seqno: uint8 -) {. - cdecl, - importc: "rocksdb_ingestexternalfileoptions_set_allow_global_seqno", - dynlib: librocksdb -.} - + opt: ptr rocksdb_ingestexternalfileoptions_t; allow_global_seqno: uint8) {.cdecl.} proc rocksdb_ingestexternalfileoptions_set_allow_blocking_flush*( - opt: ptr rocksdb_ingestexternalfileoptions_t, allow_blocking_flush: uint8 -) {. - cdecl, - importc: "rocksdb_ingestexternalfileoptions_set_allow_blocking_flush", - dynlib: librocksdb -.} - + opt: ptr rocksdb_ingestexternalfileoptions_t; allow_blocking_flush: uint8) {. + cdecl.} proc rocksdb_ingestexternalfileoptions_set_ingest_behind*( - opt: ptr rocksdb_ingestexternalfileoptions_t, ingest_behind: uint8 -) {. - cdecl, - importc: "rocksdb_ingestexternalfileoptions_set_ingest_behind", - dynlib: librocksdb -.} - + opt: ptr rocksdb_ingestexternalfileoptions_t; ingest_behind: uint8) {.cdecl.} proc rocksdb_ingestexternalfileoptions_set_fail_if_not_bottommost_level*( - opt: ptr rocksdb_ingestexternalfileoptions_t, fail_if_not_bottommost_level: uint8 -) {. - cdecl, - importc: "rocksdb_ingestexternalfileoptions_set_fail_if_not_bottommost_level", - dynlib: librocksdb -.} - + opt: ptr rocksdb_ingestexternalfileoptions_t; + fail_if_not_bottommost_level: uint8) {.cdecl.} proc rocksdb_ingestexternalfileoptions_destroy*( - opt: ptr rocksdb_ingestexternalfileoptions_t -) {.cdecl, importc: "rocksdb_ingestexternalfileoptions_destroy", dynlib: librocksdb.} - -proc rocksdb_ingest_external_file*( - db: ptr rocksdb_t, - file_list: cstringArray, - list_len: csize_t, - opt: ptr rocksdb_ingestexternalfileoptions_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_ingest_external_file", dynlib: librocksdb.} - -proc rocksdb_ingest_external_file_cf*( - db: ptr rocksdb_t, - handle: ptr rocksdb_column_family_handle_t, - file_list: cstringArray, - list_len: csize_t, - opt: ptr rocksdb_ingestexternalfileoptions_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_ingest_external_file_cf", dynlib: librocksdb.} - -proc rocksdb_try_catch_up_with_primary*( - db: ptr rocksdb_t, errptr: cstringArray -) {.cdecl, importc: "rocksdb_try_catch_up_with_primary", dynlib: librocksdb.} - + opt: ptr rocksdb_ingestexternalfileoptions_t) {.cdecl.} +proc rocksdb_ingest_external_file*(db: ptr rocksdb_t; file_list: cstringArray; + list_len: csize_t; + opt: ptr rocksdb_ingestexternalfileoptions_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_ingest_external_file_cf*(db: ptr rocksdb_t; handle: ptr rocksdb_column_family_handle_t; + file_list: cstringArray; list_len: csize_t; opt: ptr rocksdb_ingestexternalfileoptions_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_try_catch_up_with_primary*(db: ptr rocksdb_t; errptr: cstringArray) {. + cdecl.} ## SliceTransform -proc rocksdb_slicetransform_create*( - state: pointer, - destructor: proc(a1: pointer) {.cdecl.}, - transform: proc( - a1: pointer, key: cstring, length: csize_t, dst_length: ptr csize_t - ): cstring {.cdecl.}, - in_domain: proc(a1: pointer, key: cstring, length: csize_t): uint8 {.cdecl.}, - in_range: proc(a1: pointer, key: cstring, length: csize_t): uint8 {.cdecl.}, - name: proc(a1: pointer): cstring {.cdecl.}, -): ptr rocksdb_slicetransform_t {. - cdecl, importc: "rocksdb_slicetransform_create", dynlib: librocksdb -.} - -proc rocksdb_slicetransform_create_fixed_prefix*( - a1: csize_t -): ptr rocksdb_slicetransform_t {. - cdecl, importc: "rocksdb_slicetransform_create_fixed_prefix", dynlib: librocksdb -.} - -proc rocksdb_slicetransform_create_noop*(): ptr rocksdb_slicetransform_t {. - cdecl, importc: "rocksdb_slicetransform_create_noop", dynlib: librocksdb -.} - -proc rocksdb_slicetransform_destroy*( - a1: ptr rocksdb_slicetransform_t -) {.cdecl, importc: "rocksdb_slicetransform_destroy", dynlib: librocksdb.} - +proc rocksdb_slicetransform_create*(state: pointer; + destructor: proc (a1: pointer) {.cdecl.}; + transform: proc (a1: pointer; key: cstring; length: csize_t; dst_length: ptr csize_t): cstring {. + cdecl.}; in_domain: proc (a1: pointer; key: cstring; length: csize_t): uint8 {.cdecl.}; + in_range: proc (a1: pointer; key: cstring; length: csize_t): uint8 {.cdecl.}; + name: proc (a1: pointer): cstring {.cdecl.}): ptr rocksdb_slicetransform_t {. + cdecl.} +proc rocksdb_slicetransform_create_fixed_prefix*(a1: csize_t): ptr rocksdb_slicetransform_t {. + cdecl.} +proc rocksdb_slicetransform_create_noop*(): ptr rocksdb_slicetransform_t {.cdecl.} +proc rocksdb_slicetransform_destroy*(a1: ptr rocksdb_slicetransform_t) {.cdecl.} ## Universal Compaction options const @@ -4641,227 +1890,79 @@ const rocksdb_total_size_compaction_stop_style* = 1 proc rocksdb_universal_compaction_options_create*(): ptr rocksdb_universal_compaction_options_t {. - cdecl, importc: "rocksdb_universal_compaction_options_create", dynlib: librocksdb -.} - + cdecl.} proc rocksdb_universal_compaction_options_set_size_ratio*( - a1: ptr rocksdb_universal_compaction_options_t, a2: cint -) {. - cdecl, - importc: "rocksdb_universal_compaction_options_set_size_ratio", - dynlib: librocksdb -.} - + a1: ptr rocksdb_universal_compaction_options_t; a2: cint) {.cdecl.} proc rocksdb_universal_compaction_options_get_size_ratio*( - a1: ptr rocksdb_universal_compaction_options_t -): cint {. - cdecl, - importc: "rocksdb_universal_compaction_options_get_size_ratio", - dynlib: librocksdb -.} - + a1: ptr rocksdb_universal_compaction_options_t): cint {.cdecl.} proc rocksdb_universal_compaction_options_set_min_merge_width*( - a1: ptr rocksdb_universal_compaction_options_t, a2: cint -) {. - cdecl, - importc: "rocksdb_universal_compaction_options_set_min_merge_width", - dynlib: librocksdb -.} - + a1: ptr rocksdb_universal_compaction_options_t; a2: cint) {.cdecl.} proc rocksdb_universal_compaction_options_get_min_merge_width*( - a1: ptr rocksdb_universal_compaction_options_t -): cint {. - cdecl, - importc: "rocksdb_universal_compaction_options_get_min_merge_width", - dynlib: librocksdb -.} - + a1: ptr rocksdb_universal_compaction_options_t): cint {.cdecl.} proc rocksdb_universal_compaction_options_set_max_merge_width*( - a1: ptr rocksdb_universal_compaction_options_t, a2: cint -) {. - cdecl, - importc: "rocksdb_universal_compaction_options_set_max_merge_width", - dynlib: librocksdb -.} - + a1: ptr rocksdb_universal_compaction_options_t; a2: cint) {.cdecl.} proc rocksdb_universal_compaction_options_get_max_merge_width*( - a1: ptr rocksdb_universal_compaction_options_t -): cint {. - cdecl, - importc: "rocksdb_universal_compaction_options_get_max_merge_width", - dynlib: librocksdb -.} - + a1: ptr rocksdb_universal_compaction_options_t): cint {.cdecl.} proc rocksdb_universal_compaction_options_set_max_size_amplification_percent*( - a1: ptr rocksdb_universal_compaction_options_t, a2: cint -) {. - cdecl, - importc: "rocksdb_universal_compaction_options_set_max_size_amplification_percent", - dynlib: librocksdb -.} - + a1: ptr rocksdb_universal_compaction_options_t; a2: cint) {.cdecl.} proc rocksdb_universal_compaction_options_get_max_size_amplification_percent*( - a1: ptr rocksdb_universal_compaction_options_t -): cint {. - cdecl, - importc: "rocksdb_universal_compaction_options_get_max_size_amplification_percent", - dynlib: librocksdb -.} - + a1: ptr rocksdb_universal_compaction_options_t): cint {.cdecl.} proc rocksdb_universal_compaction_options_set_compression_size_percent*( - a1: ptr rocksdb_universal_compaction_options_t, a2: cint -) {. - cdecl, - importc: "rocksdb_universal_compaction_options_set_compression_size_percent", - dynlib: librocksdb -.} - + a1: ptr rocksdb_universal_compaction_options_t; a2: cint) {.cdecl.} proc rocksdb_universal_compaction_options_get_compression_size_percent*( - a1: ptr rocksdb_universal_compaction_options_t -): cint {. - cdecl, - importc: "rocksdb_universal_compaction_options_get_compression_size_percent", - dynlib: librocksdb -.} - + a1: ptr rocksdb_universal_compaction_options_t): cint {.cdecl.} proc rocksdb_universal_compaction_options_set_stop_style*( - a1: ptr rocksdb_universal_compaction_options_t, a2: cint -) {. - cdecl, - importc: "rocksdb_universal_compaction_options_set_stop_style", - dynlib: librocksdb -.} - + a1: ptr rocksdb_universal_compaction_options_t; a2: cint) {.cdecl.} proc rocksdb_universal_compaction_options_get_stop_style*( - a1: ptr rocksdb_universal_compaction_options_t -): cint {. - cdecl, - importc: "rocksdb_universal_compaction_options_get_stop_style", - dynlib: librocksdb -.} - + a1: ptr rocksdb_universal_compaction_options_t): cint {.cdecl.} proc rocksdb_universal_compaction_options_destroy*( - a1: ptr rocksdb_universal_compaction_options_t -) {.cdecl, importc: "rocksdb_universal_compaction_options_destroy", dynlib: librocksdb.} - + a1: ptr rocksdb_universal_compaction_options_t) {.cdecl.} proc rocksdb_fifo_compaction_options_create*(): ptr rocksdb_fifo_compaction_options_t {. - cdecl, importc: "rocksdb_fifo_compaction_options_create", dynlib: librocksdb -.} - + cdecl.} proc rocksdb_fifo_compaction_options_set_allow_compaction*( - fifo_opts: ptr rocksdb_fifo_compaction_options_t, allow_compaction: uint8 -) {. - cdecl, - importc: "rocksdb_fifo_compaction_options_set_allow_compaction", - dynlib: librocksdb -.} - + fifo_opts: ptr rocksdb_fifo_compaction_options_t; allow_compaction: uint8) {. + cdecl.} proc rocksdb_fifo_compaction_options_get_allow_compaction*( - fifo_opts: ptr rocksdb_fifo_compaction_options_t -): uint8 {. - cdecl, - importc: "rocksdb_fifo_compaction_options_get_allow_compaction", - dynlib: librocksdb -.} - + fifo_opts: ptr rocksdb_fifo_compaction_options_t): uint8 {.cdecl.} proc rocksdb_fifo_compaction_options_set_max_table_files_size*( - fifo_opts: ptr rocksdb_fifo_compaction_options_t, size: uint64 -) {. - cdecl, - importc: "rocksdb_fifo_compaction_options_set_max_table_files_size", - dynlib: librocksdb -.} - + fifo_opts: ptr rocksdb_fifo_compaction_options_t; size: uint64) {.cdecl.} proc rocksdb_fifo_compaction_options_get_max_table_files_size*( - fifo_opts: ptr rocksdb_fifo_compaction_options_t -): uint64 {. - cdecl, - importc: "rocksdb_fifo_compaction_options_get_max_table_files_size", - dynlib: librocksdb -.} - + fifo_opts: ptr rocksdb_fifo_compaction_options_t): uint64 {.cdecl.} proc rocksdb_fifo_compaction_options_destroy*( - fifo_opts: ptr rocksdb_fifo_compaction_options_t -) {.cdecl, importc: "rocksdb_fifo_compaction_options_destroy", dynlib: librocksdb.} - -proc rocksdb_livefiles_count*( - a1: ptr rocksdb_livefiles_t -): cint {.cdecl, importc: "rocksdb_livefiles_count", dynlib: librocksdb.} - -proc rocksdb_livefiles_column_family_name*( - a1: ptr rocksdb_livefiles_t, index: cint -): cstring {. - cdecl, importc: "rocksdb_livefiles_column_family_name", dynlib: librocksdb -.} - -proc rocksdb_livefiles_name*( - a1: ptr rocksdb_livefiles_t, index: cint -): cstring {.cdecl, importc: "rocksdb_livefiles_name", dynlib: librocksdb.} - -proc rocksdb_livefiles_level*( - a1: ptr rocksdb_livefiles_t, index: cint -): cint {.cdecl, importc: "rocksdb_livefiles_level", dynlib: librocksdb.} - -proc rocksdb_livefiles_size*( - a1: ptr rocksdb_livefiles_t, index: cint -): csize_t {.cdecl, importc: "rocksdb_livefiles_size", dynlib: librocksdb.} - -proc rocksdb_livefiles_smallestkey*( - a1: ptr rocksdb_livefiles_t, index: cint, size: ptr csize_t -): cstring {.cdecl, importc: "rocksdb_livefiles_smallestkey", dynlib: librocksdb.} - -proc rocksdb_livefiles_largestkey*( - a1: ptr rocksdb_livefiles_t, index: cint, size: ptr csize_t -): cstring {.cdecl, importc: "rocksdb_livefiles_largestkey", dynlib: librocksdb.} - -proc rocksdb_livefiles_entries*( - a1: ptr rocksdb_livefiles_t, index: cint -): uint64 {.cdecl, importc: "rocksdb_livefiles_entries", dynlib: librocksdb.} - -proc rocksdb_livefiles_deletions*( - a1: ptr rocksdb_livefiles_t, index: cint -): uint64 {.cdecl, importc: "rocksdb_livefiles_deletions", dynlib: librocksdb.} - -proc rocksdb_livefiles_destroy*( - a1: ptr rocksdb_livefiles_t -) {.cdecl, importc: "rocksdb_livefiles_destroy", dynlib: librocksdb.} - + fifo_opts: ptr rocksdb_fifo_compaction_options_t) {.cdecl.} +proc rocksdb_livefiles_count*(a1: ptr rocksdb_livefiles_t): cint {.cdecl.} +proc rocksdb_livefiles_column_family_name*(a1: ptr rocksdb_livefiles_t; index: cint): cstring {. + cdecl.} +proc rocksdb_livefiles_name*(a1: ptr rocksdb_livefiles_t; index: cint): cstring {.cdecl.} +proc rocksdb_livefiles_level*(a1: ptr rocksdb_livefiles_t; index: cint): cint {.cdecl.} +proc rocksdb_livefiles_size*(a1: ptr rocksdb_livefiles_t; index: cint): csize_t {.cdecl.} +proc rocksdb_livefiles_smallestkey*(a1: ptr rocksdb_livefiles_t; index: cint; + size: ptr csize_t): cstring {.cdecl.} +proc rocksdb_livefiles_largestkey*(a1: ptr rocksdb_livefiles_t; index: cint; + size: ptr csize_t): cstring {.cdecl.} +proc rocksdb_livefiles_entries*(a1: ptr rocksdb_livefiles_t; index: cint): uint64 {. + cdecl.} +proc rocksdb_livefiles_deletions*(a1: ptr rocksdb_livefiles_t; index: cint): uint64 {. + cdecl.} +proc rocksdb_livefiles_destroy*(a1: ptr rocksdb_livefiles_t) {.cdecl.} ## Utility Helpers -proc rocksdb_get_options_from_string*( - base_options: ptr rocksdb_options_t, - opts_str: cstring, - new_options: ptr rocksdb_options_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_get_options_from_string", dynlib: librocksdb.} - -proc rocksdb_delete_file_in_range*( - db: ptr rocksdb_t, - start_key: cstring, - start_key_len: csize_t, - limit_key: cstring, - limit_key_len: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_delete_file_in_range", dynlib: librocksdb.} - -proc rocksdb_delete_file_in_range_cf*( - db: ptr rocksdb_t, - column_family: ptr rocksdb_column_family_handle_t, - start_key: cstring, - start_key_len: csize_t, - limit_key: cstring, - limit_key_len: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_delete_file_in_range_cf", dynlib: librocksdb.} - +proc rocksdb_get_options_from_string*(base_options: ptr rocksdb_options_t; + opts_str: cstring; + new_options: ptr rocksdb_options_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_delete_file_in_range*(db: ptr rocksdb_t; start_key: cstring; + start_key_len: csize_t; limit_key: cstring; + limit_key_len: csize_t; errptr: cstringArray) {. + cdecl.} +proc rocksdb_delete_file_in_range_cf*(db: ptr rocksdb_t; column_family: ptr rocksdb_column_family_handle_t; + start_key: cstring; start_key_len: csize_t; + limit_key: cstring; limit_key_len: csize_t; + errptr: cstringArray) {.cdecl.} ## MetaData -proc rocksdb_get_column_family_metadata*( - db: ptr rocksdb_t -): ptr rocksdb_column_family_metadata_t {. - cdecl, importc: "rocksdb_get_column_family_metadata", dynlib: librocksdb -.} - +proc rocksdb_get_column_family_metadata*(db: ptr rocksdb_t): ptr rocksdb_column_family_metadata_t {. + cdecl.} ## ## Returns the rocksdb_column_family_metadata_t of the specified ## column family. @@ -4870,40 +1971,19 @@ proc rocksdb_get_column_family_metadata*( ## using rocksdb_column_family_metadata_destroy. ## -proc rocksdb_get_column_family_metadata_cf*( - db: ptr rocksdb_t, column_family: ptr rocksdb_column_family_handle_t -): ptr rocksdb_column_family_metadata_t {. - cdecl, importc: "rocksdb_get_column_family_metadata_cf", dynlib: librocksdb -.} - +proc rocksdb_get_column_family_metadata_cf*(db: ptr rocksdb_t; + column_family: ptr rocksdb_column_family_handle_t): ptr rocksdb_column_family_metadata_t {. + cdecl.} proc rocksdb_column_family_metadata_destroy*( - cf_meta: ptr rocksdb_column_family_metadata_t -) {.cdecl, importc: "rocksdb_column_family_metadata_destroy", dynlib: librocksdb.} - + cf_meta: ptr rocksdb_column_family_metadata_t) {.cdecl.} proc rocksdb_column_family_metadata_get_size*( - cf_meta: ptr rocksdb_column_family_metadata_t -): uint64 {. - cdecl, importc: "rocksdb_column_family_metadata_get_size", dynlib: librocksdb -.} - + cf_meta: ptr rocksdb_column_family_metadata_t): uint64 {.cdecl.} proc rocksdb_column_family_metadata_get_file_count*( - cf_meta: ptr rocksdb_column_family_metadata_t -): csize_t {. - cdecl, importc: "rocksdb_column_family_metadata_get_file_count", dynlib: librocksdb -.} - + cf_meta: ptr rocksdb_column_family_metadata_t): csize_t {.cdecl.} proc rocksdb_column_family_metadata_get_name*( - cf_meta: ptr rocksdb_column_family_metadata_t -): cstring {. - cdecl, importc: "rocksdb_column_family_metadata_get_name", dynlib: librocksdb -.} - + cf_meta: ptr rocksdb_column_family_metadata_t): cstring {.cdecl.} proc rocksdb_column_family_metadata_get_level_count*( - cf_meta: ptr rocksdb_column_family_metadata_t -): csize_t {. - cdecl, importc: "rocksdb_column_family_metadata_get_level_count", dynlib: librocksdb -.} - + cf_meta: ptr rocksdb_column_family_metadata_t): csize_t {.cdecl.} ## ## Returns the rocksdb_level_metadata_t of the ith level from the specified ## column family metadata. @@ -4917,13 +1997,8 @@ proc rocksdb_column_family_metadata_get_level_count*( ## proc rocksdb_column_family_metadata_get_level_metadata*( - cf_meta: ptr rocksdb_column_family_metadata_t, i: csize_t -): ptr rocksdb_level_metadata_t {. - cdecl, - importc: "rocksdb_column_family_metadata_get_level_metadata", - dynlib: librocksdb -.} - + cf_meta: ptr rocksdb_column_family_metadata_t; i: csize_t): ptr rocksdb_level_metadata_t {. + cdecl.} ## ## Releases the specified rocksdb_level_metadata_t. ## @@ -4931,24 +2006,14 @@ proc rocksdb_column_family_metadata_get_level_metadata*( ## before the release of its parent rocksdb_column_family_metadata_t. ## -proc rocksdb_level_metadata_destroy*( - level_meta: ptr rocksdb_level_metadata_t -) {.cdecl, importc: "rocksdb_level_metadata_destroy", dynlib: librocksdb.} - -proc rocksdb_level_metadata_get_level*( - level_meta: ptr rocksdb_level_metadata_t -): cint {.cdecl, importc: "rocksdb_level_metadata_get_level", dynlib: librocksdb.} - -proc rocksdb_level_metadata_get_size*( - level_meta: ptr rocksdb_level_metadata_t -): uint64 {.cdecl, importc: "rocksdb_level_metadata_get_size", dynlib: librocksdb.} - +proc rocksdb_level_metadata_destroy*(level_meta: ptr rocksdb_level_metadata_t) {. + cdecl.} +proc rocksdb_level_metadata_get_level*(level_meta: ptr rocksdb_level_metadata_t): cint {. + cdecl.} +proc rocksdb_level_metadata_get_size*(level_meta: ptr rocksdb_level_metadata_t): uint64 {. + cdecl.} proc rocksdb_level_metadata_get_file_count*( - level_meta: ptr rocksdb_level_metadata_t -): csize_t {. - cdecl, importc: "rocksdb_level_metadata_get_file_count", dynlib: librocksdb -.} - + level_meta: ptr rocksdb_level_metadata_t): csize_t {.cdecl.} ## ## Returns the sst_file_metadata_t of the ith file from the specified level ## metadata. @@ -4962,11 +2027,8 @@ proc rocksdb_level_metadata_get_file_count*( ## proc rocksdb_level_metadata_get_sst_file_metadata*( - level_meta: ptr rocksdb_level_metadata_t, i: csize_t -): ptr rocksdb_sst_file_metadata_t {. - cdecl, importc: "rocksdb_level_metadata_get_sst_file_metadata", dynlib: librocksdb -.} - + level_meta: ptr rocksdb_level_metadata_t; i: csize_t): ptr rocksdb_sst_file_metadata_t {. + cdecl.} ## ## Releases the specified rocksdb_sst_file_metadata_t. ## @@ -4974,26 +2036,14 @@ proc rocksdb_level_metadata_get_sst_file_metadata*( ## before the release of its parent rocksdb_level_metadata_t. ## -proc rocksdb_sst_file_metadata_destroy*( - file_meta: ptr rocksdb_sst_file_metadata_t -) {.cdecl, importc: "rocksdb_sst_file_metadata_destroy", dynlib: librocksdb.} - +proc rocksdb_sst_file_metadata_destroy*(file_meta: ptr rocksdb_sst_file_metadata_t) {. + cdecl.} proc rocksdb_sst_file_metadata_get_relative_filename*( - file_meta: ptr rocksdb_sst_file_metadata_t -): cstring {. - cdecl, importc: "rocksdb_sst_file_metadata_get_relative_filename", dynlib: librocksdb -.} - + file_meta: ptr rocksdb_sst_file_metadata_t): cstring {.cdecl.} proc rocksdb_sst_file_metadata_get_directory*( - file_meta: ptr rocksdb_sst_file_metadata_t -): cstring {. - cdecl, importc: "rocksdb_sst_file_metadata_get_directory", dynlib: librocksdb -.} - -proc rocksdb_sst_file_metadata_get_size*( - file_meta: ptr rocksdb_sst_file_metadata_t -): uint64 {.cdecl, importc: "rocksdb_sst_file_metadata_get_size", dynlib: librocksdb.} - + file_meta: ptr rocksdb_sst_file_metadata_t): cstring {.cdecl.} +proc rocksdb_sst_file_metadata_get_size*(file_meta: ptr rocksdb_sst_file_metadata_t): uint64 {. + cdecl.} ## ## Returns the smallest key of the specified sst file. ## The caller is responsible for releasing the returned memory. @@ -5004,11 +2054,7 @@ proc rocksdb_sst_file_metadata_get_size*( ## proc rocksdb_sst_file_metadata_get_smallestkey*( - file_meta: ptr rocksdb_sst_file_metadata_t, len: ptr csize_t -): cstring {. - cdecl, importc: "rocksdb_sst_file_metadata_get_smallestkey", dynlib: librocksdb -.} - + file_meta: ptr rocksdb_sst_file_metadata_t; len: ptr csize_t): cstring {.cdecl.} ## ## Returns the smallest key of the specified sst file. ## The caller is responsible for releasing the returned memory. @@ -5019,943 +2065,392 @@ proc rocksdb_sst_file_metadata_get_smallestkey*( ## proc rocksdb_sst_file_metadata_get_largestkey*( - file_meta: ptr rocksdb_sst_file_metadata_t, len: ptr csize_t -): cstring {. - cdecl, importc: "rocksdb_sst_file_metadata_get_largestkey", dynlib: librocksdb -.} - + file_meta: ptr rocksdb_sst_file_metadata_t; len: ptr csize_t): cstring {.cdecl.} ## Transactions proc rocksdb_transactiondb_create_column_family*( - txn_db: ptr rocksdb_transactiondb_t, - column_family_options: ptr rocksdb_options_t, - column_family_name: cstring, - errptr: cstringArray, -): ptr rocksdb_column_family_handle_t {. - cdecl, importc: "rocksdb_transactiondb_create_column_family", dynlib: librocksdb -.} - -proc rocksdb_transactiondb_open*( - options: ptr rocksdb_options_t, - txn_db_options: ptr rocksdb_transactiondb_options_t, - name: cstring, - errptr: cstringArray, -): ptr rocksdb_transactiondb_t {. - cdecl, importc: "rocksdb_transactiondb_open", dynlib: librocksdb -.} - -proc rocksdb_transactiondb_open_column_families*( - options: ptr rocksdb_options_t, - txn_db_options: ptr rocksdb_transactiondb_options_t, - name: cstring, - num_column_families: cint, - column_family_names: cstringArray, - column_family_options: ptr ptr rocksdb_options_t, - column_family_handles: ptr ptr rocksdb_column_family_handle_t, - errptr: cstringArray, -): ptr rocksdb_transactiondb_t {. - cdecl, importc: "rocksdb_transactiondb_open_column_families", dynlib: librocksdb -.} - -proc rocksdb_transactiondb_create_snapshot*( - txn_db: ptr rocksdb_transactiondb_t -): ptr rocksdb_snapshot_t {. - cdecl, importc: "rocksdb_transactiondb_create_snapshot", dynlib: librocksdb -.} - -proc rocksdb_transactiondb_release_snapshot*( - txn_db: ptr rocksdb_transactiondb_t, snapshot: ptr rocksdb_snapshot_t -) {.cdecl, importc: "rocksdb_transactiondb_release_snapshot", dynlib: librocksdb.} - -proc rocksdb_transactiondb_property_value*( - db: ptr rocksdb_transactiondb_t, propname: cstring -): cstring {. - cdecl, importc: "rocksdb_transactiondb_property_value", dynlib: librocksdb -.} - -proc rocksdb_transactiondb_property_int*( - db: ptr rocksdb_transactiondb_t, propname: cstring, out_val: ptr uint64 -): cint {.cdecl, importc: "rocksdb_transactiondb_property_int", dynlib: librocksdb.} - -proc rocksdb_transactiondb_get_base_db*( - txn_db: ptr rocksdb_transactiondb_t -): ptr rocksdb_t {. - cdecl, importc: "rocksdb_transactiondb_get_base_db", dynlib: librocksdb -.} - -proc rocksdb_transactiondb_close_base_db*( - base_db: ptr rocksdb_t -) {.cdecl, importc: "rocksdb_transactiondb_close_base_db", dynlib: librocksdb.} - -proc rocksdb_transaction_begin*( - txn_db: ptr rocksdb_transactiondb_t, - write_options: ptr rocksdb_writeoptions_t, - txn_options: ptr rocksdb_transaction_options_t, - old_txn: ptr rocksdb_transaction_t, -): ptr rocksdb_transaction_t {. - cdecl, importc: "rocksdb_transaction_begin", dynlib: librocksdb -.} - + txn_db: ptr rocksdb_transactiondb_t; + column_family_options: ptr rocksdb_options_t; column_family_name: cstring; + errptr: cstringArray): ptr rocksdb_column_family_handle_t {.cdecl.} +proc rocksdb_transactiondb_open*(options: ptr rocksdb_options_t; txn_db_options: ptr rocksdb_transactiondb_options_t; + name: cstring; errptr: cstringArray): ptr rocksdb_transactiondb_t {. + cdecl.} +proc rocksdb_transactiondb_open_column_families*(options: ptr rocksdb_options_t; + txn_db_options: ptr rocksdb_transactiondb_options_t; name: cstring; + num_column_families: cint; column_family_names: cstringArray; + column_family_options: ptr ptr rocksdb_options_t; + column_family_handles: ptr ptr rocksdb_column_family_handle_t; + errptr: cstringArray): ptr rocksdb_transactiondb_t {.cdecl.} +proc rocksdb_transactiondb_create_snapshot*(txn_db: ptr rocksdb_transactiondb_t): ptr rocksdb_snapshot_t {. + cdecl.} +proc rocksdb_transactiondb_release_snapshot*(txn_db: ptr rocksdb_transactiondb_t; + snapshot: ptr rocksdb_snapshot_t) {.cdecl.} +proc rocksdb_transactiondb_property_value*(db: ptr rocksdb_transactiondb_t; + propname: cstring): cstring {.cdecl.} +proc rocksdb_transactiondb_property_int*(db: ptr rocksdb_transactiondb_t; + propname: cstring; out_val: ptr uint64): cint {. + cdecl.} +proc rocksdb_transactiondb_get_base_db*(txn_db: ptr rocksdb_transactiondb_t): ptr rocksdb_t {. + cdecl.} +proc rocksdb_transactiondb_close_base_db*(base_db: ptr rocksdb_t) {.cdecl.} +proc rocksdb_transaction_begin*(txn_db: ptr rocksdb_transactiondb_t; + write_options: ptr rocksdb_writeoptions_t; + txn_options: ptr rocksdb_transaction_options_t; + old_txn: ptr rocksdb_transaction_t): ptr rocksdb_transaction_t {. + cdecl.} proc rocksdb_transactiondb_get_prepared_transactions*( - txn_db: ptr rocksdb_transactiondb_t, cnt: ptr csize_t -): ptr ptr rocksdb_transaction_t {. - cdecl, importc: "rocksdb_transactiondb_get_prepared_transactions", dynlib: librocksdb -.} - -proc rocksdb_transaction_set_name*( - txn: ptr rocksdb_transaction_t, name: cstring, name_len: csize_t, errptr: cstringArray -) {.cdecl, importc: "rocksdb_transaction_set_name", dynlib: librocksdb.} - -proc rocksdb_transaction_get_name*( - txn: ptr rocksdb_transaction_t, name_len: ptr csize_t -): cstring {.cdecl, importc: "rocksdb_transaction_get_name", dynlib: librocksdb.} - -proc rocksdb_transaction_prepare*( - txn: ptr rocksdb_transaction_t, errptr: cstringArray -) {.cdecl, importc: "rocksdb_transaction_prepare", dynlib: librocksdb.} - -proc rocksdb_transaction_commit*( - txn: ptr rocksdb_transaction_t, errptr: cstringArray -) {.cdecl, importc: "rocksdb_transaction_commit", dynlib: librocksdb.} - -proc rocksdb_transaction_rollback*( - txn: ptr rocksdb_transaction_t, errptr: cstringArray -) {.cdecl, importc: "rocksdb_transaction_rollback", dynlib: librocksdb.} - -proc rocksdb_transaction_set_savepoint*( - txn: ptr rocksdb_transaction_t -) {.cdecl, importc: "rocksdb_transaction_set_savepoint", dynlib: librocksdb.} - -proc rocksdb_transaction_rollback_to_savepoint*( - txn: ptr rocksdb_transaction_t, errptr: cstringArray -) {.cdecl, importc: "rocksdb_transaction_rollback_to_savepoint", dynlib: librocksdb.} - -proc rocksdb_transaction_destroy*( - txn: ptr rocksdb_transaction_t -) {.cdecl, importc: "rocksdb_transaction_destroy", dynlib: librocksdb.} - -proc rocksdb_transaction_get_writebatch_wi*( - txn: ptr rocksdb_transaction_t -): ptr rocksdb_writebatch_wi_t {. - cdecl, importc: "rocksdb_transaction_get_writebatch_wi", dynlib: librocksdb -.} - -proc rocksdb_transaction_rebuild_from_writebatch*( - txn: ptr rocksdb_transaction_t, - writebatch: ptr rocksdb_writebatch_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_transaction_rebuild_from_writebatch", dynlib: librocksdb.} - + txn_db: ptr rocksdb_transactiondb_t; cnt: ptr csize_t): ptr ptr rocksdb_transaction_t {. + cdecl.} +proc rocksdb_transaction_set_name*(txn: ptr rocksdb_transaction_t; name: cstring; + name_len: csize_t; errptr: cstringArray) {.cdecl.} +proc rocksdb_transaction_get_name*(txn: ptr rocksdb_transaction_t; + name_len: ptr csize_t): cstring {.cdecl.} +proc rocksdb_transaction_prepare*(txn: ptr rocksdb_transaction_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_transaction_commit*(txn: ptr rocksdb_transaction_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_transaction_rollback*(txn: ptr rocksdb_transaction_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_transaction_set_savepoint*(txn: ptr rocksdb_transaction_t) {.cdecl.} +proc rocksdb_transaction_rollback_to_savepoint*(txn: ptr rocksdb_transaction_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_transaction_destroy*(txn: ptr rocksdb_transaction_t) {.cdecl.} +proc rocksdb_transaction_get_writebatch_wi*(txn: ptr rocksdb_transaction_t): ptr rocksdb_writebatch_wi_t {. + cdecl.} +proc rocksdb_transaction_rebuild_from_writebatch*(txn: ptr rocksdb_transaction_t; + writebatch: ptr rocksdb_writebatch_t; errptr: cstringArray) {.cdecl.} ## This rocksdb_writebatch_wi_t should be freed with rocksdb_free proc rocksdb_transaction_rebuild_from_writebatch_wi*( - txn: ptr rocksdb_transaction_t, wi: ptr rocksdb_writebatch_wi_t, errptr: cstringArray -) {. - cdecl, importc: "rocksdb_transaction_rebuild_from_writebatch_wi", dynlib: librocksdb -.} - -proc rocksdb_transaction_set_commit_timestamp*( - txn: ptr rocksdb_transaction_t, commit_timestamp: uint64 -) {.cdecl, importc: "rocksdb_transaction_set_commit_timestamp", dynlib: librocksdb.} - + txn: ptr rocksdb_transaction_t; wi: ptr rocksdb_writebatch_wi_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_transaction_set_commit_timestamp*(txn: ptr rocksdb_transaction_t; + commit_timestamp: uint64) {.cdecl.} proc rocksdb_transaction_set_read_timestamp_for_validation*( - txn: ptr rocksdb_transaction_t, read_timestamp: uint64 -) {. - cdecl, - importc: "rocksdb_transaction_set_read_timestamp_for_validation", - dynlib: librocksdb -.} - + txn: ptr rocksdb_transaction_t; read_timestamp: uint64) {.cdecl.} ## This snapshot should be freed using rocksdb_free -proc rocksdb_transaction_get_snapshot*( - txn: ptr rocksdb_transaction_t -): ptr rocksdb_snapshot_t {. - cdecl, importc: "rocksdb_transaction_get_snapshot", dynlib: librocksdb -.} - -proc rocksdb_transaction_get*( - txn: ptr rocksdb_transaction_t, - options: ptr rocksdb_readoptions_t, - key: cstring, - klen: csize_t, - vlen: ptr csize_t, - errptr: cstringArray, -): cstring {.cdecl, importc: "rocksdb_transaction_get", dynlib: librocksdb.} - -proc rocksdb_transaction_get_pinned*( - txn: ptr rocksdb_transaction_t, - options: ptr rocksdb_readoptions_t, - key: cstring, - klen: csize_t, - errptr: cstringArray, -): ptr rocksdb_pinnableslice_t {. - cdecl, importc: "rocksdb_transaction_get_pinned", dynlib: librocksdb -.} - -proc rocksdb_transaction_get_cf*( - txn: ptr rocksdb_transaction_t, - options: ptr rocksdb_readoptions_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - klen: csize_t, - vlen: ptr csize_t, - errptr: cstringArray, -): cstring {.cdecl, importc: "rocksdb_transaction_get_cf", dynlib: librocksdb.} - -proc rocksdb_transaction_get_pinned_cf*( - txn: ptr rocksdb_transaction_t, - options: ptr rocksdb_readoptions_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - klen: csize_t, - errptr: cstringArray, -): ptr rocksdb_pinnableslice_t {. - cdecl, importc: "rocksdb_transaction_get_pinned_cf", dynlib: librocksdb -.} - -proc rocksdb_transaction_get_for_update*( - txn: ptr rocksdb_transaction_t, - options: ptr rocksdb_readoptions_t, - key: cstring, - klen: csize_t, - vlen: ptr csize_t, - exclusive: uint8, - errptr: cstringArray, -): cstring {.cdecl, importc: "rocksdb_transaction_get_for_update", dynlib: librocksdb.} - -proc rocksdb_transaction_get_pinned_for_update*( - txn: ptr rocksdb_transaction_t, - options: ptr rocksdb_readoptions_t, - key: cstring, - klen: csize_t, - exclusive: uint8, - errptr: cstringArray, -): ptr rocksdb_pinnableslice_t {. - cdecl, importc: "rocksdb_transaction_get_pinned_for_update", dynlib: librocksdb -.} - -proc rocksdb_transaction_get_for_update_cf*( - txn: ptr rocksdb_transaction_t, - options: ptr rocksdb_readoptions_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - klen: csize_t, - vlen: ptr csize_t, - exclusive: uint8, - errptr: cstringArray, -): cstring {. - cdecl, importc: "rocksdb_transaction_get_for_update_cf", dynlib: librocksdb -.} - +proc rocksdb_transaction_get_snapshot*(txn: ptr rocksdb_transaction_t): ptr rocksdb_snapshot_t {. + cdecl.} +proc rocksdb_transaction_get*(txn: ptr rocksdb_transaction_t; + options: ptr rocksdb_readoptions_t; key: cstring; + klen: csize_t; vlen: ptr csize_t; errptr: cstringArray): cstring {. + cdecl.} +proc rocksdb_transaction_get_pinned*(txn: ptr rocksdb_transaction_t; + options: ptr rocksdb_readoptions_t; + key: cstring; klen: csize_t; + errptr: cstringArray): ptr rocksdb_pinnableslice_t {. + cdecl.} +proc rocksdb_transaction_get_cf*(txn: ptr rocksdb_transaction_t; + options: ptr rocksdb_readoptions_t; column_family: ptr rocksdb_column_family_handle_t; + key: cstring; klen: csize_t; vlen: ptr csize_t; + errptr: cstringArray): cstring {.cdecl.} +proc rocksdb_transaction_get_pinned_cf*(txn: ptr rocksdb_transaction_t; + options: ptr rocksdb_readoptions_t; + column_family: ptr rocksdb_column_family_handle_t; key: cstring; klen: csize_t; + errptr: cstringArray): ptr rocksdb_pinnableslice_t {. + cdecl.} +proc rocksdb_transaction_get_for_update*(txn: ptr rocksdb_transaction_t; + options: ptr rocksdb_readoptions_t; + key: cstring; klen: csize_t; + vlen: ptr csize_t; exclusive: uint8; + errptr: cstringArray): cstring {.cdecl.} +proc rocksdb_transaction_get_pinned_for_update*(txn: ptr rocksdb_transaction_t; + options: ptr rocksdb_readoptions_t; key: cstring; klen: csize_t; exclusive: uint8; + errptr: cstringArray): ptr rocksdb_pinnableslice_t {.cdecl.} +proc rocksdb_transaction_get_for_update_cf*(txn: ptr rocksdb_transaction_t; + options: ptr rocksdb_readoptions_t; + column_family: ptr rocksdb_column_family_handle_t; key: cstring; klen: csize_t; + vlen: ptr csize_t; exclusive: uint8; errptr: cstringArray): cstring {.cdecl.} proc rocksdb_transaction_get_pinned_for_update_cf*( - txn: ptr rocksdb_transaction_t, - options: ptr rocksdb_readoptions_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - klen: csize_t, - exclusive: uint8, - errptr: cstringArray, -): ptr rocksdb_pinnableslice_t {. - cdecl, importc: "rocksdb_transaction_get_pinned_for_update_cf", dynlib: librocksdb -.} - -proc rocksdb_transaction_multi_get*( - txn: ptr rocksdb_transaction_t, - options: ptr rocksdb_readoptions_t, - num_keys: csize_t, - keys_list: cstringArray, - keys_list_sizes: ptr csize_t, - values_list: cstringArray, - values_list_sizes: ptr csize_t, - errs: cstringArray, -) {.cdecl, importc: "rocksdb_transaction_multi_get", dynlib: librocksdb.} - -proc rocksdb_transaction_multi_get_for_update*( - txn: ptr rocksdb_transaction_t, - options: ptr rocksdb_readoptions_t, - num_keys: csize_t, - keys_list: cstringArray, - keys_list_sizes: ptr csize_t, - values_list: cstringArray, - values_list_sizes: ptr csize_t, - errs: cstringArray, -) {.cdecl, importc: "rocksdb_transaction_multi_get_for_update", dynlib: librocksdb.} - -proc rocksdb_transaction_multi_get_cf*( - txn: ptr rocksdb_transaction_t, - options: ptr rocksdb_readoptions_t, - column_families: ptr ptr rocksdb_column_family_handle_t, - num_keys: csize_t, - keys_list: cstringArray, - keys_list_sizes: ptr csize_t, - values_list: cstringArray, - values_list_sizes: ptr csize_t, - errs: cstringArray, -) {.cdecl, importc: "rocksdb_transaction_multi_get_cf", dynlib: librocksdb.} - -proc rocksdb_transaction_multi_get_for_update_cf*( - txn: ptr rocksdb_transaction_t, - options: ptr rocksdb_readoptions_t, - column_families: ptr ptr rocksdb_column_family_handle_t, - num_keys: csize_t, - keys_list: cstringArray, - keys_list_sizes: ptr csize_t, - values_list: cstringArray, - values_list_sizes: ptr csize_t, - errs: cstringArray, -) {.cdecl, importc: "rocksdb_transaction_multi_get_for_update_cf", dynlib: librocksdb.} - -proc rocksdb_transactiondb_get*( - txn_db: ptr rocksdb_transactiondb_t, - options: ptr rocksdb_readoptions_t, - key: cstring, - klen: csize_t, - vlen: ptr csize_t, - errptr: cstringArray, -): cstring {.cdecl, importc: "rocksdb_transactiondb_get", dynlib: librocksdb.} - -proc rocksdb_transactiondb_get_pinned*( - txn_db: ptr rocksdb_transactiondb_t, - options: ptr rocksdb_readoptions_t, - key: cstring, - klen: csize_t, - errptr: cstringArray, -): ptr rocksdb_pinnableslice_t {. - cdecl, importc: "rocksdb_transactiondb_get_pinned", dynlib: librocksdb -.} - -proc rocksdb_transactiondb_get_cf*( - txn_db: ptr rocksdb_transactiondb_t, - options: ptr rocksdb_readoptions_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - keylen: csize_t, - vallen: ptr csize_t, - errptr: cstringArray, -): cstring {.cdecl, importc: "rocksdb_transactiondb_get_cf", dynlib: librocksdb.} - -proc rocksdb_transactiondb_get_pinned_cf*( - txn_db: ptr rocksdb_transactiondb_t, - options: ptr rocksdb_readoptions_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - keylen: csize_t, - errptr: cstringArray, -): ptr rocksdb_pinnableslice_t {. - cdecl, importc: "rocksdb_transactiondb_get_pinned_cf", dynlib: librocksdb -.} - -proc rocksdb_transactiondb_multi_get*( - txn_db: ptr rocksdb_transactiondb_t, - options: ptr rocksdb_readoptions_t, - num_keys: csize_t, - keys_list: cstringArray, - keys_list_sizes: ptr csize_t, - values_list: cstringArray, - values_list_sizes: ptr csize_t, - errs: cstringArray, -) {.cdecl, importc: "rocksdb_transactiondb_multi_get", dynlib: librocksdb.} - -proc rocksdb_transactiondb_multi_get_cf*( - txn_db: ptr rocksdb_transactiondb_t, - options: ptr rocksdb_readoptions_t, - column_families: ptr ptr rocksdb_column_family_handle_t, - num_keys: csize_t, - keys_list: cstringArray, - keys_list_sizes: ptr csize_t, - values_list: cstringArray, - values_list_sizes: ptr csize_t, - errs: cstringArray, -) {.cdecl, importc: "rocksdb_transactiondb_multi_get_cf", dynlib: librocksdb.} - -proc rocksdb_transaction_put*( - txn: ptr rocksdb_transaction_t, - key: cstring, - klen: csize_t, - val: cstring, - vlen: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_transaction_put", dynlib: librocksdb.} - -proc rocksdb_transaction_put_cf*( - txn: ptr rocksdb_transaction_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - klen: csize_t, - val: cstring, - vlen: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_transaction_put_cf", dynlib: librocksdb.} - -proc rocksdb_transactiondb_put*( - txn_db: ptr rocksdb_transactiondb_t, - options: ptr rocksdb_writeoptions_t, - key: cstring, - klen: csize_t, - val: cstring, - vlen: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_transactiondb_put", dynlib: librocksdb.} - -proc rocksdb_transactiondb_put_cf*( - txn_db: ptr rocksdb_transactiondb_t, - options: ptr rocksdb_writeoptions_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - keylen: csize_t, - val: cstring, - vallen: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_transactiondb_put_cf", dynlib: librocksdb.} - -proc rocksdb_transactiondb_write*( - txn_db: ptr rocksdb_transactiondb_t, - options: ptr rocksdb_writeoptions_t, - batch: ptr rocksdb_writebatch_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_transactiondb_write", dynlib: librocksdb.} - -proc rocksdb_transaction_merge*( - txn: ptr rocksdb_transaction_t, - key: cstring, - klen: csize_t, - val: cstring, - vlen: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_transaction_merge", dynlib: librocksdb.} - -proc rocksdb_transaction_merge_cf*( - txn: ptr rocksdb_transaction_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - klen: csize_t, - val: cstring, - vlen: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_transaction_merge_cf", dynlib: librocksdb.} - -proc rocksdb_transactiondb_merge*( - txn_db: ptr rocksdb_transactiondb_t, - options: ptr rocksdb_writeoptions_t, - key: cstring, - klen: csize_t, - val: cstring, - vlen: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_transactiondb_merge", dynlib: librocksdb.} - -proc rocksdb_transactiondb_merge_cf*( - txn_db: ptr rocksdb_transactiondb_t, - options: ptr rocksdb_writeoptions_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - klen: csize_t, - val: cstring, - vlen: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_transactiondb_merge_cf", dynlib: librocksdb.} - -proc rocksdb_transaction_delete*( - txn: ptr rocksdb_transaction_t, key: cstring, klen: csize_t, errptr: cstringArray -) {.cdecl, importc: "rocksdb_transaction_delete", dynlib: librocksdb.} - -proc rocksdb_transaction_delete_cf*( - txn: ptr rocksdb_transaction_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - klen: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_transaction_delete_cf", dynlib: librocksdb.} - -proc rocksdb_transactiondb_delete*( - txn_db: ptr rocksdb_transactiondb_t, - options: ptr rocksdb_writeoptions_t, - key: cstring, - klen: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_transactiondb_delete", dynlib: librocksdb.} - -proc rocksdb_transactiondb_delete_cf*( - txn_db: ptr rocksdb_transactiondb_t, - options: ptr rocksdb_writeoptions_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - keylen: csize_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_transactiondb_delete_cf", dynlib: librocksdb.} - -proc rocksdb_transaction_create_iterator*( - txn: ptr rocksdb_transaction_t, options: ptr rocksdb_readoptions_t -): ptr rocksdb_iterator_t {. - cdecl, importc: "rocksdb_transaction_create_iterator", dynlib: librocksdb -.} - -proc rocksdb_transaction_create_iterator_cf*( - txn: ptr rocksdb_transaction_t, - options: ptr rocksdb_readoptions_t, - column_family: ptr rocksdb_column_family_handle_t, -): ptr rocksdb_iterator_t {. - cdecl, importc: "rocksdb_transaction_create_iterator_cf", dynlib: librocksdb -.} - -proc rocksdb_transactiondb_create_iterator*( - txn_db: ptr rocksdb_transactiondb_t, options: ptr rocksdb_readoptions_t -): ptr rocksdb_iterator_t {. - cdecl, importc: "rocksdb_transactiondb_create_iterator", dynlib: librocksdb -.} - + txn: ptr rocksdb_transaction_t; options: ptr rocksdb_readoptions_t; + column_family: ptr rocksdb_column_family_handle_t; key: cstring; klen: csize_t; + exclusive: uint8; errptr: cstringArray): ptr rocksdb_pinnableslice_t {.cdecl.} +proc rocksdb_transaction_multi_get*(txn: ptr rocksdb_transaction_t; + options: ptr rocksdb_readoptions_t; + num_keys: csize_t; keys_list: cstringArray; + keys_list_sizes: ptr csize_t; + values_list: cstringArray; + values_list_sizes: ptr csize_t; + errs: cstringArray) {.cdecl.} +proc rocksdb_transaction_multi_get_for_update*(txn: ptr rocksdb_transaction_t; + options: ptr rocksdb_readoptions_t; num_keys: csize_t; keys_list: cstringArray; + keys_list_sizes: ptr csize_t; values_list: cstringArray; + values_list_sizes: ptr csize_t; errs: cstringArray) {.cdecl.} +proc rocksdb_transaction_multi_get_cf*(txn: ptr rocksdb_transaction_t; + options: ptr rocksdb_readoptions_t; + column_families: ptr ptr rocksdb_column_family_handle_t; num_keys: csize_t; + keys_list: cstringArray; + keys_list_sizes: ptr csize_t; + values_list: cstringArray; + values_list_sizes: ptr csize_t; + errs: cstringArray) {.cdecl.} +proc rocksdb_transaction_multi_get_for_update_cf*(txn: ptr rocksdb_transaction_t; + options: ptr rocksdb_readoptions_t; + column_families: ptr ptr rocksdb_column_family_handle_t; num_keys: csize_t; + keys_list: cstringArray; keys_list_sizes: ptr csize_t; values_list: cstringArray; + values_list_sizes: ptr csize_t; errs: cstringArray) {.cdecl.} +proc rocksdb_transactiondb_get*(txn_db: ptr rocksdb_transactiondb_t; + options: ptr rocksdb_readoptions_t; key: cstring; + klen: csize_t; vlen: ptr csize_t; errptr: cstringArray): cstring {. + cdecl.} +proc rocksdb_transactiondb_get_pinned*(txn_db: ptr rocksdb_transactiondb_t; + options: ptr rocksdb_readoptions_t; + key: cstring; klen: csize_t; + errptr: cstringArray): ptr rocksdb_pinnableslice_t {. + cdecl.} +proc rocksdb_transactiondb_get_cf*(txn_db: ptr rocksdb_transactiondb_t; + options: ptr rocksdb_readoptions_t; column_family: ptr rocksdb_column_family_handle_t; + key: cstring; keylen: csize_t; + vallen: ptr csize_t; errptr: cstringArray): cstring {. + cdecl.} +proc rocksdb_transactiondb_get_pinned_cf*(txn_db: ptr rocksdb_transactiondb_t; + options: ptr rocksdb_readoptions_t; + column_family: ptr rocksdb_column_family_handle_t; key: cstring; keylen: csize_t; + errptr: cstringArray): ptr rocksdb_pinnableslice_t {.cdecl.} +proc rocksdb_transactiondb_multi_get*(txn_db: ptr rocksdb_transactiondb_t; + options: ptr rocksdb_readoptions_t; + num_keys: csize_t; keys_list: cstringArray; + keys_list_sizes: ptr csize_t; + values_list: cstringArray; + values_list_sizes: ptr csize_t; + errs: cstringArray) {.cdecl.} +proc rocksdb_transactiondb_multi_get_cf*(txn_db: ptr rocksdb_transactiondb_t; + options: ptr rocksdb_readoptions_t; + column_families: ptr ptr rocksdb_column_family_handle_t; num_keys: csize_t; + keys_list: cstringArray; + keys_list_sizes: ptr csize_t; + values_list: cstringArray; + values_list_sizes: ptr csize_t; + errs: cstringArray) {.cdecl.} +proc rocksdb_transaction_put*(txn: ptr rocksdb_transaction_t; key: cstring; + klen: csize_t; val: cstring; vlen: csize_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_transaction_put_cf*(txn: ptr rocksdb_transaction_t; column_family: ptr rocksdb_column_family_handle_t; + key: cstring; klen: csize_t; val: cstring; + vlen: csize_t; errptr: cstringArray) {.cdecl.} +proc rocksdb_transactiondb_put*(txn_db: ptr rocksdb_transactiondb_t; + options: ptr rocksdb_writeoptions_t; key: cstring; + klen: csize_t; val: cstring; vlen: csize_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_transactiondb_put_cf*(txn_db: ptr rocksdb_transactiondb_t; + options: ptr rocksdb_writeoptions_t; + column_family: ptr rocksdb_column_family_handle_t; key: cstring; keylen: csize_t; + val: cstring; vallen: csize_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_transactiondb_write*(txn_db: ptr rocksdb_transactiondb_t; + options: ptr rocksdb_writeoptions_t; + batch: ptr rocksdb_writebatch_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_transaction_merge*(txn: ptr rocksdb_transaction_t; key: cstring; + klen: csize_t; val: cstring; vlen: csize_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_transaction_merge_cf*(txn: ptr rocksdb_transaction_t; column_family: ptr rocksdb_column_family_handle_t; + key: cstring; klen: csize_t; val: cstring; + vlen: csize_t; errptr: cstringArray) {.cdecl.} +proc rocksdb_transactiondb_merge*(txn_db: ptr rocksdb_transactiondb_t; + options: ptr rocksdb_writeoptions_t; key: cstring; + klen: csize_t; val: cstring; vlen: csize_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_transactiondb_merge_cf*(txn_db: ptr rocksdb_transactiondb_t; + options: ptr rocksdb_writeoptions_t; + column_family: ptr rocksdb_column_family_handle_t; key: cstring; klen: csize_t; + val: cstring; vlen: csize_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_transaction_delete*(txn: ptr rocksdb_transaction_t; key: cstring; + klen: csize_t; errptr: cstringArray) {.cdecl.} +proc rocksdb_transaction_delete_cf*(txn: ptr rocksdb_transaction_t; column_family: ptr rocksdb_column_family_handle_t; + key: cstring; klen: csize_t; errptr: cstringArray) {. + cdecl.} +proc rocksdb_transactiondb_delete*(txn_db: ptr rocksdb_transactiondb_t; + options: ptr rocksdb_writeoptions_t; + key: cstring; klen: csize_t; errptr: cstringArray) {. + cdecl.} +proc rocksdb_transactiondb_delete_cf*(txn_db: ptr rocksdb_transactiondb_t; + options: ptr rocksdb_writeoptions_t; + column_family: ptr rocksdb_column_family_handle_t; key: cstring; keylen: csize_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_transaction_create_iterator*(txn: ptr rocksdb_transaction_t; + options: ptr rocksdb_readoptions_t): ptr rocksdb_iterator_t {.cdecl.} +proc rocksdb_transaction_create_iterator_cf*(txn: ptr rocksdb_transaction_t; + options: ptr rocksdb_readoptions_t; + column_family: ptr rocksdb_column_family_handle_t): ptr rocksdb_iterator_t {. + cdecl.} +proc rocksdb_transactiondb_create_iterator*(txn_db: ptr rocksdb_transactiondb_t; + options: ptr rocksdb_readoptions_t): ptr rocksdb_iterator_t {.cdecl.} proc rocksdb_transactiondb_create_iterator_cf*( - txn_db: ptr rocksdb_transactiondb_t, - options: ptr rocksdb_readoptions_t, - column_family: ptr rocksdb_column_family_handle_t, -): ptr rocksdb_iterator_t {. - cdecl, importc: "rocksdb_transactiondb_create_iterator_cf", dynlib: librocksdb -.} - -proc rocksdb_transactiondb_close*( - txn_db: ptr rocksdb_transactiondb_t -) {.cdecl, importc: "rocksdb_transactiondb_close", dynlib: librocksdb.} - -proc rocksdb_transactiondb_flush*( - txn_db: ptr rocksdb_transactiondb_t, - options: ptr rocksdb_flushoptions_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_transactiondb_flush", dynlib: librocksdb.} - -proc rocksdb_transactiondb_flush_cf*( - txn_db: ptr rocksdb_transactiondb_t, - options: ptr rocksdb_flushoptions_t, - column_family: ptr rocksdb_column_family_handle_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_transactiondb_flush_cf", dynlib: librocksdb.} - -proc rocksdb_transactiondb_flush_cfs*( - txn_db: ptr rocksdb_transactiondb_t, - options: ptr rocksdb_flushoptions_t, - column_families: ptr ptr rocksdb_column_family_handle_t, - num_column_families: cint, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_transactiondb_flush_cfs", dynlib: librocksdb.} - -proc rocksdb_transactiondb_flush_wal*( - txn_db: ptr rocksdb_transactiondb_t, sync: uint8, errptr: cstringArray -) {.cdecl, importc: "rocksdb_transactiondb_flush_wal", dynlib: librocksdb.} - + txn_db: ptr rocksdb_transactiondb_t; options: ptr rocksdb_readoptions_t; + column_family: ptr rocksdb_column_family_handle_t): ptr rocksdb_iterator_t {. + cdecl.} +proc rocksdb_transactiondb_close*(txn_db: ptr rocksdb_transactiondb_t) {.cdecl.} +proc rocksdb_transactiondb_flush*(txn_db: ptr rocksdb_transactiondb_t; + options: ptr rocksdb_flushoptions_t; + errptr: cstringArray) {.cdecl.} +proc rocksdb_transactiondb_flush_cf*(txn_db: ptr rocksdb_transactiondb_t; + options: ptr rocksdb_flushoptions_t; + column_family: ptr rocksdb_column_family_handle_t; errptr: cstringArray) {.cdecl.} +proc rocksdb_transactiondb_flush_cfs*(txn_db: ptr rocksdb_transactiondb_t; + options: ptr rocksdb_flushoptions_t; + column_families: ptr ptr rocksdb_column_family_handle_t; + num_column_families: cint; + errptr: cstringArray) {.cdecl.} +proc rocksdb_transactiondb_flush_wal*(txn_db: ptr rocksdb_transactiondb_t; + sync: uint8; errptr: cstringArray) {.cdecl.} proc rocksdb_transactiondb_checkpoint_object_create*( - txn_db: ptr rocksdb_transactiondb_t, errptr: cstringArray -): ptr rocksdb_checkpoint_t {. - cdecl, importc: "rocksdb_transactiondb_checkpoint_object_create", dynlib: librocksdb -.} - -proc rocksdb_optimistictransactiondb_open*( - options: ptr rocksdb_options_t, name: cstring, errptr: cstringArray -): ptr rocksdb_optimistictransactiondb_t {. - cdecl, importc: "rocksdb_optimistictransactiondb_open", dynlib: librocksdb -.} - + txn_db: ptr rocksdb_transactiondb_t; errptr: cstringArray): ptr rocksdb_checkpoint_t {. + cdecl.} +proc rocksdb_optimistictransactiondb_open*(options: ptr rocksdb_options_t; + name: cstring; errptr: cstringArray): ptr rocksdb_optimistictransactiondb_t {. + cdecl.} proc rocksdb_optimistictransactiondb_open_column_families*( - options: ptr rocksdb_options_t, - name: cstring, - num_column_families: cint, - column_family_names: cstringArray, - column_family_options: ptr ptr rocksdb_options_t, - column_family_handles: ptr ptr rocksdb_column_family_handle_t, - errptr: cstringArray, -): ptr rocksdb_optimistictransactiondb_t {. - cdecl, - importc: "rocksdb_optimistictransactiondb_open_column_families", - dynlib: librocksdb -.} - + options: ptr rocksdb_options_t; name: cstring; num_column_families: cint; + column_family_names: cstringArray; + column_family_options: ptr ptr rocksdb_options_t; + column_family_handles: ptr ptr rocksdb_column_family_handle_t; + errptr: cstringArray): ptr rocksdb_optimistictransactiondb_t {.cdecl.} proc rocksdb_optimistictransactiondb_get_base_db*( - otxn_db: ptr rocksdb_optimistictransactiondb_t -): ptr rocksdb_t {. - cdecl, importc: "rocksdb_optimistictransactiondb_get_base_db", dynlib: librocksdb -.} - -proc rocksdb_optimistictransactiondb_close_base_db*( - base_db: ptr rocksdb_t -) {. - cdecl, importc: "rocksdb_optimistictransactiondb_close_base_db", dynlib: librocksdb -.} - + otxn_db: ptr rocksdb_optimistictransactiondb_t): ptr rocksdb_t {.cdecl.} +proc rocksdb_optimistictransactiondb_close_base_db*(base_db: ptr rocksdb_t) {.cdecl.} proc rocksdb_optimistictransaction_begin*( - otxn_db: ptr rocksdb_optimistictransactiondb_t, - write_options: ptr rocksdb_writeoptions_t, - otxn_options: ptr rocksdb_optimistictransaction_options_t, - old_txn: ptr rocksdb_transaction_t, -): ptr rocksdb_transaction_t {. - cdecl, importc: "rocksdb_optimistictransaction_begin", dynlib: librocksdb -.} - + otxn_db: ptr rocksdb_optimistictransactiondb_t; + write_options: ptr rocksdb_writeoptions_t; + otxn_options: ptr rocksdb_optimistictransaction_options_t; + old_txn: ptr rocksdb_transaction_t): ptr rocksdb_transaction_t {.cdecl.} proc rocksdb_optimistictransactiondb_write*( - otxn_db: ptr rocksdb_optimistictransactiondb_t, - options: ptr rocksdb_writeoptions_t, - batch: ptr rocksdb_writebatch_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_optimistictransactiondb_write", dynlib: librocksdb.} - + otxn_db: ptr rocksdb_optimistictransactiondb_t; + options: ptr rocksdb_writeoptions_t; batch: ptr rocksdb_writebatch_t; + errptr: cstringArray) {.cdecl.} proc rocksdb_optimistictransactiondb_close*( - otxn_db: ptr rocksdb_optimistictransactiondb_t -) {.cdecl, importc: "rocksdb_optimistictransactiondb_close", dynlib: librocksdb.} - + otxn_db: ptr rocksdb_optimistictransactiondb_t) {.cdecl.} proc rocksdb_optimistictransactiondb_checkpoint_object_create*( - otxn_db: ptr rocksdb_optimistictransactiondb_t, errptr: cstringArray -): ptr rocksdb_checkpoint_t {. - cdecl, - importc: "rocksdb_optimistictransactiondb_checkpoint_object_create", - dynlib: librocksdb -.} - + otxn_db: ptr rocksdb_optimistictransactiondb_t; errptr: cstringArray): ptr rocksdb_checkpoint_t {. + cdecl.} ## Transaction Options proc rocksdb_transactiondb_options_create*(): ptr rocksdb_transactiondb_options_t {. - cdecl, importc: "rocksdb_transactiondb_options_create", dynlib: librocksdb -.} - + cdecl.} proc rocksdb_transactiondb_options_destroy*( - opt: ptr rocksdb_transactiondb_options_t -) {.cdecl, importc: "rocksdb_transactiondb_options_destroy", dynlib: librocksdb.} - + opt: ptr rocksdb_transactiondb_options_t) {.cdecl.} proc rocksdb_transactiondb_options_set_max_num_locks*( - opt: ptr rocksdb_transactiondb_options_t, max_num_locks: int64 -) {. - cdecl, importc: "rocksdb_transactiondb_options_set_max_num_locks", dynlib: librocksdb -.} - + opt: ptr rocksdb_transactiondb_options_t; max_num_locks: int64) {.cdecl.} proc rocksdb_transactiondb_options_set_num_stripes*( - opt: ptr rocksdb_transactiondb_options_t, num_stripes: csize_t -) {. - cdecl, importc: "rocksdb_transactiondb_options_set_num_stripes", dynlib: librocksdb -.} - + opt: ptr rocksdb_transactiondb_options_t; num_stripes: csize_t) {.cdecl.} proc rocksdb_transactiondb_options_set_transaction_lock_timeout*( - opt: ptr rocksdb_transactiondb_options_t, txn_lock_timeout: int64 -) {. - cdecl, - importc: "rocksdb_transactiondb_options_set_transaction_lock_timeout", - dynlib: librocksdb -.} - + opt: ptr rocksdb_transactiondb_options_t; txn_lock_timeout: int64) {.cdecl.} proc rocksdb_transactiondb_options_set_default_lock_timeout*( - opt: ptr rocksdb_transactiondb_options_t, default_lock_timeout: int64 -) {. - cdecl, - importc: "rocksdb_transactiondb_options_set_default_lock_timeout", - dynlib: librocksdb -.} - + opt: ptr rocksdb_transactiondb_options_t; default_lock_timeout: int64) {.cdecl.} proc rocksdb_transaction_options_create*(): ptr rocksdb_transaction_options_t {. - cdecl, importc: "rocksdb_transaction_options_create", dynlib: librocksdb -.} - -proc rocksdb_transaction_options_destroy*( - opt: ptr rocksdb_transaction_options_t -) {.cdecl, importc: "rocksdb_transaction_options_destroy", dynlib: librocksdb.} - + cdecl.} +proc rocksdb_transaction_options_destroy*(opt: ptr rocksdb_transaction_options_t) {. + cdecl.} proc rocksdb_transaction_options_set_set_snapshot*( - opt: ptr rocksdb_transaction_options_t, v: uint8 -) {.cdecl, importc: "rocksdb_transaction_options_set_set_snapshot", dynlib: librocksdb.} - + opt: ptr rocksdb_transaction_options_t; v: uint8) {.cdecl.} proc rocksdb_transaction_options_set_deadlock_detect*( - opt: ptr rocksdb_transaction_options_t, v: uint8 -) {. - cdecl, importc: "rocksdb_transaction_options_set_deadlock_detect", dynlib: librocksdb -.} - + opt: ptr rocksdb_transaction_options_t; v: uint8) {.cdecl.} proc rocksdb_transaction_options_set_lock_timeout*( - opt: ptr rocksdb_transaction_options_t, lock_timeout: int64 -) {.cdecl, importc: "rocksdb_transaction_options_set_lock_timeout", dynlib: librocksdb.} - + opt: ptr rocksdb_transaction_options_t; lock_timeout: int64) {.cdecl.} proc rocksdb_transaction_options_set_expiration*( - opt: ptr rocksdb_transaction_options_t, expiration: int64 -) {.cdecl, importc: "rocksdb_transaction_options_set_expiration", dynlib: librocksdb.} - + opt: ptr rocksdb_transaction_options_t; expiration: int64) {.cdecl.} proc rocksdb_transaction_options_set_deadlock_detect_depth*( - opt: ptr rocksdb_transaction_options_t, depth: int64 -) {. - cdecl, - importc: "rocksdb_transaction_options_set_deadlock_detect_depth", - dynlib: librocksdb -.} - + opt: ptr rocksdb_transaction_options_t; depth: int64) {.cdecl.} proc rocksdb_transaction_options_set_max_write_batch_size*( - opt: ptr rocksdb_transaction_options_t, size: csize_t -) {. - cdecl, - importc: "rocksdb_transaction_options_set_max_write_batch_size", - dynlib: librocksdb -.} - + opt: ptr rocksdb_transaction_options_t; size: csize_t) {.cdecl.} proc rocksdb_transaction_options_set_skip_prepare*( - opt: ptr rocksdb_transaction_options_t, v: uint8 -) {.cdecl, importc: "rocksdb_transaction_options_set_skip_prepare", dynlib: librocksdb.} - + opt: ptr rocksdb_transaction_options_t; v: uint8) {.cdecl.} proc rocksdb_optimistictransaction_options_create*(): ptr rocksdb_optimistictransaction_options_t {. - cdecl, importc: "rocksdb_optimistictransaction_options_create", dynlib: librocksdb -.} - + cdecl.} proc rocksdb_optimistictransaction_options_destroy*( - opt: ptr rocksdb_optimistictransaction_options_t -) {. - cdecl, importc: "rocksdb_optimistictransaction_options_destroy", dynlib: librocksdb -.} - + opt: ptr rocksdb_optimistictransaction_options_t) {.cdecl.} proc rocksdb_optimistictransaction_options_set_set_snapshot*( - opt: ptr rocksdb_optimistictransaction_options_t, v: uint8 -) {. - cdecl, - importc: "rocksdb_optimistictransaction_options_set_set_snapshot", - dynlib: librocksdb -.} - + opt: ptr rocksdb_optimistictransaction_options_t; v: uint8) {.cdecl.} proc rocksdb_optimistictransactiondb_property_value*( - db: ptr rocksdb_optimistictransactiondb_t, propname: cstring -): cstring {. - cdecl, importc: "rocksdb_optimistictransactiondb_property_value", dynlib: librocksdb -.} - + db: ptr rocksdb_optimistictransactiondb_t; propname: cstring): cstring {.cdecl.} proc rocksdb_optimistictransactiondb_property_int*( - db: ptr rocksdb_optimistictransactiondb_t, propname: cstring, out_val: ptr uint64 -): cint {. - cdecl, importc: "rocksdb_optimistictransactiondb_property_int", dynlib: librocksdb -.} - + db: ptr rocksdb_optimistictransactiondb_t; propname: cstring; out_val: ptr uint64): cint {. + cdecl.} ## referring to convention (3), this should be used by client ## to free memory that was malloc()ed -proc rocksdb_free*( - `ptr`: pointer -) {.cdecl, importc: "rocksdb_free", dynlib: librocksdb.} - -proc rocksdb_get_pinned*( - db: ptr rocksdb_t, - options: ptr rocksdb_readoptions_t, - key: cstring, - keylen: csize_t, - errptr: cstringArray, -): ptr rocksdb_pinnableslice_t {. - cdecl, importc: "rocksdb_get_pinned", dynlib: librocksdb -.} - -proc rocksdb_get_pinned_cf*( - db: ptr rocksdb_t, - options: ptr rocksdb_readoptions_t, - column_family: ptr rocksdb_column_family_handle_t, - key: cstring, - keylen: csize_t, - errptr: cstringArray, -): ptr rocksdb_pinnableslice_t {. - cdecl, importc: "rocksdb_get_pinned_cf", dynlib: librocksdb -.} - -proc rocksdb_pinnableslice_destroy*( - v: ptr rocksdb_pinnableslice_t -) {.cdecl, importc: "rocksdb_pinnableslice_destroy", dynlib: librocksdb.} - -proc rocksdb_pinnableslice_value*( - t: ptr rocksdb_pinnableslice_t, vlen: ptr csize_t -): cstring {.cdecl, importc: "rocksdb_pinnableslice_value", dynlib: librocksdb.} - -proc rocksdb_memory_consumers_create*(): ptr rocksdb_memory_consumers_t {. - cdecl, importc: "rocksdb_memory_consumers_create", dynlib: librocksdb -.} - -proc rocksdb_memory_consumers_add_db*( - consumers: ptr rocksdb_memory_consumers_t, db: ptr rocksdb_t -) {.cdecl, importc: "rocksdb_memory_consumers_add_db", dynlib: librocksdb.} - -proc rocksdb_memory_consumers_add_cache*( - consumers: ptr rocksdb_memory_consumers_t, cache: ptr rocksdb_cache_t -) {.cdecl, importc: "rocksdb_memory_consumers_add_cache", dynlib: librocksdb.} - -proc rocksdb_memory_consumers_destroy*( - consumers: ptr rocksdb_memory_consumers_t -) {.cdecl, importc: "rocksdb_memory_consumers_destroy", dynlib: librocksdb.} - +proc rocksdb_free*(`ptr`: pointer) {.cdecl.} +proc rocksdb_get_pinned*(db: ptr rocksdb_t; options: ptr rocksdb_readoptions_t; + key: cstring; keylen: csize_t; errptr: cstringArray): ptr rocksdb_pinnableslice_t {. + cdecl.} +proc rocksdb_get_pinned_cf*(db: ptr rocksdb_t; options: ptr rocksdb_readoptions_t; + column_family: ptr rocksdb_column_family_handle_t; + key: cstring; keylen: csize_t; errptr: cstringArray): ptr rocksdb_pinnableslice_t {. + cdecl.} +proc rocksdb_pinnableslice_destroy*(v: ptr rocksdb_pinnableslice_t) {.cdecl.} +proc rocksdb_pinnableslice_value*(t: ptr rocksdb_pinnableslice_t; vlen: ptr csize_t): cstring {. + cdecl.} +proc rocksdb_memory_consumers_create*(): ptr rocksdb_memory_consumers_t {.cdecl.} +proc rocksdb_memory_consumers_add_db*(consumers: ptr rocksdb_memory_consumers_t; + db: ptr rocksdb_t) {.cdecl.} +proc rocksdb_memory_consumers_add_cache*(consumers: ptr rocksdb_memory_consumers_t; + cache: ptr rocksdb_cache_t) {.cdecl.} +proc rocksdb_memory_consumers_destroy*(consumers: ptr rocksdb_memory_consumers_t) {. + cdecl.} proc rocksdb_approximate_memory_usage_create*( - consumers: ptr rocksdb_memory_consumers_t, errptr: cstringArray -): ptr rocksdb_memory_usage_t {. - cdecl, importc: "rocksdb_approximate_memory_usage_create", dynlib: librocksdb -.} - -proc rocksdb_approximate_memory_usage_destroy*( - usage: ptr rocksdb_memory_usage_t -) {.cdecl, importc: "rocksdb_approximate_memory_usage_destroy", dynlib: librocksdb.} - + consumers: ptr rocksdb_memory_consumers_t; errptr: cstringArray): ptr rocksdb_memory_usage_t {. + cdecl.} +proc rocksdb_approximate_memory_usage_destroy*(usage: ptr rocksdb_memory_usage_t) {. + cdecl.} proc rocksdb_approximate_memory_usage_get_mem_table_total*( - memory_usage: ptr rocksdb_memory_usage_t -): uint64 {. - cdecl, - importc: "rocksdb_approximate_memory_usage_get_mem_table_total", - dynlib: librocksdb -.} - + memory_usage: ptr rocksdb_memory_usage_t): uint64 {.cdecl.} proc rocksdb_approximate_memory_usage_get_mem_table_unflushed*( - memory_usage: ptr rocksdb_memory_usage_t -): uint64 {. - cdecl, - importc: "rocksdb_approximate_memory_usage_get_mem_table_unflushed", - dynlib: librocksdb -.} - + memory_usage: ptr rocksdb_memory_usage_t): uint64 {.cdecl.} proc rocksdb_approximate_memory_usage_get_mem_table_readers_total*( - memory_usage: ptr rocksdb_memory_usage_t -): uint64 {. - cdecl, - importc: "rocksdb_approximate_memory_usage_get_mem_table_readers_total", - dynlib: librocksdb -.} - + memory_usage: ptr rocksdb_memory_usage_t): uint64 {.cdecl.} proc rocksdb_approximate_memory_usage_get_cache_total*( - memory_usage: ptr rocksdb_memory_usage_t -): uint64 {. - cdecl, importc: "rocksdb_approximate_memory_usage_get_cache_total", dynlib: librocksdb -.} - -proc rocksdb_options_set_dump_malloc_stats*( - a1: ptr rocksdb_options_t, a2: uint8 -) {.cdecl, importc: "rocksdb_options_set_dump_malloc_stats", dynlib: librocksdb.} - -proc rocksdb_options_set_memtable_whole_key_filtering*( - a1: ptr rocksdb_options_t, a2: uint8 -) {. - cdecl, importc: "rocksdb_options_set_memtable_whole_key_filtering", dynlib: librocksdb -.} - -proc rocksdb_cancel_all_background_work*( - db: ptr rocksdb_t, wait: uint8 -) {.cdecl, importc: "rocksdb_cancel_all_background_work", dynlib: librocksdb.} - -proc rocksdb_disable_manual_compaction*( - db: ptr rocksdb_t -) {.cdecl, importc: "rocksdb_disable_manual_compaction", dynlib: librocksdb.} - -proc rocksdb_enable_manual_compaction*( - db: ptr rocksdb_t -) {.cdecl, importc: "rocksdb_enable_manual_compaction", dynlib: librocksdb.} - + memory_usage: ptr rocksdb_memory_usage_t): uint64 {.cdecl.} +proc rocksdb_options_set_dump_malloc_stats*(a1: ptr rocksdb_options_t; a2: uint8) {. + cdecl.} +proc rocksdb_options_set_memtable_whole_key_filtering*(a1: ptr rocksdb_options_t; + a2: uint8) {.cdecl.} +proc rocksdb_cancel_all_background_work*(db: ptr rocksdb_t; wait: uint8) {.cdecl.} +proc rocksdb_disable_manual_compaction*(db: ptr rocksdb_t) {.cdecl.} +proc rocksdb_enable_manual_compaction*(db: ptr rocksdb_t) {.cdecl.} proc rocksdb_statistics_histogram_data_create*(): ptr rocksdb_statistics_histogram_data_t {. - cdecl, importc: "rocksdb_statistics_histogram_data_create", dynlib: librocksdb -.} - + cdecl.} proc rocksdb_statistics_histogram_data_destroy*( - data: ptr rocksdb_statistics_histogram_data_t -) {.cdecl, importc: "rocksdb_statistics_histogram_data_destroy", dynlib: librocksdb.} - + data: ptr rocksdb_statistics_histogram_data_t) {.cdecl.} proc rocksdb_statistics_histogram_data_get_median*( - data: ptr rocksdb_statistics_histogram_data_t -): cdouble {. - cdecl, importc: "rocksdb_statistics_histogram_data_get_median", dynlib: librocksdb -.} - + data: ptr rocksdb_statistics_histogram_data_t): cdouble {.cdecl.} proc rocksdb_statistics_histogram_data_get_p95*( - data: ptr rocksdb_statistics_histogram_data_t -): cdouble {. - cdecl, importc: "rocksdb_statistics_histogram_data_get_p95", dynlib: librocksdb -.} - + data: ptr rocksdb_statistics_histogram_data_t): cdouble {.cdecl.} proc rocksdb_statistics_histogram_data_get_p99*( - data: ptr rocksdb_statistics_histogram_data_t -): cdouble {. - cdecl, importc: "rocksdb_statistics_histogram_data_get_p99", dynlib: librocksdb -.} - + data: ptr rocksdb_statistics_histogram_data_t): cdouble {.cdecl.} proc rocksdb_statistics_histogram_data_get_average*( - data: ptr rocksdb_statistics_histogram_data_t -): cdouble {. - cdecl, importc: "rocksdb_statistics_histogram_data_get_average", dynlib: librocksdb -.} - + data: ptr rocksdb_statistics_histogram_data_t): cdouble {.cdecl.} proc rocksdb_statistics_histogram_data_get_std_dev*( - data: ptr rocksdb_statistics_histogram_data_t -): cdouble {. - cdecl, importc: "rocksdb_statistics_histogram_data_get_std_dev", dynlib: librocksdb -.} - + data: ptr rocksdb_statistics_histogram_data_t): cdouble {.cdecl.} proc rocksdb_statistics_histogram_data_get_max*( - data: ptr rocksdb_statistics_histogram_data_t -): cdouble {. - cdecl, importc: "rocksdb_statistics_histogram_data_get_max", dynlib: librocksdb -.} - + data: ptr rocksdb_statistics_histogram_data_t): cdouble {.cdecl.} proc rocksdb_statistics_histogram_data_get_count*( - data: ptr rocksdb_statistics_histogram_data_t -): uint64 {. - cdecl, importc: "rocksdb_statistics_histogram_data_get_count", dynlib: librocksdb -.} - + data: ptr rocksdb_statistics_histogram_data_t): uint64 {.cdecl.} proc rocksdb_statistics_histogram_data_get_sum*( - data: ptr rocksdb_statistics_histogram_data_t -): uint64 {. - cdecl, importc: "rocksdb_statistics_histogram_data_get_sum", dynlib: librocksdb -.} - + data: ptr rocksdb_statistics_histogram_data_t): uint64 {.cdecl.} proc rocksdb_statistics_histogram_data_get_min*( - data: ptr rocksdb_statistics_histogram_data_t -): cdouble {. - cdecl, importc: "rocksdb_statistics_histogram_data_get_min", dynlib: librocksdb -.} - -proc rocksdb_wait_for_compact*( - db: ptr rocksdb_t, - options: ptr rocksdb_wait_for_compact_options_t, - errptr: cstringArray, -) {.cdecl, importc: "rocksdb_wait_for_compact", dynlib: librocksdb.} - + data: ptr rocksdb_statistics_histogram_data_t): cdouble {.cdecl.} +proc rocksdb_wait_for_compact*(db: ptr rocksdb_t; + options: ptr rocksdb_wait_for_compact_options_t; + errptr: cstringArray) {.cdecl.} proc rocksdb_wait_for_compact_options_create*(): ptr rocksdb_wait_for_compact_options_t {. - cdecl, importc: "rocksdb_wait_for_compact_options_create", dynlib: librocksdb -.} - + cdecl.} proc rocksdb_wait_for_compact_options_destroy*( - opt: ptr rocksdb_wait_for_compact_options_t -) {.cdecl, importc: "rocksdb_wait_for_compact_options_destroy", dynlib: librocksdb.} - + opt: ptr rocksdb_wait_for_compact_options_t) {.cdecl.} proc rocksdb_wait_for_compact_options_set_abort_on_pause*( - opt: ptr rocksdb_wait_for_compact_options_t, v: uint8 -) {. - cdecl, - importc: "rocksdb_wait_for_compact_options_set_abort_on_pause", - dynlib: librocksdb -.} - + opt: ptr rocksdb_wait_for_compact_options_t; v: uint8) {.cdecl.} proc rocksdb_wait_for_compact_options_get_abort_on_pause*( - opt: ptr rocksdb_wait_for_compact_options_t -): uint8 {. - cdecl, - importc: "rocksdb_wait_for_compact_options_get_abort_on_pause", - dynlib: librocksdb -.} - + opt: ptr rocksdb_wait_for_compact_options_t): uint8 {.cdecl.} proc rocksdb_wait_for_compact_options_set_flush*( - opt: ptr rocksdb_wait_for_compact_options_t, v: uint8 -) {.cdecl, importc: "rocksdb_wait_for_compact_options_set_flush", dynlib: librocksdb.} - + opt: ptr rocksdb_wait_for_compact_options_t; v: uint8) {.cdecl.} proc rocksdb_wait_for_compact_options_get_flush*( - opt: ptr rocksdb_wait_for_compact_options_t -): uint8 {. - cdecl, importc: "rocksdb_wait_for_compact_options_get_flush", dynlib: librocksdb -.} - + opt: ptr rocksdb_wait_for_compact_options_t): uint8 {.cdecl.} proc rocksdb_wait_for_compact_options_set_close_db*( - opt: ptr rocksdb_wait_for_compact_options_t, v: uint8 -) {. - cdecl, importc: "rocksdb_wait_for_compact_options_set_close_db", dynlib: librocksdb -.} - + opt: ptr rocksdb_wait_for_compact_options_t; v: uint8) {.cdecl.} proc rocksdb_wait_for_compact_options_get_close_db*( - opt: ptr rocksdb_wait_for_compact_options_t -): uint8 {. - cdecl, importc: "rocksdb_wait_for_compact_options_get_close_db", dynlib: librocksdb -.} - + opt: ptr rocksdb_wait_for_compact_options_t): uint8 {.cdecl.} proc rocksdb_wait_for_compact_options_set_timeout*( - opt: ptr rocksdb_wait_for_compact_options_t, microseconds: uint64 -) {.cdecl, importc: "rocksdb_wait_for_compact_options_set_timeout", dynlib: librocksdb.} - + opt: ptr rocksdb_wait_for_compact_options_t; microseconds: uint64) {.cdecl.} proc rocksdb_wait_for_compact_options_get_timeout*( - opt: ptr rocksdb_wait_for_compact_options_t -): uint64 {. - cdecl, importc: "rocksdb_wait_for_compact_options_get_timeout", dynlib: librocksdb -.} + opt: ptr rocksdb_wait_for_compact_options_t): uint64 {.cdecl.} \ No newline at end of file From a14fd969d6420e9c74ec1f8bdc1380750ebb6557 Mon Sep 17 00:00:00 2001 From: bhartnett <51288821+bhartnett@users.noreply.github.com> Date: Tue, 14 Jan 2025 16:49:49 +0800 Subject: [PATCH 04/11] Update CI and run nph. --- .github/workflows/ci.yml | 5 - rocksdb/lib/librocksdb.nim | 2 +- rocksdb/lib/rocksdb_gen.nim | 5259 ++++++++++++++++++++++++----------- 3 files changed, 3621 insertions(+), 1645 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b0cea4f..37d7967 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -123,8 +123,3 @@ jobs: nimble --version nimble install -y nimble test - - # static linking is not supported on windows - if [[ "${{ matrix.target.os }}" != "windows" ]]; then - nimble test_static - fi diff --git a/rocksdb/lib/librocksdb.nim b/rocksdb/lib/librocksdb.nim index 25a9275..3edb58c 100644 --- a/rocksdb/lib/librocksdb.nim +++ b/rocksdb/lib/librocksdb.nim @@ -108,7 +108,7 @@ else: # {.passl: "-lshlwapi -lrpcrt4".} if defined(windows): - {.push importc, dynlib: "librocksdb.so" .} + {.push importc, dynlib: "librocksdb.so".} # Do I need importc for static lib? include ./rocksdb_gen.nim diff --git a/rocksdb/lib/rocksdb_gen.nim b/rocksdb/lib/rocksdb_gen.nim index c736517..1f79588 100644 --- a/rocksdb/lib/rocksdb_gen.nim +++ b/rocksdb/lib/rocksdb_gen.nim @@ -43,267 +43,562 @@ ## Exported types - ## DB operations -proc rocksdb_open*(options: ptr rocksdb_options_t; name: cstring; errptr: cstringArray): ptr rocksdb_t {. - cdecl.} -proc rocksdb_open_with_ttl*(options: ptr rocksdb_options_t; name: cstring; ttl: cint; - errptr: cstringArray): ptr rocksdb_t {.cdecl.} -proc rocksdb_open_for_read_only*(options: ptr rocksdb_options_t; name: cstring; - error_if_wal_file_exists: uint8; - errptr: cstringArray): ptr rocksdb_t {.cdecl.} -proc rocksdb_open_as_secondary*(options: ptr rocksdb_options_t; name: cstring; - secondary_path: cstring; errptr: cstringArray): ptr rocksdb_t {. - cdecl.} -proc rocksdb_backup_engine_open*(options: ptr rocksdb_options_t; path: cstring; - errptr: cstringArray): ptr rocksdb_backup_engine_t {. - cdecl.} -proc rocksdb_backup_engine_open_opts*(options: ptr rocksdb_backup_engine_options_t; - env: ptr rocksdb_env_t; errptr: cstringArray): ptr rocksdb_backup_engine_t {. - cdecl.} -proc rocksdb_backup_engine_create_new_backup*(be: ptr rocksdb_backup_engine_t; - db: ptr rocksdb_t; errptr: cstringArray) {.cdecl.} +proc rocksdb_open*( + options: ptr rocksdb_options_t, name: cstring, errptr: cstringArray +): ptr rocksdb_t {.cdecl.} + +proc rocksdb_open_with_ttl*( + options: ptr rocksdb_options_t, name: cstring, ttl: cint, errptr: cstringArray +): ptr rocksdb_t {.cdecl.} + +proc rocksdb_open_for_read_only*( + options: ptr rocksdb_options_t, + name: cstring, + error_if_wal_file_exists: uint8, + errptr: cstringArray, +): ptr rocksdb_t {.cdecl.} + +proc rocksdb_open_as_secondary*( + options: ptr rocksdb_options_t, + name: cstring, + secondary_path: cstring, + errptr: cstringArray, +): ptr rocksdb_t {.cdecl.} + +proc rocksdb_backup_engine_open*( + options: ptr rocksdb_options_t, path: cstring, errptr: cstringArray +): ptr rocksdb_backup_engine_t {.cdecl.} + +proc rocksdb_backup_engine_open_opts*( + options: ptr rocksdb_backup_engine_options_t, + env: ptr rocksdb_env_t, + errptr: cstringArray, +): ptr rocksdb_backup_engine_t {.cdecl.} + +proc rocksdb_backup_engine_create_new_backup*( + be: ptr rocksdb_backup_engine_t, db: ptr rocksdb_t, errptr: cstringArray +) {.cdecl.} + proc rocksdb_backup_engine_create_new_backup_flush*( - be: ptr rocksdb_backup_engine_t; db: ptr rocksdb_t; flush_before_backup: uint8; - errptr: cstringArray) {.cdecl.} -proc rocksdb_backup_engine_purge_old_backups*(be: ptr rocksdb_backup_engine_t; - num_backups_to_keep: uint32; errptr: cstringArray) {.cdecl.} + be: ptr rocksdb_backup_engine_t, + db: ptr rocksdb_t, + flush_before_backup: uint8, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_backup_engine_purge_old_backups*( + be: ptr rocksdb_backup_engine_t, num_backups_to_keep: uint32, errptr: cstringArray +) {.cdecl.} + proc rocksdb_restore_options_create*(): ptr rocksdb_restore_options_t {.cdecl.} proc rocksdb_restore_options_destroy*(opt: ptr rocksdb_restore_options_t) {.cdecl.} proc rocksdb_restore_options_set_keep_log_files*( - opt: ptr rocksdb_restore_options_t; v: cint) {.cdecl.} -proc rocksdb_backup_engine_verify_backup*(be: ptr rocksdb_backup_engine_t; - backup_id: uint32; errptr: cstringArray) {.cdecl.} + opt: ptr rocksdb_restore_options_t, v: cint +) {.cdecl.} + +proc rocksdb_backup_engine_verify_backup*( + be: ptr rocksdb_backup_engine_t, backup_id: uint32, errptr: cstringArray +) {.cdecl.} + proc rocksdb_backup_engine_restore_db_from_latest_backup*( - be: ptr rocksdb_backup_engine_t; db_dir: cstring; wal_dir: cstring; - restore_options: ptr rocksdb_restore_options_t; errptr: cstringArray) {.cdecl.} + be: ptr rocksdb_backup_engine_t, + db_dir: cstring, + wal_dir: cstring, + restore_options: ptr rocksdb_restore_options_t, + errptr: cstringArray, +) {.cdecl.} + proc rocksdb_backup_engine_restore_db_from_backup*( - be: ptr rocksdb_backup_engine_t; db_dir: cstring; wal_dir: cstring; - restore_options: ptr rocksdb_restore_options_t; backup_id: uint32; - errptr: cstringArray) {.cdecl.} -proc rocksdb_backup_engine_get_backup_info*(be: ptr rocksdb_backup_engine_t): ptr rocksdb_backup_engine_info_t {. - cdecl.} -proc rocksdb_backup_engine_info_count*(info: ptr rocksdb_backup_engine_info_t): cint {. - cdecl.} + be: ptr rocksdb_backup_engine_t, + db_dir: cstring, + wal_dir: cstring, + restore_options: ptr rocksdb_restore_options_t, + backup_id: uint32, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_backup_engine_get_backup_info*( + be: ptr rocksdb_backup_engine_t +): ptr rocksdb_backup_engine_info_t {.cdecl.} + +proc rocksdb_backup_engine_info_count*( + info: ptr rocksdb_backup_engine_info_t +): cint {.cdecl.} + proc rocksdb_backup_engine_info_timestamp*( - info: ptr rocksdb_backup_engine_info_t; index: cint): int64 {.cdecl.} + info: ptr rocksdb_backup_engine_info_t, index: cint +): int64 {.cdecl.} + proc rocksdb_backup_engine_info_backup_id*( - info: ptr rocksdb_backup_engine_info_t; index: cint): uint32 {.cdecl.} -proc rocksdb_backup_engine_info_size*(info: ptr rocksdb_backup_engine_info_t; - index: cint): uint64 {.cdecl.} + info: ptr rocksdb_backup_engine_info_t, index: cint +): uint32 {.cdecl.} + +proc rocksdb_backup_engine_info_size*( + info: ptr rocksdb_backup_engine_info_t, index: cint +): uint64 {.cdecl.} + proc rocksdb_backup_engine_info_number_files*( - info: ptr rocksdb_backup_engine_info_t; index: cint): uint32 {.cdecl.} -proc rocksdb_backup_engine_info_destroy*(info: ptr rocksdb_backup_engine_info_t) {. - cdecl.} + info: ptr rocksdb_backup_engine_info_t, index: cint +): uint32 {.cdecl.} + +proc rocksdb_backup_engine_info_destroy*( + info: ptr rocksdb_backup_engine_info_t +) {.cdecl.} + proc rocksdb_backup_engine_close*(be: ptr rocksdb_backup_engine_t) {.cdecl.} -proc rocksdb_put_with_ts*(db: ptr rocksdb_t; options: ptr rocksdb_writeoptions_t; - key: cstring; keylen: csize_t; ts: cstring; tslen: csize_t; - val: cstring; vallen: csize_t; errptr: cstringArray) {.cdecl.} -proc rocksdb_put_cf_with_ts*(db: ptr rocksdb_t; options: ptr rocksdb_writeoptions_t; - column_family: ptr rocksdb_column_family_handle_t; - key: cstring; keylen: csize_t; ts: cstring; - tslen: csize_t; val: cstring; vallen: csize_t; - errptr: cstringArray) {.cdecl.} -proc rocksdb_delete_with_ts*(db: ptr rocksdb_t; options: ptr rocksdb_writeoptions_t; - key: cstring; keylen: csize_t; ts: cstring; - tslen: csize_t; errptr: cstringArray) {.cdecl.} -proc rocksdb_delete_cf_with_ts*(db: ptr rocksdb_t; - options: ptr rocksdb_writeoptions_t; column_family: ptr rocksdb_column_family_handle_t; - key: cstring; keylen: csize_t; ts: cstring; - tslen: csize_t; errptr: cstringArray) {.cdecl.} -proc rocksdb_singledelete*(db: ptr rocksdb_t; options: ptr rocksdb_writeoptions_t; - key: cstring; keylen: csize_t; errptr: cstringArray) {.cdecl.} -proc rocksdb_singledelete_cf*(db: ptr rocksdb_t; - options: ptr rocksdb_writeoptions_t; - column_family: ptr rocksdb_column_family_handle_t; - key: cstring; keylen: csize_t; errptr: cstringArray) {. - cdecl.} -proc rocksdb_singledelete_with_ts*(db: ptr rocksdb_t; - options: ptr rocksdb_writeoptions_t; - key: cstring; keylen: csize_t; ts: cstring; - tslen: csize_t; errptr: cstringArray) {.cdecl.} -proc rocksdb_singledelete_cf_with_ts*(db: ptr rocksdb_t; - options: ptr rocksdb_writeoptions_t; - column_family: ptr rocksdb_column_family_handle_t; key: cstring; keylen: csize_t; - ts: cstring; tslen: csize_t; - errptr: cstringArray) {.cdecl.} -proc rocksdb_increase_full_history_ts_low*(db: ptr rocksdb_t; - column_family: ptr rocksdb_column_family_handle_t; ts_low: cstring; - ts_lowlen: csize_t; errptr: cstringArray) {.cdecl.} -proc rocksdb_get_full_history_ts_low*(db: ptr rocksdb_t; column_family: ptr rocksdb_column_family_handle_t; - ts_lowlen: ptr csize_t; errptr: cstringArray): cstring {. - cdecl.} +proc rocksdb_put_with_ts*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + key: cstring, + keylen: csize_t, + ts: cstring, + tslen: csize_t, + val: cstring, + vallen: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_put_cf_with_ts*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + keylen: csize_t, + ts: cstring, + tslen: csize_t, + val: cstring, + vallen: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_delete_with_ts*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + key: cstring, + keylen: csize_t, + ts: cstring, + tslen: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_delete_cf_with_ts*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + keylen: csize_t, + ts: cstring, + tslen: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_singledelete*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + key: cstring, + keylen: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_singledelete_cf*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + keylen: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_singledelete_with_ts*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + key: cstring, + keylen: csize_t, + ts: cstring, + tslen: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_singledelete_cf_with_ts*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + keylen: csize_t, + ts: cstring, + tslen: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_increase_full_history_ts_low*( + db: ptr rocksdb_t, + column_family: ptr rocksdb_column_family_handle_t, + ts_low: cstring, + ts_lowlen: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_get_full_history_ts_low*( + db: ptr rocksdb_t, + column_family: ptr rocksdb_column_family_handle_t, + ts_lowlen: ptr csize_t, + errptr: cstringArray, +): cstring {.cdecl.} + ## BackupEngineOptions -proc rocksdb_backup_engine_options_create*(backup_dir: cstring): ptr rocksdb_backup_engine_options_t {. - cdecl.} +proc rocksdb_backup_engine_options_create*( + backup_dir: cstring +): ptr rocksdb_backup_engine_options_t {.cdecl.} + proc rocksdb_backup_engine_options_set_backup_dir*( - options: ptr rocksdb_backup_engine_options_t; backup_dir: cstring) {.cdecl.} + options: ptr rocksdb_backup_engine_options_t, backup_dir: cstring +) {.cdecl.} + proc rocksdb_backup_engine_options_set_env*( - options: ptr rocksdb_backup_engine_options_t; env: ptr rocksdb_env_t) {.cdecl.} + options: ptr rocksdb_backup_engine_options_t, env: ptr rocksdb_env_t +) {.cdecl.} + proc rocksdb_backup_engine_options_set_share_table_files*( - options: ptr rocksdb_backup_engine_options_t; val: uint8) {.cdecl.} + options: ptr rocksdb_backup_engine_options_t, val: uint8 +) {.cdecl.} + proc rocksdb_backup_engine_options_get_share_table_files*( - options: ptr rocksdb_backup_engine_options_t): uint8 {.cdecl.} + options: ptr rocksdb_backup_engine_options_t +): uint8 {.cdecl.} + proc rocksdb_backup_engine_options_set_sync*( - options: ptr rocksdb_backup_engine_options_t; val: uint8) {.cdecl.} + options: ptr rocksdb_backup_engine_options_t, val: uint8 +) {.cdecl.} + proc rocksdb_backup_engine_options_get_sync*( - options: ptr rocksdb_backup_engine_options_t): uint8 {.cdecl.} + options: ptr rocksdb_backup_engine_options_t +): uint8 {.cdecl.} + proc rocksdb_backup_engine_options_set_destroy_old_data*( - options: ptr rocksdb_backup_engine_options_t; val: uint8) {.cdecl.} + options: ptr rocksdb_backup_engine_options_t, val: uint8 +) {.cdecl.} + proc rocksdb_backup_engine_options_get_destroy_old_data*( - options: ptr rocksdb_backup_engine_options_t): uint8 {.cdecl.} + options: ptr rocksdb_backup_engine_options_t +): uint8 {.cdecl.} + proc rocksdb_backup_engine_options_set_backup_log_files*( - options: ptr rocksdb_backup_engine_options_t; val: uint8) {.cdecl.} + options: ptr rocksdb_backup_engine_options_t, val: uint8 +) {.cdecl.} + proc rocksdb_backup_engine_options_get_backup_log_files*( - options: ptr rocksdb_backup_engine_options_t): uint8 {.cdecl.} + options: ptr rocksdb_backup_engine_options_t +): uint8 {.cdecl.} + proc rocksdb_backup_engine_options_set_backup_rate_limit*( - options: ptr rocksdb_backup_engine_options_t; limit: uint64) {.cdecl.} + options: ptr rocksdb_backup_engine_options_t, limit: uint64 +) {.cdecl.} + proc rocksdb_backup_engine_options_get_backup_rate_limit*( - options: ptr rocksdb_backup_engine_options_t): uint64 {.cdecl.} + options: ptr rocksdb_backup_engine_options_t +): uint64 {.cdecl.} + proc rocksdb_backup_engine_options_set_restore_rate_limit*( - options: ptr rocksdb_backup_engine_options_t; limit: uint64) {.cdecl.} + options: ptr rocksdb_backup_engine_options_t, limit: uint64 +) {.cdecl.} + proc rocksdb_backup_engine_options_get_restore_rate_limit*( - options: ptr rocksdb_backup_engine_options_t): uint64 {.cdecl.} + options: ptr rocksdb_backup_engine_options_t +): uint64 {.cdecl.} + proc rocksdb_backup_engine_options_set_max_background_operations*( - options: ptr rocksdb_backup_engine_options_t; val: cint) {.cdecl.} + options: ptr rocksdb_backup_engine_options_t, val: cint +) {.cdecl.} + proc rocksdb_backup_engine_options_get_max_background_operations*( - options: ptr rocksdb_backup_engine_options_t): cint {.cdecl.} + options: ptr rocksdb_backup_engine_options_t +): cint {.cdecl.} + proc rocksdb_backup_engine_options_set_callback_trigger_interval_size*( - options: ptr rocksdb_backup_engine_options_t; size: uint64) {.cdecl.} + options: ptr rocksdb_backup_engine_options_t, size: uint64 +) {.cdecl.} + proc rocksdb_backup_engine_options_get_callback_trigger_interval_size*( - options: ptr rocksdb_backup_engine_options_t): uint64 {.cdecl.} + options: ptr rocksdb_backup_engine_options_t +): uint64 {.cdecl.} + proc rocksdb_backup_engine_options_set_max_valid_backups_to_open*( - options: ptr rocksdb_backup_engine_options_t; val: cint) {.cdecl.} + options: ptr rocksdb_backup_engine_options_t, val: cint +) {.cdecl.} + proc rocksdb_backup_engine_options_get_max_valid_backups_to_open*( - options: ptr rocksdb_backup_engine_options_t): cint {.cdecl.} + options: ptr rocksdb_backup_engine_options_t +): cint {.cdecl.} + proc rocksdb_backup_engine_options_set_share_files_with_checksum_naming*( - options: ptr rocksdb_backup_engine_options_t; val: cint) {.cdecl.} + options: ptr rocksdb_backup_engine_options_t, val: cint +) {.cdecl.} + proc rocksdb_backup_engine_options_get_share_files_with_checksum_naming*( - options: ptr rocksdb_backup_engine_options_t): cint {.cdecl.} + options: ptr rocksdb_backup_engine_options_t +): cint {.cdecl.} + proc rocksdb_backup_engine_options_destroy*( - a1: ptr rocksdb_backup_engine_options_t) {.cdecl.} + a1: ptr rocksdb_backup_engine_options_t +) {.cdecl.} + ## Checkpoint -proc rocksdb_checkpoint_object_create*(db: ptr rocksdb_t; errptr: cstringArray): ptr rocksdb_checkpoint_t {. - cdecl.} -proc rocksdb_checkpoint_create*(checkpoint: ptr rocksdb_checkpoint_t; - checkpoint_dir: cstring; - log_size_for_flush: uint64; errptr: cstringArray) {. - cdecl.} -proc rocksdb_checkpoint_object_destroy*(checkpoint: ptr rocksdb_checkpoint_t) {. - cdecl.} -proc rocksdb_open_and_trim_history*(options: ptr rocksdb_options_t; name: cstring; - num_column_families: cint; - column_family_names: cstringArray; - column_family_options: ptr ptr rocksdb_options_t; column_family_handles: ptr ptr rocksdb_column_family_handle_t; - trim_ts: cstring; trim_tslen: csize_t; - errptr: cstringArray): ptr rocksdb_t {.cdecl.} -proc rocksdb_open_column_families*(options: ptr rocksdb_options_t; name: cstring; - num_column_families: cint; - column_family_names: cstringArray; - column_family_options: ptr ptr rocksdb_options_t; column_family_handles: ptr ptr rocksdb_column_family_handle_t; - errptr: cstringArray): ptr rocksdb_t {.cdecl.} -proc rocksdb_open_column_families_with_ttl*(options: ptr rocksdb_options_t; - name: cstring; num_column_families: cint; column_family_names: cstringArray; - column_family_options: ptr ptr rocksdb_options_t; - column_family_handles: ptr ptr rocksdb_column_family_handle_t; ttls: ptr cint; - errptr: cstringArray): ptr rocksdb_t {.cdecl.} -proc rocksdb_open_for_read_only_column_families*(options: ptr rocksdb_options_t; - name: cstring; num_column_families: cint; column_family_names: cstringArray; - column_family_options: ptr ptr rocksdb_options_t; - column_family_handles: ptr ptr rocksdb_column_family_handle_t; - error_if_wal_file_exists: uint8; errptr: cstringArray): ptr rocksdb_t {.cdecl.} -proc rocksdb_open_as_secondary_column_families*(options: ptr rocksdb_options_t; - name: cstring; secondary_path: cstring; num_column_families: cint; - column_family_names: cstringArray; - column_family_options: ptr ptr rocksdb_options_t; - column_family_handles: ptr ptr rocksdb_column_family_handle_t; - errptr: cstringArray): ptr rocksdb_t {.cdecl.} -proc rocksdb_list_column_families*(options: ptr rocksdb_options_t; name: cstring; - lencf: ptr csize_t; errptr: cstringArray): cstringArray {. - cdecl.} -proc rocksdb_list_column_families_destroy*(list: cstringArray; len: csize_t) {.cdecl.} -proc rocksdb_create_column_family*(db: ptr rocksdb_t; - column_family_options: ptr rocksdb_options_t; - column_family_name: cstring; - errptr: cstringArray): ptr rocksdb_column_family_handle_t {. - cdecl.} -proc rocksdb_create_column_families*(db: ptr rocksdb_t; column_family_options: ptr rocksdb_options_t; - num_column_families: cint; - column_family_names: cstringArray; - lencfs: ptr csize_t; errptr: cstringArray): ptr ptr rocksdb_column_family_handle_t {. - cdecl.} +proc rocksdb_checkpoint_object_create*( + db: ptr rocksdb_t, errptr: cstringArray +): ptr rocksdb_checkpoint_t {.cdecl.} + +proc rocksdb_checkpoint_create*( + checkpoint: ptr rocksdb_checkpoint_t, + checkpoint_dir: cstring, + log_size_for_flush: uint64, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_checkpoint_object_destroy*(checkpoint: ptr rocksdb_checkpoint_t) {.cdecl.} +proc rocksdb_open_and_trim_history*( + options: ptr rocksdb_options_t, + name: cstring, + num_column_families: cint, + column_family_names: cstringArray, + column_family_options: ptr ptr rocksdb_options_t, + column_family_handles: ptr ptr rocksdb_column_family_handle_t, + trim_ts: cstring, + trim_tslen: csize_t, + errptr: cstringArray, +): ptr rocksdb_t {.cdecl.} + +proc rocksdb_open_column_families*( + options: ptr rocksdb_options_t, + name: cstring, + num_column_families: cint, + column_family_names: cstringArray, + column_family_options: ptr ptr rocksdb_options_t, + column_family_handles: ptr ptr rocksdb_column_family_handle_t, + errptr: cstringArray, +): ptr rocksdb_t {.cdecl.} + +proc rocksdb_open_column_families_with_ttl*( + options: ptr rocksdb_options_t, + name: cstring, + num_column_families: cint, + column_family_names: cstringArray, + column_family_options: ptr ptr rocksdb_options_t, + column_family_handles: ptr ptr rocksdb_column_family_handle_t, + ttls: ptr cint, + errptr: cstringArray, +): ptr rocksdb_t {.cdecl.} + +proc rocksdb_open_for_read_only_column_families*( + options: ptr rocksdb_options_t, + name: cstring, + num_column_families: cint, + column_family_names: cstringArray, + column_family_options: ptr ptr rocksdb_options_t, + column_family_handles: ptr ptr rocksdb_column_family_handle_t, + error_if_wal_file_exists: uint8, + errptr: cstringArray, +): ptr rocksdb_t {.cdecl.} + +proc rocksdb_open_as_secondary_column_families*( + options: ptr rocksdb_options_t, + name: cstring, + secondary_path: cstring, + num_column_families: cint, + column_family_names: cstringArray, + column_family_options: ptr ptr rocksdb_options_t, + column_family_handles: ptr ptr rocksdb_column_family_handle_t, + errptr: cstringArray, +): ptr rocksdb_t {.cdecl.} + +proc rocksdb_list_column_families*( + options: ptr rocksdb_options_t, + name: cstring, + lencf: ptr csize_t, + errptr: cstringArray, +): cstringArray {.cdecl.} + +proc rocksdb_list_column_families_destroy*(list: cstringArray, len: csize_t) {.cdecl.} +proc rocksdb_create_column_family*( + db: ptr rocksdb_t, + column_family_options: ptr rocksdb_options_t, + column_family_name: cstring, + errptr: cstringArray, +): ptr rocksdb_column_family_handle_t {.cdecl.} + +proc rocksdb_create_column_families*( + db: ptr rocksdb_t, + column_family_options: ptr rocksdb_options_t, + num_column_families: cint, + column_family_names: cstringArray, + lencfs: ptr csize_t, + errptr: cstringArray, +): ptr ptr rocksdb_column_family_handle_t {.cdecl.} + proc rocksdb_create_column_families_destroy*( - list: ptr ptr rocksdb_column_family_handle_t) {.cdecl.} -proc rocksdb_create_column_family_with_ttl*(db: ptr rocksdb_t; - column_family_options: ptr rocksdb_options_t; column_family_name: cstring; - ttl: cint; errptr: cstringArray): ptr rocksdb_column_family_handle_t {.cdecl.} -proc rocksdb_drop_column_family*(db: ptr rocksdb_t; - handle: ptr rocksdb_column_family_handle_t; - errptr: cstringArray) {.cdecl.} -proc rocksdb_get_default_column_family_handle*(db: ptr rocksdb_t): ptr rocksdb_column_family_handle_t {. - cdecl.} -proc rocksdb_column_family_handle_destroy*(a1: ptr rocksdb_column_family_handle_t) {. - cdecl.} + list: ptr ptr rocksdb_column_family_handle_t +) {.cdecl.} + +proc rocksdb_create_column_family_with_ttl*( + db: ptr rocksdb_t, + column_family_options: ptr rocksdb_options_t, + column_family_name: cstring, + ttl: cint, + errptr: cstringArray, +): ptr rocksdb_column_family_handle_t {.cdecl.} + +proc rocksdb_drop_column_family*( + db: ptr rocksdb_t, handle: ptr rocksdb_column_family_handle_t, errptr: cstringArray +) {.cdecl.} + +proc rocksdb_get_default_column_family_handle*( + db: ptr rocksdb_t +): ptr rocksdb_column_family_handle_t {.cdecl.} + +proc rocksdb_column_family_handle_destroy*( + a1: ptr rocksdb_column_family_handle_t +) {.cdecl.} + proc rocksdb_column_family_handle_get_id*( - handle: ptr rocksdb_column_family_handle_t): uint32 {.cdecl.} + handle: ptr rocksdb_column_family_handle_t +): uint32 {.cdecl.} + proc rocksdb_column_family_handle_get_name*( - handle: ptr rocksdb_column_family_handle_t; name_len: ptr csize_t): cstring {.cdecl.} + handle: ptr rocksdb_column_family_handle_t, name_len: ptr csize_t +): cstring {.cdecl.} + proc rocksdb_close*(db: ptr rocksdb_t) {.cdecl.} -proc rocksdb_put*(db: ptr rocksdb_t; options: ptr rocksdb_writeoptions_t; key: cstring; - keylen: csize_t; val: cstring; vallen: csize_t; errptr: cstringArray) {. - cdecl.} -proc rocksdb_put_cf*(db: ptr rocksdb_t; options: ptr rocksdb_writeoptions_t; - column_family: ptr rocksdb_column_family_handle_t; - key: cstring; keylen: csize_t; val: cstring; vallen: csize_t; - errptr: cstringArray) {.cdecl.} -proc rocksdb_delete*(db: ptr rocksdb_t; options: ptr rocksdb_writeoptions_t; - key: cstring; keylen: csize_t; errptr: cstringArray) {.cdecl.} -proc rocksdb_delete_cf*(db: ptr rocksdb_t; options: ptr rocksdb_writeoptions_t; - column_family: ptr rocksdb_column_family_handle_t; - key: cstring; keylen: csize_t; errptr: cstringArray) {.cdecl.} -proc rocksdb_delete_range_cf*(db: ptr rocksdb_t; - options: ptr rocksdb_writeoptions_t; - column_family: ptr rocksdb_column_family_handle_t; - start_key: cstring; start_key_len: csize_t; - end_key: cstring; end_key_len: csize_t; - errptr: cstringArray) {.cdecl.} -proc rocksdb_merge*(db: ptr rocksdb_t; options: ptr rocksdb_writeoptions_t; - key: cstring; keylen: csize_t; val: cstring; vallen: csize_t; - errptr: cstringArray) {.cdecl.} -proc rocksdb_merge_cf*(db: ptr rocksdb_t; options: ptr rocksdb_writeoptions_t; - column_family: ptr rocksdb_column_family_handle_t; - key: cstring; keylen: csize_t; val: cstring; vallen: csize_t; - errptr: cstringArray) {.cdecl.} -proc rocksdb_write*(db: ptr rocksdb_t; options: ptr rocksdb_writeoptions_t; - batch: ptr rocksdb_writebatch_t; errptr: cstringArray) {.cdecl.} +proc rocksdb_put*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + key: cstring, + keylen: csize_t, + val: cstring, + vallen: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_put_cf*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + keylen: csize_t, + val: cstring, + vallen: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_delete*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + key: cstring, + keylen: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_delete_cf*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + keylen: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_delete_range_cf*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + start_key: cstring, + start_key_len: csize_t, + end_key: cstring, + end_key_len: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_merge*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + key: cstring, + keylen: csize_t, + val: cstring, + vallen: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_merge_cf*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + keylen: csize_t, + val: cstring, + vallen: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_write*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + batch: ptr rocksdb_writebatch_t, + errptr: cstringArray, +) {.cdecl.} + ## Returns NULL if not found. A malloc()ed array otherwise. ## Stores the length of the array in *vallen. -proc rocksdb_get*(db: ptr rocksdb_t; options: ptr rocksdb_readoptions_t; key: cstring; - keylen: csize_t; vallen: ptr csize_t; errptr: cstringArray): cstring {. - cdecl.} -proc rocksdb_get_with_ts*(db: ptr rocksdb_t; options: ptr rocksdb_readoptions_t; - key: cstring; keylen: csize_t; vallen: ptr csize_t; - ts: cstringArray; tslen: ptr csize_t; errptr: cstringArray): cstring {. - cdecl.} -proc rocksdb_get_cf*(db: ptr rocksdb_t; options: ptr rocksdb_readoptions_t; - column_family: ptr rocksdb_column_family_handle_t; - key: cstring; keylen: csize_t; vallen: ptr csize_t; - errptr: cstringArray): cstring {.cdecl.} -proc rocksdb_get_cf_with_ts*(db: ptr rocksdb_t; options: ptr rocksdb_readoptions_t; - column_family: ptr rocksdb_column_family_handle_t; - key: cstring; keylen: csize_t; vallen: ptr csize_t; - ts: cstringArray; tslen: ptr csize_t; - errptr: cstringArray): cstring {.cdecl.} +proc rocksdb_get*( + db: ptr rocksdb_t, + options: ptr rocksdb_readoptions_t, + key: cstring, + keylen: csize_t, + vallen: ptr csize_t, + errptr: cstringArray, +): cstring {.cdecl.} + +proc rocksdb_get_with_ts*( + db: ptr rocksdb_t, + options: ptr rocksdb_readoptions_t, + key: cstring, + keylen: csize_t, + vallen: ptr csize_t, + ts: cstringArray, + tslen: ptr csize_t, + errptr: cstringArray, +): cstring {.cdecl.} + +proc rocksdb_get_cf*( + db: ptr rocksdb_t, + options: ptr rocksdb_readoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + keylen: csize_t, + vallen: ptr csize_t, + errptr: cstringArray, +): cstring {.cdecl.} + +proc rocksdb_get_cf_with_ts*( + db: ptr rocksdb_t, + options: ptr rocksdb_readoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + keylen: csize_t, + vallen: ptr csize_t, + ts: cstringArray, + tslen: ptr csize_t, + errptr: cstringArray, +): cstring {.cdecl.} + ## ## Returns a malloc() buffer with the DB identity, assigning the length to ## *id_len. Returns NULL if an error occurred. ## -proc rocksdb_get_db_identity*(db: ptr rocksdb_t; id_len: ptr csize_t): cstring {.cdecl.} +proc rocksdb_get_db_identity*(db: ptr rocksdb_t, id_len: ptr csize_t): cstring {.cdecl.} ## if values_list[i] == NULL and errs[i] == NULL, ## then we got status.IsNotFound(), which we will not return. ## all errors except status status.ok() and status.IsNotFound() are returned. @@ -316,34 +611,56 @@ proc rocksdb_get_db_identity*(db: ptr rocksdb_t; id_len: ptr csize_t): cstring { ## each non-NULL values_list entry is a malloc()ed array, with ## the length for each stored in values_list_sizes[i]. -proc rocksdb_multi_get*(db: ptr rocksdb_t; options: ptr rocksdb_readoptions_t; - num_keys: csize_t; keys_list: cstringArray; - keys_list_sizes: ptr csize_t; values_list: cstringArray; - values_list_sizes: ptr csize_t; errs: cstringArray) {.cdecl.} -proc rocksdb_multi_get_with_ts*(db: ptr rocksdb_t; - options: ptr rocksdb_readoptions_t; - num_keys: csize_t; keys_list: cstringArray; - keys_list_sizes: ptr csize_t; - values_list: cstringArray; - values_list_sizes: ptr csize_t; - timestamp_list: cstringArray; - timestamp_list_sizes: ptr csize_t; - errs: cstringArray) {.cdecl.} -proc rocksdb_multi_get_cf*(db: ptr rocksdb_t; options: ptr rocksdb_readoptions_t; - column_families: ptr ptr rocksdb_column_family_handle_t; num_keys: csize_t; - keys_list: cstringArray; keys_list_sizes: ptr csize_t; - values_list: cstringArray; - values_list_sizes: ptr csize_t; errs: cstringArray) {.cdecl.} -proc rocksdb_multi_get_cf_with_ts*(db: ptr rocksdb_t; - options: ptr rocksdb_readoptions_t; - column_families: ptr ptr rocksdb_column_family_handle_t; num_keys: csize_t; - keys_list: cstringArray; - keys_list_sizes: ptr csize_t; - values_list: cstringArray; - values_list_sizes: ptr csize_t; - timestamps_list: cstringArray; - timestamps_list_sizes: ptr csize_t; - errs: cstringArray) {.cdecl.} +proc rocksdb_multi_get*( + db: ptr rocksdb_t, + options: ptr rocksdb_readoptions_t, + num_keys: csize_t, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + values_list: cstringArray, + values_list_sizes: ptr csize_t, + errs: cstringArray, +) {.cdecl.} + +proc rocksdb_multi_get_with_ts*( + db: ptr rocksdb_t, + options: ptr rocksdb_readoptions_t, + num_keys: csize_t, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + values_list: cstringArray, + values_list_sizes: ptr csize_t, + timestamp_list: cstringArray, + timestamp_list_sizes: ptr csize_t, + errs: cstringArray, +) {.cdecl.} + +proc rocksdb_multi_get_cf*( + db: ptr rocksdb_t, + options: ptr rocksdb_readoptions_t, + column_families: ptr ptr rocksdb_column_family_handle_t, + num_keys: csize_t, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + values_list: cstringArray, + values_list_sizes: ptr csize_t, + errs: cstringArray, +) {.cdecl.} + +proc rocksdb_multi_get_cf_with_ts*( + db: ptr rocksdb_t, + options: ptr rocksdb_readoptions_t, + column_families: ptr ptr rocksdb_column_family_handle_t, + num_keys: csize_t, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + values_list: cstringArray, + values_list_sizes: ptr csize_t, + timestamps_list: cstringArray, + timestamps_list_sizes: ptr csize_t, + errs: cstringArray, +) {.cdecl.} + ## The MultiGet API that improves performance by batching operations ## in the read path for greater efficiency. Currently, only the block based ## table format with full filters are supported. Other table formats such @@ -371,374 +688,771 @@ proc rocksdb_multi_get_cf_with_ts*(db: ptr rocksdb_t; ## internally by the API - the input array will not be ## modified -proc rocksdb_batched_multi_get_cf*(db: ptr rocksdb_t; - options: ptr rocksdb_readoptions_t; column_family: ptr rocksdb_column_family_handle_t; - num_keys: csize_t; keys_list: cstringArray; - keys_list_sizes: ptr csize_t; - values: ptr ptr rocksdb_pinnableslice_t; - errs: cstringArray; sorted_input: bool) {.cdecl.} +proc rocksdb_batched_multi_get_cf*( + db: ptr rocksdb_t, + options: ptr rocksdb_readoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + num_keys: csize_t, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + values: ptr ptr rocksdb_pinnableslice_t, + errs: cstringArray, + sorted_input: bool, +) {.cdecl.} + ## The value is only allocated (using malloc) and returned if it is found and ## value_found isn't NULL. In that case the user is responsible for freeing it. -proc rocksdb_key_may_exist*(db: ptr rocksdb_t; options: ptr rocksdb_readoptions_t; - key: cstring; key_len: csize_t; value: cstringArray; - val_len: ptr csize_t; timestamp: cstring; - timestamp_len: csize_t; value_found: ptr uint8): uint8 {. - cdecl.} +proc rocksdb_key_may_exist*( + db: ptr rocksdb_t, + options: ptr rocksdb_readoptions_t, + key: cstring, + key_len: csize_t, + value: cstringArray, + val_len: ptr csize_t, + timestamp: cstring, + timestamp_len: csize_t, + value_found: ptr uint8, +): uint8 {.cdecl.} + ## The value is only allocated (using malloc) and returned if it is found and ## value_found isn't NULL. In that case the user is responsible for freeing it. -proc rocksdb_key_may_exist_cf*(db: ptr rocksdb_t; - options: ptr rocksdb_readoptions_t; column_family: ptr rocksdb_column_family_handle_t; - key: cstring; key_len: csize_t; value: cstringArray; - val_len: ptr csize_t; timestamp: cstring; - timestamp_len: csize_t; value_found: ptr uint8): uint8 {. - cdecl.} -proc rocksdb_create_iterator*(db: ptr rocksdb_t; options: ptr rocksdb_readoptions_t): ptr rocksdb_iterator_t {. - cdecl.} -proc rocksdb_get_updates_since*(db: ptr rocksdb_t; seq_number: uint64; - options: ptr rocksdb_wal_readoptions_t; - errptr: cstringArray): ptr rocksdb_wal_iterator_t {. - cdecl.} -proc rocksdb_create_iterator_cf*(db: ptr rocksdb_t; - options: ptr rocksdb_readoptions_t; column_family: ptr rocksdb_column_family_handle_t): ptr rocksdb_iterator_t {. - cdecl.} -proc rocksdb_create_iterators*(db: ptr rocksdb_t; opts: ptr rocksdb_readoptions_t; - column_families: ptr ptr rocksdb_column_family_handle_t; - iterators: ptr ptr rocksdb_iterator_t; size: csize_t; - errptr: cstringArray) {.cdecl.} +proc rocksdb_key_may_exist_cf*( + db: ptr rocksdb_t, + options: ptr rocksdb_readoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + key_len: csize_t, + value: cstringArray, + val_len: ptr csize_t, + timestamp: cstring, + timestamp_len: csize_t, + value_found: ptr uint8, +): uint8 {.cdecl.} + +proc rocksdb_create_iterator*( + db: ptr rocksdb_t, options: ptr rocksdb_readoptions_t +): ptr rocksdb_iterator_t {.cdecl.} + +proc rocksdb_get_updates_since*( + db: ptr rocksdb_t, + seq_number: uint64, + options: ptr rocksdb_wal_readoptions_t, + errptr: cstringArray, +): ptr rocksdb_wal_iterator_t {.cdecl.} + +proc rocksdb_create_iterator_cf*( + db: ptr rocksdb_t, + options: ptr rocksdb_readoptions_t, + column_family: ptr rocksdb_column_family_handle_t, +): ptr rocksdb_iterator_t {.cdecl.} + +proc rocksdb_create_iterators*( + db: ptr rocksdb_t, + opts: ptr rocksdb_readoptions_t, + column_families: ptr ptr rocksdb_column_family_handle_t, + iterators: ptr ptr rocksdb_iterator_t, + size: csize_t, + errptr: cstringArray, +) {.cdecl.} + proc rocksdb_create_snapshot*(db: ptr rocksdb_t): ptr rocksdb_snapshot_t {.cdecl.} -proc rocksdb_release_snapshot*(db: ptr rocksdb_t; snapshot: ptr rocksdb_snapshot_t) {. - cdecl.} -proc rocksdb_snapshot_get_sequence_number*(snapshot: ptr rocksdb_snapshot_t): uint64 {. - cdecl.} +proc rocksdb_release_snapshot*( + db: ptr rocksdb_t, snapshot: ptr rocksdb_snapshot_t +) {.cdecl.} + +proc rocksdb_snapshot_get_sequence_number*( + snapshot: ptr rocksdb_snapshot_t +): uint64 {.cdecl.} + ## Returns NULL if property name is unknown. ## Else returns a pointer to a malloc()-ed null-terminated value. -proc rocksdb_property_value*(db: ptr rocksdb_t; propname: cstring): cstring {.cdecl.} +proc rocksdb_property_value*(db: ptr rocksdb_t, propname: cstring): cstring {.cdecl.} ## returns 0 on success, -1 otherwise -proc rocksdb_property_int*(db: ptr rocksdb_t; propname: cstring; out_val: ptr uint64): cint {. - cdecl.} +proc rocksdb_property_int*( + db: ptr rocksdb_t, propname: cstring, out_val: ptr uint64 +): cint {.cdecl.} + ## returns 0 on success, -1 otherwise -proc rocksdb_property_int_cf*(db: ptr rocksdb_t; - column_family: ptr rocksdb_column_family_handle_t; - propname: cstring; out_val: ptr uint64): cint {.cdecl.} -proc rocksdb_property_value_cf*(db: ptr rocksdb_t; column_family: ptr rocksdb_column_family_handle_t; - propname: cstring): cstring {.cdecl.} -proc rocksdb_approximate_sizes*(db: ptr rocksdb_t; num_ranges: cint; - range_start_key: cstringArray; - range_start_key_len: ptr csize_t; - range_limit_key: cstringArray; - range_limit_key_len: ptr csize_t; sizes: ptr uint64; - errptr: cstringArray) {.cdecl.} -proc rocksdb_approximate_sizes_cf*(db: ptr rocksdb_t; column_family: ptr rocksdb_column_family_handle_t; - num_ranges: cint; range_start_key: cstringArray; - range_start_key_len: ptr csize_t; - range_limit_key: cstringArray; - range_limit_key_len: ptr csize_t; - sizes: ptr uint64; errptr: cstringArray) {.cdecl.} +proc rocksdb_property_int_cf*( + db: ptr rocksdb_t, + column_family: ptr rocksdb_column_family_handle_t, + propname: cstring, + out_val: ptr uint64, +): cint {.cdecl.} + +proc rocksdb_property_value_cf*( + db: ptr rocksdb_t, + column_family: ptr rocksdb_column_family_handle_t, + propname: cstring, +): cstring {.cdecl.} + +proc rocksdb_approximate_sizes*( + db: ptr rocksdb_t, + num_ranges: cint, + range_start_key: cstringArray, + range_start_key_len: ptr csize_t, + range_limit_key: cstringArray, + range_limit_key_len: ptr csize_t, + sizes: ptr uint64, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_approximate_sizes_cf*( + db: ptr rocksdb_t, + column_family: ptr rocksdb_column_family_handle_t, + num_ranges: cint, + range_start_key: cstringArray, + range_start_key_len: ptr csize_t, + range_limit_key: cstringArray, + range_limit_key_len: ptr csize_t, + sizes: ptr uint64, + errptr: cstringArray, +) {.cdecl.} + const rocksdb_size_approximation_flags_none* = 0 rocksdb_size_approximation_flags_include_memtable* = 1 shl 0 rocksdb_size_approximation_flags_include_files* = 1 shl 1 -proc rocksdb_approximate_sizes_cf_with_flags*(db: ptr rocksdb_t; - column_family: ptr rocksdb_column_family_handle_t; num_ranges: cint; - range_start_key: cstringArray; range_start_key_len: ptr csize_t; - range_limit_key: cstringArray; range_limit_key_len: ptr csize_t; - include_flags: uint8; sizes: ptr uint64; errptr: cstringArray) {.cdecl.} -proc rocksdb_compact_range*(db: ptr rocksdb_t; start_key: cstring; - start_key_len: csize_t; limit_key: cstring; - limit_key_len: csize_t) {.cdecl.} -proc rocksdb_compact_range_cf*(db: ptr rocksdb_t; column_family: ptr rocksdb_column_family_handle_t; - start_key: cstring; start_key_len: csize_t; - limit_key: cstring; limit_key_len: csize_t) {.cdecl.} -proc rocksdb_suggest_compact_range*(db: ptr rocksdb_t; start_key: cstring; - start_key_len: csize_t; limit_key: cstring; - limit_key_len: csize_t; errptr: cstringArray) {. - cdecl.} -proc rocksdb_suggest_compact_range_cf*(db: ptr rocksdb_t; column_family: ptr rocksdb_column_family_handle_t; - start_key: cstring; start_key_len: csize_t; - limit_key: cstring; limit_key_len: csize_t; - errptr: cstringArray) {.cdecl.} -proc rocksdb_compact_range_opt*(db: ptr rocksdb_t; - opt: ptr rocksdb_compactoptions_t; - start_key: cstring; start_key_len: csize_t; - limit_key: cstring; limit_key_len: csize_t) {.cdecl.} -proc rocksdb_compact_range_cf_opt*(db: ptr rocksdb_t; column_family: ptr rocksdb_column_family_handle_t; - opt: ptr rocksdb_compactoptions_t; - start_key: cstring; start_key_len: csize_t; - limit_key: cstring; limit_key_len: csize_t) {. - cdecl.} -proc rocksdb_delete_file*(db: ptr rocksdb_t; name: cstring) {.cdecl.} +proc rocksdb_approximate_sizes_cf_with_flags*( + db: ptr rocksdb_t, + column_family: ptr rocksdb_column_family_handle_t, + num_ranges: cint, + range_start_key: cstringArray, + range_start_key_len: ptr csize_t, + range_limit_key: cstringArray, + range_limit_key_len: ptr csize_t, + include_flags: uint8, + sizes: ptr uint64, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_compact_range*( + db: ptr rocksdb_t, + start_key: cstring, + start_key_len: csize_t, + limit_key: cstring, + limit_key_len: csize_t, +) {.cdecl.} + +proc rocksdb_compact_range_cf*( + db: ptr rocksdb_t, + column_family: ptr rocksdb_column_family_handle_t, + start_key: cstring, + start_key_len: csize_t, + limit_key: cstring, + limit_key_len: csize_t, +) {.cdecl.} + +proc rocksdb_suggest_compact_range*( + db: ptr rocksdb_t, + start_key: cstring, + start_key_len: csize_t, + limit_key: cstring, + limit_key_len: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_suggest_compact_range_cf*( + db: ptr rocksdb_t, + column_family: ptr rocksdb_column_family_handle_t, + start_key: cstring, + start_key_len: csize_t, + limit_key: cstring, + limit_key_len: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_compact_range_opt*( + db: ptr rocksdb_t, + opt: ptr rocksdb_compactoptions_t, + start_key: cstring, + start_key_len: csize_t, + limit_key: cstring, + limit_key_len: csize_t, +) {.cdecl.} + +proc rocksdb_compact_range_cf_opt*( + db: ptr rocksdb_t, + column_family: ptr rocksdb_column_family_handle_t, + opt: ptr rocksdb_compactoptions_t, + start_key: cstring, + start_key_len: csize_t, + limit_key: cstring, + limit_key_len: csize_t, +) {.cdecl.} + +proc rocksdb_delete_file*(db: ptr rocksdb_t, name: cstring) {.cdecl.} proc rocksdb_livefiles*(db: ptr rocksdb_t): ptr rocksdb_livefiles_t {.cdecl.} -proc rocksdb_flush*(db: ptr rocksdb_t; options: ptr rocksdb_flushoptions_t; - errptr: cstringArray) {.cdecl.} -proc rocksdb_flush_cf*(db: ptr rocksdb_t; options: ptr rocksdb_flushoptions_t; - column_family: ptr rocksdb_column_family_handle_t; - errptr: cstringArray) {.cdecl.} -proc rocksdb_flush_cfs*(db: ptr rocksdb_t; options: ptr rocksdb_flushoptions_t; - column_family: ptr ptr rocksdb_column_family_handle_t; - num_column_families: cint; errptr: cstringArray) {.cdecl.} -proc rocksdb_flush_wal*(db: ptr rocksdb_t; sync: uint8; errptr: cstringArray) {.cdecl.} -proc rocksdb_disable_file_deletions*(db: ptr rocksdb_t; errptr: cstringArray) {.cdecl.} -proc rocksdb_enable_file_deletions*(db: ptr rocksdb_t; errptr: cstringArray) {.cdecl.} +proc rocksdb_flush*( + db: ptr rocksdb_t, options: ptr rocksdb_flushoptions_t, errptr: cstringArray +) {.cdecl.} + +proc rocksdb_flush_cf*( + db: ptr rocksdb_t, + options: ptr rocksdb_flushoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_flush_cfs*( + db: ptr rocksdb_t, + options: ptr rocksdb_flushoptions_t, + column_family: ptr ptr rocksdb_column_family_handle_t, + num_column_families: cint, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_flush_wal*(db: ptr rocksdb_t, sync: uint8, errptr: cstringArray) {.cdecl.} +proc rocksdb_disable_file_deletions*(db: ptr rocksdb_t, errptr: cstringArray) {.cdecl.} +proc rocksdb_enable_file_deletions*(db: ptr rocksdb_t, errptr: cstringArray) {.cdecl.} ## Management operations -proc rocksdb_destroy_db*(options: ptr rocksdb_options_t; name: cstring; - errptr: cstringArray) {.cdecl.} -proc rocksdb_repair_db*(options: ptr rocksdb_options_t; name: cstring; - errptr: cstringArray) {.cdecl.} +proc rocksdb_destroy_db*( + options: ptr rocksdb_options_t, name: cstring, errptr: cstringArray +) {.cdecl.} + +proc rocksdb_repair_db*( + options: ptr rocksdb_options_t, name: cstring, errptr: cstringArray +) {.cdecl.} + ## Iterator proc rocksdb_iter_destroy*(a1: ptr rocksdb_iterator_t) {.cdecl.} proc rocksdb_iter_valid*(a1: ptr rocksdb_iterator_t): uint8 {.cdecl.} proc rocksdb_iter_seek_to_first*(a1: ptr rocksdb_iterator_t) {.cdecl.} proc rocksdb_iter_seek_to_last*(a1: ptr rocksdb_iterator_t) {.cdecl.} -proc rocksdb_iter_seek*(a1: ptr rocksdb_iterator_t; k: cstring; klen: csize_t) {.cdecl.} -proc rocksdb_iter_seek_for_prev*(a1: ptr rocksdb_iterator_t; k: cstring; klen: csize_t) {. - cdecl.} +proc rocksdb_iter_seek*(a1: ptr rocksdb_iterator_t, k: cstring, klen: csize_t) {.cdecl.} +proc rocksdb_iter_seek_for_prev*( + a1: ptr rocksdb_iterator_t, k: cstring, klen: csize_t +) {.cdecl.} + proc rocksdb_iter_next*(a1: ptr rocksdb_iterator_t) {.cdecl.} proc rocksdb_iter_prev*(a1: ptr rocksdb_iterator_t) {.cdecl.} -proc rocksdb_iter_key*(a1: ptr rocksdb_iterator_t; klen: ptr csize_t): cstring {.cdecl.} -proc rocksdb_iter_value*(a1: ptr rocksdb_iterator_t; vlen: ptr csize_t): cstring {.cdecl.} -proc rocksdb_iter_timestamp*(a1: ptr rocksdb_iterator_t; tslen: ptr csize_t): cstring {. - cdecl.} -proc rocksdb_iter_get_error*(a1: ptr rocksdb_iterator_t; errptr: cstringArray) {.cdecl.} -proc rocksdb_iter_refresh*(iter: ptr rocksdb_iterator_t; errptr: cstringArray) {.cdecl.} +proc rocksdb_iter_key*(a1: ptr rocksdb_iterator_t, klen: ptr csize_t): cstring {.cdecl.} +proc rocksdb_iter_value*( + a1: ptr rocksdb_iterator_t, vlen: ptr csize_t +): cstring {.cdecl.} + +proc rocksdb_iter_timestamp*( + a1: ptr rocksdb_iterator_t, tslen: ptr csize_t +): cstring {.cdecl.} + +proc rocksdb_iter_get_error*(a1: ptr rocksdb_iterator_t, errptr: cstringArray) {.cdecl.} +proc rocksdb_iter_refresh*(iter: ptr rocksdb_iterator_t, errptr: cstringArray) {.cdecl.} proc rocksdb_wal_iter_next*(iter: ptr rocksdb_wal_iterator_t) {.cdecl.} proc rocksdb_wal_iter_valid*(a1: ptr rocksdb_wal_iterator_t): uint8 {.cdecl.} -proc rocksdb_wal_iter_status*(iter: ptr rocksdb_wal_iterator_t; errptr: cstringArray) {. - cdecl.} -proc rocksdb_wal_iter_get_batch*(iter: ptr rocksdb_wal_iterator_t; seq: ptr uint64): ptr rocksdb_writebatch_t {. - cdecl.} +proc rocksdb_wal_iter_status*( + iter: ptr rocksdb_wal_iterator_t, errptr: cstringArray +) {.cdecl.} + +proc rocksdb_wal_iter_get_batch*( + iter: ptr rocksdb_wal_iterator_t, seq: ptr uint64 +): ptr rocksdb_writebatch_t {.cdecl.} + proc rocksdb_get_latest_sequence_number*(db: ptr rocksdb_t): uint64 {.cdecl.} proc rocksdb_wal_iter_destroy*(iter: ptr rocksdb_wal_iterator_t) {.cdecl.} ## Write batch proc rocksdb_writebatch_create*(): ptr rocksdb_writebatch_t {.cdecl.} -proc rocksdb_writebatch_create_from*(rep: cstring; size: csize_t): ptr rocksdb_writebatch_t {. - cdecl.} -proc rocksdb_writebatch_create_with_params*(reserved_bytes: csize_t; - max_bytes: csize_t; protection_bytes_per_key: csize_t; default_cf_ts_sz: csize_t): ptr rocksdb_writebatch_t {. - cdecl.} +proc rocksdb_writebatch_create_from*( + rep: cstring, size: csize_t +): ptr rocksdb_writebatch_t {.cdecl.} + +proc rocksdb_writebatch_create_with_params*( + reserved_bytes: csize_t, + max_bytes: csize_t, + protection_bytes_per_key: csize_t, + default_cf_ts_sz: csize_t, +): ptr rocksdb_writebatch_t {.cdecl.} + proc rocksdb_writebatch_destroy*(a1: ptr rocksdb_writebatch_t) {.cdecl.} proc rocksdb_writebatch_clear*(a1: ptr rocksdb_writebatch_t) {.cdecl.} proc rocksdb_writebatch_count*(a1: ptr rocksdb_writebatch_t): cint {.cdecl.} -proc rocksdb_writebatch_put*(a1: ptr rocksdb_writebatch_t; key: cstring; - klen: csize_t; val: cstring; vlen: csize_t) {.cdecl.} -proc rocksdb_writebatch_put_cf*(a1: ptr rocksdb_writebatch_t; column_family: ptr rocksdb_column_family_handle_t; - key: cstring; klen: csize_t; val: cstring; - vlen: csize_t) {.cdecl.} -proc rocksdb_writebatch_put_cf_with_ts*(a1: ptr rocksdb_writebatch_t; column_family: ptr rocksdb_column_family_handle_t; - key: cstring; klen: csize_t; ts: cstring; - tslen: csize_t; val: cstring; vlen: csize_t) {. - cdecl.} -proc rocksdb_writebatch_putv*(b: ptr rocksdb_writebatch_t; num_keys: cint; - keys_list: cstringArray; - keys_list_sizes: ptr csize_t; num_values: cint; - values_list: cstringArray; - values_list_sizes: ptr csize_t) {.cdecl.} -proc rocksdb_writebatch_putv_cf*(b: ptr rocksdb_writebatch_t; column_family: ptr rocksdb_column_family_handle_t; - num_keys: cint; keys_list: cstringArray; - keys_list_sizes: ptr csize_t; num_values: cint; - values_list: cstringArray; - values_list_sizes: ptr csize_t) {.cdecl.} -proc rocksdb_writebatch_merge*(a1: ptr rocksdb_writebatch_t; key: cstring; - klen: csize_t; val: cstring; vlen: csize_t) {.cdecl.} -proc rocksdb_writebatch_merge_cf*(a1: ptr rocksdb_writebatch_t; column_family: ptr rocksdb_column_family_handle_t; - key: cstring; klen: csize_t; val: cstring; - vlen: csize_t) {.cdecl.} -proc rocksdb_writebatch_mergev*(b: ptr rocksdb_writebatch_t; num_keys: cint; - keys_list: cstringArray; - keys_list_sizes: ptr csize_t; num_values: cint; - values_list: cstringArray; - values_list_sizes: ptr csize_t) {.cdecl.} -proc rocksdb_writebatch_mergev_cf*(b: ptr rocksdb_writebatch_t; column_family: ptr rocksdb_column_family_handle_t; - num_keys: cint; keys_list: cstringArray; - keys_list_sizes: ptr csize_t; num_values: cint; - values_list: cstringArray; - values_list_sizes: ptr csize_t) {.cdecl.} -proc rocksdb_writebatch_delete*(a1: ptr rocksdb_writebatch_t; key: cstring; - klen: csize_t) {.cdecl.} -proc rocksdb_writebatch_singledelete*(b: ptr rocksdb_writebatch_t; key: cstring; - klen: csize_t) {.cdecl.} -proc rocksdb_writebatch_delete_cf*(a1: ptr rocksdb_writebatch_t; column_family: ptr rocksdb_column_family_handle_t; - key: cstring; klen: csize_t) {.cdecl.} -proc rocksdb_writebatch_delete_cf_with_ts*(a1: ptr rocksdb_writebatch_t; - column_family: ptr rocksdb_column_family_handle_t; key: cstring; klen: csize_t; - ts: cstring; tslen: csize_t) {.cdecl.} -proc rocksdb_writebatch_singledelete_cf*(b: ptr rocksdb_writebatch_t; column_family: ptr rocksdb_column_family_handle_t; - key: cstring; klen: csize_t) {.cdecl.} -proc rocksdb_writebatch_singledelete_cf_with_ts*(b: ptr rocksdb_writebatch_t; - column_family: ptr rocksdb_column_family_handle_t; key: cstring; klen: csize_t; - ts: cstring; tslen: csize_t) {.cdecl.} -proc rocksdb_writebatch_deletev*(b: ptr rocksdb_writebatch_t; num_keys: cint; - keys_list: cstringArray; - keys_list_sizes: ptr csize_t) {.cdecl.} -proc rocksdb_writebatch_deletev_cf*(b: ptr rocksdb_writebatch_t; column_family: ptr rocksdb_column_family_handle_t; - num_keys: cint; keys_list: cstringArray; - keys_list_sizes: ptr csize_t) {.cdecl.} -proc rocksdb_writebatch_delete_range*(b: ptr rocksdb_writebatch_t; - start_key: cstring; start_key_len: csize_t; - end_key: cstring; end_key_len: csize_t) {.cdecl.} -proc rocksdb_writebatch_delete_range_cf*(b: ptr rocksdb_writebatch_t; column_family: ptr rocksdb_column_family_handle_t; - start_key: cstring; - start_key_len: csize_t; end_key: cstring; - end_key_len: csize_t) {.cdecl.} -proc rocksdb_writebatch_delete_rangev*(b: ptr rocksdb_writebatch_t; num_keys: cint; - start_keys_list: cstringArray; - start_keys_list_sizes: ptr csize_t; - end_keys_list: cstringArray; - end_keys_list_sizes: ptr csize_t) {.cdecl.} -proc rocksdb_writebatch_delete_rangev_cf*(b: ptr rocksdb_writebatch_t; - column_family: ptr rocksdb_column_family_handle_t; num_keys: cint; - start_keys_list: cstringArray; start_keys_list_sizes: ptr csize_t; - end_keys_list: cstringArray; end_keys_list_sizes: ptr csize_t) {.cdecl.} -proc rocksdb_writebatch_put_log_data*(a1: ptr rocksdb_writebatch_t; blob: cstring; - len: csize_t) {.cdecl.} -proc rocksdb_writebatch_iterate*(a1: ptr rocksdb_writebatch_t; state: pointer; put: proc ( - a1: pointer; k: cstring; klen: csize_t; v: cstring; vlen: csize_t) {.cdecl.}; deleted: proc ( - a1: pointer; k: cstring; klen: csize_t) {.cdecl.}) {.cdecl.} -proc rocksdb_writebatch_iterate_cf*(a1: ptr rocksdb_writebatch_t; state: pointer; - put_cf: proc (a1: pointer; cfid: uint32; k: cstring; klen: csize_t; v: cstring; - vlen: csize_t) {.cdecl.}; deleted_cf: proc (a1: pointer; cfid: uint32; - k: cstring; klen: csize_t) {.cdecl.}; merge_cf: proc (a1: pointer; cfid: uint32; - k: cstring; klen: csize_t; v: cstring; vlen: csize_t) {.cdecl.}) {.cdecl.} -proc rocksdb_writebatch_data*(a1: ptr rocksdb_writebatch_t; size: ptr csize_t): cstring {. - cdecl.} +proc rocksdb_writebatch_put*( + a1: ptr rocksdb_writebatch_t, key: cstring, klen: csize_t, val: cstring, vlen: csize_t +) {.cdecl.} + +proc rocksdb_writebatch_put_cf*( + a1: ptr rocksdb_writebatch_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, + val: cstring, + vlen: csize_t, +) {.cdecl.} + +proc rocksdb_writebatch_put_cf_with_ts*( + a1: ptr rocksdb_writebatch_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, + ts: cstring, + tslen: csize_t, + val: cstring, + vlen: csize_t, +) {.cdecl.} + +proc rocksdb_writebatch_putv*( + b: ptr rocksdb_writebatch_t, + num_keys: cint, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + num_values: cint, + values_list: cstringArray, + values_list_sizes: ptr csize_t, +) {.cdecl.} + +proc rocksdb_writebatch_putv_cf*( + b: ptr rocksdb_writebatch_t, + column_family: ptr rocksdb_column_family_handle_t, + num_keys: cint, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + num_values: cint, + values_list: cstringArray, + values_list_sizes: ptr csize_t, +) {.cdecl.} + +proc rocksdb_writebatch_merge*( + a1: ptr rocksdb_writebatch_t, key: cstring, klen: csize_t, val: cstring, vlen: csize_t +) {.cdecl.} + +proc rocksdb_writebatch_merge_cf*( + a1: ptr rocksdb_writebatch_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, + val: cstring, + vlen: csize_t, +) {.cdecl.} + +proc rocksdb_writebatch_mergev*( + b: ptr rocksdb_writebatch_t, + num_keys: cint, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + num_values: cint, + values_list: cstringArray, + values_list_sizes: ptr csize_t, +) {.cdecl.} + +proc rocksdb_writebatch_mergev_cf*( + b: ptr rocksdb_writebatch_t, + column_family: ptr rocksdb_column_family_handle_t, + num_keys: cint, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + num_values: cint, + values_list: cstringArray, + values_list_sizes: ptr csize_t, +) {.cdecl.} + +proc rocksdb_writebatch_delete*( + a1: ptr rocksdb_writebatch_t, key: cstring, klen: csize_t +) {.cdecl.} + +proc rocksdb_writebatch_singledelete*( + b: ptr rocksdb_writebatch_t, key: cstring, klen: csize_t +) {.cdecl.} + +proc rocksdb_writebatch_delete_cf*( + a1: ptr rocksdb_writebatch_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, +) {.cdecl.} + +proc rocksdb_writebatch_delete_cf_with_ts*( + a1: ptr rocksdb_writebatch_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, + ts: cstring, + tslen: csize_t, +) {.cdecl.} + +proc rocksdb_writebatch_singledelete_cf*( + b: ptr rocksdb_writebatch_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, +) {.cdecl.} + +proc rocksdb_writebatch_singledelete_cf_with_ts*( + b: ptr rocksdb_writebatch_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, + ts: cstring, + tslen: csize_t, +) {.cdecl.} + +proc rocksdb_writebatch_deletev*( + b: ptr rocksdb_writebatch_t, + num_keys: cint, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, +) {.cdecl.} + +proc rocksdb_writebatch_deletev_cf*( + b: ptr rocksdb_writebatch_t, + column_family: ptr rocksdb_column_family_handle_t, + num_keys: cint, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, +) {.cdecl.} + +proc rocksdb_writebatch_delete_range*( + b: ptr rocksdb_writebatch_t, + start_key: cstring, + start_key_len: csize_t, + end_key: cstring, + end_key_len: csize_t, +) {.cdecl.} + +proc rocksdb_writebatch_delete_range_cf*( + b: ptr rocksdb_writebatch_t, + column_family: ptr rocksdb_column_family_handle_t, + start_key: cstring, + start_key_len: csize_t, + end_key: cstring, + end_key_len: csize_t, +) {.cdecl.} + +proc rocksdb_writebatch_delete_rangev*( + b: ptr rocksdb_writebatch_t, + num_keys: cint, + start_keys_list: cstringArray, + start_keys_list_sizes: ptr csize_t, + end_keys_list: cstringArray, + end_keys_list_sizes: ptr csize_t, +) {.cdecl.} + +proc rocksdb_writebatch_delete_rangev_cf*( + b: ptr rocksdb_writebatch_t, + column_family: ptr rocksdb_column_family_handle_t, + num_keys: cint, + start_keys_list: cstringArray, + start_keys_list_sizes: ptr csize_t, + end_keys_list: cstringArray, + end_keys_list_sizes: ptr csize_t, +) {.cdecl.} + +proc rocksdb_writebatch_put_log_data*( + a1: ptr rocksdb_writebatch_t, blob: cstring, len: csize_t +) {.cdecl.} + +proc rocksdb_writebatch_iterate*( + a1: ptr rocksdb_writebatch_t, + state: pointer, + put: proc(a1: pointer, k: cstring, klen: csize_t, v: cstring, vlen: csize_t) {.cdecl.}, + deleted: proc(a1: pointer, k: cstring, klen: csize_t) {.cdecl.}, +) {.cdecl.} + +proc rocksdb_writebatch_iterate_cf*( + a1: ptr rocksdb_writebatch_t, + state: pointer, + put_cf: proc( + a1: pointer, cfid: uint32, k: cstring, klen: csize_t, v: cstring, vlen: csize_t + ) {.cdecl.}, + deleted_cf: proc(a1: pointer, cfid: uint32, k: cstring, klen: csize_t) {.cdecl.}, + merge_cf: proc( + a1: pointer, cfid: uint32, k: cstring, klen: csize_t, v: cstring, vlen: csize_t + ) {.cdecl.}, +) {.cdecl.} + +proc rocksdb_writebatch_data*( + a1: ptr rocksdb_writebatch_t, size: ptr csize_t +): cstring {.cdecl.} + proc rocksdb_writebatch_set_save_point*(a1: ptr rocksdb_writebatch_t) {.cdecl.} -proc rocksdb_writebatch_rollback_to_save_point*(a1: ptr rocksdb_writebatch_t; - errptr: cstringArray) {.cdecl.} -proc rocksdb_writebatch_pop_save_point*(a1: ptr rocksdb_writebatch_t; - errptr: cstringArray) {.cdecl.} -proc rocksdb_writebatch_update_timestamps*(wb: ptr rocksdb_writebatch_t; - ts: cstring; tslen: csize_t; state: pointer; - get_ts_size: proc (a1: pointer; a2: uint32): csize_t {.cdecl.}; errptr: cstringArray) {. - cdecl.} +proc rocksdb_writebatch_rollback_to_save_point*( + a1: ptr rocksdb_writebatch_t, errptr: cstringArray +) {.cdecl.} + +proc rocksdb_writebatch_pop_save_point*( + a1: ptr rocksdb_writebatch_t, errptr: cstringArray +) {.cdecl.} + +proc rocksdb_writebatch_update_timestamps*( + wb: ptr rocksdb_writebatch_t, + ts: cstring, + tslen: csize_t, + state: pointer, + get_ts_size: proc(a1: pointer, a2: uint32): csize_t {.cdecl.}, + errptr: cstringArray, +) {.cdecl.} + ## Write batch with index -proc rocksdb_writebatch_wi_create*(reserved_bytes: csize_t; overwrite_keys: uint8): ptr rocksdb_writebatch_wi_t {. - cdecl.} -proc rocksdb_writebatch_wi_create_from*(rep: cstring; size: csize_t): ptr rocksdb_writebatch_wi_t {. - cdecl.} +proc rocksdb_writebatch_wi_create*( + reserved_bytes: csize_t, overwrite_keys: uint8 +): ptr rocksdb_writebatch_wi_t {.cdecl.} + +proc rocksdb_writebatch_wi_create_from*( + rep: cstring, size: csize_t +): ptr rocksdb_writebatch_wi_t {.cdecl.} + proc rocksdb_writebatch_wi_create_with_params*( - backup_index_comparator: ptr rocksdb_comparator_t; reserved_bytes: csize_t; - overwrite_key: uint8; max_bytes: csize_t; protection_bytes_per_key: csize_t): ptr rocksdb_writebatch_wi_t {. - cdecl.} + backup_index_comparator: ptr rocksdb_comparator_t, + reserved_bytes: csize_t, + overwrite_key: uint8, + max_bytes: csize_t, + protection_bytes_per_key: csize_t, +): ptr rocksdb_writebatch_wi_t {.cdecl.} + proc rocksdb_writebatch_wi_destroy*(a1: ptr rocksdb_writebatch_wi_t) {.cdecl.} proc rocksdb_writebatch_wi_clear*(a1: ptr rocksdb_writebatch_wi_t) {.cdecl.} proc rocksdb_writebatch_wi_count*(b: ptr rocksdb_writebatch_wi_t): cint {.cdecl.} -proc rocksdb_writebatch_wi_put*(a1: ptr rocksdb_writebatch_wi_t; key: cstring; - klen: csize_t; val: cstring; vlen: csize_t) {.cdecl.} -proc rocksdb_writebatch_wi_put_cf*(a1: ptr rocksdb_writebatch_wi_t; column_family: ptr rocksdb_column_family_handle_t; - key: cstring; klen: csize_t; val: cstring; - vlen: csize_t) {.cdecl.} -proc rocksdb_writebatch_wi_putv*(b: ptr rocksdb_writebatch_wi_t; num_keys: cint; - keys_list: cstringArray; - keys_list_sizes: ptr csize_t; num_values: cint; - values_list: cstringArray; - values_list_sizes: ptr csize_t) {.cdecl.} -proc rocksdb_writebatch_wi_putv_cf*(b: ptr rocksdb_writebatch_wi_t; column_family: ptr rocksdb_column_family_handle_t; - num_keys: cint; keys_list: cstringArray; - keys_list_sizes: ptr csize_t; num_values: cint; - values_list: cstringArray; - values_list_sizes: ptr csize_t) {.cdecl.} -proc rocksdb_writebatch_wi_merge*(a1: ptr rocksdb_writebatch_wi_t; key: cstring; - klen: csize_t; val: cstring; vlen: csize_t) {.cdecl.} -proc rocksdb_writebatch_wi_merge_cf*(a1: ptr rocksdb_writebatch_wi_t; column_family: ptr rocksdb_column_family_handle_t; - key: cstring; klen: csize_t; val: cstring; - vlen: csize_t) {.cdecl.} -proc rocksdb_writebatch_wi_mergev*(b: ptr rocksdb_writebatch_wi_t; num_keys: cint; - keys_list: cstringArray; - keys_list_sizes: ptr csize_t; num_values: cint; - values_list: cstringArray; - values_list_sizes: ptr csize_t) {.cdecl.} -proc rocksdb_writebatch_wi_mergev_cf*(b: ptr rocksdb_writebatch_wi_t; column_family: ptr rocksdb_column_family_handle_t; - num_keys: cint; keys_list: cstringArray; - keys_list_sizes: ptr csize_t; - num_values: cint; values_list: cstringArray; - values_list_sizes: ptr csize_t) {.cdecl.} -proc rocksdb_writebatch_wi_delete*(a1: ptr rocksdb_writebatch_wi_t; key: cstring; - klen: csize_t) {.cdecl.} -proc rocksdb_writebatch_wi_singledelete*(a1: ptr rocksdb_writebatch_wi_t; - key: cstring; klen: csize_t) {.cdecl.} -proc rocksdb_writebatch_wi_delete_cf*(a1: ptr rocksdb_writebatch_wi_t; column_family: ptr rocksdb_column_family_handle_t; - key: cstring; klen: csize_t) {.cdecl.} -proc rocksdb_writebatch_wi_singledelete_cf*(a1: ptr rocksdb_writebatch_wi_t; - column_family: ptr rocksdb_column_family_handle_t; key: cstring; klen: csize_t) {. - cdecl.} -proc rocksdb_writebatch_wi_deletev*(b: ptr rocksdb_writebatch_wi_t; num_keys: cint; - keys_list: cstringArray; - keys_list_sizes: ptr csize_t) {.cdecl.} -proc rocksdb_writebatch_wi_deletev_cf*(b: ptr rocksdb_writebatch_wi_t; column_family: ptr rocksdb_column_family_handle_t; - num_keys: cint; keys_list: cstringArray; - keys_list_sizes: ptr csize_t) {.cdecl.} +proc rocksdb_writebatch_wi_put*( + a1: ptr rocksdb_writebatch_wi_t, + key: cstring, + klen: csize_t, + val: cstring, + vlen: csize_t, +) {.cdecl.} + +proc rocksdb_writebatch_wi_put_cf*( + a1: ptr rocksdb_writebatch_wi_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, + val: cstring, + vlen: csize_t, +) {.cdecl.} + +proc rocksdb_writebatch_wi_putv*( + b: ptr rocksdb_writebatch_wi_t, + num_keys: cint, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + num_values: cint, + values_list: cstringArray, + values_list_sizes: ptr csize_t, +) {.cdecl.} + +proc rocksdb_writebatch_wi_putv_cf*( + b: ptr rocksdb_writebatch_wi_t, + column_family: ptr rocksdb_column_family_handle_t, + num_keys: cint, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + num_values: cint, + values_list: cstringArray, + values_list_sizes: ptr csize_t, +) {.cdecl.} + +proc rocksdb_writebatch_wi_merge*( + a1: ptr rocksdb_writebatch_wi_t, + key: cstring, + klen: csize_t, + val: cstring, + vlen: csize_t, +) {.cdecl.} + +proc rocksdb_writebatch_wi_merge_cf*( + a1: ptr rocksdb_writebatch_wi_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, + val: cstring, + vlen: csize_t, +) {.cdecl.} + +proc rocksdb_writebatch_wi_mergev*( + b: ptr rocksdb_writebatch_wi_t, + num_keys: cint, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + num_values: cint, + values_list: cstringArray, + values_list_sizes: ptr csize_t, +) {.cdecl.} + +proc rocksdb_writebatch_wi_mergev_cf*( + b: ptr rocksdb_writebatch_wi_t, + column_family: ptr rocksdb_column_family_handle_t, + num_keys: cint, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + num_values: cint, + values_list: cstringArray, + values_list_sizes: ptr csize_t, +) {.cdecl.} + +proc rocksdb_writebatch_wi_delete*( + a1: ptr rocksdb_writebatch_wi_t, key: cstring, klen: csize_t +) {.cdecl.} + +proc rocksdb_writebatch_wi_singledelete*( + a1: ptr rocksdb_writebatch_wi_t, key: cstring, klen: csize_t +) {.cdecl.} + +proc rocksdb_writebatch_wi_delete_cf*( + a1: ptr rocksdb_writebatch_wi_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, +) {.cdecl.} + +proc rocksdb_writebatch_wi_singledelete_cf*( + a1: ptr rocksdb_writebatch_wi_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, +) {.cdecl.} + +proc rocksdb_writebatch_wi_deletev*( + b: ptr rocksdb_writebatch_wi_t, + num_keys: cint, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, +) {.cdecl.} + +proc rocksdb_writebatch_wi_deletev_cf*( + b: ptr rocksdb_writebatch_wi_t, + column_family: ptr rocksdb_column_family_handle_t, + num_keys: cint, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, +) {.cdecl.} + ## DO NOT USE - rocksdb_writebatch_wi_delete_range is not yet supported -proc rocksdb_writebatch_wi_delete_range*(b: ptr rocksdb_writebatch_wi_t; - start_key: cstring; - start_key_len: csize_t; end_key: cstring; - end_key_len: csize_t) {.cdecl.} +proc rocksdb_writebatch_wi_delete_range*( + b: ptr rocksdb_writebatch_wi_t, + start_key: cstring, + start_key_len: csize_t, + end_key: cstring, + end_key_len: csize_t, +) {.cdecl.} + ## DO NOT USE - rocksdb_writebatch_wi_delete_range_cf is not yet supported -proc rocksdb_writebatch_wi_delete_range_cf*(b: ptr rocksdb_writebatch_wi_t; - column_family: ptr rocksdb_column_family_handle_t; start_key: cstring; - start_key_len: csize_t; end_key: cstring; end_key_len: csize_t) {.cdecl.} +proc rocksdb_writebatch_wi_delete_range_cf*( + b: ptr rocksdb_writebatch_wi_t, + column_family: ptr rocksdb_column_family_handle_t, + start_key: cstring, + start_key_len: csize_t, + end_key: cstring, + end_key_len: csize_t, +) {.cdecl.} + ## DO NOT USE - rocksdb_writebatch_wi_delete_rangev is not yet supported -proc rocksdb_writebatch_wi_delete_rangev*(b: ptr rocksdb_writebatch_wi_t; - num_keys: cint; start_keys_list: cstringArray; - start_keys_list_sizes: ptr csize_t; end_keys_list: cstringArray; - end_keys_list_sizes: ptr csize_t) {.cdecl.} +proc rocksdb_writebatch_wi_delete_rangev*( + b: ptr rocksdb_writebatch_wi_t, + num_keys: cint, + start_keys_list: cstringArray, + start_keys_list_sizes: ptr csize_t, + end_keys_list: cstringArray, + end_keys_list_sizes: ptr csize_t, +) {.cdecl.} + ## DO NOT USE - rocksdb_writebatch_wi_delete_rangev_cf is not yet supported -proc rocksdb_writebatch_wi_delete_rangev_cf*(b: ptr rocksdb_writebatch_wi_t; - column_family: ptr rocksdb_column_family_handle_t; num_keys: cint; - start_keys_list: cstringArray; start_keys_list_sizes: ptr csize_t; - end_keys_list: cstringArray; end_keys_list_sizes: ptr csize_t) {.cdecl.} -proc rocksdb_writebatch_wi_put_log_data*(a1: ptr rocksdb_writebatch_wi_t; - blob: cstring; len: csize_t) {.cdecl.} -proc rocksdb_writebatch_wi_iterate*(b: ptr rocksdb_writebatch_wi_t; state: pointer; - put: proc (a1: pointer; k: cstring; klen: csize_t; v: cstring; vlen: csize_t) {.cdecl.}; - deleted: proc (a1: pointer; k: cstring; klen: csize_t) {.cdecl.}) {.cdecl.} -proc rocksdb_writebatch_wi_data*(b: ptr rocksdb_writebatch_wi_t; size: ptr csize_t): cstring {. - cdecl.} +proc rocksdb_writebatch_wi_delete_rangev_cf*( + b: ptr rocksdb_writebatch_wi_t, + column_family: ptr rocksdb_column_family_handle_t, + num_keys: cint, + start_keys_list: cstringArray, + start_keys_list_sizes: ptr csize_t, + end_keys_list: cstringArray, + end_keys_list_sizes: ptr csize_t, +) {.cdecl.} + +proc rocksdb_writebatch_wi_put_log_data*( + a1: ptr rocksdb_writebatch_wi_t, blob: cstring, len: csize_t +) {.cdecl.} + +proc rocksdb_writebatch_wi_iterate*( + b: ptr rocksdb_writebatch_wi_t, + state: pointer, + put: proc(a1: pointer, k: cstring, klen: csize_t, v: cstring, vlen: csize_t) {.cdecl.}, + deleted: proc(a1: pointer, k: cstring, klen: csize_t) {.cdecl.}, +) {.cdecl.} + +proc rocksdb_writebatch_wi_data*( + b: ptr rocksdb_writebatch_wi_t, size: ptr csize_t +): cstring {.cdecl.} + proc rocksdb_writebatch_wi_set_save_point*(a1: ptr rocksdb_writebatch_wi_t) {.cdecl.} proc rocksdb_writebatch_wi_rollback_to_save_point*( - a1: ptr rocksdb_writebatch_wi_t; errptr: cstringArray) {.cdecl.} -proc rocksdb_writebatch_wi_get_from_batch*(wbwi: ptr rocksdb_writebatch_wi_t; - options: ptr rocksdb_options_t; key: cstring; keylen: csize_t; vallen: ptr csize_t; - errptr: cstringArray): cstring {.cdecl.} -proc rocksdb_writebatch_wi_get_from_batch_cf*(wbwi: ptr rocksdb_writebatch_wi_t; - options: ptr rocksdb_options_t; - column_family: ptr rocksdb_column_family_handle_t; key: cstring; keylen: csize_t; - vallen: ptr csize_t; errptr: cstringArray): cstring {.cdecl.} + a1: ptr rocksdb_writebatch_wi_t, errptr: cstringArray +) {.cdecl.} + +proc rocksdb_writebatch_wi_get_from_batch*( + wbwi: ptr rocksdb_writebatch_wi_t, + options: ptr rocksdb_options_t, + key: cstring, + keylen: csize_t, + vallen: ptr csize_t, + errptr: cstringArray, +): cstring {.cdecl.} + +proc rocksdb_writebatch_wi_get_from_batch_cf*( + wbwi: ptr rocksdb_writebatch_wi_t, + options: ptr rocksdb_options_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + keylen: csize_t, + vallen: ptr csize_t, + errptr: cstringArray, +): cstring {.cdecl.} + proc rocksdb_writebatch_wi_get_from_batch_and_db*( - wbwi: ptr rocksdb_writebatch_wi_t; db: ptr rocksdb_t; - options: ptr rocksdb_readoptions_t; key: cstring; keylen: csize_t; - vallen: ptr csize_t; errptr: cstringArray): cstring {.cdecl.} + wbwi: ptr rocksdb_writebatch_wi_t, + db: ptr rocksdb_t, + options: ptr rocksdb_readoptions_t, + key: cstring, + keylen: csize_t, + vallen: ptr csize_t, + errptr: cstringArray, +): cstring {.cdecl.} + proc rocksdb_writebatch_wi_get_from_batch_and_db_cf*( - wbwi: ptr rocksdb_writebatch_wi_t; db: ptr rocksdb_t; - options: ptr rocksdb_readoptions_t; - column_family: ptr rocksdb_column_family_handle_t; key: cstring; keylen: csize_t; - vallen: ptr csize_t; errptr: cstringArray): cstring {.cdecl.} -proc rocksdb_write_writebatch_wi*(db: ptr rocksdb_t; - options: ptr rocksdb_writeoptions_t; - wbwi: ptr rocksdb_writebatch_wi_t; - errptr: cstringArray) {.cdecl.} + wbwi: ptr rocksdb_writebatch_wi_t, + db: ptr rocksdb_t, + options: ptr rocksdb_readoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + keylen: csize_t, + vallen: ptr csize_t, + errptr: cstringArray, +): cstring {.cdecl.} + +proc rocksdb_write_writebatch_wi*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + wbwi: ptr rocksdb_writebatch_wi_t, + errptr: cstringArray, +) {.cdecl.} + proc rocksdb_writebatch_wi_create_iterator_with_base*( - wbwi: ptr rocksdb_writebatch_wi_t; base_iterator: ptr rocksdb_iterator_t): ptr rocksdb_iterator_t {. - cdecl.} + wbwi: ptr rocksdb_writebatch_wi_t, base_iterator: ptr rocksdb_iterator_t +): ptr rocksdb_iterator_t {.cdecl.} + proc rocksdb_writebatch_wi_create_iterator_with_base_cf*( - wbwi: ptr rocksdb_writebatch_wi_t; base_iterator: ptr rocksdb_iterator_t; - cf: ptr rocksdb_column_family_handle_t): ptr rocksdb_iterator_t {.cdecl.} -proc rocksdb_writebatch_wi_update_timestamps*(wbwi: ptr rocksdb_writebatch_wi_t; - ts: cstring; tslen: csize_t; state: pointer; - get_ts_size: proc (a1: pointer; a2: uint32): csize_t {.cdecl.}; errptr: cstringArray) {. - cdecl.} + wbwi: ptr rocksdb_writebatch_wi_t, + base_iterator: ptr rocksdb_iterator_t, + cf: ptr rocksdb_column_family_handle_t, +): ptr rocksdb_iterator_t {.cdecl.} + +proc rocksdb_writebatch_wi_update_timestamps*( + wbwi: ptr rocksdb_writebatch_wi_t, + ts: cstring, + tslen: csize_t, + state: pointer, + get_ts_size: proc(a1: pointer, a2: uint32): csize_t {.cdecl.}, + errptr: cstringArray, +) {.cdecl.} + ## Options utils ## Load the latest rocksdb options from the specified db_path. ## @@ -751,66 +1465,101 @@ proc rocksdb_writebatch_wi_update_timestamps*(wbwi: ptr rocksdb_writebatch_wi_t; ## returned. db_options, column_family_names, and column_family_options ## will be set to NULL. -proc rocksdb_load_latest_options*(db_path: cstring; env: ptr rocksdb_env_t; - ignore_unknown_options: bool; - cache: ptr rocksdb_cache_t; - db_options: ptr ptr rocksdb_options_t; - num_column_families: ptr csize_t; - column_family_names: ptr cstringArray; - column_family_options: ptr ptr ptr rocksdb_options_t; errptr: cstringArray) {.cdecl.} -proc rocksdb_load_latest_options_destroy*(db_options: ptr rocksdb_options_t; - list_column_family_names: cstringArray; - list_column_family_options: ptr ptr rocksdb_options_t; len: csize_t) {.cdecl.} +proc rocksdb_load_latest_options*( + db_path: cstring, + env: ptr rocksdb_env_t, + ignore_unknown_options: bool, + cache: ptr rocksdb_cache_t, + db_options: ptr ptr rocksdb_options_t, + num_column_families: ptr csize_t, + column_family_names: ptr cstringArray, + column_family_options: ptr ptr ptr rocksdb_options_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_load_latest_options_destroy*( + db_options: ptr rocksdb_options_t, + list_column_family_names: cstringArray, + list_column_family_options: ptr ptr rocksdb_options_t, + len: csize_t, +) {.cdecl.} + ## Block based table options proc rocksdb_block_based_options_create*(): ptr rocksdb_block_based_table_options_t {. - cdecl.} + cdecl +.} + proc rocksdb_block_based_options_destroy*( - options: ptr rocksdb_block_based_table_options_t) {.cdecl.} + options: ptr rocksdb_block_based_table_options_t +) {.cdecl.} + proc rocksdb_block_based_options_set_checksum*( - a1: ptr rocksdb_block_based_table_options_t; a2: char) {.cdecl.} + a1: ptr rocksdb_block_based_table_options_t, a2: char +) {.cdecl.} + proc rocksdb_block_based_options_set_block_size*( - options: ptr rocksdb_block_based_table_options_t; block_size: csize_t) {.cdecl.} + options: ptr rocksdb_block_based_table_options_t, block_size: csize_t +) {.cdecl.} + proc rocksdb_block_based_options_set_block_size_deviation*( - options: ptr rocksdb_block_based_table_options_t; block_size_deviation: cint) {. - cdecl.} + options: ptr rocksdb_block_based_table_options_t, block_size_deviation: cint +) {.cdecl.} + proc rocksdb_block_based_options_set_block_restart_interval*( - options: ptr rocksdb_block_based_table_options_t; block_restart_interval: cint) {. - cdecl.} + options: ptr rocksdb_block_based_table_options_t, block_restart_interval: cint +) {.cdecl.} + proc rocksdb_block_based_options_set_index_block_restart_interval*( - options: ptr rocksdb_block_based_table_options_t; - index_block_restart_interval: cint) {.cdecl.} + options: ptr rocksdb_block_based_table_options_t, index_block_restart_interval: cint +) {.cdecl.} + proc rocksdb_block_based_options_set_metadata_block_size*( - options: ptr rocksdb_block_based_table_options_t; metadata_block_size: uint64) {. - cdecl.} + options: ptr rocksdb_block_based_table_options_t, metadata_block_size: uint64 +) {.cdecl.} + proc rocksdb_block_based_options_set_partition_filters*( - options: ptr rocksdb_block_based_table_options_t; partition_filters: uint8) {. - cdecl.} + options: ptr rocksdb_block_based_table_options_t, partition_filters: uint8 +) {.cdecl.} + proc rocksdb_block_based_options_set_optimize_filters_for_memory*( - options: ptr rocksdb_block_based_table_options_t; - optimize_filters_for_memory: uint8) {.cdecl.} + options: ptr rocksdb_block_based_table_options_t, optimize_filters_for_memory: uint8 +) {.cdecl.} + proc rocksdb_block_based_options_set_use_delta_encoding*( - options: ptr rocksdb_block_based_table_options_t; use_delta_encoding: uint8) {. - cdecl.} + options: ptr rocksdb_block_based_table_options_t, use_delta_encoding: uint8 +) {.cdecl.} + proc rocksdb_block_based_options_set_filter_policy*( - options: ptr rocksdb_block_based_table_options_t; - filter_policy: ptr rocksdb_filterpolicy_t) {.cdecl.} + options: ptr rocksdb_block_based_table_options_t, + filter_policy: ptr rocksdb_filterpolicy_t, +) {.cdecl.} + proc rocksdb_block_based_options_set_no_block_cache*( - options: ptr rocksdb_block_based_table_options_t; no_block_cache: uint8) {.cdecl.} + options: ptr rocksdb_block_based_table_options_t, no_block_cache: uint8 +) {.cdecl.} + proc rocksdb_block_based_options_set_block_cache*( - options: ptr rocksdb_block_based_table_options_t; - block_cache: ptr rocksdb_cache_t) {.cdecl.} + options: ptr rocksdb_block_based_table_options_t, block_cache: ptr rocksdb_cache_t +) {.cdecl.} + proc rocksdb_block_based_options_set_whole_key_filtering*( - a1: ptr rocksdb_block_based_table_options_t; a2: uint8) {.cdecl.} + a1: ptr rocksdb_block_based_table_options_t, a2: uint8 +) {.cdecl.} + proc rocksdb_block_based_options_set_format_version*( - a1: ptr rocksdb_block_based_table_options_t; a2: cint) {.cdecl.} + a1: ptr rocksdb_block_based_table_options_t, a2: cint +) {.cdecl.} + const rocksdb_block_based_table_index_type_binary_search* = 0 rocksdb_block_based_table_index_type_hash_search* = 1 rocksdb_block_based_table_index_type_two_level_index_search* = 2 proc rocksdb_block_based_options_set_index_type*( - a1: ptr rocksdb_block_based_table_options_t; a2: cint) {.cdecl.} + a1: ptr rocksdb_block_based_table_options_t, a2: cint +) {.cdecl.} + ## uses one of the above enums const @@ -818,25 +1567,39 @@ const rocksdb_block_based_table_data_block_index_type_binary_search_and_hash* = 1 proc rocksdb_block_based_options_set_data_block_index_type*( - a1: ptr rocksdb_block_based_table_options_t; a2: cint) {.cdecl.} + a1: ptr rocksdb_block_based_table_options_t, a2: cint +) {.cdecl.} + ## uses one of the above enums proc rocksdb_block_based_options_set_data_block_hash_ratio*( - options: ptr rocksdb_block_based_table_options_t; v: cdouble) {.cdecl.} + options: ptr rocksdb_block_based_table_options_t, v: cdouble +) {.cdecl.} + ## rocksdb_block_based_options_set_hash_index_allow_collision() ## is removed since BlockBasedTableOptions.hash_index_allow_collision() ## is removed proc rocksdb_block_based_options_set_cache_index_and_filter_blocks*( - a1: ptr rocksdb_block_based_table_options_t; a2: uint8) {.cdecl.} + a1: ptr rocksdb_block_based_table_options_t, a2: uint8 +) {.cdecl.} + proc rocksdb_block_based_options_set_cache_index_and_filter_blocks_with_high_priority*( - a1: ptr rocksdb_block_based_table_options_t; a2: uint8) {.cdecl.} + a1: ptr rocksdb_block_based_table_options_t, a2: uint8 +) {.cdecl.} + proc rocksdb_block_based_options_set_pin_l0_filter_and_index_blocks_in_cache*( - a1: ptr rocksdb_block_based_table_options_t; a2: uint8) {.cdecl.} + a1: ptr rocksdb_block_based_table_options_t, a2: uint8 +) {.cdecl.} + proc rocksdb_block_based_options_set_pin_top_level_index_and_filter*( - a1: ptr rocksdb_block_based_table_options_t; a2: uint8) {.cdecl.} -proc rocksdb_options_set_block_based_table_factory*(opt: ptr rocksdb_options_t; - table_options: ptr rocksdb_block_based_table_options_t) {.cdecl.} + a1: ptr rocksdb_block_based_table_options_t, a2: uint8 +) {.cdecl.} + +proc rocksdb_options_set_block_based_table_factory*( + opt: ptr rocksdb_options_t, table_options: ptr rocksdb_block_based_table_options_t +) {.cdecl.} + const rocksdb_block_based_k_fallback_pinning_tier* = 0 rocksdb_block_based_k_none_pinning_tier* = 1 @@ -844,193 +1607,361 @@ const rocksdb_block_based_k_all_pinning_tier* = 3 proc rocksdb_block_based_options_set_top_level_index_pinning_tier*( - a1: ptr rocksdb_block_based_table_options_t; a2: cint) {.cdecl.} + a1: ptr rocksdb_block_based_table_options_t, a2: cint +) {.cdecl.} + proc rocksdb_block_based_options_set_partition_pinning_tier*( - a1: ptr rocksdb_block_based_table_options_t; a2: cint) {.cdecl.} + a1: ptr rocksdb_block_based_table_options_t, a2: cint +) {.cdecl.} + proc rocksdb_block_based_options_set_unpartitioned_pinning_tier*( - a1: ptr rocksdb_block_based_table_options_t; a2: cint) {.cdecl.} -proc rocksdb_options_set_write_buffer_manager*(opt: ptr rocksdb_options_t; - wbm: ptr rocksdb_write_buffer_manager_t) {.cdecl.} + a1: ptr rocksdb_block_based_table_options_t, a2: cint +) {.cdecl.} + +proc rocksdb_options_set_write_buffer_manager*( + opt: ptr rocksdb_options_t, wbm: ptr rocksdb_write_buffer_manager_t +) {.cdecl.} + ## Cuckoo table options proc rocksdb_cuckoo_options_create*(): ptr rocksdb_cuckoo_table_options_t {.cdecl.} -proc rocksdb_cuckoo_options_destroy*(options: ptr rocksdb_cuckoo_table_options_t) {. - cdecl.} +proc rocksdb_cuckoo_options_destroy*( + options: ptr rocksdb_cuckoo_table_options_t +) {.cdecl.} + proc rocksdb_cuckoo_options_set_hash_ratio*( - options: ptr rocksdb_cuckoo_table_options_t; v: cdouble) {.cdecl.} + options: ptr rocksdb_cuckoo_table_options_t, v: cdouble +) {.cdecl.} + proc rocksdb_cuckoo_options_set_max_search_depth*( - options: ptr rocksdb_cuckoo_table_options_t; v: uint32) {.cdecl.} + options: ptr rocksdb_cuckoo_table_options_t, v: uint32 +) {.cdecl.} + proc rocksdb_cuckoo_options_set_cuckoo_block_size*( - options: ptr rocksdb_cuckoo_table_options_t; v: uint32) {.cdecl.} + options: ptr rocksdb_cuckoo_table_options_t, v: uint32 +) {.cdecl.} + proc rocksdb_cuckoo_options_set_identity_as_first_hash*( - options: ptr rocksdb_cuckoo_table_options_t; v: uint8) {.cdecl.} + options: ptr rocksdb_cuckoo_table_options_t, v: uint8 +) {.cdecl.} + proc rocksdb_cuckoo_options_set_use_module_hash*( - options: ptr rocksdb_cuckoo_table_options_t; v: uint8) {.cdecl.} -proc rocksdb_options_set_cuckoo_table_factory*(opt: ptr rocksdb_options_t; - table_options: ptr rocksdb_cuckoo_table_options_t) {.cdecl.} + options: ptr rocksdb_cuckoo_table_options_t, v: uint8 +) {.cdecl.} + +proc rocksdb_options_set_cuckoo_table_factory*( + opt: ptr rocksdb_options_t, table_options: ptr rocksdb_cuckoo_table_options_t +) {.cdecl.} + ## Options -proc rocksdb_set_options*(db: ptr rocksdb_t; count: cint; keys: ptr cstring; - values: ptr cstring; errptr: cstringArray) {.cdecl.} -proc rocksdb_set_options_cf*(db: ptr rocksdb_t; - handle: ptr rocksdb_column_family_handle_t; - count: cint; keys: ptr cstring; values: ptr cstring; - errptr: cstringArray) {.cdecl.} +proc rocksdb_set_options*( + db: ptr rocksdb_t, + count: cint, + keys: ptr cstring, + values: ptr cstring, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_set_options_cf*( + db: ptr rocksdb_t, + handle: ptr rocksdb_column_family_handle_t, + count: cint, + keys: ptr cstring, + values: ptr cstring, + errptr: cstringArray, +) {.cdecl.} + proc rocksdb_options_create*(): ptr rocksdb_options_t {.cdecl.} proc rocksdb_options_destroy*(a1: ptr rocksdb_options_t) {.cdecl.} -proc rocksdb_options_create_copy*(a1: ptr rocksdb_options_t): ptr rocksdb_options_t {. - cdecl.} -proc rocksdb_options_increase_parallelism*(opt: ptr rocksdb_options_t; - total_threads: cint) {.cdecl.} -proc rocksdb_options_optimize_for_point_lookup*(opt: ptr rocksdb_options_t; - block_cache_size_mb: uint64) {.cdecl.} -proc rocksdb_options_optimize_level_style_compaction*(opt: ptr rocksdb_options_t; - memtable_memory_budget: uint64) {.cdecl.} +proc rocksdb_options_create_copy*( + a1: ptr rocksdb_options_t +): ptr rocksdb_options_t {.cdecl.} + +proc rocksdb_options_increase_parallelism*( + opt: ptr rocksdb_options_t, total_threads: cint +) {.cdecl.} + +proc rocksdb_options_optimize_for_point_lookup*( + opt: ptr rocksdb_options_t, block_cache_size_mb: uint64 +) {.cdecl.} + +proc rocksdb_options_optimize_level_style_compaction*( + opt: ptr rocksdb_options_t, memtable_memory_budget: uint64 +) {.cdecl.} + proc rocksdb_options_optimize_universal_style_compaction*( - opt: ptr rocksdb_options_t; memtable_memory_budget: uint64) {.cdecl.} -proc rocksdb_options_set_allow_ingest_behind*(a1: ptr rocksdb_options_t; a2: uint8) {. - cdecl.} -proc rocksdb_options_get_allow_ingest_behind*(a1: ptr rocksdb_options_t): uint8 {. - cdecl.} -proc rocksdb_options_set_compaction_filter*(a1: ptr rocksdb_options_t; - a2: ptr rocksdb_compactionfilter_t) {.cdecl.} -proc rocksdb_options_set_compaction_filter_factory*(a1: ptr rocksdb_options_t; - a2: ptr rocksdb_compactionfilterfactory_t) {.cdecl.} -proc rocksdb_options_compaction_readahead_size*(a1: ptr rocksdb_options_t; - a2: csize_t) {.cdecl.} -proc rocksdb_options_get_compaction_readahead_size*(a1: ptr rocksdb_options_t): csize_t {. - cdecl.} -proc rocksdb_options_set_comparator*(a1: ptr rocksdb_options_t; - a2: ptr rocksdb_comparator_t) {.cdecl.} -proc rocksdb_options_set_merge_operator*(a1: ptr rocksdb_options_t; - a2: ptr rocksdb_mergeoperator_t) {.cdecl.} -proc rocksdb_options_set_uint64add_merge_operator*(a1: ptr rocksdb_options_t) {. - cdecl.} -proc rocksdb_options_set_compression_per_level*(opt: ptr rocksdb_options_t; - level_values: ptr cint; num_levels: csize_t) {.cdecl.} -proc rocksdb_options_set_create_if_missing*(a1: ptr rocksdb_options_t; a2: uint8) {. - cdecl.} + opt: ptr rocksdb_options_t, memtable_memory_budget: uint64 +) {.cdecl.} + +proc rocksdb_options_set_allow_ingest_behind*( + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl.} + +proc rocksdb_options_get_allow_ingest_behind*( + a1: ptr rocksdb_options_t +): uint8 {.cdecl.} + +proc rocksdb_options_set_compaction_filter*( + a1: ptr rocksdb_options_t, a2: ptr rocksdb_compactionfilter_t +) {.cdecl.} + +proc rocksdb_options_set_compaction_filter_factory*( + a1: ptr rocksdb_options_t, a2: ptr rocksdb_compactionfilterfactory_t +) {.cdecl.} + +proc rocksdb_options_compaction_readahead_size*( + a1: ptr rocksdb_options_t, a2: csize_t +) {.cdecl.} + +proc rocksdb_options_get_compaction_readahead_size*( + a1: ptr rocksdb_options_t +): csize_t {.cdecl.} + +proc rocksdb_options_set_comparator*( + a1: ptr rocksdb_options_t, a2: ptr rocksdb_comparator_t +) {.cdecl.} + +proc rocksdb_options_set_merge_operator*( + a1: ptr rocksdb_options_t, a2: ptr rocksdb_mergeoperator_t +) {.cdecl.} + +proc rocksdb_options_set_uint64add_merge_operator*(a1: ptr rocksdb_options_t) {.cdecl.} +proc rocksdb_options_set_compression_per_level*( + opt: ptr rocksdb_options_t, level_values: ptr cint, num_levels: csize_t +) {.cdecl.} + +proc rocksdb_options_set_create_if_missing*( + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl.} + proc rocksdb_options_get_create_if_missing*(a1: ptr rocksdb_options_t): uint8 {.cdecl.} proc rocksdb_options_set_create_missing_column_families*( - a1: ptr rocksdb_options_t; a2: uint8) {.cdecl.} + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl.} + proc rocksdb_options_get_create_missing_column_families*( - a1: ptr rocksdb_options_t): uint8 {.cdecl.} -proc rocksdb_options_set_error_if_exists*(a1: ptr rocksdb_options_t; a2: uint8) {. - cdecl.} + a1: ptr rocksdb_options_t +): uint8 {.cdecl.} + +proc rocksdb_options_set_error_if_exists*( + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl.} + proc rocksdb_options_get_error_if_exists*(a1: ptr rocksdb_options_t): uint8 {.cdecl.} -proc rocksdb_options_set_paranoid_checks*(a1: ptr rocksdb_options_t; a2: uint8) {. - cdecl.} +proc rocksdb_options_set_paranoid_checks*( + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl.} + proc rocksdb_options_get_paranoid_checks*(a1: ptr rocksdb_options_t): uint8 {.cdecl.} -proc rocksdb_options_set_db_paths*(a1: ptr rocksdb_options_t; - path_values: ptr ptr rocksdb_dbpath_t; - num_paths: csize_t) {.cdecl.} -proc rocksdb_options_set_cf_paths*(a1: ptr rocksdb_options_t; - path_values: ptr ptr rocksdb_dbpath_t; - num_paths: csize_t) {.cdecl.} -proc rocksdb_options_set_env*(a1: ptr rocksdb_options_t; a2: ptr rocksdb_env_t) {.cdecl.} -proc rocksdb_options_set_info_log*(a1: ptr rocksdb_options_t; - a2: ptr rocksdb_logger_t) {.cdecl.} -proc rocksdb_options_get_info_log*(opt: ptr rocksdb_options_t): ptr rocksdb_logger_t {. - cdecl.} -proc rocksdb_options_set_info_log_level*(a1: ptr rocksdb_options_t; a2: cint) {.cdecl.} +proc rocksdb_options_set_db_paths*( + a1: ptr rocksdb_options_t, path_values: ptr ptr rocksdb_dbpath_t, num_paths: csize_t +) {.cdecl.} + +proc rocksdb_options_set_cf_paths*( + a1: ptr rocksdb_options_t, path_values: ptr ptr rocksdb_dbpath_t, num_paths: csize_t +) {.cdecl.} + +proc rocksdb_options_set_env*( + a1: ptr rocksdb_options_t, a2: ptr rocksdb_env_t +) {.cdecl.} + +proc rocksdb_options_set_info_log*( + a1: ptr rocksdb_options_t, a2: ptr rocksdb_logger_t +) {.cdecl.} + +proc rocksdb_options_get_info_log*( + opt: ptr rocksdb_options_t +): ptr rocksdb_logger_t {.cdecl.} + +proc rocksdb_options_set_info_log_level*(a1: ptr rocksdb_options_t, a2: cint) {.cdecl.} proc rocksdb_options_get_info_log_level*(a1: ptr rocksdb_options_t): cint {.cdecl.} -proc rocksdb_logger_create_stderr_logger*(log_level: cint; prefix: cstring): ptr rocksdb_logger_t {. - cdecl.} -proc rocksdb_logger_create_callback_logger*(log_level: cint; - a2: proc (priv: pointer; lev: cuint; msg: cstring; len: csize_t) {.cdecl.}; - priv: pointer): ptr rocksdb_logger_t {.cdecl.} +proc rocksdb_logger_create_stderr_logger*( + log_level: cint, prefix: cstring +): ptr rocksdb_logger_t {.cdecl.} + +proc rocksdb_logger_create_callback_logger*( + log_level: cint, + a2: proc(priv: pointer, lev: cuint, msg: cstring, len: csize_t) {.cdecl.}, + priv: pointer, +): ptr rocksdb_logger_t {.cdecl.} + proc rocksdb_logger_destroy*(logger: ptr rocksdb_logger_t) {.cdecl.} -proc rocksdb_options_set_write_buffer_size*(a1: ptr rocksdb_options_t; a2: csize_t) {. - cdecl.} -proc rocksdb_options_get_write_buffer_size*(a1: ptr rocksdb_options_t): csize_t {. - cdecl.} -proc rocksdb_options_set_db_write_buffer_size*(a1: ptr rocksdb_options_t; - a2: csize_t) {.cdecl.} -proc rocksdb_options_get_db_write_buffer_size*(a1: ptr rocksdb_options_t): csize_t {. - cdecl.} -proc rocksdb_options_set_max_open_files*(a1: ptr rocksdb_options_t; a2: cint) {.cdecl.} +proc rocksdb_options_set_write_buffer_size*( + a1: ptr rocksdb_options_t, a2: csize_t +) {.cdecl.} + +proc rocksdb_options_get_write_buffer_size*( + a1: ptr rocksdb_options_t +): csize_t {.cdecl.} + +proc rocksdb_options_set_db_write_buffer_size*( + a1: ptr rocksdb_options_t, a2: csize_t +) {.cdecl.} + +proc rocksdb_options_get_db_write_buffer_size*( + a1: ptr rocksdb_options_t +): csize_t {.cdecl.} + +proc rocksdb_options_set_max_open_files*(a1: ptr rocksdb_options_t, a2: cint) {.cdecl.} proc rocksdb_options_get_max_open_files*(a1: ptr rocksdb_options_t): cint {.cdecl.} -proc rocksdb_options_set_max_file_opening_threads*(a1: ptr rocksdb_options_t; - a2: cint) {.cdecl.} -proc rocksdb_options_get_max_file_opening_threads*(a1: ptr rocksdb_options_t): cint {. - cdecl.} -proc rocksdb_options_set_max_total_wal_size*(opt: ptr rocksdb_options_t; n: uint64) {. - cdecl.} -proc rocksdb_options_get_max_total_wal_size*(opt: ptr rocksdb_options_t): uint64 {. - cdecl.} -proc rocksdb_options_set_compression_options*(a1: ptr rocksdb_options_t; a2: cint; - a3: cint; a4: cint; a5: cint) {.cdecl.} +proc rocksdb_options_set_max_file_opening_threads*( + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl.} + +proc rocksdb_options_get_max_file_opening_threads*( + a1: ptr rocksdb_options_t +): cint {.cdecl.} + +proc rocksdb_options_set_max_total_wal_size*( + opt: ptr rocksdb_options_t, n: uint64 +) {.cdecl.} + +proc rocksdb_options_get_max_total_wal_size*( + opt: ptr rocksdb_options_t +): uint64 {.cdecl.} + +proc rocksdb_options_set_compression_options*( + a1: ptr rocksdb_options_t, a2: cint, a3: cint, a4: cint, a5: cint +) {.cdecl.} + proc rocksdb_options_set_compression_options_zstd_max_train_bytes*( - a1: ptr rocksdb_options_t; a2: cint) {.cdecl.} + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl.} + proc rocksdb_options_get_compression_options_zstd_max_train_bytes*( - opt: ptr rocksdb_options_t): cint {.cdecl.} + opt: ptr rocksdb_options_t +): cint {.cdecl.} + proc rocksdb_options_set_compression_options_use_zstd_dict_trainer*( - a1: ptr rocksdb_options_t; a2: uint8) {.cdecl.} + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl.} + proc rocksdb_options_get_compression_options_use_zstd_dict_trainer*( - opt: ptr rocksdb_options_t): uint8 {.cdecl.} + opt: ptr rocksdb_options_t +): uint8 {.cdecl.} + proc rocksdb_options_set_compression_options_parallel_threads*( - a1: ptr rocksdb_options_t; a2: cint) {.cdecl.} + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl.} + proc rocksdb_options_get_compression_options_parallel_threads*( - opt: ptr rocksdb_options_t): cint {.cdecl.} + opt: ptr rocksdb_options_t +): cint {.cdecl.} + proc rocksdb_options_set_compression_options_max_dict_buffer_bytes*( - a1: ptr rocksdb_options_t; a2: uint64) {.cdecl.} + a1: ptr rocksdb_options_t, a2: uint64 +) {.cdecl.} + proc rocksdb_options_get_compression_options_max_dict_buffer_bytes*( - opt: ptr rocksdb_options_t): uint64 {.cdecl.} + opt: ptr rocksdb_options_t +): uint64 {.cdecl.} + proc rocksdb_options_set_bottommost_compression_options*( - a1: ptr rocksdb_options_t; a2: cint; a3: cint; a4: cint; a5: cint; a6: uint8) {.cdecl.} + a1: ptr rocksdb_options_t, a2: cint, a3: cint, a4: cint, a5: cint, a6: uint8 +) {.cdecl.} + proc rocksdb_options_set_bottommost_compression_options_zstd_max_train_bytes*( - a1: ptr rocksdb_options_t; a2: cint; a3: uint8) {.cdecl.} + a1: ptr rocksdb_options_t, a2: cint, a3: uint8 +) {.cdecl.} + proc rocksdb_options_set_bottommost_compression_options_use_zstd_dict_trainer*( - a1: ptr rocksdb_options_t; a2: uint8; a3: uint8) {.cdecl.} + a1: ptr rocksdb_options_t, a2: uint8, a3: uint8 +) {.cdecl.} + proc rocksdb_options_get_bottommost_compression_options_use_zstd_dict_trainer*( - opt: ptr rocksdb_options_t): uint8 {.cdecl.} + opt: ptr rocksdb_options_t +): uint8 {.cdecl.} + proc rocksdb_options_set_bottommost_compression_options_max_dict_buffer_bytes*( - a1: ptr rocksdb_options_t; a2: uint64; a3: uint8) {.cdecl.} -proc rocksdb_options_set_prefix_extractor*(a1: ptr rocksdb_options_t; - a2: ptr rocksdb_slicetransform_t) {.cdecl.} -proc rocksdb_options_set_num_levels*(a1: ptr rocksdb_options_t; a2: cint) {.cdecl.} + a1: ptr rocksdb_options_t, a2: uint64, a3: uint8 +) {.cdecl.} + +proc rocksdb_options_set_prefix_extractor*( + a1: ptr rocksdb_options_t, a2: ptr rocksdb_slicetransform_t +) {.cdecl.} + +proc rocksdb_options_set_num_levels*(a1: ptr rocksdb_options_t, a2: cint) {.cdecl.} proc rocksdb_options_get_num_levels*(a1: ptr rocksdb_options_t): cint {.cdecl.} proc rocksdb_options_set_level0_file_num_compaction_trigger*( - a1: ptr rocksdb_options_t; a2: cint) {.cdecl.} + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl.} + proc rocksdb_options_get_level0_file_num_compaction_trigger*( - a1: ptr rocksdb_options_t): cint {.cdecl.} + a1: ptr rocksdb_options_t +): cint {.cdecl.} + proc rocksdb_options_set_level0_slowdown_writes_trigger*( - a1: ptr rocksdb_options_t; a2: cint) {.cdecl.} + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl.} + proc rocksdb_options_get_level0_slowdown_writes_trigger*( - a1: ptr rocksdb_options_t): cint {.cdecl.} -proc rocksdb_options_set_level0_stop_writes_trigger*(a1: ptr rocksdb_options_t; - a2: cint) {.cdecl.} -proc rocksdb_options_get_level0_stop_writes_trigger*(a1: ptr rocksdb_options_t): cint {. - cdecl.} -proc rocksdb_options_set_target_file_size_base*(a1: ptr rocksdb_options_t; - a2: uint64) {.cdecl.} -proc rocksdb_options_get_target_file_size_base*(a1: ptr rocksdb_options_t): uint64 {. - cdecl.} -proc rocksdb_options_set_target_file_size_multiplier*(a1: ptr rocksdb_options_t; - a2: cint) {.cdecl.} -proc rocksdb_options_get_target_file_size_multiplier*(a1: ptr rocksdb_options_t): cint {. - cdecl.} -proc rocksdb_options_set_max_bytes_for_level_base*(a1: ptr rocksdb_options_t; - a2: uint64) {.cdecl.} -proc rocksdb_options_get_max_bytes_for_level_base*(a1: ptr rocksdb_options_t): uint64 {. - cdecl.} + a1: ptr rocksdb_options_t +): cint {.cdecl.} + +proc rocksdb_options_set_level0_stop_writes_trigger*( + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl.} + +proc rocksdb_options_get_level0_stop_writes_trigger*( + a1: ptr rocksdb_options_t +): cint {.cdecl.} + +proc rocksdb_options_set_target_file_size_base*( + a1: ptr rocksdb_options_t, a2: uint64 +) {.cdecl.} + +proc rocksdb_options_get_target_file_size_base*( + a1: ptr rocksdb_options_t +): uint64 {.cdecl.} + +proc rocksdb_options_set_target_file_size_multiplier*( + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl.} + +proc rocksdb_options_get_target_file_size_multiplier*( + a1: ptr rocksdb_options_t +): cint {.cdecl.} + +proc rocksdb_options_set_max_bytes_for_level_base*( + a1: ptr rocksdb_options_t, a2: uint64 +) {.cdecl.} + +proc rocksdb_options_get_max_bytes_for_level_base*( + a1: ptr rocksdb_options_t +): uint64 {.cdecl.} + proc rocksdb_options_set_level_compaction_dynamic_level_bytes*( - a1: ptr rocksdb_options_t; a2: uint8) {.cdecl.} + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl.} + proc rocksdb_options_get_level_compaction_dynamic_level_bytes*( - a1: ptr rocksdb_options_t): uint8 {.cdecl.} + a1: ptr rocksdb_options_t +): uint8 {.cdecl.} + proc rocksdb_options_set_max_bytes_for_level_multiplier*( - a1: ptr rocksdb_options_t; a2: cdouble) {.cdecl.} + a1: ptr rocksdb_options_t, a2: cdouble +) {.cdecl.} + proc rocksdb_options_get_max_bytes_for_level_multiplier*( - a1: ptr rocksdb_options_t): cdouble {.cdecl.} + a1: ptr rocksdb_options_t +): cdouble {.cdecl.} + proc rocksdb_options_set_max_bytes_for_level_multiplier_additional*( - a1: ptr rocksdb_options_t; level_values: ptr cint; num_levels: csize_t) {.cdecl.} + a1: ptr rocksdb_options_t, level_values: ptr cint, num_levels: csize_t +) {.cdecl.} + proc rocksdb_options_enable_statistics*(a1: ptr rocksdb_options_t) {.cdecl.} -proc rocksdb_options_set_ttl*(a1: ptr rocksdb_options_t; a2: uint64) {.cdecl.} +proc rocksdb_options_set_ttl*(a1: ptr rocksdb_options_t, a2: uint64) {.cdecl.} proc rocksdb_options_get_ttl*(a1: ptr rocksdb_options_t): uint64 {.cdecl.} -proc rocksdb_options_set_periodic_compaction_seconds*(a1: ptr rocksdb_options_t; - a2: uint64) {.cdecl.} -proc rocksdb_options_get_periodic_compaction_seconds*(a1: ptr rocksdb_options_t): uint64 {. - cdecl.} +proc rocksdb_options_set_periodic_compaction_seconds*( + a1: ptr rocksdb_options_t, a2: uint64 +) {.cdecl.} + +proc rocksdb_options_get_periodic_compaction_seconds*( + a1: ptr rocksdb_options_t +): uint64 {.cdecl.} + const rocksdb_statistics_level_disable_all* = 0 rocksdb_statistics_level_except_tickers* = rocksdb_statistics_level_disable_all @@ -1040,297 +1971,549 @@ const rocksdb_statistics_level_except_time_for_mutex* = 4 rocksdb_statistics_level_all* = 5 -proc rocksdb_options_set_statistics_level*(a1: ptr rocksdb_options_t; level: cint) {. - cdecl.} +proc rocksdb_options_set_statistics_level*( + a1: ptr rocksdb_options_t, level: cint +) {.cdecl.} + proc rocksdb_options_get_statistics_level*(a1: ptr rocksdb_options_t): cint {.cdecl.} proc rocksdb_options_set_skip_stats_update_on_db_open*( - opt: ptr rocksdb_options_t; val: uint8) {.cdecl.} -proc rocksdb_options_get_skip_stats_update_on_db_open*(opt: ptr rocksdb_options_t): uint8 {. - cdecl.} + opt: ptr rocksdb_options_t, val: uint8 +) {.cdecl.} + +proc rocksdb_options_get_skip_stats_update_on_db_open*( + opt: ptr rocksdb_options_t +): uint8 {.cdecl.} + proc rocksdb_options_set_skip_checking_sst_file_sizes_on_db_open*( - opt: ptr rocksdb_options_t; val: uint8) {.cdecl.} + opt: ptr rocksdb_options_t, val: uint8 +) {.cdecl.} + proc rocksdb_options_get_skip_checking_sst_file_sizes_on_db_open*( - opt: ptr rocksdb_options_t): uint8 {.cdecl.} + opt: ptr rocksdb_options_t +): uint8 {.cdecl.} + ## Blob Options Settings -proc rocksdb_options_set_enable_blob_files*(opt: ptr rocksdb_options_t; val: uint8) {. - cdecl.} -proc rocksdb_options_get_enable_blob_files*(opt: ptr rocksdb_options_t): uint8 {. - cdecl.} -proc rocksdb_options_set_min_blob_size*(opt: ptr rocksdb_options_t; val: uint64) {. - cdecl.} +proc rocksdb_options_set_enable_blob_files*( + opt: ptr rocksdb_options_t, val: uint8 +) {.cdecl.} + +proc rocksdb_options_get_enable_blob_files*(opt: ptr rocksdb_options_t): uint8 {.cdecl.} +proc rocksdb_options_set_min_blob_size*( + opt: ptr rocksdb_options_t, val: uint64 +) {.cdecl.} + proc rocksdb_options_get_min_blob_size*(opt: ptr rocksdb_options_t): uint64 {.cdecl.} -proc rocksdb_options_set_blob_file_size*(opt: ptr rocksdb_options_t; val: uint64) {. - cdecl.} +proc rocksdb_options_set_blob_file_size*( + opt: ptr rocksdb_options_t, val: uint64 +) {.cdecl.} + proc rocksdb_options_get_blob_file_size*(opt: ptr rocksdb_options_t): uint64 {.cdecl.} -proc rocksdb_options_set_blob_compression_type*(opt: ptr rocksdb_options_t; - val: cint) {.cdecl.} -proc rocksdb_options_get_blob_compression_type*(opt: ptr rocksdb_options_t): cint {. - cdecl.} -proc rocksdb_options_set_enable_blob_gc*(opt: ptr rocksdb_options_t; val: uint8) {. - cdecl.} +proc rocksdb_options_set_blob_compression_type*( + opt: ptr rocksdb_options_t, val: cint +) {.cdecl.} + +proc rocksdb_options_get_blob_compression_type*( + opt: ptr rocksdb_options_t +): cint {.cdecl.} + +proc rocksdb_options_set_enable_blob_gc*( + opt: ptr rocksdb_options_t, val: uint8 +) {.cdecl.} + proc rocksdb_options_get_enable_blob_gc*(opt: ptr rocksdb_options_t): uint8 {.cdecl.} -proc rocksdb_options_set_blob_gc_age_cutoff*(opt: ptr rocksdb_options_t; - val: cdouble) {.cdecl.} -proc rocksdb_options_get_blob_gc_age_cutoff*(opt: ptr rocksdb_options_t): cdouble {. - cdecl.} -proc rocksdb_options_set_blob_gc_force_threshold*(opt: ptr rocksdb_options_t; - val: cdouble) {.cdecl.} -proc rocksdb_options_get_blob_gc_force_threshold*(opt: ptr rocksdb_options_t): cdouble {. - cdecl.} +proc rocksdb_options_set_blob_gc_age_cutoff*( + opt: ptr rocksdb_options_t, val: cdouble +) {.cdecl.} + +proc rocksdb_options_get_blob_gc_age_cutoff*( + opt: ptr rocksdb_options_t +): cdouble {.cdecl.} + +proc rocksdb_options_set_blob_gc_force_threshold*( + opt: ptr rocksdb_options_t, val: cdouble +) {.cdecl.} + +proc rocksdb_options_get_blob_gc_force_threshold*( + opt: ptr rocksdb_options_t +): cdouble {.cdecl.} + proc rocksdb_options_set_blob_compaction_readahead_size*( - opt: ptr rocksdb_options_t; val: uint64) {.cdecl.} + opt: ptr rocksdb_options_t, val: uint64 +) {.cdecl.} + proc rocksdb_options_get_blob_compaction_readahead_size*( - opt: ptr rocksdb_options_t): uint64 {.cdecl.} -proc rocksdb_options_set_blob_file_starting_level*(opt: ptr rocksdb_options_t; - val: cint) {.cdecl.} -proc rocksdb_options_get_blob_file_starting_level*(opt: ptr rocksdb_options_t): cint {. - cdecl.} -proc rocksdb_options_set_blob_cache*(opt: ptr rocksdb_options_t; - blob_cache: ptr rocksdb_cache_t) {.cdecl.} + opt: ptr rocksdb_options_t +): uint64 {.cdecl.} + +proc rocksdb_options_set_blob_file_starting_level*( + opt: ptr rocksdb_options_t, val: cint +) {.cdecl.} + +proc rocksdb_options_get_blob_file_starting_level*( + opt: ptr rocksdb_options_t +): cint {.cdecl.} + +proc rocksdb_options_set_blob_cache*( + opt: ptr rocksdb_options_t, blob_cache: ptr rocksdb_cache_t +) {.cdecl.} + const rocksdb_prepopulate_blob_disable* = 0 rocksdb_prepopulate_blob_flush_only* = 1 -proc rocksdb_options_set_prepopulate_blob_cache*(opt: ptr rocksdb_options_t; - val: cint) {.cdecl.} -proc rocksdb_options_get_prepopulate_blob_cache*(opt: ptr rocksdb_options_t): cint {. - cdecl.} +proc rocksdb_options_set_prepopulate_blob_cache*( + opt: ptr rocksdb_options_t, val: cint +) {.cdecl.} + +proc rocksdb_options_get_prepopulate_blob_cache*( + opt: ptr rocksdb_options_t +): cint {.cdecl.} + ## returns a pointer to a malloc()-ed, null terminated string -proc rocksdb_options_statistics_get_string*(opt: ptr rocksdb_options_t): cstring {. - cdecl.} -proc rocksdb_options_statistics_get_ticker_count*(opt: ptr rocksdb_options_t; - ticker_type: uint32): uint64 {.cdecl.} -proc rocksdb_options_statistics_get_histogram_data*(opt: ptr rocksdb_options_t; - histogram_type: uint32; data: ptr rocksdb_statistics_histogram_data_t) {.cdecl.} -proc rocksdb_options_set_max_write_buffer_number*(a1: ptr rocksdb_options_t; - a2: cint) {.cdecl.} -proc rocksdb_options_get_max_write_buffer_number*(a1: ptr rocksdb_options_t): cint {. - cdecl.} +proc rocksdb_options_statistics_get_string*( + opt: ptr rocksdb_options_t +): cstring {.cdecl.} + +proc rocksdb_options_statistics_get_ticker_count*( + opt: ptr rocksdb_options_t, ticker_type: uint32 +): uint64 {.cdecl.} + +proc rocksdb_options_statistics_get_histogram_data*( + opt: ptr rocksdb_options_t, + histogram_type: uint32, + data: ptr rocksdb_statistics_histogram_data_t, +) {.cdecl.} + +proc rocksdb_options_set_max_write_buffer_number*( + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl.} + +proc rocksdb_options_get_max_write_buffer_number*( + a1: ptr rocksdb_options_t +): cint {.cdecl.} + proc rocksdb_options_set_min_write_buffer_number_to_merge*( - a1: ptr rocksdb_options_t; a2: cint) {.cdecl.} + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl.} + proc rocksdb_options_get_min_write_buffer_number_to_merge*( - a1: ptr rocksdb_options_t): cint {.cdecl.} + a1: ptr rocksdb_options_t +): cint {.cdecl.} + proc rocksdb_options_set_max_write_buffer_number_to_maintain*( - a1: ptr rocksdb_options_t; a2: cint) {.cdecl.} + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl.} + proc rocksdb_options_get_max_write_buffer_number_to_maintain*( - a1: ptr rocksdb_options_t): cint {.cdecl.} + a1: ptr rocksdb_options_t +): cint {.cdecl.} + proc rocksdb_options_set_max_write_buffer_size_to_maintain*( - a1: ptr rocksdb_options_t; a2: int64) {.cdecl.} + a1: ptr rocksdb_options_t, a2: int64 +) {.cdecl.} + proc rocksdb_options_get_max_write_buffer_size_to_maintain*( - a1: ptr rocksdb_options_t): int64 {.cdecl.} -proc rocksdb_options_set_enable_pipelined_write*(a1: ptr rocksdb_options_t; - a2: uint8) {.cdecl.} -proc rocksdb_options_get_enable_pipelined_write*(a1: ptr rocksdb_options_t): uint8 {. - cdecl.} -proc rocksdb_options_set_unordered_write*(a1: ptr rocksdb_options_t; a2: uint8) {. - cdecl.} + a1: ptr rocksdb_options_t +): int64 {.cdecl.} + +proc rocksdb_options_set_enable_pipelined_write*( + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl.} + +proc rocksdb_options_get_enable_pipelined_write*( + a1: ptr rocksdb_options_t +): uint8 {.cdecl.} + +proc rocksdb_options_set_unordered_write*( + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl.} + proc rocksdb_options_get_unordered_write*(a1: ptr rocksdb_options_t): uint8 {.cdecl.} -proc rocksdb_options_set_max_subcompactions*(a1: ptr rocksdb_options_t; a2: uint32) {. - cdecl.} -proc rocksdb_options_get_max_subcompactions*(a1: ptr rocksdb_options_t): uint32 {. - cdecl.} -proc rocksdb_options_set_max_background_jobs*(a1: ptr rocksdb_options_t; a2: cint) {. - cdecl.} -proc rocksdb_options_get_max_background_jobs*(a1: ptr rocksdb_options_t): cint {. - cdecl.} -proc rocksdb_options_set_max_background_compactions*(a1: ptr rocksdb_options_t; - a2: cint) {.cdecl.} -proc rocksdb_options_get_max_background_compactions*(a1: ptr rocksdb_options_t): cint {. - cdecl.} -proc rocksdb_options_set_max_background_flushes*(a1: ptr rocksdb_options_t; a2: cint) {. - cdecl.} -proc rocksdb_options_get_max_background_flushes*(a1: ptr rocksdb_options_t): cint {. - cdecl.} -proc rocksdb_options_set_max_log_file_size*(a1: ptr rocksdb_options_t; a2: csize_t) {. - cdecl.} -proc rocksdb_options_get_max_log_file_size*(a1: ptr rocksdb_options_t): csize_t {. - cdecl.} -proc rocksdb_options_set_log_file_time_to_roll*(a1: ptr rocksdb_options_t; - a2: csize_t) {.cdecl.} -proc rocksdb_options_get_log_file_time_to_roll*(a1: ptr rocksdb_options_t): csize_t {. - cdecl.} -proc rocksdb_options_set_keep_log_file_num*(a1: ptr rocksdb_options_t; a2: csize_t) {. - cdecl.} -proc rocksdb_options_get_keep_log_file_num*(a1: ptr rocksdb_options_t): csize_t {. - cdecl.} -proc rocksdb_options_set_recycle_log_file_num*(a1: ptr rocksdb_options_t; - a2: csize_t) {.cdecl.} -proc rocksdb_options_get_recycle_log_file_num*(a1: ptr rocksdb_options_t): csize_t {. - cdecl.} +proc rocksdb_options_set_max_subcompactions*( + a1: ptr rocksdb_options_t, a2: uint32 +) {.cdecl.} + +proc rocksdb_options_get_max_subcompactions*( + a1: ptr rocksdb_options_t +): uint32 {.cdecl.} + +proc rocksdb_options_set_max_background_jobs*( + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl.} + +proc rocksdb_options_get_max_background_jobs*(a1: ptr rocksdb_options_t): cint {.cdecl.} +proc rocksdb_options_set_max_background_compactions*( + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl.} + +proc rocksdb_options_get_max_background_compactions*( + a1: ptr rocksdb_options_t +): cint {.cdecl.} + +proc rocksdb_options_set_max_background_flushes*( + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl.} + +proc rocksdb_options_get_max_background_flushes*( + a1: ptr rocksdb_options_t +): cint {.cdecl.} + +proc rocksdb_options_set_max_log_file_size*( + a1: ptr rocksdb_options_t, a2: csize_t +) {.cdecl.} + +proc rocksdb_options_get_max_log_file_size*( + a1: ptr rocksdb_options_t +): csize_t {.cdecl.} + +proc rocksdb_options_set_log_file_time_to_roll*( + a1: ptr rocksdb_options_t, a2: csize_t +) {.cdecl.} + +proc rocksdb_options_get_log_file_time_to_roll*( + a1: ptr rocksdb_options_t +): csize_t {.cdecl.} + +proc rocksdb_options_set_keep_log_file_num*( + a1: ptr rocksdb_options_t, a2: csize_t +) {.cdecl.} + +proc rocksdb_options_get_keep_log_file_num*( + a1: ptr rocksdb_options_t +): csize_t {.cdecl.} + +proc rocksdb_options_set_recycle_log_file_num*( + a1: ptr rocksdb_options_t, a2: csize_t +) {.cdecl.} + +proc rocksdb_options_get_recycle_log_file_num*( + a1: ptr rocksdb_options_t +): csize_t {.cdecl.} + proc rocksdb_options_set_soft_pending_compaction_bytes_limit*( - opt: ptr rocksdb_options_t; v: csize_t) {.cdecl.} + opt: ptr rocksdb_options_t, v: csize_t +) {.cdecl.} + proc rocksdb_options_get_soft_pending_compaction_bytes_limit*( - opt: ptr rocksdb_options_t): csize_t {.cdecl.} + opt: ptr rocksdb_options_t +): csize_t {.cdecl.} + proc rocksdb_options_set_hard_pending_compaction_bytes_limit*( - opt: ptr rocksdb_options_t; v: csize_t) {.cdecl.} + opt: ptr rocksdb_options_t, v: csize_t +) {.cdecl.} + proc rocksdb_options_get_hard_pending_compaction_bytes_limit*( - opt: ptr rocksdb_options_t): csize_t {.cdecl.} -proc rocksdb_options_set_max_manifest_file_size*(a1: ptr rocksdb_options_t; - a2: csize_t) {.cdecl.} -proc rocksdb_options_get_max_manifest_file_size*(a1: ptr rocksdb_options_t): csize_t {. - cdecl.} -proc rocksdb_options_set_table_cache_numshardbits*(a1: ptr rocksdb_options_t; - a2: cint) {.cdecl.} -proc rocksdb_options_get_table_cache_numshardbits*(a1: ptr rocksdb_options_t): cint {. - cdecl.} -proc rocksdb_options_set_arena_block_size*(a1: ptr rocksdb_options_t; a2: csize_t) {. - cdecl.} -proc rocksdb_options_get_arena_block_size*(a1: ptr rocksdb_options_t): csize_t {. - cdecl.} -proc rocksdb_options_set_use_fsync*(a1: ptr rocksdb_options_t; a2: cint) {.cdecl.} + opt: ptr rocksdb_options_t +): csize_t {.cdecl.} + +proc rocksdb_options_set_max_manifest_file_size*( + a1: ptr rocksdb_options_t, a2: csize_t +) {.cdecl.} + +proc rocksdb_options_get_max_manifest_file_size*( + a1: ptr rocksdb_options_t +): csize_t {.cdecl.} + +proc rocksdb_options_set_table_cache_numshardbits*( + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl.} + +proc rocksdb_options_get_table_cache_numshardbits*( + a1: ptr rocksdb_options_t +): cint {.cdecl.} + +proc rocksdb_options_set_arena_block_size*( + a1: ptr rocksdb_options_t, a2: csize_t +) {.cdecl.} + +proc rocksdb_options_get_arena_block_size*(a1: ptr rocksdb_options_t): csize_t {.cdecl.} +proc rocksdb_options_set_use_fsync*(a1: ptr rocksdb_options_t, a2: cint) {.cdecl.} proc rocksdb_options_get_use_fsync*(a1: ptr rocksdb_options_t): cint {.cdecl.} -proc rocksdb_options_set_db_log_dir*(a1: ptr rocksdb_options_t; a2: cstring) {.cdecl.} -proc rocksdb_options_set_wal_dir*(a1: ptr rocksdb_options_t; a2: cstring) {.cdecl.} -proc rocksdb_options_set_WAL_ttl_seconds*(a1: ptr rocksdb_options_t; a2: uint64) {. - cdecl.} +proc rocksdb_options_set_db_log_dir*(a1: ptr rocksdb_options_t, a2: cstring) {.cdecl.} +proc rocksdb_options_set_wal_dir*(a1: ptr rocksdb_options_t, a2: cstring) {.cdecl.} +proc rocksdb_options_set_WAL_ttl_seconds*( + a1: ptr rocksdb_options_t, a2: uint64 +) {.cdecl.} + proc rocksdb_options_get_WAL_ttl_seconds*(a1: ptr rocksdb_options_t): uint64 {.cdecl.} -proc rocksdb_options_set_WAL_size_limit_MB*(a1: ptr rocksdb_options_t; a2: uint64) {. - cdecl.} -proc rocksdb_options_get_WAL_size_limit_MB*(a1: ptr rocksdb_options_t): uint64 {. - cdecl.} -proc rocksdb_options_set_manifest_preallocation_size*(a1: ptr rocksdb_options_t; - a2: csize_t) {.cdecl.} -proc rocksdb_options_get_manifest_preallocation_size*(a1: ptr rocksdb_options_t): csize_t {. - cdecl.} -proc rocksdb_options_set_allow_mmap_reads*(a1: ptr rocksdb_options_t; a2: uint8) {. - cdecl.} +proc rocksdb_options_set_WAL_size_limit_MB*( + a1: ptr rocksdb_options_t, a2: uint64 +) {.cdecl.} + +proc rocksdb_options_get_WAL_size_limit_MB*(a1: ptr rocksdb_options_t): uint64 {.cdecl.} +proc rocksdb_options_set_manifest_preallocation_size*( + a1: ptr rocksdb_options_t, a2: csize_t +) {.cdecl.} + +proc rocksdb_options_get_manifest_preallocation_size*( + a1: ptr rocksdb_options_t +): csize_t {.cdecl.} + +proc rocksdb_options_set_allow_mmap_reads*( + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl.} + proc rocksdb_options_get_allow_mmap_reads*(a1: ptr rocksdb_options_t): uint8 {.cdecl.} -proc rocksdb_options_set_allow_mmap_writes*(a1: ptr rocksdb_options_t; a2: uint8) {. - cdecl.} +proc rocksdb_options_set_allow_mmap_writes*( + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl.} + proc rocksdb_options_get_allow_mmap_writes*(a1: ptr rocksdb_options_t): uint8 {.cdecl.} -proc rocksdb_options_set_use_direct_reads*(a1: ptr rocksdb_options_t; a2: uint8) {. - cdecl.} +proc rocksdb_options_set_use_direct_reads*( + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl.} + proc rocksdb_options_get_use_direct_reads*(a1: ptr rocksdb_options_t): uint8 {.cdecl.} proc rocksdb_options_set_use_direct_io_for_flush_and_compaction*( - a1: ptr rocksdb_options_t; a2: uint8) {.cdecl.} + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl.} + proc rocksdb_options_get_use_direct_io_for_flush_and_compaction*( - a1: ptr rocksdb_options_t): uint8 {.cdecl.} -proc rocksdb_options_set_is_fd_close_on_exec*(a1: ptr rocksdb_options_t; a2: uint8) {. - cdecl.} -proc rocksdb_options_get_is_fd_close_on_exec*(a1: ptr rocksdb_options_t): uint8 {. - cdecl.} -proc rocksdb_options_set_stats_dump_period_sec*(a1: ptr rocksdb_options_t; a2: cuint) {. - cdecl.} -proc rocksdb_options_get_stats_dump_period_sec*(a1: ptr rocksdb_options_t): cuint {. - cdecl.} -proc rocksdb_options_set_stats_persist_period_sec*(a1: ptr rocksdb_options_t; - a2: cuint) {.cdecl.} -proc rocksdb_options_get_stats_persist_period_sec*(a1: ptr rocksdb_options_t): cuint {. - cdecl.} -proc rocksdb_options_set_advise_random_on_open*(a1: ptr rocksdb_options_t; a2: uint8) {. - cdecl.} -proc rocksdb_options_get_advise_random_on_open*(a1: ptr rocksdb_options_t): uint8 {. - cdecl.} -proc rocksdb_options_set_use_adaptive_mutex*(a1: ptr rocksdb_options_t; a2: uint8) {. - cdecl.} -proc rocksdb_options_get_use_adaptive_mutex*(a1: ptr rocksdb_options_t): uint8 {. - cdecl.} -proc rocksdb_options_set_bytes_per_sync*(a1: ptr rocksdb_options_t; a2: uint64) {. - cdecl.} + a1: ptr rocksdb_options_t +): uint8 {.cdecl.} + +proc rocksdb_options_set_is_fd_close_on_exec*( + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl.} + +proc rocksdb_options_get_is_fd_close_on_exec*( + a1: ptr rocksdb_options_t +): uint8 {.cdecl.} + +proc rocksdb_options_set_stats_dump_period_sec*( + a1: ptr rocksdb_options_t, a2: cuint +) {.cdecl.} + +proc rocksdb_options_get_stats_dump_period_sec*( + a1: ptr rocksdb_options_t +): cuint {.cdecl.} + +proc rocksdb_options_set_stats_persist_period_sec*( + a1: ptr rocksdb_options_t, a2: cuint +) {.cdecl.} + +proc rocksdb_options_get_stats_persist_period_sec*( + a1: ptr rocksdb_options_t +): cuint {.cdecl.} + +proc rocksdb_options_set_advise_random_on_open*( + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl.} + +proc rocksdb_options_get_advise_random_on_open*( + a1: ptr rocksdb_options_t +): uint8 {.cdecl.} + +proc rocksdb_options_set_use_adaptive_mutex*( + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl.} + +proc rocksdb_options_get_use_adaptive_mutex*(a1: ptr rocksdb_options_t): uint8 {.cdecl.} +proc rocksdb_options_set_bytes_per_sync*( + a1: ptr rocksdb_options_t, a2: uint64 +) {.cdecl.} + proc rocksdb_options_get_bytes_per_sync*(a1: ptr rocksdb_options_t): uint64 {.cdecl.} -proc rocksdb_options_set_wal_bytes_per_sync*(a1: ptr rocksdb_options_t; a2: uint64) {. - cdecl.} -proc rocksdb_options_get_wal_bytes_per_sync*(a1: ptr rocksdb_options_t): uint64 {. - cdecl.} +proc rocksdb_options_set_wal_bytes_per_sync*( + a1: ptr rocksdb_options_t, a2: uint64 +) {.cdecl.} + +proc rocksdb_options_get_wal_bytes_per_sync*( + a1: ptr rocksdb_options_t +): uint64 {.cdecl.} + proc rocksdb_options_set_writable_file_max_buffer_size*( - a1: ptr rocksdb_options_t; a2: uint64) {.cdecl.} -proc rocksdb_options_get_writable_file_max_buffer_size*(a1: ptr rocksdb_options_t): uint64 {. - cdecl.} + a1: ptr rocksdb_options_t, a2: uint64 +) {.cdecl.} + +proc rocksdb_options_get_writable_file_max_buffer_size*( + a1: ptr rocksdb_options_t +): uint64 {.cdecl.} + proc rocksdb_options_set_allow_concurrent_memtable_write*( - a1: ptr rocksdb_options_t; a2: uint8) {.cdecl.} + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl.} + proc rocksdb_options_get_allow_concurrent_memtable_write*( - a1: ptr rocksdb_options_t): uint8 {.cdecl.} + a1: ptr rocksdb_options_t +): uint8 {.cdecl.} + proc rocksdb_options_set_enable_write_thread_adaptive_yield*( - a1: ptr rocksdb_options_t; a2: uint8) {.cdecl.} + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl.} + proc rocksdb_options_get_enable_write_thread_adaptive_yield*( - a1: ptr rocksdb_options_t): uint8 {.cdecl.} + a1: ptr rocksdb_options_t +): uint8 {.cdecl.} + proc rocksdb_options_set_max_sequential_skip_in_iterations*( - a1: ptr rocksdb_options_t; a2: uint64) {.cdecl.} + a1: ptr rocksdb_options_t, a2: uint64 +) {.cdecl.} + proc rocksdb_options_get_max_sequential_skip_in_iterations*( - a1: ptr rocksdb_options_t): uint64 {.cdecl.} -proc rocksdb_options_set_disable_auto_compactions*(a1: ptr rocksdb_options_t; - a2: cint) {.cdecl.} -proc rocksdb_options_get_disable_auto_compactions*(a1: ptr rocksdb_options_t): uint8 {. - cdecl.} -proc rocksdb_options_set_optimize_filters_for_hits*(a1: ptr rocksdb_options_t; - a2: cint) {.cdecl.} -proc rocksdb_options_get_optimize_filters_for_hits*(a1: ptr rocksdb_options_t): uint8 {. - cdecl.} + a1: ptr rocksdb_options_t +): uint64 {.cdecl.} + +proc rocksdb_options_set_disable_auto_compactions*( + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl.} + +proc rocksdb_options_get_disable_auto_compactions*( + a1: ptr rocksdb_options_t +): uint8 {.cdecl.} + +proc rocksdb_options_set_optimize_filters_for_hits*( + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl.} + +proc rocksdb_options_get_optimize_filters_for_hits*( + a1: ptr rocksdb_options_t +): uint8 {.cdecl.} + proc rocksdb_options_set_delete_obsolete_files_period_micros*( - a1: ptr rocksdb_options_t; a2: uint64) {.cdecl.} + a1: ptr rocksdb_options_t, a2: uint64 +) {.cdecl.} + proc rocksdb_options_get_delete_obsolete_files_period_micros*( - a1: ptr rocksdb_options_t): uint64 {.cdecl.} + a1: ptr rocksdb_options_t +): uint64 {.cdecl.} + proc rocksdb_options_prepare_for_bulk_load*(a1: ptr rocksdb_options_t) {.cdecl.} proc rocksdb_options_set_memtable_vector_rep*(a1: ptr rocksdb_options_t) {.cdecl.} proc rocksdb_options_set_memtable_prefix_bloom_size_ratio*( - a1: ptr rocksdb_options_t; a2: cdouble) {.cdecl.} + a1: ptr rocksdb_options_t, a2: cdouble +) {.cdecl.} + proc rocksdb_options_get_memtable_prefix_bloom_size_ratio*( - a1: ptr rocksdb_options_t): cdouble {.cdecl.} -proc rocksdb_options_set_max_compaction_bytes*(a1: ptr rocksdb_options_t; a2: uint64) {. - cdecl.} -proc rocksdb_options_get_max_compaction_bytes*(a1: ptr rocksdb_options_t): uint64 {. - cdecl.} -proc rocksdb_options_set_hash_skip_list_rep*(a1: ptr rocksdb_options_t; a2: csize_t; - a3: int32; a4: int32) {.cdecl.} -proc rocksdb_options_set_hash_link_list_rep*(a1: ptr rocksdb_options_t; a2: csize_t) {. - cdecl.} -proc rocksdb_options_set_plain_table_factory*(a1: ptr rocksdb_options_t; a2: uint32; - a3: cint; a4: cdouble; a5: csize_t; a6: csize_t; a7: char; a8: uint8; a9: uint8) {.cdecl.} -proc rocksdb_options_get_write_dbid_to_manifest*(a1: ptr rocksdb_options_t): uint8 {. - cdecl.} -proc rocksdb_options_set_write_dbid_to_manifest*(a1: ptr rocksdb_options_t; - a2: uint8) {.cdecl.} -proc rocksdb_options_get_write_identity_file*(a1: ptr rocksdb_options_t): uint8 {. - cdecl.} -proc rocksdb_options_set_write_identity_file*(a1: ptr rocksdb_options_t; a2: uint8) {. - cdecl.} + a1: ptr rocksdb_options_t +): cdouble {.cdecl.} + +proc rocksdb_options_set_max_compaction_bytes*( + a1: ptr rocksdb_options_t, a2: uint64 +) {.cdecl.} + +proc rocksdb_options_get_max_compaction_bytes*( + a1: ptr rocksdb_options_t +): uint64 {.cdecl.} + +proc rocksdb_options_set_hash_skip_list_rep*( + a1: ptr rocksdb_options_t, a2: csize_t, a3: int32, a4: int32 +) {.cdecl.} + +proc rocksdb_options_set_hash_link_list_rep*( + a1: ptr rocksdb_options_t, a2: csize_t +) {.cdecl.} + +proc rocksdb_options_set_plain_table_factory*( + a1: ptr rocksdb_options_t, + a2: uint32, + a3: cint, + a4: cdouble, + a5: csize_t, + a6: csize_t, + a7: char, + a8: uint8, + a9: uint8, +) {.cdecl.} + +proc rocksdb_options_get_write_dbid_to_manifest*( + a1: ptr rocksdb_options_t +): uint8 {.cdecl.} + +proc rocksdb_options_set_write_dbid_to_manifest*( + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl.} + +proc rocksdb_options_get_write_identity_file*( + a1: ptr rocksdb_options_t +): uint8 {.cdecl.} + +proc rocksdb_options_set_write_identity_file*( + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl.} + proc rocksdb_options_get_track_and_verify_wals_in_manifest*( - a1: ptr rocksdb_options_t): uint8 {.cdecl.} + a1: ptr rocksdb_options_t +): uint8 {.cdecl.} + proc rocksdb_options_set_track_and_verify_wals_in_manifest*( - a1: ptr rocksdb_options_t; a2: uint8) {.cdecl.} -proc rocksdb_options_set_min_level_to_compress*(opt: ptr rocksdb_options_t; - level: cint) {.cdecl.} -proc rocksdb_options_set_memtable_huge_page_size*(a1: ptr rocksdb_options_t; - a2: csize_t) {.cdecl.} -proc rocksdb_options_get_memtable_huge_page_size*(a1: ptr rocksdb_options_t): csize_t {. - cdecl.} -proc rocksdb_options_set_max_successive_merges*(a1: ptr rocksdb_options_t; - a2: csize_t) {.cdecl.} -proc rocksdb_options_get_max_successive_merges*(a1: ptr rocksdb_options_t): csize_t {. - cdecl.} -proc rocksdb_options_set_bloom_locality*(a1: ptr rocksdb_options_t; a2: uint32) {. - cdecl.} + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl.} + +proc rocksdb_options_set_min_level_to_compress*( + opt: ptr rocksdb_options_t, level: cint +) {.cdecl.} + +proc rocksdb_options_set_memtable_huge_page_size*( + a1: ptr rocksdb_options_t, a2: csize_t +) {.cdecl.} + +proc rocksdb_options_get_memtable_huge_page_size*( + a1: ptr rocksdb_options_t +): csize_t {.cdecl.} + +proc rocksdb_options_set_max_successive_merges*( + a1: ptr rocksdb_options_t, a2: csize_t +) {.cdecl.} + +proc rocksdb_options_get_max_successive_merges*( + a1: ptr rocksdb_options_t +): csize_t {.cdecl.} + +proc rocksdb_options_set_bloom_locality*( + a1: ptr rocksdb_options_t, a2: uint32 +) {.cdecl.} + proc rocksdb_options_get_bloom_locality*(a1: ptr rocksdb_options_t): uint32 {.cdecl.} -proc rocksdb_options_set_inplace_update_support*(a1: ptr rocksdb_options_t; - a2: uint8) {.cdecl.} -proc rocksdb_options_get_inplace_update_support*(a1: ptr rocksdb_options_t): uint8 {. - cdecl.} -proc rocksdb_options_set_inplace_update_num_locks*(a1: ptr rocksdb_options_t; - a2: csize_t) {.cdecl.} -proc rocksdb_options_get_inplace_update_num_locks*(a1: ptr rocksdb_options_t): csize_t {. - cdecl.} -proc rocksdb_options_set_report_bg_io_stats*(a1: ptr rocksdb_options_t; a2: cint) {. - cdecl.} -proc rocksdb_options_get_report_bg_io_stats*(a1: ptr rocksdb_options_t): uint8 {. - cdecl.} +proc rocksdb_options_set_inplace_update_support*( + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl.} + +proc rocksdb_options_get_inplace_update_support*( + a1: ptr rocksdb_options_t +): uint8 {.cdecl.} + +proc rocksdb_options_set_inplace_update_num_locks*( + a1: ptr rocksdb_options_t, a2: csize_t +) {.cdecl.} + +proc rocksdb_options_get_inplace_update_num_locks*( + a1: ptr rocksdb_options_t +): csize_t {.cdecl.} + +proc rocksdb_options_set_report_bg_io_stats*( + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl.} + +proc rocksdb_options_get_report_bg_io_stats*(a1: ptr rocksdb_options_t): uint8 {.cdecl.} proc rocksdb_options_set_avoid_unnecessary_blocking_io*( - a1: ptr rocksdb_options_t; a2: uint8) {.cdecl.} -proc rocksdb_options_get_avoid_unnecessary_blocking_io*(a1: ptr rocksdb_options_t): uint8 {. - cdecl.} + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl.} + +proc rocksdb_options_get_avoid_unnecessary_blocking_io*( + a1: ptr rocksdb_options_t +): uint8 {.cdecl.} + proc rocksdb_options_set_experimental_mempurge_threshold*( - a1: ptr rocksdb_options_t; a2: cdouble) {.cdecl.} + a1: ptr rocksdb_options_t, a2: cdouble +) {.cdecl.} + proc rocksdb_options_get_experimental_mempurge_threshold*( - a1: ptr rocksdb_options_t): cdouble {.cdecl.} + a1: ptr rocksdb_options_t +): cdouble {.cdecl.} + const rocksdb_tolerate_corrupted_tail_records_recovery* = 0 rocksdb_absolute_consistency_recovery* = 1 rocksdb_point_in_time_recovery* = 2 rocksdb_skip_any_corrupted_records_recovery* = 3 -proc rocksdb_options_set_wal_recovery_mode*(a1: ptr rocksdb_options_t; a2: cint) {. - cdecl.} +proc rocksdb_options_set_wal_recovery_mode*( + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl.} + proc rocksdb_options_get_wal_recovery_mode*(a1: ptr rocksdb_options_t): cint {.cdecl.} const rocksdb_no_compression* = 0 @@ -1342,40 +2525,64 @@ const rocksdb_xpress_compression* = 6 rocksdb_zstd_compression* = 7 -proc rocksdb_options_set_compression*(a1: ptr rocksdb_options_t; a2: cint) {.cdecl.} +proc rocksdb_options_set_compression*(a1: ptr rocksdb_options_t, a2: cint) {.cdecl.} proc rocksdb_options_get_compression*(a1: ptr rocksdb_options_t): cint {.cdecl.} -proc rocksdb_options_set_bottommost_compression*(a1: ptr rocksdb_options_t; a2: cint) {. - cdecl.} -proc rocksdb_options_get_bottommost_compression*(a1: ptr rocksdb_options_t): cint {. - cdecl.} +proc rocksdb_options_set_bottommost_compression*( + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl.} + +proc rocksdb_options_get_bottommost_compression*( + a1: ptr rocksdb_options_t +): cint {.cdecl.} + const rocksdb_level_compaction* = 0 rocksdb_universal_compaction* = 1 rocksdb_fifo_compaction* = 2 -proc rocksdb_options_set_compaction_style*(a1: ptr rocksdb_options_t; a2: cint) {. - cdecl.} +proc rocksdb_options_set_compaction_style*( + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl.} + proc rocksdb_options_get_compaction_style*(a1: ptr rocksdb_options_t): cint {.cdecl.} -proc rocksdb_options_set_universal_compaction_options*(a1: ptr rocksdb_options_t; - a2: ptr rocksdb_universal_compaction_options_t) {.cdecl.} -proc rocksdb_options_set_fifo_compaction_options*(opt: ptr rocksdb_options_t; - fifo: ptr rocksdb_fifo_compaction_options_t) {.cdecl.} -proc rocksdb_options_set_ratelimiter*(opt: ptr rocksdb_options_t; - limiter: ptr rocksdb_ratelimiter_t) {.cdecl.} -proc rocksdb_options_set_atomic_flush*(opt: ptr rocksdb_options_t; a2: uint8) {.cdecl.} +proc rocksdb_options_set_universal_compaction_options*( + a1: ptr rocksdb_options_t, a2: ptr rocksdb_universal_compaction_options_t +) {.cdecl.} + +proc rocksdb_options_set_fifo_compaction_options*( + opt: ptr rocksdb_options_t, fifo: ptr rocksdb_fifo_compaction_options_t +) {.cdecl.} + +proc rocksdb_options_set_ratelimiter*( + opt: ptr rocksdb_options_t, limiter: ptr rocksdb_ratelimiter_t +) {.cdecl.} + +proc rocksdb_options_set_atomic_flush*(opt: ptr rocksdb_options_t, a2: uint8) {.cdecl.} proc rocksdb_options_get_atomic_flush*(opt: ptr rocksdb_options_t): uint8 {.cdecl.} -proc rocksdb_options_set_row_cache*(opt: ptr rocksdb_options_t; - cache: ptr rocksdb_cache_t) {.cdecl.} +proc rocksdb_options_set_row_cache*( + opt: ptr rocksdb_options_t, cache: ptr rocksdb_cache_t +) {.cdecl.} + proc rocksdb_options_add_compact_on_deletion_collector_factory*( - a1: ptr rocksdb_options_t; window_size: csize_t; num_dels_trigger: csize_t) {.cdecl.} + a1: ptr rocksdb_options_t, window_size: csize_t, num_dels_trigger: csize_t +) {.cdecl.} + proc rocksdb_options_add_compact_on_deletion_collector_factory_del_ratio*( - a1: ptr rocksdb_options_t; window_size: csize_t; num_dels_trigger: csize_t; - deletion_ratio: cdouble) {.cdecl.} -proc rocksdb_options_set_manual_wal_flush*(opt: ptr rocksdb_options_t; a2: uint8) {. - cdecl.} + a1: ptr rocksdb_options_t, + window_size: csize_t, + num_dels_trigger: csize_t, + deletion_ratio: cdouble, +) {.cdecl.} + +proc rocksdb_options_set_manual_wal_flush*( + opt: ptr rocksdb_options_t, a2: uint8 +) {.cdecl.} + proc rocksdb_options_get_manual_wal_flush*(opt: ptr rocksdb_options_t): uint8 {.cdecl.} -proc rocksdb_options_set_wal_compression*(opt: ptr rocksdb_options_t; a2: cint) {. - cdecl.} +proc rocksdb_options_set_wal_compression*( + opt: ptr rocksdb_options_t, a2: cint +) {.cdecl.} + proc rocksdb_options_get_wal_compression*(opt: ptr rocksdb_options_t): cint {.cdecl.} const rocksdb_k_by_compensated_size_compaction_pri* = 0 @@ -1384,18 +2591,26 @@ const rocksdb_k_min_overlapping_ratio_compaction_pri* = 3 rocksdb_k_round_robin_compaction_pri* = 4 -proc rocksdb_options_set_compaction_pri*(a1: ptr rocksdb_options_t; a2: cint) {.cdecl.} +proc rocksdb_options_set_compaction_pri*(a1: ptr rocksdb_options_t, a2: cint) {.cdecl.} proc rocksdb_options_get_compaction_pri*(a1: ptr rocksdb_options_t): cint {.cdecl.} ## RateLimiter -proc rocksdb_ratelimiter_create*(rate_bytes_per_sec: int64; - refill_period_us: int64; fairness: int32): ptr rocksdb_ratelimiter_t {. - cdecl.} -proc rocksdb_ratelimiter_create_auto_tuned*(rate_bytes_per_sec: int64; - refill_period_us: int64; fairness: int32): ptr rocksdb_ratelimiter_t {.cdecl.} -proc rocksdb_ratelimiter_create_with_mode*(rate_bytes_per_sec: int64; - refill_period_us: int64; fairness: int32; mode: cint; auto_tuned: bool): ptr rocksdb_ratelimiter_t {. - cdecl.} +proc rocksdb_ratelimiter_create*( + rate_bytes_per_sec: int64, refill_period_us: int64, fairness: int32 +): ptr rocksdb_ratelimiter_t {.cdecl.} + +proc rocksdb_ratelimiter_create_auto_tuned*( + rate_bytes_per_sec: int64, refill_period_us: int64, fairness: int32 +): ptr rocksdb_ratelimiter_t {.cdecl.} + +proc rocksdb_ratelimiter_create_with_mode*( + rate_bytes_per_sec: int64, + refill_period_us: int64, + fairness: int32, + mode: cint, + auto_tuned: bool, +): ptr rocksdb_ratelimiter_t {.cdecl.} + proc rocksdb_ratelimiter_destroy*(a1: ptr rocksdb_ratelimiter_t) {.cdecl.} ## PerfContext @@ -1490,397 +2705,705 @@ const proc rocksdb_set_perf_level*(a1: cint) {.cdecl.} proc rocksdb_perfcontext_create*(): ptr rocksdb_perfcontext_t {.cdecl.} proc rocksdb_perfcontext_reset*(context: ptr rocksdb_perfcontext_t) {.cdecl.} -proc rocksdb_perfcontext_report*(context: ptr rocksdb_perfcontext_t; - exclude_zero_counters: uint8): cstring {.cdecl.} -proc rocksdb_perfcontext_metric*(context: ptr rocksdb_perfcontext_t; metric: cint): uint64 {. - cdecl.} +proc rocksdb_perfcontext_report*( + context: ptr rocksdb_perfcontext_t, exclude_zero_counters: uint8 +): cstring {.cdecl.} + +proc rocksdb_perfcontext_metric*( + context: ptr rocksdb_perfcontext_t, metric: cint +): uint64 {.cdecl.} + proc rocksdb_perfcontext_destroy*(context: ptr rocksdb_perfcontext_t) {.cdecl.} ## Compaction Filter -proc rocksdb_compactionfilter_create*(state: pointer; - destructor: proc (a1: pointer) {.cdecl.}; filter: proc ( - a1: pointer; level: cint; key: cstring; key_length: csize_t; - existing_value: cstring; value_length: csize_t; new_value: cstringArray; - new_value_length: ptr csize_t; value_changed: ptr uint8): uint8 {.cdecl.}; - name: proc (a1: pointer): cstring {.cdecl.}): ptr rocksdb_compactionfilter_t {. - cdecl.} +proc rocksdb_compactionfilter_create*( + state: pointer, + destructor: proc(a1: pointer) {.cdecl.}, + filter: proc( + a1: pointer, + level: cint, + key: cstring, + key_length: csize_t, + existing_value: cstring, + value_length: csize_t, + new_value: cstringArray, + new_value_length: ptr csize_t, + value_changed: ptr uint8, + ): uint8 {.cdecl.}, + name: proc(a1: pointer): cstring {.cdecl.}, +): ptr rocksdb_compactionfilter_t {.cdecl.} + proc rocksdb_compactionfilter_set_ignore_snapshots*( - a1: ptr rocksdb_compactionfilter_t; a2: uint8) {.cdecl.} + a1: ptr rocksdb_compactionfilter_t, a2: uint8 +) {.cdecl.} + proc rocksdb_compactionfilter_destroy*(a1: ptr rocksdb_compactionfilter_t) {.cdecl.} ## Compaction Filter Context proc rocksdb_compactionfiltercontext_is_full_compaction*( - context: ptr rocksdb_compactionfiltercontext_t): uint8 {.cdecl.} + context: ptr rocksdb_compactionfiltercontext_t +): uint8 {.cdecl.} + proc rocksdb_compactionfiltercontext_is_manual_compaction*( - context: ptr rocksdb_compactionfiltercontext_t): uint8 {.cdecl.} + context: ptr rocksdb_compactionfiltercontext_t +): uint8 {.cdecl.} + ## Compaction Filter Factory -proc rocksdb_compactionfilterfactory_create*(state: pointer; - destructor: proc (a1: pointer) {.cdecl.}; create_compaction_filter: proc ( - a1: pointer; context: ptr rocksdb_compactionfiltercontext_t): ptr rocksdb_compactionfilter_t {. - cdecl.}; name: proc (a1: pointer): cstring {.cdecl.}): ptr rocksdb_compactionfilterfactory_t {. - cdecl.} +proc rocksdb_compactionfilterfactory_create*( + state: pointer, + destructor: proc(a1: pointer) {.cdecl.}, + create_compaction_filter: proc( + a1: pointer, context: ptr rocksdb_compactionfiltercontext_t + ): ptr rocksdb_compactionfilter_t {.cdecl.}, + name: proc(a1: pointer): cstring {.cdecl.}, +): ptr rocksdb_compactionfilterfactory_t {.cdecl.} + proc rocksdb_compactionfilterfactory_destroy*( - a1: ptr rocksdb_compactionfilterfactory_t) {.cdecl.} + a1: ptr rocksdb_compactionfilterfactory_t +) {.cdecl.} + ## Comparator -proc rocksdb_comparator_create*(state: pointer; - destructor: proc (a1: pointer) {.cdecl.}; compare: proc ( - a1: pointer; a: cstring; alen: csize_t; b: cstring; blen: csize_t): cint {.cdecl.}; - name: proc (a1: pointer): cstring {.cdecl.}): ptr rocksdb_comparator_t {. - cdecl.} +proc rocksdb_comparator_create*( + state: pointer, + destructor: proc(a1: pointer) {.cdecl.}, + compare: proc(a1: pointer, a: cstring, alen: csize_t, b: cstring, blen: csize_t): cint {. + cdecl + .}, + name: proc(a1: pointer): cstring {.cdecl.}, +): ptr rocksdb_comparator_t {.cdecl.} + proc rocksdb_comparator_destroy*(a1: ptr rocksdb_comparator_t) {.cdecl.} -proc rocksdb_comparator_with_ts_create*(state: pointer; - destructor: proc (a1: pointer) {.cdecl.}; - compare: proc (a1: pointer; a: cstring; alen: csize_t; b: cstring; blen: csize_t): cint {. - cdecl.}; compare_ts: proc (a1: pointer; a_ts: cstring; a_tslen: csize_t; - b_ts: cstring; b_tslen: csize_t): cint {.cdecl.}; - compare_without_ts: proc (a1: pointer; a: cstring; alen: csize_t; a_has_ts: uint8; - b: cstring; blen: csize_t; b_has_ts: uint8): cint {.cdecl.}; - name: proc (a1: pointer): cstring {.cdecl.}; timestamp_size: csize_t): ptr rocksdb_comparator_t {. - cdecl.} +proc rocksdb_comparator_with_ts_create*( + state: pointer, + destructor: proc(a1: pointer) {.cdecl.}, + compare: proc(a1: pointer, a: cstring, alen: csize_t, b: cstring, blen: csize_t): cint {. + cdecl + .}, + compare_ts: proc( + a1: pointer, a_ts: cstring, a_tslen: csize_t, b_ts: cstring, b_tslen: csize_t + ): cint {.cdecl.}, + compare_without_ts: proc( + a1: pointer, + a: cstring, + alen: csize_t, + a_has_ts: uint8, + b: cstring, + blen: csize_t, + b_has_ts: uint8, + ): cint {.cdecl.}, + name: proc(a1: pointer): cstring {.cdecl.}, + timestamp_size: csize_t, +): ptr rocksdb_comparator_t {.cdecl.} + ## Filter policy proc rocksdb_filterpolicy_destroy*(a1: ptr rocksdb_filterpolicy_t) {.cdecl.} -proc rocksdb_filterpolicy_create_bloom*(bits_per_key: cdouble): ptr rocksdb_filterpolicy_t {. - cdecl.} -proc rocksdb_filterpolicy_create_bloom_full*(bits_per_key: cdouble): ptr rocksdb_filterpolicy_t {. - cdecl.} -proc rocksdb_filterpolicy_create_ribbon*(bloom_equivalent_bits_per_key: cdouble): ptr rocksdb_filterpolicy_t {. - cdecl.} +proc rocksdb_filterpolicy_create_bloom*( + bits_per_key: cdouble +): ptr rocksdb_filterpolicy_t {.cdecl.} + +proc rocksdb_filterpolicy_create_bloom_full*( + bits_per_key: cdouble +): ptr rocksdb_filterpolicy_t {.cdecl.} + +proc rocksdb_filterpolicy_create_ribbon*( + bloom_equivalent_bits_per_key: cdouble +): ptr rocksdb_filterpolicy_t {.cdecl.} + proc rocksdb_filterpolicy_create_ribbon_hybrid*( - bloom_equivalent_bits_per_key: cdouble; bloom_before_level: cint): ptr rocksdb_filterpolicy_t {. - cdecl.} + bloom_equivalent_bits_per_key: cdouble, bloom_before_level: cint +): ptr rocksdb_filterpolicy_t {.cdecl.} + ## Merge Operator -proc rocksdb_mergeoperator_create*(state: pointer; - destructor: proc (a1: pointer) {.cdecl.}; - full_merge: proc (a1: pointer; key: cstring; key_length: csize_t; - existing_value: cstring; existing_value_length: csize_t; - operands_list: cstringArray; - operands_list_length: ptr csize_t; num_operands: cint; - success: ptr uint8; new_value_length: ptr csize_t): cstring {.cdecl.}; - partial_merge: proc (a1: pointer; key: cstring; key_length: csize_t; - operands_list: cstringArray; - operands_list_length: ptr csize_t; num_operands: cint; - success: ptr uint8; new_value_length: ptr csize_t): cstring {. - cdecl.}; delete_value: proc (a1: pointer; value: cstring; value_length: csize_t) {. - cdecl.}; name: proc (a1: pointer): cstring {.cdecl.}): ptr rocksdb_mergeoperator_t {. - cdecl.} +proc rocksdb_mergeoperator_create*( + state: pointer, + destructor: proc(a1: pointer) {.cdecl.}, + full_merge: proc( + a1: pointer, + key: cstring, + key_length: csize_t, + existing_value: cstring, + existing_value_length: csize_t, + operands_list: cstringArray, + operands_list_length: ptr csize_t, + num_operands: cint, + success: ptr uint8, + new_value_length: ptr csize_t, + ): cstring {.cdecl.}, + partial_merge: proc( + a1: pointer, + key: cstring, + key_length: csize_t, + operands_list: cstringArray, + operands_list_length: ptr csize_t, + num_operands: cint, + success: ptr uint8, + new_value_length: ptr csize_t, + ): cstring {.cdecl.}, + delete_value: proc(a1: pointer, value: cstring, value_length: csize_t) {.cdecl.}, + name: proc(a1: pointer): cstring {.cdecl.}, +): ptr rocksdb_mergeoperator_t {.cdecl.} + proc rocksdb_mergeoperator_destroy*(a1: ptr rocksdb_mergeoperator_t) {.cdecl.} ## Read options proc rocksdb_readoptions_create*(): ptr rocksdb_readoptions_t {.cdecl.} proc rocksdb_readoptions_destroy*(a1: ptr rocksdb_readoptions_t) {.cdecl.} -proc rocksdb_readoptions_set_verify_checksums*(a1: ptr rocksdb_readoptions_t; - a2: uint8) {.cdecl.} -proc rocksdb_readoptions_get_verify_checksums*(a1: ptr rocksdb_readoptions_t): uint8 {. - cdecl.} -proc rocksdb_readoptions_set_fill_cache*(a1: ptr rocksdb_readoptions_t; a2: uint8) {. - cdecl.} -proc rocksdb_readoptions_get_fill_cache*(a1: ptr rocksdb_readoptions_t): uint8 {. - cdecl.} -proc rocksdb_readoptions_set_snapshot*(a1: ptr rocksdb_readoptions_t; - a2: ptr rocksdb_snapshot_t) {.cdecl.} -proc rocksdb_readoptions_set_iterate_upper_bound*(a1: ptr rocksdb_readoptions_t; - key: cstring; keylen: csize_t) {.cdecl.} -proc rocksdb_readoptions_set_iterate_lower_bound*(a1: ptr rocksdb_readoptions_t; - key: cstring; keylen: csize_t) {.cdecl.} -proc rocksdb_readoptions_set_read_tier*(a1: ptr rocksdb_readoptions_t; a2: cint) {. - cdecl.} +proc rocksdb_readoptions_set_verify_checksums*( + a1: ptr rocksdb_readoptions_t, a2: uint8 +) {.cdecl.} + +proc rocksdb_readoptions_get_verify_checksums*( + a1: ptr rocksdb_readoptions_t +): uint8 {.cdecl.} + +proc rocksdb_readoptions_set_fill_cache*( + a1: ptr rocksdb_readoptions_t, a2: uint8 +) {.cdecl.} + +proc rocksdb_readoptions_get_fill_cache*(a1: ptr rocksdb_readoptions_t): uint8 {.cdecl.} +proc rocksdb_readoptions_set_snapshot*( + a1: ptr rocksdb_readoptions_t, a2: ptr rocksdb_snapshot_t +) {.cdecl.} + +proc rocksdb_readoptions_set_iterate_upper_bound*( + a1: ptr rocksdb_readoptions_t, key: cstring, keylen: csize_t +) {.cdecl.} + +proc rocksdb_readoptions_set_iterate_lower_bound*( + a1: ptr rocksdb_readoptions_t, key: cstring, keylen: csize_t +) {.cdecl.} + +proc rocksdb_readoptions_set_read_tier*( + a1: ptr rocksdb_readoptions_t, a2: cint +) {.cdecl.} + proc rocksdb_readoptions_get_read_tier*(a1: ptr rocksdb_readoptions_t): cint {.cdecl.} -proc rocksdb_readoptions_set_tailing*(a1: ptr rocksdb_readoptions_t; a2: uint8) {. - cdecl.} +proc rocksdb_readoptions_set_tailing*( + a1: ptr rocksdb_readoptions_t, a2: uint8 +) {.cdecl.} + proc rocksdb_readoptions_get_tailing*(a1: ptr rocksdb_readoptions_t): uint8 {.cdecl.} ## The functionality that this option controlled has been removed. -proc rocksdb_readoptions_set_managed*(a1: ptr rocksdb_readoptions_t; a2: uint8) {. - cdecl.} -proc rocksdb_readoptions_set_readahead_size*(a1: ptr rocksdb_readoptions_t; - a2: csize_t) {.cdecl.} -proc rocksdb_readoptions_get_readahead_size*(a1: ptr rocksdb_readoptions_t): csize_t {. - cdecl.} -proc rocksdb_readoptions_set_prefix_same_as_start*(a1: ptr rocksdb_readoptions_t; - a2: uint8) {.cdecl.} -proc rocksdb_readoptions_get_prefix_same_as_start*(a1: ptr rocksdb_readoptions_t): uint8 {. - cdecl.} -proc rocksdb_readoptions_set_pin_data*(a1: ptr rocksdb_readoptions_t; a2: uint8) {. - cdecl.} +proc rocksdb_readoptions_set_managed*( + a1: ptr rocksdb_readoptions_t, a2: uint8 +) {.cdecl.} + +proc rocksdb_readoptions_set_readahead_size*( + a1: ptr rocksdb_readoptions_t, a2: csize_t +) {.cdecl.} + +proc rocksdb_readoptions_get_readahead_size*( + a1: ptr rocksdb_readoptions_t +): csize_t {.cdecl.} + +proc rocksdb_readoptions_set_prefix_same_as_start*( + a1: ptr rocksdb_readoptions_t, a2: uint8 +) {.cdecl.} + +proc rocksdb_readoptions_get_prefix_same_as_start*( + a1: ptr rocksdb_readoptions_t +): uint8 {.cdecl.} + +proc rocksdb_readoptions_set_pin_data*( + a1: ptr rocksdb_readoptions_t, a2: uint8 +) {.cdecl.} + proc rocksdb_readoptions_get_pin_data*(a1: ptr rocksdb_readoptions_t): uint8 {.cdecl.} -proc rocksdb_readoptions_set_total_order_seek*(a1: ptr rocksdb_readoptions_t; - a2: uint8) {.cdecl.} -proc rocksdb_readoptions_get_total_order_seek*(a1: ptr rocksdb_readoptions_t): uint8 {. - cdecl.} +proc rocksdb_readoptions_set_total_order_seek*( + a1: ptr rocksdb_readoptions_t, a2: uint8 +) {.cdecl.} + +proc rocksdb_readoptions_get_total_order_seek*( + a1: ptr rocksdb_readoptions_t +): uint8 {.cdecl.} + proc rocksdb_readoptions_set_max_skippable_internal_keys*( - a1: ptr rocksdb_readoptions_t; a2: uint64) {.cdecl.} + a1: ptr rocksdb_readoptions_t, a2: uint64 +) {.cdecl.} + proc rocksdb_readoptions_get_max_skippable_internal_keys*( - a1: ptr rocksdb_readoptions_t): uint64 {.cdecl.} + a1: ptr rocksdb_readoptions_t +): uint64 {.cdecl.} + proc rocksdb_readoptions_set_background_purge_on_iterator_cleanup*( - a1: ptr rocksdb_readoptions_t; a2: uint8) {.cdecl.} + a1: ptr rocksdb_readoptions_t, a2: uint8 +) {.cdecl.} + proc rocksdb_readoptions_get_background_purge_on_iterator_cleanup*( - a1: ptr rocksdb_readoptions_t): uint8 {.cdecl.} + a1: ptr rocksdb_readoptions_t +): uint8 {.cdecl.} + proc rocksdb_readoptions_set_ignore_range_deletions*( - a1: ptr rocksdb_readoptions_t; a2: uint8) {.cdecl.} + a1: ptr rocksdb_readoptions_t, a2: uint8 +) {.cdecl.} + proc rocksdb_readoptions_get_ignore_range_deletions*( - a1: ptr rocksdb_readoptions_t): uint8 {.cdecl.} -proc rocksdb_readoptions_set_deadline*(a1: ptr rocksdb_readoptions_t; - microseconds: uint64) {.cdecl.} + a1: ptr rocksdb_readoptions_t +): uint8 {.cdecl.} + +proc rocksdb_readoptions_set_deadline*( + a1: ptr rocksdb_readoptions_t, microseconds: uint64 +) {.cdecl.} + proc rocksdb_readoptions_get_deadline*(a1: ptr rocksdb_readoptions_t): uint64 {.cdecl.} -proc rocksdb_readoptions_set_io_timeout*(a1: ptr rocksdb_readoptions_t; - microseconds: uint64) {.cdecl.} -proc rocksdb_readoptions_get_io_timeout*(a1: ptr rocksdb_readoptions_t): uint64 {. - cdecl.} -proc rocksdb_readoptions_set_async_io*(a1: ptr rocksdb_readoptions_t; a2: uint8) {. - cdecl.} +proc rocksdb_readoptions_set_io_timeout*( + a1: ptr rocksdb_readoptions_t, microseconds: uint64 +) {.cdecl.} + +proc rocksdb_readoptions_get_io_timeout*( + a1: ptr rocksdb_readoptions_t +): uint64 {.cdecl.} + +proc rocksdb_readoptions_set_async_io*( + a1: ptr rocksdb_readoptions_t, a2: uint8 +) {.cdecl.} + proc rocksdb_readoptions_get_async_io*(a1: ptr rocksdb_readoptions_t): uint8 {.cdecl.} -proc rocksdb_readoptions_set_timestamp*(a1: ptr rocksdb_readoptions_t; ts: cstring; - tslen: csize_t) {.cdecl.} -proc rocksdb_readoptions_set_iter_start_ts*(a1: ptr rocksdb_readoptions_t; - ts: cstring; tslen: csize_t) {.cdecl.} -proc rocksdb_readoptions_set_auto_readahead_size*(a1: ptr rocksdb_readoptions_t; - a2: uint8) {.cdecl.} +proc rocksdb_readoptions_set_timestamp*( + a1: ptr rocksdb_readoptions_t, ts: cstring, tslen: csize_t +) {.cdecl.} + +proc rocksdb_readoptions_set_iter_start_ts*( + a1: ptr rocksdb_readoptions_t, ts: cstring, tslen: csize_t +) {.cdecl.} + +proc rocksdb_readoptions_set_auto_readahead_size*( + a1: ptr rocksdb_readoptions_t, a2: uint8 +) {.cdecl.} + ## Write options proc rocksdb_writeoptions_create*(): ptr rocksdb_writeoptions_t {.cdecl.} proc rocksdb_writeoptions_destroy*(a1: ptr rocksdb_writeoptions_t) {.cdecl.} -proc rocksdb_writeoptions_set_sync*(a1: ptr rocksdb_writeoptions_t; a2: uint8) {.cdecl.} +proc rocksdb_writeoptions_set_sync*(a1: ptr rocksdb_writeoptions_t, a2: uint8) {.cdecl.} proc rocksdb_writeoptions_get_sync*(a1: ptr rocksdb_writeoptions_t): uint8 {.cdecl.} -proc rocksdb_writeoptions_disable_WAL*(opt: ptr rocksdb_writeoptions_t; - disable: cint) {.cdecl.} -proc rocksdb_writeoptions_get_disable_WAL*(opt: ptr rocksdb_writeoptions_t): uint8 {. - cdecl.} +proc rocksdb_writeoptions_disable_WAL*( + opt: ptr rocksdb_writeoptions_t, disable: cint +) {.cdecl.} + +proc rocksdb_writeoptions_get_disable_WAL*( + opt: ptr rocksdb_writeoptions_t +): uint8 {.cdecl.} + proc rocksdb_writeoptions_set_ignore_missing_column_families*( - a1: ptr rocksdb_writeoptions_t; a2: uint8) {.cdecl.} + a1: ptr rocksdb_writeoptions_t, a2: uint8 +) {.cdecl.} + proc rocksdb_writeoptions_get_ignore_missing_column_families*( - a1: ptr rocksdb_writeoptions_t): uint8 {.cdecl.} -proc rocksdb_writeoptions_set_no_slowdown*(a1: ptr rocksdb_writeoptions_t; a2: uint8) {. - cdecl.} -proc rocksdb_writeoptions_get_no_slowdown*(a1: ptr rocksdb_writeoptions_t): uint8 {. - cdecl.} -proc rocksdb_writeoptions_set_low_pri*(a1: ptr rocksdb_writeoptions_t; a2: uint8) {. - cdecl.} + a1: ptr rocksdb_writeoptions_t +): uint8 {.cdecl.} + +proc rocksdb_writeoptions_set_no_slowdown*( + a1: ptr rocksdb_writeoptions_t, a2: uint8 +) {.cdecl.} + +proc rocksdb_writeoptions_get_no_slowdown*( + a1: ptr rocksdb_writeoptions_t +): uint8 {.cdecl.} + +proc rocksdb_writeoptions_set_low_pri*( + a1: ptr rocksdb_writeoptions_t, a2: uint8 +) {.cdecl.} + proc rocksdb_writeoptions_get_low_pri*(a1: ptr rocksdb_writeoptions_t): uint8 {.cdecl.} proc rocksdb_writeoptions_set_memtable_insert_hint_per_batch*( - a1: ptr rocksdb_writeoptions_t; a2: uint8) {.cdecl.} + a1: ptr rocksdb_writeoptions_t, a2: uint8 +) {.cdecl.} + proc rocksdb_writeoptions_get_memtable_insert_hint_per_batch*( - a1: ptr rocksdb_writeoptions_t): uint8 {.cdecl.} + a1: ptr rocksdb_writeoptions_t +): uint8 {.cdecl.} + ## Compact range options proc rocksdb_compactoptions_create*(): ptr rocksdb_compactoptions_t {.cdecl.} proc rocksdb_compactoptions_destroy*(a1: ptr rocksdb_compactoptions_t) {.cdecl.} proc rocksdb_compactoptions_set_exclusive_manual_compaction*( - a1: ptr rocksdb_compactoptions_t; a2: uint8) {.cdecl.} + a1: ptr rocksdb_compactoptions_t, a2: uint8 +) {.cdecl.} + proc rocksdb_compactoptions_get_exclusive_manual_compaction*( - a1: ptr rocksdb_compactoptions_t): uint8 {.cdecl.} + a1: ptr rocksdb_compactoptions_t +): uint8 {.cdecl.} + proc rocksdb_compactoptions_set_bottommost_level_compaction*( - a1: ptr rocksdb_compactoptions_t; a2: uint8) {.cdecl.} + a1: ptr rocksdb_compactoptions_t, a2: uint8 +) {.cdecl.} + proc rocksdb_compactoptions_get_bottommost_level_compaction*( - a1: ptr rocksdb_compactoptions_t): uint8 {.cdecl.} -proc rocksdb_compactoptions_set_change_level*(a1: ptr rocksdb_compactoptions_t; - a2: uint8) {.cdecl.} -proc rocksdb_compactoptions_get_change_level*(a1: ptr rocksdb_compactoptions_t): uint8 {. - cdecl.} -proc rocksdb_compactoptions_set_target_level*(a1: ptr rocksdb_compactoptions_t; - a2: cint) {.cdecl.} -proc rocksdb_compactoptions_get_target_level*(a1: ptr rocksdb_compactoptions_t): cint {. - cdecl.} + a1: ptr rocksdb_compactoptions_t +): uint8 {.cdecl.} + +proc rocksdb_compactoptions_set_change_level*( + a1: ptr rocksdb_compactoptions_t, a2: uint8 +) {.cdecl.} + +proc rocksdb_compactoptions_get_change_level*( + a1: ptr rocksdb_compactoptions_t +): uint8 {.cdecl.} + +proc rocksdb_compactoptions_set_target_level*( + a1: ptr rocksdb_compactoptions_t, a2: cint +) {.cdecl.} + +proc rocksdb_compactoptions_get_target_level*( + a1: ptr rocksdb_compactoptions_t +): cint {.cdecl.} + proc rocksdb_compactoptions_set_full_history_ts_low*( - a1: ptr rocksdb_compactoptions_t; ts: cstring; tslen: csize_t) {.cdecl.} + a1: ptr rocksdb_compactoptions_t, ts: cstring, tslen: csize_t +) {.cdecl.} + ## Flush options proc rocksdb_flushoptions_create*(): ptr rocksdb_flushoptions_t {.cdecl.} proc rocksdb_flushoptions_destroy*(a1: ptr rocksdb_flushoptions_t) {.cdecl.} -proc rocksdb_flushoptions_set_wait*(a1: ptr rocksdb_flushoptions_t; a2: uint8) {.cdecl.} +proc rocksdb_flushoptions_set_wait*(a1: ptr rocksdb_flushoptions_t, a2: uint8) {.cdecl.} proc rocksdb_flushoptions_get_wait*(a1: ptr rocksdb_flushoptions_t): uint8 {.cdecl.} ## Memory allocator -proc rocksdb_jemalloc_nodump_allocator_create*(errptr: cstringArray): ptr rocksdb_memory_allocator_t {. - cdecl.} +proc rocksdb_jemalloc_nodump_allocator_create*( + errptr: cstringArray +): ptr rocksdb_memory_allocator_t {.cdecl.} + proc rocksdb_memory_allocator_destroy*(a1: ptr rocksdb_memory_allocator_t) {.cdecl.} ## Cache proc rocksdb_lru_cache_options_create*(): ptr rocksdb_lru_cache_options_t {.cdecl.} proc rocksdb_lru_cache_options_destroy*(a1: ptr rocksdb_lru_cache_options_t) {.cdecl.} -proc rocksdb_lru_cache_options_set_capacity*(a1: ptr rocksdb_lru_cache_options_t; - a2: csize_t) {.cdecl.} +proc rocksdb_lru_cache_options_set_capacity*( + a1: ptr rocksdb_lru_cache_options_t, a2: csize_t +) {.cdecl.} + proc rocksdb_lru_cache_options_set_num_shard_bits*( - a1: ptr rocksdb_lru_cache_options_t; a2: cint) {.cdecl.} + a1: ptr rocksdb_lru_cache_options_t, a2: cint +) {.cdecl.} + proc rocksdb_lru_cache_options_set_memory_allocator*( - a1: ptr rocksdb_lru_cache_options_t; a2: ptr rocksdb_memory_allocator_t) {.cdecl.} + a1: ptr rocksdb_lru_cache_options_t, a2: ptr rocksdb_memory_allocator_t +) {.cdecl.} + proc rocksdb_cache_create_lru*(capacity: csize_t): ptr rocksdb_cache_t {.cdecl.} -proc rocksdb_cache_create_lru_with_strict_capacity_limit*(capacity: csize_t): ptr rocksdb_cache_t {. - cdecl.} -proc rocksdb_cache_create_lru_opts*(a1: ptr rocksdb_lru_cache_options_t): ptr rocksdb_cache_t {. - cdecl.} +proc rocksdb_cache_create_lru_with_strict_capacity_limit*( + capacity: csize_t +): ptr rocksdb_cache_t {.cdecl.} + +proc rocksdb_cache_create_lru_opts*( + a1: ptr rocksdb_lru_cache_options_t +): ptr rocksdb_cache_t {.cdecl.} + proc rocksdb_cache_destroy*(cache: ptr rocksdb_cache_t) {.cdecl.} proc rocksdb_cache_disown_data*(cache: ptr rocksdb_cache_t) {.cdecl.} -proc rocksdb_cache_set_capacity*(cache: ptr rocksdb_cache_t; capacity: csize_t) {. - cdecl.} +proc rocksdb_cache_set_capacity*( + cache: ptr rocksdb_cache_t, capacity: csize_t +) {.cdecl.} + proc rocksdb_cache_get_capacity*(cache: ptr rocksdb_cache_t): csize_t {.cdecl.} proc rocksdb_cache_get_usage*(cache: ptr rocksdb_cache_t): csize_t {.cdecl.} proc rocksdb_cache_get_pinned_usage*(cache: ptr rocksdb_cache_t): csize_t {.cdecl.} -proc rocksdb_cache_get_table_address_count*(cache: ptr rocksdb_cache_t): csize_t {. - cdecl.} +proc rocksdb_cache_get_table_address_count*( + cache: ptr rocksdb_cache_t +): csize_t {.cdecl.} + proc rocksdb_cache_get_occupancy_count*(cache: ptr rocksdb_cache_t): csize_t {.cdecl.} ## WriteBufferManager -proc rocksdb_write_buffer_manager_create*(buffer_size: csize_t; allow_stall: bool): ptr rocksdb_write_buffer_manager_t {. - cdecl.} -proc rocksdb_write_buffer_manager_create_with_cache*(buffer_size: csize_t; - cache: ptr rocksdb_cache_t; allow_stall: bool): ptr rocksdb_write_buffer_manager_t {. - cdecl.} +proc rocksdb_write_buffer_manager_create*( + buffer_size: csize_t, allow_stall: bool +): ptr rocksdb_write_buffer_manager_t {.cdecl.} + +proc rocksdb_write_buffer_manager_create_with_cache*( + buffer_size: csize_t, cache: ptr rocksdb_cache_t, allow_stall: bool +): ptr rocksdb_write_buffer_manager_t {.cdecl.} + proc rocksdb_write_buffer_manager_destroy*( - wbm: ptr rocksdb_write_buffer_manager_t) {.cdecl.} + wbm: ptr rocksdb_write_buffer_manager_t +) {.cdecl.} + proc rocksdb_write_buffer_manager_enabled*( - wbm: ptr rocksdb_write_buffer_manager_t): bool {.cdecl.} + wbm: ptr rocksdb_write_buffer_manager_t +): bool {.cdecl.} + proc rocksdb_write_buffer_manager_cost_to_cache*( - wbm: ptr rocksdb_write_buffer_manager_t): bool {.cdecl.} + wbm: ptr rocksdb_write_buffer_manager_t +): bool {.cdecl.} + proc rocksdb_write_buffer_manager_memory_usage*( - wbm: ptr rocksdb_write_buffer_manager_t): csize_t {.cdecl.} + wbm: ptr rocksdb_write_buffer_manager_t +): csize_t {.cdecl.} + proc rocksdb_write_buffer_manager_mutable_memtable_memory_usage*( - wbm: ptr rocksdb_write_buffer_manager_t): csize_t {.cdecl.} + wbm: ptr rocksdb_write_buffer_manager_t +): csize_t {.cdecl.} + proc rocksdb_write_buffer_manager_dummy_entries_in_cache_usage*( - wbm: ptr rocksdb_write_buffer_manager_t): csize_t {.cdecl.} + wbm: ptr rocksdb_write_buffer_manager_t +): csize_t {.cdecl.} + proc rocksdb_write_buffer_manager_buffer_size*( - wbm: ptr rocksdb_write_buffer_manager_t): csize_t {.cdecl.} + wbm: ptr rocksdb_write_buffer_manager_t +): csize_t {.cdecl.} + proc rocksdb_write_buffer_manager_set_buffer_size*( - wbm: ptr rocksdb_write_buffer_manager_t; new_size: csize_t) {.cdecl.} + wbm: ptr rocksdb_write_buffer_manager_t, new_size: csize_t +) {.cdecl.} + proc rocksdb_write_buffer_manager_set_allow_stall*( - wbm: ptr rocksdb_write_buffer_manager_t; new_allow_stall: bool) {.cdecl.} + wbm: ptr rocksdb_write_buffer_manager_t, new_allow_stall: bool +) {.cdecl.} + ## HyperClockCache -proc rocksdb_hyper_clock_cache_options_create*(capacity: csize_t; - estimated_entry_charge: csize_t): ptr rocksdb_hyper_clock_cache_options_t {. - cdecl.} +proc rocksdb_hyper_clock_cache_options_create*( + capacity: csize_t, estimated_entry_charge: csize_t +): ptr rocksdb_hyper_clock_cache_options_t {.cdecl.} + proc rocksdb_hyper_clock_cache_options_destroy*( - a1: ptr rocksdb_hyper_clock_cache_options_t) {.cdecl.} + a1: ptr rocksdb_hyper_clock_cache_options_t +) {.cdecl.} + proc rocksdb_hyper_clock_cache_options_set_capacity*( - a1: ptr rocksdb_hyper_clock_cache_options_t; a2: csize_t) {.cdecl.} + a1: ptr rocksdb_hyper_clock_cache_options_t, a2: csize_t +) {.cdecl.} + proc rocksdb_hyper_clock_cache_options_set_estimated_entry_charge*( - a1: ptr rocksdb_hyper_clock_cache_options_t; a2: csize_t) {.cdecl.} + a1: ptr rocksdb_hyper_clock_cache_options_t, a2: csize_t +) {.cdecl.} + proc rocksdb_hyper_clock_cache_options_set_num_shard_bits*( - a1: ptr rocksdb_hyper_clock_cache_options_t; a2: cint) {.cdecl.} + a1: ptr rocksdb_hyper_clock_cache_options_t, a2: cint +) {.cdecl.} + proc rocksdb_hyper_clock_cache_options_set_memory_allocator*( - a1: ptr rocksdb_hyper_clock_cache_options_t; a2: ptr rocksdb_memory_allocator_t) {. - cdecl.} -proc rocksdb_cache_create_hyper_clock*(capacity: csize_t; - estimated_entry_charge: csize_t): ptr rocksdb_cache_t {. - cdecl.} + a1: ptr rocksdb_hyper_clock_cache_options_t, a2: ptr rocksdb_memory_allocator_t +) {.cdecl.} + +proc rocksdb_cache_create_hyper_clock*( + capacity: csize_t, estimated_entry_charge: csize_t +): ptr rocksdb_cache_t {.cdecl.} + proc rocksdb_cache_create_hyper_clock_opts*( - a1: ptr rocksdb_hyper_clock_cache_options_t): ptr rocksdb_cache_t {.cdecl.} + a1: ptr rocksdb_hyper_clock_cache_options_t +): ptr rocksdb_cache_t {.cdecl.} + ## DBPath -proc rocksdb_dbpath_create*(path: cstring; target_size: uint64): ptr rocksdb_dbpath_t {. - cdecl.} +proc rocksdb_dbpath_create*( + path: cstring, target_size: uint64 +): ptr rocksdb_dbpath_t {.cdecl.} + proc rocksdb_dbpath_destroy*(a1: ptr rocksdb_dbpath_t) {.cdecl.} ## Env proc rocksdb_create_default_env*(): ptr rocksdb_env_t {.cdecl.} proc rocksdb_create_mem_env*(): ptr rocksdb_env_t {.cdecl.} -proc rocksdb_env_set_background_threads*(env: ptr rocksdb_env_t; n: cint) {.cdecl.} +proc rocksdb_env_set_background_threads*(env: ptr rocksdb_env_t, n: cint) {.cdecl.} proc rocksdb_env_get_background_threads*(env: ptr rocksdb_env_t): cint {.cdecl.} -proc rocksdb_env_set_high_priority_background_threads*(env: ptr rocksdb_env_t; - n: cint) {.cdecl.} -proc rocksdb_env_get_high_priority_background_threads*(env: ptr rocksdb_env_t): cint {. - cdecl.} -proc rocksdb_env_set_low_priority_background_threads*(env: ptr rocksdb_env_t; - n: cint) {.cdecl.} -proc rocksdb_env_get_low_priority_background_threads*(env: ptr rocksdb_env_t): cint {. - cdecl.} -proc rocksdb_env_set_bottom_priority_background_threads*(env: ptr rocksdb_env_t; - n: cint) {.cdecl.} -proc rocksdb_env_get_bottom_priority_background_threads*(env: ptr rocksdb_env_t): cint {. - cdecl.} +proc rocksdb_env_set_high_priority_background_threads*( + env: ptr rocksdb_env_t, n: cint +) {.cdecl.} + +proc rocksdb_env_get_high_priority_background_threads*( + env: ptr rocksdb_env_t +): cint {.cdecl.} + +proc rocksdb_env_set_low_priority_background_threads*( + env: ptr rocksdb_env_t, n: cint +) {.cdecl.} + +proc rocksdb_env_get_low_priority_background_threads*( + env: ptr rocksdb_env_t +): cint {.cdecl.} + +proc rocksdb_env_set_bottom_priority_background_threads*( + env: ptr rocksdb_env_t, n: cint +) {.cdecl.} + +proc rocksdb_env_get_bottom_priority_background_threads*( + env: ptr rocksdb_env_t +): cint {.cdecl.} + proc rocksdb_env_join_all_threads*(env: ptr rocksdb_env_t) {.cdecl.} proc rocksdb_env_lower_thread_pool_io_priority*(env: ptr rocksdb_env_t) {.cdecl.} proc rocksdb_env_lower_high_priority_thread_pool_io_priority*( - env: ptr rocksdb_env_t) {.cdecl.} + env: ptr rocksdb_env_t +) {.cdecl.} + proc rocksdb_env_lower_thread_pool_cpu_priority*(env: ptr rocksdb_env_t) {.cdecl.} proc rocksdb_env_lower_high_priority_thread_pool_cpu_priority*( - env: ptr rocksdb_env_t) {.cdecl.} + env: ptr rocksdb_env_t +) {.cdecl.} + proc rocksdb_env_destroy*(a1: ptr rocksdb_env_t) {.cdecl.} proc rocksdb_envoptions_create*(): ptr rocksdb_envoptions_t {.cdecl.} proc rocksdb_envoptions_destroy*(opt: ptr rocksdb_envoptions_t) {.cdecl.} -proc rocksdb_create_dir_if_missing*(env: ptr rocksdb_env_t; path: cstring; - errptr: cstringArray) {.cdecl.} +proc rocksdb_create_dir_if_missing*( + env: ptr rocksdb_env_t, path: cstring, errptr: cstringArray +) {.cdecl.} + ## SstFile -proc rocksdb_sstfilewriter_create*(env: ptr rocksdb_envoptions_t; - io_options: ptr rocksdb_options_t): ptr rocksdb_sstfilewriter_t {. - cdecl.} -proc rocksdb_sstfilewriter_create_with_comparator*(env: ptr rocksdb_envoptions_t; - io_options: ptr rocksdb_options_t; comparator: ptr rocksdb_comparator_t): ptr rocksdb_sstfilewriter_t {. - cdecl.} -proc rocksdb_sstfilewriter_open*(writer: ptr rocksdb_sstfilewriter_t; name: cstring; - errptr: cstringArray) {.cdecl.} -proc rocksdb_sstfilewriter_add*(writer: ptr rocksdb_sstfilewriter_t; key: cstring; - keylen: csize_t; val: cstring; vallen: csize_t; - errptr: cstringArray) {.cdecl.} -proc rocksdb_sstfilewriter_put*(writer: ptr rocksdb_sstfilewriter_t; key: cstring; - keylen: csize_t; val: cstring; vallen: csize_t; - errptr: cstringArray) {.cdecl.} -proc rocksdb_sstfilewriter_put_with_ts*(writer: ptr rocksdb_sstfilewriter_t; - key: cstring; keylen: csize_t; ts: cstring; - tslen: csize_t; val: cstring; - vallen: csize_t; errptr: cstringArray) {. - cdecl.} -proc rocksdb_sstfilewriter_merge*(writer: ptr rocksdb_sstfilewriter_t; key: cstring; - keylen: csize_t; val: cstring; vallen: csize_t; - errptr: cstringArray) {.cdecl.} -proc rocksdb_sstfilewriter_delete*(writer: ptr rocksdb_sstfilewriter_t; - key: cstring; keylen: csize_t; - errptr: cstringArray) {.cdecl.} -proc rocksdb_sstfilewriter_delete_with_ts*(writer: ptr rocksdb_sstfilewriter_t; - key: cstring; keylen: csize_t; ts: cstring; tslen: csize_t; errptr: cstringArray) {. - cdecl.} -proc rocksdb_sstfilewriter_delete_range*(writer: ptr rocksdb_sstfilewriter_t; - begin_key: cstring; begin_keylen: csize_t; - end_key: cstring; end_keylen: csize_t; - errptr: cstringArray) {.cdecl.} -proc rocksdb_sstfilewriter_finish*(writer: ptr rocksdb_sstfilewriter_t; - errptr: cstringArray) {.cdecl.} -proc rocksdb_sstfilewriter_file_size*(writer: ptr rocksdb_sstfilewriter_t; - file_size: ptr uint64) {.cdecl.} +proc rocksdb_sstfilewriter_create*( + env: ptr rocksdb_envoptions_t, io_options: ptr rocksdb_options_t +): ptr rocksdb_sstfilewriter_t {.cdecl.} + +proc rocksdb_sstfilewriter_create_with_comparator*( + env: ptr rocksdb_envoptions_t, + io_options: ptr rocksdb_options_t, + comparator: ptr rocksdb_comparator_t, +): ptr rocksdb_sstfilewriter_t {.cdecl.} + +proc rocksdb_sstfilewriter_open*( + writer: ptr rocksdb_sstfilewriter_t, name: cstring, errptr: cstringArray +) {.cdecl.} + +proc rocksdb_sstfilewriter_add*( + writer: ptr rocksdb_sstfilewriter_t, + key: cstring, + keylen: csize_t, + val: cstring, + vallen: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_sstfilewriter_put*( + writer: ptr rocksdb_sstfilewriter_t, + key: cstring, + keylen: csize_t, + val: cstring, + vallen: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_sstfilewriter_put_with_ts*( + writer: ptr rocksdb_sstfilewriter_t, + key: cstring, + keylen: csize_t, + ts: cstring, + tslen: csize_t, + val: cstring, + vallen: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_sstfilewriter_merge*( + writer: ptr rocksdb_sstfilewriter_t, + key: cstring, + keylen: csize_t, + val: cstring, + vallen: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_sstfilewriter_delete*( + writer: ptr rocksdb_sstfilewriter_t, + key: cstring, + keylen: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_sstfilewriter_delete_with_ts*( + writer: ptr rocksdb_sstfilewriter_t, + key: cstring, + keylen: csize_t, + ts: cstring, + tslen: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_sstfilewriter_delete_range*( + writer: ptr rocksdb_sstfilewriter_t, + begin_key: cstring, + begin_keylen: csize_t, + end_key: cstring, + end_keylen: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_sstfilewriter_finish*( + writer: ptr rocksdb_sstfilewriter_t, errptr: cstringArray +) {.cdecl.} + +proc rocksdb_sstfilewriter_file_size*( + writer: ptr rocksdb_sstfilewriter_t, file_size: ptr uint64 +) {.cdecl.} + proc rocksdb_sstfilewriter_destroy*(writer: ptr rocksdb_sstfilewriter_t) {.cdecl.} proc rocksdb_ingestexternalfileoptions_create*(): ptr rocksdb_ingestexternalfileoptions_t {. - cdecl.} + cdecl +.} + proc rocksdb_ingestexternalfileoptions_set_move_files*( - opt: ptr rocksdb_ingestexternalfileoptions_t; move_files: uint8) {.cdecl.} + opt: ptr rocksdb_ingestexternalfileoptions_t, move_files: uint8 +) {.cdecl.} + proc rocksdb_ingestexternalfileoptions_set_snapshot_consistency*( - opt: ptr rocksdb_ingestexternalfileoptions_t; snapshot_consistency: uint8) {. - cdecl.} + opt: ptr rocksdb_ingestexternalfileoptions_t, snapshot_consistency: uint8 +) {.cdecl.} + proc rocksdb_ingestexternalfileoptions_set_allow_global_seqno*( - opt: ptr rocksdb_ingestexternalfileoptions_t; allow_global_seqno: uint8) {.cdecl.} + opt: ptr rocksdb_ingestexternalfileoptions_t, allow_global_seqno: uint8 +) {.cdecl.} + proc rocksdb_ingestexternalfileoptions_set_allow_blocking_flush*( - opt: ptr rocksdb_ingestexternalfileoptions_t; allow_blocking_flush: uint8) {. - cdecl.} + opt: ptr rocksdb_ingestexternalfileoptions_t, allow_blocking_flush: uint8 +) {.cdecl.} + proc rocksdb_ingestexternalfileoptions_set_ingest_behind*( - opt: ptr rocksdb_ingestexternalfileoptions_t; ingest_behind: uint8) {.cdecl.} + opt: ptr rocksdb_ingestexternalfileoptions_t, ingest_behind: uint8 +) {.cdecl.} + proc rocksdb_ingestexternalfileoptions_set_fail_if_not_bottommost_level*( - opt: ptr rocksdb_ingestexternalfileoptions_t; - fail_if_not_bottommost_level: uint8) {.cdecl.} + opt: ptr rocksdb_ingestexternalfileoptions_t, fail_if_not_bottommost_level: uint8 +) {.cdecl.} + proc rocksdb_ingestexternalfileoptions_destroy*( - opt: ptr rocksdb_ingestexternalfileoptions_t) {.cdecl.} -proc rocksdb_ingest_external_file*(db: ptr rocksdb_t; file_list: cstringArray; - list_len: csize_t; - opt: ptr rocksdb_ingestexternalfileoptions_t; - errptr: cstringArray) {.cdecl.} -proc rocksdb_ingest_external_file_cf*(db: ptr rocksdb_t; handle: ptr rocksdb_column_family_handle_t; - file_list: cstringArray; list_len: csize_t; opt: ptr rocksdb_ingestexternalfileoptions_t; - errptr: cstringArray) {.cdecl.} -proc rocksdb_try_catch_up_with_primary*(db: ptr rocksdb_t; errptr: cstringArray) {. - cdecl.} + opt: ptr rocksdb_ingestexternalfileoptions_t +) {.cdecl.} + +proc rocksdb_ingest_external_file*( + db: ptr rocksdb_t, + file_list: cstringArray, + list_len: csize_t, + opt: ptr rocksdb_ingestexternalfileoptions_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_ingest_external_file_cf*( + db: ptr rocksdb_t, + handle: ptr rocksdb_column_family_handle_t, + file_list: cstringArray, + list_len: csize_t, + opt: ptr rocksdb_ingestexternalfileoptions_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_try_catch_up_with_primary*( + db: ptr rocksdb_t, errptr: cstringArray +) {.cdecl.} + ## SliceTransform -proc rocksdb_slicetransform_create*(state: pointer; - destructor: proc (a1: pointer) {.cdecl.}; - transform: proc (a1: pointer; key: cstring; length: csize_t; dst_length: ptr csize_t): cstring {. - cdecl.}; in_domain: proc (a1: pointer; key: cstring; length: csize_t): uint8 {.cdecl.}; - in_range: proc (a1: pointer; key: cstring; length: csize_t): uint8 {.cdecl.}; - name: proc (a1: pointer): cstring {.cdecl.}): ptr rocksdb_slicetransform_t {. - cdecl.} -proc rocksdb_slicetransform_create_fixed_prefix*(a1: csize_t): ptr rocksdb_slicetransform_t {. - cdecl.} +proc rocksdb_slicetransform_create*( + state: pointer, + destructor: proc(a1: pointer) {.cdecl.}, + transform: proc( + a1: pointer, key: cstring, length: csize_t, dst_length: ptr csize_t + ): cstring {.cdecl.}, + in_domain: proc(a1: pointer, key: cstring, length: csize_t): uint8 {.cdecl.}, + in_range: proc(a1: pointer, key: cstring, length: csize_t): uint8 {.cdecl.}, + name: proc(a1: pointer): cstring {.cdecl.}, +): ptr rocksdb_slicetransform_t {.cdecl.} + +proc rocksdb_slicetransform_create_fixed_prefix*( + a1: csize_t +): ptr rocksdb_slicetransform_t {.cdecl.} + proc rocksdb_slicetransform_create_noop*(): ptr rocksdb_slicetransform_t {.cdecl.} proc rocksdb_slicetransform_destroy*(a1: ptr rocksdb_slicetransform_t) {.cdecl.} ## Universal Compaction options @@ -1890,79 +3413,150 @@ const rocksdb_total_size_compaction_stop_style* = 1 proc rocksdb_universal_compaction_options_create*(): ptr rocksdb_universal_compaction_options_t {. - cdecl.} + cdecl +.} + proc rocksdb_universal_compaction_options_set_size_ratio*( - a1: ptr rocksdb_universal_compaction_options_t; a2: cint) {.cdecl.} + a1: ptr rocksdb_universal_compaction_options_t, a2: cint +) {.cdecl.} + proc rocksdb_universal_compaction_options_get_size_ratio*( - a1: ptr rocksdb_universal_compaction_options_t): cint {.cdecl.} + a1: ptr rocksdb_universal_compaction_options_t +): cint {.cdecl.} + proc rocksdb_universal_compaction_options_set_min_merge_width*( - a1: ptr rocksdb_universal_compaction_options_t; a2: cint) {.cdecl.} + a1: ptr rocksdb_universal_compaction_options_t, a2: cint +) {.cdecl.} + proc rocksdb_universal_compaction_options_get_min_merge_width*( - a1: ptr rocksdb_universal_compaction_options_t): cint {.cdecl.} + a1: ptr rocksdb_universal_compaction_options_t +): cint {.cdecl.} + proc rocksdb_universal_compaction_options_set_max_merge_width*( - a1: ptr rocksdb_universal_compaction_options_t; a2: cint) {.cdecl.} + a1: ptr rocksdb_universal_compaction_options_t, a2: cint +) {.cdecl.} + proc rocksdb_universal_compaction_options_get_max_merge_width*( - a1: ptr rocksdb_universal_compaction_options_t): cint {.cdecl.} + a1: ptr rocksdb_universal_compaction_options_t +): cint {.cdecl.} + proc rocksdb_universal_compaction_options_set_max_size_amplification_percent*( - a1: ptr rocksdb_universal_compaction_options_t; a2: cint) {.cdecl.} + a1: ptr rocksdb_universal_compaction_options_t, a2: cint +) {.cdecl.} + proc rocksdb_universal_compaction_options_get_max_size_amplification_percent*( - a1: ptr rocksdb_universal_compaction_options_t): cint {.cdecl.} + a1: ptr rocksdb_universal_compaction_options_t +): cint {.cdecl.} + proc rocksdb_universal_compaction_options_set_compression_size_percent*( - a1: ptr rocksdb_universal_compaction_options_t; a2: cint) {.cdecl.} + a1: ptr rocksdb_universal_compaction_options_t, a2: cint +) {.cdecl.} + proc rocksdb_universal_compaction_options_get_compression_size_percent*( - a1: ptr rocksdb_universal_compaction_options_t): cint {.cdecl.} + a1: ptr rocksdb_universal_compaction_options_t +): cint {.cdecl.} + proc rocksdb_universal_compaction_options_set_stop_style*( - a1: ptr rocksdb_universal_compaction_options_t; a2: cint) {.cdecl.} + a1: ptr rocksdb_universal_compaction_options_t, a2: cint +) {.cdecl.} + proc rocksdb_universal_compaction_options_get_stop_style*( - a1: ptr rocksdb_universal_compaction_options_t): cint {.cdecl.} + a1: ptr rocksdb_universal_compaction_options_t +): cint {.cdecl.} + proc rocksdb_universal_compaction_options_destroy*( - a1: ptr rocksdb_universal_compaction_options_t) {.cdecl.} + a1: ptr rocksdb_universal_compaction_options_t +) {.cdecl.} + proc rocksdb_fifo_compaction_options_create*(): ptr rocksdb_fifo_compaction_options_t {. - cdecl.} + cdecl +.} + proc rocksdb_fifo_compaction_options_set_allow_compaction*( - fifo_opts: ptr rocksdb_fifo_compaction_options_t; allow_compaction: uint8) {. - cdecl.} + fifo_opts: ptr rocksdb_fifo_compaction_options_t, allow_compaction: uint8 +) {.cdecl.} + proc rocksdb_fifo_compaction_options_get_allow_compaction*( - fifo_opts: ptr rocksdb_fifo_compaction_options_t): uint8 {.cdecl.} + fifo_opts: ptr rocksdb_fifo_compaction_options_t +): uint8 {.cdecl.} + proc rocksdb_fifo_compaction_options_set_max_table_files_size*( - fifo_opts: ptr rocksdb_fifo_compaction_options_t; size: uint64) {.cdecl.} + fifo_opts: ptr rocksdb_fifo_compaction_options_t, size: uint64 +) {.cdecl.} + proc rocksdb_fifo_compaction_options_get_max_table_files_size*( - fifo_opts: ptr rocksdb_fifo_compaction_options_t): uint64 {.cdecl.} + fifo_opts: ptr rocksdb_fifo_compaction_options_t +): uint64 {.cdecl.} + proc rocksdb_fifo_compaction_options_destroy*( - fifo_opts: ptr rocksdb_fifo_compaction_options_t) {.cdecl.} + fifo_opts: ptr rocksdb_fifo_compaction_options_t +) {.cdecl.} + proc rocksdb_livefiles_count*(a1: ptr rocksdb_livefiles_t): cint {.cdecl.} -proc rocksdb_livefiles_column_family_name*(a1: ptr rocksdb_livefiles_t; index: cint): cstring {. - cdecl.} -proc rocksdb_livefiles_name*(a1: ptr rocksdb_livefiles_t; index: cint): cstring {.cdecl.} -proc rocksdb_livefiles_level*(a1: ptr rocksdb_livefiles_t; index: cint): cint {.cdecl.} -proc rocksdb_livefiles_size*(a1: ptr rocksdb_livefiles_t; index: cint): csize_t {.cdecl.} -proc rocksdb_livefiles_smallestkey*(a1: ptr rocksdb_livefiles_t; index: cint; - size: ptr csize_t): cstring {.cdecl.} -proc rocksdb_livefiles_largestkey*(a1: ptr rocksdb_livefiles_t; index: cint; - size: ptr csize_t): cstring {.cdecl.} -proc rocksdb_livefiles_entries*(a1: ptr rocksdb_livefiles_t; index: cint): uint64 {. - cdecl.} -proc rocksdb_livefiles_deletions*(a1: ptr rocksdb_livefiles_t; index: cint): uint64 {. - cdecl.} +proc rocksdb_livefiles_column_family_name*( + a1: ptr rocksdb_livefiles_t, index: cint +): cstring {.cdecl.} + +proc rocksdb_livefiles_name*( + a1: ptr rocksdb_livefiles_t, index: cint +): cstring {.cdecl.} + +proc rocksdb_livefiles_level*(a1: ptr rocksdb_livefiles_t, index: cint): cint {.cdecl.} +proc rocksdb_livefiles_size*( + a1: ptr rocksdb_livefiles_t, index: cint +): csize_t {.cdecl.} + +proc rocksdb_livefiles_smallestkey*( + a1: ptr rocksdb_livefiles_t, index: cint, size: ptr csize_t +): cstring {.cdecl.} + +proc rocksdb_livefiles_largestkey*( + a1: ptr rocksdb_livefiles_t, index: cint, size: ptr csize_t +): cstring {.cdecl.} + +proc rocksdb_livefiles_entries*( + a1: ptr rocksdb_livefiles_t, index: cint +): uint64 {.cdecl.} + +proc rocksdb_livefiles_deletions*( + a1: ptr rocksdb_livefiles_t, index: cint +): uint64 {.cdecl.} + proc rocksdb_livefiles_destroy*(a1: ptr rocksdb_livefiles_t) {.cdecl.} ## Utility Helpers -proc rocksdb_get_options_from_string*(base_options: ptr rocksdb_options_t; - opts_str: cstring; - new_options: ptr rocksdb_options_t; - errptr: cstringArray) {.cdecl.} -proc rocksdb_delete_file_in_range*(db: ptr rocksdb_t; start_key: cstring; - start_key_len: csize_t; limit_key: cstring; - limit_key_len: csize_t; errptr: cstringArray) {. - cdecl.} -proc rocksdb_delete_file_in_range_cf*(db: ptr rocksdb_t; column_family: ptr rocksdb_column_family_handle_t; - start_key: cstring; start_key_len: csize_t; - limit_key: cstring; limit_key_len: csize_t; - errptr: cstringArray) {.cdecl.} +proc rocksdb_get_options_from_string*( + base_options: ptr rocksdb_options_t, + opts_str: cstring, + new_options: ptr rocksdb_options_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_delete_file_in_range*( + db: ptr rocksdb_t, + start_key: cstring, + start_key_len: csize_t, + limit_key: cstring, + limit_key_len: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_delete_file_in_range_cf*( + db: ptr rocksdb_t, + column_family: ptr rocksdb_column_family_handle_t, + start_key: cstring, + start_key_len: csize_t, + limit_key: cstring, + limit_key_len: csize_t, + errptr: cstringArray, +) {.cdecl.} + ## MetaData -proc rocksdb_get_column_family_metadata*(db: ptr rocksdb_t): ptr rocksdb_column_family_metadata_t {. - cdecl.} +proc rocksdb_get_column_family_metadata*( + db: ptr rocksdb_t +): ptr rocksdb_column_family_metadata_t {.cdecl.} + ## ## Returns the rocksdb_column_family_metadata_t of the specified ## column family. @@ -1971,19 +3565,30 @@ proc rocksdb_get_column_family_metadata*(db: ptr rocksdb_t): ptr rocksdb_column_ ## using rocksdb_column_family_metadata_destroy. ## -proc rocksdb_get_column_family_metadata_cf*(db: ptr rocksdb_t; - column_family: ptr rocksdb_column_family_handle_t): ptr rocksdb_column_family_metadata_t {. - cdecl.} +proc rocksdb_get_column_family_metadata_cf*( + db: ptr rocksdb_t, column_family: ptr rocksdb_column_family_handle_t +): ptr rocksdb_column_family_metadata_t {.cdecl.} + proc rocksdb_column_family_metadata_destroy*( - cf_meta: ptr rocksdb_column_family_metadata_t) {.cdecl.} + cf_meta: ptr rocksdb_column_family_metadata_t +) {.cdecl.} + proc rocksdb_column_family_metadata_get_size*( - cf_meta: ptr rocksdb_column_family_metadata_t): uint64 {.cdecl.} + cf_meta: ptr rocksdb_column_family_metadata_t +): uint64 {.cdecl.} + proc rocksdb_column_family_metadata_get_file_count*( - cf_meta: ptr rocksdb_column_family_metadata_t): csize_t {.cdecl.} + cf_meta: ptr rocksdb_column_family_metadata_t +): csize_t {.cdecl.} + proc rocksdb_column_family_metadata_get_name*( - cf_meta: ptr rocksdb_column_family_metadata_t): cstring {.cdecl.} + cf_meta: ptr rocksdb_column_family_metadata_t +): cstring {.cdecl.} + proc rocksdb_column_family_metadata_get_level_count*( - cf_meta: ptr rocksdb_column_family_metadata_t): csize_t {.cdecl.} + cf_meta: ptr rocksdb_column_family_metadata_t +): csize_t {.cdecl.} + ## ## Returns the rocksdb_level_metadata_t of the ith level from the specified ## column family metadata. @@ -1997,8 +3602,9 @@ proc rocksdb_column_family_metadata_get_level_count*( ## proc rocksdb_column_family_metadata_get_level_metadata*( - cf_meta: ptr rocksdb_column_family_metadata_t; i: csize_t): ptr rocksdb_level_metadata_t {. - cdecl.} + cf_meta: ptr rocksdb_column_family_metadata_t, i: csize_t +): ptr rocksdb_level_metadata_t {.cdecl.} + ## ## Releases the specified rocksdb_level_metadata_t. ## @@ -2006,14 +3612,19 @@ proc rocksdb_column_family_metadata_get_level_metadata*( ## before the release of its parent rocksdb_column_family_metadata_t. ## -proc rocksdb_level_metadata_destroy*(level_meta: ptr rocksdb_level_metadata_t) {. - cdecl.} -proc rocksdb_level_metadata_get_level*(level_meta: ptr rocksdb_level_metadata_t): cint {. - cdecl.} -proc rocksdb_level_metadata_get_size*(level_meta: ptr rocksdb_level_metadata_t): uint64 {. - cdecl.} +proc rocksdb_level_metadata_destroy*(level_meta: ptr rocksdb_level_metadata_t) {.cdecl.} +proc rocksdb_level_metadata_get_level*( + level_meta: ptr rocksdb_level_metadata_t +): cint {.cdecl.} + +proc rocksdb_level_metadata_get_size*( + level_meta: ptr rocksdb_level_metadata_t +): uint64 {.cdecl.} + proc rocksdb_level_metadata_get_file_count*( - level_meta: ptr rocksdb_level_metadata_t): csize_t {.cdecl.} + level_meta: ptr rocksdb_level_metadata_t +): csize_t {.cdecl.} + ## ## Returns the sst_file_metadata_t of the ith file from the specified level ## metadata. @@ -2027,8 +3638,9 @@ proc rocksdb_level_metadata_get_file_count*( ## proc rocksdb_level_metadata_get_sst_file_metadata*( - level_meta: ptr rocksdb_level_metadata_t; i: csize_t): ptr rocksdb_sst_file_metadata_t {. - cdecl.} + level_meta: ptr rocksdb_level_metadata_t, i: csize_t +): ptr rocksdb_sst_file_metadata_t {.cdecl.} + ## ## Releases the specified rocksdb_sst_file_metadata_t. ## @@ -2036,14 +3648,22 @@ proc rocksdb_level_metadata_get_sst_file_metadata*( ## before the release of its parent rocksdb_level_metadata_t. ## -proc rocksdb_sst_file_metadata_destroy*(file_meta: ptr rocksdb_sst_file_metadata_t) {. - cdecl.} +proc rocksdb_sst_file_metadata_destroy*( + file_meta: ptr rocksdb_sst_file_metadata_t +) {.cdecl.} + proc rocksdb_sst_file_metadata_get_relative_filename*( - file_meta: ptr rocksdb_sst_file_metadata_t): cstring {.cdecl.} + file_meta: ptr rocksdb_sst_file_metadata_t +): cstring {.cdecl.} + proc rocksdb_sst_file_metadata_get_directory*( - file_meta: ptr rocksdb_sst_file_metadata_t): cstring {.cdecl.} -proc rocksdb_sst_file_metadata_get_size*(file_meta: ptr rocksdb_sst_file_metadata_t): uint64 {. - cdecl.} + file_meta: ptr rocksdb_sst_file_metadata_t +): cstring {.cdecl.} + +proc rocksdb_sst_file_metadata_get_size*( + file_meta: ptr rocksdb_sst_file_metadata_t +): uint64 {.cdecl.} + ## ## Returns the smallest key of the specified sst file. ## The caller is responsible for releasing the returned memory. @@ -2054,7 +3674,9 @@ proc rocksdb_sst_file_metadata_get_size*(file_meta: ptr rocksdb_sst_file_metadat ## proc rocksdb_sst_file_metadata_get_smallestkey*( - file_meta: ptr rocksdb_sst_file_metadata_t; len: ptr csize_t): cstring {.cdecl.} + file_meta: ptr rocksdb_sst_file_metadata_t, len: ptr csize_t +): cstring {.cdecl.} + ## ## Returns the smallest key of the specified sst file. ## The caller is responsible for releasing the returned memory. @@ -2065,392 +3687,751 @@ proc rocksdb_sst_file_metadata_get_smallestkey*( ## proc rocksdb_sst_file_metadata_get_largestkey*( - file_meta: ptr rocksdb_sst_file_metadata_t; len: ptr csize_t): cstring {.cdecl.} + file_meta: ptr rocksdb_sst_file_metadata_t, len: ptr csize_t +): cstring {.cdecl.} + ## Transactions proc rocksdb_transactiondb_create_column_family*( - txn_db: ptr rocksdb_transactiondb_t; - column_family_options: ptr rocksdb_options_t; column_family_name: cstring; - errptr: cstringArray): ptr rocksdb_column_family_handle_t {.cdecl.} -proc rocksdb_transactiondb_open*(options: ptr rocksdb_options_t; txn_db_options: ptr rocksdb_transactiondb_options_t; - name: cstring; errptr: cstringArray): ptr rocksdb_transactiondb_t {. - cdecl.} -proc rocksdb_transactiondb_open_column_families*(options: ptr rocksdb_options_t; - txn_db_options: ptr rocksdb_transactiondb_options_t; name: cstring; - num_column_families: cint; column_family_names: cstringArray; - column_family_options: ptr ptr rocksdb_options_t; - column_family_handles: ptr ptr rocksdb_column_family_handle_t; - errptr: cstringArray): ptr rocksdb_transactiondb_t {.cdecl.} -proc rocksdb_transactiondb_create_snapshot*(txn_db: ptr rocksdb_transactiondb_t): ptr rocksdb_snapshot_t {. - cdecl.} -proc rocksdb_transactiondb_release_snapshot*(txn_db: ptr rocksdb_transactiondb_t; - snapshot: ptr rocksdb_snapshot_t) {.cdecl.} -proc rocksdb_transactiondb_property_value*(db: ptr rocksdb_transactiondb_t; - propname: cstring): cstring {.cdecl.} -proc rocksdb_transactiondb_property_int*(db: ptr rocksdb_transactiondb_t; - propname: cstring; out_val: ptr uint64): cint {. - cdecl.} -proc rocksdb_transactiondb_get_base_db*(txn_db: ptr rocksdb_transactiondb_t): ptr rocksdb_t {. - cdecl.} + txn_db: ptr rocksdb_transactiondb_t, + column_family_options: ptr rocksdb_options_t, + column_family_name: cstring, + errptr: cstringArray, +): ptr rocksdb_column_family_handle_t {.cdecl.} + +proc rocksdb_transactiondb_open*( + options: ptr rocksdb_options_t, + txn_db_options: ptr rocksdb_transactiondb_options_t, + name: cstring, + errptr: cstringArray, +): ptr rocksdb_transactiondb_t {.cdecl.} + +proc rocksdb_transactiondb_open_column_families*( + options: ptr rocksdb_options_t, + txn_db_options: ptr rocksdb_transactiondb_options_t, + name: cstring, + num_column_families: cint, + column_family_names: cstringArray, + column_family_options: ptr ptr rocksdb_options_t, + column_family_handles: ptr ptr rocksdb_column_family_handle_t, + errptr: cstringArray, +): ptr rocksdb_transactiondb_t {.cdecl.} + +proc rocksdb_transactiondb_create_snapshot*( + txn_db: ptr rocksdb_transactiondb_t +): ptr rocksdb_snapshot_t {.cdecl.} + +proc rocksdb_transactiondb_release_snapshot*( + txn_db: ptr rocksdb_transactiondb_t, snapshot: ptr rocksdb_snapshot_t +) {.cdecl.} + +proc rocksdb_transactiondb_property_value*( + db: ptr rocksdb_transactiondb_t, propname: cstring +): cstring {.cdecl.} + +proc rocksdb_transactiondb_property_int*( + db: ptr rocksdb_transactiondb_t, propname: cstring, out_val: ptr uint64 +): cint {.cdecl.} + +proc rocksdb_transactiondb_get_base_db*( + txn_db: ptr rocksdb_transactiondb_t +): ptr rocksdb_t {.cdecl.} + proc rocksdb_transactiondb_close_base_db*(base_db: ptr rocksdb_t) {.cdecl.} -proc rocksdb_transaction_begin*(txn_db: ptr rocksdb_transactiondb_t; - write_options: ptr rocksdb_writeoptions_t; - txn_options: ptr rocksdb_transaction_options_t; - old_txn: ptr rocksdb_transaction_t): ptr rocksdb_transaction_t {. - cdecl.} +proc rocksdb_transaction_begin*( + txn_db: ptr rocksdb_transactiondb_t, + write_options: ptr rocksdb_writeoptions_t, + txn_options: ptr rocksdb_transaction_options_t, + old_txn: ptr rocksdb_transaction_t, +): ptr rocksdb_transaction_t {.cdecl.} + proc rocksdb_transactiondb_get_prepared_transactions*( - txn_db: ptr rocksdb_transactiondb_t; cnt: ptr csize_t): ptr ptr rocksdb_transaction_t {. - cdecl.} -proc rocksdb_transaction_set_name*(txn: ptr rocksdb_transaction_t; name: cstring; - name_len: csize_t; errptr: cstringArray) {.cdecl.} -proc rocksdb_transaction_get_name*(txn: ptr rocksdb_transaction_t; - name_len: ptr csize_t): cstring {.cdecl.} -proc rocksdb_transaction_prepare*(txn: ptr rocksdb_transaction_t; - errptr: cstringArray) {.cdecl.} -proc rocksdb_transaction_commit*(txn: ptr rocksdb_transaction_t; - errptr: cstringArray) {.cdecl.} -proc rocksdb_transaction_rollback*(txn: ptr rocksdb_transaction_t; - errptr: cstringArray) {.cdecl.} + txn_db: ptr rocksdb_transactiondb_t, cnt: ptr csize_t +): ptr ptr rocksdb_transaction_t {.cdecl.} + +proc rocksdb_transaction_set_name*( + txn: ptr rocksdb_transaction_t, name: cstring, name_len: csize_t, errptr: cstringArray +) {.cdecl.} + +proc rocksdb_transaction_get_name*( + txn: ptr rocksdb_transaction_t, name_len: ptr csize_t +): cstring {.cdecl.} + +proc rocksdb_transaction_prepare*( + txn: ptr rocksdb_transaction_t, errptr: cstringArray +) {.cdecl.} + +proc rocksdb_transaction_commit*( + txn: ptr rocksdb_transaction_t, errptr: cstringArray +) {.cdecl.} + +proc rocksdb_transaction_rollback*( + txn: ptr rocksdb_transaction_t, errptr: cstringArray +) {.cdecl.} + proc rocksdb_transaction_set_savepoint*(txn: ptr rocksdb_transaction_t) {.cdecl.} -proc rocksdb_transaction_rollback_to_savepoint*(txn: ptr rocksdb_transaction_t; - errptr: cstringArray) {.cdecl.} +proc rocksdb_transaction_rollback_to_savepoint*( + txn: ptr rocksdb_transaction_t, errptr: cstringArray +) {.cdecl.} + proc rocksdb_transaction_destroy*(txn: ptr rocksdb_transaction_t) {.cdecl.} -proc rocksdb_transaction_get_writebatch_wi*(txn: ptr rocksdb_transaction_t): ptr rocksdb_writebatch_wi_t {. - cdecl.} -proc rocksdb_transaction_rebuild_from_writebatch*(txn: ptr rocksdb_transaction_t; - writebatch: ptr rocksdb_writebatch_t; errptr: cstringArray) {.cdecl.} +proc rocksdb_transaction_get_writebatch_wi*( + txn: ptr rocksdb_transaction_t +): ptr rocksdb_writebatch_wi_t {.cdecl.} + +proc rocksdb_transaction_rebuild_from_writebatch*( + txn: ptr rocksdb_transaction_t, + writebatch: ptr rocksdb_writebatch_t, + errptr: cstringArray, +) {.cdecl.} + ## This rocksdb_writebatch_wi_t should be freed with rocksdb_free proc rocksdb_transaction_rebuild_from_writebatch_wi*( - txn: ptr rocksdb_transaction_t; wi: ptr rocksdb_writebatch_wi_t; - errptr: cstringArray) {.cdecl.} -proc rocksdb_transaction_set_commit_timestamp*(txn: ptr rocksdb_transaction_t; - commit_timestamp: uint64) {.cdecl.} + txn: ptr rocksdb_transaction_t, wi: ptr rocksdb_writebatch_wi_t, errptr: cstringArray +) {.cdecl.} + +proc rocksdb_transaction_set_commit_timestamp*( + txn: ptr rocksdb_transaction_t, commit_timestamp: uint64 +) {.cdecl.} + proc rocksdb_transaction_set_read_timestamp_for_validation*( - txn: ptr rocksdb_transaction_t; read_timestamp: uint64) {.cdecl.} + txn: ptr rocksdb_transaction_t, read_timestamp: uint64 +) {.cdecl.} + ## This snapshot should be freed using rocksdb_free -proc rocksdb_transaction_get_snapshot*(txn: ptr rocksdb_transaction_t): ptr rocksdb_snapshot_t {. - cdecl.} -proc rocksdb_transaction_get*(txn: ptr rocksdb_transaction_t; - options: ptr rocksdb_readoptions_t; key: cstring; - klen: csize_t; vlen: ptr csize_t; errptr: cstringArray): cstring {. - cdecl.} -proc rocksdb_transaction_get_pinned*(txn: ptr rocksdb_transaction_t; - options: ptr rocksdb_readoptions_t; - key: cstring; klen: csize_t; - errptr: cstringArray): ptr rocksdb_pinnableslice_t {. - cdecl.} -proc rocksdb_transaction_get_cf*(txn: ptr rocksdb_transaction_t; - options: ptr rocksdb_readoptions_t; column_family: ptr rocksdb_column_family_handle_t; - key: cstring; klen: csize_t; vlen: ptr csize_t; - errptr: cstringArray): cstring {.cdecl.} -proc rocksdb_transaction_get_pinned_cf*(txn: ptr rocksdb_transaction_t; - options: ptr rocksdb_readoptions_t; - column_family: ptr rocksdb_column_family_handle_t; key: cstring; klen: csize_t; - errptr: cstringArray): ptr rocksdb_pinnableslice_t {. - cdecl.} -proc rocksdb_transaction_get_for_update*(txn: ptr rocksdb_transaction_t; - options: ptr rocksdb_readoptions_t; - key: cstring; klen: csize_t; - vlen: ptr csize_t; exclusive: uint8; - errptr: cstringArray): cstring {.cdecl.} -proc rocksdb_transaction_get_pinned_for_update*(txn: ptr rocksdb_transaction_t; - options: ptr rocksdb_readoptions_t; key: cstring; klen: csize_t; exclusive: uint8; - errptr: cstringArray): ptr rocksdb_pinnableslice_t {.cdecl.} -proc rocksdb_transaction_get_for_update_cf*(txn: ptr rocksdb_transaction_t; - options: ptr rocksdb_readoptions_t; - column_family: ptr rocksdb_column_family_handle_t; key: cstring; klen: csize_t; - vlen: ptr csize_t; exclusive: uint8; errptr: cstringArray): cstring {.cdecl.} +proc rocksdb_transaction_get_snapshot*( + txn: ptr rocksdb_transaction_t +): ptr rocksdb_snapshot_t {.cdecl.} + +proc rocksdb_transaction_get*( + txn: ptr rocksdb_transaction_t, + options: ptr rocksdb_readoptions_t, + key: cstring, + klen: csize_t, + vlen: ptr csize_t, + errptr: cstringArray, +): cstring {.cdecl.} + +proc rocksdb_transaction_get_pinned*( + txn: ptr rocksdb_transaction_t, + options: ptr rocksdb_readoptions_t, + key: cstring, + klen: csize_t, + errptr: cstringArray, +): ptr rocksdb_pinnableslice_t {.cdecl.} + +proc rocksdb_transaction_get_cf*( + txn: ptr rocksdb_transaction_t, + options: ptr rocksdb_readoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, + vlen: ptr csize_t, + errptr: cstringArray, +): cstring {.cdecl.} + +proc rocksdb_transaction_get_pinned_cf*( + txn: ptr rocksdb_transaction_t, + options: ptr rocksdb_readoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, + errptr: cstringArray, +): ptr rocksdb_pinnableslice_t {.cdecl.} + +proc rocksdb_transaction_get_for_update*( + txn: ptr rocksdb_transaction_t, + options: ptr rocksdb_readoptions_t, + key: cstring, + klen: csize_t, + vlen: ptr csize_t, + exclusive: uint8, + errptr: cstringArray, +): cstring {.cdecl.} + +proc rocksdb_transaction_get_pinned_for_update*( + txn: ptr rocksdb_transaction_t, + options: ptr rocksdb_readoptions_t, + key: cstring, + klen: csize_t, + exclusive: uint8, + errptr: cstringArray, +): ptr rocksdb_pinnableslice_t {.cdecl.} + +proc rocksdb_transaction_get_for_update_cf*( + txn: ptr rocksdb_transaction_t, + options: ptr rocksdb_readoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, + vlen: ptr csize_t, + exclusive: uint8, + errptr: cstringArray, +): cstring {.cdecl.} + proc rocksdb_transaction_get_pinned_for_update_cf*( - txn: ptr rocksdb_transaction_t; options: ptr rocksdb_readoptions_t; - column_family: ptr rocksdb_column_family_handle_t; key: cstring; klen: csize_t; - exclusive: uint8; errptr: cstringArray): ptr rocksdb_pinnableslice_t {.cdecl.} -proc rocksdb_transaction_multi_get*(txn: ptr rocksdb_transaction_t; - options: ptr rocksdb_readoptions_t; - num_keys: csize_t; keys_list: cstringArray; - keys_list_sizes: ptr csize_t; - values_list: cstringArray; - values_list_sizes: ptr csize_t; - errs: cstringArray) {.cdecl.} -proc rocksdb_transaction_multi_get_for_update*(txn: ptr rocksdb_transaction_t; - options: ptr rocksdb_readoptions_t; num_keys: csize_t; keys_list: cstringArray; - keys_list_sizes: ptr csize_t; values_list: cstringArray; - values_list_sizes: ptr csize_t; errs: cstringArray) {.cdecl.} -proc rocksdb_transaction_multi_get_cf*(txn: ptr rocksdb_transaction_t; - options: ptr rocksdb_readoptions_t; - column_families: ptr ptr rocksdb_column_family_handle_t; num_keys: csize_t; - keys_list: cstringArray; - keys_list_sizes: ptr csize_t; - values_list: cstringArray; - values_list_sizes: ptr csize_t; - errs: cstringArray) {.cdecl.} -proc rocksdb_transaction_multi_get_for_update_cf*(txn: ptr rocksdb_transaction_t; - options: ptr rocksdb_readoptions_t; - column_families: ptr ptr rocksdb_column_family_handle_t; num_keys: csize_t; - keys_list: cstringArray; keys_list_sizes: ptr csize_t; values_list: cstringArray; - values_list_sizes: ptr csize_t; errs: cstringArray) {.cdecl.} -proc rocksdb_transactiondb_get*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_readoptions_t; key: cstring; - klen: csize_t; vlen: ptr csize_t; errptr: cstringArray): cstring {. - cdecl.} -proc rocksdb_transactiondb_get_pinned*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_readoptions_t; - key: cstring; klen: csize_t; - errptr: cstringArray): ptr rocksdb_pinnableslice_t {. - cdecl.} -proc rocksdb_transactiondb_get_cf*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_readoptions_t; column_family: ptr rocksdb_column_family_handle_t; - key: cstring; keylen: csize_t; - vallen: ptr csize_t; errptr: cstringArray): cstring {. - cdecl.} -proc rocksdb_transactiondb_get_pinned_cf*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_readoptions_t; - column_family: ptr rocksdb_column_family_handle_t; key: cstring; keylen: csize_t; - errptr: cstringArray): ptr rocksdb_pinnableslice_t {.cdecl.} -proc rocksdb_transactiondb_multi_get*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_readoptions_t; - num_keys: csize_t; keys_list: cstringArray; - keys_list_sizes: ptr csize_t; - values_list: cstringArray; - values_list_sizes: ptr csize_t; - errs: cstringArray) {.cdecl.} -proc rocksdb_transactiondb_multi_get_cf*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_readoptions_t; - column_families: ptr ptr rocksdb_column_family_handle_t; num_keys: csize_t; - keys_list: cstringArray; - keys_list_sizes: ptr csize_t; - values_list: cstringArray; - values_list_sizes: ptr csize_t; - errs: cstringArray) {.cdecl.} -proc rocksdb_transaction_put*(txn: ptr rocksdb_transaction_t; key: cstring; - klen: csize_t; val: cstring; vlen: csize_t; - errptr: cstringArray) {.cdecl.} -proc rocksdb_transaction_put_cf*(txn: ptr rocksdb_transaction_t; column_family: ptr rocksdb_column_family_handle_t; - key: cstring; klen: csize_t; val: cstring; - vlen: csize_t; errptr: cstringArray) {.cdecl.} -proc rocksdb_transactiondb_put*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_writeoptions_t; key: cstring; - klen: csize_t; val: cstring; vlen: csize_t; - errptr: cstringArray) {.cdecl.} -proc rocksdb_transactiondb_put_cf*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_writeoptions_t; - column_family: ptr rocksdb_column_family_handle_t; key: cstring; keylen: csize_t; - val: cstring; vallen: csize_t; - errptr: cstringArray) {.cdecl.} -proc rocksdb_transactiondb_write*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_writeoptions_t; - batch: ptr rocksdb_writebatch_t; - errptr: cstringArray) {.cdecl.} -proc rocksdb_transaction_merge*(txn: ptr rocksdb_transaction_t; key: cstring; - klen: csize_t; val: cstring; vlen: csize_t; - errptr: cstringArray) {.cdecl.} -proc rocksdb_transaction_merge_cf*(txn: ptr rocksdb_transaction_t; column_family: ptr rocksdb_column_family_handle_t; - key: cstring; klen: csize_t; val: cstring; - vlen: csize_t; errptr: cstringArray) {.cdecl.} -proc rocksdb_transactiondb_merge*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_writeoptions_t; key: cstring; - klen: csize_t; val: cstring; vlen: csize_t; - errptr: cstringArray) {.cdecl.} -proc rocksdb_transactiondb_merge_cf*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_writeoptions_t; - column_family: ptr rocksdb_column_family_handle_t; key: cstring; klen: csize_t; - val: cstring; vlen: csize_t; - errptr: cstringArray) {.cdecl.} -proc rocksdb_transaction_delete*(txn: ptr rocksdb_transaction_t; key: cstring; - klen: csize_t; errptr: cstringArray) {.cdecl.} -proc rocksdb_transaction_delete_cf*(txn: ptr rocksdb_transaction_t; column_family: ptr rocksdb_column_family_handle_t; - key: cstring; klen: csize_t; errptr: cstringArray) {. - cdecl.} -proc rocksdb_transactiondb_delete*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_writeoptions_t; - key: cstring; klen: csize_t; errptr: cstringArray) {. - cdecl.} -proc rocksdb_transactiondb_delete_cf*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_writeoptions_t; - column_family: ptr rocksdb_column_family_handle_t; key: cstring; keylen: csize_t; - errptr: cstringArray) {.cdecl.} -proc rocksdb_transaction_create_iterator*(txn: ptr rocksdb_transaction_t; - options: ptr rocksdb_readoptions_t): ptr rocksdb_iterator_t {.cdecl.} -proc rocksdb_transaction_create_iterator_cf*(txn: ptr rocksdb_transaction_t; - options: ptr rocksdb_readoptions_t; - column_family: ptr rocksdb_column_family_handle_t): ptr rocksdb_iterator_t {. - cdecl.} -proc rocksdb_transactiondb_create_iterator*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_readoptions_t): ptr rocksdb_iterator_t {.cdecl.} + txn: ptr rocksdb_transaction_t, + options: ptr rocksdb_readoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, + exclusive: uint8, + errptr: cstringArray, +): ptr rocksdb_pinnableslice_t {.cdecl.} + +proc rocksdb_transaction_multi_get*( + txn: ptr rocksdb_transaction_t, + options: ptr rocksdb_readoptions_t, + num_keys: csize_t, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + values_list: cstringArray, + values_list_sizes: ptr csize_t, + errs: cstringArray, +) {.cdecl.} + +proc rocksdb_transaction_multi_get_for_update*( + txn: ptr rocksdb_transaction_t, + options: ptr rocksdb_readoptions_t, + num_keys: csize_t, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + values_list: cstringArray, + values_list_sizes: ptr csize_t, + errs: cstringArray, +) {.cdecl.} + +proc rocksdb_transaction_multi_get_cf*( + txn: ptr rocksdb_transaction_t, + options: ptr rocksdb_readoptions_t, + column_families: ptr ptr rocksdb_column_family_handle_t, + num_keys: csize_t, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + values_list: cstringArray, + values_list_sizes: ptr csize_t, + errs: cstringArray, +) {.cdecl.} + +proc rocksdb_transaction_multi_get_for_update_cf*( + txn: ptr rocksdb_transaction_t, + options: ptr rocksdb_readoptions_t, + column_families: ptr ptr rocksdb_column_family_handle_t, + num_keys: csize_t, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + values_list: cstringArray, + values_list_sizes: ptr csize_t, + errs: cstringArray, +) {.cdecl.} + +proc rocksdb_transactiondb_get*( + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_readoptions_t, + key: cstring, + klen: csize_t, + vlen: ptr csize_t, + errptr: cstringArray, +): cstring {.cdecl.} + +proc rocksdb_transactiondb_get_pinned*( + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_readoptions_t, + key: cstring, + klen: csize_t, + errptr: cstringArray, +): ptr rocksdb_pinnableslice_t {.cdecl.} + +proc rocksdb_transactiondb_get_cf*( + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_readoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + keylen: csize_t, + vallen: ptr csize_t, + errptr: cstringArray, +): cstring {.cdecl.} + +proc rocksdb_transactiondb_get_pinned_cf*( + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_readoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + keylen: csize_t, + errptr: cstringArray, +): ptr rocksdb_pinnableslice_t {.cdecl.} + +proc rocksdb_transactiondb_multi_get*( + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_readoptions_t, + num_keys: csize_t, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + values_list: cstringArray, + values_list_sizes: ptr csize_t, + errs: cstringArray, +) {.cdecl.} + +proc rocksdb_transactiondb_multi_get_cf*( + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_readoptions_t, + column_families: ptr ptr rocksdb_column_family_handle_t, + num_keys: csize_t, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + values_list: cstringArray, + values_list_sizes: ptr csize_t, + errs: cstringArray, +) {.cdecl.} + +proc rocksdb_transaction_put*( + txn: ptr rocksdb_transaction_t, + key: cstring, + klen: csize_t, + val: cstring, + vlen: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_transaction_put_cf*( + txn: ptr rocksdb_transaction_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, + val: cstring, + vlen: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_transactiondb_put*( + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_writeoptions_t, + key: cstring, + klen: csize_t, + val: cstring, + vlen: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_transactiondb_put_cf*( + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_writeoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + keylen: csize_t, + val: cstring, + vallen: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_transactiondb_write*( + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_writeoptions_t, + batch: ptr rocksdb_writebatch_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_transaction_merge*( + txn: ptr rocksdb_transaction_t, + key: cstring, + klen: csize_t, + val: cstring, + vlen: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_transaction_merge_cf*( + txn: ptr rocksdb_transaction_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, + val: cstring, + vlen: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_transactiondb_merge*( + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_writeoptions_t, + key: cstring, + klen: csize_t, + val: cstring, + vlen: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_transactiondb_merge_cf*( + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_writeoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, + val: cstring, + vlen: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_transaction_delete*( + txn: ptr rocksdb_transaction_t, key: cstring, klen: csize_t, errptr: cstringArray +) {.cdecl.} + +proc rocksdb_transaction_delete_cf*( + txn: ptr rocksdb_transaction_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_transactiondb_delete*( + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_writeoptions_t, + key: cstring, + klen: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_transactiondb_delete_cf*( + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_writeoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + keylen: csize_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_transaction_create_iterator*( + txn: ptr rocksdb_transaction_t, options: ptr rocksdb_readoptions_t +): ptr rocksdb_iterator_t {.cdecl.} + +proc rocksdb_transaction_create_iterator_cf*( + txn: ptr rocksdb_transaction_t, + options: ptr rocksdb_readoptions_t, + column_family: ptr rocksdb_column_family_handle_t, +): ptr rocksdb_iterator_t {.cdecl.} + +proc rocksdb_transactiondb_create_iterator*( + txn_db: ptr rocksdb_transactiondb_t, options: ptr rocksdb_readoptions_t +): ptr rocksdb_iterator_t {.cdecl.} + proc rocksdb_transactiondb_create_iterator_cf*( - txn_db: ptr rocksdb_transactiondb_t; options: ptr rocksdb_readoptions_t; - column_family: ptr rocksdb_column_family_handle_t): ptr rocksdb_iterator_t {. - cdecl.} + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_readoptions_t, + column_family: ptr rocksdb_column_family_handle_t, +): ptr rocksdb_iterator_t {.cdecl.} + proc rocksdb_transactiondb_close*(txn_db: ptr rocksdb_transactiondb_t) {.cdecl.} -proc rocksdb_transactiondb_flush*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_flushoptions_t; - errptr: cstringArray) {.cdecl.} -proc rocksdb_transactiondb_flush_cf*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_flushoptions_t; - column_family: ptr rocksdb_column_family_handle_t; errptr: cstringArray) {.cdecl.} -proc rocksdb_transactiondb_flush_cfs*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_flushoptions_t; - column_families: ptr ptr rocksdb_column_family_handle_t; - num_column_families: cint; - errptr: cstringArray) {.cdecl.} -proc rocksdb_transactiondb_flush_wal*(txn_db: ptr rocksdb_transactiondb_t; - sync: uint8; errptr: cstringArray) {.cdecl.} +proc rocksdb_transactiondb_flush*( + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_flushoptions_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_transactiondb_flush_cf*( + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_flushoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_transactiondb_flush_cfs*( + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_flushoptions_t, + column_families: ptr ptr rocksdb_column_family_handle_t, + num_column_families: cint, + errptr: cstringArray, +) {.cdecl.} + +proc rocksdb_transactiondb_flush_wal*( + txn_db: ptr rocksdb_transactiondb_t, sync: uint8, errptr: cstringArray +) {.cdecl.} + proc rocksdb_transactiondb_checkpoint_object_create*( - txn_db: ptr rocksdb_transactiondb_t; errptr: cstringArray): ptr rocksdb_checkpoint_t {. - cdecl.} -proc rocksdb_optimistictransactiondb_open*(options: ptr rocksdb_options_t; - name: cstring; errptr: cstringArray): ptr rocksdb_optimistictransactiondb_t {. - cdecl.} + txn_db: ptr rocksdb_transactiondb_t, errptr: cstringArray +): ptr rocksdb_checkpoint_t {.cdecl.} + +proc rocksdb_optimistictransactiondb_open*( + options: ptr rocksdb_options_t, name: cstring, errptr: cstringArray +): ptr rocksdb_optimistictransactiondb_t {.cdecl.} + proc rocksdb_optimistictransactiondb_open_column_families*( - options: ptr rocksdb_options_t; name: cstring; num_column_families: cint; - column_family_names: cstringArray; - column_family_options: ptr ptr rocksdb_options_t; - column_family_handles: ptr ptr rocksdb_column_family_handle_t; - errptr: cstringArray): ptr rocksdb_optimistictransactiondb_t {.cdecl.} + options: ptr rocksdb_options_t, + name: cstring, + num_column_families: cint, + column_family_names: cstringArray, + column_family_options: ptr ptr rocksdb_options_t, + column_family_handles: ptr ptr rocksdb_column_family_handle_t, + errptr: cstringArray, +): ptr rocksdb_optimistictransactiondb_t {.cdecl.} + proc rocksdb_optimistictransactiondb_get_base_db*( - otxn_db: ptr rocksdb_optimistictransactiondb_t): ptr rocksdb_t {.cdecl.} + otxn_db: ptr rocksdb_optimistictransactiondb_t +): ptr rocksdb_t {.cdecl.} + proc rocksdb_optimistictransactiondb_close_base_db*(base_db: ptr rocksdb_t) {.cdecl.} proc rocksdb_optimistictransaction_begin*( - otxn_db: ptr rocksdb_optimistictransactiondb_t; - write_options: ptr rocksdb_writeoptions_t; - otxn_options: ptr rocksdb_optimistictransaction_options_t; - old_txn: ptr rocksdb_transaction_t): ptr rocksdb_transaction_t {.cdecl.} + otxn_db: ptr rocksdb_optimistictransactiondb_t, + write_options: ptr rocksdb_writeoptions_t, + otxn_options: ptr rocksdb_optimistictransaction_options_t, + old_txn: ptr rocksdb_transaction_t, +): ptr rocksdb_transaction_t {.cdecl.} + proc rocksdb_optimistictransactiondb_write*( - otxn_db: ptr rocksdb_optimistictransactiondb_t; - options: ptr rocksdb_writeoptions_t; batch: ptr rocksdb_writebatch_t; - errptr: cstringArray) {.cdecl.} + otxn_db: ptr rocksdb_optimistictransactiondb_t, + options: ptr rocksdb_writeoptions_t, + batch: ptr rocksdb_writebatch_t, + errptr: cstringArray, +) {.cdecl.} + proc rocksdb_optimistictransactiondb_close*( - otxn_db: ptr rocksdb_optimistictransactiondb_t) {.cdecl.} + otxn_db: ptr rocksdb_optimistictransactiondb_t +) {.cdecl.} + proc rocksdb_optimistictransactiondb_checkpoint_object_create*( - otxn_db: ptr rocksdb_optimistictransactiondb_t; errptr: cstringArray): ptr rocksdb_checkpoint_t {. - cdecl.} + otxn_db: ptr rocksdb_optimistictransactiondb_t, errptr: cstringArray +): ptr rocksdb_checkpoint_t {.cdecl.} + ## Transaction Options proc rocksdb_transactiondb_options_create*(): ptr rocksdb_transactiondb_options_t {. - cdecl.} + cdecl +.} + proc rocksdb_transactiondb_options_destroy*( - opt: ptr rocksdb_transactiondb_options_t) {.cdecl.} + opt: ptr rocksdb_transactiondb_options_t +) {.cdecl.} + proc rocksdb_transactiondb_options_set_max_num_locks*( - opt: ptr rocksdb_transactiondb_options_t; max_num_locks: int64) {.cdecl.} + opt: ptr rocksdb_transactiondb_options_t, max_num_locks: int64 +) {.cdecl.} + proc rocksdb_transactiondb_options_set_num_stripes*( - opt: ptr rocksdb_transactiondb_options_t; num_stripes: csize_t) {.cdecl.} + opt: ptr rocksdb_transactiondb_options_t, num_stripes: csize_t +) {.cdecl.} + proc rocksdb_transactiondb_options_set_transaction_lock_timeout*( - opt: ptr rocksdb_transactiondb_options_t; txn_lock_timeout: int64) {.cdecl.} + opt: ptr rocksdb_transactiondb_options_t, txn_lock_timeout: int64 +) {.cdecl.} + proc rocksdb_transactiondb_options_set_default_lock_timeout*( - opt: ptr rocksdb_transactiondb_options_t; default_lock_timeout: int64) {.cdecl.} -proc rocksdb_transaction_options_create*(): ptr rocksdb_transaction_options_t {. - cdecl.} -proc rocksdb_transaction_options_destroy*(opt: ptr rocksdb_transaction_options_t) {. - cdecl.} + opt: ptr rocksdb_transactiondb_options_t, default_lock_timeout: int64 +) {.cdecl.} + +proc rocksdb_transaction_options_create*(): ptr rocksdb_transaction_options_t {.cdecl.} +proc rocksdb_transaction_options_destroy*( + opt: ptr rocksdb_transaction_options_t +) {.cdecl.} + proc rocksdb_transaction_options_set_set_snapshot*( - opt: ptr rocksdb_transaction_options_t; v: uint8) {.cdecl.} + opt: ptr rocksdb_transaction_options_t, v: uint8 +) {.cdecl.} + proc rocksdb_transaction_options_set_deadlock_detect*( - opt: ptr rocksdb_transaction_options_t; v: uint8) {.cdecl.} + opt: ptr rocksdb_transaction_options_t, v: uint8 +) {.cdecl.} + proc rocksdb_transaction_options_set_lock_timeout*( - opt: ptr rocksdb_transaction_options_t; lock_timeout: int64) {.cdecl.} + opt: ptr rocksdb_transaction_options_t, lock_timeout: int64 +) {.cdecl.} + proc rocksdb_transaction_options_set_expiration*( - opt: ptr rocksdb_transaction_options_t; expiration: int64) {.cdecl.} + opt: ptr rocksdb_transaction_options_t, expiration: int64 +) {.cdecl.} + proc rocksdb_transaction_options_set_deadlock_detect_depth*( - opt: ptr rocksdb_transaction_options_t; depth: int64) {.cdecl.} + opt: ptr rocksdb_transaction_options_t, depth: int64 +) {.cdecl.} + proc rocksdb_transaction_options_set_max_write_batch_size*( - opt: ptr rocksdb_transaction_options_t; size: csize_t) {.cdecl.} + opt: ptr rocksdb_transaction_options_t, size: csize_t +) {.cdecl.} + proc rocksdb_transaction_options_set_skip_prepare*( - opt: ptr rocksdb_transaction_options_t; v: uint8) {.cdecl.} + opt: ptr rocksdb_transaction_options_t, v: uint8 +) {.cdecl.} + proc rocksdb_optimistictransaction_options_create*(): ptr rocksdb_optimistictransaction_options_t {. - cdecl.} + cdecl +.} + proc rocksdb_optimistictransaction_options_destroy*( - opt: ptr rocksdb_optimistictransaction_options_t) {.cdecl.} + opt: ptr rocksdb_optimistictransaction_options_t +) {.cdecl.} + proc rocksdb_optimistictransaction_options_set_set_snapshot*( - opt: ptr rocksdb_optimistictransaction_options_t; v: uint8) {.cdecl.} + opt: ptr rocksdb_optimistictransaction_options_t, v: uint8 +) {.cdecl.} + proc rocksdb_optimistictransactiondb_property_value*( - db: ptr rocksdb_optimistictransactiondb_t; propname: cstring): cstring {.cdecl.} + db: ptr rocksdb_optimistictransactiondb_t, propname: cstring +): cstring {.cdecl.} + proc rocksdb_optimistictransactiondb_property_int*( - db: ptr rocksdb_optimistictransactiondb_t; propname: cstring; out_val: ptr uint64): cint {. - cdecl.} + db: ptr rocksdb_optimistictransactiondb_t, propname: cstring, out_val: ptr uint64 +): cint {.cdecl.} + ## referring to convention (3), this should be used by client ## to free memory that was malloc()ed proc rocksdb_free*(`ptr`: pointer) {.cdecl.} -proc rocksdb_get_pinned*(db: ptr rocksdb_t; options: ptr rocksdb_readoptions_t; - key: cstring; keylen: csize_t; errptr: cstringArray): ptr rocksdb_pinnableslice_t {. - cdecl.} -proc rocksdb_get_pinned_cf*(db: ptr rocksdb_t; options: ptr rocksdb_readoptions_t; - column_family: ptr rocksdb_column_family_handle_t; - key: cstring; keylen: csize_t; errptr: cstringArray): ptr rocksdb_pinnableslice_t {. - cdecl.} +proc rocksdb_get_pinned*( + db: ptr rocksdb_t, + options: ptr rocksdb_readoptions_t, + key: cstring, + keylen: csize_t, + errptr: cstringArray, +): ptr rocksdb_pinnableslice_t {.cdecl.} + +proc rocksdb_get_pinned_cf*( + db: ptr rocksdb_t, + options: ptr rocksdb_readoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + keylen: csize_t, + errptr: cstringArray, +): ptr rocksdb_pinnableslice_t {.cdecl.} + proc rocksdb_pinnableslice_destroy*(v: ptr rocksdb_pinnableslice_t) {.cdecl.} -proc rocksdb_pinnableslice_value*(t: ptr rocksdb_pinnableslice_t; vlen: ptr csize_t): cstring {. - cdecl.} +proc rocksdb_pinnableslice_value*( + t: ptr rocksdb_pinnableslice_t, vlen: ptr csize_t +): cstring {.cdecl.} + proc rocksdb_memory_consumers_create*(): ptr rocksdb_memory_consumers_t {.cdecl.} -proc rocksdb_memory_consumers_add_db*(consumers: ptr rocksdb_memory_consumers_t; - db: ptr rocksdb_t) {.cdecl.} -proc rocksdb_memory_consumers_add_cache*(consumers: ptr rocksdb_memory_consumers_t; - cache: ptr rocksdb_cache_t) {.cdecl.} -proc rocksdb_memory_consumers_destroy*(consumers: ptr rocksdb_memory_consumers_t) {. - cdecl.} +proc rocksdb_memory_consumers_add_db*( + consumers: ptr rocksdb_memory_consumers_t, db: ptr rocksdb_t +) {.cdecl.} + +proc rocksdb_memory_consumers_add_cache*( + consumers: ptr rocksdb_memory_consumers_t, cache: ptr rocksdb_cache_t +) {.cdecl.} + +proc rocksdb_memory_consumers_destroy*( + consumers: ptr rocksdb_memory_consumers_t +) {.cdecl.} + proc rocksdb_approximate_memory_usage_create*( - consumers: ptr rocksdb_memory_consumers_t; errptr: cstringArray): ptr rocksdb_memory_usage_t {. - cdecl.} -proc rocksdb_approximate_memory_usage_destroy*(usage: ptr rocksdb_memory_usage_t) {. - cdecl.} + consumers: ptr rocksdb_memory_consumers_t, errptr: cstringArray +): ptr rocksdb_memory_usage_t {.cdecl.} + +proc rocksdb_approximate_memory_usage_destroy*( + usage: ptr rocksdb_memory_usage_t +) {.cdecl.} + proc rocksdb_approximate_memory_usage_get_mem_table_total*( - memory_usage: ptr rocksdb_memory_usage_t): uint64 {.cdecl.} + memory_usage: ptr rocksdb_memory_usage_t +): uint64 {.cdecl.} + proc rocksdb_approximate_memory_usage_get_mem_table_unflushed*( - memory_usage: ptr rocksdb_memory_usage_t): uint64 {.cdecl.} + memory_usage: ptr rocksdb_memory_usage_t +): uint64 {.cdecl.} + proc rocksdb_approximate_memory_usage_get_mem_table_readers_total*( - memory_usage: ptr rocksdb_memory_usage_t): uint64 {.cdecl.} + memory_usage: ptr rocksdb_memory_usage_t +): uint64 {.cdecl.} + proc rocksdb_approximate_memory_usage_get_cache_total*( - memory_usage: ptr rocksdb_memory_usage_t): uint64 {.cdecl.} -proc rocksdb_options_set_dump_malloc_stats*(a1: ptr rocksdb_options_t; a2: uint8) {. - cdecl.} -proc rocksdb_options_set_memtable_whole_key_filtering*(a1: ptr rocksdb_options_t; - a2: uint8) {.cdecl.} -proc rocksdb_cancel_all_background_work*(db: ptr rocksdb_t; wait: uint8) {.cdecl.} + memory_usage: ptr rocksdb_memory_usage_t +): uint64 {.cdecl.} + +proc rocksdb_options_set_dump_malloc_stats*( + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl.} + +proc rocksdb_options_set_memtable_whole_key_filtering*( + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl.} + +proc rocksdb_cancel_all_background_work*(db: ptr rocksdb_t, wait: uint8) {.cdecl.} proc rocksdb_disable_manual_compaction*(db: ptr rocksdb_t) {.cdecl.} proc rocksdb_enable_manual_compaction*(db: ptr rocksdb_t) {.cdecl.} proc rocksdb_statistics_histogram_data_create*(): ptr rocksdb_statistics_histogram_data_t {. - cdecl.} + cdecl +.} + proc rocksdb_statistics_histogram_data_destroy*( - data: ptr rocksdb_statistics_histogram_data_t) {.cdecl.} + data: ptr rocksdb_statistics_histogram_data_t +) {.cdecl.} + proc rocksdb_statistics_histogram_data_get_median*( - data: ptr rocksdb_statistics_histogram_data_t): cdouble {.cdecl.} + data: ptr rocksdb_statistics_histogram_data_t +): cdouble {.cdecl.} + proc rocksdb_statistics_histogram_data_get_p95*( - data: ptr rocksdb_statistics_histogram_data_t): cdouble {.cdecl.} + data: ptr rocksdb_statistics_histogram_data_t +): cdouble {.cdecl.} + proc rocksdb_statistics_histogram_data_get_p99*( - data: ptr rocksdb_statistics_histogram_data_t): cdouble {.cdecl.} + data: ptr rocksdb_statistics_histogram_data_t +): cdouble {.cdecl.} + proc rocksdb_statistics_histogram_data_get_average*( - data: ptr rocksdb_statistics_histogram_data_t): cdouble {.cdecl.} + data: ptr rocksdb_statistics_histogram_data_t +): cdouble {.cdecl.} + proc rocksdb_statistics_histogram_data_get_std_dev*( - data: ptr rocksdb_statistics_histogram_data_t): cdouble {.cdecl.} + data: ptr rocksdb_statistics_histogram_data_t +): cdouble {.cdecl.} + proc rocksdb_statistics_histogram_data_get_max*( - data: ptr rocksdb_statistics_histogram_data_t): cdouble {.cdecl.} + data: ptr rocksdb_statistics_histogram_data_t +): cdouble {.cdecl.} + proc rocksdb_statistics_histogram_data_get_count*( - data: ptr rocksdb_statistics_histogram_data_t): uint64 {.cdecl.} + data: ptr rocksdb_statistics_histogram_data_t +): uint64 {.cdecl.} + proc rocksdb_statistics_histogram_data_get_sum*( - data: ptr rocksdb_statistics_histogram_data_t): uint64 {.cdecl.} + data: ptr rocksdb_statistics_histogram_data_t +): uint64 {.cdecl.} + proc rocksdb_statistics_histogram_data_get_min*( - data: ptr rocksdb_statistics_histogram_data_t): cdouble {.cdecl.} -proc rocksdb_wait_for_compact*(db: ptr rocksdb_t; - options: ptr rocksdb_wait_for_compact_options_t; - errptr: cstringArray) {.cdecl.} + data: ptr rocksdb_statistics_histogram_data_t +): cdouble {.cdecl.} + +proc rocksdb_wait_for_compact*( + db: ptr rocksdb_t, + options: ptr rocksdb_wait_for_compact_options_t, + errptr: cstringArray, +) {.cdecl.} + proc rocksdb_wait_for_compact_options_create*(): ptr rocksdb_wait_for_compact_options_t {. - cdecl.} + cdecl +.} + proc rocksdb_wait_for_compact_options_destroy*( - opt: ptr rocksdb_wait_for_compact_options_t) {.cdecl.} + opt: ptr rocksdb_wait_for_compact_options_t +) {.cdecl.} + proc rocksdb_wait_for_compact_options_set_abort_on_pause*( - opt: ptr rocksdb_wait_for_compact_options_t; v: uint8) {.cdecl.} + opt: ptr rocksdb_wait_for_compact_options_t, v: uint8 +) {.cdecl.} + proc rocksdb_wait_for_compact_options_get_abort_on_pause*( - opt: ptr rocksdb_wait_for_compact_options_t): uint8 {.cdecl.} + opt: ptr rocksdb_wait_for_compact_options_t +): uint8 {.cdecl.} + proc rocksdb_wait_for_compact_options_set_flush*( - opt: ptr rocksdb_wait_for_compact_options_t; v: uint8) {.cdecl.} + opt: ptr rocksdb_wait_for_compact_options_t, v: uint8 +) {.cdecl.} + proc rocksdb_wait_for_compact_options_get_flush*( - opt: ptr rocksdb_wait_for_compact_options_t): uint8 {.cdecl.} + opt: ptr rocksdb_wait_for_compact_options_t +): uint8 {.cdecl.} + proc rocksdb_wait_for_compact_options_set_close_db*( - opt: ptr rocksdb_wait_for_compact_options_t; v: uint8) {.cdecl.} + opt: ptr rocksdb_wait_for_compact_options_t, v: uint8 +) {.cdecl.} + proc rocksdb_wait_for_compact_options_get_close_db*( - opt: ptr rocksdb_wait_for_compact_options_t): uint8 {.cdecl.} + opt: ptr rocksdb_wait_for_compact_options_t +): uint8 {.cdecl.} + proc rocksdb_wait_for_compact_options_set_timeout*( - opt: ptr rocksdb_wait_for_compact_options_t; microseconds: uint64) {.cdecl.} + opt: ptr rocksdb_wait_for_compact_options_t, microseconds: uint64 +) {.cdecl.} + proc rocksdb_wait_for_compact_options_get_timeout*( - opt: ptr rocksdb_wait_for_compact_options_t): uint64 {.cdecl.} \ No newline at end of file + opt: ptr rocksdb_wait_for_compact_options_t +): uint64 {.cdecl.} From 9dac0fd6b8d43e125eb7b890f3d1d0cf3b9fcffe Mon Sep 17 00:00:00 2001 From: bhartnett <51288821+bhartnett@users.noreply.github.com> Date: Tue, 14 Jan 2025 16:56:31 +0800 Subject: [PATCH 05/11] Define librocksdb dynlib on windows. --- rocksdb/lib/librocksdb.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rocksdb/lib/librocksdb.nim b/rocksdb/lib/librocksdb.nim index 3edb58c..1dfa7e6 100644 --- a/rocksdb/lib/librocksdb.nim +++ b/rocksdb/lib/librocksdb.nim @@ -90,6 +90,7 @@ type ## DB operations when defined(windows): + const librocksdb = "librocksdb.dll" {.pragma: importrocks, importc, cdecl, dynlib: librocksdb.} else: {.pragma: importrocks, importc, cdecl.} @@ -108,7 +109,7 @@ else: # {.passl: "-lshlwapi -lrpcrt4".} if defined(windows): - {.push importc, dynlib: "librocksdb.so".} + {.push importc, dynlib: librocksdb.} # Do I need importc for static lib? include ./rocksdb_gen.nim From e7b7c6e3da976e044776652f4c290adc000aaf88 Mon Sep 17 00:00:00 2001 From: bhartnett <51288821+bhartnett@users.noreply.github.com> Date: Wed, 15 Jan 2025 00:14:43 +0800 Subject: [PATCH 06/11] Add rocksdb_dynamic_linking flag. --- config.nims | 4 ++-- rocksdb/lib/librocksdb.nim | 26 +++++++++++++------------- scripts/build_shared_deps_linux.sh | 27 +++++++++++++++++++++++++++ scripts/build_shared_deps_osx.sh | 27 +++++++++++++++++++++++++++ 4 files changed, 69 insertions(+), 15 deletions(-) create mode 100755 scripts/build_shared_deps_linux.sh create mode 100755 scripts/build_shared_deps_osx.sh diff --git a/config.nims b/config.nims index 9d214ce..02c8a1f 100644 --- a/config.nims +++ b/config.nims @@ -1,5 +1,5 @@ # nim-rocksdb -# Copyright (c) 2019-2023 Status Research & Development GmbH +# Copyright (c) 2019-2025 Status Research & Development GmbH # Licensed under either of # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE)) # * MIT license ([LICENSE-MIT](LICENSE-MIT)) @@ -12,7 +12,7 @@ when fileExists("nimble.paths"): include "nimble.paths" # end Nimble config -when not defined(windows): +when not defined(rocksdb_dynamic_linking) and not defined(windows): # use the C++ linker profile because it's a C++ library when defined(macosx): switch("clang.linkerexe", "clang++") diff --git a/rocksdb/lib/librocksdb.nim b/rocksdb/lib/librocksdb.nim index 1dfa7e6..d1672ac 100644 --- a/rocksdb/lib/librocksdb.nim +++ b/rocksdb/lib/librocksdb.nim @@ -1,4 +1,4 @@ -# Copyright 2018-2024 Status Research & Development GmbH +# Copyright 2018-2025 Status Research & Development GmbH # Licensed under either of # # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) @@ -22,6 +22,8 @@ ## This file exposes the low-level C API of RocksDB +import std/[os, strutils] + {.push raises: [].} type @@ -87,29 +89,27 @@ type rocksdb_memory_consumers_t* = object rocksdb_wait_for_compact_options_t* = object -## DB operations - when defined(windows): const librocksdb = "librocksdb.dll" - {.pragma: importrocks, importc, cdecl, dynlib: librocksdb.} +elif defined(macosx): + const librocksdb = "librocksdb.dylib" else: - {.pragma: importrocks, importc, cdecl.} + const librocksdb = "librocksdb.so" - import std/[os, strutils] +when defined(rocksdb_dynamic_linking) or defined(windows): + {.push importc, cdecl, dynlib: librocksdb.} +else: const topLevelPath = currentSourcePath.parentDir().parentDir().parentDir() - libsDir = topLevelPath.replace('\\', '/') & "/build/lib" + libsDir = topLevelPath.replace('\\', '/') & "/build/lib/" {.passl: libsDir & "/librocksdb.a".} {.passl: libsDir & "/liblz4.a".} {.passl: libsDir & "/libzstd.a".} - # This is require for static linking on windows - # when defined(windows): - # {.passl: "-lshlwapi -lrpcrt4".} + when defined(windows): + {.passl: "-lshlwapi -lrpcrt4".} -if defined(windows): - {.push importc, dynlib: librocksdb.} + {.push importc, cdecl.} -# Do I need importc for static lib? include ./rocksdb_gen.nim diff --git a/scripts/build_shared_deps_linux.sh b/scripts/build_shared_deps_linux.sh new file mode 100755 index 0000000..e6459ce --- /dev/null +++ b/scripts/build_shared_deps_linux.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +# Nim-RocksDB +# Copyright 2024-2025 Status Research & Development GmbH +# Licensed under either of +# +# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) +# * GPL license, version 2.0, ([LICENSE-GPLv2](LICENSE-GPLv2) or https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) +# +# at your option. This file may not be copied, modified, or distributed except according to those terms. + +set -e + +cd "$(dirname "${BASH_SOURCE[0]}")"/.. + +REPO_DIR="${PWD}" +BUILD_DEST="${REPO_DIR}/build/" + +git submodule update --init + +${REPO_DIR}/vendor/vcpkg/bootstrap-vcpkg.sh -disableMetrics + +${REPO_DIR}/vendor/vcpkg/vcpkg install rocksdb[lz4,zstd]:x64-linux-rocksdb --recurse --overlay-triplets=${REPO_DIR}/triplets + +mkdir -p "${BUILD_DEST}" + +cp "${REPO_DIR}/vendor/vcpkg/installed/x64-linux-rocksdb/lib/librocksdb.so" "${BUILD_DEST}/" diff --git a/scripts/build_shared_deps_osx.sh b/scripts/build_shared_deps_osx.sh new file mode 100755 index 0000000..da779e1 --- /dev/null +++ b/scripts/build_shared_deps_osx.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +# Nim-RocksDB +# Copyright 2024-2025 Status Research & Development GmbH +# Licensed under either of +# +# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) +# * GPL license, version 2.0, ([LICENSE-GPLv2](LICENSE-GPLv2) or https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) +# +# at your option. This file may not be copied, modified, or distributed except according to those terms. + +set -e + +cd "$(dirname "${BASH_SOURCE[0]}")"/.. + +REPO_DIR="${PWD}" +BUILD_DEST="${REPO_DIR}/build/" + +git submodule update --init + +${REPO_DIR}/vendor/vcpkg/bootstrap-vcpkg.sh -disableMetrics + +${REPO_DIR}/vendor/vcpkg/vcpkg install rocksdb[lz4,zstd]:x64-osx-rocksdb --recurse --overlay-triplets=${REPO_DIR}/triplets + +mkdir -p "${BUILD_DEST}" + +cp "${REPO_DIR}/vendor/vcpkg/installed/x64-osx-rocksdb/lib/librocksdb.dylib" "${BUILD_DEST}/" From 4239d545ae4b4b401ad6a8da0c6891aa7fcddb18 Mon Sep 17 00:00:00 2001 From: bhartnett <51288821+bhartnett@users.noreply.github.com> Date: Wed, 15 Jan 2025 10:23:50 +0800 Subject: [PATCH 07/11] Improve nimble file. --- rocksdb.nimble | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rocksdb.nimble b/rocksdb.nimble index b48a805..504307f 100644 --- a/rocksdb.nimble +++ b/rocksdb.nimble @@ -11,12 +11,15 @@ installDirs = @["build"] ### Dependencies requires "nim >= 2.0", "results", "tempfile", "unittest2" -before install: +template build() = when defined(windows): exec ".\\scripts\\build_dlls_windows.bat" else: exec "scripts/build_static_deps.sh" +before install: + build() + task format, "Format nim code using nph": exec "nimble install nph@0.6.0" exec "nph ." @@ -26,6 +29,7 @@ task clean, "Remove temporary files": exec "make -C vendor/rocksdb clean" task test, "Run tests": + build() when defined(windows): exec "nim c -d:nimDebugDlOpen -r --threads:on tests/test_all.nim" else: From a5cf8ed3dbf59dcc5a3e84b337a7e3220f29b46a Mon Sep 17 00:00:00 2001 From: bhartnett <51288821+bhartnett@users.noreply.github.com> Date: Wed, 15 Jan 2025 10:24:37 +0800 Subject: [PATCH 08/11] Put built static libs in same directory as dll. --- rocksdb/lib/librocksdb.nim | 2 +- scripts/build_static_deps.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rocksdb/lib/librocksdb.nim b/rocksdb/lib/librocksdb.nim index d1672ac..6da3970 100644 --- a/rocksdb/lib/librocksdb.nim +++ b/rocksdb/lib/librocksdb.nim @@ -101,7 +101,7 @@ when defined(rocksdb_dynamic_linking) or defined(windows): else: const topLevelPath = currentSourcePath.parentDir().parentDir().parentDir() - libsDir = topLevelPath.replace('\\', '/') & "/build/lib/" + libsDir = topLevelPath.replace('\\', '/') & "/build/" {.passl: libsDir & "/librocksdb.a".} {.passl: libsDir & "/liblz4.a".} diff --git a/scripts/build_static_deps.sh b/scripts/build_static_deps.sh index ff49835..3f78d0b 100755 --- a/scripts/build_static_deps.sh +++ b/scripts/build_static_deps.sh @@ -15,7 +15,7 @@ cd "$(dirname "${BASH_SOURCE[0]}")"/.. REPO_DIR="${PWD}" ROCKSDB_LIB_DIR="${REPO_DIR}/vendor/rocksdb" -BUILD_DEST="${REPO_DIR}/build/lib" +BUILD_DEST="${REPO_DIR}/build" : "${MAKE:=make}" From ad08bc249235f1f314cc5db0fce3d4e1be8c04b8 Mon Sep 17 00:00:00 2001 From: bhartnett <51288821+bhartnett@users.noreply.github.com> Date: Wed, 15 Jan 2025 10:28:23 +0800 Subject: [PATCH 09/11] Remove nimble clean. --- rocksdb.nimble | 4 ---- 1 file changed, 4 deletions(-) diff --git a/rocksdb.nimble b/rocksdb.nimble index 504307f..2838194 100644 --- a/rocksdb.nimble +++ b/rocksdb.nimble @@ -24,10 +24,6 @@ task format, "Format nim code using nph": exec "nimble install nph@0.6.0" exec "nph ." -task clean, "Remove temporary files": - exec "rm -rf build" - exec "make -C vendor/rocksdb clean" - task test, "Run tests": build() when defined(windows): From 152fd128c5bff5257872b507fbc1dc3b36b9980e Mon Sep 17 00:00:00 2001 From: bhartnett <51288821+bhartnett@users.noreply.github.com> Date: Wed, 15 Jan 2025 10:38:22 +0800 Subject: [PATCH 10/11] Improve build script. --- scripts/build_static_deps.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/build_static_deps.sh b/scripts/build_static_deps.sh index 3f78d0b..27db25f 100755 --- a/scripts/build_static_deps.sh +++ b/scripts/build_static_deps.sh @@ -34,6 +34,13 @@ export DEBUG_LEVEL=0 if ${MAKE} -C "${ROCKSDB_LIB_DIR}" -q unity.a; then echo "RocksDb static libraries already built. Skipping build." + + # Copy the built libraries in case the build directory has been removed + mkdir -p "${BUILD_DEST}" + cp "${ROCKSDB_LIB_DIR}/liblz4.a" "${BUILD_DEST}/" + cp "${ROCKSDB_LIB_DIR}/libzstd.a" "${BUILD_DEST}/" + cp "${ROCKSDB_LIB_DIR}/unity.a" "${BUILD_DEST}/librocksdb.a" + exit 0 else ${REPO_DIR}/scripts/clean_build_artifacts.sh From 7f7014971ab305921797defa928b6f6bef6cbef7 Mon Sep 17 00:00:00 2001 From: bhartnett <51288821+bhartnett@users.noreply.github.com> Date: Wed, 15 Jan 2025 12:16:48 +0800 Subject: [PATCH 11/11] Update readme. --- README.md | 56 +++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 38 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 04cd5a9..0e20adc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Nim-RocksDB +# Nim-RocksDb [![Build Status (Travis)](https://img.shields.io/travis/status-im/nim-rocksdb/master.svg?label=Linux%20/%20macOS "Linux/macOS build status (Travis)")](https://travis-ci.org/status-im/nim-rocksdb) [![Windows build status (Appveyor)](https://img.shields.io/appveyor/ci/nimbus/nim-rocksdb/master.svg?label=Windows "Windows build status (Appveyor)")](https://ci.appveyor.com/project/nimbus/nim-rocksdb) @@ -10,35 +10,53 @@ A Nim wrapper for [Facebook's RocksDB](https://github.com/facebook/rocksdb), a p ## Current status -Nim-RocksDB provides a wrapper for the low-level functions in the librocksdb c library. +Nim-RocksDb provides a wrapper for the low-level functions in the librocksdb c +library. ## Installation -Nim-RocksDB requires Nim and the Nimble package manager. For Windows you will need Visual Studio 2015 Update 3 or greater with the English language pack. +Nim-RocksDb requires Nim and the Nimble package manager. For Windows you will +need Visual Studio 2015 Update 3 or greater with the English language pack. To get started run: ``` -nimble install +nimble install rocksdb ``` -This will download and install the RocksDB dynamic libraries for your platform and copy them into the `build/` directory of the project. When including this library in your application you may want to copy these libraries into another location or set the LD_LIBRARY_PATH environment variable (DYLD_LIBRARY_PATH on MacOS, PATH on Windows) to include the `build/` directory so that your application can find them on startup. +This will download and install the RocksDB libraries for your platform and copy +them into the `build/` directory of the project. On Linux and MacOS only static +linking to the RocksDb libraries is supported and on Windows only dynamic linking +is supported. -Alternatively you can use the `rocksdb_static_linking` flag to statically link the library into your application. +On Windows you may want to copy the dll into another location or set your PATH +to include the `build/` directory so that your application can find the dll on +startup. -### Static linking +### Compression libraries -To build the RocksDB static libraries run: -``` -./scripts/build_static_deps.sh -``` +RocksDb supports using a number of compression libraries. This library builds +and only supports the following compression libraries: +- lz4 +- zstd + +On Linux and MacOS these libraries are staticly linked into the final binary +along with the RocksDb static library. On Windows they are staticly linked into +the RocksDb dll. + + +### Static linking -To statically link RocksDB, you would do something like: +On Linux and MacOS your Nim program will need to use the C++ linker profile +because RocksDb is a C++ library. For example: ``` -nim c -d:rocksdb_static_linking --threads:on your_program.nim + when defined(macosx): + switch("clang.linkerexe", "clang++") + when defined(linux): + switch("gcc.linkerexe", "g++") ``` -See the config.nims file which contains the static linking configuration which is switched on with the `rocksdb_static_linking` flag. Note that static linking is currently not supported on windows. +Note that static linking is currently not supported on windows. ## Usage @@ -46,12 +64,13 @@ See [simple_example](examples/simple_example.nim) ### Contribution -Any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any -additional terms or conditions. +Any contribution intentionally submitted for inclusion in the work by you shall +be dual licensed as above, without any additional terms or conditions. ## Versioning -The library generally follows the upstream RocksDb version number, adding one more number for tracking changes to the Nim wrapper itself. +The library generally follows the upstream RocksDb version number, adding one +more number for tracking changes to the Nim wrapper itself. ## License @@ -65,7 +84,8 @@ or * Apache License, Version 2.0, ([LICENSE-APACHEv2](LICENSE-APACHEv2) or http://www.apache.org/licenses/LICENSE-2.0) -at your option. This file may not be copied, modified, or distributed except according to those terms. +at your option. This file may not be copied, modified, or distributed except +according to those terms. ### Dependency License