c-ipfs/include/ipfs/repo/fsrepo/lmdb_datastore.h

41 lines
1.1 KiB
C

#pragma once
#include "lmdb.h"
#include "libp2p/db/datastore.h"
struct lmdb_trans_cursor {
MDB_txn* transaction;
MDB_cursor* cursor;
};
/***
* Places the LMDB methods into the datastore's function pointers
* @param datastore the datastore to fill
* @returns true(1) on success;
*/
int repo_fsrepo_lmdb_cast(struct Datastore* datastore);
/**
* Open an lmdb database with the given parameters.
* Note: for now, the parameters are not used
* @param argc number of parameters in the following array
* @param argv an array of parameters
*/
int repo_fsrepro_lmdb_open(int argc, char** argv, struct Datastore* datastore);
/***
* Close an LMDB database
* NOTE: for now, argc and argv are not used
* @param argc number of parameters in the argv array
* @param argv parameters to be passed in
* @param datastore the datastore struct that contains information about the opened database
*/
int repo_fsrepo_lmdb_close(struct Datastore* datastore);
/***
* Creates the directory
* @param datastore contains the path that needs to be created
* @returns true(1) on success
*/
int repo_fsrepo_lmdb_create_directory(struct Datastore* datastore);