Changelog for libmawk ~~~~~~~~~~~~~~~~~~~~~ libmawk 0.10.0 (released: 2014-06-26, r937) Major changes in core, mostly for virtual arrays: [array] -Add: introduce new VM instructions for all array-element-write operations and split the lvalue rule of the grammar; besides being new instructions, they do the same in the execution switch as before [array] -Add: virtualize array operations [array] -Add: virtual, per instance ENVIRON[] that copies environ[] upon the first access and affects exec() [array] -Del: ST_ENV: ENVIRON[] is not a global special case anymore, just a builtin array with a different implementation [core] -Fix: replace "short int type" and a bunch of C_ macros for cell type with a proper enum [core] -Add: macro option for cell operators for speed [core] -Fix: set ERRNO in fin after a read error [core] -Cleanup: mawk_ prefix zmalloc, zfree, ZMALLOC, ZFREE and a lot of other constants and macros [init] -Add: a flag for indicating that it is ok for initialize_argv() to end up without a script [dump] -Fix: print the code of illegal instructions [dump] -Add: da_text: use blank lines to separate blocks: functions, BEGIN, MAIN, END [dump] -Change: da_text: after user functions, dump code in BEGIN-MAIN-END order - it is more intuitive this way [dump] -Add: text dump includes a summary of the global symbol table [dump] -Change: introduce -W dumpsym for dumping symbols independently of dumping code [da_bin] -Fix: properly save/load C_SNULL and C_SPACE (special split argument types) to/from binary dump API CHANGES affecting libmawk: [core] -Clenaup: rename STRING to mawk_string_t [core] -Clenaup: rename CELL to libmawk_cell_t [core] -Change: use an union instead of dval in CELL, to make room for other data types [core] -Add: new cell type C_ARR_REF (should be execute()-internal); an array reference by name and index (instead of pointer to a cell) [API] -move parsing the script from init stage1 to stage2 to give the host app a chance to inject things into the context before any code is parsed [API] -Change: get_var should return a read-only CELL - direct modification of the cell is a bad idea due to possible side effects required at write [API] -Fix: libmawk_print_cell shall be called with the context (mawk_state_t) as any other call in the API [API] -Change: new, easier-to-use c-func calling conventions and helpers [array] -Cleanup: rename ARRAY to mawk_array_t New libmawk API features: [API] -Add: helper functions to return the numeric value of a cell [API] -Add: an easy way to set a cell to empty [API] -Add: high level array set_at calls and scalar set calls libmawk 0.9.7 (released: 2014-05-17, r732) Major code structure changes: [vio] -Split: file/pipe open/close operations to virtual IO (vio) [linux] -Add: initial linux kernel module effort (defunct yet) [array] -Add: virtualized array access (except for write) with callback functions [libmawk] -Split: lmawk-comp and lmawk-exec frames - most code is in common yet [libmawk] -Add: MAWK_NO_FORK for configuring against system() and fork() Code cleanup: [da_bin] -Cleanup: compiler warnings around da_bin (binary script save/load) [da_bin] -Split: da_bin and da_bin_helper: precompiled binary script load doesn't directly call read() but an user provided callback for virtualization [da_bin] -Fix: array creation on binary load [da_bin] -Fix: when resetting code base size for loading binary, use zmalloc for proper allocation size [build] -Fix: Makefile cleanup for portability [libmawk] -Fix: prefix NF, RS and other similar macro names with MAWK_ - they collide in the Linux kernel [test_3rd] -Add: scripts for running optional 3rd party tests from vendor/ (for the gawk set, without much configuration or filtering) [regex] -Change: error handling without setjmp/longjmp (return values and a bunch of checks) [regex] -Fix: regex lib uses zmalloc memory allocation to ensure all memory is free'd after a context is destroyed [regex] -Add: tiny test program to trigger almost all possible error conditions in the regex lib [regex] -Fix: move runtime states of the regex lib in the mawk struct to make it reentrant [regex] -Fix: bi_vars are part of the mawk struct because parallel scripts may have different values for the same variables or even modify them from script More portable doubles (and numeric): [numeric] -Add: use porty's math_wrap for log() to get rid of undeterministic fpe [numeric] -Add: use PM math protection copied from libporty [numeric] -Add: new builtin function isnan() [numeric] -Fix: virtualize strtod int strtonum: on a real int-only platform (e.g. Linux kernel) there won't be strtod at all Fixes of the core functionality: [libmawk] -Fix: make sure runtime error exit code takes over in final_error_code [bi_func] -Fix: substr for start indices less than 1 behave similar to how substr() handles length overruns (silently truncate) - gawk has the same behavior [bi_func] -Fix: gsub() patch for the ^ bug [io] -Fix: redirection conditions messed up in r349 [libmawk] -Fix: disable -v only when MAWK_NO_EXEC is set, and don't even consider MAWK_NO_COMP [libmawk] -Fix: fin_exec should respect a MAWK exit request and not retry reading [libmawk] -Fix: if FIN can not be open (invalid file name, nonexisting file), don't segfault but return error libmawk 0.9.6 (missed) libmawk 0.9.5 (released: 2012-10-13, r527) [libmawk] -Add: memory usage accounting figures; -Wmaxmem=size sets maximum memory allocation in bytes (optional suffixes: k and m) [libmawk] -Add: binary save/load functionality (-Wcompile and -b) works on 32 bit systems only (will be fixed later) [libmawk] -Change: replace hardwired double references with generin numeric (C_NUM, num_t) - libmawk can be configured to use int or double as numeric format (./configure --numeric=) [libmawk] -Cleanup: (portability tweak) const correctness in mawk_reverse_find [libmawk] -Add: (portability tweak) _POSIX_SOURCE [libmawk] -Fix: (portability tweak) explicit rules for rexp/*.o incuding $(CC) command line for old fashioned make having the wrong implicit rule [libmawk] -Cleanup: (portability tweak) k&r style function declarations/definitions removed from rexp lib [libmawk] -Fix: (portability tweak) missing prototypes to avoid implicit declaration warning [libmawk] -Change: disable two zfree() calls that would free main code to avoid double frees [libmawk] -Add: compile with app clfags [libmawk] -Cleanup: move scconfig'd -D options to conf.h from Makefile.conf to make compiler command lines shorter [libmawk] -Cleanup: new vars.[ch] for collecting variable-related code [libmawk] -Fix: mawk_mm (aka free_later) mechanism memory handling erros when realloc()'d [doc] -Add: explain design decisions behind our two gnu-dependencies [doc] -Add: portability table (per system: compiles out of the box, has FPE problems, awklib test ran fine) libmawk 0.9.4 (released: 2010-12-26, r392) [scconfig] -Add: detect pipe(2) and set NO_PIPE, replacing HAVE_REAL_PIPES [scconfig] -Add: detect size_t include file (removes the ifdef mess) [scconfig] -Add: require detection of cc/fpic (fixes compilation on amd64) [libmawk] -Cleanup: del PROTO() macro: libmawk requires at least C89 compiler [libmawk] -Cleanup: remove revision history and file name comments from *.[ch] copyright notice above all mawk copyright notices [libmawk] -Cleanup: version to clearly indicate that this is lmawk [libmawk] -Cleanup: unified indentation in all .c and .h files [libmawk] -Cleanup: remove a lot of compiler warnings, fix const correctness [libmawk] -Cleanup: Makefile.dep generation rule; proper, up-to-date Makefile.dep [libmawk] -Del: remove FAKE_PIPES support (was only for DOS anyway) [libmawk] -Del: void * is a must, PTR should not fall back to char * [libmawk] -Del: cut out MSDOS support with all its "dreaded segment nonsense" [libmawk] -Fix: get bison to generate a reentrant parser [libmawk] -Fix: move static globals to mawk state struct [libmawk] -Fix: memory leaks libmawk 0.9.3 (released: 2010-12-21, r307) [libmawk] -Fix: use -fPIC for compiling (helps on amd64) [libmawk] -Add: new builtin variable ERRNO with a different error code for each corner case in extension calls [libmawk] -Add: new built-in variable LIBPATH for library search path - skip loading a script if name started with '+' and the script was already loaded - if script file name starts with '/', assume it to be an absolute path and skip LIBPATH search [scconfig] -Add: scconfig configures/generates Makefiles of libmawk after autodetecting system features [scconfig] -Del: config-user, v7, atarist: scconfig should take care of all supported systems [scconfig] -Add: central ./configure and Makefile [libmawk] -Fix: order of running BEGINs with "include" [libmawk] -Fix: memory leaks around parser state [awklib] -Add: three awk libraries: - lib_rand for reproducible pseudo random numbers - lib_array for packing/unpacking/printing arrays - lib_ascii for converting characters to ASCII codes libmawk 0.9.2 (released: 2010-12-12, r229) [libmawk] -Fix: invalid memory handling around cells [libmawk] -Fix: manual page dates and author and project/executable name [libmawk] -Add: dynamic awk function calls (call() and acall()) [libmawk] -Add: dynamic awk variable value fetch (valueof()) [libmawk] -Add: include libmawk 0.9.1 (released: 2009-08-14, r198) [API] -Add: remember userdata when registering and calling back c functions [API] -Add: option to suppress undefined function calls [API] -Add: new call allowing awk function calls without varargs [API] -Change: split up libmawk_initialize in 3 stages (optional) [libmawk] -Del: autotools, keep last generated Makefile for hand editing [libmawk] -Del: config.h (merged in Makefile.conf.in) [libmawk] -Rename: mawk -> lmawk (the binary) [libmawk] -Change: print cell prints integers without .000000 [testapp] -Move: testapp out from libmawk (new dir structure) [testapp] -Fix: stack handling bug [doc] -Add: manual pages for libmawk calls libmawk 0.9.0 (released: 2009-07-22, r146) * Initial release, based on mawk 1.3.3 * r3...r8 Separate libmawk_call() from execute(); allow undefined functions * r9...r42 globals to struct (reentrant) * r43...r92 rename non-static functions to have a mawk_ prefix * r92...r145 libmawk