ruby-changes:2183
From: ko1@a...
Date: 11 Oct 2007 00:05:52 +0900
Subject: [ruby-changes:2183] matz - Ruby:r13674 (trunk): * include/ruby/oniguruma.h (OnigEncodingTypeST): add OnigEncoding
matz 2007-10-11 00:05:32 +0900 (Thu, 11 Oct 2007)
New Revision: 13674
Modified files:
trunk/ChangeLog
trunk/ascii.c
trunk/euc_jp.c
trunk/include/ruby/oniguruma.h
trunk/regenc.c
trunk/regenc.h
trunk/sjis.c
trunk/unicode.c
trunk/utf8.c
trunk/version.h
Log:
* include/ruby/oniguruma.h (OnigEncodingTypeST): add OnigEncoding
parameter to every function members.
* include/ruby/oniguruma.h (OnigEncodingTypeST): add auxiliary
data member to provide user defined data for an encoding.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/include/ruby/oniguruma.h?r1=13674&r2=13673
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ascii.c?r1=13674&r2=13673
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/version.h?r1=13674&r2=13673
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/utf8.c?r1=13674&r2=13673
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/euc_jp.c?r1=13674&r2=13673
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=13674&r2=13673
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/regenc.c?r1=13674&r2=13673
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/unicode.c?r1=13674&r2=13673
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/sjis.c?r1=13674&r2=13673
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/regenc.h?r1=13674&r2=13673
Index: euc_jp.c
===================================================================
--- euc_jp.c (revision 13673)
+++ euc_jp.c (revision 13674)
@@ -51,13 +51,13 @@
};
static int
-mbc_enc_len(const UChar* p, const UChar* e)
+mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc)
{
return EncLen_EUCJP[*p];
}
static OnigCodePoint
-mbc_to_code(const UChar* p, const UChar* end)
+mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
{
int c, i, len;
OnigCodePoint n;
@@ -75,7 +75,7 @@
}
static int
-code_to_mbclen(OnigCodePoint code)
+code_to_mbclen(OnigCodePoint code, OnigEncoding enc)
{
if (ONIGENC_IS_CODE_ASCII(code)) return 1;
else if (code > 0xffffff) return 0;
@@ -104,7 +104,7 @@
#endif
static int
-code_to_mbc(OnigCodePoint code, UChar *buf)
+code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc)
{
UChar *p = buf;
@@ -121,7 +121,8 @@
static int
mbc_case_fold(OnigCaseFoldType flag,
- const UChar** pp, const UChar* end, UChar* lower)
+ const UChar** pp, const UChar* end, UChar* lower,
+ OnigEncoding enc)
{
int len;
const UChar* p = *pp;
@@ -144,7 +145,7 @@
}
static UChar*
-left_adjust_char_head(const UChar* start, const UChar* s)
+left_adjust_char_head(const UChar* start, const UChar* s, OnigEncoding enc)
{
/* In this encoding
mb-trail bytes doesn't mix with single bytes.
@@ -163,7 +164,7 @@
}
static int
-is_allowed_reverse_match(const UChar* s, const UChar* end)
+is_allowed_reverse_match(const UChar* s, const UChar* end, OnigEncoding enc)
{
const UChar c = *s;
if (c <= 0x7e || c == 0x8e || c == 0x8f)
@@ -219,14 +220,14 @@
}
static int
-is_code_ctype(OnigCodePoint code, unsigned int ctype)
+is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
{
if (ctype <= ONIGENC_MAX_STD_CTYPE) {
if (code < 128)
return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype);
else {
if (CTYPE_IS_WORD_GRAPH_PRINT(ctype)) {
- return (code_to_mbclen(code) > 1 ? TRUE : FALSE);
+ return (code_to_mbclen(code, enc) > 1 ? TRUE : FALSE);
}
}
}
@@ -245,7 +246,7 @@
static int
get_ctype_code_range(int ctype, OnigCodePoint* sb_out,
- const OnigCodePoint* ranges[])
+ const OnigCodePoint* ranges[], OnigEncoding enc)
{
if (ctype <= ONIGENC_MAX_STD_CTYPE) {
return ONIG_NO_SUPPORT_CONFIG;
@@ -281,5 +282,6 @@
is_code_ctype,
get_ctype_code_range,
left_adjust_char_head,
- is_allowed_reverse_match
+ is_allowed_reverse_match,
+ 0
};
Index: sjis.c
===================================================================
--- sjis.c (revision 13673)
+++ sjis.c (revision 13674)
@@ -71,13 +71,13 @@
#define SJIS_ISMB_TRAIL(byte) SJIS_CAN_BE_TRAIL_TABLE[(byte)]
static int
-mbc_enc_len(const UChar* p, const UChar* e)
+mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc)
{
return EncLen_SJIS[*p];
}
static int
-code_to_mbclen(OnigCodePoint code)
+code_to_mbclen(OnigCodePoint code, OnigEncoding enc)
{
if (code < 256) {
if (EncLen_SJIS[(int )code] == 1)
@@ -93,7 +93,7 @@
}
static OnigCodePoint
-mbc_to_code(const UChar* p, const UChar* end)
+mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
{
int c, i, len;
OnigCodePoint n;
@@ -112,7 +112,7 @@
}
static int
-code_to_mbc(OnigCodePoint code, UChar *buf)
+code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc)
{
UChar *p = buf;
@@ -128,7 +128,8 @@
static int
mbc_case_fold(OnigCaseFoldType flag,
- const UChar** pp, const UChar* end, UChar* lower)
+ const UChar** pp, const UChar* end, UChar* lower,
+ OnigEncoding enc)
{
const UChar* p = *pp;
@@ -176,7 +177,7 @@
#endif
static UChar*
-left_adjust_char_head(const UChar* start, const UChar* s)
+left_adjust_char_head(const UChar* start, const UChar* s, OnigEncoding enc)
{
const UChar *p;
int len;
@@ -199,7 +200,7 @@
}
static int
-is_allowed_reverse_match(const UChar* s, const UChar* end)
+is_allowed_reverse_match(const UChar* s, const UChar* end, OnigEncoding enc)
{
const UChar c = *s;
return (SJIS_ISMB_TRAIL(c) ? FALSE : TRUE);
@@ -253,14 +254,14 @@
}
static int
-is_code_ctype(OnigCodePoint code, unsigned int ctype)
+is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
{
if (ctype <= ONIGENC_MAX_STD_CTYPE) {
if (code < 128)
return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype);
else {
if (CTYPE_IS_WORD_GRAPH_PRINT(ctype)) {
- return (code_to_mbclen(code) > 1 ? TRUE : FALSE);
+ return (code_to_mbclen(code, enc) > 1 ? TRUE : FALSE);
}
}
}
@@ -279,7 +280,7 @@
static int
get_ctype_code_range(int ctype, OnigCodePoint* sb_out,
- const OnigCodePoint* ranges[])
+ const OnigCodePoint* ranges[], OnigEncoding enc)
{
if (ctype <= ONIGENC_MAX_STD_CTYPE) {
return ONIG_NO_SUPPORT_CONFIG;
@@ -314,5 +315,6 @@
is_code_ctype,
get_ctype_code_range,
left_adjust_char_head,
- is_allowed_reverse_match
+ is_allowed_reverse_match,
+ 0
};
Index: ascii.c
===================================================================
--- ascii.c (revision 13673)
+++ ascii.c (revision 13674)
@@ -30,7 +30,7 @@
#include "regenc.h"
static int
-ascii_is_code_ctype(OnigCodePoint code, unsigned int ctype)
+ascii_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
{
if (code < 128)
return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype);
Index: include/ruby/oniguruma.h
===================================================================
--- include/ruby/oniguruma.h (revision 13673)
+++ include/ruby/oniguruma.h (revision 13674)
@@ -144,22 +144,23 @@
typedef int (*OnigApplyAllCaseFoldFunc)(OnigCodePoint from, OnigCodePoint* to, int to_len, void* arg);
typedef struct OnigEncodingTypeST {
- int (*mbc_enc_len)(const OnigUChar* p,const OnigUChar* e);
+ int (*mbc_enc_len)(const OnigUChar* p,const OnigUChar* e, struct OnigEncodingTypeST* enc);
const char* name;
int max_enc_len;
int min_enc_len;
- int (*is_mbc_newline)(const OnigUChar* p, const OnigUChar* end);
- OnigCodePoint (*mbc_to_code)(const OnigUChar* p, const OnigUChar* end);
- int (*code_to_mbclen)(OnigCodePoint code);
- int (*code_to_mbc)(OnigCodePoint code, OnigUChar *buf);
- int (*mbc_case_fold)(OnigCaseFoldType flag, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to);
- int (*apply_all_case_fold)(OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg);
- int (*get_case_fold_codes_by_str)(OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem acs[]);
+ int (*is_mbc_newline)(const OnigUChar* p, const OnigUChar* end, struct OnigEncodingTypeST* enc);
+ OnigCodePoint (*mbc_to_code)(const OnigUChar* p, const OnigUChar* end, struct OnigEncodingTypeST* enc);
+ int (*code_to_mbclen)(OnigCodePoint code, struct OnigEncodingTypeST* enc);
+ int (*code_to_mbc)(OnigCodePoint code, OnigUChar *buf, struct OnigEncodingTypeST* enc);
+ int (*mbc_case_fold)(OnigCaseFoldType flag, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to, struct OnigEncodingTypeST* enc);
+ int (*apply_all_case_fold)(OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg, struct OnigEncodingTypeST* enc);
+ int (*get_case_fold_codes_by_str)(OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem acs[], struct OnigEncodingTypeST* enc);
int (*property_name_to_ctype)(struct OnigEncodingTypeST* enc, OnigUChar* p, OnigUChar* end);
- int (*is_code_ctype)(OnigCodePoint code, unsigned int ctype);
- int (*get_ctype_code_range)(int ctype, OnigCodePoint* sb_out, const OnigCodePoint* ranges[]);
- OnigUChar* (*left_adjust_char_head)(const OnigUChar* start, const OnigUChar* p);
- int (*is_allowed_reverse_match)(const OnigUChar* p, const OnigUChar* end);
+ int (*is_code_ctype)(OnigCodePoint code, unsigned int ctype, struct OnigEncodingTypeST* enc);
+ int (*get_ctype_code_range)(int ctype, OnigCodePoint* sb_out, const OnigCodePoint* ranges[], struct OnigEncodingTypeST* enc);
+ OnigUChar* (*left_adjust_char_head)(const OnigUChar* start, const OnigUChar* p, struct OnigEncodingTypeST* enc);
+ int (*is_allowed_reverse_match)(const OnigUChar* p, const OnigUChar* end, struct OnigEncodingTypeST* enc);
+ void *auxiliary_data;
} OnigEncodingType;
typedef OnigEncodingType* OnigEncoding;
@@ -269,30 +270,30 @@
#define ONIGENC_NAME(enc) ((enc)->name)
#define ONIGENC_MBC_CASE_FOLD(enc,flag,pp,end,buf) \
- (enc)->mbc_case_fold(flag,(const OnigUChar** )pp,end,buf)
+ (enc)->mbc_case_fold(flag,(const OnigUChar** )pp,end,buf,enc)
#define ONIGENC_IS_ALLOWED_REVERSE_MATCH(enc,s,end) \
- (enc)->is_allowed_reverse_match(s,end)
+ (enc)->is_allowed_reverse_match(s,end,enc)
#define ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc,start,s) \
- (enc)->left_adjust_char_head(start, s)
+ (enc)->left_adjust_char_head(start, s, enc)
#define ONIGENC_APPLY_ALL_CASE_FOLD(enc,case_fold_flag,f,arg) \
- (enc)->apply_all_case_fold(case_fold_flag,f,arg)
+ (enc)->apply_all_case_fold(case_fold_flag,f,arg,enc)
#define ONIGENC_GET_CASE_FOLD_CODES_BY_STR(enc,case_fold_flag,p,end,acs) \
- (enc)->get_case_fold_codes_by_str(case_fold_flag,p,end,acs)
+ (enc)->get_case_fold_codes_by_str(case_fold_flag,p,end,acs,enc)
#define ONIGENC_STEP_BACK(enc,start,s,n) \
onigenc_step_back((enc),(start),(s),(n))
-#define ONIGENC_MBC_ENC_LEN(enc,p,e) (enc)->mbc_enc_len(p,e)
+#define ONIGENC_MBC_ENC_LEN(enc,p,e) (enc)->mbc_enc_len(p,e,enc)
#define ONIGENC_MBC_MAXLEN(enc) ((enc)->max_enc_len)
#define ONIGENC_MBC_MAXLEN_DIST(enc) ONIGENC_MBC_MAXLEN(enc)
#define ONIGENC_MBC_MINLEN(enc) ((enc)->min_enc_len)
-#define ONIGENC_IS_MBC_NEWLINE(enc,p,end) (enc)->is_mbc_newline((p),(end))
-#define ONIGENC_MBC_TO_CODE(enc,p,end) (enc)->mbc_to_code((p),(end))
-#define ONIGENC_CODE_TO_MBCLEN(enc,code) (enc)->code_to_mbclen(code)
-#define ONIGENC_CODE_TO_MBC(enc,code,buf) (enc)->code_to_mbc(code,buf)
+#define ONIGENC_IS_MBC_NEWLINE(enc,p,end) (enc)->is_mbc_newline((p),(end),enc)
+#define ONIGENC_MBC_TO_CODE(enc,p,end) (enc)->mbc_to_code((p),(end),enc)
+#define ONIGENC_CODE_TO_MBCLEN(enc,code) (enc)->code_to_mbclen(code,enc)
+#define ONIGENC_CODE_TO_MBC(enc,code,buf) (enc)->code_to_mbc(code,buf,enc)
#define ONIGENC_PROPERTY_NAME_TO_CTYPE(enc,p,end) \
(enc)->property_name_to_ctype(enc,p,end)
-#define ONIGENC_IS_CODE_CTYPE(enc,code,ctype) (enc)->is_code_ctype(code,ctype)
+#define ONIGENC_IS_CODE_CTYPE(enc,code,ctype) (enc)->is_code_ctype(code,ctype,enc)
#define ONIGENC_IS_CODE_NEWLINE(enc,code) \
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_NEWLINE)
@@ -324,7 +325,7 @@
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_WORD)
#define ONIGENC_GET_CTYPE_CODE_RANGE(enc,ctype,sbout,ranges) \
- (enc)->get_ctype_code_range(ctype,sbout,ranges)
+ (enc)->get_ctype_code_range(ctype,sbout,ranges,enc)
ONIG_EXTERN
OnigUChar* onigenc_step_back P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, int n));
Index: regenc.c
===================================================================
--- regenc.c (revision 13673)
+++ regenc.c (revision 13674)
@@ -394,7 +394,8 @@
extern int
onigenc_ascii_apply_all_case_fold(OnigCaseFoldType flag,
- OnigApplyAllCaseFoldFunc f, void* arg)
+ OnigApplyAllCaseFoldFunc f, void* arg,
+ OnigEncoding enc)
{
OnigCodePoint code;
int i, r;
@@ -415,7 +416,8 @@
extern int
onigenc_ascii_get_case_fold_codes_by_str(OnigCaseFoldType flag,
- const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[])
+ const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[],
+ OnigEncoding enc)
{
if (0x41 <= *p && *p <= 0x5a) {
items[0].byte_len = 1;
@@ -451,7 +453,7 @@
OnigCodePoint code;
int i, r;
- r = onigenc_ascii_apply_all_case_fold(flag, f, arg);
+ r = onigenc_ascii_apply_all_case_fold(flag, f, arg, 0);
if (r != 0) return r;
for (i = 0; i < map_size; i++) {
@@ -554,13 +556,14 @@
extern int
onigenc_not_support_get_ctype_code_range(int ctype,
- OnigCodePoint* sb_out, const OnigCodePoint* ranges[])
+ OnigCodePoint* sb_out, const OnigCodePoint* ranges[],
+ OnigEncoding enc)
{
return ONIG_NO_SUPPORT_CONFIG;
}
extern int
-onigenc_is_mbc_newline_0x0a(const UChar* p, const UChar* end)
+onigenc_is_mbc_newline_0x0a(const UChar* p, const UChar* end, OnigEncoding enc)
{
if (p < end) {
if (*p == 0x0a) return 1;
@@ -571,7 +574,7 @@
/* for single byte encodings */
extern int
onigenc_ascii_mbc_case_fold(OnigCaseFoldType flag, const UChar** p,
- const UChar*end, UChar* lower)
+ const UChar*end, UChar* lower, OnigEncoding enc)
{
*lower = ONIGENC_ASCII_CODE_TO_LOWER_CASE(**p);
@@ -592,44 +595,47 @@
#endif
extern int
-onigenc_single_byte_mbc_enc_len(const UChar* p, const UChar* e)
+onigenc_single_byte_mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc)
{
return 1;
}
extern OnigCodePoint
-onigenc_single_byte_mbc_to_code(const UChar* p, const UChar* end)
+onigenc_single_byte_mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
{
return (OnigCodePoint )(*p);
}
extern int
-onigenc_single_byte_code_to_mbclen(OnigCodePoint code)
+onigenc_single_byte_code_to_mbclen(OnigCodePoint code, OnigEncoding enc)
{
return 1;
}
extern int
-onigenc_single_byte_code_to_mbc(OnigCodePoint code, UChar *buf)
+onigenc_single_byte_code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc)
{
*buf = (UChar )(code & 0xff);
return 1;
}
extern UChar*
-onigenc_single_byte_left_adjust_char_head(const UChar* start, const UChar* s)
+onigenc_single_byte_left_adjust_char_head(const UChar* start, const UChar* s,
+ OnigEncoding enc)
{
return (UChar* )s;
}
extern int
-onigenc_always_true_is_allowed_reverse_match(const UChar* s, const UChar* end)
+onigenc_always_true_is_allowed_reverse_match(const UChar* s, const UChar* end,
+ OnigEncoding enc)
{
return TRUE;
}
extern int
-onigenc_always_false_is_allowed_reverse_match(const UChar* s, const UChar* end)
+onigenc_always_false_is_allowed_reverse_match(const UChar* s, const UChar* end,
+ OnigEncoding enc)
{
return FALSE;
}
Index: ChangeLog
===================================================================
--- ChangeLog (revision 13673)
+++ ChangeLog (revision 13674)
@@ -1,3 +1,11 @@
+Thu Oct 11 00:04:37 2007 Yukihiro Matsumoto <matz@r...>
+
+ * include/ruby/oniguruma.h (OnigEncodingTypeST): add OnigEncoding
+ parameter to every function members.
+
+ * include/ruby/oniguruma.h (OnigEncodingTypeST): add auxiliary
+ data member to provide user defined data for an encoding.
+
Wed Oct 10 23:32:15 2007 Yukihiro Matsumoto <matz@r...>
* re.c (rb_reg_s_quote): no longer takes optional second argument
Index: regenc.h
===================================================================
--- regenc.h (revision 13673)
+++ regenc.h (revision 13674)
@@ -107,23 +107,23 @@
#define ONIG_ENCODING_INIT_DEFAULT ONIG_ENCODING_ASCII
/* for encoding system implementation (internal) */
-ONIG_EXTERN int onigenc_ascii_apply_all_case_fold P_((OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg));
-ONIG_EXTERN int onigenc_ascii_get_case_fold_codes_by_str P_((OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]));
+ONIG_EXTERN int onigenc_ascii_apply_all_case_fold P_((OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg, OnigEncoding enc));
+ONIG_EXTERN int onigenc_ascii_get_case_fold_codes_by_str P_((OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[], OnigEncoding enc));
ONIG_EXTERN int onigenc_apply_all_case_fold_with_map P_((int map_size, const OnigPairCaseFoldCodes map[], int ess_tsett_flag, OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg));
ONIG_EXTERN int onigenc_get_case_fold_codes_by_str_with_map P_((int map_size, const OnigPairCaseFoldCodes map[], int ess_tsett_flag, OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]));
-ONIG_EXTERN int onigenc_not_support_get_ctype_code_range P_((int ctype, OnigCodePoint* sb_out, const OnigCodePoint* ranges[]));
-ONIG_EXTERN int onigenc_is_mbc_newline_0x0a P_((const UChar* p, const UChar* end));
+ONIG_EXTERN int onigenc_not_support_get_ctype_code_range P_((int ctype, OnigCodePoint* sb_out, const OnigCodePoint* ranges[], OnigEncoding enc));
+ONIG_EXTERN int onigenc_is_mbc_newline_0x0a P_((const UChar* p, const UChar* end, OnigEncoding enc));
/* methods for single byte encoding */
-ONIG_EXTERN int onigenc_ascii_mbc_case_fold P_((OnigCaseFoldType flag, const UChar** p, const UChar* end, UChar* lower));
-ONIG_EXTERN int onigenc_single_byte_mbc_enc_len P_((const UChar* p, const UChar* e));
-ONIG_EXTERN OnigCodePoint onigenc_single_byte_mbc_to_code P_((const UChar* p, const UChar* end));
-ONIG_EXTERN int onigenc_single_byte_code_to_mbclen P_((OnigCodePoint code));
-ONIG_EXTERN int onigenc_single_byte_code_to_mbc P_((OnigCodePoint code, UChar *buf));
-ONIG_EXTERN UChar* onigenc_single_byte_left_adjust_char_head P_((const UChar* start, const UChar* s));
-ONIG_EXTERN int onigenc_always_true_is_allowed_reverse_match P_((const UChar* s, const UChar* end));
-ONIG_EXTERN int onigenc_always_false_is_allowed_reverse_match P_((const UChar* s, const UChar* end));
+ONIG_EXTERN int onigenc_ascii_mbc_case_fold P_((OnigCaseFoldType flag, const UChar** p, const UChar* end, UChar* lower, OnigEncoding enc));
+ONIG_EXTERN int onigenc_single_byte_mbc_enc_len P_((const UChar* p, const UChar* e, OnigEncoding enc));
+ONIG_EXTERN OnigCodePoint onigenc_single_byte_mbc_to_code P_((const UChar* p, const UChar* end, OnigEncoding enc));
+ONIG_EXTERN int onigenc_single_byte_code_to_mbclen P_((OnigCodePoint code, OnigEncoding enc));
+ONIG_EXTERN int onigenc_single_byte_code_to_mbc P_((OnigCodePoint code, UChar *buf, OnigEncoding enc));
+ONIG_EXTERN UChar* onigenc_single_byte_left_adjust_char_head P_((const UChar* start, const UChar* s, OnigEncoding enc));
+ONIG_EXTERN int onigenc_always_true_is_allowed_reverse_match P_((const UChar* s, const UChar* end, OnigEncoding enc));
+ONIG_EXTERN int onigenc_always_false_is_allowed_reverse_match P_((const UChar* s, const UChar* end, OnigEncoding enc));
/* methods for multi byte encoding */
ONIG_EXTERN OnigCodePoint onigenc_mbn_mbc_to_code P_((OnigEncoding enc, const UChar* p, const UChar* end));
@@ -139,12 +139,12 @@
/* in enc/unicode.c */
-ONIG_EXTERN int onigenc_unicode_is_code_ctype P_((OnigCodePoint code, unsigned int ctype));
+ONIG_EXTERN int onigenc_unicode_is_code_ctype P_((OnigCodePoint code, unsigned int ctype, OnigEncoding enc));
ONIG_EXTERN int onigenc_utf16_32_get_ctype_code_range P_((int ctype, OnigCodePoint *sb_out, const OnigCodePoint* ranges[]));
ONIG_EXTERN int onigenc_unicode_ctype_code_range P_((int ctype, const OnigCodePoint* ranges[]));
ONIG_EXTERN int onigenc_unicode_get_case_fold_codes_by_str P_((OnigEncoding enc, OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]));
ONIG_EXTERN int onigenc_unicode_mbc_case_fold P_((OnigEncoding enc, OnigCaseFoldType flag, const UChar** pp, const UChar* end, UChar* fold));
-ONIG_EXTERN int onigenc_unicode_apply_all_case_fold P_((OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg));
+ONIG_EXTERN int onigenc_unicode_apply_all_case_fold P_((OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg, OnigEncoding enc));
#define ONIGENC_ISO_8859_1_TO_LOWER_CASE(c) \
Index: utf8.c
===================================================================
--- utf8.c (revision 13673)
+++ utf8.c (revision 13674)
@@ -60,13 +60,13 @@
};
static int
-utf8_mbc_enc_len(const UChar* p, const UChar* e)
+utf8_mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc)
{
return EncLen_UTF8[*p];
}
static int
-utf8_is_mbc_newline(const UChar* p, const UChar* end)
+utf8_is_mbc_newline(const UChar* p, const UChar* end, OnigEncoding enc)
{
if (p < end) {
if (*p == 0x0a) return 1;
@@ -91,7 +91,7 @@
}
static OnigCodePoint
-utf8_mbc_to_code(const UChar* p, const UChar* end)
+utf8_mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
{
int c, len;
OnigCodePoint n;
@@ -118,7 +118,7 @@
}
static int
-utf8_code_to_mbclen(OnigCodePoint code)
+utf8_code_to_mbclen(OnigCodePoint code, OnigEncoding enc)
{
if ((code & 0xffffff80) == 0) return 1;
else if ((code & 0xfffff800) == 0) {
@@ -163,7 +163,7 @@
#endif
static int
-utf8_code_to_mbc(OnigCodePoint code, UChar *buf)
+utf8_code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc)
{
#define UTF8_TRAILS(code, shift) (UChar )((((code) >> (shift)) & 0x3f) | 0x80)
#define UTF8_TRAIL0(code) (UChar )(((code) & 0x3f) | 0x80)
@@ -221,7 +221,7 @@
static int
utf8_mbc_case_fold(OnigCaseFoldType flag, const UChar** pp,
- const UChar* end, UChar* fold)
+ const UChar* end, UChar* fold, OnigEncoding enc)
{
const UChar* p = *pp;
@@ -286,7 +286,7 @@
static int
utf8_get_ctype_code_range(int ctype, OnigCodePoint *sb_out,
- const OnigCodePoint* ranges[])
+ const OnigCodePoint* ranges[], OnigEncoding enc)
{
*sb_out = 0x80;
return onigenc_unicode_ctype_code_range(ctype, ranges);
@@ -294,7 +294,7 @@
static UChar*
-utf8_left_adjust_char_head(const UChar* start, const UChar* s)
+utf8_left_adjust_char_head(const UChar* start, const UChar* s, OnigEncoding enc)
{
const UChar *p;
@@ -307,7 +307,8 @@
static int
utf8_get_case_fold_codes_by_str(OnigCaseFoldType flag,
- const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[])
+ const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[],
+ OnigEncoding enc)
{
return onigenc_unicode_get_case_fold_codes_by_str(ONIG_ENCODING_UTF8,
flag, p, end, items);
Index: unicode.c
===================================================================
--- unicode.c (revision 13673)
+++ unicode.c (revision 13674)
@@ -10745,7 +10745,7 @@
}
extern int
-onigenc_unicode_is_code_ctype(OnigCodePoint code, unsigned int ctype)
+onigenc_unicode_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
{
if (
#ifdef USE_UNICODE_PROPERTIES
@@ -11005,7 +11005,8 @@
extern int
onigenc_unicode_apply_all_case_fold(OnigCaseFoldType flag,
- OnigApplyAllCaseFoldFunc f, void* arg)
+ OnigApplyAllCaseFoldFunc f, void* arg,
+ OnigEncoding enc)
{
const CaseUnfold_11_Type* p11;
OnigCodePoint code;
Index: version.h
===================================================================
--- version.h (revision 13673)
+++ version.h (revision 13674)
@@ -1,7 +1,7 @@
#define RUBY_VERSION "1.9.0"
-#define RUBY_RELEASE_DATE "2007-10-10"
+#define RUBY_RELEASE_DATE "2007-10-11"
#define RUBY_VERSION_CODE 190
-#define RUBY_RELEASE_CODE 20071010
+#define RUBY_RELEASE_CODE 20071011
#define RUBY_PATCHLEVEL 0
#define RUBY_VERSION_MAJOR 1
@@ -9,7 +9,7 @@
#define RUBY_VERSION_TEENY 0
#define RUBY_RELEASE_YEAR 2007
#define RUBY_RELEASE_MONTH 10
-#define RUBY_RELEASE_DAY 10
+#define RUBY_RELEASE_DAY 11
#ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[];
--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml