]> pd.if.org Git - nbds/blobdiff - map/nstring.h
generic interface for map-like data structures
[nbds] / map / nstring.h
diff --git a/map/nstring.h b/map/nstring.h
new file mode 100644 (file)
index 0000000..9aa4ce4
--- /dev/null
@@ -0,0 +1,12 @@
+#ifndef NSTRING_H
+#define NSTRING_H
+
+typedef struct nstring {
+    uint32_t len;
+    char data[];
+} nstring_t;
+
+nstring_t * ns_alloc (const void *data, uint32_t len);
+int ns_cmp_raw (nstring_t *ns, const void *data, uint32_t len);
+
+#endif//NSTRING_H