]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/MKkeyname.awk
ncurses 5.6 - patch 20080531
[ncurses.git] / ncurses / base / MKkeyname.awk
index 64bbef461eb6ef7b08f5d1e14a10984b3dbce897..5711fb85dd442515e5c64d3412be44f84db4b024 100644 (file)
@@ -1,6 +1,6 @@
-# $Id: MKkeyname.awk,v 1.37 2007/07/28 21:47:21 tom Exp $
+# $Id: MKkeyname.awk,v 1.39 2008/05/31 19:54:58 tom Exp $
 ##############################################################################
-# Copyright (c) 1999-2006,2007 Free Software Foundation, Inc.                #
+# Copyright (c) 1999-2007,2008 Free Software Foundation, Inc.                #
 #                                                                            #
 # Permission is hereby granted, free of charge, to any person obtaining a    #
 # copy of this software and associated documentation files (the "Software"), #
@@ -39,7 +39,7 @@ BEGIN {
 /^[^#]/ {
                if (bigstrings) {
                        if (first)  {
-                               print "struct kn { int offset; int code; };"
+                               print "struct kn { short offset; int code; };"
                                print "static const struct kn _nc_key_names[] = {"
                        }
                        printf "\t{ %d, %s },\n", offset, $1
@@ -67,7 +67,7 @@ END {
        print "#define SIZEOF_TABLE 256"
        print "#define MyTable _nc_globals.keyname_table"
        print ""
-       print "NCURSES_EXPORT(NCURSES_CONST char *) keyname (int c)"
+       print "NCURSES_EXPORT(NCURSES_CONST char *) _nc_keyname (SCREEN *sp, int c)"
        print "{"
        print " int i;"
        print " char name[20];"
@@ -100,7 +100,7 @@ END {
        print "                         if (MyTable[c] == 0) {"
        print "                                 int cc = c;"
        print "                                 p = name;"
-       print "                                 if (cc >= 128 && (SP == 0 || SP->_use_meta)) {"
+       print "                                 if (cc >= 128 && (sp == 0 || sp->_use_meta)) {"
        print "                                         strcpy(p, \"M-\");"
        print "                                         p += 2;"
        print "                                         cc -= 128;"
@@ -141,6 +141,11 @@ END {
        print " return result;"
        print "}"
        print ""
+       print "NCURSES_EXPORT(NCURSES_CONST char *) keyname (int c)"
+       print "{"
+       print "\treturn _nc_keyname(SP, c);"
+       print "}"
+       print ""
        print "#if NO_LEAKS"
        print "void _nc_keyname_leaks(void)"
        print "{"