[#1711] Re: open-uri patch, added progress_proc hook — "T. Onoma" <transami@...>

Tanaka Akira:

22 messages 2003/11/19
[#1737] Re: open-uri patch, added progress_proc hook — Mathieu Bouchard <matju@...> 2003/11/23

[#1739] Re: open-uri patch, added progress_proc hook — Mathieu Bouchard <matju@...> 2003/11/23

[#1740] Re: open-uri patch, added progress_proc hook — "T. Onoma" <transami@...> 2003/11/23

On Sunday 23 November 2003 08:26 pm, Mathieu Bouchard wrote:

[#1741] Re: open-uri patch, added progress_proc hook — Mathieu Bouchard <matju@...> 2003/11/23

[#1718] Re: open-uri patch, added progress_proc hook — Elliott Hughes <ehughes@...>

22 messages 2003/11/21
[#1722] Re: open-uri patch, added progress_proc hook — Tanaka Akira <akr@...17n.org> 2003/11/22

In article <AD4480A509455343AEFACCC231BA850F17C434@ukexchange>,

[#1724] Re: open-uri patch, added progress_proc hook — "T. Onoma" <transami@...> 2003/11/22

On Saturday 22 November 2003 04:34 pm, Tanaka Akira wrote:

[#1726] Re: open-uri patch, added progress_proc hook — Tanaka Akira <akr@...17n.org> 2003/11/23

In article <200311221024.05642.transami@runbox.com>,

[#1731] Re: open-uri patch, added progress_proc hook — "T. Onoma" <transami@...> 2003/11/23

On Sunday 23 November 2003 02:24 am, Tanaka Akira wrote:

[#1732] Re: open-uri patch, added progress_proc hook — Tanaka Akira <akr@...17n.org> 2003/11/23

In article <200311230325.21687.transami@runbox.com>,

[#1733] Re: open-uri patch, added progress_proc hook — "T. Onoma" <transami@...> 2003/11/23

On Sunday 23 November 2003 03:10 pm, Tanaka Akira wrote:

[#1750] Re: open-uri patch, added progress_proc hook — Tanaka Akira <akr@...17n.org> 2003/11/24

In article <200311230648.41003.transami@runbox.com>,

[#1759] Re: open-uri patch, added progress_proc hook — Sean E Russell <ser@...> 2003/11/24

On Monday 24 November 2003 03:19, Tanaka Akira wrote:

[#1762] Re: open-uri patch, added progress_proc hook — "Nathaniel Talbott" <nathaniel@...> 2003/11/24

Sean E Russell [mailto:ser@germane-software.com] wrote:

[#1753] gc_sweep under 1.8 ... not syck.so — Richard Kilmer <rich@...>

We still encountered a gc_sweep in our use of Ruby 1.8 on Linux (v8).

16 messages 2003/11/24
[#1754] Re: gc_sweep under 1.8 ... not syck.so — ts <decoux@...> 2003/11/24

>>>>> "R" == Richard Kilmer <rich@infoether.com> writes:

[#1757] Re: gc_sweep under 1.8 ... not syck.so — Richard Kilmer <rich@...> 2003/11/24

Yes, there are several (Ruby) threads working during this gc_sweep.

[#1758] Re: gc_sweep under 1.8 ... not syck.so — ts <decoux@...> 2003/11/24

>>>>> "R" == Richard Kilmer <rich@infoether.com> writes:

[#1763] Re: gc_sweep under 1.8 ... not syck.so — Richard Kilmer <rich@...> 2003/11/24

of course this effects 300 machines ;-)

[#1755] Re: Controlled block variables — Jamis Buck <jgb3@...>

On Mon, 2003-11-24 at 02:04, T. Onoma wrote:

26 messages 2003/11/24
[#1756] Re: Controlled block variables — "T. Onoma" <transami@...> 2003/11/24

On Monday 24 November 2003 05:22 pm, Jamis Buck wrote:

[#1760] Re: Controlled block variables — Sean E Russell <ser@...> 2003/11/24

On Monday 24 November 2003 11:51, T. Onoma wrote:

[#1761] Re: Controlled block variables — "T. Onoma" <transami@...> 2003/11/24

On Monday 24 November 2003 06:40 pm, Sean E Russell wrote:

[patch] Small additions to Curses extension

From: Ville Aine <vaine@...>
Date: 2003-11-19 00:15:03 UTC
List: ruby-core #1707
The attached patch adds bindings for these functions to Curses:
- def_prog_mode() as Curses.def_prog_mode
- reset_prog_mode() as Curses.reset_prog_mode
- timeout() as Curses.timeout=
- wtimeout() as Window#timeout=
- nodelay() as Window#nodelay=

All of these functions are specified in the XSI Curses standard, 
Issue 4.

The standard also specifies other possibly useful functions that
aren't included in the Curses extension. I'd be very interested in 
knowing why they haven't been included? For the sake of simplicity? 
Portability?

-- 
Ville Aine / "if.iknisleh.sc@eniav".reverse

Attachments (1)

ruby_curses.patch (3.15 KB, text/x-diff)
Index: curses.c
===================================================================
RCS file: /src/ruby/ext/curses/curses.c,v
retrieving revision 1.21
diff -u -r1.21 curses.c
--- curses.c	18 Aug 2003 16:24:42 -0000	1.21
+++ curses.c	18 Nov 2003 23:43:15 -0000
@@ -679,6 +679,31 @@
 #undef define_curs_mouse_member
 #endif /* USE_MOUSE */
 
+#ifdef HAVE_TIMEOUT
+static VALUE
+curses_timeout(VALUE obj, VALUE delay)
+{
+  timeout(NUM2INT(delay));
+  return Qnil;
+}
+#endif
+
+#ifdef HAVE_DEF_PROG_MODE
+static VALUE
+curses_def_prog_mode(VALUE obj)
+{
+  return def_prog_mode() == OK ? Qtrue : Qfalse;
+}
+#endif
+
+#ifdef HAVE_RESET_PROG_MODE
+static VALUE
+curses_reset_prog_mode(VALUE obj)
+{
+  return reset_prog_mode() == OK ? Qtrue : Qfalse;
+}
+#endif
+
 /*-------------------------- class Window --------------------------*/
 
 /* def self.allocate */
@@ -1251,6 +1276,30 @@
 }
 #endif /* HAVE_KEYPAD */
 
+#ifdef HAVE_NODELAY
+static VALUE
+window_nodelay(VALUE obj, VALUE val)
+{
+  struct windata *winp;
+  GetWINDOW(obj,winp);
+  
+  return nodelay(winp->window,RTEST(val) ? TRUE : FALSE) == OK ?
+    Qtrue : Qfalse;
+}
+#endif
+
+#ifdef HAVE_WTIMEOUT
+static VALUE
+window_timeout(VALUE obj, VALUE delay)
+{
+  struct windata *winp;
+  GetWINDOW(obj,winp);
+
+  wtimeout(winp->window,NUM2INT(delay));
+  return Qnil;
+}
+#endif
+
 /*------------------------- Initialization -------------------------*/
 void
 Init_curses()
@@ -1332,6 +1381,15 @@
     rb_define_module_function(mCurses, "mouseinterval", curses_mouseinterval, 1);
     rb_define_module_function(mCurses, "mousemask", curses_mousemask, 1);
 #endif /* USE_MOUSE */
+#ifdef HAVE_TIMEOUT
+    rb_define_module_function(mCurses, "timeout=", curses_timeout, 1);
+#endif 
+#ifdef HAVE_DEF_PROG_MODE
+    rb_define_module_function(mCurses, "def_prog_mode", curses_def_prog_mode, 0);
+#endif
+#ifdef HAVE_RESET_PROG_MODE
+    rb_define_module_function(mCurses, "reset_prog_mode", curses_reset_prog_mode, 0);
+#endif
 
     cWindow = rb_define_class_under(mCurses, "Window", rb_cData);
     rb_define_alloc_func(cWindow, window_s_allocate);
@@ -1379,6 +1437,12 @@
     rb_define_method(cWindow, "bkgd", window_bkgd, 1);
     rb_define_method(cWindow, "getbkgd", window_getbkgd, 0);
 #endif /* USE_COLOR */
+#ifdef HAVE_NODELAY
+    rb_define_method(cWindow, "nodelay=", window_nodelay, 1);
+#endif 
+#ifdef HAVE_WTIMEOUT
+    rb_define_method(cWindow, "timeout=", window_timeout, 1);
+#endif
 
 
 #define rb_curses_define_const(c) rb_define_const(mCurses,#c,UINT2NUM(c))
Index: extconf.rb
===================================================================
RCS file: /src/ruby/ext/curses/extconf.rb,v
retrieving revision 1.15
diff -u -r1.15 extconf.rb
--- extconf.rb	18 Aug 2003 16:24:42 -0000	1.15
+++ extconf.rb	18 Nov 2003 23:43:15 -0000
@@ -19,7 +19,7 @@
 end
 
 if make
-  for f in %w(isendwin ungetch beep getnstr wgetnstr doupdate flash deleteln wdeleteln keypad keyname init_color wresize resizeterm)
+  for f in %w(isendwin ungetch beep getnstr wgetnstr doupdate flash deleteln wdeleteln keypad keyname init_color wresize resizeterm nodelay timeout wtimeout def_prog_mode reset_prog_mode)
     have_func(f)
   end
   flag = "-D_XOPEN_SOURCE_EXTENDED"

In This Thread

Prev Next