Back to index

php5  5.3.10
Defines | Functions | Variables
unicode.c File Reference
#include "regenc.h"

Go to the source code of this file.

Defines

#define CR_SET(list)

Functions

int onigenc_unicode_is_code_ctype (OnigCodePoint code, unsigned int ctype)
int onigenc_unicode_get_ctype_code_range (int ctype, const OnigCodePoint *sbr[], const OnigCodePoint *mbr[])

Variables

const unsigned short OnigEnc_Unicode_ISO_8859_1_CtypeTable [256]
static const OnigCodePoint CRAlnum []
static const OnigCodePoint CRAlpha []
static const OnigCodePoint CRBlank []
static const OnigCodePoint CRCntrl []
static const OnigCodePoint CRDigit []
static const OnigCodePoint CRGraph []
static const OnigCodePoint CRLower []
static const OnigCodePoint CRPrint []
static const OnigCodePoint CRPunct []
static const OnigCodePoint CRSpace []
static const OnigCodePoint CRUpper []
static const OnigCodePoint CRXDigit []
static const OnigCodePoint CRASCII []
static const OnigCodePoint CRWord []

Define Documentation

#define CR_SET (   list)
Value:
do { \
  *mbr = list; \
} while (0)

Function Documentation

int onigenc_unicode_get_ctype_code_range ( int  ctype,
const OnigCodePoint sbr[],
const OnigCodePoint mbr[] 
)

Definition at line 3342 of file unicode.c.

{
  static const OnigCodePoint EmptyRange[] = { 0 };

#define CR_SET(list) do { \
  *mbr = list; \
} while (0)

  *sbr = EmptyRange;

  switch (ctype) {
  case ONIGENC_CTYPE_ALPHA:
    CR_SET(CRAlpha);
    break;
  case ONIGENC_CTYPE_BLANK:
    CR_SET(CRBlank);
    break;
  case ONIGENC_CTYPE_CNTRL:
    CR_SET(CRCntrl);
    break;
  case ONIGENC_CTYPE_DIGIT:
    CR_SET(CRDigit);
    break;
  case ONIGENC_CTYPE_GRAPH:
    CR_SET(CRGraph);
    break;
  case ONIGENC_CTYPE_LOWER:
    CR_SET(CRLower);
    break;
  case ONIGENC_CTYPE_PRINT:
    CR_SET(CRPrint);
    break;
  case ONIGENC_CTYPE_PUNCT:
    CR_SET(CRPunct);
    break;
  case ONIGENC_CTYPE_SPACE:
    CR_SET(CRSpace);
    break;
  case ONIGENC_CTYPE_UPPER:
    CR_SET(CRUpper);
    break;
  case ONIGENC_CTYPE_XDIGIT:
    CR_SET(CRXDigit);
    break;
  case ONIGENC_CTYPE_WORD:
    CR_SET(CRWord);
    break;
  case ONIGENC_CTYPE_ASCII:
    CR_SET(CRASCII);
    break;
  case ONIGENC_CTYPE_ALNUM:
    CR_SET(CRAlnum);
    break;

  default:
    return ONIGENCERR_TYPE_BUG;
    break;
  }

  return 0;
}
int onigenc_unicode_is_code_ctype ( OnigCodePoint  code,
unsigned int  ctype 
)

Definition at line 3272 of file unicode.c.

{
  if (code < 256) {
    return ONIGENC_IS_UNICODE_ISO_8859_1_CTYPE(code, ctype);
  }

#ifdef USE_UNICODE_FULL_RANGE_CTYPE

  switch (ctype) {
  case ONIGENC_CTYPE_ALPHA:
    return onig_is_in_code_range((UChar* )CRAlpha, code);
    break;
  case ONIGENC_CTYPE_BLANK:
    return onig_is_in_code_range((UChar* )CRBlank, code);
    break;
  case ONIGENC_CTYPE_CNTRL:
    return onig_is_in_code_range((UChar* )CRCntrl, code);
    break;
  case ONIGENC_CTYPE_DIGIT:
    return onig_is_in_code_range((UChar* )CRDigit, code);
    break;
  case ONIGENC_CTYPE_GRAPH:
    return onig_is_in_code_range((UChar* )CRGraph, code);
    break;
  case ONIGENC_CTYPE_LOWER:
    return onig_is_in_code_range((UChar* )CRLower, code);
    break;
  case ONIGENC_CTYPE_PRINT:
    return onig_is_in_code_range((UChar* )CRPrint, code);
    break;
  case ONIGENC_CTYPE_PUNCT:
    return onig_is_in_code_range((UChar* )CRPunct, code);
    break;
  case ONIGENC_CTYPE_SPACE:
    return onig_is_in_code_range((UChar* )CRSpace, code);
    break;
  case ONIGENC_CTYPE_UPPER:
    return onig_is_in_code_range((UChar* )CRUpper, code);
    break;
  case ONIGENC_CTYPE_XDIGIT:
    return FALSE;
    break;
  case ONIGENC_CTYPE_WORD:
    return onig_is_in_code_range((UChar* )CRWord, code);
    break;
  case ONIGENC_CTYPE_ASCII:
    return FALSE;
    break;
  case ONIGENC_CTYPE_ALNUM:
    return onig_is_in_code_range((UChar* )CRAlnum, code);
    break;
  case ONIGENC_CTYPE_NEWLINE:
    return FALSE;
    break;

  default:
    return ONIGENCERR_TYPE_BUG;
    break;
  }

#else

  if ((ctype & ONIGENC_CTYPE_WORD) != 0) {
    return TRUE;
  }
  return FALSE;
#endif /* USE_UNICODE_FULL_RANGE_CTYPE */
}

Here is the call graph for this function:


Variable Documentation

const OnigCodePoint CRAlnum[] [static]

Definition at line 68 of file unicode.c.

const OnigCodePoint CRAlpha[] [static]

Definition at line 493 of file unicode.c.

const OnigCodePoint CRASCII[] [static]
Initial value:
 {



  1,

  0x0000, 0x007f
}

Definition at line 2813 of file unicode.c.

const OnigCodePoint CRBlank[] [static]
Initial value:
 {



  3,

  0x0009, 0x0009,
  0x0020, 0x0020,
  0x00a0, 0x00a0








 
}

Definition at line 900 of file unicode.c.

const OnigCodePoint CRCntrl[] [static]
Initial value:
 {



  3,

  0x0000, 0x001f,
  0x007f, 0x009f,
  0x00ad, 0x00ad


















 
}

Definition at line 920 of file unicode.c.

const OnigCodePoint CRDigit[] [static]

Definition at line 950 of file unicode.c.

const OnigCodePoint CRGraph[] [static]

Definition at line 984 of file unicode.c.

const OnigCodePoint CRLower[] [static]

Definition at line 1400 of file unicode.c.

const OnigCodePoint CRPrint[] [static]

Definition at line 1835 of file unicode.c.

const OnigCodePoint CRPunct[] [static]

Definition at line 2251 of file unicode.c.

const OnigCodePoint CRSpace[] [static]
Initial value:
 {



  4,

  0x0009, 0x000d,
  0x0020, 0x0020,
  0x0085, 0x0085,
  0x00a0, 0x00a0









 
}

Definition at line 2348 of file unicode.c.

const OnigCodePoint CRUpper[] [static]

Definition at line 2370 of file unicode.c.

const OnigCodePoint CRWord[] [static]

Definition at line 2822 of file unicode.c.

const OnigCodePoint CRXDigit[] [static]
Initial value:
 {



  3,

  0x0030, 0x0039,
  0x0041, 0x0046,
  0x0061, 0x0066
}

Definition at line 2802 of file unicode.c.

const unsigned short OnigEnc_Unicode_ISO_8859_1_CtypeTable[256]

Definition at line 33 of file unicode.c.