X-Git-Url: https://pd.if.org/git/?p=nbds;a=blobdiff_plain;f=include%2Fnstring.h;fp=include%2Fnstring.h;h=5d6fc89c390b83ac4ec8804135d775dd49df5621;hp=0000000000000000000000000000000000000000;hb=f1098084dd54496a61f9a254541190df77edd166;hpb=7378edffa5751159d35eab31eceb76a1f16231d0 diff --git a/include/nstring.h b/include/nstring.h new file mode 100644 index 0000000..5d6fc89 --- /dev/null +++ b/include/nstring.h @@ -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