From 6cdb9a2a9cc3555b8a682f6a7e456213850df287 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sat, 2 May 2026 01:10:56 -0400 Subject: [PATCH] initial commit Signed-off-by: Ian Moffett --- .gitignore | 3 +++ Makefile | 15 +++++++++++ README.md | 4 +++ client/.keep | 0 endpoint/Makefile | 27 +++++++++++++++++++ endpoint/core/server.c | 47 ++++++++++++++++++++++++++++++++++ endpoint/inc/endpoint/common.h | 12 +++++++++ libremail/common/.keep | 0 libremail/crypto/.keep | 0 libremail/inc/libremail/.keep | 0 10 files changed, 108 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 README.md create mode 100644 client/.keep create mode 100644 endpoint/Makefile create mode 100644 endpoint/core/server.c create mode 100644 endpoint/inc/endpoint/common.h create mode 100644 libremail/common/.keep create mode 100644 libremail/crypto/.keep create mode 100644 libremail/inc/libremail/.keep diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1224243 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.o +*.d +/bin diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8116fe5 --- /dev/null +++ b/Makefile @@ -0,0 +1,15 @@ +# +# Copyright (c) 2026, Chloe Moffett +# Provided under the BSD-3 clause +# + +.PHONY: all +all: bin endpoint + +.PHONY: bin +bin: + mkdir -p $@ + +.PHONY: endpoint +endpoint: + cd endpoint/; make diff --git a/README.md b/README.md new file mode 100644 index 0000000..361da7f --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# Remail - an experimental electronic mail standard + +Remail is an experimental electronic mail standard being developed with the motivation being the +reformation of modern email protocols. For more information, please read this [book](https://wiki.mirocom.org/books/remail) diff --git a/client/.keep b/client/.keep new file mode 100644 index 0000000..e69de29 diff --git a/endpoint/Makefile b/endpoint/Makefile new file mode 100644 index 0000000..c49731f --- /dev/null +++ b/endpoint/Makefile @@ -0,0 +1,27 @@ +# +# Copyright (c) 2026, Chloe Moffett +# Provided under the BSD-3 clause +# + +CFILES = $(shell find . -name "*.c") +OFILES = $(CFILES:.c=.o) +DFILES = $(CFILES:.c=.d) +CC = gcc + +CFLAGS = \ + -Wall \ + -pedantic \ + -MMD \ + -Iinc \ + -I../libremail/inc + +.PHONY: all +all: ../bin/remailsv $(OFILES) + +.PHONY: ../bin/remailsv +../bin/remailsv: $(OFILES) + $(CC) $^ -o $@ + +-include $(DFILES) +%.o: %.c + $(CC) -c $< $(CFLAGS) -o $@ diff --git a/endpoint/core/server.c b/endpoint/core/server.c new file mode 100644 index 0000000..dacfbe7 --- /dev/null +++ b/endpoint/core/server.c @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2026, Chloe Moffett + * Provided under the BSD-3 clause + */ + +#include +#include +#include "endpoint/common.h" + +static void +help(void) +{ + printf("usage: ./remailsv \n"); + printf("... [-h] Display this help menu\n"); + printf("... [-v] Display the version\n"); +} + +static void +version(void) +{ + printf("Version v%s\n", SERVER_VERSION); +} + +int +main(int argc, char **argv) +{ + int opt; + + if (argc < 2) { + printf("fatal: too few arguments!\n"); + help(); + return -1; + } + + while ((opt = getopt(argc, argv, "hv")) != -1) { + switch (opt) { + case 'h': + help(); + return -1; + case 'v': + version(); + return 0; + } + } + + return 0; +} diff --git a/endpoint/inc/endpoint/common.h b/endpoint/inc/endpoint/common.h new file mode 100644 index 0000000..e705d2f --- /dev/null +++ b/endpoint/inc/endpoint/common.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2026, Chloe Moffett + * Provided under the BSD-3 clause + */ + +#ifndef ENDPOINT_COMMON_H +#define ENDPOINT_COMMON_H 1 + +/* Server software version */ +#define SERVER_VERSION "0.0.1" + +#endif /* !ENDPOINT_COMMON_H */ diff --git a/libremail/common/.keep b/libremail/common/.keep new file mode 100644 index 0000000..e69de29 diff --git a/libremail/crypto/.keep b/libremail/crypto/.keep new file mode 100644 index 0000000..e69de29 diff --git a/libremail/inc/libremail/.keep b/libremail/inc/libremail/.keep new file mode 100644 index 0000000..e69de29