Ignore:
Timestamp:
Jan 21, 2018, 12:10:09 AM (6 years ago)
Author:
coas-nagasima
Message:

prototoolに関連するプロジェクトをnewlibからmuslを使うよう変更・更新
ntshellをnewlibの下位の実装から、muslのsyscallの実装に変更・更新
以下のOSSをアップデート
・mruby-1.3.0
・musl-1.1.18
・onigmo-6.1.3
・tcc-0.9.27
以下のOSSを追加
・openssl-1.1.0e
・curl-7.57.0
・zlib-1.2.11
以下のmrbgemsを追加
・iij/mruby-digest
・iij/mruby-env
・iij/mruby-errno
・iij/mruby-iijson
・iij/mruby-ipaddr
・iij/mruby-mock
・iij/mruby-require
・iij/mruby-tls-openssl

Location:
EcnlProtoTool/trunk/onigmo-6.1.3
Files:
1 copied
1 moved

Legend:

Unmodified
Added
Removed
  • EcnlProtoTool/trunk/onigmo-6.1.3/src/enc/utf_8.c

    r321 r331  
    11/**********************************************************************
    2   utf8.c -  Oniguruma (regular expression library)
     2  utf_8.c -  Oniguruma (regular expression library)
    33**********************************************************************/
    44/*-
     
    2929
    3030#include "regenc.h"
     31#ifdef RUBY
     32# include "encindex.h"
     33#endif
     34
     35#ifndef ENCINDEX_UTF_8
     36# define ENCINDEX_UTF_8 0
     37#endif
    3138
    3239#define USE_INVALID_CODE_SCHEME
     
    3441#ifdef USE_INVALID_CODE_SCHEME
    3542/* virtual codepoint values for invalid encoding byte 0xfe and 0xff */
    36 #define INVALID_CODE_FE   0xfffffffe
    37 #define INVALID_CODE_FF   0xffffffff
    38 #define VALID_CODE_LIMIT  0x7fffffff
    39 #endif
     43# define INVALID_CODE_FE  0xfffffffe
     44# define INVALID_CODE_FF  0xffffffff
     45#endif
     46#define VALID_CODE_LIMIT  0x0010ffff
    4047
    4148#define utf8_islead(c)     ((UChar )((c) & 0xc0) != 0x80)
     
    5764  2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
    5865  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
    59   4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 1, 1
     66  4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
    6067};
    6168
    62 static int
    63 mbc_enc_len(const UChar* p)
    64 {
    65   return EncLen_UTF8[*p];
    66 }
    67 
    68 static int
    69 is_mbc_newline(const UChar* p, const UChar* end)
     69typedef enum {
     70  FAILURE = -2,
     71  ACCEPT,
     72  S0, S1, S2, S3,
     73  S4, S5, S6, S7
     74} state_t;
     75#define A ACCEPT
     76#define F FAILURE
     77static const signed char trans[][0x100] = {
     78  { /* S0   0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f */
     79    /* 0 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
     80    /* 1 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
     81    /* 2 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
     82    /* 3 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
     83    /* 4 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
     84    /* 5 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
     85    /* 6 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
     86    /* 7 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
     87    /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     88    /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     89    /* a */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     90    /* b */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     91    /* c */ F, F, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
     92    /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
     93    /* e */ 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3,
     94    /* f */ 5, 6, 6, 6, 7, F, F, F, F, F, F, F, F, F, F, F
     95  },
     96  { /* S1   0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f */
     97    /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     98    /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     99    /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     100    /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     101    /* 4 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     102    /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     103    /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     104    /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     105    /* 8 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
     106    /* 9 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
     107    /* a */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
     108    /* b */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
     109    /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     110    /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     111    /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     112    /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F
     113  },
     114  { /* S2   0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f */
     115    /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     116    /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     117    /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     118    /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     119    /* 4 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     120    /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     121    /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     122    /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     123    /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     124    /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     125    /* a */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
     126    /* b */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
     127    /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     128    /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     129    /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     130    /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F
     131  },
     132  { /* S3   0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f */
     133    /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     134    /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     135    /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     136    /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     137    /* 4 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     138    /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     139    /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     140    /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     141    /* 8 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
     142    /* 9 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
     143    /* a */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
     144    /* b */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
     145    /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     146    /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     147    /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     148    /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F
     149  },
     150  { /* S4   0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f */
     151    /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     152    /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     153    /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     154    /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     155    /* 4 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     156    /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     157    /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     158    /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     159    /* 8 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
     160    /* 9 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
     161    /* a */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     162    /* b */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     163    /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     164    /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     165    /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     166    /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F
     167  },
     168  { /* S5   0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f */
     169    /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     170    /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     171    /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     172    /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     173    /* 4 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     174    /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     175    /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     176    /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     177    /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     178    /* 9 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
     179    /* a */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
     180    /* b */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
     181    /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     182    /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     183    /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     184    /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F
     185  },
     186  { /* S6   0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f */
     187    /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     188    /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     189    /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     190    /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     191    /* 4 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     192    /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     193    /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     194    /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     195    /* 8 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
     196    /* 9 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
     197    /* a */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
     198    /* b */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
     199    /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     200    /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     201    /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     202    /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F
     203  },
     204  { /* S7   0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f */
     205    /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     206    /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     207    /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     208    /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     209    /* 4 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     210    /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     211    /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     212    /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     213    /* 8 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
     214    /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     215    /* a */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     216    /* b */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     217    /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     218    /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     219    /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
     220    /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F
     221  },
     222};
     223#undef A
     224#undef F
     225
     226static int
     227mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc ARG_UNUSED)
     228{
     229  int firstbyte = *p++;
     230  state_t s;
     231  s = trans[0][firstbyte];
     232  if (s < 0) return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(1) :
     233                                  ONIGENC_CONSTRUCT_MBCLEN_INVALID();
     234
     235  if (p == e) return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(EncLen_UTF8[firstbyte]-1);
     236  s = trans[s][*p++];
     237  if (s < 0) return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(2) :
     238                                  ONIGENC_CONSTRUCT_MBCLEN_INVALID();
     239
     240  if (p == e) return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(EncLen_UTF8[firstbyte]-2);
     241  s = trans[s][*p++];
     242  if (s < 0) return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(3) :
     243                                  ONIGENC_CONSTRUCT_MBCLEN_INVALID();
     244
     245  if (p == e) return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(EncLen_UTF8[firstbyte]-3);
     246  s = trans[s][*p++];
     247  return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(4) :
     248                       ONIGENC_CONSTRUCT_MBCLEN_INVALID();
     249}
     250
     251static int
     252is_mbc_newline(const UChar* p, const UChar* end, OnigEncoding enc)
    70253{
    71254  if (p < end) {
     
    90273
    91274static OnigCodePoint
    92 mbc_to_code(const UChar* p, const UChar* end ARG_UNUSED)
     275mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
    93276{
    94277  int c, len;
    95278  OnigCodePoint n;
    96279
    97   len = mbc_enc_len(p);
     280  len = mbc_enc_len(p, end, enc);
    98281  c = *p++;
    99282  if (len > 1) {
     
    117300
    118301static int
    119 code_to_mbclen(OnigCodePoint code)
     302code_to_mbclen(OnigCodePoint code, OnigEncoding enc ARG_UNUSED)
    120303{
    121304  if      ((code & 0xffffff80) == 0) return 1;
    122305  else if ((code & 0xfffff800) == 0) return 2;
    123306  else if ((code & 0xffff0000) == 0) return 3;
    124   else if ((code & 0xffe00000) == 0) return 4;
    125   else if ((code & 0xfc000000) == 0) return 5;
    126   else if ((code & 0x80000000) == 0) return 6;
     307  else if (code <= VALID_CODE_LIMIT) return 4;
    127308#ifdef USE_INVALID_CODE_SCHEME
    128309  else if (code == INVALID_CODE_FE) return 1;
     
    130311#endif
    131312  else
    132     return ONIGERR_INVALID_CODE_POINT_VALUE;
    133 }
    134 
    135 static int
    136 code_to_mbc(OnigCodePoint code, UChar *buf)
     313    return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE;
     314}
     315
     316static int
     317code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc ARG_UNUSED)
    137318{
    138319#define UTF8_TRAILS(code, shift) (UChar )((((code) >> (shift)) & 0x3f) | 0x80)
     
    153334      *p++ = UTF8_TRAILS(code, 6);
    154335    }
    155     else if ((code & 0xffe00000) == 0) {
     336    else if (code <= VALID_CODE_LIMIT) {
    156337      *p++ = (UChar )(((code>>18) & 0x07) | 0xf0);
    157       *p++ = UTF8_TRAILS(code, 12);
    158       *p++ = UTF8_TRAILS(code,  6);
    159     }
    160     else if ((code & 0xfc000000) == 0) {
    161       *p++ = (UChar )(((code>>24) & 0x03) | 0xf8);
    162       *p++ = UTF8_TRAILS(code, 18);
    163       *p++ = UTF8_TRAILS(code, 12);
    164       *p++ = UTF8_TRAILS(code,  6);
    165     }
    166     else if ((code & 0x80000000) == 0) {
    167       *p++ = (UChar )(((code>>30) & 0x01) | 0xfc);
    168       *p++ = UTF8_TRAILS(code, 24);
    169       *p++ = UTF8_TRAILS(code, 18);
    170338      *p++ = UTF8_TRAILS(code, 12);
    171339      *p++ = UTF8_TRAILS(code,  6);
     
    192360static int
    193361mbc_case_fold(OnigCaseFoldType flag, const UChar** pp,
    194               const UChar* end, UChar* fold)
     362              const UChar* end, UChar* fold, OnigEncoding enc)
    195363{
    196364  const UChar* p = *pp;
     
    213381  }
    214382  else {
    215     return onigenc_unicode_mbc_case_fold(ONIG_ENCODING_UTF8, flag,
    216                                          pp, end, fold);
    217   }
    218 }
    219 
    220 #if 0
    221 static int
    222 is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
    223 {
    224   const UChar* p = *pp;
    225 
    226   if (ONIGENC_IS_MBC_ASCII(p)) {
    227     (*pp)++;
    228     return ONIGENC_IS_ASCII_CODE_CASE_AMBIG(*p);
    229   }
    230   else {
    231     (*pp) += mbc_enc_len(p);
    232 
    233     if (*p == 0xc3) {
    234       int c = *(p + 1);
    235       if (c >= 0x80) {
    236         if (c <= (UChar )0x9e) { /* upper */
    237           if (c == (UChar )0x97) return FALSE;
    238           return TRUE;
    239         }
    240         else if (c >= (UChar )0xa0 && c <= (UChar )0xbe) { /* lower */
    241           if (c == (UChar )'\267') return FALSE;
    242           return TRUE;
    243         }
    244         else if (c == (UChar )0x9f &&
    245                  (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
    246           return TRUE;
    247         }
    248       }
    249     }
    250   }
    251 
    252   return FALSE;
    253 }
    254 #endif
     383    return onigenc_unicode_mbc_case_fold(enc, flag, pp, end, fold);
     384  }
     385}
    255386
    256387
    257388static int
    258389get_ctype_code_range(OnigCtype ctype, OnigCodePoint *sb_out,
    259                      const OnigCodePoint* ranges[])
     390                     const OnigCodePoint* ranges[], OnigEncoding enc ARG_UNUSED)
    260391{
    261392  *sb_out = 0x80;
     
    265396
    266397static UChar*
    267 left_adjust_char_head(const UChar* start, const UChar* s)
     398left_adjust_char_head(const UChar* start, const UChar* s, const UChar* end, OnigEncoding enc ARG_UNUSED)
    268399{
    269400  const UChar *p;
     
    278409static int
    279410get_case_fold_codes_by_str(OnigCaseFoldType flag,
    280     const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[])
    281 {
    282   return onigenc_unicode_get_case_fold_codes_by_str(ONIG_ENCODING_UTF8,
    283                                                     flag, p, end, items);
    284 }
    285 
    286 OnigEncodingType OnigEncodingUTF8 = {
     411    const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[],
     412    OnigEncoding enc)
     413{
     414  return onigenc_unicode_get_case_fold_codes_by_str(enc, flag, p, end, items);
     415}
     416
     417OnigEncodingDefine(utf_8, UTF_8) = {
    287418  mbc_enc_len,
    288419  "UTF-8",     /* name */
    289   6,           /* max byte length */
     420  4,           /* max byte length */
    290421  1,           /* min byte length */
    291422  is_mbc_newline,
     
    301432  left_adjust_char_head,
    302433  onigenc_always_true_is_allowed_reverse_match,
     434  onigenc_unicode_case_map,
     435  ENCINDEX_UTF_8,
    303436  ONIGENC_FLAG_UNICODE,
    304437};
     438ENC_ALIAS("CP65001", "UTF-8")
     439
     440/*
     441 * Name: UTF8-MAC
     442 * Link: http://developer.apple.com/documentation/MacOSX/Conceptual/BPFileSystem/BPFileSystem.html
     443 * Link: http://developer.apple.com/qa/qa2001/qa1235.html
     444 * Link: http://developer.apple.com/jp/qa/qa2001/qa1235.html
     445 * Link: http://www.gnu.org/software/emacs/NEWS.23.2
     446 */
     447ENC_REPLICATE("UTF8-MAC", "UTF-8")
     448ENC_ALIAS("UTF-8-MAC", "UTF8-MAC")
     449ENC_ALIAS("UTF-8-HFS", "UTF8-MAC") /* Emacs 23.2 */
Note: See TracChangeset for help on using the changeset viewer.