Fix C API

This commit is contained in:
Igor Canadi 2014-02-24 15:15:34 -08:00
parent 01c27be5fb
commit 2bf1151a25
3 changed files with 4 additions and 7 deletions

View File

@ -595,7 +595,7 @@ void rocksdb_options_set_comparator(
opt->rep.comparator = cmp;
}
void rocksdb_options_set_merger_operator(
void rocksdb_options_set_merge_operator(
rocksdb_options_t* opt,
rocksdb_mergeoperator_t* merge_operator) {
opt->rep.merge_operator = std::shared_ptr<MergeOperator>(merge_operator);

View File

@ -416,7 +416,7 @@ int main(int argc, char** argv) {
// Create new database
rocksdb_close(db);
rocksdb_destroy_db(options, dbname, &err);
rocksdb_options_set_merger_operator(options, merge_operator);
rocksdb_options_set_merge_operator(options, merge_operator);
db = rocksdb_open(options, dbname, &err);
CheckNoError(err);
rocksdb_put(db, woptions, "foo", 3, "foovalue", 8, &err);
@ -431,8 +431,6 @@ int main(int argc, char** argv) {
CheckNoError(err);
CheckGet(db, roptions, "bar", "fake");
rocksdb_options_set_merger_operator(options, NULL);
rocksdb_mergeoperator_destroy(merge_operator);
}
StartPhase("cleanup");

View File

@ -216,9 +216,8 @@ extern void rocksdb_options_destroy(rocksdb_options_t*);
extern void rocksdb_options_set_comparator(
rocksdb_options_t*,
rocksdb_comparator_t*);
extern void rocksdb_options_set_merger_operator(
rocksdb_options_t*,
rocksdb_mergeoperator_t*);
extern void rocksdb_options_set_merge_operator(rocksdb_options_t*,
rocksdb_mergeoperator_t*);
extern void rocksdb_options_set_compression_per_level(
rocksdb_options_t* opt,
int* level_values,