diff options
Diffstat (limited to 'client/include')
-rw-r--r-- | client/include/util.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/client/include/util.h b/client/include/util.h new file mode 100644 index 0000000..39c130b --- /dev/null +++ b/client/include/util.h @@ -0,0 +1,13 @@ +#ifndef MRAT_UTIL_H +#define MRAT_UTIL_H + +#include <stddef.h> + +#define container_of(ptr, type, member) ({ \ + const typeof(((type*)0)->member)*__mptr = (ptr); \ + (type*)((char*)__mptr - offsetof(type, member)); }) + +char* str_strip(char *str); +char** str_split(char *str, const char *delim); + +#endif |