summaryrefslogtreecommitdiff
path: root/common/include
diff options
context:
space:
mode:
authorDanny Holman <dholman@gymli.org>2023-07-26 11:40:36 -0500
committerDanny Holman <dholman@gymli.org>2023-07-26 11:40:36 -0500
commitf3d50195e43fd33e7f36e4e55a84af790b7de5d1 (patch)
tree271f11ccb2297375245df5f9783ca31d84dd5c52 /common/include
parentee0f0f95d6972e66c56812e0e3abe9275d5f0fdc (diff)
common: create the common directory
Create a directory for files that are shared between the reference client and server. Refactor the build scripts to reflect this restructuring. Signed-off-by: Danny Holman <dholman@gymli.org>
Diffstat (limited to 'common/include')
-rw-r--r--common/include/util.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/common/include/util.h b/common/include/util.h
new file mode 100644
index 0000000..39c130b
--- /dev/null
+++ b/common/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