Next: Extension Exercises, Previous: gawkextlib, Up: Dynamic Extensions [Contents][Index]
gawk
in C or C++ using the application programming interface (API) defined by the gawk
developers.plugin_is_GPL_compatible
.gawk
and an extension is two-way. gawk
passes a struct
to the extension that contains various data fields and function pointers. The extension can then call into gawk
via the supplied function pointers to accomplish certain tasks.awk
-level functions with gawk
. The implementation takes the form of a C function pointer with a defined signature. By convention, implementation functions are named do_XXXX()
for some awk
-level function XXXX()
.gawkapi.h
. You must include a number of standard header files before including it in your source file.ERRNO
, or unsetting itawk
values, array elements, and arrays.gawk
and memory allocated by an extension.gawk
to an extension must be treated as read-only by the extension.gawk
must come from the API’s memory allocation functions. gawk
takes responsibility for the memory and releases it when appropriate.gawk
so that an extension can make sure it is compatible with the gawk
that loaded it.gawkapi.h
header file make this easier to do.gawk
distribution includes a number of small but useful sample extensions. The gawkextlib
project includes several more (larger) extensions. If you wish to write an extension and contribute it to the community of gawk
users, the gawkextlib
project is the place to do so.Next: Extension Exercises, Previous: gawkextlib, Up: Dynamic Extensions [Contents][Index]