chore: moved typedefs to u_defs
authorLukas Krickl <lukas@krickl.dev>
Sat, 21 Feb 2026 21:23:09 +0000 (22:23 +0100)
committerLukas Krickl <lukas@krickl.dev>
Sat, 21 Feb 2026 21:23:09 +0000 (22:23 +0100)
src/lmud.h
src/u_defs.h [new file with mode: 0644]

index e09d8dd5b2e5c16604178420d46bec5c115735e5..a2d42b4318eb8a076e44783fdf1e2b2fe7c6e524 100644 (file)
@@ -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 (file)
index 0000000..cbaabe5
--- /dev/null
@@ -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