Back to index

lightning-sunbird  0.9+nobinonly
Functions | Variables
cattable.h File Reference
#include "nscore.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

static PRUint8 GetCat (PRUint32 u)

Variables

static const PRUint8 gGenCatIdx1 [256]
static const PRUint8 gGenCatIdx2 [592]
static const PRUint8 gGenCatIdx3 [736]
static const PRUint8 gGenCatIdx4 [8]
static const PRUint8 gGenCatIdx5 [272]
static const PRUint8 gGenCatIdx6 [160]
static const PRUint8 gGenCatIdx7 [150]
static const PRUint8 gGenCatIdx8 [8]
static const PRUint8 gGenCatIdx9 [4]
static const PRUint8 gGenCatIdx10 [12]
static const PRUint8 gGenCatIdx11 [144]
static const PRUint8 gGenCatIdx12 [256]
static const PRUint32 gGenCatPatPl0 []
static const PRUint32 gGenCatPatPl1 []

Function Documentation

static PRUint8 GetCat ( PRUint32  u) [static]

Definition at line 3018 of file cattable.h.

{
    PRUint32 pat;
    //
    //  Handle block which use index table mapping    
    //
    // Handle U+000000 to U+0007FF
    if(0x000000 <= u && u <= 0x0007FF) {
        pat = gGenCatPatPl0[gGenCatIdx1 [( u - 0x000000 ) / 8]];
        return (pat  >> ((u % 8) * 4)) & 0x0F;
    }

    // Handle U+000900 to U+001B7F
    if(0x000900 <= u && u <= 0x001B7F) {
        pat = gGenCatPatPl0[gGenCatIdx2 [( u - 0x000900 ) / 8]];
        return (pat  >> ((u % 8) * 4)) & 0x0F;
    }

    // Handle U+001D00 to U+0033FF
    if(0x001D00 <= u && u <= 0x0033FF) {
        pat = gGenCatPatPl1[gGenCatIdx3 [( u - 0x001D00 ) / 8]];
        return (pat  >> ((u % 8) * 4)) & 0x0F;
    }

    // Handle U+004DC0 to U+004DFF
    if(0x004DC0 <= u && u <= 0x004DFF) {
        pat = gGenCatPatPl1[gGenCatIdx4 [( u - 0x004DC0 ) / 8]];
        return (pat  >> ((u % 8) * 4)) & 0x0F;
    }

    // Handle U+00A000 to U+00A87F
    if(0x00A000 <= u && u <= 0x00A87F) {
        pat = gGenCatPatPl1[gGenCatIdx5 [( u - 0x00A000 ) / 8]];
        return (pat  >> ((u % 8) * 4)) & 0x0F;
    }

    // Handle U+00FB00 to U+00FFFF
    if(0x00FB00 <= u && u <= 0x00FFFF) {
        pat = gGenCatPatPl1[gGenCatIdx6 [( u - 0x00FB00 ) / 8]];
        return (pat  >> ((u % 8) * 4)) & 0x0F;
    }

    // Handle U+010000 to U+0104AF
    if(0x010000 <= u && u <= 0x0104AF) {
        pat = gGenCatPatPl1[gGenCatIdx7 [( u - 0x010000 ) / 8]];
        return (pat  >> ((u % 8) * 4)) & 0x0F;
    }

    // Handle U+010800 to U+01083F
    if(0x010800 <= u && u <= 0x01083F) {
        pat = gGenCatPatPl1[gGenCatIdx8 [( u - 0x010800 ) / 8]];
        return (pat  >> ((u % 8) * 4)) & 0x0F;
    }

    // Handle U+010900 to U+01091F
    if(0x010900 <= u && u <= 0x01091F) {
        pat = gGenCatPatPl1[gGenCatIdx9 [( u - 0x010900 ) / 8]];
        return (pat  >> ((u % 8) * 4)) & 0x0F;
    }

    // Handle U+010A00 to U+010A5F
    if(0x010A00 <= u && u <= 0x010A5F) {
        pat = gGenCatPatPl1[gGenCatIdx10 [( u - 0x010A00 ) / 8]];
        return (pat  >> ((u % 8) * 4)) & 0x0F;
    }

    // Handle U+012000 to U+01247F
    if(0x012000 <= u && u <= 0x01247F) {
        pat = gGenCatPatPl1[gGenCatIdx11 [( u - 0x012000 ) / 8]];
        return (pat  >> ((u % 8) * 4)) & 0x0F;
    }

    // Handle U+01D000 to U+01D7FF
    if(0x01D000 <= u && u <= 0x01D7FF) {
        pat = gGenCatPatPl1[gGenCatIdx12 [( u - 0x01D000 ) / 8]];
        return (pat  >> ((u % 8) * 4)) & 0x0F;
    }

    //
    //  Handle blocks which share the same category 
    //
    // Handle CJK Ideograph Extension A block 
    if(0x3400 <= u && u <= 0x4DB5) 
        return 5; 

    // Handle CJK Ideograph block 
    if(0x4E00 <= u && u <= 0x9FBB) 
        return 5; 

    // Handle Hangul Syllable block 
    if(0xAC00 <= u && u <= 0xD7A3) 
        return 5; 

    // Handle Non Private Use High Surrogate block 
    if(0xD800 <= u && u <= 0xDB7F) 
        return 4; 

    // Handle Private Use High Surrogate block 
    if(0xDB80 <= u && u <= 0xDBFF) 
        return 4; 

    // Handle Low Surrogate block 
    if(0xDC00 <= u && u <= 0xDFFF) 
        return 4; 

    // Handle Private Use block 
    if(0xE000 <= u && u <= 0xF8FF) 
        return 4; 

    // Handle CJK Compatibility #1 block 
    if(0xF900 <= u && u <= 0xFA2D) 
        return 5; 

    // Handle CJK Compatibility #2 block 
    if(0xFA30 <= u && u <= 0xFA6A) 
        return 5; 

    // Handle CJK Compatibility #3 block 
    if(0xFA70 <= u && u <= 0xFAD9) 
        return 5; 

    // Handle CJK Ideograph Extension B block 
    if(0x20000 <= u && u <= 0x2A6D6) 
        return 5; 

    // Handle CJK Compatibility #4 block 
    if(0x2F800 <= u && u <= 0x2FA1D) 
        return 5; 

    // Handle Plane 15 Private Use block 
    if(0xF0000 <= u && u <= 0xFFFFD) 
        return 4; 

    // Handle Plane 16 Private Use block 
    if(0x100000 <= u && u <= 0x10FFFD) 
        return 4; 

    return 0; // UNDEFINE 
}

Variable Documentation

const PRUint8 gGenCatIdx1[256] [static]

Definition at line 43 of file cattable.h.

const PRUint8 gGenCatIdx10[12] [static]
Initial value:
 {
    131,  
    132,  
    114,  
     77,  
      0,  
      0,  
      5,  
    133,  
     28,  
      3,  
     19,  
    134,  
}

Definition at line 2256 of file cattable.h.

const PRUint8 gGenCatIdx11[144] [static]

Definition at line 2271 of file cattable.h.

const PRUint8 gGenCatIdx12[256] [static]

Definition at line 2418 of file cattable.h.

const PRUint8 gGenCatIdx2[592] [static]

Definition at line 302 of file cattable.h.

const PRUint8 gGenCatIdx3[736] [static]

Definition at line 897 of file cattable.h.

const PRUint8 gGenCatIdx4[8] [static]
Initial value:
 {
     31,  
     31,  
     31,  
     31,  
     31,  
     31,  
     31,  
     31,  
}

Definition at line 1636 of file cattable.h.

const PRUint8 gGenCatIdx5[272] [static]

Definition at line 1647 of file cattable.h.

const PRUint8 gGenCatIdx6[160] [static]

Definition at line 1922 of file cattable.h.

const PRUint8 gGenCatIdx7[150] [static]

Definition at line 2085 of file cattable.h.

const PRUint8 gGenCatIdx8[8] [static]
Initial value:
 {
      7,  
    126,  
      0,  
      0,  
      0,  
      0,  
    127,  
    128,  
}

Definition at line 2238 of file cattable.h.

const PRUint8 gGenCatIdx9[4] [static]
Initial value:
 {
      0,  
      0,  
    129,  
    130,  
}

Definition at line 2249 of file cattable.h.

Definition at line 2677 of file cattable.h.

Definition at line 2861 of file cattable.h.