From: Lukas Krickl Date: Sat, 21 Feb 2026 21:23:09 +0000 (+0100) Subject: chore: moved typedefs to u_defs X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=93457aba20f83e79f2acf4d88276a6c8e77026fe;p=lmud%2F.git chore: moved typedefs to u_defs --- diff --git a/src/lmud.h b/src/lmud.h index e09d8dd..a2d42b4 100644 --- a/src/lmud.h +++ b/src/lmud.h @@ -7,43 +7,8 @@ * System includes */ #include "u_assert.h" +#include "u_defs.h" -#define LMUD_VER "0.0.1" - -/* args without value */ -#define LMUD_OPTS "hvV" - -/* args with value */ -#define LMUD_OPTS_ARG "c:" -#define LMUD_HELP(a, desc) printf("\t-%s\t%s\n", (a), desc); - -/** - * generic typedefs - */ - -typedef unsigned char lmud_bool; -#define LMUD_TRUE 1 -#define LMUD_FALSE 0 - -struct lmud_config { - lmud_bool verbose; - - char **argv; - int argc; -}; - -typedef unsigned char u8; -typedef char i8; -typedef unsigned short u16; -typedef short i16; -typedef unsigned int u32; -typedef int i32; - -struct lmud_config* lmud_cfg(); -void lmud_help(int argc, char **argv); -void lmud_version(void); -void lmud_getopt(int argc, char **argv, struct lmud_config *cfg); -int lmud_main(int argc, char **argv); /** diff --git a/src/u_defs.h b/src/u_defs.h new file mode 100644 index 0000000..cbaabe5 --- /dev/null +++ b/src/u_defs.h @@ -0,0 +1,46 @@ +#ifndef U_DEFS_H__ +#define U_DEFS_H__ + +/** + * This module contains global type defs and constants + * + */ + +#define LMUD_VER "0.0.1" + +/* args without value */ +#define LMUD_OPTS "hvV" + +/* args with value */ +#define LMUD_OPTS_ARG "c:" +#define LMUD_HELP(a, desc) printf("\t-%s\t%s\n", (a), desc); + +/** + * generic typedefs + */ + +typedef unsigned char lmud_bool; +#define LMUD_TRUE 1 +#define LMUD_FALSE 0 + +struct lmud_config { + lmud_bool verbose; + + char **argv; + int argc; +}; + +typedef unsigned char u8; +typedef char i8; +typedef unsigned short u16; +typedef short i16; +typedef unsigned int u32; +typedef int i32; + +struct lmud_config* lmud_cfg(); +void lmud_help(int argc, char **argv); +void lmud_version(void); +void lmud_getopt(int argc, char **argv, struct lmud_config *cfg); +int lmud_main(int argc, char **argv); + +#endif