| download | motivation | current state |
libmawk
Libmawk is a fork of mawk 1.3.3 restructured for embedding. This means the
user gets libmawk.h and libmawk.so and can embed awk scripting language
in any application written in C. Why? Because
awk is my favorite programming language.
If you are interested in the project, you may want to
download the sources.
features
Libmawk has the following main features:
- load and run multiple awk scripts independently, in parallel
- scripts do not read stdin but a memory buffer the embedding process can fill from time to time
- running scripts in (mostly) non-blocking manner - that is, the script will not block if the process can not provide new input
- all these without threads or fork() - leaving the choice to the application to implement async main loop, threads or multiple processes with IPC
- call awk functions from C, using vararg for smooth integration
- call C functions from awk scripts
- resolve existing awk variables from C - read or write variables
- save/load precompiled (binary) scripts
- accounting of memory allocation, optional limitation of memory allocation, per script
- language extensions (both in the lib and executable version)
- dynamic function calls (call functions by name using call() and acall())
- dynamic variable value fetch (valueof() returns the value of a variable by name)
- include "source.awk" allows an awk source to include another awk source (for modular scripts and awk libraries)
License
Since mawk is licensed under the GNU GPL v2 and libmawk is a fork of
mawk, libmawk is licensed under the GNU GPL v2 too.
Contact
email: libmawk [( a t )] igor2.repo.hu