mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/iconv/iconv.c (iconv_s_list): return encoding list if no block
is given. [ruby-dev:23063] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8586deca95
commit
51c8d62bff
2 changed files with 19 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
|||
Thu Apr 8 18:22:00 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* ext/iconv/iconv.c (iconv_s_list): return encoding list if no block
|
||||
is given. [ruby-dev:23063]
|
||||
|
||||
Wed Apr 7 15:29:24 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* pack.c (pack_pack): use NUM2INT() instead of num2i32().
|
||||
|
@ -11,7 +16,7 @@ Wed Apr 7 12:32:02 2004 Kouhei Sutou <kou@cozmixng.org>
|
|||
* lib/rss/dublincore.rb: reverted style.
|
||||
|
||||
* lib/rss/xmlparser.rb: normalized XMLParser class hierarchy.
|
||||
|
||||
|
||||
Wed Apr 7 10:43:17 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* Makefile.in, common.mk, */Makefile.sub (ext/extinit.o): OUTFLAG
|
||||
|
|
|
@ -650,6 +650,7 @@ iconv_s_conv
|
|||
struct iconv_name_list {
|
||||
unsigned int namescount;
|
||||
const char *const *names;
|
||||
VALUE array;
|
||||
};
|
||||
|
||||
static VALUE
|
||||
|
@ -669,6 +670,9 @@ list_iconv_i
|
|||
for (i = 0; i < namescount; i++) {
|
||||
rb_ary_push(ary, rb_str_new2(names[i]));
|
||||
}
|
||||
if (p->array) {
|
||||
return rb_ary_push(p->array, ary);
|
||||
}
|
||||
return rb_yield(ary);
|
||||
}
|
||||
|
||||
|
@ -688,6 +692,7 @@ list_iconv
|
|||
|
||||
list.namescount = namescount;
|
||||
list.names = names;
|
||||
list.array = ((VALUE *)data)[1];
|
||||
rb_protect(list_iconv_i, (VALUE)&list, state);
|
||||
return *state;
|
||||
}
|
||||
|
@ -697,8 +702,14 @@ static VALUE
|
|||
iconv_s_list _((void))
|
||||
{
|
||||
#ifdef HAVE_ICONVLIST
|
||||
int state = 0;
|
||||
iconvlist(list_iconv, &state);
|
||||
int state;
|
||||
VALUE args[2];
|
||||
|
||||
args[1] = rb_block_given_p() ? 0 : rb_ary_new();
|
||||
iconvlist(list_iconv, args);
|
||||
state = *(int *)args;
|
||||
if (state) rb_jump_tag(state);
|
||||
if (args[1]) return args[1];
|
||||
#else
|
||||
rb_notimplement();
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue