Annotation of coherent/g/usr/lib/ncurses/MKinfo.awk, revision 1.1.1.1

1.1       root        1: #
                      2: # Generate putinfo.c
                      3: # 10-23-92. Vlad.
                      4: #
                      5: BEGIN  {
                      6:                print "/*" > "boolnames"
                      7:                print " * putinfo.c" > "boolnames"
                      8:                print " * This file is generated by MKinfo.awk." > "boolnames"
                      9:                print " * Do not make any changes directly to this file" > "boolnames"
                     10:                print " */" > "boolnames"
                     11:                print "#include <stdio.h>" > "boolnames"
                     12:                print "#include <string.h>" > "boolnames"
                     13:                print "#include <ctype.h>" > "boolnames"
                     14:                print ""  > "boolnames"
                     15:                print "#define  bool    char"  > "boolnames"
                     16:                print "#define  TRUE    1" > "boolnames"        
                     17:                print "#define  FALSE   0" > "boolnames"
                     18:                print "" > "boolnames"
                     19:                print "#define\tMAXINDEX(array) (sizeof(array)/sizeof(array[0]))" > "boolnames"
                     20:                print "" > "boolnames"
                     21:                print "/*" > "boolnames"
                     22:                print " * bools and boolcaps;" > "boolnames"
                     23:                print " * lookup translate table for boolean fields." > "boolnames"
                     24:                print " */\n" > "boolnames"
                     25:                print "struct bools {" > "boolnames"
                     26:                print "\tchar\t*capname;\t/* termcap name */" > "boolnames"
                     27:                print "\tchar\t*infoname;\t/* terminfo name */" > "boolnames"
                     28:                print "};\n" > "boolnames"
                     29:                print "struct bools\tboolcaps[] = {" > "boolnames"
                     30:                print  "\n/*" > "numnames"
                     31:                print  " * nums and numcaps;" > "numnames"
                     32:                print  " * lookuptranslate table for numeric capabilities." > "numnames"
                     33:                print  " */" > "numnames"
                     34:                print "struct nums {" > "numnames"
                     35:                print "\tchar\t*capname;\t/* termcap name */" > "numnames"
                     36:                print "\tchar\t*infoname;\t/* terminfo name */" > "numnames"
                     37:                print "};\n" > "numnames"
                     38:                print "struct nums\tnumcaps[] = {" > "numnames"
                     39:                print  "\n/*" > "strnames"
                     40:                print  " * sts and strcaps;" > "strnames"
                     41:                print  " * lookuptranslate table for string capabilities." > "strnames"
                     42:                print  " */" > "strnames"
                     43:                print "struct strs {" > "strnames"
                     44:                print "\tchar\t*capname;\t/* termcap name */" > "strnames"
                     45:                print "\tchar\t*infoname;\t/* terminfo name */" > "strnames"
                     46:                print "\tchar\t*dflt;\t\t/* default value */" > "strnames"
                     47:                print "};\n" > "strnames"
                     48:                print "struct strs\tstrcaps[] = {" > "strnames"
                     49:        }
                     50: 
                     51: $4 == "bool"   {
                     52:                        printf "\t\t{ %s, %s },\n", $3, $2 > "boolnames"
                     53:                }
                     54: $4 == "number" {
                     55:                        printf "\t\t{ %s, %s },\n", $3, $2 > "numnames"
                     56:                }
                     57: 
                     58: $4 == "str"    {
                     59:                        if ($2 == "\"bel\"")
                     60:                                printf "\t\t{ %s, %s, \"^G\" },\n", $3, $2 > "strnames"
                     61:                        else if ($2 == "\"cr\"")
                     62:                                printf "\t\t{ %s, %s, \"\\r\" },\n", $3, $2 > "strnames"
                     63:                        else if ($2 == "\"cud1\"")
                     64:                                printf "\t\t{ %s, %s, \"\\n\" },\n", $3, $2 > "strnames"
                     65:                        else if ($2 == "\"cub1\"")
                     66:                                printf "\t\t{ %s, %s, \"\\b\" },\n", $3, $2 > "strnames"
                     67:                        else if ($2 == "\"ind\"")
                     68:                                printf "\t\t{ %s, %s, \"\\n\" },\n", $3, $2 > "strnames"
                     69:                        else
                     70:                                printf "\t\t{ %s, %s, ((char *)0) },\n", $3, $2 > "strnames"
                     71:                }
                     72: 
                     73: END            {
                     74:                        print  "};\n" > "boolnames"
                     75:                        print "#define\tMAXBOOLS\tMAXINDEX(boolcaps)" > "boolnames"
                     76:                        print  "};\n" > "numnames"
                     77:                        print "#define\tMAXNUMS\tMAXINDEX(numcaps)" > "numnames"
                     78:                        print  "};" > "strnames"
                     79:                        print "\n#define\tMAXSTRS\tMAXINDEX(strcaps)\n" > "strnames"
                     80:                }

unix.superglobalmegacorp.com

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