diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2005-03-30 06:02:53 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2005-03-30 06:02:53 +0000 |
commit | 433ddf771b59c9fd1c98dfb876044c225e188539 (patch) | |
tree | 3257ae02e7ff7b6b719d1fa431e307584ef39197 | |
parent | 11e37d658788c136ae153d9a573f268fc41e8319 (diff) |
get rid of the twisted keywords.[c|h] interaction and just let keywords.sh
put the defines and the table into the .h
-rw-r--r-- | sbin/route/Makefile | 4 | ||||
-rw-r--r-- | sbin/route/keywords.c | 55 | ||||
-rw-r--r-- | sbin/route/keywords.h | 60 | ||||
-rw-r--r-- | sbin/route/keywords.sh | 34 |
4 files changed, 66 insertions, 87 deletions
diff --git a/sbin/route/Makefile b/sbin/route/Makefile index afd02ebdbc7..55e7baede0a 100644 --- a/sbin/route/Makefile +++ b/sbin/route/Makefile @@ -1,8 +1,8 @@ -# $OpenBSD: Makefile,v 1.8 2005/03/30 05:34:30 henning Exp $ +# $OpenBSD: Makefile,v 1.9 2005/03/30 06:02:52 henning Exp $ PROG= route MAN= route.8 -SRCS= route.c show.c keywords.c +SRCS= route.c show.c BINOWN= root BINMODE=555 diff --git a/sbin/route/keywords.c b/sbin/route/keywords.c deleted file mode 100644 index 9de4c12c617..00000000000 --- a/sbin/route/keywords.c +++ /dev/null @@ -1,55 +0,0 @@ -/* $OpenBSD: keywords.c,v 1.13 2005/03/30 05:20:18 henning Exp $ */ - -/* WARNING! This file was generated by keywords.sh */ - -#include "keywords.h" - -struct keytab keywords[] = { - - {"add", K_ADD}, - {"blackhole", K_BLACKHOLE}, - {"change", K_CHANGE}, - {"cloning", K_CLONING}, - {"delete", K_DELETE}, - {"dst", K_DST}, - {"expire", K_EXPIRE}, - {"flush", K_FLUSH}, - {"gateway", K_GATEWAY}, - {"genmask", K_GENMASK}, - {"get", K_GET}, - {"host", K_HOST}, - {"hopcount", K_HOPCOUNT}, - {"iface", K_IFACE}, - {"interface", K_INTERFACE}, - {"ifa", K_IFA}, - {"ifp", K_IFP}, - {"inet", K_INET}, - {"inet6", K_INET6}, - {"ipx", K_IPX}, - {"label", K_LABEL}, - {"link", K_LINK}, - {"llinfo", K_LLINFO}, - {"lock", K_LOCK}, - {"lockrest", K_LOCKREST}, - {"monitor", K_MONITOR}, - {"mpath", K_MPATH}, - {"mtu", K_MTU}, - {"net", K_NET}, - {"netmask", K_NETMASK}, - {"nostatic", K_NOSTATIC}, - {"prefixlen", K_PREFIXLEN}, - {"proto1", K_PROTO1}, - {"proto2", K_PROTO2}, - {"recvpipe", K_RECVPIPE}, - {"reject", K_REJECT}, - {"rtt", K_RTT}, - {"rttvar", K_RTTVAR}, - {"sa", K_SA}, - {"sendpipe", K_SENDPIPE}, - {"show", K_SHOW}, - {"ssthresh", K_SSTHRESH}, - {"static", K_STATIC}, - {"xresolve", K_XRESOLVE}, - {0, 0} -}; - diff --git a/sbin/route/keywords.h b/sbin/route/keywords.h index 4e91c159ce2..d83ad8628a9 100644 --- a/sbin/route/keywords.h +++ b/sbin/route/keywords.h @@ -1,12 +1,11 @@ -/* $OpenBSD: keywords.h,v 1.13 2005/03/30 05:20:18 henning Exp $ */ +/* $OpenBSD: keywords.h,v 1.14 2005/03/30 06:02:52 henning Exp $ */ /* WARNING! This file was generated by keywords.sh */ -extern struct keytab { - char *kt_cp; - int kt_i; -} keywords[]; - +struct keytab { + char *kt_cp; + int kt_i; +}; #define K_ADD 1 #define K_BLACKHOLE 2 @@ -52,3 +51,52 @@ extern struct keytab { #define K_SSTHRESH 42 #define K_STATIC 43 #define K_XRESOLVE 44 + +struct keytab keywords[] = { + { "add", K_ADD }, + { "blackhole", K_BLACKHOLE }, + { "change", K_CHANGE }, + { "cloning", K_CLONING }, + { "delete", K_DELETE }, + { "dst", K_DST }, + { "expire", K_EXPIRE }, + { "flush", K_FLUSH }, + { "gateway", K_GATEWAY }, + { "genmask", K_GENMASK }, + { "get", K_GET }, + { "host", K_HOST }, + { "hopcount", K_HOPCOUNT }, + { "iface", K_IFACE }, + { "interface", K_INTERFACE }, + { "ifa", K_IFA }, + { "ifp", K_IFP }, + { "inet", K_INET }, + { "inet6", K_INET6 }, + { "ipx", K_IPX }, + { "label", K_LABEL }, + { "link", K_LINK }, + { "llinfo", K_LLINFO }, + { "lock", K_LOCK }, + { "lockrest", K_LOCKREST }, + { "monitor", K_MONITOR }, + { "mpath", K_MPATH }, + { "mtu", K_MTU }, + { "net", K_NET }, + { "netmask", K_NETMASK }, + { "nostatic", K_NOSTATIC }, + { "prefixlen", K_PREFIXLEN }, + { "proto1", K_PROTO1 }, + { "proto2", K_PROTO2 }, + { "recvpipe", K_RECVPIPE }, + { "reject", K_REJECT }, + { "rtt", K_RTT }, + { "rttvar", K_RTTVAR }, + { "sa", K_SA }, + { "sendpipe", K_SENDPIPE }, + { "show", K_SHOW }, + { "ssthresh", K_SSTHRESH }, + { "static", K_STATIC }, + { "xresolve", K_XRESOLVE }, + { 0, 0 } +}; + 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 |