1*880d7978SAlexander Pyhalov /* 2*880d7978SAlexander Pyhalov * CDDL HEADER START 3*880d7978SAlexander Pyhalov * 4*880d7978SAlexander Pyhalov * The contents of this file are subject to the terms of the 5*880d7978SAlexander Pyhalov * Common Development and Distribution License (the "License"). 6*880d7978SAlexander Pyhalov * You may not use this file except in compliance with the License. 7*880d7978SAlexander Pyhalov * 8*880d7978SAlexander Pyhalov * You can obtain a copy of the license at src/OPENSOLARIS.LICENSE 9*880d7978SAlexander Pyhalov * or http://www.opensolaris.org/os/licensing. 10*880d7978SAlexander Pyhalov * See the License for the specific language governing permissions 11*880d7978SAlexander Pyhalov * and limitations under the License. 12*880d7978SAlexander Pyhalov * 13*880d7978SAlexander Pyhalov * When distributing Covered Code, include this CDDL HEADER in each 14*880d7978SAlexander Pyhalov * file and include the License file at src/OPENSOLARIS.LICENSE. 15*880d7978SAlexander Pyhalov * If applicable, add the following below this CDDL HEADER, with the 16*880d7978SAlexander Pyhalov * fields enclosed by brackets "[]" replaced with your own identifying 17*880d7978SAlexander Pyhalov * information: Portions Copyright [yyyy] [name of copyright owner] 18*880d7978SAlexander Pyhalov * 19*880d7978SAlexander Pyhalov * CDDL HEADER END 20*880d7978SAlexander Pyhalov */ 21*880d7978SAlexander Pyhalov /* 22*880d7978SAlexander Pyhalov * Copyright (c) 1994 by Sun Microsystems, Inc. 23*880d7978SAlexander Pyhalov */ 24*880d7978SAlexander Pyhalov 25*880d7978SAlexander Pyhalov 26*880d7978SAlexander Pyhalov 27*880d7978SAlexander Pyhalov #ifndef _HANGULCODE_H_ 28*880d7978SAlexander Pyhalov #define _HANGULCODE_H_ 29*880d7978SAlexander Pyhalov 30*880d7978SAlexander Pyhalov 31*880d7978SAlexander Pyhalov typedef struct _kcode_table { 32*880d7978SAlexander Pyhalov unsigned short code; 33*880d7978SAlexander Pyhalov unsigned long utf8; 34*880d7978SAlexander Pyhalov } kcode_table; 35*880d7978SAlexander Pyhalov 36*880d7978SAlexander Pyhalov /* Cho Sung Count - 1 and Joong Sung Count - 1 */ 37*880d7978SAlexander Pyhalov #define CI_CNT 18 38*880d7978SAlexander Pyhalov #define V_CNT 20 39*880d7978SAlexander Pyhalov 40*880d7978SAlexander Pyhalov /* 0xa1 + 0xff - 0xfe */ 41*880d7978SAlexander Pyhalov #define SKIP 0xA2 42*880d7978SAlexander Pyhalov 43*880d7978SAlexander Pyhalov #ifndef BYTE_MASK 44*880d7978SAlexander Pyhalov #define BYTE_MASK 0xFF 45*880d7978SAlexander Pyhalov #endif /* BYTE_MASK */ 46*880d7978SAlexander Pyhalov 47*880d7978SAlexander Pyhalov #define BIT_MASK 0x01 48*880d7978SAlexander Pyhalov 49*880d7978SAlexander Pyhalov /* FAILED == non-identical character. */ 50*880d7978SAlexander Pyhalov #define FAILED 0 51*880d7978SAlexander Pyhalov #define ILLEGAL_SEQ 1 52*880d7978SAlexander Pyhalov #define HANGUL 2 53*880d7978SAlexander Pyhalov #define HANJA_OR_SYMBOL 3 54*880d7978SAlexander Pyhalov 55*880d7978SAlexander Pyhalov #define CHOSUNG(code) ((unsigned short)((code) & 0x7c00) >> 10) 56*880d7978SAlexander Pyhalov #define JOONGSUNG(code) ((unsigned short)((code) & 0x03e0) >> 5) 57*880d7978SAlexander Pyhalov #define JONGSUNG(code) ((code) & 0x001f) 58*880d7978SAlexander Pyhalov 59*880d7978SAlexander Pyhalov #define MAGIC_NUMBER 0x2165 60*880d7978SAlexander Pyhalov 61*880d7978SAlexander Pyhalov #define CVC_FILL 100 62*880d7978SAlexander Pyhalov 63*880d7978SAlexander Pyhalov #define ESC 0x1B 64*880d7978SAlexander Pyhalov #define SI 0x0F 65*880d7978SAlexander Pyhalov #define SO 0x0E 66*880d7978SAlexander Pyhalov 67*880d7978SAlexander Pyhalov #define MAX_E2U_NUM 5873 68*880d7978SAlexander Pyhalov #define MAX_J922U_NUM 5873 69*880d7978SAlexander Pyhalov #define MAX_U2E_NUM 8223 70*880d7978SAlexander Pyhalov #define MAX_U2ISO2022_NUM 8223 71*880d7978SAlexander Pyhalov #define MAX_U2J92_NUM 8223 72*880d7978SAlexander Pyhalov 73*880d7978SAlexander Pyhalov #define NON_IDENTICAL '?' 74*880d7978SAlexander Pyhalov 75*880d7978SAlexander Pyhalov #define UTF8_NON_ID_CHAR1 0xEF 76*880d7978SAlexander Pyhalov #define UTF8_NON_ID_CHAR2 0xBF 77*880d7978SAlexander Pyhalov #define UTF8_NON_ID_CHAR3 0xBD 78*880d7978SAlexander Pyhalov 79*880d7978SAlexander Pyhalov #endif /* _HANGULCODE_H_ */ 80