summaryrefslogtreecommitdiff
path: root/util.h
diff options
context:
space:
mode:
authorsinanmohd <sinan@firemail.cc>2023-09-28 10:27:39 +0530
committersinanmohd <sinan@firemail.cc>2023-09-28 16:17:21 +0530
commitd605727d4bb3b7ae19dc0227d55030a7ebc73148 (patch)
treeb183df7104eedaf8628985933d52df16d23df278 /util.h
parent3647b6c1140cb9e0cebeab19e53c0294f966b19b (diff)
server: initHEADmaster
Diffstat (limited to 'util.h')
-rw-r--r--util.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/util.h b/util.h
new file mode 100644
index 0000000..fbaf60c
--- /dev/null
+++ b/util.h
@@ -0,0 +1,16 @@
+#include <stdio.h>
+#include <stdarg.h>
+
+enum plog { PLOG_INFO, PLOG_WARN, PLOG_ERR };
+static const char *msg[] = { "info", "warn", "eror"};
+
+void plog(enum plog type, const char *fmt, ...)
+{
+ va_list args;
+
+ va_start(args, fmt);
+ fprintf(stderr, "%s: ",msg[type]);
+ vfprintf(stderr, fmt, args);
+ putc('\n', stderr);
+ va_end(args);
+}