summaryrefslogtreecommitdiff
path: root/server/include/util.h
blob: 39c130b59aa441c1a1ea34c66637260fd1f27a84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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