enc/shift_jis.c File Reference

#include "regint.h"

Go to the source code of this file.

Defines

#define SJIS_ISMB_FIRST(byte)   (EncLen_SJIS[byte] > 1)
#define SJIS_ISMB_TRAIL(byte)   SJIS_CAN_BE_TRAIL_TABLE[(byte)]
#define A   ACCEPT
#define F   FAILURE

Enumerations

enum  state_t { FAILURE = -2, ACCEPT = -1, S0 = 0, S1 }

Functions

static int mbc_enc_len (const UChar *p, const UChar *e, OnigEncoding enc ARG_UNUSED)
static int code_to_mbclen (OnigCodePoint code, OnigEncoding enc ARG_UNUSED)
static OnigCodePoint mbc_to_code (const UChar *p, const UChar *end, OnigEncoding enc)
static int code_to_mbc (OnigCodePoint code, UChar *buf, OnigEncoding enc)
static int apply_all_case_fold (OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void *arg, OnigEncoding enc)
static OnigCodePoint get_lower_case (OnigCodePoint code)
static OnigCodePoint get_upper_case (OnigCodePoint code)
static int get_case_fold_codes_by_str (OnigCaseFoldType flag, const OnigUChar *p, const OnigUChar *end, OnigCaseFoldCodeItem items[], OnigEncoding enc)
static int mbc_case_fold (OnigCaseFoldType flag, const UChar **pp, const UChar *end, UChar *lower, OnigEncoding enc)
static UChar * left_adjust_char_head (const UChar *start, const UChar *s, const UChar *end, OnigEncoding enc)
static int is_allowed_reverse_match (const UChar *s, const UChar *end, OnigEncoding enc ARG_UNUSED)
static int init_property_list (void)
static int property_name_to_ctype (OnigEncoding enc, UChar *p, UChar *end)
static int is_code_ctype (OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
static int get_ctype_code_range (OnigCtype ctype, OnigCodePoint *sb_out, const OnigCodePoint *ranges[], OnigEncoding enc ARG_UNUSED)
 OnigEncodingDefine (shift_jis, Shift_JIS)

Variables

static const int EncLen_SJIS []
static const char SJIS_CAN_BE_TRAIL_TABLE [256]
static const OnigPairCaseFoldCodes CaseFoldMap []
static const signed char trans [][0x100]
static int PropertyInited = 0
static const OnigCodePoint ** PropertyList
static int PropertyListNum
static int PropertyListSize
static hash_table_typePropertyNameTable
static const OnigCodePoint CR_Hiragana []
static const OnigCodePoint CR_Katakana []
static const OnigCodePoint CR_Han []
static const OnigCodePoint CR_Latin []
static const OnigCodePoint CR_Greek []
static const OnigCodePoint CR_Cyrillic []


Define Documentation

#define A   ACCEPT

Definition at line 166 of file shift_jis.c.

#define F   FAILURE

Definition at line 167 of file shift_jis.c.

#define SJIS_ISMB_FIRST ( byte   )     (EncLen_SJIS[byte] > 1)

Definition at line 162 of file shift_jis.c.

Referenced by left_adjust_char_head().

#define SJIS_ISMB_TRAIL ( byte   )     SJIS_CAN_BE_TRAIL_TABLE[(byte)]

Definition at line 163 of file shift_jis.c.

Referenced by code_to_mbclen(), is_allowed_reverse_match(), and left_adjust_char_head().


Enumeration Type Documentation

enum state_t

Enumerator:
FAILURE 
ACCEPT 
S0 
S1 

Definition at line 165 of file shift_jis.c.


Function Documentation

static int apply_all_case_fold ( OnigCaseFoldType  flag,
OnigApplyAllCaseFoldFunc  f,
void *  arg,
OnigEncoding enc   
) [static]

Definition at line 277 of file shift_jis.c.

References CaseFoldMap, and onigenc_apply_all_case_fold_with_map().

static int code_to_mbc ( OnigCodePoint  code,
UChar *  buf,
OnigEncoding enc   
) [static]

Definition at line 262 of file shift_jis.c.

References mbc_enc_len(), and UChar.

static int code_to_mbclen ( OnigCodePoint  code,
OnigEncoding enc  ARG_UNUSED 
) [static]

Definition at line 224 of file shift_jis.c.

References EncLen_SJIS, ONIGERR_INVALID_CODE_POINT_VALUE, ONIGERR_TOO_BIG_WIDE_CHAR_VALUE, and SJIS_ISMB_TRAIL.

static int get_case_fold_codes_by_str ( OnigCaseFoldType  flag,
const OnigUChar p,
const OnigUChar end,
OnigCaseFoldCodeItem  items[],
OnigEncoding enc   
) [static]

Definition at line 325 of file shift_jis.c.

References OnigCaseFoldCodeItem::byte_len, OnigCaseFoldCodeItem::code, OnigCaseFoldCodeItem::code_len, get_lower_case(), get_upper_case(), len, mbc_enc_len(), mbc_to_code(), onigenc_ascii_get_case_fold_codes_by_str(), and ONIGENC_IS_ASCII_CODE.

static int get_ctype_code_range ( OnigCtype  ctype,
OnigCodePoint sb_out,
const OnigCodePoint ranges[],
OnigEncoding enc  ARG_UNUSED 
) [static]

Definition at line 559 of file shift_jis.c.

References ONIG_NO_SUPPORT_CONFIG, ONIGENC_MAX_STD_CTYPE, ONIGERR_TYPE_BUG, and PROPERTY_LIST_INIT_CHECK.

static OnigCodePoint get_lower_case ( OnigCodePoint  code  )  [static]

Definition at line 286 of file shift_jis.c.

References ONIGENC_IS_IN_RANGE.

static OnigCodePoint get_upper_case ( OnigCodePoint  code  )  [static]

Definition at line 305 of file shift_jis.c.

References ONIGENC_IS_IN_RANGE.

static int init_property_list ( void   )  [static]

Definition at line 497 of file shift_jis.c.

References PROPERTY_LIST_ADD_PROP.

static int is_allowed_reverse_match ( const UChar *  s,
const UChar *  end,
OnigEncoding enc  ARG_UNUSED 
) [static]

Definition at line 429 of file shift_jis.c.

References FALSE, SJIS_ISMB_TRAIL, TRUE, and UChar.

static int is_code_ctype ( OnigCodePoint  code,
unsigned int  ctype,
OnigEncoding enc   
) [static]

Definition at line 534 of file shift_jis.c.

References CTYPE_IS_WORD_GRAPH_PRINT, FALSE, onig_is_in_code_range(), ONIGENC_IS_ASCII_CODE_CTYPE, ONIGENC_MAX_STD_CTYPE, ONIGERR_TYPE_BUG, PROPERTY_LIST_INIT_CHECK, TRUE, and UChar.

static UChar* left_adjust_char_head ( const UChar *  start,
const UChar *  s,
const UChar *  end,
OnigEncoding enc   
) [static]

Definition at line 406 of file shift_jis.c.

References len, mbc_enc_len(), SJIS_ISMB_FIRST, SJIS_ISMB_TRAIL, and UChar.

static int mbc_case_fold ( OnigCaseFoldType  flag,
const UChar **  pp,
const UChar *  end,
UChar *  lower,
OnigEncoding  enc 
) [static]

Definition at line 357 of file shift_jis.c.

References code_to_mbc(), get_lower_case(), len, mbc_to_code(), ONIGENC_ASCII_CODE_TO_LOWER_CASE, ONIGENC_IS_MBC_ASCII, and UChar.

static int mbc_enc_len ( const UChar *  p,
const UChar *  e,
OnigEncoding enc  ARG_UNUSED 
) [static]

Definition at line 210 of file shift_jis.c.

References ACCEPT, EncLen_SJIS, ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND, ONIGENC_CONSTRUCT_MBCLEN_INVALID, ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE, and trans.

static OnigCodePoint mbc_to_code ( const UChar *  p,
const UChar *  end,
OnigEncoding  enc 
) [static]

Definition at line 243 of file shift_jis.c.

References len, and mbc_enc_len().

OnigEncodingDefine ( shift_jis  ,
Shift_JIS   
)

static int property_name_to_ctype ( OnigEncoding  enc,
UChar *  p,
UChar *  end 
) [static]

Definition at line 514 of file shift_jis.c.

References ALLOCA_N, onig_st_lookup_strend(), ONIGENC_ASCII_CODE_TO_LOWER_CASE, onigenc_minimum_property_name_to_ctype(), PROPERTY_LIST_INIT_CHECK, and UChar.


Variable Documentation

const OnigPairCaseFoldCodes CaseFoldMap[] [static]

Definition at line 71 of file shift_jis.c.

const OnigCodePoint CR_Cyrillic[] [static]

Initial value:

 {
  3,
  0x8440, 0x8460,
  0x8470, 0x847f,
  0x8480, 0x8491,
}

Definition at line 489 of file shift_jis.c.

const OnigCodePoint CR_Greek[] [static]

Initial value:

 {
  2,
  0x839f, 0x83b6,
  0x83bf, 0x83d6,
}

Definition at line 483 of file shift_jis.c.

const OnigCodePoint CR_Han[] [static]

Initial value:

 {
  4,
  0x8157, 0x8157,
  0x889f, 0x9872,       
  0x989f, 0x9ffc,       
  0xe040, 0xeaa4,       
}

Definition at line 466 of file shift_jis.c.

const OnigCodePoint CR_Hiragana[] [static]

Initial value:

 {
  1,
  0x829f, 0x82f1
}

Definition at line 442 of file shift_jis.c.

const OnigCodePoint CR_Katakana[] [static]

Initial value:

 {
  4,
  0x00a6, 0x00af,
  0x00b1, 0x00dd,
  0x8340, 0x837e,
  0x8380, 0x8396,
}

Definition at line 447 of file shift_jis.c.

const OnigCodePoint CR_Latin[] [static]

Initial value:

 {
  4,
  0x0041, 0x005a,
  0x0061, 0x007a,
  0x8260, 0x8279,
  0x8281, 0x829a,
}

Definition at line 475 of file shift_jis.c.

const int EncLen_SJIS[] [static]

Initial value:

 {
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1
}

Definition at line 33 of file shift_jis.c.

Referenced by code_to_mbclen(), and mbc_enc_len().

int PropertyInited = 0 [static]

Definition at line 436 of file shift_jis.c.

const OnigCodePoint** PropertyList [static]

Definition at line 437 of file shift_jis.c.

int PropertyListNum [static]

Definition at line 438 of file shift_jis.c.

int PropertyListSize [static]

Definition at line 439 of file shift_jis.c.

hash_table_type* PropertyNameTable [static]

Definition at line 440 of file shift_jis.c.

const char SJIS_CAN_BE_TRAIL_TABLE[256] [static]

Initial value:

 {
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0
}

Definition at line 52 of file shift_jis.c.

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

Definition at line 168 of file shift_jis.c.


Generated on 19 Jul 2016 for Ruby by  doxygen 1.4.7