summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog16
-rw-r--r--common.mk2
-rw-r--r--enc/Makefile.in6
-rw-r--r--enc/ascii.c2
-rw-r--r--enc/depend4
-rw-r--r--enc/euc_jp.c2
-rw-r--r--enc/iso_8859_1.c2
-rw-r--r--enc/iso_8859_10.c2
-rw-r--r--enc/iso_8859_11.c2
-rw-r--r--enc/iso_8859_13.c2
-rw-r--r--enc/iso_8859_14.c2
-rw-r--r--enc/iso_8859_15.c2
-rw-r--r--enc/iso_8859_16.c2
-rw-r--r--enc/iso_8859_2.c2
-rw-r--r--enc/iso_8859_3.c2
-rw-r--r--enc/iso_8859_4.c2
-rw-r--r--enc/iso_8859_5.c2
-rw-r--r--enc/iso_8859_6.c2
-rw-r--r--enc/iso_8859_7.c2
-rw-r--r--enc/iso_8859_8.c2
-rw-r--r--enc/iso_8859_9.c2
-rw-r--r--enc/sjis.c2
-rw-r--r--enc/utf8.c2
-rw-r--r--encoding.c3
-rw-r--r--regenc.h6
25 files changed, 43 insertions, 32 deletions
diff --git a/ChangeLog b/ChangeLog
index a09b48b..64cedd5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+Fri Dec 21 11:23:24 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (enc.mk): depends on $(RBCONFIG) instead of rbconfig.rb.
+
+ * encoding.c (Init_Encoding): ISO-8859-1 is no longer a replica.
+
+ * regenc.h (OnigEncodingDefine): names of extension and encoding can
+ differ.
+
+ * enc/Makefile.in: always shared.
+
+ * enc/depend (deffile): should not upcase.
+
+ * enc/{ascii,euc_jp,sjis,utf8,iso_8859_{1..16}}.c: fix for Init.
+
Fri Dec 21 09:26:48 2007 Tanaka Akira <akr@fsij.org>
* tool/compile_prelude.rb: use erb.
@@ -78,7 +93,6 @@ Thu Dec 20 17:07:54 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* enc/depend, enc/make_encmake.rb: fix for Windows.
-
* enc/{ascii,euc_jp,sjis,utf8,iso_8859_{1..16}}.c: renamed.
Thu Dec 20 16:42:55 2007 Koichi Sasada <ko1@atdot.net>
diff --git a/common.mk b/common.mk
index 1971641..010044b 100644
--- a/common.mk
+++ b/common.mk
@@ -344,7 +344,7 @@ encs: enc.mk
$(MAKE) -f enc.mk -$(MAKEFLAGS)
enc.mk: $(srcdir)/enc/make_encmake.rb $(srcdir)/enc/Makefile.in $(srcdir)/enc/depend \
- $(srcdir)/lib/mkmf.rb rbconfig.rb
+ $(srcdir)/lib/mkmf.rb $(RBCONFIG)
$(MINIRUBY) $(srcdir)/enc/make_encmake.rb --builtin-encs="$(BUILTIN_ENCOBJS)" $@
.PRECIOUS: $(MKFILES)
diff --git a/enc/Makefile.in b/enc/Makefile.in
index a16124d..21be8ae 100644
--- a/enc/Makefile.in
+++ b/enc/Makefile.in
@@ -16,14 +16,14 @@ BUILTIN_ENCS = ascii.c \
RUBY_SO_NAME = @RUBY_SO_NAME@
LIBRUBY = @LIBRUBY@
-LIBRUBY_A = @LIBRUBY_A@
-LIBRUBYARG_STATIC = @LIBRUBYARG_STATIC@
LIBRUBYARG_SHARED = @LIBRUBYARG_SHARED@
+LIBRUBYARG_STATIC = $(LIBRUBYARG_SHARED)
empty =
CC = @CC@
OUTFLAG = @OUTFLAG@$(empty)
-CFLAGS = @CFLAGS@ @ARCH_FLAG@
+CFLAGS = $(CCDLFLAGS) @CFLAGS@ @ARCH_FLAG@
+CCDLFLAGS = @CCDLFLAGS@
INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir) -I$(top_srcdir)
DEFS = @DEFS@
CPPFLAGS = @CPPFLAGS@ -DONIG_ENC_REGISTER=rb_enc_register
diff --git a/enc/ascii.c b/enc/ascii.c
index 9428902..3a40ad6 100644
--- a/enc/ascii.c
+++ b/enc/ascii.c
@@ -38,7 +38,7 @@ ascii_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
return FALSE;
}
-OnigEncodingDefine(ASCII) = {
+OnigEncodingDefine(ascii, ASCII) = {
onigenc_single_byte_mbc_enc_len,
"ASCII-8BIT",/* name */
1, /* max byte length */
diff --git a/enc/depend b/enc/depend
index 29ae915..dcdffb8 100644
--- a/enc/depend
+++ b/enc/depend
@@ -35,9 +35,9 @@ $(ENCSODIR)/<%e%>.$(DLEXT): <%deps%>
! end
! if DEFFILE
! encs.each do |e|
-<%e%>-$(arch).def:
+<%e%>-$(arch).def: enc.mk
echo EXPORTS > $@
- echo <%EXPORT_PREFIX%>Init_<%e.upcase%> >> $@
+ echo <%EXPORT_PREFIX%>Init_<%e%> >> $@
! end
! end
diff --git a/enc/euc_jp.c b/enc/euc_jp.c
index 240e110..eca698c 100644
--- a/enc/euc_jp.c
+++ b/enc/euc_jp.c
@@ -341,7 +341,7 @@ get_ctype_code_range(int ctype, OnigCodePoint* sb_out,
}
-OnigEncodingDefine(EUC_JP) = {
+OnigEncodingDefine(euc_jp, EUC_JP) = {
mbc_enc_len,
"EUC-JP", /* name */
3, /* max enc length */
diff --git a/enc/iso_8859_1.c b/enc/iso_8859_1.c
index f7db6f9..0c85c8b 100644
--- a/enc/iso_8859_1.c
+++ b/enc/iso_8859_1.c
@@ -254,7 +254,7 @@ is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
return FALSE;
}
-OnigEncodingDefine(ISO_8859_1) = {
+OnigEncodingDefine(iso_8859_1, ISO_8859_1) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-1", /* name */
1, /* max enc length */
diff --git a/enc/iso_8859_10.c b/enc/iso_8859_10.c
index 20606d7..2b5affa 100644
--- a/enc/iso_8859_10.c
+++ b/enc/iso_8859_10.c
@@ -224,7 +224,7 @@ iso_8859_10_get_case_fold_codes_by_str(OnigCaseFoldType flag,
flag, p, end, items);
}
-OnigEncodingDefine(ISO_8859_10) = {
+OnigEncodingDefine(iso_8859_10, ISO_8859_10) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-10", /* name */
1, /* max enc length */
diff --git a/enc/iso_8859_11.c b/enc/iso_8859_11.c
index 463f52e..343993d 100644
--- a/enc/iso_8859_11.c
+++ b/enc/iso_8859_11.c
@@ -76,7 +76,7 @@ iso_8859_11_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding e
return FALSE;
}
-OnigEncodingDefine(ISO_8859_11) = {
+OnigEncodingDefine(iso_8859_11, ISO_8859_11) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-11", /* name */
1, /* max enc length */
diff --git a/enc/iso_8859_13.c b/enc/iso_8859_13.c
index 3a99115..4b6db1a 100644
--- a/enc/iso_8859_13.c
+++ b/enc/iso_8859_13.c
@@ -213,7 +213,7 @@ iso_8859_13_get_case_fold_codes_by_str(OnigCaseFoldType flag,
flag, p, end, items);
}
-OnigEncodingDefine(ISO_8859_13) = {
+OnigEncodingDefine(iso_8859_13, ISO_8859_13) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-13", /* name */
1, /* max enc length */
diff --git a/enc/iso_8859_14.c b/enc/iso_8859_14.c
index d4afd9d..c54d8fc 100644
--- a/enc/iso_8859_14.c
+++ b/enc/iso_8859_14.c
@@ -225,7 +225,7 @@ iso_8859_14_get_case_fold_codes_by_str(OnigCaseFoldType flag,
flag, p, end, items);
}
-OnigEncodingDefine(ISO_8859_14) = {
+OnigEncodingDefine(iso_8859_14, ISO_8859_14) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-14", /* name */
1, /* max enc length */
diff --git a/enc/iso_8859_15.c b/enc/iso_8859_15.c
index 9deeec7..de96370 100644
--- a/enc/iso_8859_15.c
+++ b/enc/iso_8859_15.c
@@ -219,7 +219,7 @@ iso_8859_15_get_case_fold_codes_by_str(OnigCaseFoldType flag,
flag, p, end, items);
}
-OnigEncodingDefine(ISO_8859_15) = {
+OnigEncodingDefine(iso_8859_15, ISO_8859_15) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-15", /* name */
1, /* max enc length */
diff --git a/enc/iso_8859_16.c b/enc/iso_8859_16.c
index 76517f8..1cf4f65 100644
--- a/enc/iso_8859_16.c
+++ b/enc/iso_8859_16.c
@@ -222,7 +222,7 @@ iso_8859_16_get_case_fold_codes_by_str(OnigCaseFoldType flag,
flag, p, end, items);
}
-OnigEncodingDefine(ISO_8859_16) = {
+OnigEncodingDefine(iso_8859_16, ISO_8859_16) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-16", /* name */
1, /* max enc length */
diff --git a/enc/iso_8859_2.c b/enc/iso_8859_2.c
index 182a417..57340b3 100644
--- a/enc/iso_8859_2.c
+++ b/enc/iso_8859_2.c
@@ -219,7 +219,7 @@ is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
return FALSE;
}
-OnigEncodingDefine(ISO_8859_2) = {
+OnigEncodingDefine(iso_8859_2, ISO_8859_2) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-2", /* name */
1, /* max enc length */
diff --git a/enc/iso_8859_3.c b/enc/iso_8859_3.c
index 952483a..90c2636 100644
--- a/enc/iso_8859_3.c
+++ b/enc/iso_8859_3.c
@@ -219,7 +219,7 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
flag, p, end, items);
}
-OnigEncodingDefine(ISO_8859_3) = {
+OnigEncodingDefine(iso_8859_3, ISO_8859_3) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-3", /* name */
1, /* max enc length */
diff --git a/enc/iso_8859_4.c b/enc/iso_8859_4.c
index a82ec3c..cc103cd 100644
--- a/enc/iso_8859_4.c
+++ b/enc/iso_8859_4.c
@@ -221,7 +221,7 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
flag, p, end, items);
}
-OnigEncodingDefine(ISO_8859_4) = {
+OnigEncodingDefine(iso_8859_4, ISO_8859_4) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-4", /* name */
1, /* max enc length */
diff --git a/enc/iso_8859_5.c b/enc/iso_8859_5.c
index 69908a2..de7a0fd 100644
--- a/enc/iso_8859_5.c
+++ b/enc/iso_8859_5.c
@@ -209,7 +209,7 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
flag, p, end, items);
}
-OnigEncodingDefine(ISO_8859_5) = {
+OnigEncodingDefine(iso_8859_5, ISO_8859_5) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-5", /* name */
1, /* max enc length */
diff --git a/enc/iso_8859_6.c b/enc/iso_8859_6.c
index b0da863..c0f3027 100644
--- a/enc/iso_8859_6.c
+++ b/enc/iso_8859_6.c
@@ -76,7 +76,7 @@ is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
return FALSE;
}
-OnigEncodingDefine(ISO_8859_6) = {
+OnigEncodingDefine(iso_8859_6, ISO_8859_6) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-6", /* name */
1, /* max enc length */
diff --git a/enc/iso_8859_7.c b/enc/iso_8859_7.c
index fc825b1..2ff42ed 100644
--- a/enc/iso_8859_7.c
+++ b/enc/iso_8859_7.c
@@ -206,7 +206,7 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
}
-OnigEncodingDefine(ISO_8859_7) = {
+OnigEncodingDefine(iso_8859_7, ISO_8859_7) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-7", /* name */
1, /* max enc length */
diff --git a/enc/iso_8859_8.c b/enc/iso_8859_8.c
index 61cd842..3a075b0 100644
--- a/enc/iso_8859_8.c
+++ b/enc/iso_8859_8.c
@@ -76,7 +76,7 @@ iso_8859_8_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding en
return FALSE;
}
-OnigEncodingDefine(ISO_8859_8) = {
+OnigEncodingDefine(iso_8859_8, ISO_8859_8) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-8", /* name */
1, /* max enc length */
diff --git a/enc/iso_8859_9.c b/enc/iso_8859_9.c
index 95d92d9..1921c59 100644
--- a/enc/iso_8859_9.c
+++ b/enc/iso_8859_9.c
@@ -213,7 +213,7 @@ iso_8859_9_get_case_fold_codes_by_str(OnigCaseFoldType flag,
flag, p, end, items);
}
-OnigEncodingDefine(ISO_8859_9) = {
+OnigEncodingDefine(iso_8859_9, ISO_8859_9) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-9", /* name */
1, /* max enc length */
diff --git a/enc/sjis.c b/enc/sjis.c
index e3d656f..5540a1f 100644
--- a/enc/sjis.c
+++ b/enc/sjis.c
@@ -351,7 +351,7 @@ get_ctype_code_range(int ctype, OnigCodePoint* sb_out,
}
}
-OnigEncodingDefine(SJIS) = {
+OnigEncodingDefine(sjis, SJIS) = {
mbc_enc_len,
"Shift_JIS", /* name */
2, /* max byte length */
diff --git a/enc/utf8.c b/enc/utf8.c
index 9f278b5..adfb274 100644
--- a/enc/utf8.c
+++ b/enc/utf8.c
@@ -486,7 +486,7 @@ utf8_get_case_fold_codes_by_str(OnigCaseFoldType flag,
flag, p, end, items);
}
-OnigEncodingDefine(UTF8) = {
+OnigEncodingDefine(utf8, UTF8) = {
utf8_mbc_enc_len,
"UTF-8", /* name */
6, /* max byte length */
diff --git a/encoding.c b/encoding.c
index 5d41652..a85cfdf 100644
--- a/encoding.c
+++ b/encoding.c
@@ -773,9 +773,6 @@ Init_Encoding(void)
rb_define_singleton_method(rb_cEncoding, "default_external", get_default_external, 0);
- /* should be imported from Oniguruma */
- rb_enc_replicate("ISO-8859-1", rb_enc_find(rb_enc_name(ONIG_ENCODING_ASCII)));
-
/* dummy for unsupported, statefull encoding */
rb_enc_replicate("ISO-2022-JP", rb_enc_find(rb_enc_name(ONIG_ENCODING_ASCII)));
diff --git a/regenc.h b/regenc.h
index 2512985..d23a60a 100644
--- a/regenc.h
+++ b/regenc.h
@@ -181,9 +181,9 @@ ONIG_EXTERN const unsigned short OnigEncAsciiCtypeTable[];
extern int ONIG_ENC_REGISTER(const char *, OnigEncodingType*);
#define OnigEncodingName(n) encoding_##n
#define OnigEncodingDeclare(n) static OnigEncodingType OnigEncodingName(n)
-#define OnigEncodingDefine(n) \
+#define OnigEncodingDefine(f,n) \
OnigEncodingDeclare(n); \
- void Init_##n(void) { \
+ void Init_##f(void) { \
ONIG_ENC_REGISTER(OnigEncodingName(n).name, \
&OnigEncodingName(n)); \
} \
@@ -191,7 +191,7 @@ extern int ONIG_ENC_REGISTER(const char *, OnigEncodingType*);
#else
#define OnigEncodingName(n) OnigEncoding##n
#define OnigEncodingDeclare(n) OnigEncodingType OnigEncodingName(n)
-#define OnigEncodingDefine(n) OnigEncodingDeclare(n)
+#define OnigEncodingDefine(f,n) OnigEncodingDeclare(n)
#endif
#endif /* REGENC_H */