Home | History | Annotate | Line # | Download | only in kdump
mkioctls revision 1.5
      1  1.5  mycroft #	$Id: mkioctls,v 1.5 1995/01/15 07:51:08 mycroft Exp $
      2  1.3  mycroft #
      3  1.5  mycroft cpp -dM ${1+"$@"} | awk '
      4  1.1      cgd BEGIN {
      5  1.1      cgd 	print "#include <sys/param.h>"
      6  1.1      cgd 	print "#include <sys/socket.h>"
      7  1.1      cgd 	print "#include <sys/socketvar.h>"
      8  1.1      cgd 	print "#include <net/route.h>"
      9  1.1      cgd 	print "#include <net/if.h>"
     10  1.1      cgd 	print "#include <sys/termios.h>"
     11  1.1      cgd 	print "#define COMPAT_43"
     12  1.1      cgd 	print "#include <sys/ioctl.h>"
     13  1.1      cgd 	print ""
     14  1.1      cgd 	print "char *"
     15  1.1      cgd 	print "ioctlname(val)"
     16  1.5  mycroft 	print "\tlong val;"
     17  1.1      cgd 	print "{"
     18  1.1      cgd 	print ""
     19  1.1      cgd }
     20  1.1      cgd 
     21  1.1      cgd /^#[ 	]*define[ 	]*(TIO|FIO|SIO|OSIO)[A-Z]*[ 	]*_IO/ {
     22  1.1      cgd 	
     23  1.1      cgd 	# find where the name starts
     24  1.1      cgd 	for (i = 1; i <= NF; i++)
     25  1.1      cgd 		if ($i ~ /define/)
     26  1.1      cgd 			break;
     27  1.1      cgd 	++i;
     28  1.1      cgd 	# 
     29  1.5  mycroft 	printf("\tif (val == %s)\n\t\treturn (\"%s\");\n", $i, $i);
     30  1.1      cgd 
     31  1.1      cgd }
     32  1.1      cgd END {
     33  1.5  mycroft 	print "\n\treturn (NULL);"
     34  1.1      cgd 	print "}"
     35  1.1      cgd }
     36  1.5  mycroft '
     37