2 /***************************************************************************
4 ****************************************************************************
5 * ncurses is copyright (C) 1992-1995 *
7 * zmbenhal@netcom.com *
9 * esr@snark.thyrsus.com *
11 * Permission is hereby granted to reproduce and distribute ncurses *
12 * by any means and for any fee, whether alone or as part of a *
13 * larger distribution, in source or in binary form, PROVIDED *
14 * this notice is included with any such distribution, and is not *
15 * removed from any of its header files. Mention of ncurses in any *
16 * applications linked with it is highly appreciated. *
18 * ncurses comes AS IS with no warranty, implied or expressed. *
20 ***************************************************************************/
24 #include <curses.priv.h>
25 #include <term.h> /* ena_acs, acs_chars */
27 MODULE_ID("$Id: lib_acs.c,v 1.8 1997/04/24 11:04:07 tom Exp $")
33 T(("initializing ACS map"));
36 * Initializations for a UNIX-like multi-terminal environment. Use
37 * ASCII chars and count on the terminfo description to do better.
39 ACS_ULCORNER = '+'; /* should be upper left corner */
40 ACS_LLCORNER = '+'; /* should be lower left corner */
41 ACS_URCORNER = '+'; /* should be upper right corner */
42 ACS_LRCORNER = '+'; /* should be lower right corner */
43 ACS_RTEE = '+'; /* should be tee pointing left */
44 ACS_LTEE = '+'; /* should be tee pointing right */
45 ACS_BTEE = '+'; /* should be tee pointing up */
46 ACS_TTEE = '+'; /* should be tee pointing down */
47 ACS_HLINE = '-'; /* should be horizontal line */
48 ACS_VLINE = '|'; /* should be vertical line */
49 ACS_PLUS = '+'; /* should be large plus or crossover */
50 ACS_S1 = '~'; /* should be scan line 1 */
51 ACS_S9 = '_'; /* should be scan line 9 */
52 ACS_DIAMOND = '+'; /* should be diamond */
53 ACS_CKBOARD = ':'; /* should be checker board (stipple) */
54 ACS_DEGREE = '\''; /* should be degree symbol */
55 ACS_PLMINUS = '#'; /* should be plus/minus */
56 ACS_BULLET = 'o'; /* should be bullet */
57 ACS_LARROW = '<'; /* should be arrow pointing left */
58 ACS_RARROW = '>'; /* should be arrow pointing right */
59 ACS_DARROW = 'v'; /* should be arrow pointing down */
60 ACS_UARROW = '^'; /* should be arrow pointing up */
61 ACS_BOARD = '#'; /* should be board of squares */
62 ACS_LANTERN = '#'; /* should be lantern symbol */
63 ACS_BLOCK = '#'; /* should be solid square block */
64 /* these defaults were invented for ncurses */
65 ACS_S3 = '-'; /* should be scan line 3 */
66 ACS_S7 = '-'; /* should be scan line 7 */
67 ACS_LEQUAL = '<'; /* should be less-than-or-equal-to */
68 ACS_GEQUAL = '>'; /* should be greater-than-or-equal-to */
69 ACS_PI = '*'; /* should be greek pi */
70 ACS_NEQUAL = '!'; /* should be not-equal */
71 ACS_STERLING = 'f'; /* should be pound-sterling symbol */
76 TPUTS_TRACE("ena_acs");
82 #define ALTCHAR(c) (TextOf(c) | A_ALTCHARSET)
84 if (acs_chars != NULL) {
86 size_t length = strlen(acs_chars);
89 switch (acs_chars[i]) {
90 case 'l':case 'm':case 'k':case 'j':
91 case 'u':case 't':case 'v':case 'w':
92 case 'q':case 'x':case 'n':case 'o':
93 case 's':case '`':case 'a':case 'f':
94 case 'g':case '~':case ',':case '+':
95 case '.':case '-':case 'h':case 'I':
96 case '0':case 'p':case 'r':case 'y':
97 case 'z':case '{':case '|':case '}':
98 acs_map[(unsigned int)acs_chars[i]] =
99 ALTCHAR(acs_chars[i+1]);
108 #define SIZEOF(v) (sizeof(v)/sizeof(v[0]))
109 /* Show the equivalent mapping, noting if it does not match the
110 * given attribute, whether by re-ordering or duplication.
112 if (_nc_tracing & TRACE_CALLS) {
114 char show[SIZEOF(acs_map) + 1];
115 for (n = 1, m = 0; n < SIZEOF(acs_map); n++) {
116 if (acs_map[n] != 0) {
118 show[m++] = TextOf(acs_map[n]);
122 _tracef("%s acs_chars %s",
125 : (strcmp(acs_chars, show)
131 #endif /* acs_char */