NetBSD/usr.bin/kdump/mkioctls
1994-10-06 15:44:32 +00:00

36 lines
674 B
Plaintext

# $Id: mkioctls,v 1.3 1994/10/06 15:44:35 mycroft Exp $
#
awk '
BEGIN {
print "#include <sys/param.h>"
print "#include <sys/socket.h>"
print "#include <sys/socketvar.h>"
print "#include <net/route.h>"
print "#include <net/if.h>"
print "#include <sys/termios.h>"
print "#define COMPAT_43"
print "#include <sys/ioctl.h>"
print ""
print "char *"
print "ioctlname(val)"
print "{"
print ""
}
/^#[ ]*define[ ]*(TIO|FIO|SIO|OSIO)[A-Z]*[ ]*_IO/ {
# find where the name starts
for (i = 1; i <= NF; i++)
if ($i ~ /define/)
break;
++i;
#
printf("\tif (val == %s)\n\t\treturn(\"%s\");\n", $i, $i);
}
END {
print "\n\treturn(NULL);"
print "}"
}
' $1 $2