2023-10-12 10:06:20 +02:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "lsm.h"
|
|
|
|
#include "lsm_store.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialize a new lsm_store struct.
|
|
|
|
*
|
2023-10-13 11:56:50 +02:00
|
|
|
* @param lsm_store pointer to where to store the newly allocated object's
|
|
|
|
* pointer
|
2023-10-12 10:06:20 +02:00
|
|
|
* @return success of the function
|
|
|
|
*/
|
|
|
|
lsm_error lsm_store_init(lsm_store **ptr) {
|
|
|
|
lsm_store *store = calloc(1, sizeof(lsm_store));
|
|
|
|
|
|
|
|
if (store == NULL) {
|
|
|
|
return lsm_error_failed_alloc;
|
|
|
|
}
|
|
|
|
|
|
|
|
*ptr = store;
|
|
|
|
|
|
|
|
return lsm_error_ok;
|
|
|
|
}
|