summaryrefslogtreecommitdiff
path: root/enc
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
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')
-rw-r--r--enc/Makefile.in1
-rw-r--r--enc/euc_jp.c10
-rw-r--r--enc/shift_jis.c14
3 files changed, 14 insertions, 11 deletions
diff --git a/enc/Makefile.in b/enc/Makefile.in
index 694803427f..f33a75d3d2 100644
--- a/enc/Makefile.in
+++ b/enc/Makefile.in
@@ -15,7 +15,6 @@ DLEXT = @DLEXT@
OBJEXT = @OBJEXT@
BUILTIN_ENCS = ascii.c \
- euc_jp.c shift_jis.c \
unicode.c utf8.c
RUBY_SO_NAME = @RUBY_SO_NAME@
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));
diff --git a/enc/shift_jis.c b/enc/shift_jis.c
index dcf05bf86f..977f2f2cce 100644
--- a/enc/shift_jis.c
+++ b/enc/shift_jis.c
@@ -29,6 +29,8 @@
#include "regint.h"
+OnigEncodingDeclare(Shift_JIS);
+
static const int EncLen_SJIS[] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -150,7 +152,7 @@ mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
int c, i, len;
OnigCodePoint n;
- len = enclen(ONIG_ENCODING_SJIS, p, end);
+ len = enclen(&encoding_Shift_JIS, p, end);
c = *p++;
n = c;
if (len == 1) return n;
@@ -172,7 +174,7 @@ code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc)
*p++ = (UChar )(code & 0xff);
#if 0
- if (enclen(ONIG_ENCODING_SJIS, buf) != (p - buf))
+ if (enclen(&encoding_Shift_JIS, buf) != (p - buf))
return REGERR_INVALID_CODE_POINT_VALUE;
#endif
return p - buf;
@@ -192,7 +194,7 @@ mbc_case_fold(OnigCaseFoldType flag,
}
else {
int i;
- int len = enclen(ONIG_ENCODING_SJIS, p, end);
+ int len = enclen(&encoding_Shift_JIS, p, end);
for (i = 0; i < len; i++) {
*lower++ = *p++;
@@ -207,7 +209,7 @@ static int
is_mbc_ambiguous(OnigCaseFoldType flag,
const UChar** pp, const UChar* end)
{
- return onigenc_mbn_is_mbc_ambiguous(ONIG_ENCODING_SJIS, flag, pp, end);
+ return onigenc_mbn_is_mbc_ambiguous(&encoding_Shift_JIS, flag, pp, end);
}
#endif
@@ -245,7 +247,7 @@ left_adjust_char_head(const UChar* start, const UChar* s, OnigEncoding enc)
}
}
}
- len = enclen(ONIG_ENCODING_SJIS, p, s);
+ len = enclen(&encoding_Shift_JIS, p, s);
if (p + len > s) return (UChar* )p;
p += len;
return (UChar* )(p + ((s - p) & ~1));
@@ -351,7 +353,7 @@ get_ctype_code_range(OnigCtype ctype, OnigCodePoint* sb_out,
}
}
-OnigEncodingDefine(sjis, SJIS) = {
+OnigEncodingDefine(shift_jis, Shift_JIS) = {
mbc_enc_len,
"Shift_JIS", /* name */
2, /* max byte length */