diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2016-05-25 01:37:44 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2016-05-25 01:37:44 +0300 |
commit | 44d5655584bfa914c127f177919a7069e6cff841 (patch) | |
tree | e161e7792f09897b4129843a466e35d8e841bac6 /gawkapi.c | |
parent | 5a66b6c262a2953af85465b1ec6c2d47bacec7cd (diff) | |
download | egawk-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.c | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -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 */ |