]> pd.if.org Git - nbds/blobdiff - include/nstring.h
all structures now support arbitrary type keys with a fast path for integers
[nbds] / include / nstring.h
diff --git a/include/nstring.h b/include/nstring.h
new file mode 100644 (file)
index 0000000..5d6fc89
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef NSTRING_H
+#define NSTRING_H
+
+typedef struct nstring {
+    uint32_t len;
+    char data[];
+} nstring_t;
+
+nstring_t * ns_alloc (uint32_t len);
+int         ns_cmp   (const nstring_t *ns1, const nstring_t *ns2);
+uint32_t    ns_hash  (const nstring_t *ns);
+nstring_t * ns_dup   (const nstring_t *ns);
+
+#endif//NSTRING_H