Print this page
6117 Many small bugs prevent a clean build on SPARC
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/libcurses/screen/keyname.sh
+++ new/usr/src/lib/libcurses/screen/keyname.sh
1 1 #
2 2 # CDDL HEADER START
3 3 #
4 4 # The contents of this file are subject to the terms of the
5 5 # Common Development and Distribution License, Version 1.0 only
6 6 # (the "License"). You may not use this file except in compliance
7 7 # with the License.
8 8 #
9 9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 # or http://www.opensolaris.org/os/licensing.
11 11 # See the License for the specific language governing permissions
12 12 # and limitations under the License.
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
13 13 #
14 14 # When distributing Covered Code, include this CDDL HEADER in each
15 15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 # If applicable, add the following below this CDDL HEADER, with the
17 17 # fields enclosed by brackets "[]" replaced with your own identifying
18 18 # information: Portions Copyright [yyyy] [name of copyright owner]
19 19 #
20 20 # CDDL HEADER END
21 21 #
22 22 #
23 +# Copyright 2015 Gary Mills
23 24 # Copyright 1997 Sun Microsystems, Inc. All rights reserved.
24 25 # Use is subject to license terms.
25 26 #
26 27
27 28 #
28 29 # Copyright (c) 1988 AT&T
29 30 # All Rights Reserved
30 31 #
31 32
32 33 #
33 34 # University Copyright- Copyright (c) 1982, 1986, 1988
34 35 # The Regents of the University of California
35 36 # All Rights Reserved
36 37 #
37 38 # University Acknowledgment- Portions of this document are derived from
38 39 # software developed by the University of California, Berkeley, and its
39 40 # contributors.
40 41 #
41 42
42 -#ident "%Z%%M% %I% %E% SMI"
43 -
44 43 rm -f keyname.c
45 -/usr/bin/echo "#include \"curses_inc.h\"\n" > keyname.c
46 -/usr/bin/echo "static char *keystrings[] =\n\t\t{" >> keyname.c
44 +/usr/bin/print "#include \"curses_inc.h\"\n" > keyname.c
45 +/usr/bin/print "static char *keystrings[] =\n\t\t{" >> keyname.c
47 46 {
48 47 grep -v 'KEY_F(' keycaps | awk '{ print $5, $4 }' | sed -e 's/,//g' -e 's/KEY_//'
49 48 # These three aren't in keycaps
50 49 echo '0401 BREAK\n0530 SRESET\n0531 RESET'
51 50 } | sort -n | awk '
52 51 {
53 52 print "\t\t \"" $2 "\", /* " $1 " */"
54 53 }
55 54 ' >> keyname.c
56 55
57 56 LAST=`tail -1 keyname.c | awk -F'"' '{print $2}'`
58 57 cat << ! >> keyname.c
59 58 };
60 59
61 60 char *
62 61 keyname(int key)
63 62 {
64 63 static char buf[16];
65 64
66 65 if (key >= 0400) {
67 66 int i;
68 67
69 68 if ((key == 0400) || (key > KEY_${LAST}))
70 69 return ("UNKNOWN KEY");
71 70 if (key > 0507)
72 71 i = key - (0401 + ((0507 - 0410) + 1));
73 72 else
74 73 if (key >= 0410) {
75 74 (void) sprintf(buf, "KEY_F(%d)", key - 0410);
76 75 goto ret_buf;
77 76 } else
78 77 i = key - 0401;
79 78 (void) sprintf(buf, "KEY_%s", keystrings[i]);
80 79 goto ret_buf;
81 80 }
82 81
83 82 if (key >= 0200) {
84 83 #ifdef SYSV
85 84 if (SHELLTTYS.c_cflag & CS8)
86 85 #else /* SYSV */
87 86 if (SHELLTTY.c_cflag & CS8)
88 87 #endif /* SYSV */
89 88 (void) sprintf(buf, "%c", key);
90 89 else
91 90 (void) sprintf(buf, "M-%s", unctrl(key & 0177));
92 91 goto ret_buf;
93 92 }
94 93
95 94 if (key < 0) {
96 95 (void) sprintf(buf, "%d", key);
97 96 ret_buf:
98 97 return (buf);
99 98 }
100 99
101 100 return (unctrl(key));
102 101 }
103 102 !
104 103 exit 0
↓ open down ↓ |
48 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX