]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 5.6 - patch 20070612
authorThomas E. Dickey <dickey@invisible-island.net>
Tue, 12 Jun 2007 23:12:17 +0000 (23:12 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Tue, 12 Jun 2007 23:12:17 +0000 (23:12 +0000)
+ corrected xterm+pcf2 terminfo modifiers for F1-F4, to match xterm
  #226 -TD
+ split-out key_name() from MKkeyname.awk since it now depends upon
  wunctrl() which is not in libtinfo (report by Rong-En Fan).

MANIFEST
NEWS
dist.mk
misc/terminfo.src
ncurses/base/MKkeyname.awk
ncurses/modules
ncurses/widechar/lib_key_name.c [new file with mode: 0644]
ncurses/widechar/lib_wunctrl.c

index 3861a53c16720b88eab0f6c2f7fbae401cba10bb..3e3ec427a20833cfcb294dfa648020702d381fed 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
 ./ncurses/widechar/lib_in_wchnstr.c
 ./ncurses/widechar/lib_ins_wch.c
 ./ncurses/widechar/lib_inwstr.c
 ./ncurses/widechar/lib_in_wchnstr.c
 ./ncurses/widechar/lib_ins_wch.c
 ./ncurses/widechar/lib_inwstr.c
+./ncurses/widechar/lib_key_name.c
 ./ncurses/widechar/lib_pecho_wchar.c
 ./ncurses/widechar/lib_slk_wset.c
 ./ncurses/widechar/lib_unget_wch.c
 ./ncurses/widechar/lib_pecho_wchar.c
 ./ncurses/widechar/lib_slk_wset.c
 ./ncurses/widechar/lib_unget_wch.c
diff --git a/NEWS b/NEWS
index 4d4a20e430cf4369e781a7a21bc70011f5129fc7..887a56c02bc42ee784d6b4327986d40a1eee7827 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.1134 2007/06/09 22:47:59 tom Exp $
+-- $Id: NEWS,v 1.1137 2007/06/12 20:37:41 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,12 @@ See the AUTHORS file for the corresponding full names.
 Changes through 1.9.9e did not credit all contributions;
 it is not possible to add this information.
 
 Changes through 1.9.9e did not credit all contributions;
 it is not possible to add this information.
 
+20070612
+       + corrected xterm+pcf2 terminfo modifiers for F1-F4, to match xterm
+         #226 -TD
+       + split-out key_name() from MKkeyname.awk since it now depends upon
+         wunctrl() which is not in libtinfo (report by Rong-En Fan).
+
 20070609
        + add test/key_name.c
        + add stdscr cases to test/inchs.c and test_inch_wide.c
 20070609
        + add test/key_name.c
        + add stdscr cases to test/inchs.c and test_inch_wide.c
diff --git a/dist.mk b/dist.mk
index d9427353a335c02d3836de470d82285aec953a40..3e01cad88a8171355eb23fc87408ef843c9d4c32 100644 (file)
--- a/dist.mk
+++ b/dist.mk
@@ -25,7 +25,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: dist.mk,v 1.596 2007/06/09 16:13:09 tom Exp $
+# $Id: dist.mk,v 1.597 2007/06/12 20:17:22 tom Exp $
 # Makefile for creating ncurses distributions.
 #
 # This only needs to be used directly as a makefile by developers, but
 # Makefile for creating ncurses distributions.
 #
 # This only needs to be used directly as a makefile by developers, but
@@ -37,7 +37,7 @@ SHELL = /bin/sh
 # These define the major/minor/patch versions of ncurses.
 NCURSES_MAJOR = 5
 NCURSES_MINOR = 6
 # These define the major/minor/patch versions of ncurses.
 NCURSES_MAJOR = 5
 NCURSES_MINOR = 6
-NCURSES_PATCH = 20070609
+NCURSES_PATCH = 20070612
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index b414640cf1cbb093508f73eca5b656d54776f355..738bdbb48ee2974cee02e76b785b70c553a2bcf6 100644 (file)
@@ -6,8 +6,8 @@
 # Report bugs and new terminal descriptions to
 #      bug-ncurses@gnu.org
 #
 # Report bugs and new terminal descriptions to
 #      bug-ncurses@gnu.org
 #
-#      $Revision: 1.303 $
-#      $Date: 2006/10/07 17:52:03 $
+#      $Revision: 1.305 $
+#      $Date: 2007/06/10 13:33:54 $
 #
 # The original header is preserved below for reference.  It is noted that there
 # is a "newer" version which differs in some cosmetic details (but actually
 #
 # The original header is preserved below for reference.  It is noted that there
 # is a "newer" version which differs in some cosmetic details (but actually
@@ -3101,24 +3101,25 @@ xterm+pcf0|fragment with modifyFunctionKeys:0,
        kf59=\E[23;3~, kf6=\E[17~, kf60=\E[24;3~, kf61=\EO4P,
        kf62=\EO4Q, kf63=\EO4R, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
 #
        kf59=\E[23;3~, kf6=\E[17~, kf60=\E[24;3~, kf61=\EO4P,
        kf62=\EO4Q, kf63=\EO4R, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
 #
-xterm+pcf2|fragment with modifyFunctionKeys:0,
+xterm+pcf2|fragment with modifyFunctionKeys:2,
        kf1=\EOP, kf10=\E[21~, kf11=\E[23~, kf12=\E[24~,
        kf1=\EOP, kf10=\E[21~, kf11=\E[23~, kf12=\E[24~,
-       kf13=\E[2P, kf14=\E[2Q, kf15=\E[2R, kf16=\E[2S,
+       kf13=\E[1;2P, kf14=\E[1;2Q, kf15=\E[1;2R, kf16=\E[1;2S,
        kf17=\E[15;2~, kf18=\E[17;2~, kf19=\E[18;2~, kf2=\EOQ,
        kf20=\E[19;2~, kf21=\E[20;2~, kf22=\E[21;2~,
        kf17=\E[15;2~, kf18=\E[17;2~, kf19=\E[18;2~, kf2=\EOQ,
        kf20=\E[19;2~, kf21=\E[20;2~, kf22=\E[21;2~,
-       kf23=\E[23;2~, kf24=\E[24;2~, kf25=\E[5P, kf26=\E[5Q,
-       kf27=\E[5R, kf28=\E[5S, kf29=\E[15;5~, kf3=\EOR,
+       kf23=\E[23;2~, kf24=\E[24;2~, kf25=\E[1;5P, kf26=\E[1;5Q,
+       kf27=\E[1;5R, kf28=\E[1;5S, kf29=\E[15;5~, kf3=\EOR,
        kf30=\E[17;5~, kf31=\E[18;5~, kf32=\E[19;5~,
        kf33=\E[20;5~, kf34=\E[21;5~, kf35=\E[23;5~,
        kf30=\E[17;5~, kf31=\E[18;5~, kf32=\E[19;5~,
        kf33=\E[20;5~, kf34=\E[21;5~, kf35=\E[23;5~,
-       kf36=\E[24;5~, kf37=\E[6P, kf38=\E[6Q, kf39=\E[6R,
-       kf4=\EOS, kf40=\E[6S, kf41=\E[15;6~, kf42=\E[17;6~,
+       kf36=\E[24;5~, kf37=\E[1;6P, kf38=\E[1;6Q, kf39=\E[1;6R,
+       kf4=\EOS, kf40=\E[1;6S, kf41=\E[15;6~, kf42=\E[17;6~,
        kf43=\E[18;6~, kf44=\E[19;6~, kf45=\E[20;6~,
        kf43=\E[18;6~, kf44=\E[19;6~, kf45=\E[20;6~,
-       kf46=\E[21;6~, kf47=\E[23;6~, kf48=\E[24;6~, kf49=\E[3P,
-       kf5=\E[15~, kf50=\E[3Q, kf51=\E[3R, kf52=\E[3S,
-       kf53=\E[15;3~, kf54=\E[17;3~, kf55=\E[18;3~,
-       kf56=\E[19;3~, kf57=\E[20;3~, kf58=\E[21;3~,
-       kf59=\E[23;3~, kf6=\E[17~, kf60=\E[24;3~, kf61=\E[4P,
-       kf62=\E[4Q, kf63=\E[4R, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
+       kf46=\E[21;6~, kf47=\E[23;6~, kf48=\E[24;6~,
+       kf49=\E[1;3P, kf5=\E[15~, kf50=\E[1;3Q, kf51=\E[1;3R,
+       kf52=\E[1;3S, kf53=\E[15;3~, kf54=\E[17;3~,
+       kf55=\E[18;3~, kf56=\E[19;3~, kf57=\E[20;3~,
+       kf58=\E[21;3~, kf59=\E[23;3~, kf6=\E[17~, kf60=\E[24;3~,
+       kf61=\E[1;4P, kf62=\E[1;4Q, kf63=\E[1;4R, kf7=\E[18~,
+       kf8=\E[19~, kf9=\E[20~,
 #
 # This chunk is used for building the VT220/Sun/PC keyboard variants.
 xterm-basic|modern xterm terminal emulator - common,
 #
 # This chunk is used for building the VT220/Sun/PC keyboard variants.
 xterm-basic|modern xterm terminal emulator - common,
@@ -15207,40 +15208,33 @@ ncr7901|ncr 7901 model,
 # recognized:  if you type in "ESC !", the next (third) character is not
 # echoed, showing that the terminal was actually waiting for a parameter!
 ndr9500|nd9500|Newbury Data 9500,
 # recognized:  if you type in "ESC !", the next (third) character is not
 # echoed, showing that the terminal was actually waiting for a parameter!
 ndr9500|nd9500|Newbury Data 9500,
-       xon, hs, am, bw, ul, mir, msgr, mc5i,
+       am, bw, hs, mc5i, mir, msgr, ul, xon,
        cols#80, lines#24, wsl#79,
        cols#80, lines#24, wsl#79,
-       is2=\Ew\E'\EDF\El\Er\EO,
-       civis=\E.0, cnorm=\E.1,
-       bel=^G, flash=\Eb$<50/>\Ed, cr=^M, nel=^_,
-       ht=^I, cbt=\EI, hts=\E1, tbc=\E3,
-       clear=\E;, el=\ET, ed=\EY,
-       cud1=^V, cub1=^H, cuf1=^L, cuu1=^K, home=^^,
-       ind=^j, ri=\Ej,
-       cup=\E=%p1%{32}%+%c%p2%{32}%+%c,
-       dch1=\EW, dl1=\ER,
-       ich1=\EQ, il1=\EE,
-       el=\ET, ed=\EY,
-       dim=\E), prot=\E),
-       smso=\E), rmso=\E(,
-       smacs=\E$, rmacs=\E%%, acsc=qKnImAjDwNuLtMvOlBkCxJ,
-       sgr0=\EG0\E%%\E(,
+       acsc=qKnImAjDwNuLtMvOlBkCxJ, bel=^G, cbt=\EI, civis=\E.0,
+       clear=\E;, cnorm=\E.1, cr=^M, cub1=^H, cud1=^V, cuf1=^L,
+       cup=\E=%p1%{32}%+%c%p2%{32}%+%c, cuu1=^K, dch1=\EW,
+       dim=\E), dl1=\ER, dsl=\Eh, ed=\EY, el=\ET,
+       flash=\Eb$<50/>\Ed, fsl=^M, home=^^, ht=^I, hts=\E1,
+       ich1=\EQ, il1=\EE, ind=^J, is2=\Ew\E'\EDF\El\Er\EO,
+       kDC=\Er, kDL=\EO, kEOL=\Et, kIC=\Eq, kcbt=\EI, kclr=^Z,
+       kcub1=^H, kcud1=^V, kcuf1=^L, kcuu1=^K, kdch1=\EW, kdl1=\ER,
+       ked=\EY, kel=\ET, kent=^M, kf1=^A@\r, kf10=^AI\r, kf11=^AJ\r,
+       kf12=^A`\r, kf13=^Aa\r, kf14=^Ab\r, kf15=^Ac\r, kf16=^Ad\r,
+       kf17=^Ae\r, kf18=^Af\r, kf19=^Ag\r, kf2=^AA\r, kf20=^Ah\r,
+       kf21=^Ai\r, kf22=^Aj\r, kf3=^AB\r, kf4=^AC\r, kf5=^AD\r,
+       kf6=^AE\r, kf7=^AF\r, kf8=^AG\r, kf9=^AH\r, khome=^^,
+       kich1=\EQ, kil1=\EE, kprt=\EP, mc4=\Ea, mc5=\E`, nel=^_,
+       pfloc=\E|%{48}%p1%+%c2%p2\031,
+       pfx=\E|%{48}%p1%+%c1%p2\031, prot=\E), ri=\Ej,
+       rmacs=\E%%, rmir=\Er, rmso=\E(, rmxon=^N,
        sgr=\E%%\E(%?%p1%p5%p8%|%|%t\E)%;%?%p9%t\E$%;,
        sgr=\E%%\E(%?%p1%p5%p8%|%|%t\E)%;%?%p9%t\E$%;,
-       smir=\Eq, rmir=\Er,
-       smxon=^O, rmxon=^N,
-       dsl=\Eh, fsl=\r, tsl=\Eg\Ef^I%p1%{32}%+%c,
-       mc5=\E`, mc4=\Ea,
-       kcud1=^V, kcub1=^H, kcuf1=^L, kcuu1=^K,
-       kcbt=\EI,
-       .kbs=^H, kclr=^Z, kel=\ET, ked=\EY,
-                         kEOL=\Et,
-       kdch1=\EW, kdl1=\ER, kich1=\EQ, kil1=\EE,
-       kDC=\Er,   kDL=\EO,  kIC=\Eq,
-       kent=^M, khome=^^, kprt=\EP,
-       kf1=^A@\r, kf2=^AA\r, kf3=^AB\r, kf4=^AC\r, kf5=^AD\r, kf6=^AE\r, kf7=^AF\r, kf8=^AG\r, kf9=^AH\r, kf10=^AI\r, kf11=^AJ\r, kf12=^A`\r, kf13=^Aa\r, kf14=^Ab\r, kf15=^Ac\r, kf16=^Ad\r, kf17=^Ae\r, kf18=^Af\r, kf19=^Ag\r, kf20=^Ah\r, kf21=^Ai\r, kf22=^Aj\r,
-       pkey_local=\E|%{48}%p1%+%c2%p2^Y, pkey_xmit=\E|%{48}%p1%+%c1%p2^Y,
+       sgr0=\EG0\E%%\E(, smacs=\E$, smir=\Eq, smso=\E), smxon=^O,
+       tbc=\E3, tsl=\Eg\Ef\011%p1%{32}%+%c, .kbs=^H,
 
 ndr9500-nl|NDR 9500 with no status line,
 
 ndr9500-nl|NDR 9500 with no status line,
-       hs@, wsl@, dsl@, fsl@, tsl@, use=ndr9500,
+       hs@,
+       wsl@,
+       dsl@, fsl@, tsl@, use=ndr9500,
 
 ndr9500-25|NDR 9500 with 25th line enabled,
        lines#25, use=ndr9500,
 
 ndr9500-25|NDR 9500 with 25th line enabled,
        lines#25, use=ndr9500,
@@ -15251,16 +15245,17 @@ ndr9500-25-nl|NDR 9500 with 25 lines and no status line,
 ndr9500-mc|NDR 9500 with magic cookies (enables underline inverse video invisible and blink),
        msgr@,
        xmc#1,
 ndr9500-mc|NDR 9500 with magic cookies (enables underline inverse video invisible and blink),
        msgr@,
        xmc#1,
-       blink=\EG2, rev=\EG4, invis=\EG1, smul=\EG8, rmul=\EG0, smso=\EG4, rmso=\EG0,
-       sgr0=\EG0\E%%\E(,
+       blink=\EG2, invis=\EG1, rev=\EG4, rmso=\EG0, rmul=\EG0,
        sgr=\E%%\E(%?%p5%p8%|%t\E)%;%?%p9%t\E$%;\EG%{48}%?%p7%t%{1}%+%;%?%p4%t%{2}%+%;%?%p3%p1%|%t%{4}%+%;%?%p2%t%{8}%+%;%c,
        sgr=\E%%\E(%?%p5%p8%|%t\E)%;%?%p9%t\E$%;\EG%{48}%?%p7%t%{1}%+%;%?%p4%t%{2}%+%;%?%p3%p1%|%t%{4}%+%;%?%p2%t%{8}%+%;%c,
-       use=ndr9500,
+       sgr0=\EG0\E%%\E(, smso=\EG4, smul=\EG8, use=ndr9500,
 
 ndr9500-25-mc|NDR 500 with 25 lines and magic cookies,
        lines#25, use=ndr9500-mc,
 
 ndr9500-mc-nl|NDR 9500 with magic cookies and no status line,
 
 ndr9500-25-mc|NDR 500 with 25 lines and magic cookies,
        lines#25, use=ndr9500-mc,
 
 ndr9500-mc-nl|NDR 9500 with magic cookies and no status line,
-       hs@, wsl@, dsl@, fsl@, tsl@, use=ndr9500-mc,
+       hs@,
+       wsl@,
+       dsl@, fsl@, tsl@, use=ndr9500-mc,
 
 ndr9500-25-mc-nl|NDR 9500 with 25 lines and magic cookies and no status line,
        lines#25, use=ndr9500-mc-nl,
 
 ndr9500-25-mc-nl|NDR 9500 with 25 lines and magic cookies and no status line,
        lines#25, use=ndr9500-mc-nl,
@@ -21394,6 +21389,9 @@ v3220|LANPAR Vision II model 3220/3221/3222,
 # 2007-03-03
 #      * add Newbury Data entries (Jean-Charles Billaud).
 #
 # 2007-03-03
 #      * add Newbury Data entries (Jean-Charles Billaud).
 #
+# 2007-06-10
+#      * corrected xterm+pcf2 modifiers for F1-F4, match xterm #226 -TD
+#
 # The following sets edit modes for GNU EMACS.
 # Local Variables:
 # fill-prefix:"\t"
 # The following sets edit modes for GNU EMACS.
 # Local Variables:
 # fill-prefix:"\t"
index 760e1b58aba359ba3bf6894480c8f5e286ff42a6..1c2a0760b747cbb16ffc365b4135dfea28529c9d 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: MKkeyname.awk,v 1.35 2007/06/09 22:36:10 tom Exp $
+# $Id: MKkeyname.awk,v 1.36 2007/06/12 20:28:18 tom Exp $
 ##############################################################################
 # Copyright (c) 1999-2006,2007 Free Software Foundation, Inc.                #
 #                                                                            #
 ##############################################################################
 # Copyright (c) 1999-2006,2007 Free Software Foundation, Inc.                #
 #                                                                            #
@@ -115,31 +115,6 @@ END {
        print " return result;"
        print "}"
        print ""
        print " return result;"
        print "}"
        print ""
-       print "#if USE_WIDEC_SUPPORT"
-       print "NCURSES_EXPORT(NCURSES_CONST char *) key_name (wchar_t c)"
-       print "{"
-       print " cchar_t my_cchar;"
-       print " wchar_t *my_wchars;"
-       print " size_t len;"
-       print ""
-       print " /* FIXME: move to _nc_globals */"
-       print " static char result[MB_LEN_MAX + 1];"
-       print ""
-       print " memset(&my_cchar, 0, sizeof(my_cchar));"
-       print " my_cchar.chars[0] = c;"
-       print " my_cchar.chars[1] = L'\\0';"
-       print ""
-       print " my_wchars = wunctrl(&my_cchar);"
-       print " len = wcstombs(result, my_wchars, sizeof(result)-1);"
-       print " if (isEILSEQ(len) || (len == 0)) {"
-       print "         return \"UNKNOWN KEY\";"
-       print " }"
-       print ""
-       print " result[len] = '\\0';"
-       print " return result;"
-       print "}"
-       print "#endif"
-       print ""
        print "#if NO_LEAKS"
        print "void _nc_keyname_leaks(void)"
        print "{"
        print "#if NO_LEAKS"
        print "void _nc_keyname_leaks(void)"
        print "{"
index 0168180ba22e17edfc5267092a1267230903f478..93bd348e382dce96960e3b08b327b728bcf20701 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: modules,v 1.109 2007/01/13 17:33:52 tom Exp $
+# $Id: modules,v 1.110 2007/06/12 20:21:42 tom Exp $
 ##############################################################################
 # Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.                #
 #                                                                            #
 ##############################################################################
 # Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.                #
 #                                                                            #
@@ -127,14 +127,15 @@ charable  lib             $(wide)
 lib_add_wch    lib             $(wide)
 lib_box_set    lib             $(wide)
 lib_cchar      lib             $(wide)
 lib_add_wch    lib             $(wide)
 lib_box_set    lib             $(wide)
 lib_cchar      lib             $(wide)
-lib_get_wch    lib             $(wide)
 lib_erasewchar lib             $(wide)
 lib_erasewchar lib             $(wide)
+lib_get_wch    lib             $(wide)
 lib_get_wstr   lib             $(wide)
 lib_hline_set  lib             $(wide)
 lib_in_wch     lib             $(wide)
 lib_in_wchnstr lib             $(wide)
 lib_ins_wch    lib             $(wide)
 lib_inwstr     lib             $(wide)
 lib_get_wstr   lib             $(wide)
 lib_hline_set  lib             $(wide)
 lib_in_wch     lib             $(wide)
 lib_in_wchnstr lib             $(wide)
 lib_ins_wch    lib             $(wide)
 lib_inwstr     lib             $(wide)
+lib_key_name   lib             $(wide)
 lib_pecho_wchar        lib             $(wide)
 lib_slk_wset   lib             $(wide)
 lib_unget_wch  lib             $(wide)
 lib_pecho_wchar        lib             $(wide)
 lib_slk_wset   lib             $(wide)
 lib_unget_wch  lib             $(wide)
diff --git a/ncurses/widechar/lib_key_name.c b/ncurses/widechar/lib_key_name.c
new file mode 100644 (file)
index 0000000..e24c965
--- /dev/null
@@ -0,0 +1,62 @@
+/****************************************************************************
+ * Copyright (c) 2007 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"), to deal in the Software without restriction, including      *
+ * without limitation the rights to use, copy, modify, merge, publish,      *
+ * distribute, distribute with modifications, sublicense, and/or sell       *
+ * copies of the Software, and to permit persons to whom the Software is    *
+ * furnished to do so, subject to the following conditions:                 *
+ *                                                                          *
+ * The above copyright notice and this permission notice shall be included  *
+ * in all copies or substantial portions of the Software.                   *
+ *                                                                          *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+ *                                                                          *
+ * Except as contained in this notice, the name(s) of the above copyright   *
+ * holders shall not be used in advertising or otherwise to promote the     *
+ * sale, use or other dealings in this Software without prior written       *
+ * authorization.                                                           *
+ ****************************************************************************/
+
+/*
+**     lib_key_name.c
+**
+**     The routine key_name().
+**
+*/
+
+#include <curses.priv.h>
+
+MODULE_ID("$Id: lib_key_name.c,v 1.2 2007/06/12 21:01:13 tom Exp $")
+
+NCURSES_EXPORT(NCURSES_CONST char *)
+key_name(wchar_t c)
+{
+    cchar_t my_cchar;
+    wchar_t *my_wchars;
+    size_t len;
+
+    /* FIXME: move to _nc_globals */
+    static char result[MB_LEN_MAX + 1];
+
+    memset(&my_cchar, 0, sizeof(my_cchar));
+    my_cchar.chars[0] = c;
+    my_cchar.chars[1] = L'\0';
+
+    my_wchars = wunctrl(&my_cchar);
+    len = wcstombs(result, my_wchars, sizeof(result) - 1);
+    if (isEILSEQ(len) || (len == 0)) {
+       return "UNKNOWN KEY";
+    }
+
+    result[len] = '\0';
+    return result;
+}
index e87085a6596a8f75a6389135fe9ef163cf0bf1eb..be2259acdcffda4cf49dca6f428673cfe173abd6 100644 (file)
@@ -35,9 +35,7 @@
 
 #include <curses.priv.h>
 
 
 #include <curses.priv.h>
 
-#if USE_WIDEC_SUPPORT
-
-MODULE_ID("$Id: lib_wunctrl.c,v 1.11 2007/06/09 22:44:30 tom Exp $")
+MODULE_ID("$Id: lib_wunctrl.c,v 1.12 2007/06/12 20:22:32 tom Exp $")
 
 NCURSES_EXPORT(wchar_t *)
 wunctrl(cchar_t *wc)
 
 NCURSES_EXPORT(wchar_t *)
 wunctrl(cchar_t *wc)
@@ -55,5 +53,3 @@ wunctrl(cchar_t *wc)
     } else
        return wc->chars;
 }
     } else
        return wc->chars;
 }
-
-#endif