From 795bf7a665d6fb459e9bc6e8d34f1d679affee93 Mon Sep 17 00:00:00 2001 From: akr Date: Mon, 8 Sep 2008 17:23:37 +0000 Subject: * include/ruby/encoding.h (rb_econv_decorate_at_first): declared. (rb_econv_decorate_at_last): declared. * transcode.c (rb_econv_open_by_transcoder_entries): initialize replacement_enc. allocate outbuf for the last transcoder. (rb_econv_open0): extracted from rb_econv_open. (rb_econv_open): use rb_econv_open0 and decorate the result using rb_econv_decorate_at_first and rb_econv_decorate_at_last. (rb_econv_decorate_at): new function. (rb_econv_decorate_at_first): ditto. (rb_econv_decorate_at_last): ditto. (rb_econv_binmode): fix iteration end condition. (econv_init): don't set source_encoding_name and destination_encoding_name because they are set in rb_econv_open0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- include/ruby/encoding.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/ruby/encoding.h') diff --git a/include/ruby/encoding.h b/include/ruby/encoding.h index 3d294a0d7f..28a89765f3 100644 --- a/include/ruby/encoding.h +++ b/include/ruby/encoding.h @@ -224,6 +224,10 @@ void rb_econv_close(rb_econv_t *ec); /* result: 0:success -1:failure */ int rb_econv_set_replacement(rb_econv_t *ec, const unsigned char *str, size_t len, const char *encname); +/* result: 0:success -1:failure */ +int rb_econv_decorate_at_first(rb_econv_t *ec, const char *decorator_name); +int rb_econv_decorate_at_last(rb_econv_t *ec, const char *decorator_name); + VALUE rb_econv_open_exc(const char *senc, const char *denc, int ecflags); /* result: 0:success -1:failure */ -- cgit v1.2.3