Back to index

lightning-sunbird  0.9+nobinonly
tamil.h
Go to the documentation of this file.
00001 /* ***** BEGIN LICENSE BLOCK *****
00002  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00003  *
00004  * The contents of this file are subject to the Mozilla Public License Version
00005  * 1.1 (the "License"); you may not use this file except in compliance with
00006  * the License. You may obtain a copy of the License at
00007  * http://www.mozilla.org/MPL/
00008  *
00009  * Software distributed under the License is distributed on an "AS IS" basis,
00010  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00011  * for the specific language governing rights and limitations under the
00012  * License.
00013  *
00014  * The Original Code is Mozilla Communicator client code.
00015  *
00016  * The Initial Developer of the Original Code is
00017  * Jungshik Shin <jshin@mailaps.org>.
00018  * Portions created by the Initial Developer are Copyright (C) 2003
00019  * the Initial Developer. All Rights Reserved.
00020  *
00021  * Contributor(s):
00022  *
00023  * Alternatively, the contents of this file may be used under the terms of
00024  * either the GNU General Public License Version 2 or later (the "GPL"), or
00025  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00026  * in which case the provisions of the GPL or the LGPL are applicable instead
00027  * of those above. If you wish to allow use of your version of this file only
00028  * under the terms of either the GPL or the LGPL, and not to allow others to
00029  * use your version of this file under the terms of the MPL, indicate your
00030  * decision by deleting the provisions above and replace them with the notice
00031  * and other provisions required by the GPL or the LGPL. If you do not delete
00032  * the provisions above, a recipient may use your version of this file under
00033  * the terms of any one of the MPL, the GPL or the LGPL.
00034  *
00035  * ***** END LICENSE BLOCK ***** */
00036 
00037 // Definitions to use in TSCII en/decoders.
00038 
00039 #define TSC_KA    0xb8
00040 #define TSC_NA    0xc9
00041 // akara varisai
00042 #define IS_TSC_CONSONANT1(c) ((c) >= TSC_KA && (c) <= TSC_NA) 
00043 // grantha akara mey varisai
00044 #define TSC_JA    0x83
00045 #define TSC_HA    0x86
00046 #define IS_TSC_CONSONANT2(c) ((c) >= TSC_JA && (c) <= TSC_HA) 
00047 
00048 // union of two above
00049 #define IS_TSC_CONSONANT(c)  (IS_TSC_CONSONANT1(c) || IS_TSC_CONSONANT2(c))
00050 
00051 #define TSC_SA    0x85  
00052 #define TSC_TA    0xbc  
00053 #define TSC_RA    0xc3
00054 #define TSC_KSSA  0x87 // Consonant Conjunct K.SSA : live 
00055 
00056 #define TSC_KA_DEAD   0xec  // KA with virama/pulli
00057 #define TSC_SA_DEAD   0x8a  // SA with virama/pulli
00058 #define TSC_KSSA_DEAD 0x8c  // Consonant Conjunct K.SSA : dead
00059 
00060 #define TSC_TI_LIGA   0xca  // Ligature of consonant TA and Vowel sign I
00061 #define TSC_SRII_LIGA 0x82  // Ligature of SA + RA + II
00062 
00063 // Two part vowel signs
00064 #define UNI_VOWELSIGN_E 0x0BC6
00065 #define TSC_VOWELSIGN_E 0xa6
00066 #define TSC_LEFT_VOWELSIGN(u)      ((u) - UNI_VOWELSIGN_E + TSC_VOWELSIGN_E)
00067 #define IS_UNI_LEFT_VOWELSIGN(u)   ((u) >= UNI_VOWELSIGN_E && (u) <= 0x0BC8)  
00068 #define IS_UNI_2PARTS_VOWELSIGN(u) ((u) >= 0x0BCA && (u) <= 0x0BCC)  
00069 
00070 #define UNI_TAMIL_START 0x0B80
00071 #define IS_UNI_TAMIL(u) (UNI_TAMIL_START <= (u) && (u) < UNI_TAMIL_START + 0x80)
00072 
00073 #define UNI_VIRAMA         0x0BCD
00074 #define UNI_VOWELSIGN_I    0x0BBF
00075 #define UNI_VOWELSIGN_II   0x0BC0
00076 #define UNI_VOWELSIGN_U    0x0BC1
00077 #define UNI_VOWELSIGN_UU   0x0BC2
00078 #define UNI_SSA            0x0BB7
00079 #define UNI_RA             0x0BB0
00080 
00081 // Punctuation marks 
00082 #define UNI_LSQ 0x2018
00083 #define UNI_RSQ 0x2019
00084 #define UNI_LDQ 0x201C
00085 #define UNI_RDQ 0x201D
00086 #define UNI_LEFT_SINGLE_QUOTE UNI_LSQ
00087 #define UNI_RIGHT_SINGLE_QUOTE UNI_RSQ
00088 #define UNI_LEFT_DOUBLE_QUOTE UNI_LDQ
00089 #define UNI_RIGHT_DOUBLE_QUOTE UNI_RDQ
00090 #define IS_UNI_SINGLE_QUOTE(u) (UNI_LSQ <= (u) && (u) <= UNI_RSQ)
00091 #define IS_UNI_DOUBLE_QUOTE(u) (UNI_LDQ <= (u) && (u) <= UNI_RDQ)
00092 
00093 #define TSC_LEFT_SINGLE_QUOTE 0x91
00094 #define TSC_LEFT_DOUBLE_QUOTE 0x93
00095 
00096 #define TSC_LEFT_VOWEL_PART(u) (((u) % 2) ? 0xa7 : 0xa6)
00097 #define TSC_RIGHT_VOWEL_PART(u) (((u) != 0x0BCC) ? 0xa1 : 0xaa)