919N/A/*
1370N/A * Copyright (c) 1986, 2013, Oracle and/or its affiliates. All rights reserved.
919N/A *
919N/A * Permission is hereby granted, free of charge, to any person obtaining a
919N/A * copy of this software and associated documentation files (the "Software"),
919N/A * to deal in the Software without restriction, including without limitation
919N/A * the rights to use, copy, modify, merge, publish, distribute, sublicense,
919N/A * and/or sell copies of the Software, and to permit persons to whom the
919N/A * Software is furnished to do so, subject to the following conditions:
919N/A *
919N/A * The above copyright notice and this permission notice (including the next
919N/A * paragraph) shall be included in all copies or substantial portions of the
919N/A * Software.
919N/A *
919N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
919N/A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
919N/A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
919N/A * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
919N/A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
919N/A * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
919N/A * DEALINGS IN THE SOFTWARE.
919N/A */
1370N/A
1370N/A#ifndef _SUNCOMPOSE_H
1370N/A#define _SUNCOMPOSE_H
1370N/A
341N/A/*
341N/A * Suncompose.h -- Compose Key Sequence Table
341N/A *
341N/A * The idea here is to create a simple index into a table of
341N/A * compose key sequences. The purpose is to provide a fast
341N/A * lookup mechanism using as little space as possible (while
341N/A * still using a table of triplets).
341N/A *
341N/A * For reference, here is the set of all composable characters:
341N/A * SP !\"\'*+,-./01234:<>?ACDEHILNOPRSTUXY\\^_`acdehilnoprstuxy|~
341N/A *
341N/A * if ascii_char[i] is not composable,
341N/A * compose_map[i] is -1
341N/A * else
341N/A * if ascii_char[i] appears as a first char in compose_table,
341N/A * compose_map[i] is the index of it's first appearance
341N/A * else
341N/A * compose_map[i] is 112 (end of table)
341N/A */
341N/A
341N/A#define ASCII_SET_SIZE 128
341N/A
1370N/Aconst char compose_map[ASCII_SET_SIZE] = {
341N/A -1, /* 000 (^@) */
341N/A -1, /* 001 (^A) */
341N/A -1, /* 002 (^B) */
341N/A -1, /* 003 (^C) */
341N/A -1, /* 004 (^D) */
341N/A -1, /* 005 (^E) */
341N/A -1, /* 006 (^F) */
341N/A -1, /* 007 (^G) */
341N/A -1, /* 008 (^H) */
341N/A -1, /* 009 (^I) */
341N/A -1, /* 010 (^J) */
341N/A -1, /* 011 (^K) */
341N/A -1, /* 012 (^L) */
341N/A -1, /* 013 (^M) */
341N/A -1, /* 014 (^N) */
341N/A -1, /* 015 (^O) */
341N/A -1, /* 016 (^P) */
341N/A -1, /* 017 (^Q) */
341N/A -1, /* 018 (^R) */
341N/A -1, /* 019 (^S) */
341N/A -1, /* 020 (^T) */
341N/A -1, /* 021 (^U) */
341N/A -1, /* 022 (^V) */
341N/A -1, /* 023 (^W) */
341N/A -1, /* 024 (^X) */
341N/A -1, /* 025 (^Y) */
341N/A -1, /* 026 (^Z) */
341N/A -1, /* 027 (^[) */
341N/A -1, /* 028 (^\) */
341N/A -1, /* 029 (^]) */
341N/A -1, /* 030 (^^) */
341N/A -1, /* 031 (^_) */
341N/A 0, /* 032 (SP) */
341N/A 1, /* 033 (!) */
341N/A 4, /* 034 (") */
341N/A -1, /* 035 (#) */
341N/A -1, /* 036 ($) */
341N/A -1, /* 037 (%) */
341N/A -1, /* 038 (&) */
341N/A 16, /* 039 (') */
341N/A -1, /* 040 (() */
341N/A -1, /* 041 ()) */
341N/A 28, /* 042 (*) */
341N/A 31, /* 043 (+) */
341N/A 32, /* 044 (,) */
341N/A 36, /* 045 (-) */
341N/A 48, /* 046 (.) */
341N/A 49, /* 047 (/) */
341N/A 54, /* 048 (0) */
341N/A 57, /* 049 (1) */
341N/A 60, /* 050 (2) */
341N/A 61, /* 051 (3) */
341N/A 112, /* 052 (4) */
341N/A -1, /* 053 (5) */
341N/A -1, /* 054 (6) */
341N/A -1, /* 055 (7) */
341N/A -1, /* 056 (8) */
341N/A -1, /* 057 (9) */
341N/A 112, /* 058 (:) */
341N/A -1, /* 059 (;) */
341N/A 63, /* 060 (<) */
341N/A -1, /* 061 (=) */
341N/A 64, /* 062 (>) */
341N/A 65, /* 063 (?) */
341N/A -1, /* 064 (@) */
341N/A 66, /* 065 (A) */
341N/A -1, /* 066 (B) */
341N/A 70, /* 067 (C) */
341N/A 112, /* 068 (D) */
341N/A 71, /* 069 (E) */
341N/A -1, /* 070 (F) */
341N/A -1, /* 071 (G) */
341N/A 73, /* 072 (H) */
341N/A 74, /* 073 (I) */
341N/A -1, /* 074 (J) */
341N/A -1, /* 075 (K) */
341N/A 112, /* 076 (L) */
341N/A -1, /* 077 (M) */
341N/A 76, /* 078 (N) */
341N/A 77, /* 079 (O) */
341N/A 84, /* 080 (P) */
341N/A -1, /* 081 (Q) */
341N/A 112, /* 082 (R) */
341N/A 112, /* 083 (S) */
341N/A 112, /* 084 (T) */
341N/A 85, /* 085 (U) */
341N/A -1, /* 086 (V) */
341N/A -1, /* 087 (W) */
341N/A 112, /* 088 (X) */
341N/A 112, /* 089 (Y) */
341N/A -1, /* 090 (Z) */
341N/A -1, /* 091 ([) */
341N/A 87, /* 092 (\) */
341N/A -1, /* 093 (]) */
341N/A 88, /* 094 (^) */
341N/A 93, /* 095 (_) */
341N/A 94, /* 096 (`) */
341N/A 99, /* 097 (a) */
341N/A -1, /* 098 (b) */
341N/A 101, /* 099 (c) */
341N/A 112, /* 100 (d) */
341N/A 112, /* 101 (e) */
341N/A -1, /* 102 (f) */
341N/A -1, /* 103 (g) */
341N/A 102, /* 104 (h) */
341N/A 112, /* 105 (i) */
341N/A -1, /* 106 (j) */
341N/A -1, /* 107 (k) */
341N/A 112, /* 108 (l) */
341N/A -1, /* 109 (m) */
341N/A 103, /* 110 (n) */
341N/A 104, /* 111 (o) */
341N/A 108, /* 112 (p) */
341N/A -1, /* 113 (q) */
341N/A 112, /* 114 (r) */
341N/A 109, /* 115 (s) */
341N/A 112, /* 116 (t) */
341N/A 112, /* 117 (u) */
341N/A -1, /* 118 (v) */
341N/A -1, /* 119 (w) */
341N/A 110, /* 120 (x) */
341N/A 112, /* 121 (y) */
341N/A -1, /* 122 (z) */
341N/A -1, /* 123 ({) */
341N/A 111, /* 124 (|) */
341N/A -1, /* 125 (}) */
341N/A 112, /* 126 (~) */
341N/A -1, /* 127 (DEL) */
341N/A};
341N/A
341N/Atypedef struct _ComposeTableEntry {
341N/A unsigned char first;
341N/A unsigned char second;
341N/A unsigned char result;
341N/A} ComposeTableEntry;
341N/A
341N/A/*
341N/A * IMPORTANT NOTE: This table MUST be kept in proper sorted order:
341N/A * The first and second characters in each entry must be in ASCII
341N/A * collating sequence (left to right).
341N/A * The table must be in ASCII collating sequence by first character
341N/A * (top to bottom).
341N/A */
341N/A
341N/A/* COMPOSE + first character + second character => ISO character */
341N/A
1370N/Aconst ComposeTableEntry compose_table[] = {
341N/A
341N/A {' ', ' ', 0xA0}, /* 000 */ /* NBSP (non-breaking space) */
341N/A {'!', '!', 0xA1}, /* 001 */ /* inverted ! */
341N/A {'!', 'P', 0xB6}, /* 002 */ /* paragraph mark */
341N/A {'!', 'p', 0xB6}, /* 003 */ /* paragraph mark */
341N/A {'"', '"', 0xA8}, /* 004 */ /* diaresis */
341N/A {'"', 'A', 0xC4}, /* 005 */ /* A with diaresis */
341N/A {'"', 'E', 0xCB}, /* 006 */ /* E with diaresis */
341N/A {'"', 'I', 0xCF}, /* 007 */ /* I with diaresis */
341N/A {'"', 'O', 0xD6}, /* 008 */ /* O with diaresis */
341N/A {'"', 'U', 0xDC}, /* 009 */ /* U with diaresis */
341N/A {'"', 'a', 0xE4}, /* 010 */ /* a with diaresis */
341N/A {'"', 'e', 0xEB}, /* 011 */ /* e with diaresis */
341N/A {'"', 'i', 0xEF}, /* 012 */ /* i with diaresis */
341N/A {'"', 'o', 0xF6}, /* 013 */ /* o with diaresis */
341N/A {'"', 'u', 0xFC}, /* 014 */ /* u with diaresis */
341N/A {'"', 'y', 0xFF}, /* 015 */ /* y with diaresis */
341N/A {'\'','A', 0xC1}, /* 016 */ /* A with acute accent */
341N/A {'\'','E', 0xC9}, /* 017 */ /* E with acute accent */
341N/A {'\'','I', 0xCD}, /* 018 */ /* I with acute accent */
341N/A {'\'','O', 0xD3}, /* 019 */ /* O with acute accent */
341N/A {'\'','U', 0xDA}, /* 020 */ /* U with acute accent */
341N/A {'\'','Y', 0xDD}, /* 021 */ /* Y with acute accent */
341N/A {'\'','a', 0xE1}, /* 022 */ /* a with acute accent */
341N/A {'\'','e', 0xE9}, /* 023 */ /* e with acute accent */
341N/A {'\'','i', 0xED}, /* 024 */ /* i with acute accent */
341N/A {'\'','o', 0xF3}, /* 025 */ /* o with acute accent */
341N/A {'\'','u', 0xFA}, /* 026 */ /* u with acute accent */
341N/A {'\'','y', 0xFD}, /* 027 */ /* y with acute accent */
341N/A {'*', 'A', 0xC5}, /* 028 */ /* A with ring */
341N/A {'*', '^', 0xB0}, /* 029 */ /* degree */
341N/A {'*', 'a', 0xE5}, /* 030 */ /* a with ring */
341N/A {'+', '-', 0xB1}, /* 031 */ /* plus/minus */
341N/A {',', ',', 0xB8}, /* 032 */ /* cedilla */
341N/A {',', '-', 0xAC}, /* 033 */ /* not sign */
341N/A {',', 'C', 0xC7}, /* 034 */ /* C with cedilla */
341N/A {',', 'c', 0xE7}, /* 035 */ /* c with cedilla */
341N/A {'-', '-', 0xAD}, /* 036 */ /* soft hyphen */
341N/A {'-', ':', 0xF7}, /* 037 */ /* division sign */
341N/A {'-', 'A', 0xAA}, /* 038 */ /* feminine superior numeral */
341N/A {'-', 'D', 0xD0}, /* 039 */ /* Upper-case eth */
341N/A {'-', 'L', 0xA3}, /* 040 */ /* pounds sterling */
341N/A {'-', 'Y', 0xA5}, /* 041 */ /* yen */
341N/A {'-', '^', 0xAF}, /* 042 */ /* macron */
341N/A {'-', 'a', 0xAA}, /* 043 */ /* feminine superior numeral */
341N/A {'-', 'd', 0xF0}, /* 044 */ /* Lower-case eth */
341N/A {'-', 'l', 0xA3}, /* 045 */ /* pounds sterling */
341N/A {'-', 'y', 0xA5}, /* 046 */ /* yen */
341N/A {'-', '|', 0xAC}, /* 047 */ /* not sign */
341N/A {'.', '^', 0xB7}, /* 048 */ /* centered dot */
341N/A {'/', 'C', 0xA2}, /* 049 */ /* cent sign */
341N/A {'/', 'O', 0xD8}, /* 050 */ /* O with slash */
341N/A {'/', 'c', 0xA2}, /* 051 */ /* cent sign */
341N/A {'/', 'o', 0xF8}, /* 052 */ /* o with slash */
341N/A {'/', 'u', 0xB5}, /* 053 */ /* mu */
341N/A {'0', 'X', 0xA4}, /* 054 */ /* currency symbol */
341N/A {'0', '^', 0xB0}, /* 055 */ /* degree */
341N/A {'0', 'x', 0xA4}, /* 056 */ /* currency symbol */
341N/A {'1', '2', 0xBD}, /* 057 */ /* 1/2 */
341N/A {'1', '4', 0xBC}, /* 058 */ /* 1/4 */
341N/A {'1', '^', 0xB9}, /* 059 */ /* superior '1' */
341N/A {'2', '^', 0xB2}, /* 060 */ /* superior '2' */
341N/A {'3', '4', 0xBE}, /* 061 */ /* 3/4 */
341N/A {'3', '^', 0xB3}, /* 062 */ /* superior '3' */
341N/A {'<', '<', 0xAB}, /* 063 */ /* left guillemot */
341N/A {'>', '>', 0xBB}, /* 064 */ /* right guillemot */
341N/A {'?', '?', 0xBF}, /* 065 */ /* inverted ? */
341N/A {'A', 'E', 0xC6}, /* 066 */ /* AE dipthong */
341N/A {'A', '^', 0xC2}, /* 067 */ /* A with circumflex accent */
341N/A {'A', '`', 0xC0}, /* 068 */ /* A with grave accent */
341N/A {'A', '~', 0xC3}, /* 069 */ /* A with tilde */
341N/A {'C', 'O', 0xA9}, /* 060 */ /* copyright */
341N/A {'E', '^', 0xCA}, /* 071 */ /* E with circumflex accent */
341N/A {'E', '`', 0xC8}, /* 072 */ /* E with grave accent */
341N/A {'H', 'T', 0xDE}, /* 073 */ /* Upper-case thorn */
341N/A {'I', '^', 0xCE}, /* 074 */ /* I with circumflex accent */
341N/A {'I', '`', 0xCC}, /* 075 */ /* I with grave accent */
341N/A {'N', '~', 0xD1}, /* 076 */ /* N with tilde */
341N/A {'O', 'R', 0xAE}, /* 077 */ /* registered */
341N/A {'O', 'S', 0xA7}, /* 078 */ /* section mark */
341N/A {'O', 'X', 0xA4}, /* 079 */ /* currency symbol */
341N/A {'O', '^', 0xD4}, /* 080 */ /* O with circumflex accent */
341N/A {'O', '_', 0xBA}, /* 081 */ /* masculine superior numeral */
341N/A {'O', '`', 0xD2}, /* 082 */ /* O with grave accent */
341N/A {'O', '~', 0xD5}, /* 083 */ /* O with tilde */
341N/A {'P', '|', 0xDE}, /* 084 */ /* Upper-case thorn */
341N/A {'U', '^', 0xDB}, /* 085 */ /* U with circumflex accent */
341N/A {'U', '`', 0xD9}, /* 086 */ /* U with grave accent */
341N/A {'\\','\\',0xB4}, /* 087 */ /* acute accent */
341N/A {'^', 'a', 0xE2}, /* 088 */ /* a with circumflex accent */
341N/A {'^', 'e', 0xEA}, /* 089 */ /* e with circumflex accent */
341N/A {'^', 'i', 0xEE}, /* 090 */ /* i with circumflex accent */
341N/A {'^', 'o', 0xF4}, /* 091 */ /* o with circumflex accent */
341N/A {'^', 'u', 0xFB}, /* 092 */ /* u with circumflex accent */
341N/A {'_', 'o', 0xBA}, /* 093 */ /* masculine superior numeral */
341N/A {'`', 'a', 0xE0}, /* 094 */ /* a with grave accent */
341N/A {'`', 'e', 0xE8}, /* 095 */ /* e with grave accent */
341N/A {'`', 'i', 0xEC}, /* 096 */ /* i with grave accent */
341N/A {'`', 'o', 0xF2}, /* 097 */ /* o with grave accent */
341N/A {'`', 'u', 0xF9}, /* 098 */ /* u with grave accent */
341N/A {'a', 'e', 0xE6}, /* 099 */ /* ae dipthong */
341N/A {'a', '~', 0xE3}, /* 100 */ /* a with tilde */
341N/A {'c', 'o', 0xA9}, /* 101 */ /* copyright */
341N/A {'h', 't', 0xFE}, /* 102 */ /* Lower-case thorn */
341N/A {'n', '~', 0xF1}, /* 103 */ /* n with tilde */
341N/A {'o', 'r', 0xAE}, /* 104 */ /* registered */
341N/A {'o', 's', 0xA7}, /* 105 */ /* section mark */
341N/A {'o', 'x', 0xA4}, /* 106 */ /* currency symbol */
341N/A {'o', '~', 0xF5}, /* 107 */ /* o with tilde */
341N/A {'p', '|', 0xFE}, /* 108 */ /* Lower-case thorn */
341N/A {'s', 's', 0xDF}, /* 109 */ /* German double-s */
341N/A {'x', 'x', 0xD7}, /* 110 */ /* multiplication sign */
341N/A {'|', '|', 0xA6}, /* 111 */ /* broken bar */
341N/A
341N/A {0, 0, 0}, /* end of table */
341N/A};
341N/A
1370N/A#endif /* _SUNCOMPOSE_H */