manpagez: man pages & more
info gawk
Home | html | info | man

File: gawk.info,  Node: Printing Messages,  Next: Updating ERRNO,  Prev: Registration Functions,  Up: Extension API Description

17.4.7 Printing Messages
------------------------

You can print different kinds of warning messages from your extension,
as described here.  Note that for these functions, you must pass in the
extension ID received from 'gawk' when the extension was loaded:(1)

'void fatal(awk_ext_id_t id, const char *format, ...);'
     Print a message and then cause 'gawk' to exit immediately.

'void nonfatal(awk_ext_id_t id, const char *format, ...);'
     Print a nonfatal error message.

'void warning(awk_ext_id_t id, const char *format, ...);'
     Print a warning message.

'void lintwarn(awk_ext_id_t id, const char *format, ...);'
     Print a "lint warning."  Normally this is the same as printing a
     warning message, but if 'gawk' was invoked with '--lint=fatal',
     then lint warnings become fatal error messages.

   All of these functions are otherwise like the C 'printf()' family of
functions, where the 'format' parameter is a string with literal
characters and formatting codes intermixed.

   ---------- Footnotes ----------

   (1) Because the API uses only ISO C 90 features, it cannot make use
of the ISO C 99 variadic macro feature to hide that parameter.  More's
the pity.

© manpagez.com 2000-2025
Individual documents may contain additional copyright information.