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