From 02dbf0b9936539b16b4167659bcd71969120e3e9 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Tue, 21 Feb 2023 15:35:18 +0100 Subject: [PATCH] Add warn() and info() debug macros --- src/common.c | 1 - src/common.h | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common.c b/src/common.c index 0a84ff3..14f3ab8 100644 --- a/src/common.c +++ b/src/common.c @@ -47,7 +47,6 @@ verr(const char *func, const char *errstr, ...) va_end(ap); } - void vdie(const char *func, const char *errstr, ...) { diff --git a/src/common.h b/src/common.h index e39aa88..f2e36a1 100644 --- a/src/common.h +++ b/src/common.h @@ -18,6 +18,8 @@ void vdie(const char *func, const char *errstr, ...); #define rerr(...) fprintf(stderr, __VA_ARGS__) #define err(...) verr(__func__, __VA_ARGS__) #define die(...) vdie(__func__, __VA_ARGS__) +#define info(...) verr("INFO", __VA_ARGS__) +#define warn(...) verr("WARN", __VA_ARGS__) #ifdef ENABLE_DEBUG # define dbg(...) verr(__func__, __VA_ARGS__)