0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-25 16:22:35 +01:00

ircd::db: Stub a place to put the runtime loaded library version information.

This commit is contained in:
Jason Volk 2018-12-03 12:30:59 -08:00
parent 041f6c16c3
commit f2ecf617ba
2 changed files with 29 additions and 0 deletions

View file

@ -74,8 +74,15 @@ namespace ircd::db
//
namespace ircd::db
{
// Version information from rocksdb headers (when building ircd).
extern const uint version[3];
extern const string_view version_str;
// Version of the RocksDB shared library (when running ircd).
extern const uint abi_version[3];
extern const string_view abi_version_str;
// Supported compressions (detected when running ircd)
extern std::array<std::string, 16> compressions;
// Utils for "name:checkpoint" string amalgam
@ -86,6 +93,7 @@ namespace ircd::db
std::string path(const string_view &name, const uint64_t &checkpoint);
std::string path(const string_view &name);
// Paths of available databases.
std::vector<std::string> available();
}

View file

@ -152,6 +152,27 @@ ircd::db::version_str
version[2])
);
decltype(ircd::db::abi_version)
ircd::db::abi_version
{
//TODO: Get lib version.
0,
0,
0,
};
char ircd_db_abi_version_str_buf[64];
decltype(ircd::db::abi_version_str)
ircd::db::abi_version_str
(
ircd_db_abi_version_str_buf,
::snprintf(ircd_db_abi_version_str_buf, sizeof(ircd_db_abi_version_str_buf),
"%u.%u.%u",
abi_version[0],
abi_version[1],
abi_version[2])
);
//
// init::init
//