From f3d50195e43fd33e7f36e4e55a84af790b7de5d1 Mon Sep 17 00:00:00 2001 From: Danny Holman Date: Wed, 26 Jul 2023 11:40:36 -0500 Subject: 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 --- common/include/util.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 common/include/util.h (limited to 'common/include') 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 + +#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 -- cgit v1.2.3