aboutgitcodelistschat:MatrixIRC
path: root/cooker/util.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2023-03-20 07:54:51 +0100
committerStefano Brivio <sbrivio@redhat.com>2023-03-20 07:54:51 +0100
commitcbc17d2fcafe2e432f704d2dd2e0ff5c85118356 (patch)
treed52fd0269e474a2face81f6044293d1536aa8d0d /cooker/util.c
parentac8209922a79de4d6108128244c9133f5591fd8b (diff)
downloadseitan-cbc17d2fcafe2e432f704d2dd2e0ff5c85118356.tar
seitan-cbc17d2fcafe2e432f704d2dd2e0ff5c85118356.tar.gz
seitan-cbc17d2fcafe2e432f704d2dd2e0ff5c85118356.tar.bz2
seitan-cbc17d2fcafe2e432f704d2dd2e0ff5c85118356.tar.lz
seitan-cbc17d2fcafe2e432f704d2dd2e0ff5c85118356.tar.xz
seitan-cbc17d2fcafe2e432f704d2dd2e0ff5c85118356.tar.zst
seitan-cbc17d2fcafe2e432f704d2dd2e0ff5c85118356.zip
cooker: Initial import of new implementation
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'cooker/util.c')
-rw-r--r--cooker/util.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/cooker/util.c b/cooker/util.c
new file mode 100644
index 0000000..a2ecce0
--- /dev/null
+++ b/cooker/util.c
@@ -0,0 +1,29 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+/* seitan - Syscall Expressive Interpreter, Transformer and Notifier
+ *
+ * cooker/util.c - Convenience routines
+ *
+ * Copyright 2023 Red Hat GmbH
+ * Author: Stefano Brivio <sbrivio@redhat.com>
+ */
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+
+#define logfn(name) \
+void name(const char *format, ...) { \
+ va_list args; \
+ \
+ va_start(args, format); \
+ (void)vfprintf(stderr, format, args); \
+ va_end(args); \
+ if (format[strlen(format)] != '\n') \
+ fprintf(stderr, "\n"); \
+}
+
+logfn(err)
+logfn(info)
+logfn(debug)
+