f1559c01bcca1ac0f9ac34aa726f38e356cdabe7
[oweals/cde.git] / cde / programs / dtksh / ksh93 / src / lib / libast / include / national.h
1 /* $XConsortium: national.h /main/3 1995/11/01 17:38:14 rswiston $ */
2 /***************************************************************
3 *                                                              *
4 *                      AT&T - PROPRIETARY                      *
5 *                                                              *
6 *        THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF        *
7 *                    AT&T BELL LABORATORIES                    *
8 *         AND IS NOT TO BE DISCLOSED OR USED EXCEPT IN         *
9 *            ACCORDANCE WITH APPLICABLE AGREEMENTS             *
10 *                                                              *
11 *          Copyright (c) 1993 AT&T Bell Laboratories           *
12 *              Unpublished & Not for Publication               *
13 *                     All Rights Reserved                      *
14 *                                                              *
15 *       The copyright notice above does not evidence any       *
16 *      actual or intended publication of such source code      *
17 *                                                              *
18 *               This software was created by the               *
19 *           Advanced Software Technology Department            *
20 *                    AT&T Bell Laboratories                    *
21 *                                                              *
22 *               For further information contact                *
23 *                    {ulysses,attmail}!dgk                     *
24 *                     dgk@ulysses.att.com                      *
25 *                   David Korn 908-582-7975                    *
26 *                                                              *
27 ***************************************************************/
28
29 #line 1
30
31 /* %W% */
32
33 /*
34  *  national.h -  definitions for international character sets
35  *
36  *   David Korn
37  *   AT&T Bell Laboratories
38  *   Room 5D-112
39  *   Murray Hill, N. J. 07974
40  *   Tel. x7975
41  *
42  */
43
44 /*
45  * This data must be defined for each country in defs.c
46  */
47
48 #ifndef HIGHBIT
49 #   define HIGHBIT              (1<<(CHAR_BIT-1))
50 #endif /* HIGHBIT */
51
52 #ifndef ESS_MAXCHAR     /* allow multiple includes */
53
54 /*
55  *  This section may change from country to country
56  */
57
58 #define ESS_MAXCHAR     2       /* Maximum number of non-escape bytes
59                                    for any and all character sets */
60 #define CCS1_IN_SIZE    2
61 #define CCS1_OUT_SIZE   2
62 #define CCS2_IN_SIZE    1
63 #define CCS2_OUT_SIZE   1
64 #define CCS3_IN_SIZE    2
65 #define CCS3_OUT_SIZE   2
66
67 /*
68  * This part is generic
69  */
70
71 #define MARKER          0x100   /* Must be invalid character */
72 #define ESS2            0x8e    /* Escape to char set 2 */
73 #define ESS3            0x8f    /* Escape to char set 3 */
74 #define ESS_SETMASK     (3<<(7*ESS_MAXCHAR))    /* character set bits */
75
76 #define echarset(c)     ((c)==ESS3?3:((c)==ESS2)?2:((c)>>7)&1)
77 #define icharset(i)     ((i)>>(7*ESS_MAXCHAR)&3)
78
79 #define in_csize(s)     int_charsize[s]
80 #define out_csize(s)    int_charsize[s+4]
81
82 extern char int_charsize[8];
83
84 #endif /* ESS_MAXCHAR */