Mercurial > nomad > old-fuse
changeset 80:28d23cea9a1c
client: a dummy objstore instantiation
This demonstrates the object store library initialization and store creation.
The abort at the end is intentional to generate a core file for easier debugging.
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author | Josef 'Jeff' Sipek <jeffpc@josefsipek.net> |
---|---|
date | Fri, 16 Oct 2015 21:52:34 -0400 |
parents | 8949e2f5525b |
children | 3a22f0c7b3f6 |
files | src/client/CMakeLists.txt src/client/main.c |
diffstat | 2 files changed, 28 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/client/CMakeLists.txt Fri Oct 16 21:43:31 2015 -0400 +++ b/src/client/CMakeLists.txt Fri Oct 16 21:52:34 2015 -0400 @@ -26,6 +26,8 @@ target_link_libraries(nomad-client ${BASE_LIBS} + common + nomad_objstore ) install(TARGETS nomad-client DESTINATION bin
--- a/src/client/main.c Fri Oct 16 21:43:31 2015 -0400 +++ b/src/client/main.c Fri Oct 16 21:52:34 2015 -0400 @@ -20,7 +20,33 @@ * SOFTWARE. */ +#include <stdio.h> +#include <stdlib.h> + +#include <nomad/types.h> +#include <nomad/objstore.h> + int main(int argc, char **argv) { + struct objstore *store; + int ret; + + /* + * TODO: + * The local node id should be stored persistently in a config file + * of some sort. The initial value for the node id should be + * generated randomly. + */ + nomad_set_local_node_id(0xabba); + ret = objstore_init(); + + fprintf(stderr, "objstore_init() = %d\n", ret); + + store = objstore_store_create("abc", OS_MODE_STORE); + + fprintf(stderr, "store = %p\n", store); + + abort(); + return 0; }