nserver

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | LICENSE

commit 04310feb4d12ace8b31e1acf74f7f2c159e2659d
parent a71f4cec5902e28563b1bb78eec98364070a351e
Author: rsiddharth <s@ricketyspace.net>
Date:   Sun, 29 Sep 2019 21:23:44 -0400

nserver: Add protocol.c

Diffstat:
nserver/src/protocol.c | 24++++++++++++++++++++++++
1 file changed, 24 insertions(+), 0 deletions(-)

diff --git a/nserver/src/protocol.c b/nserver/src/protocol.c @@ -0,0 +1,24 @@ +#include <protocol.h> + +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; +}