4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 1997 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 /* Copyright (c) 1988 AT&T */
28 /* All Rights Reserved */
31 * University Copyright- Copyright (c) 1982, 1986, 1988
32 * The Regents of the University of California
35 * University Acknowledgment- Portions of this document are derived from
36 * software developed by the University of California, Berkeley, and its
40 #pragma ident "%Z%%M% %I% %E% SMI"
45 #include <sys/types.h>
46 #include "curses_inc.h"
49 * When the keyboard can send more than eight bits, offsets array
50 * should be changed from chars to shorts.
51 * The offsets MUST match what is in curses.h.
54 static unsigned char offsets
[][2] = {
55 { '`', '*' }, /* ACS_DIAMOND */
56 { 'a', ':' }, /* ACS_CKBOARD */
57 { 'f', '\'' }, /* ACS_DEGREE */
58 { 'g', '#' }, /* ACS_PLMINUS */
59 { 'o', '-' }, /* ACS_S1 */
60 { 'q', '-' }, /* ACS_HLINE */
61 { 's', '_' }, /* ACS_S9 */
62 { 'x', '|' }, /* ACS_VLINE */
63 { '~', 'o' }, /* ACS_BULLET */
64 { ',', '<' }, /* ACS_LARROW */
65 { '+', '>' }, /* ACS_RARROW */
66 { '.', 'v' }, /* ACS_DARROW */
67 { '-', '^' }, /* ACS_UARROW */
68 { 'h', '#' }, /* ACS_BOARD */
69 { 'i', '#' }, /* ACS_LANTERN */
70 { '0', '#' }, /* ACS_BLOCK */
78 int i
= sizeof (offsets
) / 2, to_get
, must_output
;
80 #ifdef _VR3_COMPAT_CODE
81 if ((nacsmap
= cur_term
->_acs32map
= (chtype
*)
82 malloc(sizeof (chtype
) * 0400)) == NULL
)
83 #else /* _VR3_COMPAT_CODE */
84 if ((nacsmap
= cur_term
->_acsmap
= (chtype
*)
85 malloc(sizeof (chtype
) * 0400)) == NULL
)
86 #endif /* _VR3_COMPAT_CODE */
88 #ifdef _VR3_COMPAT_CODE
90 #endif /* _VR3_COMPAT_CODE */
91 term_errno
= TERM_BAD_MALLOC
;
93 strcpy(term_parm_err
, "init_acs");
98 /* Default acs chars for regular ASCII terminals are plus signs. */
100 memSset(nacsmap
, (chtype
) '+', 0400);
103 * Now load in defaults for some of the characters which have close
104 * approximations in the normal ascii set.
108 nacsmap
[offsets
[i
][0]] = offsets
[i
][1];
110 /* Now do mapping for terminals own ACS, if any */
112 if ((cp
= acs_chars
) != 0)
114 to_get
= *cp
++; /* to get this ... */
115 must_output
= *cp
++; /* must output this ... */
118 fprintf(outf
, "acs %d, was %d, now %d\n",
119 to_get
, nacsmap
[to_get
], must_output
);
121 nacsmap
[to_get
] = ( must_output
& 0xFF ) | A_ALTCHARSET
;
126 #ifdef _VR3_COMPAT_CODE
130 if ((n16acsmap
= cur_term
->_acsmap
= (_ochtype
*)
131 malloc(sizeof (_ochtype
) * 0400)) == NULL
) {
135 for (i
= 0; i
< 0400; i
++)
137 n16acsmap
[i
] = _TO_OCHTYPE(nacsmap
[i
]);
141 #endif /* _VR3_COMPAT_CODE */