<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[2069] MacRuby/branches/experimental</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.macosforge.org/projects/ruby/changeset/2069">2069</a></dd>
<dt>Author</dt> <dd>pthomson@apple.com</dd>
<dt>Date</dt> <dd>2009-07-24 14:23:13 -0700 (Fri, 24 Jul 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>Got readline to work, though it breaks irb.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#MacRubybranchesexperimentalextreadlineextconfrb">MacRuby/branches/experimental/ext/readline/extconf.rb</a></li>
<li><a href="#MacRubybranchesexperimentalextreadlinereadlinec">MacRuby/branches/experimental/ext/readline/readline.c</a></li>
<li><a href="#MacRubybranchesexperimentalrakelibbuilderrake">MacRuby/branches/experimental/rakelib/builder.rake</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="MacRubybranchesexperimentalextreadlineextconfrb"></a>
<div class="modfile"><h4>Modified: MacRuby/branches/experimental/ext/readline/extconf.rb (2068 => 2069)</h4>
<pre class="diff"><span>
<span class="info">--- MacRuby/branches/experimental/ext/readline/extconf.rb        2009-07-24 05:23:19 UTC (rev 2068)
+++ MacRuby/branches/experimental/ext/readline/extconf.rb        2009-07-24 21:23:13 UTC (rev 2069)
</span><span class="lines">@@ -15,36 +15,40 @@
</span><span class="cx">   return have_var(var, $readline_headers)
</span><span class="cx"> end
</span><span class="cx"> 
</span><ins>+def have_readline_func(func)
+  return have_func(func, $readline_headers)
+end
+
</ins><span class="cx"> dir_config('curses')
</span><span class="cx"> dir_config('ncurses')
</span><span class="cx"> dir_config('termcap')
</span><span class="cx"> dir_config(&quot;readline&quot;)
</span><del>-enable_libedit = enable_config(&quot;libedit&quot;)
</del><ins>+enable_libedit = true
</ins><span class="cx"> have_library(&quot;user32&quot;, nil) if /cygwin/ === RUBY_PLATFORM
</span><del>-have_library(&quot;ncurses&quot;, &quot;tgetnum&quot;) ||
-  have_library(&quot;termcap&quot;, &quot;tgetnum&quot;) ||
-  have_library(&quot;curses&quot;, &quot;tgetnum&quot;)
</del><ins>+have_library(&quot;ncurses&quot;) ||
+  have_library(&quot;termcap&quot;) ||
+  have_library(&quot;curses&quot;)
</ins><span class="cx"> 
</span><span class="cx"> if enable_libedit
</span><span class="cx">   unless (have_readline_header(&quot;editline/readline.h&quot;) ||
</span><span class="cx">           have_readline_header(&quot;readline/readline.h&quot;)) &amp;&amp;
</span><del>-          have_library(&quot;edit&quot;, &quot;readline&quot;)
</del><ins>+          have_library(&quot;edit&quot;)
</ins><span class="cx">     exit
</span><span class="cx">   end
</span><span class="cx"> else
</span><span class="cx">   unless ((have_readline_header(&quot;readline/readline.h&quot;) &amp;&amp;
</span><span class="cx">            have_readline_header(&quot;readline/history.h&quot;)) &amp;&amp;
</span><del>-           (have_library(&quot;readline&quot;, &quot;readline&quot;) ||
-            have_library(&quot;edit&quot;, &quot;readline&quot;))) ||
</del><ins>+           (have_library(&quot;readline&quot;) ||
+            have_library(&quot;edit&quot;))) ||
</ins><span class="cx">             (have_readline_header(&quot;editline/readline.h&quot;) &amp;&amp;
</span><del>-             have_library(&quot;edit&quot;, &quot;readline&quot;))
</del><ins>+             have_library(&quot;edit&quot;))
</ins><span class="cx">     exit
</span><span class="cx">   end
</span><span class="cx"> end
</span><span class="cx"> 
</span><del>-have_func(&quot;rl_filename_completion_function&quot;)
-have_func(&quot;rl_username_completion_function&quot;)
-have_func(&quot;rl_completion_matches&quot;)
</del><ins>+have_readline_func(&quot;rl_filename_completion_function&quot;)
+have_readline_func(&quot;username_completion_function&quot;)
+have_readline_func(&quot;rl_completion_matches&quot;)
</ins><span class="cx"> have_readline_var(&quot;rl_deprep_term_function&quot;)
</span><span class="cx"> have_readline_var(&quot;rl_completion_append_character&quot;)
</span><span class="cx"> have_readline_var(&quot;rl_basic_word_break_characters&quot;)
</span><span class="lines">@@ -55,11 +59,11 @@
</span><span class="cx"> have_readline_var(&quot;rl_attempted_completion_over&quot;)
</span><span class="cx"> have_readline_var(&quot;rl_library_version&quot;)
</span><span class="cx"> # workaround for native windows.
</span><del>-/mswin|bccwin|mingw/ !~ RUBY_PLATFORM &amp;&amp; have_readline_var(&quot;rl_event_hook&quot;)
-have_func(&quot;rl_cleanup_after_signal&quot;)
-have_func(&quot;rl_clear_signals&quot;)
-have_func(&quot;rl_vi_editing_mode&quot;)
-have_func(&quot;rl_emacs_editing_mode&quot;)
-have_func(&quot;replace_history_entry&quot;)
-have_func(&quot;remove_history&quot;)
</del><ins>+#/mswin|bccwin|mingw/ !~ RUBY_PLATFORM &amp;&amp; have_readline_var(&quot;rl_event_hook&quot;)
+have_readline_func(&quot;rl_cleanup_after_signal&quot;)
+have_readline_func(&quot;rl_clear_signals&quot;)
+have_readline_func(&quot;rl_vi_editing_mode&quot;)
+have_readline_func(&quot;rl_emacs_editing_mode&quot;)
+have_readline_func(&quot;replace_history_entry&quot;)
+have_readline_func(&quot;remove_history&quot;)
</ins><span class="cx"> create_makefile(&quot;readline&quot;)
</span></span></pre></div>
<a id="MacRubybranchesexperimentalextreadlinereadlinec"></a>
<div class="modfile"><h4>Modified: MacRuby/branches/experimental/ext/readline/readline.c (2068 => 2069)</h4>
<pre class="diff"><span>
<span class="info">--- MacRuby/branches/experimental/ext/readline/readline.c        2009-07-24 05:23:19 UTC (rev 2068)
+++ MacRuby/branches/experimental/ext/readline/readline.c        2009-07-24 21:23:13 UTC (rev 2069)
</span><span class="lines">@@ -19,7 +19,7 @@
</span><span class="cx"> #include &lt;editline/readline.h&gt;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#include &quot;ruby/ruby.h&quot;
</del><ins>+#include &quot;ruby.h&quot;
</ins><span class="cx"> #include &quot;ruby/io.h&quot;
</span><span class="cx"> #include &quot;ruby/signal.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -27,6 +27,10 @@
</span><span class="cx"> #include &lt;unistd.h&gt;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#ifndef GetOpenFile
+#define GetOpenFile(obj, var) var = RFILE(rb_io_taint_check(obj))-&gt;fptr
+#endif
+
</ins><span class="cx"> #if WITH_OBJC
</span><span class="cx"> /* We cannot use the GC memory functions here because the underlying libedit
</span><span class="cx">  * function will call free() on the memory, resulting in a leak.
</span><span class="lines">@@ -78,7 +82,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-readline_readline(int argc, VALUE *argv, VALUE self)
</del><ins>+readline_readline(VALUE self, SEL sel, int argc, VALUE *argv)
</ins><span class="cx"> {
</span><span class="cx">     VALUE tmp, add_hist, result;
</span><span class="cx">     const char *prompt = NULL;
</span><span class="lines">@@ -126,31 +130,31 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-readline_s_set_input(VALUE self, VALUE input)
</del><ins>+readline_s_set_input(VALUE self, SEL sel, VALUE input)
</ins><span class="cx"> {
</span><span class="cx">     rb_io_t *ifp;
</span><span class="cx"> 
</span><span class="cx">     rb_secure(4);
</span><span class="cx">     Check_Type(input, T_FILE);
</span><span class="cx">     GetOpenFile(input, ifp);
</span><del>-    rl_instream = rb_io_stdio_file(ifp);
</del><ins>+    rl_instream = fdopen(ifp-&gt;fd, &quot;r+&quot;);
</ins><span class="cx">     return input;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-readline_s_set_output(VALUE self, VALUE output)
</del><ins>+readline_s_set_output(VALUE self, SEL sel, VALUE output)
</ins><span class="cx"> {
</span><span class="cx">     rb_io_t *ofp;
</span><span class="cx"> 
</span><span class="cx">     rb_secure(4);
</span><span class="cx">     Check_Type(output, T_FILE);
</span><span class="cx">     GetOpenFile(output, ofp);
</span><del>-    rl_outstream = rb_io_stdio_file(ofp);
</del><ins>+    rl_outstream = fdopen(ofp-&gt;fd, &quot;w+&quot;);
</ins><span class="cx">     return output;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-readline_s_set_completion_proc(VALUE self, VALUE proc)
</del><ins>+readline_s_set_completion_proc(VALUE self, SEL sel, VALUE proc)
</ins><span class="cx"> {
</span><span class="cx">     rb_secure(4);
</span><span class="cx">     if (!rb_respond_to(proc, rb_intern(&quot;call&quot;)))
</span><span class="lines">@@ -159,21 +163,21 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-readline_s_get_completion_proc(VALUE self)
</del><ins>+readline_s_get_completion_proc(VALUE self, SEL sel)
</ins><span class="cx"> {
</span><span class="cx">     rb_secure(4);
</span><span class="cx">     return rb_attr_get(mReadline, completion_proc);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-readline_s_set_completion_case_fold(VALUE self, VALUE val)
</del><ins>+readline_s_set_completion_case_fold(VALUE self, SEL sel, VALUE val)
</ins><span class="cx"> {
</span><span class="cx">     rb_secure(4);
</span><span class="cx">     return rb_ivar_set(mReadline, completion_case_fold, val);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-readline_s_get_completion_case_fold(VALUE self)
</del><ins>+readline_s_get_completion_case_fold(VALUE self, SEL sel)
</ins><span class="cx"> {
</span><span class="cx">     rb_secure(4);
</span><span class="cx">     return rb_attr_get(mReadline, completion_case_fold);
</span><span class="lines">@@ -244,7 +248,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-readline_s_vi_editing_mode(VALUE self)
</del><ins>+readline_s_vi_editing_mode(VALUE self, SEL sel)
</ins><span class="cx"> {
</span><span class="cx"> #ifdef HAVE_RL_VI_EDITING_MODE
</span><span class="cx">     rb_secure(4);
</span><span class="lines">@@ -257,7 +261,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-readline_s_emacs_editing_mode(VALUE self)
</del><ins>+readline_s_emacs_editing_mode(VALUE self, SEL sel)
</ins><span class="cx"> {
</span><span class="cx"> #ifdef HAVE_RL_EMACS_EDITING_MODE
</span><span class="cx">     rb_secure(4);
</span><span class="lines">@@ -270,7 +274,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-readline_s_set_completion_append_character(VALUE self, VALUE str)
</del><ins>+readline_s_set_completion_append_character(VALUE self, SEL sel, VALUE str)
</ins><span class="cx"> {
</span><span class="cx"> #ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER
</span><span class="cx">     rb_secure(4);
</span><span class="lines">@@ -293,7 +297,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-readline_s_get_completion_append_character(VALUE self)
</del><ins>+readline_s_get_completion_append_character(VALUE self, SEL sel)
</ins><span class="cx"> {
</span><span class="cx"> #ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER
</span><span class="cx">     VALUE str;
</span><span class="lines">@@ -311,7 +315,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-readline_s_set_basic_word_break_characters(VALUE self, VALUE str)
</del><ins>+readline_s_set_basic_word_break_characters(VALUE self, SEL sel, VALUE str)
</ins><span class="cx"> {
</span><span class="cx"> #ifdef HAVE_RL_BASIC_WORD_BREAK_CHARACTERS
</span><span class="cx">     static char *basic_word_break_characters = NULL;
</span><span class="lines">@@ -337,7 +341,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-readline_s_get_basic_word_break_characters(VALUE self, VALUE str)
</del><ins>+readline_s_get_basic_word_break_characters(VALUE self, SEL sel, VALUE str)
</ins><span class="cx"> {
</span><span class="cx"> #ifdef HAVE_RL_BASIC_WORD_BREAK_CHARACTERS
</span><span class="cx">     rb_secure(4);
</span><span class="lines">@@ -351,7 +355,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-readline_s_set_completer_word_break_characters(VALUE self, VALUE str)
</del><ins>+readline_s_set_completer_word_break_characters(VALUE self, SEL sel, VALUE str)
</ins><span class="cx"> {
</span><span class="cx"> #ifdef HAVE_RL_COMPLETER_WORD_BREAK_CHARACTERS
</span><span class="cx">     static char *completer_word_break_characters = NULL;
</span><span class="lines">@@ -377,7 +381,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-readline_s_get_completer_word_break_characters(VALUE self, VALUE str)
</del><ins>+readline_s_get_completer_word_break_characters(VALUE self, SEL sel, VALUE str)
</ins><span class="cx"> {
</span><span class="cx"> #ifdef HAVE_RL_COMPLETER_WORD_BREAK_CHARACTERS
</span><span class="cx">     rb_secure(4);
</span><span class="lines">@@ -391,7 +395,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-readline_s_set_basic_quote_characters(VALUE self, VALUE str)
</del><ins>+readline_s_set_basic_quote_characters(VALUE self, SEL sel, VALUE str)
</ins><span class="cx"> {
</span><span class="cx"> #ifdef HAVE_RL_BASIC_QUOTE_CHARACTERS
</span><span class="cx">     static char *basic_quote_characters = NULL;
</span><span class="lines">@@ -418,7 +422,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-readline_s_get_basic_quote_characters(VALUE self, VALUE str)
</del><ins>+readline_s_get_basic_quote_characters(VALUE self, SEL sel, VALUE str)
</ins><span class="cx"> {
</span><span class="cx"> #ifdef HAVE_RL_BASIC_QUOTE_CHARACTERS
</span><span class="cx">     rb_secure(4);
</span><span class="lines">@@ -432,7 +436,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-readline_s_set_completer_quote_characters(VALUE self, VALUE str)
</del><ins>+readline_s_set_completer_quote_characters(VALUE self, SEL sel, VALUE str)
</ins><span class="cx"> {
</span><span class="cx"> #ifdef HAVE_RL_COMPLETER_QUOTE_CHARACTERS
</span><span class="cx">     static char *completer_quote_characters = NULL;
</span><span class="lines">@@ -458,7 +462,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-readline_s_get_completer_quote_characters(VALUE self, VALUE str)
</del><ins>+readline_s_get_completer_quote_characters(VALUE self, SEL sel, VALUE str)
</ins><span class="cx"> {
</span><span class="cx"> #ifdef HAVE_RL_COMPLETER_QUOTE_CHARACTERS
</span><span class="cx">     rb_secure(4);
</span><span class="lines">@@ -472,7 +476,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-readline_s_set_filename_quote_characters(VALUE self, VALUE str)
</del><ins>+readline_s_set_filename_quote_characters(VALUE self, SEL sel, VALUE str)
</ins><span class="cx"> {
</span><span class="cx"> #ifdef HAVE_RL_FILENAME_QUOTE_CHARACTERS
</span><span class="cx">     static char *filename_quote_characters = NULL;
</span><span class="lines">@@ -498,7 +502,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-readline_s_get_filename_quote_characters(VALUE self, VALUE str)
</del><ins>+readline_s_get_filename_quote_characters(VALUE self, SEL sel, VALUE str)
</ins><span class="cx"> {
</span><span class="cx"> #ifdef HAVE_RL_FILENAME_QUOTE_CHARACTERS
</span><span class="cx">     rb_secure(4);
</span><span class="lines">@@ -512,13 +516,13 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-hist_to_s(VALUE self)
</del><ins>+hist_to_s(VALUE self, SEL sel)
</ins><span class="cx"> {
</span><span class="cx">     return rb_str_new2(&quot;HISTORY&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-hist_get(VALUE self, VALUE index)
</del><ins>+hist_get(VALUE self, SEL sel, VALUE index)
</ins><span class="cx"> {
</span><span class="cx">     HIST_ENTRY *entry;
</span><span class="cx">     int i;
</span><span class="lines">@@ -536,7 +540,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-hist_set(VALUE self, VALUE index, VALUE str)
</del><ins>+hist_set(VALUE self, SEL sel, VALUE index, VALUE str)
</ins><span class="cx"> {
</span><span class="cx"> #ifdef HAVE_REPLACE_HISTORY_ENTRY
</span><span class="cx">     HIST_ENTRY *entry;
</span><span class="lines">@@ -560,7 +564,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-hist_push(VALUE self, VALUE str)
</del><ins>+hist_push(VALUE self, SEL sel, VALUE str)
</ins><span class="cx"> {
</span><span class="cx">     rb_secure(4);
</span><span class="cx">     SafeStringValue(str);
</span><span class="lines">@@ -569,7 +573,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-hist_push_method(int argc, VALUE *argv, VALUE self)
</del><ins>+hist_push_method(VALUE self, SEL sel, int argc, VALUE *argv)
</ins><span class="cx"> {
</span><span class="cx">     VALUE str;
</span><span class="cx">     
</span><span class="lines">@@ -605,7 +609,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-hist_pop(VALUE self)
</del><ins>+hist_pop(VALUE self, SEL sel)
</ins><span class="cx"> {
</span><span class="cx">     rb_secure(4);
</span><span class="cx">     if (history_length &gt; 0) {
</span><span class="lines">@@ -616,7 +620,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-hist_shift(VALUE self)
</del><ins>+hist_shift(VALUE self, SEL sel)
</ins><span class="cx"> {
</span><span class="cx">     rb_secure(4);
</span><span class="cx">     if (history_length &gt; 0) {
</span><span class="lines">@@ -627,7 +631,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-hist_each(VALUE self)
</del><ins>+hist_each(VALUE self, SEL sel)
</ins><span class="cx"> {
</span><span class="cx">     HIST_ENTRY *entry;
</span><span class="cx">     int i;
</span><span class="lines">@@ -645,21 +649,21 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-hist_length(VALUE self)
</del><ins>+hist_length(VALUE self, SEL sel)
</ins><span class="cx"> {
</span><span class="cx">     rb_secure(4);
</span><span class="cx">     return INT2NUM(history_length);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-hist_empty_p(VALUE self)
</del><ins>+hist_empty_p(VALUE self, SEL sel)
</ins><span class="cx"> {
</span><span class="cx">     rb_secure(4);
</span><span class="cx">     return history_length == 0 ? Qtrue : Qfalse;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-hist_delete_at(VALUE self, VALUE index)
</del><ins>+hist_delete_at(VALUE self, SEL sel, VALUE index)
</ins><span class="cx"> {
</span><span class="cx">     int i;
</span><span class="cx"> 
</span><span class="lines">@@ -674,7 +678,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-filename_completion_proc_call(VALUE self, VALUE str)
</del><ins>+filename_completion_proc_call(VALUE self, SEL sel, VALUE str)
</ins><span class="cx"> {
</span><span class="cx">     VALUE result;
</span><span class="cx">     char **matches;
</span><span class="lines">@@ -699,7 +703,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VALUE
</span><del>-username_completion_proc_call(VALUE self, VALUE str)
</del><ins>+username_completion_proc_call(VALUE self, SEL sel, VALUE str)
</ins><span class="cx"> {
</span><span class="cx">     VALUE result;
</span><span class="cx">     char **matches;
</span><span class="lines">@@ -737,72 +741,72 @@
</span><span class="cx">     completion_case_fold = rb_intern(COMPLETION_CASE_FOLD);
</span><span class="cx"> 
</span><span class="cx">     mReadline = rb_define_module(&quot;Readline&quot;);
</span><del>-    rb_define_module_function(mReadline, &quot;readline&quot;,
</del><ins>+    rb_objc_define_method(mReadline, &quot;readline&quot;,
</ins><span class="cx">                               readline_readline, -1);
</span><del>-    rb_define_singleton_method(mReadline, &quot;input=&quot;,
</del><ins>+    rb_objc_define_method(*(VALUE *)mReadline, &quot;input=&quot;,
</ins><span class="cx">                                readline_s_set_input, 1);
</span><del>-    rb_define_singleton_method(mReadline, &quot;output=&quot;,
</del><ins>+    rb_objc_define_method(*(VALUE *)mReadline, &quot;output=&quot;,
</ins><span class="cx">                                readline_s_set_output, 1);
</span><del>-    rb_define_singleton_method(mReadline, &quot;completion_proc=&quot;,
</del><ins>+    rb_objc_define_method(*(VALUE *)mReadline, &quot;completion_proc=&quot;,
</ins><span class="cx">                                readline_s_set_completion_proc, 1);
</span><del>-    rb_define_singleton_method(mReadline, &quot;completion_proc&quot;,
</del><ins>+    rb_objc_define_method(*(VALUE *)mReadline, &quot;completion_proc&quot;,
</ins><span class="cx">                                readline_s_get_completion_proc, 0);
</span><del>-    rb_define_singleton_method(mReadline, &quot;completion_case_fold=&quot;,
</del><ins>+    rb_objc_define_method(*(VALUE *)mReadline, &quot;completion_case_fold=&quot;,
</ins><span class="cx">                                readline_s_set_completion_case_fold, 1);
</span><del>-    rb_define_singleton_method(mReadline, &quot;completion_case_fold&quot;,
</del><ins>+    rb_objc_define_method(*(VALUE *)mReadline, &quot;completion_case_fold&quot;,
</ins><span class="cx">                                readline_s_get_completion_case_fold, 0);
</span><del>-    rb_define_singleton_method(mReadline, &quot;vi_editing_mode&quot;,
</del><ins>+    rb_objc_define_method(*(VALUE *)mReadline, &quot;vi_editing_mode&quot;,
</ins><span class="cx">                                readline_s_vi_editing_mode, 0);
</span><del>-    rb_define_singleton_method(mReadline, &quot;emacs_editing_mode&quot;,
</del><ins>+    rb_objc_define_method(*(VALUE *)mReadline, &quot;emacs_editing_mode&quot;,
</ins><span class="cx">                                readline_s_emacs_editing_mode, 0);
</span><del>-    rb_define_singleton_method(mReadline, &quot;completion_append_character=&quot;,
</del><ins>+    rb_objc_define_method(*(VALUE *)mReadline, &quot;completion_append_character=&quot;,
</ins><span class="cx">                                readline_s_set_completion_append_character, 1);
</span><del>-    rb_define_singleton_method(mReadline, &quot;completion_append_character&quot;,
</del><ins>+    rb_objc_define_method(*(VALUE *)mReadline, &quot;completion_append_character&quot;,
</ins><span class="cx">                                readline_s_get_completion_append_character, 0);
</span><del>-    rb_define_singleton_method(mReadline, &quot;basic_word_break_characters=&quot;,
</del><ins>+    rb_objc_define_method(*(VALUE *)mReadline, &quot;basic_word_break_characters=&quot;,
</ins><span class="cx">                                readline_s_set_basic_word_break_characters, 1);
</span><del>-    rb_define_singleton_method(mReadline, &quot;basic_word_break_characters&quot;,
</del><ins>+    rb_objc_define_method(*(VALUE *)mReadline, &quot;basic_word_break_characters&quot;,
</ins><span class="cx">                                readline_s_get_basic_word_break_characters, 0);
</span><del>-    rb_define_singleton_method(mReadline, &quot;completer_word_break_characters=&quot;,
</del><ins>+    rb_objc_define_method(*(VALUE *)mReadline, &quot;completer_word_break_characters=&quot;,
</ins><span class="cx">                                readline_s_set_completer_word_break_characters, 1);
</span><del>-    rb_define_singleton_method(mReadline, &quot;completer_word_break_characters&quot;,
</del><ins>+    rb_objc_define_method(*(VALUE *)mReadline, &quot;completer_word_break_characters&quot;,
</ins><span class="cx">                                readline_s_get_completer_word_break_characters, 0);
</span><del>-    rb_define_singleton_method(mReadline, &quot;basic_quote_characters=&quot;,
</del><ins>+    rb_objc_define_method(*(VALUE *)mReadline, &quot;basic_quote_characters=&quot;,
</ins><span class="cx">                                readline_s_set_basic_quote_characters, 1);
</span><del>-    rb_define_singleton_method(mReadline, &quot;basic_quote_characters&quot;,
</del><ins>+    rb_objc_define_method(*(VALUE *)mReadline, &quot;basic_quote_characters&quot;,
</ins><span class="cx">                                readline_s_get_basic_quote_characters, 0);
</span><del>-    rb_define_singleton_method(mReadline, &quot;completer_quote_characters=&quot;,
</del><ins>+    rb_objc_define_method(*(VALUE *)mReadline, &quot;completer_quote_characters=&quot;,
</ins><span class="cx">                                readline_s_set_completer_quote_characters, 1);
</span><del>-    rb_define_singleton_method(mReadline, &quot;completer_quote_characters&quot;,
</del><ins>+    rb_objc_define_method(*(VALUE *)mReadline, &quot;completer_quote_characters&quot;,
</ins><span class="cx">                                readline_s_get_completer_quote_characters, 0);
</span><del>-    rb_define_singleton_method(mReadline, &quot;filename_quote_characters=&quot;,
</del><ins>+    rb_objc_define_method(*(VALUE *)mReadline, &quot;filename_quote_characters=&quot;,
</ins><span class="cx">                                readline_s_set_filename_quote_characters, 1);
</span><del>-    rb_define_singleton_method(mReadline, &quot;filename_quote_characters&quot;,
</del><ins>+    rb_objc_define_method(*(VALUE *)mReadline, &quot;filename_quote_characters&quot;,
</ins><span class="cx">                                readline_s_get_filename_quote_characters, 0);
</span><span class="cx"> 
</span><span class="cx">     history = rb_obj_alloc(rb_cObject);
</span><span class="cx">     rb_extend_object(history, rb_mEnumerable);
</span><del>-    rb_define_singleton_method(history,&quot;to_s&quot;, hist_to_s, 0);
-    rb_define_singleton_method(history,&quot;[]&quot;, hist_get, 1);
-    rb_define_singleton_method(history,&quot;[]=&quot;, hist_set, 2);
-    rb_define_singleton_method(history,&quot;&lt;&lt;&quot;, hist_push, 1);
-    rb_define_singleton_method(history,&quot;push&quot;, hist_push_method, -1);
-    rb_define_singleton_method(history,&quot;pop&quot;, hist_pop, 0);
-    rb_define_singleton_method(history,&quot;shift&quot;, hist_shift, 0);
-    rb_define_singleton_method(history,&quot;each&quot;, hist_each, 0);
-    rb_define_singleton_method(history,&quot;length&quot;, hist_length, 0);
-    rb_define_singleton_method(history,&quot;size&quot;, hist_length, 0);
-    rb_define_singleton_method(history,&quot;empty?&quot;, hist_empty_p, 0);
-    rb_define_singleton_method(history,&quot;delete_at&quot;, hist_delete_at, 1);
</del><ins>+    rb_objc_define_method(*(VALUE *)history, &quot;to_s&quot;, hist_to_s, 0);
+    rb_objc_define_method(*(VALUE *)history, &quot;[]&quot;, hist_get, 1);
+    rb_objc_define_method(*(VALUE *)history, &quot;[]=&quot;, hist_set, 2);
+    rb_objc_define_method(*(VALUE *)history, &quot;&lt;&lt;&quot;, hist_push, 1);
+    rb_objc_define_method(*(VALUE *)history, &quot;push&quot;, hist_push_method, -1);
+    rb_objc_define_method(*(VALUE *)history, &quot;pop&quot;, hist_pop, 0);
+    rb_objc_define_method(*(VALUE *)history, &quot;shift&quot;, hist_shift, 0);
+    rb_objc_define_method(*(VALUE *)history, &quot;each&quot;, hist_each, 0);
+    rb_objc_define_method(*(VALUE *)history, &quot;length&quot;, hist_length, 0);
+    rb_objc_define_method(*(VALUE *)history, &quot;size&quot;, hist_length, 0);
+    rb_objc_define_method(*(VALUE *)history, &quot;empty?&quot;, hist_empty_p, 0);
+    rb_objc_define_method(*(VALUE *)history, &quot;delete_at&quot;, hist_delete_at, 1);
</ins><span class="cx">     rb_define_const(mReadline, &quot;HISTORY&quot;, history);
</span><span class="cx"> 
</span><span class="cx">     fcomp = rb_obj_alloc(rb_cObject);
</span><del>-    rb_define_singleton_method(fcomp, &quot;call&quot;,
</del><ins>+    rb_objc_define_method(*(VALUE *)fcomp, &quot;call&quot;,
</ins><span class="cx">                                filename_completion_proc_call, 1);
</span><span class="cx">     rb_define_const(mReadline, &quot;FILENAME_COMPLETION_PROC&quot;, fcomp);
</span><span class="cx"> 
</span><span class="cx">     ucomp = rb_obj_alloc(rb_cObject);
</span><del>-    rb_define_singleton_method(ucomp, &quot;call&quot;,
</del><ins>+    rb_objc_define_method(*(VALUE *)ucomp, &quot;call&quot;,
</ins><span class="cx">                                username_completion_proc_call, 1);
</span><span class="cx">     rb_define_const(mReadline, &quot;USERNAME_COMPLETION_PROC&quot;, ucomp);
</span><span class="cx"> #if defined HAVE_RL_LIBRARY_VERSION
</span></span></pre></div>
<a id="MacRubybranchesexperimentalrakelibbuilderrake"></a>
<div class="modfile"><h4>Modified: MacRuby/branches/experimental/rakelib/builder.rake (2068 => 2069)</h4>
<pre class="diff"><span>
<span class="info">--- MacRuby/branches/experimental/rakelib/builder.rake        2009-07-24 05:23:19 UTC (rev 2068)
+++ MacRuby/branches/experimental/rakelib/builder.rake        2009-07-24 21:23:13 UTC (rev 2069)
</span><span class="lines">@@ -312,7 +312,7 @@
</span><span class="cx"> EXTMK_ARGS = &quot;#{SCRIPT_ARGS} --extension --extstatic&quot;
</span><span class="cx"> INSTRUBY_ARGS = &quot;#{SCRIPT_ARGS} --data-mode=0644 --prog-mode=0755 --installed-list #{INSTALLED_LIST} --mantype=\&quot;doc\&quot; --sym-dest-dir=\&quot;#{SYM_INSTDIR}\&quot;&quot;
</span><span class="cx"> 
</span><del>-EXTENSIONS = ['ripper', 'digest']
</del><ins>+EXTENSIONS = ['ripper', 'digest', 'readline']
</ins><span class="cx"> def perform_extensions_target(target)
</span><span class="cx">   EXTENSIONS.map { |x| File.join('ext', x) }.each do |ext_dir|
</span><span class="cx">     Dir.glob(File.join(ext_dir, '**/extconf.rb')) do |p|
</span></span></pre>
</div>
</div>

</body>
</html>