Commit | Line | Data |
---|---|---|
1f6764c8 MT |
1 | nawk ' |
2 | BEGIN { | |
3 | print "#include <sys/param.h>" | |
4 | print "#include <sys/socket.h" | |
5 | print "#include <sys/socketvar.h>" | |
6 | print "#include <net/route.h>" | |
7 | print "#include <net/if.h>" | |
8 | print "#include <sys/termios.h>" | |
9 | print "" | |
10 | print "char *" | |
11 | print "ioctlname(val)" | |
12 | print "{" | |
13 | print "" | |
14 | print " switch(val) {" | |
15 | } | |
16 | ||
17 | /^#[ ]*define[ ]*(TIO|FIO|SIO|OSIO)[A-Z]*[ ]*_IO/ { | |
18 | ||
19 | # find where the name starts | |
20 | for (i = 1; i <= NF; i++) | |
21 | if ($i ~ /^.define/) | |
22 | break; | |
23 | ++i; | |
24 | # | |
25 | printf("\tcase %s:\n\t\treturn(\"%s\");\n", $i, $i); | |
26 | ||
27 | } | |
28 | END { | |
29 | print "\t};\n\treturn(NULL);" | |
30 | print "}" | |
31 | } | |
32 | ' /sys/h/ioctl.h |