Back to index

lightning-sunbird  0.9+nobinonly
nsUTF8Verifier.h
Go to the documentation of this file.
00001 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either of the GNU General Public License Version 2 or later (the "GPL"),
00026  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 /* 
00038  * DO NOT EDIT THIS DOCUMENT MANUALLY !!!
00039  * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER
00040  *    mozilla/intl/chardet/tools/
00041  * Please contact ftang@netscape.com or mozilla-i18n@mozilla.org
00042  * if you have any question. Thanks
00043  */
00044 #include "nsVerifier.h"
00045 static const PRUint32 UTF8_cls [ 256 / 8 ] = {
00046 PCK4BITS(1,1,1,1,1,1,1,1),  // 00 - 07 
00047 PCK4BITS(1,1,1,1,1,1,0,0),  // 08 - 0f 
00048 PCK4BITS(1,1,1,1,1,1,1,1),  // 10 - 17 
00049 PCK4BITS(1,1,1,0,1,1,1,1),  // 18 - 1f 
00050 PCK4BITS(1,1,1,1,1,1,1,1),  // 20 - 27 
00051 PCK4BITS(1,1,1,1,1,1,1,1),  // 28 - 2f 
00052 PCK4BITS(1,1,1,1,1,1,1,1),  // 30 - 37 
00053 PCK4BITS(1,1,1,1,1,1,1,1),  // 38 - 3f 
00054 PCK4BITS(1,1,1,1,1,1,1,1),  // 40 - 47 
00055 PCK4BITS(1,1,1,1,1,1,1,1),  // 48 - 4f 
00056 PCK4BITS(1,1,1,1,1,1,1,1),  // 50 - 57 
00057 PCK4BITS(1,1,1,1,1,1,1,1),  // 58 - 5f 
00058 PCK4BITS(1,1,1,1,1,1,1,1),  // 60 - 67 
00059 PCK4BITS(1,1,1,1,1,1,1,1),  // 68 - 6f 
00060 PCK4BITS(1,1,1,1,1,1,1,1),  // 70 - 77 
00061 PCK4BITS(1,1,1,1,1,1,1,1),  // 78 - 7f 
00062 PCK4BITS(2,2,2,2,3,3,3,3),  // 80 - 87 
00063 PCK4BITS(4,4,4,4,4,4,4,4),  // 88 - 8f 
00064 PCK4BITS(4,4,4,4,4,4,4,4),  // 90 - 97 
00065 PCK4BITS(4,4,4,4,4,4,4,4),  // 98 - 9f 
00066 PCK4BITS(5,5,5,5,5,5,5,5),  // a0 - a7 
00067 PCK4BITS(5,5,5,5,5,5,5,5),  // a8 - af 
00068 PCK4BITS(5,5,5,5,5,5,5,5),  // b0 - b7 
00069 PCK4BITS(5,5,5,5,5,5,5,5),  // b8 - bf 
00070 PCK4BITS(0,0,6,6,6,6,6,6),  // c0 - c7 
00071 PCK4BITS(6,6,6,6,6,6,6,6),  // c8 - cf 
00072 PCK4BITS(6,6,6,6,6,6,6,6),  // d0 - d7 
00073 PCK4BITS(6,6,6,6,6,6,6,6),  // d8 - df 
00074 PCK4BITS(7,8,8,8,8,8,8,8),  // e0 - e7 
00075 PCK4BITS(8,8,8,8,8,9,8,8),  // e8 - ef 
00076 PCK4BITS(10,11,11,11,11,11,11,11),  // f0 - f7 
00077 PCK4BITS(12,13,13,13,14,15,0,0)   // f8 - ff 
00078 };
00079 
00080 
00081 static const PRUint32 UTF8_st [ 26] = {
00082 PCK4BITS(eError,eStart,eError,eError,eError,eError,     12,     10),//00-07 
00083 PCK4BITS(     9,     11,     8,     7,     6,     5,     4,     3),//08-0f 
00084 PCK4BITS(eError,eError,eError,eError,eError,eError,eError,eError),//10-17 
00085 PCK4BITS(eError,eError,eError,eError,eError,eError,eError,eError),//18-1f 
00086 PCK4BITS(eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe),//20-27 
00087 PCK4BITS(eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe),//28-2f 
00088 PCK4BITS(eError,eError,     5,     5,     5,     5,eError,eError),//30-37 
00089 PCK4BITS(eError,eError,eError,eError,eError,eError,eError,eError),//38-3f 
00090 PCK4BITS(eError,eError,eError,     5,     5,     5,eError,eError),//40-47 
00091 PCK4BITS(eError,eError,eError,eError,eError,eError,eError,eError),//48-4f 
00092 PCK4BITS(eError,eError,     7,     7,     7,     7,eError,eError),//50-57 
00093 PCK4BITS(eError,eError,eError,eError,eError,eError,eError,eError),//58-5f 
00094 PCK4BITS(eError,eError,eError,eError,     7,     7,eError,eError),//60-67 
00095 PCK4BITS(eError,eError,eError,eError,eError,eError,eError,eError),//68-6f 
00096 PCK4BITS(eError,eError,     9,     9,     9,     9,eError,eError),//70-77 
00097 PCK4BITS(eError,eError,eError,eError,eError,eError,eError,eError),//78-7f 
00098 PCK4BITS(eError,eError,eError,eError,eError,     9,eError,eError),//80-87 
00099 PCK4BITS(eError,eError,eError,eError,eError,eError,eError,eError),//88-8f 
00100 PCK4BITS(eError,eError,     12,     12,     12,     12,eError,eError),//90-97 
00101 PCK4BITS(eError,eError,eError,eError,eError,eError,eError,eError),//98-9f 
00102 PCK4BITS(eError,eError,eError,eError,eError,     12,eError,eError),//a0-a7 
00103 PCK4BITS(eError,eError,eError,eError,eError,eError,eError,eError),//a8-af 
00104 PCK4BITS(eError,eError,     12,     12,     12,eError,eError,eError),//b0-b7 
00105 PCK4BITS(eError,eError,eError,eError,eError,eError,eError,eError),//b8-bf 
00106 PCK4BITS(eError,eError,eStart,eStart,eStart,eStart,eError,eError),//c0-c7 
00107 PCK4BITS(eError,eError,eError,eError,eError,eError,eError,eError) //c8-cf 
00108 };
00109 
00110 
00111 static nsVerifier nsUTF8Verifier = {
00112      "UTF-8",
00113     {
00114        eIdxSft4bits, 
00115        eSftMsk4bits, 
00116        eBitSft4bits, 
00117        eUnitMsk4bits, 
00118        UTF8_cls 
00119     },
00120     16,
00121     {
00122        eIdxSft4bits, 
00123        eSftMsk4bits, 
00124        eBitSft4bits, 
00125        eUnitMsk4bits, 
00126        UTF8_st 
00127     }
00128 };