From bfb5a9ad837e8985aa66acb8a9d6e6790488dcd4 Mon Sep 17 00:00:00 2001 From: thing1 Date: Mon, 30 Jun 2025 07:54:25 +0100 Subject: init commit, should remake send --- send/util.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 send/util.h (limited to 'send/util.h') diff --git a/send/util.h b/send/util.h new file mode 100644 index 0000000..5f1a698 --- /dev/null +++ b/send/util.h @@ -0,0 +1,27 @@ +#include +#include +#include + +static void +warn(const char *msg) { + if (errno != 0) + perror(msg); + else + fprintf(stderr, "error: %s\n", msg); +} + +static void +error(const char *msg) { + warn(msg); + exit(1); +} + +static int +make_mhash(char *m) { + int hash = 0; + while (*m != 0) { + hash += *m; + m++; + } + return hash; +} -- cgit v1.2.3