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 (PRUnichar u)

Variables

static const PRUint8 gGenCatIdx1 [224]
static const PRUint8 gGenCatIdx2 [288]
static const PRUint8 gGenCatIdx3 [320]
static const PRUint8 gGenCatIdx4 [128]
static const PRUint8 gGenCatIdx5 [224]
static PRUint32 gGenCatPat [201]

Function Documentation

static PRUint8 GetCat ( PRUnichar  u) [static]

Definition at line 1446 of file cattable.h.

{
    PRUint32 pat;
    //
    //  Handle block which use index table mapping    
    //
    // Handle U+0000 to U+06FF
    if( (u<=((PRUnichar)0x06FF))) {
        pat = gGenCatPat[gGenCatIdx1 [( u -(PRUnichar) 0x0000 ) / 8]];
        return (pat  >> ((u % 8) * 4)) & 0x0F;
    }

    // Handle U+0900 to U+11FF
    if((((PRUnichar)0x0900)<=u)&&(u<=((PRUnichar)0x11FF))) {
        pat = gGenCatPat[gGenCatIdx2 [( u -(PRUnichar) 0x0900 ) / 8]];
        return (pat  >> ((u % 8) * 4)) & 0x0F;
    }

    // Handle U+1E00 to U+27FF
    if((((PRUnichar)0x1E00)<=u)&&(u<=((PRUnichar)0x27FF))) {
        pat = gGenCatPat[gGenCatIdx3 [( u -(PRUnichar) 0x1E00 ) / 8]];
        return (pat  >> ((u % 8) * 4)) & 0x0F;
    }

    // Handle U+3000 to U+33FF
    if((((PRUnichar)0x3000)<=u)&&(u<=((PRUnichar)0x33FF))) {
        pat = gGenCatPat[gGenCatIdx4 [( u -(PRUnichar) 0x3000 ) / 8]];
        return (pat  >> ((u % 8) * 4)) & 0x0F;
    }

    // Handle U+F900 to U+FFFF
    if((((PRUnichar)0xF900)<=u)&&(u<=((PRUnichar)0xFFFF))) {
        pat = gGenCatPat[gGenCatIdx5 [( u -(PRUnichar) 0xF900 ) / 8]];
        return (pat  >> ((u % 8) * 4)) & 0x0F;
    }

    //
    //  Handle blocks which share the same category 
    //
    // Handle CJK Ideograp block 
    if((((PRUnichar)0x4E00)<=u)&&(u<=((PRUnichar)0x9FA5))) 
        return 5; 

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

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

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

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

    // Handle Unassigned High Surrogat block 
    if((((PRUnichar)0xD800)<=u)&&(u<=((PRUnichar)0xDB7F))) 
        return 4; 

    return 0; // UNDEFINE 
}

Here is the caller graph for this function:


Variable Documentation

const PRUint8 gGenCatIdx1[224] [static]

Definition at line 43 of file cattable.h.

const PRUint8 gGenCatIdx2[288] [static]

Definition at line 270 of file cattable.h.

const PRUint8 gGenCatIdx3[320] [static]

Definition at line 561 of file cattable.h.

const PRUint8 gGenCatIdx4[128] [static]

Definition at line 884 of file cattable.h.

const PRUint8 gGenCatIdx5[224] [static]

Definition at line 1015 of file cattable.h.

PRUint32 gGenCatPat[201] [static]

Definition at line 1242 of file cattable.h.