#ifndef SSTRING_H #define SSTRING_H #include #include typedef struct string { char *s; size_t len; } string; #define STREMPTY(x) {(x).s = NULL; (x).len = 0; } static inline int newstr(string *s, const size_t len) { s->len = len; s->s = malloc(len); return (len && !s->s) ? -1 : 0; } #endif