util.h (318B)
1 /* See LICENSE for license details. */ 2 #define LEN(a) (sizeof(a) / sizeof(*a)) 3 4 typedef struct { 5 char *s; 6 ptrdiff_t len; 7 } s8; 8 #define s8(s) (s8){s, LEN(s) - 1} 9 10 int s8cmp(s8, s8); 11 s8 s8dup(void *, ptrdiff_t); 12 s8 s8trim(s8); 13 s8 unescape(s8); 14 void *xreallocarray(void *, size_t, size_t); 15 void die(const char *, ...);