|
|
coherent
Fri Jul 10 22:45:42 1992 PDT V3.3.3: extensive changes to implement shell functions, as per specification provided by hal. sh.h Added tokens NFUNC, NRET and shell function type SHFUNC. Added declarations for globals sh_fnp, in_sh_fn, ret_done. sh.y Added tokens _PARENS and _RET and syntax for return and shell functions. lex.c Added "return" (_RET) and "()" (_PARENS). extern.c Added globals sh_fnp, in_sh_fn, ret_done. exec1.c In command(), added cases NFUNC (shell function definitions) and NRET (return) and ret_done references to change control flow after return. Added call to sh_fn() to look for shell function calls. exec2.c In clone(), reset global sh_fnp to NULL in child so that forked processes do not inherit shell functions. exec3.c Added code to implement shell function definition and execution. lookup_sh_fn() looks up a shell function name, def_sh_fn() defines a shell function, and sh_fn() executes a shell function if appropriate. Auxilliary routines copy_node() and free_node() do the messiest part of the job. Tue Jul 14 15:06:56 1992 PDT sh.h Redefined NODE so that -VSINU compilation is no longer required. lex.c Added hashing to keyword lookup. Mon Mar 22 11:25:47 1993 PST exec1.c Integrated changes from non-function version, cf. sh/Changes. Fri May 7 05:34:29 1993 PDT exec3.c V4.0.5: In sh_fn, added code to save and restore sesp->s_con. michael discovered that a shell function called from ANDAND within a while-loop caused the old version to core dump. The modified version essentially runs the shell function in its own "break/continue" context, then restores the previous "break/continue" context.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.