Ruby  1.9.3p551(2014-11-13revision48407)
Macros | Enumerations | Functions | Variables
gb18030.c File Reference
#include "regenc.h"

Go to the source code of this file.

Macros

#define DEBUG_GB18030(arg)
 
#define A   ACCEPT
 
#define F   FAILURE
 
#define RETURN(n)
 

Enumerations

enum  { C1, C2, C4, CM }
 
enum  state_t {
  FAILURE = -2, ACCEPT = -1, S0 = 0, S1,
  FAILURE = -2, ACCEPT = -1, S0 = 0, S1,
  FAILURE = -2, ACCEPT = -1, S0 = 0, S1,
  S2, S3, S4, S5,
  S6, FAILURE = -2, ACCEPT = -1, S0 = 0,
  S1, S2, FAILURE = -2, ACCEPT = -1,
  S0 = 0, S1, FAILURE = -2, ACCEPT = -1,
  S0 = 0, S1, S2, S3,
  FAILURE = -2, ACCEPT = -1, S0 = 0, S1,
  S2, S3, FAILURE = -2, ACCEPT = -1,
  S0 = 0, S1, FAILURE = -2, ACCEPT = -1,
  S0 = 0, S1, FAILURE = -2, ACCEPT,
  S0, S1, S2, S3,
  S4, S5, S6, S7
}
 
enum  state {
  S_START, S_one_C2, S_one_C4, S_one_CM,
  S_odd_CM_one_CX, S_even_CM_one_CX, S_one_CMC4, S_odd_CMC4,
  S_one_C4_odd_CMC4, S_even_CMC4, S_one_C4_even_CMC4, S_odd_CM_odd_CMC4,
  S_even_CM_odd_CMC4, S_odd_CM_even_CMC4, S_even_CM_even_CMC4, S_odd_C4CM,
  S_one_CM_odd_C4CM, S_even_C4CM, S_one_CM_even_C4CM, S_even_CM_odd_C4CM,
  S_odd_CM_odd_C4CM, S_even_CM_even_C4CM, S_odd_CM_even_C4CM
}
 

Functions

static int gb18030_mbc_enc_len (const UChar *p, const UChar *e, OnigEncoding enc ARG_UNUSED)
 
static OnigCodePoint gb18030_mbc_to_code (const UChar *p, const UChar *end, OnigEncoding enc)
 
static int gb18030_code_to_mbc (OnigCodePoint code, UChar *buf, OnigEncoding enc)
 
static int gb18030_mbc_case_fold (OnigCaseFoldType flag, const UChar **pp, const UChar *end, UChar *lower, OnigEncoding enc)
 
static int gb18030_is_code_ctype (OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
 
static UChargb18030_left_adjust_char_head (const UChar *start, const UChar *s, const UChar *end, OnigEncoding enc)
 
static int gb18030_is_allowed_reverse_match (const UChar *s, const UChar *end ARG_UNUSED, OnigEncoding enc ARG_UNUSED)
 
 OnigEncodingDefine (gb18030, GB18030)
 

Variables

static const char GB18030_MAP []
 
static const signed char trans [][0x100]
 

Macro Definition Documentation

#define A   ACCEPT

Definition at line 66 of file gb18030.c.

#define DEBUG_GB18030 (   arg)

Definition at line 34 of file gb18030.c.

Referenced by gb18030_left_adjust_char_head().

#define F   FAILURE

Definition at line 67 of file gb18030.c.

#define RETURN (   n)

Enumeration Type Documentation

anonymous enum
Enumerator
C1 
C2 
C4 
CM 

Definition at line 39 of file gb18030.c.

enum state
Enumerator
S_START 
S_one_C2 
S_one_C4 
S_one_CM 
S_odd_CM_one_CX 
S_even_CM_one_CX 
S_one_CMC4 
S_odd_CMC4 
S_one_C4_odd_CMC4 
S_even_CMC4 
S_one_C4_even_CMC4 
S_odd_CM_odd_CMC4 
S_even_CM_odd_CMC4 
S_odd_CM_even_CMC4 
S_even_CM_even_CMC4 
S_odd_C4CM 
S_one_CM_odd_C4CM 
S_even_C4CM 
S_one_CM_even_C4CM 
S_even_CM_odd_C4CM 
S_odd_CM_odd_C4CM 
S_even_CM_even_C4CM 
S_odd_CM_even_C4CM 

Definition at line 213 of file gb18030.c.

enum state_t
Enumerator
FAILURE 
ACCEPT 
S0 
S1 
FAILURE 
ACCEPT 
S0 
S1 
FAILURE 
ACCEPT 
S0 
S1 
S2 
S3 
S4 
S5 
S6 
FAILURE 
ACCEPT 
S0 
S1 
S2 
FAILURE 
ACCEPT 
S0 
S1 
FAILURE 
ACCEPT 
S0 
S1 
S2 
S3 
FAILURE 
ACCEPT 
S0 
S1 
S2 
S3 
FAILURE 
ACCEPT 
S0 
S1 
FAILURE 
ACCEPT 
S0 
S1 
FAILURE 
ACCEPT 
S0 
S1 
S2 
S3 
S4 
S5 
S6 
S7 

Definition at line 65 of file gb18030.c.

Function Documentation

static int gb18030_code_to_mbc ( OnigCodePoint  code,
UChar buf,
OnigEncoding  enc 
)
static

Definition at line 185 of file gb18030.c.

References onigenc_mb4_code_to_mbc().

static int gb18030_is_allowed_reverse_match ( const UChar s,
const UChar *end  ARG_UNUSED,
OnigEncoding enc  ARG_UNUSED 
)
static

Definition at line 573 of file gb18030.c.

References C1, FALSE, GB18030_MAP, and TRUE.

static int gb18030_is_code_ctype ( OnigCodePoint  code,
unsigned int  ctype,
OnigEncoding  enc 
)
static

Definition at line 208 of file gb18030.c.

References onigenc_mb4_is_code_ctype().

static UChar* gb18030_left_adjust_char_head ( const UChar start,
const UChar s,
const UChar end,
OnigEncoding  enc 
)
static
static int gb18030_mbc_case_fold ( OnigCaseFoldType  flag,
const UChar **  pp,
const UChar end,
UChar lower,
OnigEncoding  enc 
)
static

Definition at line 191 of file gb18030.c.

References onigenc_mbn_mbc_case_fold().

static int gb18030_mbc_enc_len ( const UChar p,
const UChar e,
OnigEncoding enc  ARG_UNUSED 
)
static

Definition at line 146 of file gb18030.c.

References ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE, RETURN, and trans.

static OnigCodePoint gb18030_mbc_to_code ( const UChar p,
const UChar end,
OnigEncoding  enc 
)
static

Definition at line 167 of file gb18030.c.

References enclen, i, and len.

OnigEncodingDefine ( gb18030  ,
GB18030   
)

Variable Documentation

const char GB18030_MAP[]
static
Initial value:
= {
C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1,
C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1,
C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1,
C4, C4, C4, C4, C4, C4, C4, C4, C4, C4, C1, C1, C1, C1, C1, C1,
C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2,
C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2,
C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2,
C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C1,
C2, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM,
CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM,
CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM,
CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM,
CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM,
CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM,
CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM,
CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, C1
}

Definition at line 46 of file gb18030.c.

Referenced by gb18030_is_allowed_reverse_match(), and gb18030_left_adjust_char_head().

const signed char trans[][0x100]
static

Definition at line 68 of file gb18030.c.

Referenced by gb18030_mbc_enc_len().