[前][次][番号順一覧][スレッド一覧]

ruby-changes:3497

From: ko1@a...
Date: Sun, 13 Jan 2008 11:51:30 +0900 (JST)
Subject: [ruby-changes:3497] naruse - Ruby:r15016 (trunk): * encoding.c (ENCINDEX_EUC_JP, ENCINDEX_SJIS): removed.

naruse	2008-01-13 11:51:15 +0900 (Sun, 13 Jan 2008)

  New Revision: 15016

  Modified files:
    trunk/ChangeLog
    trunk/common.mk
    trunk/enc/Makefile.in
    trunk/enc/euc_jp.c
    trunk/enc/shift_jis.c
    trunk/encoding.c
    trunk/ruby.c

  Log:
    * 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.


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ruby.c?r1=15016&r2=15015&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=15016&r2=15015&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/enc/euc_jp.c?r1=15016&r2=15015&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/encoding.c?r1=15016&r2=15015&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/enc/Makefile.in?r1=15016&r2=15015&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/enc/shift_jis.c?r1=15016&r2=15015&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/common.mk?r1=15016&r2=15015&diff_format=u

Index: encoding.c
===================================================================
--- encoding.c	(revision 15015)
+++ encoding.c	(revision 15016)
@@ -297,8 +297,6 @@
 
 enum {
     ENCINDEX_ASCII,
-    ENCINDEX_EUC_JP,
-    ENCINDEX_SJIS,
     ENCINDEX_UTF8,
     ENCINDEX_BUILTIN_MAX
 };
@@ -309,8 +307,6 @@
     enc_table.count = enc_table_expand(ENCINDEX_BUILTIN_MAX);
 #define ENC_REGISTER(enc) enc_register_at(ENCINDEX_##enc, rb_enc_name(ONIG_ENCODING_##enc), ONIG_ENCODING_##enc)
     ENC_REGISTER(ASCII);
-    ENC_REGISTER(EUC_JP);
-    ENC_REGISTER(SJIS);
     ENC_REGISTER(UTF8);
 #undef ENC_REGISTER
 }
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 15015)
+++ ChangeLog	(revision 15016)
@@ -1,3 +1,16 @@
+Sun Jan 13 11:41:11 2008  NARUSE, Yui  <naruse@r...>
+
+	* 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.
+
 Sun Jan 13 10:21:40 2008  Nobuyoshi Nakada  <nobu@r...>
 
 	* encoding.c (enc_table): packed all enc_table stuff.
Index: enc/Makefile.in
===================================================================
--- enc/Makefile.in	(revision 15015)
+++ enc/Makefile.in	(revision 15016)
@@ -15,7 +15,6 @@
 OBJEXT = @OBJEXT@
 
 BUILTIN_ENCS	= ascii.c \
-		  euc_jp.c shift_jis.c \
 		  unicode.c utf8.c
 
 RUBY_SO_NAME = @RUBY_SO_NAME@
Index: enc/euc_jp.c
===================================================================
--- enc/euc_jp.c	(revision 15015)
+++ enc/euc_jp.c	(revision 15016)
@@ -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 @@
   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 @@
   *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 @@
   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 @@
   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));
Index: enc/shift_jis.c
===================================================================
--- enc/shift_jis.c	(revision 15015)
+++ enc/shift_jis.c	(revision 15016)
@@ -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 @@
   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 @@
   *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 @@
   }
   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 @@
 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 @@
       }
     } 
   }
-  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 @@
   }
 }
 
-OnigEncodingDefine(sjis, SJIS) = {
+OnigEncodingDefine(shift_jis, Shift_JIS) = {
   mbc_enc_len,
   "Shift_JIS",   /* name */
   2,             /* max byte length */
Index: common.mk
===================================================================
--- common.mk	(revision 15015)
+++ common.mk	(revision 15016)
@@ -664,12 +664,6 @@
 
 ascii.$(OBJEXT): {$(VPATH)}ascii.c {$(VPATH)}regenc.h {$(VPATH)}config.h \
   {$(VPATH)}defines.h {$(VPATH)}oniguruma.h
-euc_jp.$(OBJEXT): {$(VPATH)}euc_jp.c {$(VPATH)}regint.h \
-  {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}regenc.h \
-  {$(VPATH)}oniguruma.h {$(VPATH)}st.h
-shift_jis.$(OBJEXT): {$(VPATH)}shift_jis.c {$(VPATH)}regint.h {$(VPATH)}config.h \
-  {$(VPATH)}defines.h {$(VPATH)}regenc.h {$(VPATH)}oniguruma.h \
-  {$(VPATH)}st.h
 unicode.$(OBJEXT): {$(VPATH)}unicode.c {$(VPATH)}regint.h \
   {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}regenc.h \
   {$(VPATH)}oniguruma.h {$(VPATH)}st.h
Index: ruby.c
===================================================================
--- ruby.c	(revision 15015)
+++ ruby.c	(revision 15016)
@@ -709,11 +709,11 @@
 		rb_encoding *enc = 0;
 		switch (*s) {
 		  case 'E': case 'e':
-		    enc = ONIG_ENCODING_EUC_JP;
+		    enc = enc = rb_enc_find("EUC-JP");
 		    break;
 		  case 'S': case 's':
 		    enc = rb_enc_find("Windows-31J");
-		    if (!enc) enc = ONIG_ENCODING_SJIS;
+		    if (!enc) enc = rb_enc_find("Shift_JIS");
 		    break;
 		  case 'U': case 'u':
 		    enc = ONIG_ENCODING_UTF8;

--
ML: ruby-changes@q...
Info: 

[前][次][番号順一覧][スレッド一覧]