Remove building with NOCRYPTO option
[minix.git] / sbin / route / keywords.sh
blobae1476d72eb1d836e24cd7208bd5cc58e724ce8b
1 #!/bin/sh
2 # $NetBSD: keywords.sh,v 1.11 2013/03/01 18:25:17 joerg Exp $
3 # @(#)keywords 8.2 (Berkeley) 3/19/94
5 # WARNING! If you change this file, re-run it!
7 # This program requires "new" awk (or GNU awk).
8 awk=${AWK:-awk}
10 cat << _EOF_ > _keywords.t1
11 add
12 atalk
13 blackhole
14 change
15 cloned
16 cloning
17 delete
18 dst
19 expire
20 flush
21 gateway
22 genmask
23 get
24 host
25 hopcount
26 iface
27 interface
28 ifa
29 ifp
30 inet
31 inet6
32 link
33 llinfo
34 lock
35 lockrest
36 mask
37 monitor
38 mtu
39 net
40 netmask
41 nostatic
42 prefixlen
43 proto1
44 proto2
45 recvpipe
46 reject
47 rtt
48 rttvar
50 sendpipe
51 show
52 ssthresh
53 static
54 x25
55 xns
56 xresolve
57 flushall
58 nocloned
59 nocloning
60 noblackhole
61 noreject
62 mpls
63 tag
64 proxy
65 _EOF_
68 ################################################################
69 # Setup
70 ################################################################
72 # This creates a stream of:
73 # keyword KEYWORD
74 # (lower case, upper case).
75 tr a-z A-Z < _keywords.t1 |
76 paste _keywords.t1 - > _keywords.t2
79 ################################################################
80 # Generate the h file
81 ################################################################
82 exec > keywords.h
84 echo '/* $'NetBSD'$ */
86 /* WARNING! This file was generated by keywords.sh */
88 extern struct keytab {
89 const char *kt_cp;
90 int kt_i;
91 } keywords[];
93 ' # defines follow
95 $awk '{
96 printf("#define\tK_%s\t%d\n", $2, NR);
97 }' < _keywords.t2
100 ################################################################
101 # Generate the c file
102 ################################################################
103 exec > keywords.c
105 echo '/* $'NetBSD'$ */
107 /* WARNING! This file was generated by keywords.sh */
109 #include "keywords.h"
111 struct keytab keywords[] = {
112 ' # initializers follow
114 $awk '{
115 printf("\t{\"%s\", K_%s},\n", $1, $2);
116 }' < _keywords.t2
118 echo ' {0, 0}
120 ' # tail
123 ################################################################
124 # Cleanup
125 ################################################################
127 rm -f _keywords.t1 _keywords.t2
128 exit 0