gawk: Old Extension Mechanism
1
1 C.6 Compatibility For Old Extensions
1 ====================================
1
1 ⇒Dynamic Extensions, describes the supported API and mechanisms
1 for writing extensions for 'gawk'. This API was introduced in version
1 4.1. However, for many years 'gawk' provided an extension mechanism
1 that required knowledge of 'gawk' internals and that was not as well
1 designed.
1
1 In order to provide a transition period, 'gawk' version 4.1 continues
1 to support the original extension mechanism. This will be true for the
1 life of exactly one major release. This support will be withdrawn, and
1 removed from the source code, at the next major release.
1
1 Briefly, original-style extensions should be compiled by including
1 the 'awk.h' header file in the extension source code. Additionally, you
1 must define the identifier 'GAWK' when building (use '-DGAWK' with
1 Unix-style compilers). Otherwise, the definitions in 'gawkapi.h' will
1 cause conflicts with those in 'awk.h' and your extension will not
1 compile.
1
1 Just as in previous versions, you load an old-style extension with
1 the 'extension()' built-in function (which is not otherwise documented).
1 This function in turn finds and loads the shared object file containing
1 the extension and calls its 'dl_load()' C routine.
1
1 Because original-style and new-style extensions use different
1 initialization routines ('dl_load()' versus 'dlload()'), they may safely
1 be installed in the same directory (to be found by 'AWKLIBPATH') without
1 conflict.
1
1 The 'gawk' development team strongly recommends that you convert any
11 old extensions that you may have to use the new API described in ⇒
Dynamic Extensions.
1