Annotation of coherent/g/usr/lib/ncurses/lib_setacs.c, revision 1.1.1.1

1.1       root        1: /*********************************************************************
                      2: *                         COPYRIGHT NOTICE                           *
                      3: **********************************************************************
                      4: *        This software is copyright (C) 1992 by Udo Munk             *
                      5: *                                                                    *
                      6: *        Permission is granted to reproduce and distribute           *
                      7: *        this file by any means so long as no fee is charged         *
                      8: *        above a nominal handling fee and so long as this            *
                      9: *        notice is always included in the copies.                    *
                     10: *                                                                    *
                     11: *        Other rights are reserved except as explicitly granted      *
                     12: *        by written permission of the author.                        *
                     13: *                Udo Munk                                           *
                     14: *                Oberstr. 21                                        *
                     15: *                4040 Neuss 1                                       *
                     16: *                Germany                                            *
                     17: *                                                                    *
                     18: *                [email protected]                                   *
                     19: *********************************************************************/
                     20: 
                     21: /*
                     22: **     lib_setacs.c
                     23: **
                     24: **     Set up the alternate character set map for the terminal
                     25: **
                     26: ** $Log:       lib_setacs.c,v $
                     27:  * Revision 1.6  93/04/12  14:14:06  bin
                     28:  * Udo: third color update
                     29:  * 
                     30:  * Revision 1.0  92/10/26  22:35:55  munk
                     31:  * Initial version
                     32:  * 
                     33: **
                     34: */
                     35: 
                     36: #ifdef RCSHDR
                     37: static char RCSid[] =
                     38:        "$Header: /src386/usr/lib/ncurses/RCS/lib_setacs.c,v 1.6 93/04/12 14:14:06 bin Exp Locker: bin $";
                     39: #endif
                     40: 
                     41: #include "curses.h"
                     42: #include "term.h"
                     43: 
                     44: setup_acs()
                     45: {
                     46:        register char *p;
                     47: 
                     48:        /* initialize acs_map with ASCII defaults for possible chars */
                     49:        acs_map['l'] = acs_map['m'] = acs_map['k'] = acs_map['j'] = '+';
                     50:        acs_map['u'] = acs_map['t'] = acs_map['v'] = acs_map['w'] = '+';
                     51:        acs_map['q'] = '-';
                     52:        acs_map['x'] = '|';
                     53:        acs_map['n'] = '+';
                     54:        acs_map['o'] = '_';
                     55:        acs_map[','] = '<';
                     56:        acs_map['+'] = '>';
                     57: 
                     58:        /* now get the alternate characters from acs_chars and fill map */
                     59:        p = acs_chars;
                     60:        do {
                     61:                switch (*p) {
                     62:                case 'l':
                     63:                        acs_map['l'] = *++p & 0377 | A_ALTCHARSET;
                     64:                        break;
                     65:                case 'm':
                     66:                        acs_map['m'] = *++p & 0377 | A_ALTCHARSET;
                     67:                        break;
                     68:                case 'k':
                     69:                        acs_map['k'] = *++p & 0377 | A_ALTCHARSET;
                     70:                        break;
                     71:                case 'j':
                     72:                        acs_map['j'] = *++p & 0377 | A_ALTCHARSET;
                     73:                        break;
                     74:                case 'u':
                     75:                        acs_map['u'] = *++p & 0377 | A_ALTCHARSET;
                     76:                        break;
                     77:                case 't':
                     78:                        acs_map['t'] = *++p & 0377 | A_ALTCHARSET;
                     79:                        break;
                     80:                case 'v':
                     81:                        acs_map['v'] = *++p & 0377 | A_ALTCHARSET;
                     82:                        break;
                     83:                case 'w':
                     84:                        acs_map['w'] = *++p & 0377 | A_ALTCHARSET;
                     85:                        break;
                     86:                case 'q':
                     87:                        acs_map['q'] = *++p & 0377 | A_ALTCHARSET;
                     88:                        break;
                     89:                case 'x':
                     90:                        acs_map['x'] = *++p & 0377 | A_ALTCHARSET;
                     91:                        break;
                     92:                case 'n':
                     93:                        acs_map['n'] = *++p & 0377 | A_ALTCHARSET;
                     94:                        break;
                     95:                case 'o':
                     96:                        acs_map['o'] = *++p & 0377 | A_ALTCHARSET;
                     97:                        break;
                     98:                case 's':
                     99:                        acs_map['s'] = *++p & 0377 | A_ALTCHARSET;
                    100:                        break;
                    101:                case '`':
                    102:                        acs_map['`'] = *++p & 0377 | A_ALTCHARSET;
                    103:                        break;
                    104:                case 'a':
                    105:                        acs_map['a'] = *++p & 0377 | A_ALTCHARSET;
                    106:                        break;
                    107:                case 'f':
                    108:                        acs_map['f'] = *++p & 0377 | A_ALTCHARSET;
                    109:                        break;
                    110:                case 'g':
                    111:                        acs_map['g'] = *++p & 0377 | A_ALTCHARSET;
                    112:                        break;
                    113:                case '~':
                    114:                        acs_map['~'] = *++p & 0377 | A_ALTCHARSET;
                    115:                        break;
                    116:                case ',':
                    117:                        acs_map[','] = *++p & 0377 | A_ALTCHARSET;
                    118:                        break;
                    119:                case '+':
                    120:                        acs_map['+'] = *++p & 0377 | A_ALTCHARSET;
                    121:                        break;
                    122:                case '.':
                    123:                        acs_map['.'] = *++p & 0377 | A_ALTCHARSET;
                    124:                        break;
                    125:                case '-':
                    126:                        acs_map['-'] = *++p & 0377 | A_ALTCHARSET;
                    127:                        break;
                    128:                case 'h':
                    129:                        acs_map['h'] = *++p & 0377 | A_ALTCHARSET;
                    130:                        break;
                    131:                case 'i':
                    132:                        acs_map['i'] = *++p & 0377 | A_ALTCHARSET;
                    133:                        break;
                    134:                case '0':
                    135:                        acs_map['0'] = *++p & 0377 | A_ALTCHARSET;
                    136:                        break;
                    137:                default:
                    138:                        p++;
                    139:                }
                    140:        } while (*p && *++p);
                    141: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.