1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ascii.c, euc_jp.c, oniggnu.h, oniguruma.h, regcomp.c, regenc.c, regenc.h, regerror.c, regexec.c, regint.h, regparse.c, regparse.h, sjis.c, utf8.c: imported Oni Guruma 3.7.0.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ksaito 2005-02-23 12:47:23 +00:00
parent f052429aa5
commit be587c77ef
8 changed files with 215 additions and 173 deletions

22
utf8.c
View file

@ -2,7 +2,7 @@
utf8.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2004 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2005 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -60,13 +60,13 @@ static int EncLen_UTF8[] = {
};
static int
utf8_mbc_enc_len(UChar* p)
utf8_mbc_enc_len(const UChar* p)
{
return EncLen_UTF8[*p];
}
static OnigCodePoint
utf8_mbc_to_code(UChar* p, UChar* end)
utf8_mbc_to_code(const UChar* p, const UChar* end)
{
int c, len;
OnigCodePoint n;
@ -195,9 +195,9 @@ utf8_code_to_mbc(OnigCodePoint code, UChar *buf)
}
static int
utf8_mbc_to_normalize(OnigAmbigType flag, UChar** pp, UChar* end, UChar* lower)
utf8_mbc_to_normalize(OnigAmbigType flag, const UChar** pp, const UChar* end, UChar* lower)
{
UChar* p = *pp;
const UChar* p = *pp;
if (ONIGENC_IS_MBC_ASCII(p)) {
if (end > p + 1 &&
@ -260,9 +260,9 @@ utf8_mbc_to_normalize(OnigAmbigType flag, UChar** pp, UChar* end, UChar* lower)
}
static int
utf8_is_mbc_ambiguous(OnigAmbigType flag, UChar** pp, UChar* end)
utf8_is_mbc_ambiguous(OnigAmbigType flag, const UChar** pp, const UChar* end)
{
UChar* p = *pp;
const UChar* p = *pp;
if (ONIGENC_IS_MBC_ASCII(p)) {
if (end > p + 1 &&
@ -3696,15 +3696,15 @@ utf8_is_code_ctype(OnigCodePoint code, unsigned int ctype)
}
static UChar*
utf8_left_adjust_char_head(UChar* start, UChar* s)
utf8_left_adjust_char_head(const UChar* start, const UChar* s)
{
UChar *p;
const UChar *p;
if (s <= start) return s;
if (s <= start) return (UChar* )s;
p = s;
while (!utf8_islead(*p) && p > start) p--;
return p;
return (UChar* )p;
}
OnigEncodingType OnigEncodingUTF8 = {