From 44d5655584bfa914c127f177919a7069e6cff841 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 25 May 2016 01:37:44 +0300 Subject: Add nonfatal error message facility to extension API. --- gawkapi.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'gawkapi.c') diff --git a/gawkapi.c b/gawkapi.c index 9d8c6f36..9d5f4491 100644 --- a/gawkapi.c +++ b/gawkapi.c @@ -198,7 +198,21 @@ api_fatal(awk_ext_id_t id, const char *format, ...) va_end(args); } -/* api_warning --- print a warning message and exit */ +/* api_nonfatal --- print a non fatal error message */ + +static void +api_nonfatal(awk_ext_id_t id, const char *format, ...) +{ + va_list args; + + (void) id; + + va_start(args, format); + err(false, _("error: "), format, args); + va_end(args); +} + +/* api_warning --- print a warning message */ static void api_warning(awk_ext_id_t id, const char *format, ...) @@ -1222,6 +1236,9 @@ gawk_api_t api_impl = { /* Find/open a file */ api_get_file, + + /* Print nonfatal error message */ + api_nonfatal, }; /* init_ext_api --- init the extension API */ -- cgit v1.2.3