xref: /illumos-gate/usr/src/lib/iconv_modules/ko/common/kdefs.h (revision dcdeca0a948b9d3139743db085d193c9db8ff2a3)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #define GI_UG		0x41	/* gi-ug 		'A' */
28 #define D_GI_UG		0x42	/* double gi-ug		'B' */
29 #define NI_UN		0x44	/* ni-un		'D' */
30 #define DI_GUD		0x47	/* di-gud		'G' */
31 #define D_DI_GUD	0x48	/* double di-gud	'H' */
32 #define RI_UL		0x49	/* ri-ul		'I' */
33 #define MI_UM		0x51	/* mi-um		'Q' */
34 #define BI_UB		0x52	/* bi-ub		'R' */
35 #define D_BI_UB		0x53	/* double bi-ub		'S' */
36 #define SI_OD		0x55	/* si-od		'U' */
37 #define D_SI_OD		0x56	/* double si-od		'V' */
38 #define YI_UNG		0x57	/* yi-ung		'W' */
39 #define JI_UD		0x58	/* ji-ud		'X' */
40 #define D_JI_UD		0x59	/* double ji-ud		'Y' */
41 #define CHI_UD		0x5a	/* chi-ud		'Z' */
42 #define KI_UK		0x5b	/* ki-uk		'[' */
43 #define TI_GUT		0x5c	/* ti-gut		'\' */
44 #define PI_UP		0x5d	/* pi-up		']' */
45 #define HI_UD		0x5e	/* hi-ud		'^' */
46 #define A		0x62	/* a			'b' */
47 #define AE		0x63	/* ae			'c' */
48 #define IA		0x64	/* ia			'd' */
49 #define IYAI		0x65	/* iyai			'e' */
50 #define E		0x66	/* e			'f' */
51 #define EA		0x67	/* ea			'g' */
52 #define IE		0x6a	/* ie			'j' */
53 #define YEA		0x6b	/* yea			'k' */
54 #define O		0x6c	/* o			'l' */
55 #define YO		0x72	/* yo			'r' */
56 #define U		0x73	/* u			's' */
57 #define YU		0x77	/* yu			'g' */
58 #define EU		0x7a	/* eu			'z' */
59 #define I		0x7c	/* i			'|' */
60 
61 #define	GIUG_SIOD	0x43 	/* gi-ug and si-od	'C' */
62 #define	NIUN_JIUD	0x45 	/* ni-un and ji-ud	'E' */
63 #define	NIUN_HIUD	0x46 	/* ni-un and hi-ud	'F' */
64 #define	RIUL_GIUG	0x4a 	/* ri_ul and gi_ug	'J' */
65 #define	RIUL_MIUM	0x4b 	/* ri_ul and mi_um	'K' */
66 #define	RIUL_BIUB	0x4c 	/* ri_ul and bi_ub	'L' */
67 #define	RIUL_SIOD	0x4d 	/* ri_ul and si_od	'M' */
68 #define	RIUL_TIGUT	0x4e 	/* ri_ul and ti_gut	'N' */
69 #define	RIUL_PIUP	0x4f 	/* ri_ul and pi_up	'O' */
70 #define	RIUL_HIUD	0x50 	/* ri_ul and hi_ud	'P' */
71 #define	BIUB_SIOD	0x54 	/* bi_ub and si_od	'T' */
72 
73 #define	O_A		0x6d 	/* o and a		'm' */
74 #define	O_AE		0x6e 	/* o and ae		'n' */
75 #define	O_I		0x6f 	/* o and i		'o' */
76 #define	U_E		0x74 	/* u and e		't' */
77 #define	U_EA		0x75 	/* u and ea		'u' */
78 #define	U_I		0x76 	/* u and i		'v' */
79 #define	EU_I		0x7b 	/* eu and i		'{' */
80 
81 #define ishaninit(c)	(c>=0xa4a1&&c<=0xa4be)	/* S000 */
82 #define ishanmid(c)	(c>=0xa4bf&&c<=0xa4d3)
83 
84 #define INITIAL_SOUND(c)	((KCHAR)(c & 0x7c00) >> 10)
85 #define MIDDLE_SOUND(c)		((KCHAR)(c & 0x03e0) >> 5)
86 #define FINAL_SOUND(c)		(c & 0x001f)
87 
88 #define BEG_OF_CONSO		0x40	/* S000 */
89 #define BEG_OF_VOW		0x60
90 
91 #define BYTE_MASK		0xff
92 #define	BIT_MASK		0x01
93 #define	MSB_MASK		0x8000
94 #define K_ILLEGAL			0xffff
95 
96 typedef unsigned short          KCHAR;
97