--- /dev/null
+* text=auto
--- /dev/null
+# Build directory
+bin/
+obj/
+tags
+
+ Prerequisites
+*.d
+
+# Object files
+*.o
+*.ko
+*.obj
+*.elf
+
+# Linker output
+*.ilk
+*.map
+*.exp
+
+# Precompiled Headers
+*.gch
+*.pch
+
+# Libraries
+*.lib
+*.a
+*.la
+*.lo
+
+# Shared objects (inc. Windows DLLs)
+*.dll
+*.so
+*.so.*
+*.dylib
+
+# Executables
+*.exe
+*.out
+*.app
+*.i*86
+*.x86_64
+*.hex
+
+# Debug files
+*.dSYM/
+*.su
+*.idb
+*.pdb
+vgcore.*
+
+# Kernel Module Compile Results
+*.mod*
+*.cmd
+.tmp_versions/
+modules.order
+Module.symvers
+Mkfile.old
+dkms.conf
+
+compile_commands.json
+.cache/
+.clang_complete
+# .clangd
+.session
+
+lmud
+testlmud
+*.patch
--- /dev/null
+# Known Bugs
+
+
--- /dev/null
+Copyright 2025-2026 Lukas Krickl (lukas@krickl.dev)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction,
+including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS",
+WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--- /dev/null
+# lmud
+
+lukas' multi user dungeon.
+
+## Table of content
+
+- [Installation](#Installation)
+- [Usage](#Usage)
+- [License](#License)
+- [Contributing](#Contributing)
+- [TODO](#TODO)
+
+## Installation
+
+To build this program you will require a recent C compiler, and make.
+
+```sh
+make # to compile all targets
+```
+
+## Usage
+
+Usage instructions can be found in the manual.
+
+- man/lmud.1: Command reference
+
+## License
+
+This program is distributed under the terms of the MIT License.
+
+## Contributing
+
--- /dev/null
+# Coding Style
+
+## Modules
+
+The code base is split into modules.
+Files and all functions therein are prefixed with one of the following:
+
+- `lmud_`: public api
+- `t_`: thinker related
+- `r_`: rendering
+- `n_`: network
+- `m_`: macro command language
+- `c_`: client-side code
+- `s_`: server side code
+- `u_`: system utility code
+
+## Library functions
+
+Third party functions (even the C stdlib) should be wrapped at all times.
+Platform specific code (including the stdlib) should be clearly marked.
--- /dev/null
+NAME=lmud
+TEST_NAME=test$(NAME)
+DBGCFLAGS=-g -fsanitize=address
+DBGLDFLAGS=-fsanitize=address
+CFLAGS=-Wall -pedantic $(DBGCFLAGS) -std=c89
+LIBS=
+LDFLAGS=$(DBGLDFLAGS) $(LIBS)
+
+INSTALL_DIR=/usr/local
+OBJS:=
+
+CCOBJ=$(CC) -c -o $@ $< $(CFLAGS) $(LDFLAGS)
+
+all: bin test
+
+release:
+ make DBGCFLAGS="" DBGLDFLAGS=""
+
+.PHONY: FORCE
+FORCE:
+
+main.o: src/main.c FORCE
+ $(CCOBJ)
+test.o: src/test.c FORCE
+ $(CCOBJ)
+
+
+bin: main.o $(OBJS)
+ $(CC) -o $(NAME) main.o $(OBJS) $(CFLAGS) $(LDFLAGS)
+
+test: test.o $(OBJS)
+ $(CC) -o $(TEST_NAME) test.o $(OBJS) $(CFLAGS) $(LDFLAGS)
+
+.PHONY: clean
+clean:
+ rm -f ./*.o
+ rm -f ./$(NAME)
+ rm -f ./$(TEST_NAME)
+
+.PHONY: install
+install:
+ mkdir -p $(INSTALL_DIR)/bin
+ mkdir -p $(INSTALL_DIR)/man/man1
+ mkdir -p $(INSTALL_DIR)/man/man5
+ cp ./$(NAME) $(INSTALL_DIR)/bin
+ cp ./man/$(NAME).1 $(INSTALL_DIR)/man/man1
+ cp ./man/$(NAME).5 $(INSTALL_DIR)/man/man5
+
--- /dev/null
+.\" Manpage for lmud.
+.\" Contact lukas@krickl.dev to correct errors or typos.
+
+.TH man 1 "21 Febuary 2026" "0.0.1" "lmud manual"
+
+.SH NAME
+ lmud
+.SH SYNOPSIS
+ lmud [-hvV] [-c=command]
+.SH DESCRIPTION
+ lmud
+
+ -h
+ display this help and exit
+
+ -V
+ display version info and exit
+
+ -v
+ verbose output
+
+ -c
+ execute a command and exit
+
+.SH EXAMPLES
+
+.SH SEE ALSO
+ lmud(5) for a command syntax reference
+
+ The documentation for make(1) for compilation instructions.
+
+ A compiler documentation such as cc(1) gcc(1) or clang(1).
+
+.SH BUGS
+
+.SH AUTHOR
+ Lukas Krickl (lukas@krickl.dev)
+
+.SH COPYRIGHT
+ Copyright 2026 Lukas Krickl (lukas@krickl.dev)
--- /dev/null
+.\" Manpage for lmud.
+.\" Contact lukas@krickl.dev to correct errors or typos.
+
+.TH man 5 "21 Febuary 2026" "0.0.1" "lmud command language reference"
+
+.SH SEE ALSO
+
+ lmud(1) for a reference on how to use lmud.
+
+.SH AUTHOR
+ Lukas Krickl (lukas@krickl.dev)
+
+.SH COPYRIGHT
+ Copyright 2026 Lukas Krickl (lukas@krickl.dev)
--- /dev/null
+#include <string.h>
+#include <getopt.h>
+#include <stdlib.h>
+#include "lmud.h"
+
+struct lmud_config lmud_global_cfg;
+
+struct lmud_config* lmud_cfg() {
+ return &lmud_global_cfg;
+}
+
+void lmud_help(int argc, char **argv) {
+ u_printf(u_stderr, "%s\n", argv[0]);
+ u_printf(u_stderr, "Usage: %s [-%s] [-c=command]\n\n",
+ argv[0], LMUD_OPTS);
+ LMUD_HELP("h", "display this help and exit");
+ LMUD_HELP("V", "display version info and exit");
+ LMUD_HELP("v", "verbose output");
+}
+
+void lmud_version(void) {
+ u_printf(u_stderr, "%s\n", LMUD_VER);
+}
+
+void lmud_getopt(int argc, char **argv, struct lmud_config *cfg) {
+ int c = 0;
+ while ((c = getopt(argc, argv, LMUD_OPTS LMUD_OPTS_ARG)) != -1) {
+ switch (c) {
+ case 'h':
+ lmud_help(argc, argv);
+ exit(0);
+ break;
+ case 'V':
+ lmud_version();
+ exit(0);
+ break;
+ case 'v':
+ cfg->verbose = 1;
+ break;
+ case '?':
+ break;
+ default:
+ u_printf(u_stderr, "%s: invalid option '%c'\nTry '%s -h' for more information.\n",
+ argv[0], c, argv[0]);
+ exit(-1);
+ break;
+ }
+ }
+
+ cfg->argc = argc - optind;
+ cfg->argv = argv + optind;
+}
+
+int lmud_main(int argc, char **argv) {
+ lmud_getopt(argc, argv, lmud_cfg());
+ return 0;
+}
--- /dev/null
+#ifndef LMUD_H__
+#define LMUD_H__
+
+/**
+ * System includes
+ */
+#include "u_stdio.h"
+#include "u_mem.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);
+
+typedef unsigned char lmud_bool;
+#define LMUD_TRUE 1
+#define LMUD_FALSE 0
+
+struct lmud_config {
+ lmud_bool verbose;
+
+ char **argv;
+ int argc;
+};
+
+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);
+
+
+/**
+ * If this is an implementation
+ * we include all c files for a mono-build
+ */
+#ifdef LMUD_IMPL
+
+#include "lmud.c"
+#include "u_stdio.c"
+#include "u_mem.c"
+
+#endif
+
+#endif
--- /dev/null
+#define LMUD_IMPL
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+#include "lmud.h"
+
+int main(int argc, char **argv) {
+ return lmud_main(argc, argv);
+}
--- /dev/null
+#define LMUD_IMPL
+
+#include <stdio.h>
+#include <assert.h>
+#include "lmud.h"
+
+#define TESTBEGIN(name) { u_printf(u_stderr, "%s\n", name); }
+
+#define TESTEND(name) { u_printf(u_stderr, "%s\n", name); }
+
+int main(int argc, char **argv) {
+ TESTBEGIN("lmud test");
+ lmud_getopt(argc, argv, lmud_cfg());
+
+ TESTEND("lmud test");
+ return 0;
+}
--- /dev/null
+#include "u_mem.h"
--- /dev/null
+#ifndef U_MEM_H__
+#define U_MEM_H__
+
+
+
+#endif
--- /dev/null
+#include <stdarg.h>
+#include "u_stdio.h"
+
+int u_printf(U_FILE* stream, const char *fmt, ...) {
+ int res = 0;
+ va_list args;
+
+ va_start(args, fmt);
+ res = vfprintf(stream, fmt, args);
+ va_end(args);
+
+ return res;
+}
+
--- /dev/null
+#ifndef U_STDIO_H__
+#define U_STDIO_H__
+
+
+typedef FILE U_FILE;
+
+#define u_stdin stdin
+#define u_stdout stdout
+#define u_stderr stderr
+
+int u_printf(U_FILE* stream, const char *fmt, ...);
+
+
+#endif