diff options
author | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2012-05-19 23:45:07 -0400 |
---|---|---|
committer | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2012-05-19 23:45:07 -0400 |
commit | cdf892a07fa67c635997e41ee8fe175aaafb2431 (patch) | |
tree | 46245d7f88797b98dbb60e60b223b3da9ff13cd1 /TODO.xgawk | |
parent | 0f2e51f9b18a1c4e203e0bd0ac3c68db9faa9b6d (diff) | |
download | egawk-cdf892a07fa67c635997e41ee8fe175aaafb2431.tar.gz egawk-cdf892a07fa67c635997e41ee8fe175aaafb2431.tar.bz2 egawk-cdf892a07fa67c635997e41ee8fe175aaafb2431.zip |
Add -i option, append .awk if initial search fails, and allow -f repeats.
Diffstat (limited to 'TODO.xgawk')
-rw-r--r-- | TODO.xgawk | 201 |
1 files changed, 113 insertions, 88 deletions
@@ -1,86 +1,37 @@ To-do list for xgawk enhancements: +- Finish implementing new interface using gawkapi.h -Done: - -- Add AWKLIBPATH with default pointing to ${libexecdir}/$PACKAGE/$VERSION - -- Change default shared library extension from ".so" to ".$shlibext" - -- Patch build infrastructure so that the current code in the - extension subdirectory gets built and installed into the default $AWKLIBPATH - location. - -- Implement @load - -- Patch ERRNO handling to create a simple API for use by extensions: - extern void update_ERRNO_int(int) - enum errno_translate { TRANSLATE, DONT_TRANSLATE }; - extern void update_ERRNO_string(const char *string, enum errno_translate); - extern void unset_ERRNO(void); - -- Add valgrind-noleak target. - -- Fix minor bug in fork extension, and add wait function. - -- Patch filefuncs extension to read symbolic links more robustly. - -- Add shared library tests. - -- Delete extension/xreadlink.[ch] - - -To do (not necessarily in this order): - -- Add a -i (--include) option. - -- The -f flag should not eliminate duplicates. - -- Enable default ".awk" search in io.c:find_source(). The simple change - is to add this code inline in io.c: - #ifndef DEFAULT_FILETYPE - #define DEFAULT_FILETYPE ".awk" - #endif - -- Implement new interface using gawkapi.h +- Consider behavior when -i and -f include the same file. Currently, + -f always loads the code, regardless of whether it has already been loaded + using -i or -f. By contrast, -i will ignore the file if has already been + loaded with either -i or -f. Thus, if you say "gawk -f lib.awk -i lib.awk", + it will not be included the second time. But if you flip the order + and say "gawk -i lib.awk -f lib.awk", the file will be loaded twice. + Is this the most sensible behavior? - Add time extension to the gawk distro. This defines sleep and gettimeofday. - Rename existing gettimeofday by adding some underscores. + Rename existing gettimeofday by adding some underscores. Awaiting + confirmation of copyright assignment from FSF... -- Enhance extension/fork.c waitpid to allow the caller to specify the options. - And add an optional array argument to wait and waitpid in which to return - exit status information. +- Running "make install" should install gawkapi.h in /usr/include. -- Maybe add more shared library tests. +- Decide how to transition from the old extension API to the new one. + When will the old approach be abandoned? -- Fix extension/rwarray.c. It does not currently compile due to changes - in the NODE structure relating to array support. The MPFR changes will - also make this more complicated. - -- Figure out how to support xgawk on platforms such as Cygwin where a DLL - cannot be linked with unresolved references. There are currently 3 - possible solutions: - 1. Restructure gawk as a stub calling into a shared library. - 2. Move a subset of gawk interfaces into a shared library that can be - called by extensions. - 3. Change the interface between gawk and extensions so that gawk will - pass a pointer to a structure into dlload that contains the addresses - of all variables and functions to which the extension may need access. +- Eliminate libtool from the top-level configure.ac. Create a separate + configure.ac in the extensions subdirectory, and hide all the libtool + stuff in there. I think AC_CONFIG_SUBDIRS may do this. Should building + the extensions be optional (e.g. by adding a --without-extensions option + to the top-level configure)? If not, I do not understand what is + accomplished by using a separate configure script for the extensions... -- Fix lint complaints about shared library functions being called without - having been defined. For example, try: - gawk --lint -lordchr 'BEGIN {print chr(65)}' - gawk: warning: function `chr' called but never defined - A - In ext.c, make_builtin needs to call awkgram.y:func_use. If done naively, - I think this would result in complaints about shared library functions - defined but not used. So there should probably be an enhancement to func_use - and ftable to indicate if it's a shared library function. +- Develop a libgawk shared library for use by extensions. Should this + be hosted in a separate project? -- Develop a libgawk shared library for use by extensions. In particular, - a few existing extensions use a hash API for mapping string handles to - structures. In xgawk, we had this API inside array.c, but it probably - belongs in a separate libgawk shared library: + A few existing extensions use a hash API for mapping string + handles to structures. In xgawk, we had this API inside array.c, but it + probably belongs in a separate libgawk shared library: typedef struct _strhash strhash; extern strhash *strhash_create P((size_t min_table_size)); @@ -96,19 +47,28 @@ To do (not necessarily in this order): strhash_delete_func, void *opaque)); extern void strhash_destroy P((strhash *, strhash_delete_func, void *opaque)); -- Running "make install" should install the new libgawk shared library - as well as header files needed to build extensions under /usr/include/gawk. - The extensions include "awk.h", and that pulls in the following headers - (according to gcc -M) : - awk.h config.h custom.h gettext.h mbsupport.h protos.h getopt.h \ - regex.h dfa.h - Most likely, most of this is not required. Arnold has suggested - creating a smaller header to define the public interface for use by shared - libraries. One could imagine having "awk-ext.h" that is included by "awk.h". - - -Separate projects for major standalone extensions. Where should these -be hosted? +- Review open hook implementation. Arnold's comments on this: + I think the code flow in io.c needs reviewing. It's not + clear to me under what circumstances open hooks (a) are called, or + (b) should be called. Only the XML extension uses them now, but I + think it'd be a nice mechanism to generalize if possible, and to + document. + + E.g., I can easily envision an open hook to turn directories into records + of the form + + type link-count mode owner group atime mtime ctime name + + I could also envision an open hook to provide an interface to libiconv + (somehow). More discussion / explanation of the vision behind this + would be welcome. + +- Can the IOBUF internals be removed from gawkapi.h? I think this may be + possible if we revise the open hook implementation. + + +Separate projects for major standalone extensions. We need to set up +hosting for these projects: - XML @@ -116,10 +76,33 @@ be hosted? - GD -- MPFR. Is this still useful if MPFR support will be integrated into gawk? +- MPFR. This is probably not useful now that MPFR support has been + integrated into gawk. Are there any users who need this extension? + + +Low priority: +- Fix extension/rwarray.c. It does not currently compile due to changes + in the NODE structure relating to array support. The MPFR changes will + also make this more complicated. John is best equipped to solve this + problem. + +- Enhance extension/fork.c waitpid to allow the caller to specify the options. + And add an optional array argument to wait and waitpid in which to return + exit status information. -Possible changes requiring (further) discussion: +- Fix lint complaints about shared library functions being called without + having been defined. For example, try: + gawk --lint -lordchr 'BEGIN {print chr(65)}' + gawk: warning: function `chr' called but never defined + A + In ext.c, make_builtin needs to call awkgram.y:func_use. If done naively, + I think this would result in complaints about shared library functions + defined but not used. So there should probably be an enhancement to func_use + and ftable to indicate if it's a shared library function. + + +Possible future changes requiring (further) discussion: - Change from dlopen to using the libltdl library (i.e. lt_dlopen). This may support more platforms. @@ -139,6 +122,48 @@ Possible changes requiring (further) discussion: etc, I'd like to keep things simple. But how we design this is going to be very important. + +Unlikely: + - Include a sample rpm spec file in a new packaging subdirectory. - Patch lexer for @include and @load to make quotes optional. + + +Done: + +- Add AWKLIBPATH with default pointing to ${libexecdir}/$PACKAGE/$VERSION + +- Change default shared library extension from ".so" to ".$shlibext" + +- Patch build infrastructure so that the current code in the + extension subdirectory gets built and installed into the default $AWKLIBPATH + location. + +- Implement @load + +- Patch ERRNO handling to create a simple API for use by extensions: + extern void update_ERRNO_int(int) + enum errno_translate { TRANSLATE, DONT_TRANSLATE }; + extern void update_ERRNO_string(const char *string, enum errno_translate); + extern void unset_ERRNO(void); + +- Add valgrind-noleak target. + +- Fix minor bug in fork extension, and add wait function. + +- Patch filefuncs extension to read symbolic links more robustly. + +- Add shared library tests. + +- Delete extension/xreadlink.[ch] + +- Add a -i (--include) option. + +- Enable default ".awk" search in io.c:find_source(). The simple change + is to add this code inline in io.c: + #ifndef DEFAULT_FILETYPE + #define DEFAULT_FILETYPE ".awk" + #endif + +- The -f flag should not eliminate duplicates. |