diff options
author | jilles <jilles@FreeBSD.org> | 2013-07-25 15:08:41 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2013-07-25 15:08:41 +0000 |
commit | 0ad2a46f33944b5fedbda54167af5739c8c5ed84 (patch) | |
tree | 4cdf5ff0108f4909c6111d72ffe6f925dec35704 /bin/sh/TOUR | |
parent | 34bfb313cd341ffba7e1c34cdc5f2aabc7cd8ec5 (diff) | |
download | FreeBSD-src-0ad2a46f33944b5fedbda54167af5739c8c5ed84.zip FreeBSD-src-0ad2a46f33944b5fedbda54167af5739c8c5ed84.tar.gz |
sh: Remove mkinit.
Replace the RESET blocks with regular functions and a reset() function that
calls them all.
This code generation tool is unusual and does not appear to provide much
benefit. I do not think isolating the knowledge about which modules need to
be reset is worth an almost 500-line build tool and wider scope for
variables used by the reset functions.
Also, relying on reset functions is often wrong: the cleanup should be done
in exception handlers so that no stale state remains after 'command eval'
and the like.
Diffstat (limited to 'bin/sh/TOUR')
-rw-r--r-- | bin/sh/TOUR | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/bin/sh/TOUR b/bin/sh/TOUR index 13438b5..e9bbe9b 100644 --- a/bin/sh/TOUR +++ b/bin/sh/TOUR @@ -25,38 +25,11 @@ programs is: program input files generates ------- ----------- --------- mkbuiltins builtins builtins.h builtins.c - mkinit *.c init.c mknodes nodetypes nodes.h nodes.c mksyntax - syntax.h syntax.c mktokens - token.h -There are undoubtedly too many of these. Mkinit searches all the -C source files for entries looking like: - - RESET { - x = 2; /* executed when the shell does a longjmp - back to the main command loop */ - } - -It pulls this code out into routines which are when particular -events occur. The intent is to improve modularity by isolating -the information about which modules need to be explicitly -initialized/reset within the modules themselves. - -Mkinit recognizes several constructs for placing declarations in -the init.c file. - INCLUDE "file.h" -includes a file. The storage class MKINIT makes a declaration -available in the init.c file, for example: - MKINIT int funcnest; /* depth of function calls */ -MKINIT alone on a line introduces a structure or union declara- -tion: - MKINIT - struct redirtab { - short renamed[10]; - }; -Preprocessor #define statements are copied to init.c without any -special action to request this. +There are undoubtedly too many of these. EXCEPTIONS: Code for dealing with exceptions appears in exceptions.c. The C language doesn't include exception handling, |