aboutsummaryrefslogtreecommitdiffstats
path: root/gawkapi.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-05-25 01:37:44 +0300
committerArnold D. Robbins <arnold@skeeve.com>2016-05-25 01:37:44 +0300
commit44d5655584bfa914c127f177919a7069e6cff841 (patch)
treee161e7792f09897b4129843a466e35d8e841bac6 /gawkapi.c
parent5a66b6c262a2953af85465b1ec6c2d47bacec7cd (diff)
downloadegawk-44d5655584bfa914c127f177919a7069e6cff841.tar.gz
egawk-44d5655584bfa914c127f177919a7069e6cff841.tar.bz2
egawk-44d5655584bfa914c127f177919a7069e6cff841.zip
Add nonfatal error message facility to extension API.
Diffstat (limited to 'gawkapi.c')
-rw-r--r--gawkapi.c19
1 files changed, 18 insertions, 1 deletions
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 */