diff options
Diffstat (limited to 'sbin/route/keywords.sh')
-rw-r--r-- | sbin/route/keywords.sh | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/sbin/route/keywords.sh b/sbin/route/keywords.sh index 89bed053181..a8553307e37 100644 --- a/sbin/route/keywords.sh +++ b/sbin/route/keywords.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $OpenBSD: keywords.sh,v 1.12 2005/03/30 05:20:18 henning Exp $ +# $OpenBSD: keywords.sh,v 1.13 2005/03/30 06:02:52 henning Exp $ # $NetBSD: keywords.sh,v 1.2 1996/11/15 18:57:21 gwr Exp $ # @(#)keywords 8.2 (Berkeley) 3/19/94 # @@ -66,7 +66,6 @@ _EOF_ tr a-z A-Z < _keywords.t1 | paste _keywords.t1 - > _keywords.t2 - ################################################################ # Generate the h file ################################################################ @@ -76,37 +75,24 @@ echo '/* $'OpenBSD'$ */ /* WARNING! This file was generated by keywords.sh */ -extern struct keytab { - char *kt_cp; - int kt_i; -} keywords[]; - -' # defines follow +struct keytab { + char *kt_cp; + int kt_i; +}; +' $awk '{ printf("#define\tK_%s\t%d\n", $2, NR); }' < _keywords.t2 - -################################################################ -# Generate the c file -################################################################ -exec > keywords.c - -echo '/* $'OpenBSD'$ */ - -/* WARNING! This file was generated by keywords.sh */ - -#include "keywords.h" - -struct keytab keywords[] = { -' # initializers follow +echo ' +struct keytab keywords[] = {' $awk '{ - printf("\t{\"%s\", K_%s},\n", $1, $2); + printf("\t{ \"%s\", K_%s },\n", $1, $2); }' < _keywords.t2 -echo ' {0, 0} +echo ' { 0, 0 } }; ' # tail |