[macruby-changes] [831] MacRuby/trunk/io.c
source_changes at macosforge.org
source_changes at macosforge.org
Mon Mar 2 14:05:53 PST 2009
Revision: 831
http://trac.macosforge.org/projects/ruby/changeset/831
Author: lsansonetti at apple.com
Date: 2009-03-02 14:05:53 -0800 (Mon, 02 Mar 2009)
Log Message:
-----------
pop non-mandatory hash from some APIs, these were introduced in 1.9.1, we will implement them later
Modified Paths:
--------------
MacRuby/trunk/io.c
Modified: MacRuby/trunk/io.c
===================================================================
--- MacRuby/trunk/io.c 2009-03-02 04:53:56 UTC (rev 830)
+++ MacRuby/trunk/io.c 2009-03-02 22:05:53 UTC (rev 831)
@@ -221,6 +221,20 @@
}
#endif
+static VALUE
+pop_last_hash(int *argc_p, VALUE *argv)
+{
+ VALUE last, tmp;
+ if (*argc_p == 0)
+ return Qnil;
+ last = argv[*argc_p-1];
+ tmp = rb_check_convert_type(last, T_HASH, "Hash", "to_hash");
+ if (NIL_P(tmp))
+ return Qnil;
+ (*argc_p)--;
+ return tmp;
+}
+
void
rb_eof_error(void)
{
@@ -5052,6 +5066,7 @@
int fd, fmode, flags = O_RDONLY;
rb_secure(4);
+ pop_last_hash(&argc, argv); // TODb
rb_scan_args(argc, argv, "11", &fnum, &mode);
if (argc == 2) {
if (FIXNUM_P(mode)) {
@@ -6216,6 +6231,7 @@
VALUE r, w, args[3], v1, v2;
rb_io_t *fptr;
+ pop_last_hash(&argc, argv); // TODO
rb_scan_args(argc, argv, "02", &v1, &v2);
if (pipe(pipes) == -1)
rb_sys_fail(0);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090302/2d2502bd/attachment.html>
More information about the macruby-changes
mailing list