summaryrefslogtreecommitdiff
path: root/src/common/showmsg.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/showmsg.c')
-rw-r--r--src/common/showmsg.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/common/showmsg.c b/src/common/showmsg.c
index 7a6f632e7..b77bf3949 100644
--- a/src/common/showmsg.c
+++ b/src/common/showmsg.c
@@ -13,6 +13,8 @@
#include <time.h>
#include <stdlib.h> // atexit
+#include <libconfig.h>
+
#ifdef WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
@@ -872,6 +874,20 @@ int ShowWarning(const char *string, ...) {
va_end(ap);
return ret;
}
+int ShowConfigWarning(config_setting_t *config, const char *string, ...)
+{
+ StringBuf buf;
+ int ret;
+ va_list ap;
+ StringBuf_Init(&buf);
+ StringBuf_AppendStr(&buf, string);
+ StringBuf_Printf(&buf, " (%s:%d)\n", config_setting_source_file(config), config_setting_source_line(config));
+ va_start(ap, string);
+ ret = _vShowMessage(MSG_WARNING, StringBuf_Value(&buf), ap);
+ va_end(ap);
+ StringBuf_Destroy(&buf);
+ return ret;
+}
int ShowDebug(const char *string, ...) {
int ret;
va_list ap;