diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-25 03:29:39 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-25 03:29:39 +0000 |
commit | a25fbe3b3e531bbe479f344af24eaf9d2eeae6ea () | |
tree | 055e58ed569fb28012fadade94f518e0a888e47d /include/ruby | |
parent | 0ada813abfe3a049da29bd423ba34606a00777bd (diff) |
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing. * parse.y (pragma_encoding): encoding specification pragma. * parse.y (rb_intern3): encoding specified symbols. * string.c (rb_str_length): length based on characters. for older behavior, bytesize method added. * string.c (rb_str_index_m): index based on characters. rindex as well. * string.c (succ_char): encoding aware succeeding string. * string.c (rb_str_reverse): reverse based on characters. * string.c (rb_str_inspect): encoding aware string description. * string.c (rb_str_upcase_bang): encoding aware case conversion. downcase, capitalize, swapcase as well. * string.c (rb_str_tr_bang): tr based on characters. delete, squeeze, tr_s, count as well. * string.c (rb_str_split_m): split based on characters. * string.c (rb_str_each_line): encoding aware each_line. * string.c (rb_str_each_char): added. iteration based on characters. * string.c (rb_str_strip_bang): encoding aware whitespace stripping. lstrip, rstrip as well. * string.c (rb_str_justify): encoding aware justifying (ljust, rjust, center). * string.c (str_encoding): get encoding attribute from a string. * re.c (rb_reg_initialize): encoding aware regular expression * sprintf.c (rb_str_format): formatting (i.e. length count) based on characters. * io.c (rb_io_getc): getc to return one-character string. for older behavior, getbyte method added. * ext/stringio/stringio.c (strio_getc): ditto. * io.c (rb_io_ungetc): allow pushing arbitrary string at the current reading point. * ext/stringio/stringio.c (strio_ungetc): ditto. * ext/strscan/strscan.c: encoding support. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | include/ruby/intern.h | 7 | ||||
-rw-r--r-- | include/ruby/io.h | 4 | ||||
-rw-r--r-- | include/ruby/node.h | 2 | ||||
-rw-r--r-- | include/ruby/re.h | 2 | ||||
-rw-r--r-- | include/ruby/regex.h | 8 | ||||
-rw-r--r-- | include/ruby/ruby.h | 30 | ||||
-rw-r--r-- | include/ruby/signal.h | 2 | ||||
-rw-r--r-- | include/ruby/util.h | 2 |
8 files changed, 43 insertions, 14 deletions
@@ -6,7 +6,7 @@ $Date$ created at: Thu Jun 10 14:22:17 JST 1993 - Copyright (C) 1993-2003 Yukihiro Matsumoto Copyright (C) 2000 Network Applied Communication Laboratory, Inc. Copyright (C) 2000 Information-technology Promotion Agency, Japan @@ -337,7 +337,7 @@ RUBY_EXTERN VALUE rb_default_rs; RUBY_EXTERN VALUE rb_output_rs; VALUE rb_io_write(VALUE, VALUE); VALUE rb_io_gets(VALUE); -VALUE rb_io_getc(VALUE); VALUE rb_io_ungetc(VALUE, VALUE); VALUE rb_io_close(VALUE); VALUE rb_io_flush(VALUE); @@ -444,7 +444,7 @@ VALUE rb_reg_last_match(VALUE); VALUE rb_reg_match_pre(VALUE); VALUE rb_reg_match_post(VALUE); VALUE rb_reg_match_last(VALUE); -VALUE rb_reg_new(const char*, long, int); VALUE rb_reg_match(VALUE, VALUE); VALUE rb_reg_match2(VALUE); int rb_reg_options(VALUE); @@ -498,6 +498,7 @@ VALUE rb_str_unlocktmp(VALUE); VALUE rb_str_dup_frozen(VALUE); VALUE rb_str_plus(VALUE, VALUE); VALUE rb_str_times(VALUE, VALUE); VALUE rb_str_substr(VALUE, long, long); void rb_str_modify(VALUE); VALUE rb_str_freeze(VALUE); @@ -6,7 +6,7 @@ $Date$ created at: Fri Nov 12 16:47:09 JST 1993 - Copyright (C) 1993-2003 Yukihiro Matsumoto **********************************************************************/ @@ -22,6 +22,7 @@ extern "C" { #include <stdio.h> #include <errno.h> #if defined(HAVE_STDIO_EXT_H) #include <stdio_ext.h> @@ -44,6 +45,7 @@ typedef struct rb_io_t { int rbuf_off; int rbuf_len; int rbuf_capa; } rb_io_t; #define HAVE_RB_IO_T 1 @@ -6,7 +6,7 @@ $Date$ created at: Fri May 28 15:14:02 JST 1993 - Copyright (C) 1993-2003 Yukihiro Matsumoto **********************************************************************/ @@ -6,7 +6,7 @@ $Date$ created at: Thu Sep 30 14:18:32 JST 1993 - Copyright (C) 1993-2003 Yukihiro Matsumoto **********************************************************************/ @@ -5,7 +5,7 @@ $Author$ $Date$ - Copyright (C) 1993-2005 Yukihiro Matsumoto **********************************************************************/ @@ -29,10 +29,8 @@ extern "C" { ONIG_EXTERN OnigEncoding OnigEncDefaultCharEncoding; -#undef ismbchar -#define ismbchar(c) (mbclen((c)) != 1) -#define mbclen(c) \ - ONIGENC_MBC_ENC_LEN(OnigEncDefaultCharEncoding, (UChar* )(&c)) #endif /* ifndef ONIG_RUBY_M17N */ @@ -5,7 +5,7 @@ $Author$ created at: Thu Jun 10 14:26:32 JST 1993 - Copyright (C) 1993-2003 Yukihiro Matsumoto Copyright (C) 2000 Network Applied Communication Laboratory, Inc. Copyright (C) 2000 Information-technology Promotion Agency, Japan @@ -455,6 +455,7 @@ struct RString { (!(RBASIC(str)->flags & RSTRING_NOEMBED) ? \ RSTRING(str)->as.ary : \ RSTRING(str)->as.heap.ptr) struct RArray { struct RBasic basic; @@ -598,6 +599,32 @@ enum ruby_value_flags { #define FL_USER6 RUBY_FL_USER6 RUBY_FL_USER7 = (1<<(FL_USHIFT+7)), #define FL_USER7 RUBY_FL_USER7 }; #define SPECIAL_CONST_P(x) (IMMEDIATE_P(x) || !RTEST(x)) @@ -667,6 +694,7 @@ void rb_gc_unregister_address(VALUE*); ID rb_intern(const char*); ID rb_intern2(const char*, long); const char *rb_id2name(ID); ID rb_to_id(VALUE); VALUE rb_id2str(ID); @@ -6,7 +6,7 @@ $Date$ created at: Wed Aug 16 01:15:38 JST 1995 - Copyright (C) 1993-2003 Yukihiro Matsumoto **********************************************************************/ @@ -6,7 +6,7 @@ $Date$ created at: Thu Mar 9 11:55:53 JST 1995 - Copyright (C) 1993-2003 Yukihiro Matsumoto **********************************************************************/ |