File:  [MW Coherent from dump] / coherent / g / usr / lib / ncurses / MKinfo.awk
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed May 29 04:56:35 2019 UTC (7 years ago) by root
Branches: MarkWilliams, MAIN
CVS tags: relic, HEAD
coherent

#
# Generate putinfo.c
# 10-23-92. Vlad.
#
BEGIN	{
		print "/*" > "boolnames"
		print " * putinfo.c" > "boolnames"
		print " * This file is generated by MKinfo.awk." > "boolnames"
		print " * Do not make any changes directly to this file" > "boolnames"
		print " */" > "boolnames"
		print "#include <stdio.h>" > "boolnames"
		print "#include <string.h>" > "boolnames"
		print "#include <ctype.h>" > "boolnames"
		print ""  > "boolnames"
		print "#define	bool	char"  > "boolnames"
		print "#define	TRUE	1" > "boolnames"	
		print "#define	FALSE	0" > "boolnames"
		print "" > "boolnames"
		print "#define\tMAXINDEX(array) (sizeof(array)/sizeof(array[0]))" > "boolnames"
		print "" > "boolnames"
		print "/*" > "boolnames"
		print " * bools and boolcaps;" > "boolnames"
		print " * lookup translate table for boolean fields." > "boolnames"
		print " */\n" > "boolnames"
		print "struct bools {" > "boolnames"
		print "\tchar\t*capname;\t/* termcap name */" > "boolnames"
		print "\tchar\t*infoname;\t/* terminfo name */" > "boolnames"
		print "};\n" > "boolnames"
		print "struct bools\tboolcaps[] = {" > "boolnames"
		print  "\n/*" > "numnames"
		print  " * nums and numcaps;" > "numnames"
		print  " * lookuptranslate table for numeric capabilities." > "numnames"
		print  " */" > "numnames"
		print "struct nums {" > "numnames"
		print "\tchar\t*capname;\t/* termcap name */" > "numnames"
		print "\tchar\t*infoname;\t/* terminfo name */" > "numnames"
		print "};\n" > "numnames"
		print "struct nums\tnumcaps[] = {" > "numnames"
		print  "\n/*" > "strnames"
		print  " * sts and strcaps;" > "strnames"
		print  " * lookuptranslate table for string capabilities." > "strnames"
		print  " */" > "strnames"
		print "struct strs {" > "strnames"
		print "\tchar\t*capname;\t/* termcap name */" > "strnames"
		print "\tchar\t*infoname;\t/* terminfo name */" > "strnames"
		print "\tchar\t*dflt;\t\t/* default value */" > "strnames"
		print "};\n" > "strnames"
		print "struct strs\tstrcaps[] = {" > "strnames"
	}

$4 == "bool"	{
			printf "\t\t{ %s, %s },\n", $3, $2 > "boolnames"
		}
$4 == "number"	{
			printf "\t\t{ %s, %s },\n", $3, $2 > "numnames"
		}

$4 == "str"	{
			if ($2 == "\"bel\"")
				printf "\t\t{ %s, %s, \"^G\" },\n", $3, $2 > "strnames"
			else if ($2 == "\"cr\"")
				printf "\t\t{ %s, %s, \"\\r\" },\n", $3, $2 > "strnames"
			else if ($2 == "\"cud1\"")
				printf "\t\t{ %s, %s, \"\\n\" },\n", $3, $2 > "strnames"
			else if ($2 == "\"cub1\"")
				printf "\t\t{ %s, %s, \"\\b\" },\n", $3, $2 > "strnames"
			else if ($2 == "\"ind\"")
				printf "\t\t{ %s, %s, \"\\n\" },\n", $3, $2 > "strnames"
			else
				printf "\t\t{ %s, %s, ((char *)0) },\n", $3, $2 > "strnames"
		}

END		{
			print  "};\n" > "boolnames"
			print "#define\tMAXBOOLS\tMAXINDEX(boolcaps)" > "boolnames"
			print  "};\n" > "numnames"
			print "#define\tMAXNUMS\tMAXINDEX(numcaps)" > "numnames"
			print  "};" > "strnames"
			print "\n#define\tMAXSTRS\tMAXINDEX(strcaps)\n" > "strnames"
		}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.