diff options
author | rsiddharth <s@ricketyspace.net> | 2019-09-29 21:23:44 -0400 |
---|---|---|
committer | rsiddharth <s@ricketyspace.net> | 2020-04-17 20:56:34 -0400 |
commit | 04310feb4d12ace8b31e1acf74f7f2c159e2659d (patch) | |
tree | d05c2cca9565061732ad278f5b468db68310dc7b | |
parent | a71f4cec5902e28563b1bb78eec98364070a351e (diff) |
nserver: Add protocol.c
-rw-r--r-- | nserver/src/protocol.c | 24 |
1 files changed, 24 insertions, 0 deletions
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 <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; +} |