diff mbox

[RFC,3/9] genksyms: pass hash and lookup functions name and target language though the input file

Message ID 1304561004-2684-4-git-send-email-lacombar@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Arnaud Lacombe May 5, 2011, 2:03 a.m. UTC
Renaming hash and lookup functions on the command line would reduces its
genericity. Use the .gperf file to pass this information. Do the same for the
target language.
---
 scripts/genksyms/Makefile       |    2 +-
 scripts/genksyms/genksyms.gperf |    3 +++
 2 files changed, 4 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/scripts/genksyms/Makefile b/scripts/genksyms/Makefile
index 82bb25f..de6675d 100644
--- a/scripts/genksyms/Makefile
+++ b/scripts/genksyms/Makefile
@@ -29,7 +29,7 @@  lex.%.c: %.l
 	cp $@ $@_shipped
 
 %.hash.c: %.gperf
-	gperf -t --output-file $@ -L ANSI-C -a -C -E -g -H is_reserved_hash -k 1,3,$$ -N is_reserved_word -p -t $<
+	gperf -t --output-file $@ -a -C -E -g -k 1,3,$$ -p -t $<
 	cp $@ $@_shipped
 
 endif
diff --git a/scripts/genksyms/genksyms.gperf b/scripts/genksyms/genksyms.gperf
index e6349ac..3e77a94 100644
--- a/scripts/genksyms/genksyms.gperf
+++ b/scripts/genksyms/genksyms.gperf
@@ -1,3 +1,6 @@ 
+%language=ANSI-C
+%define hash-function-name is_reserved_hash
+%define lookup-function-name is_reserved_word
 %{
 struct resword;
 static const struct resword *is_reserved_word(register const char *str, register unsigned int len);