]> pd.if.org Git - nbds/blob - include/nstring.h
work in progress
[nbds] / include / nstring.h
1 #ifndef NSTRING_H
2 #define NSTRING_H
3
4 #include "common.h"
5 #include "datatype.h"
6
7 typedef struct nstring {
8     uint32_t len;
9     char data[];
10 } nstring_t;
11
12 nstring_t * ns_alloc (uint32_t len);
13 int         ns_cmp   (const nstring_t *ns1, const nstring_t *ns2);
14 uint32_t    ns_hash  (const nstring_t *ns);
15 nstring_t * ns_dup   (const nstring_t *ns);
16
17 extern const datatype_t DATATYPE_NSTRING;
18
19 #endif//NSTRING_H