From 04310feb4d12ace8b31e1acf74f7f2c159e2659d Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Sun, 29 Sep 2019 21:23:44 -0400 Subject: nserver: Add protocol.c --- nserver/src/protocol.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 nserver/src/protocol.c (limited to 'nserver') diff --git a/nserver/src/protocol.c b/nserver/src/protocol.c new file mode 100644 index 0000000..0d254cd --- /dev/null +++ b/nserver/src/protocol.c @@ -0,0 +1,24 @@ +#include + +static Hashmap *hash; + +int ssinit() +{ + if (hash == NULL) { + hash = Hashmap_create(NULL, NULL); + check(hash != NULL, "unable to create hashmap"); + } + + return 0; + error: + return -1; +} + +int sscreate(char *key) +{ + check(ssinit() == 0, "ssinit failed"); + + return 0; + error: + return -1; +} -- cgit v1.2.3