~ubuntu-branches/debian/sid/ncurses/sid-200908151531

« back to all changes in this revision

Viewing changes to ncurses/base/MKkeyname.awk

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2008-11-05 21:34:00 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20081105213400-7d9r3jj2ngz18k24
Tags: 5.7-1
* Merging upstream version 5.7.
* Updating soname and sodepver to 5.7 in rules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# $Id: MKkeyname.awk,v 1.43 2009/05/09 19:01:49 tom Exp $
 
1
# $Id: MKkeyname.awk,v 1.40 2008/07/12 18:40:00 tom Exp $
2
2
##############################################################################
3
 
# Copyright (c) 1999-2008,2009 Free Software Foundation, Inc.                #
 
3
# Copyright (c) 1999-2007,2008 Free Software Foundation, Inc.                #
4
4
#                                                                            #
5
5
# Permission is hereby granted, free of charge, to any person obtaining a    #
6
6
# copy of this software and associated documentation files (the "Software"), #
67
67
        print "#define SIZEOF_TABLE 256"
68
68
        print "#define MyTable _nc_globals.keyname_table"
69
69
        print ""
70
 
        print "NCURSES_EXPORT(NCURSES_CONST char *)"
71
 
        print "safe_keyname (SCREEN *sp, int c)"
 
70
        print "NCURSES_EXPORT(NCURSES_CONST char *) _nc_keyname (SCREEN *sp, int c)"
72
71
        print "{"
73
72
        print " int i;"
74
73
        print " char name[20];"
117
116
        print "                         result = MyTable[c];"
118
117
        print "                 }"
119
118
        print "#if NCURSES_EXT_FUNCS && NCURSES_XNAMES"
120
 
        print "         } else if (result == 0 && HasTerminal(sp)) {"
 
119
        print "         } else if (result == 0 && cur_term != 0) {"
121
120
        print "                 int j, k;"
122
121
        print "                 char * bound;"
123
 
        print "                 TERMTYPE *tp = &(TerminalOf(sp)->type);"
 
122
        print "                 TERMTYPE *tp = &(cur_term->type);"
124
123
        print "                 int save_trace = _nc_tracing;"
125
124
        print ""
126
125
        print "                 _nc_tracing = 0;        /* prevent recursion via keybound() */"
127
 
        print "                 for (j = 0; (bound = NCURSES_SP_NAME(keybound)(NCURSES_SP_ARGx c, j)) != 0; ++j) {"
 
126
        print "                 for (j = 0; (bound = keybound(c, j)) != 0; ++j) {"
128
127
        print "                         for(k = STRCOUNT; k < (int) NUM_STRINGS(tp);  k++) {"
129
128
        print "                                 if (tp->Strings[k] != 0 && !strcmp(bound, tp->Strings[k])) {"
130
129
        print "                                         result = ExtStrname(tp, k, strnames);"
142
141
        print " return result;"
143
142
        print "}"
144
143
        print ""
145
 
        print "NCURSES_EXPORT(NCURSES_CONST char *)"
146
 
        print "keyname (int c)"
 
144
        print "NCURSES_EXPORT(NCURSES_CONST char *) keyname (int c)"
147
145
        print "{"
148
 
        print " return safe_keyname (CURRENT_SCREEN, c);"
 
146
        print "\treturn _nc_keyname(SP, c);"
149
147
        print "}"
150
148
        print ""
151
149
        print "#if NO_LEAKS"