diff options
author | Hartmut Brandt <harti@FreeBSD.org> | 2005-04-11 07:20:10 +0000 |
---|---|---|
committer | Hartmut Brandt <harti@FreeBSD.org> | 2005-04-11 07:20:10 +0000 |
commit | f520690c2c6018ff252b661d6c7e11886d6d22b6 (patch) | |
tree | 60d3956bc33947fb68e3718f818abf16c726d320 /usr.bin/make/for.h | |
parent | 84aac2738154d46006979d01e3dce512db465848 (diff) | |
download | src-f520690c2c6018ff252b661d6c7e11886d6d22b6.tar.gz src-f520690c2c6018ff252b661d6c7e11886d6d22b6.zip |
Rework the directive parsing code. Instead of using a lot of strcmp()s
on every line that starts with a dot use a minimal perfect hash
function and a single strcmp() on the first word after the dot
to find out whether it is really a directive call and, if yes, which
one. Then directly dispatch to a handler function for that directive
(or fall through to the dependency handling code). This makes the
directive parse a little bit more strict about the syntax: the directive
word must be followed by a character that is not alphanumerical and not
an underline (making .undefFOO illegal); .endif and .else can only be
followed by comments.
Notes
Notes:
svn path=/head/; revision=144894
Diffstat (limited to 'usr.bin/make/for.h')
-rw-r--r-- | usr.bin/make/for.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/make/for.h b/usr.bin/make/for.h index c6404b2491af..052e1948a6bb 100644 --- a/usr.bin/make/for.h +++ b/usr.bin/make/for.h @@ -41,7 +41,10 @@ #ifndef for_h_9d770f33 #define for_h_9d770f33 -int For_Eval(char *); +#include "sprite.h" + +Boolean For_For(char *); +Boolean For_Eval(char *); void For_Run(int); #endif /* for_h_9d770f33 */ |