summaryrefslogtreecommitdiff
path: root/enc/euc_jp.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-13 02:51:15 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-13 02:51:15 +0000
commit513d0ca7f6c7c27c8f875a84d5b9a8f3692dbe8f (patch)
treef99cd5fe9882653052b9e2e90fede5366c0a28b4 /enc/euc_jp.c
parent00fb802284de17da913506377f4a346210baa4a6 (diff)
* encoding.c (ENCINDEX_EUC_JP, ENCINDEX_SJIS): removed.
(rb_enc_init): EUC-JP and Shift_JIS are not builtin now. * enc/Makefile.in: ditto. * common.mk: ditto. * ruby.c (proc_options): ditto. * enc/shift_jis.c, enc/euc_jp.c: fixes for romove from builtin. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enc/euc_jp.c')
-rw-r--r--enc/euc_jp.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/enc/euc_jp.c b/enc/euc_jp.c
index 7040185558..f62627ed84 100644
--- a/enc/euc_jp.c
+++ b/enc/euc_jp.c
@@ -29,6 +29,8 @@
#include "regint.h"
+OnigEncodingDeclare(EUC_JP);
+
#define eucjp_islead(c) ((UChar )((c) - 0xa1) > 0xfe - 0xa1)
static const int EncLen_EUCJP[] = {
@@ -137,7 +139,7 @@ mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
int c, i, len;
OnigCodePoint n;
- len = enclen(ONIG_ENCODING_EUC_JP, p, end);
+ len = enclen(&encoding_EUC_JP, p, end);
n = (OnigCodePoint )*p++;
if (len == 1) return n;
@@ -189,7 +191,7 @@ code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc)
*p++ = (UChar )(code & 0xff);
#if 1
- if (enclen(ONIG_ENCODING_EUC_JP, buf, p) != (p - buf))
+ if (enclen(&encoding_EUC_JP, buf, p) != (p - buf))
return ONIGERR_INVALID_CODE_POINT_VALUE;
#endif
return p - buf;
@@ -211,7 +213,7 @@ mbc_case_fold(OnigCaseFoldType flag,
else {
int i;
- len = enclen(ONIG_ENCODING_EUC_JP, p, end);
+ len = enclen(&encoding_EUC_JP, p, end);
for (i = 0; i < len; i++) {
*lower++ = *p++;
}
@@ -233,7 +235,7 @@ left_adjust_char_head(const UChar* start, const UChar* s, OnigEncoding enc)
p = s;
while (!eucjp_islead(*p) && p > start) p--;
- len = enclen(ONIG_ENCODING_EUC_JP, p, s);
+ len = enclen(&encoding_EUC_JP, p, s);
if (p + len > s) return (UChar* )p;
p += len;
return (UChar* )(p + ((s - p) & ~1));