summaryrefslogtreecommitdiffstats
path: root/nserver
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2019-09-29 21:23:44 -0400
committerrsiddharth <s@ricketyspace.net>2020-04-17 20:56:34 -0400
commit04310feb4d12ace8b31e1acf74f7f2c159e2659d (patch)
treed05c2cca9565061732ad278f5b468db68310dc7b /nserver
parenta71f4cec5902e28563b1bb78eec98364070a351e (diff)
nserver: Add protocol.c
Diffstat (limited to 'nserver')
-rw-r--r--nserver/src/protocol.c24
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;
+}