fork of https://github.com/rust-rocksdb/rust-rocksdb for nextgraph
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
405 B
19 lines
405 B
1 year ago
|
#include "../rocksdb/include/rocksdb/version.h"
|
||
|
|
||
|
#include "c.h"
|
||
|
|
||
|
static char* CopyString(const std::string& str) {
|
||
|
char* result = reinterpret_cast<char*>(malloc(sizeof(char) * str.size()));
|
||
|
memcpy(result, str.data(), sizeof(char) * str.size());
|
||
|
return result;
|
||
|
}
|
||
|
|
||
|
extern "C" {
|
||
|
|
||
|
char* rocksdb_version() {
|
||
|
auto name = ROCKSDB_NAMESPACE::GetRocksVersionAsString(true);
|
||
|
return CopyString(name);
|
||
|
}
|
||
|
|
||
|
}
|