1*a399743eSmarc /*
2*a399743eSmarc 
3*a399743eSmarc  *      Copyright (c) 1984, 1985, 1986 AT&T
4*a399743eSmarc  *      All Rights Reserved
5*a399743eSmarc 
6*a399743eSmarc  *      THIS IS UNPUBLISHED PROPRIETARY SOURCE
7*a399743eSmarc  *      CODE OF AT&T.
8*a399743eSmarc  *      The copyright notice above does not
9*a399743eSmarc  *      evidence any actual or intended
10*a399743eSmarc  *      publication of such source code.
11*a399743eSmarc 
12*a399743eSmarc  */
13*a399743eSmarc 
14*a399743eSmarc /* @(#)national.h	1.1 */
15*a399743eSmarc 
16*a399743eSmarc /*
17*a399743eSmarc  *  national.h -  definitions for international character sets
18*a399743eSmarc  *
19*a399743eSmarc  *   David Korn
20*a399743eSmarc  *   AT&T Bell Laboratories
21*a399743eSmarc  *   Room 5D-112
22*a399743eSmarc  *   Murray Hill, N. J. 07974
23*a399743eSmarc  *   Tel. x7975
24*a399743eSmarc  *
25*a399743eSmarc  */
26*a399743eSmarc 
27*a399743eSmarc /*
28*a399743eSmarc  * This data must be defined for each country in defs.c
29*a399743eSmarc  */
30*a399743eSmarc 
31*a399743eSmarc #ifndef HIGHBIT
32*a399743eSmarc # define HIGHBIT		0x80
33*a399743eSmarc #endif /* HIGHBIT */
34*a399743eSmarc 
35*a399743eSmarc #ifndef ESS_MAXCHAR	/* allow multiple includes */
36*a399743eSmarc 
37*a399743eSmarc /*
38*a399743eSmarc  *  This section may change from country to country
39*a399743eSmarc  */
40*a399743eSmarc 
41*a399743eSmarc #define ESS_MAXCHAR	2	/* Maximum number of non-escape bytes
42*a399743eSmarc 				   for any and all character sets */
43*a399743eSmarc #define	CCS1_IN_SIZE	2
44*a399743eSmarc #define	CCS1_OUT_SIZE	2
45*a399743eSmarc #define	CCS2_IN_SIZE	1
46*a399743eSmarc #define	CCS2_OUT_SIZE	1
47*a399743eSmarc #define	CCS3_IN_SIZE	2
48*a399743eSmarc #define	CCS3_OUT_SIZE	2
49*a399743eSmarc 
50*a399743eSmarc /*
51*a399743eSmarc  * This part is generic
52*a399743eSmarc  */
53*a399743eSmarc 
54*a399743eSmarc #define MARKER		0x100	/* Must be invalid character */
55*a399743eSmarc #define ESS2		0x8e	/* Escape to char set 2 */
56*a399743eSmarc #define ESS3		0x8f	/* Escape to char set 3 */
57*a399743eSmarc #define ESS_SETMASK	(3<<(7*ESS_MAXCHAR))	/* character set bits */
58*a399743eSmarc 
59*a399743eSmarc #define	echarset(c)	((c)==ESS3?3:((c)==ESS2)?2:((c)>>7)&1)
60*a399743eSmarc #define icharset(i)	((i)>>(7*ESS_MAXCHAR)&3)
61*a399743eSmarc 
62*a399743eSmarc #define in_csize(s)	int_charsize[s]
63*a399743eSmarc #define out_csize(s)	int_charsize[s+4]
64*a399743eSmarc 
65*a399743eSmarc extern char int_charsize[8];
66*a399743eSmarc 
67*a399743eSmarc #endif /* ESS_MAXCHAR */
68