Kouhei Sutou
kous****@users*****
Mon Oct 16 00:17:16 JST 2006
Index: kazehakase/ext/ruby/kz-rb-downloader.c diff -u kazehakase/ext/ruby/kz-rb-downloader.c:1.1 kazehakase/ext/ruby/kz-rb-downloader.c:1.2 --- kazehakase/ext/ruby/kz-rb-downloader.c:1.1 Sat Jan 21 22:00:49 2006 +++ kazehakase/ext/ruby/kz-rb-downloader.c Mon Oct 16 00:17:16 2006 @@ -37,6 +37,12 @@ } static VALUE +rb_kz_dl_to_buffer(VALUE self) +{ + return CBOOL2RVAL(kz_downloader_to_buffer(_SELF(self))); +} + +static VALUE rb_kz_dl_get_string(VALUE self) { return CSTR2RVAL(kz_downloader_get_string(_SELF(self))); @@ -49,6 +55,12 @@ } static VALUE +rb_kz_dl_get_size(VALUE self) +{ + return INT2NUM(kz_downloader_get_size(_SELF(self))); +} + +static VALUE rb_kz_dl_get_current_progress(VALUE self) { return INT2NUM(kz_downloader_get_current_progress(_SELF(self))); @@ -71,7 +83,9 @@ rb_define_method(cKzDownloader, "initialize", rb_kz_dl_initialize, -1); rb_define_method(cKzDownloader, "cancel", rb_kz_dl_cancel, 0); rb_define_method(cKzDownloader, "to_file", rb_kz_dl_to_file, 0); + rb_define_method(cKzDownloader, "to_buffer", rb_kz_dl_to_buffer, 0); rb_define_method(cKzDownloader, "string", rb_kz_dl_get_string, 0); + rb_define_method(cKzDownloader, "size", rb_kz_dl_get_size, 0); rb_define_method(cKzDownloader, "percent", rb_kz_dl_get_percent, 0); rb_define_method(cKzDownloader, "current_progress", rb_kz_dl_get_current_progress, 0);