From 081c802cb9fe84d349bc4ecf26a36eceae431aed Mon Sep 17 00:00:00 2001 From: akr Date: Thu, 18 Sep 2008 12:53:25 +0000 Subject: * grapheme cluster implementation reverted. [ruby-dev:36375] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- include/ruby/encoding.h | 7 +++---- include/ruby/oniguruma.h | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/ruby/encoding.h b/include/ruby/encoding.h index acf10cb072..f2f7ba19b5 100644 --- a/include/ruby/encoding.h +++ b/include/ruby/encoding.h @@ -122,13 +122,12 @@ int rb_enc_ascget(const char *p, const char *e, int *len, rb_encoding *enc); /* -> code or raise exception */ unsigned int rb_enc_codepoint(const char *p, const char *e, rb_encoding *enc); #define rb_enc_mbc_to_codepoint(p, e, enc) ONIGENC_MBC_TO_CODE(enc,(UChar*)(p),(UChar*)(e)) -#define rb_enc_mbc_precise_codepoint(p, e, prec_ret, enc) ONIGENC_MBC_PRECISE_CODEPOINT(enc,(UChar*)(p),(UChar*)(e),(prec_ret)) /* -> codelen>0 or raise exception */ -int rb_enc_codelen(int codepoint, rb_encoding *enc); +int rb_enc_codelen(int code, rb_encoding *enc); -/* codepoint,ptr,encoding -> write buf */ -#define rb_enc_mbcput(codepoint,buf,enc) ONIGENC_CODE_TO_MBC((enc),(codepoint),(UChar*)(buf)) +/* code,ptr,encoding -> write buf */ +#define rb_enc_mbcput(c,buf,enc) ONIGENC_CODE_TO_MBC(enc,c,(UChar*)(buf)) /* start, ptr, end, encoding -> prev_char */ #define rb_enc_prev_char(s,p,e,enc) (char *)onigenc_get_prev_char_head(enc,(UChar*)(s),(UChar*)(p),(UChar*)(e)) diff --git a/include/ruby/oniguruma.h b/include/ruby/oniguruma.h index 9d9da1deab..bc6905edaa 100644 --- a/include/ruby/oniguruma.h +++ b/include/ruby/oniguruma.h @@ -155,7 +155,7 @@ typedef struct OnigEncodingTypeST { int max_enc_len; int min_enc_len; int (*is_mbc_newline)(const OnigUChar* p, const OnigUChar* end, struct OnigEncodingTypeST* enc); - OnigCodePoint (*mbc_to_code)(const OnigUChar* p, const OnigUChar* end, int *precise_ret, 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); @@ -249,8 +249,7 @@ int onigenc_mbclen_approximate P_((const OnigUChar* p,const OnigUChar* e, struct #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),enc) -#define ONIGENC_MBC_TO_CODE(enc,p,end) (enc)->mbc_to_code((p),(end),NULL,enc) -#define ONIGENC_MBC_PRECISE_CODEPOINT(enc,p,end,prec_ret) (enc)->mbc_to_code((p),(end),(prec_ret),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) \ -- cgit v1.2.3