diff options
author | Yukihiro Matsumoto <matz@ruby-lang.org> | 1996-12-25 00:33:19 +0900 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2019-08-17 22:09:32 +0900 |
commit | ce930d042913722f209bbd3209b6c90a3c71325f (patch) | |
tree | 7233482f90335a8247ef426607622a8cad067a97 | |
parent | 554b989ba1623b9f6a0b76f00824c83a23fbcbc1 (diff) | |
download | ruby-ce930d042913722f209bbd3209b6c90a3c71325f.tar.gz |
version 1.0-961225v1_0_961225
https://cache.ruby-lang.org/pub/ruby/1.0/ruby-1.0-961225.tar.gz
Wed Dec 25 00:33:19 1996 Yukihiro Matsumoto <matz@caelum.co.jp>
* version 1.0-961225
* io.c (Init_IO): newを無効化
* lib/tkthcore.rb: tk_call "global $foo; set foo 5"などもできるように
* eval.c (thread_restore_context): $~, $_でスタックを壊していた
* process.c (rb_waitpid): threadに一応対応
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | ToDo | 2 | ||||
-rw-r--r-- | array.c | 2 | ||||
-rw-r--r-- | bignum.c | 2 | ||||
-rw-r--r-- | class.c | 2 | ||||
-rw-r--r-- | compar.c | 2 | ||||
-rw-r--r-- | defines.h | 2 | ||||
-rw-r--r-- | dir.c | 2 | ||||
-rw-r--r-- | dln.c | 2 | ||||
-rw-r--r-- | dln.h | 2 | ||||
-rw-r--r-- | enum.c | 2 | ||||
-rw-r--r-- | env.h | 2 | ||||
-rw-r--r-- | error.c | 2 | ||||
-rw-r--r-- | eval.c | 8 | ||||
-rw-r--r-- | ext/kconv/kconv.c | 222 | ||||
-rw-r--r-- | file.c | 2 | ||||
-rw-r--r-- | gc.c | 2 | ||||
-rw-r--r-- | hash.c | 2 | ||||
-rw-r--r-- | inits.c | 2 | ||||
-rw-r--r-- | io.c | 9 | ||||
-rw-r--r-- | io.h | 6 | ||||
-rw-r--r-- | lib/tk.rb | 18 | ||||
-rw-r--r-- | lib/tkcore.rb | 5 | ||||
-rw-r--r-- | lib/tkthcore.rb | 5 | ||||
-rw-r--r-- | main.c | 2 | ||||
-rw-r--r-- | math.c | 2 | ||||
-rw-r--r-- | node.h | 2 | ||||
-rw-r--r-- | numeric.c | 2 | ||||
-rw-r--r-- | object.c | 2 | ||||
-rw-r--r-- | pack.c | 2 | ||||
-rw-r--r-- | parse.y | 7 | ||||
-rw-r--r-- | process.c | 57 | ||||
-rw-r--r-- | random.c | 2 | ||||
-rw-r--r-- | range.c | 2 | ||||
-rw-r--r-- | re.c | 2 | ||||
-rw-r--r-- | re.h | 2 | ||||
-rw-r--r-- | ruby.c | 2 | ||||
-rw-r--r-- | ruby.h | 2 | ||||
-rw-r--r-- | sample/tktimer.rb | 1 | ||||
-rw-r--r-- | signal.c | 2 | ||||
-rw-r--r-- | sprintf.c | 2 | ||||
-rw-r--r-- | string.c | 2 | ||||
-rw-r--r-- | struct.c | 2 | ||||
-rw-r--r-- | time.c | 2 | ||||
-rw-r--r-- | variable.c | 2 | ||||
-rw-r--r-- | version.c | 2 | ||||
-rw-r--r-- | version.h | 4 |
47 files changed, 235 insertions, 189 deletions
@@ -1,3 +1,15 @@ +Wed Dec 25 00:33:19 1996 Yukihiro Matsumoto <matz@caelum.co.jp> + + * version 1.0-961225 + + * io.c (Init_IO): new̵ + + * lib/tkthcore.rb: tk_call "global $foo; set foo 5"ʤɤǤ褦 + + * eval.c (thread_restore_context): $~, $_ǥåƤ + + * process.c (rb_waitpid): thread˰б + Tue Dec 24 15:20:58 1996 Yukihiro Matsumoto <matz@caelum.co.jp> * version 0.99.4-961224 @@ -1,7 +1,5 @@ -* """..."""%Q#...#ΤɤĤ뤤ξ褫 * ѥåޤѿΥ * formatǽ -* here document * perlΤ褦setuid check * write debugger for ruby * re-write regex code for speed and copyright @@ -3,7 +3,7 @@ array.c - $Author: matz $ - $Date: 1995/01/10 10:42:18 $ + $Date: 1996/12/25 10:42:18 $ created at: Fri Aug 6 09:46:12 JST 1993 Copyright (C) 1993-1996 Yukihiro Matsumoto @@ -3,7 +3,7 @@ bignum.c - $Author: matz $ - $Date: 1995/01/10 10:42:19 $ + $Date: 1996/12/25 10:42:19 $ created at: Fri Jun 10 00:48:55 JST 1994 ************************************************/ @@ -3,7 +3,7 @@ class.c - $Author: matz $ - $Date: 1995/01/12 08:54:44 $ + $Date: 1996/12/25 08:54:44 $ created at: Tue Aug 10 15:05:44 JST 1993 Copyright (C) 1993-1995 Yukihiro Matsumoto @@ -3,7 +3,7 @@ compar.c - $Author: matz $ - $Date: 1994/10/14 06:19:05 $ + $Date: 1996/12/25 09:19:05 $ created at: Thu Aug 26 14:39:48 JST 1993 Copyright (C) 1993-1996 Yukihiro Matsumoto @@ -3,7 +3,7 @@ defines.h - $Author: matz $ - $Date: 1995/01/10 10:42:25 $ + $Date: 1996/12/25 10:42:25 $ created at: Wed May 18 00:21:44 JST 1994 ************************************************/ @@ -3,7 +3,7 @@ dir.c - $Author: matz $ - $Date: 1995/01/10 10:42:28 $ + $Date: 1996/12/25 10:42:28 $ created at: Wed Jan 5 09:51:01 JST 1994 Copyright (C) 1993-1996 Yukihiro Matsumoto @@ -3,7 +3,7 @@ dln.c - $Author: matz $ - $Date: 1994/12/09 01:28:23 $ + $Date: 1996/12/25 01:28:23 $ created at: Tue Jan 18 17:05:06 JST 1994 Copyright (C) 1993-1996 Yukihiro Matsumoto @@ -4,7 +4,7 @@ $Author: matz $ $Revision: 1.2 $ - $Date: 1994/08/12 04:47:17 $ + $Date: 1996/12/25 04:47:17 $ created at: Wed Jan 19 16:53:09 JST 1994 ************************************************/ @@ -3,7 +3,7 @@ enum.c - $Author: matz $ - $Date: 1995/01/10 10:42:29 $ + $Date: 1996/12/25 10:42:29 $ created at: Fri Oct 1 15:15:19 JST 1993 Copyright (C) 1993-1996 Yukihiro Matsumoto @@ -4,7 +4,7 @@ $Author: matz $ $Revision: 1.8 $ - $Date: 1995/01/10 10:42:30 $ + $Date: 1996/12/25 10:42:30 $ created at: Mon Jul 11 11:53:03 JST 1994 ************************************************/ @@ -3,7 +3,7 @@ error.c - $Author: matz $ - $Date: 1995/01/10 10:42:31 $ + $Date: 1996/12/25 10:42:31 $ created at: Mon Aug 9 16:11:34 JST 1993 Copyright (C) 1993-1996 Yukihiro Matsumoto @@ -3,7 +3,7 @@ eval.c - $Author: matz $ - $Date: 1995/01/12 08:54:45 $ + $Date: 1996/12/25 08:54:45 $ created at: Thu Jun 10 14:22:17 JST 1993 Copyright (C) 1993-1995 Yukihiro Matsumoto @@ -3858,9 +3858,6 @@ thread_restore_context(th, exit) errinfo = th->errinfo; last_status = th->last_status; - lastline_set(th->last_line); - backref_set(th->last_match); - sourcefile = th->file; sourceline = th->line; @@ -3869,6 +3866,9 @@ thread_restore_context(th, exit) FLUSH_REGISTER_WINDOWS; MEMCPY(tmp->stk_pos, tmp->stk_ptr, VALUE, tmp->stk_len); + lastline_set(tmp->last_line); + backref_set(tmp->last_match); + switch (ex) { case 1: JUMP_TAG2(TAG_FATAL, INT2FIX(0)); diff --git a/ext/kconv/kconv.c b/ext/kconv/kconv.c index fd6c3bed0a..791b34b26b 100644 --- a/ext/kconv/kconv.c +++ b/ext/kconv/kconv.c @@ -33,6 +33,8 @@ static char *Version = static char *Patchlevel = "5/9612/Shinji Kono, COW matz"; +#include "ruby.h" + /* ** ** @@ -128,8 +130,10 @@ static char *Patchlevel = #include <windows.h> #endif +#ifndef FALSE #define FALSE 0 #define TRUE 1 +#endif /* state of output_mode and input_mode */ @@ -242,8 +246,104 @@ static int output_mode = ASCII, /* output kanji mode */ static int mime_mode = FALSE; /* MIME mode B base64, Q hex */ /* X0208 -> ASCII translation table */ +/* X0201 / X0208 conversion tables */ + +/* X0201 kana conversion table */ +/* 90-9F A0-DF */ +static unsigned char cv[]= { +0x21,0x21,0x21,0x23,0x21,0x56,0x21,0x57, +0x21,0x22,0x21,0x26,0x25,0x72,0x25,0x21, +0x25,0x23,0x25,0x25,0x25,0x27,0x25,0x29, +0x25,0x63,0x25,0x65,0x25,0x67,0x25,0x43, +0x21,0x3c,0x25,0x22,0x25,0x24,0x25,0x26, +0x25,0x28,0x25,0x2a,0x25,0x2b,0x25,0x2d, +0x25,0x2f,0x25,0x31,0x25,0x33,0x25,0x35, +0x25,0x37,0x25,0x39,0x25,0x3b,0x25,0x3d, +0x25,0x3f,0x25,0x41,0x25,0x44,0x25,0x46, +0x25,0x48,0x25,0x4a,0x25,0x4b,0x25,0x4c, +0x25,0x4d,0x25,0x4e,0x25,0x4f,0x25,0x52, +0x25,0x55,0x25,0x58,0x25,0x5b,0x25,0x5e, +0x25,0x5f,0x25,0x60,0x25,0x61,0x25,0x62, +0x25,0x64,0x25,0x66,0x25,0x68,0x25,0x69, +0x25,0x6a,0x25,0x6b,0x25,0x6c,0x25,0x6d, +0x25,0x6f,0x25,0x73,0x21,0x2b,0x21,0x2c, +0x00,0x00}; + -static unsigned char cv[],dv[],ev[],fv[]; +/* X0201 kana conversion table for daguten */ +/* 90-9F A0-DF */ +static unsigned char dv[]= { +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x25,0x2c,0x25,0x2e, +0x25,0x30,0x25,0x32,0x25,0x34,0x25,0x36, +0x25,0x38,0x25,0x3a,0x25,0x3c,0x25,0x3e, +0x25,0x40,0x25,0x42,0x25,0x45,0x25,0x47, +0x25,0x49,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x25,0x50,0x25,0x53, +0x25,0x56,0x25,0x59,0x25,0x5c,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00}; + +/* X0201 kana conversion table for han-daguten */ +/* 90-9F A0-DF */ +static unsigned char ev[]= { +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x25,0x51,0x25,0x54, +0x25,0x57,0x25,0x5a,0x25,0x5d,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00}; + + +/* X0208 kigou conversion table */ +/* 0x8140 - 0x819e */ +static unsigned char fv[] = { +0x00,0x00,0x00,0x00,0x2c,0x2e,0x00,0x3a, +0x3b,0x3f,0x21,0x00,0x00,0x27,0x60,0x00, +0x5e,0x00,0x5f,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x2d,0x00,0x2f, +0x5c,0x00,0x00,0x7c,0x00,0x00,0x60,0x27, +0x22,0x22,0x28,0x29,0x00,0x00,0x5b,0x5d, +0x7b,0x7d,0x3c,0x3e,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x2b,0x2d,0x00,0x00, +0x00,0x3d,0x00,0x3c,0x3e,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x24,0x00,0x00,0x25,0x23,0x26,0x2a,0x40, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +} ; + + +/* This converts =?ISO-2022-JP?B?HOGE HOGE?= */ + +static unsigned char *mime_pattern[] = { + (unsigned char *)"\075?ISO-8859-1?Q?", + (unsigned char *)"\075?ISO-2022-JP?B?", + (unsigned char *)"\075?ISO-2022-JP?Q?", + NULL +}; + +static int mime_encode[] = { + 'Q', 'B', 'Q', + 0 +}; #ifdef notdef static int file_out = FALSE; @@ -1002,7 +1102,7 @@ h_conv (c2, c1) -int +static int push_hold_buf (c2, c1) int c2, c1; @@ -1274,7 +1374,7 @@ j_oconv (c2, c1) This is the main difference from fmt. */ -int +static int fold(c2,c1) register int c2,c1; { @@ -1397,7 +1497,7 @@ register int c2,c1; } } -int +static int pre_convert(c1,c2) register int c1,c2; { @@ -1438,112 +1538,12 @@ register int c1,c2; } -/* X0201 / X0208 conversion tables */ - -/* X0201 kana conversion table */ -/* 90-9F A0-DF */ -unsigned char cv[]= { -0x21,0x21,0x21,0x23,0x21,0x56,0x21,0x57, -0x21,0x22,0x21,0x26,0x25,0x72,0x25,0x21, -0x25,0x23,0x25,0x25,0x25,0x27,0x25,0x29, -0x25,0x63,0x25,0x65,0x25,0x67,0x25,0x43, -0x21,0x3c,0x25,0x22,0x25,0x24,0x25,0x26, -0x25,0x28,0x25,0x2a,0x25,0x2b,0x25,0x2d, -0x25,0x2f,0x25,0x31,0x25,0x33,0x25,0x35, -0x25,0x37,0x25,0x39,0x25,0x3b,0x25,0x3d, -0x25,0x3f,0x25,0x41,0x25,0x44,0x25,0x46, -0x25,0x48,0x25,0x4a,0x25,0x4b,0x25,0x4c, -0x25,0x4d,0x25,0x4e,0x25,0x4f,0x25,0x52, -0x25,0x55,0x25,0x58,0x25,0x5b,0x25,0x5e, -0x25,0x5f,0x25,0x60,0x25,0x61,0x25,0x62, -0x25,0x64,0x25,0x66,0x25,0x68,0x25,0x69, -0x25,0x6a,0x25,0x6b,0x25,0x6c,0x25,0x6d, -0x25,0x6f,0x25,0x73,0x21,0x2b,0x21,0x2c, -0x00,0x00}; - - -/* X0201 kana conversion table for daguten */ -/* 90-9F A0-DF */ -unsigned char dv[]= { -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x25,0x2c,0x25,0x2e, -0x25,0x30,0x25,0x32,0x25,0x34,0x25,0x36, -0x25,0x38,0x25,0x3a,0x25,0x3c,0x25,0x3e, -0x25,0x40,0x25,0x42,0x25,0x45,0x25,0x47, -0x25,0x49,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x25,0x50,0x25,0x53, -0x25,0x56,0x25,0x59,0x25,0x5c,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00}; - -/* X0201 kana conversion table for han-daguten */ -/* 90-9F A0-DF */ -unsigned char ev[]= { -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x25,0x51,0x25,0x54, -0x25,0x57,0x25,0x5a,0x25,0x5d,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00}; - - -/* X0208 kigou conversion table */ -/* 0x8140 - 0x819e */ -unsigned char fv[] = { - -0x00,0x00,0x00,0x00,0x2c,0x2e,0x00,0x3a, -0x3b,0x3f,0x21,0x00,0x00,0x27,0x60,0x00, -0x5e,0x00,0x5f,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x2d,0x00,0x2f, -0x5c,0x00,0x00,0x7c,0x00,0x00,0x60,0x27, -0x22,0x22,0x28,0x29,0x00,0x00,0x5b,0x5d, -0x7b,0x7d,0x3c,0x3e,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x2b,0x2d,0x00,0x00, -0x00,0x3d,0x00,0x3c,0x3e,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x24,0x00,0x00,0x25,0x23,0x26,0x2a,0x40, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -} ; - - -/* This converts =?ISO-2022-JP?B?HOGE HOGE?= */ - -unsigned char *mime_pattern[] = { - (unsigned char *)"\075?ISO-8859-1?Q?", - (unsigned char *)"\075?ISO-2022-JP?B?", - (unsigned char *)"\075?ISO-2022-JP?Q?", - NULL -}; - -int mime_encode[] = { - 'Q', 'B', 'Q', - 0 -}; - -int iso8859_f_save; +static int iso8859_f_save; #define nkf_toupper(c) (('a'<=c && c<='z')?(c-('a'-'A')):c) /* I don't trust portablity of toupper */ -int +static int mime_begin() { int c1; @@ -1594,7 +1594,7 @@ mime_begin() #define mime_getc0() (mimebuf_f?_GETC():Fifo(mime_input++)) #define mime_ungetc0(c) (mimebuf_f?_UNGETC(c):mime_input--) -int +static int mime_getc() { int c1, c2, c3, c4, cc; @@ -1705,7 +1705,7 @@ mime_getc() return Fifo(mime_top++); } -int +static int mime_ungetc(c) unsigned int c; { @@ -1714,7 +1714,7 @@ unsigned int c; } -int +static int mime_integrity(p) unsigned char *p; { @@ -1749,7 +1749,7 @@ unsigned char *p; return 1; } -int +static int base64decode(c) int c; { @@ -1820,8 +1820,6 @@ usage() } #endif /* notdef */ -#include "ruby.h" - static VALUE kconv_kconv(argc, argv) int argc; @@ -3,7 +3,7 @@ file.c - $Author: matz $ - $Date: 1995/01/10 10:42:36 $ + $Date: 1996/12/25 10:42:36 $ created at: Mon Nov 15 12:24:34 JST 1993 Copyright (C) 1993-1996 Yukihiro Matsumoto @@ -3,7 +3,7 @@ gc.c - $Author: matz $ - $Date: 1995/01/12 08:54:47 $ + $Date: 1996/12/25 09:54:47 $ created at: Tue Oct 5 09:44:46 JST 1993 Copyright (C) 1993-1996 Yukihiro Matsumoto @@ -3,7 +3,7 @@ hash.c - $Author: matz $ - $Date: 1995/01/10 10:42:26 $ + $Date: 1996/12/25 10:42:26 $ created at: Mon Nov 22 18:51:18 JST 1993 Copyright (C) 1993-1996 Yukihiro Matsumoto @@ -3,7 +3,7 @@ inits.c - $Author: matz $ - $Date: 1995/01/10 10:42:38 $ + $Date: 1996/12/25 10:42:38 $ created at: Tue Dec 28 16:01:58 JST 1993 Copyright (C) 1993-1996 Yukihiro Matsumoto @@ -3,7 +3,7 @@ io.c - $Author: matz $ - $Date: 1995/01/10 10:42:39 $ + $Date: 1996/12/25 10:42:39 $ created at: Fri Oct 15 18:08:59 JST 1993 Copyright (C) 1993-1996 Yukihiro Matsumoto @@ -116,6 +116,11 @@ closed() Raise(eIOError, "closed stream"); } +void +io_wrong_type() +{ +} + /* writing functions */ VALUE io_write(io, str) @@ -1738,6 +1743,8 @@ Init_IO() cIO = rb_define_class("IO", cObject); rb_include_module(cIO, mEnumerable); + rb_undef_method(CLASS_OF(cIO), "new"); + rb_define_singleton_method(cIO, "popen", io_popen, -1); rb_define_singleton_method(cIO, "foreach", io_foreach, 1); rb_define_singleton_method(cIO, "select", f_select, -1); @@ -4,7 +4,7 @@ $Author: matz $ $Revision: 1.3 $ - $Date: 1994/08/12 11:06:42 $ + $Date: 1996/12/25 11:06:42 $ created at: Fri Nov 12 16:47:09 JST 1993 Copyright (C) 1993-1996 Yukihiro Matsumoto @@ -33,7 +33,9 @@ typedef struct OpenFile { #define FMODE_READWRITE 3 #define FMODE_SYNC 4 -#define GetOpenFile(obj,fp) fp = RFILE(obj)->fptr +void io_wrong_type(); + +#define GetOpenFile(obj,fp) ((fp) = RFILE(obj)->fptr) #define MakeOpenFile(obj, fp) do {\ fp = RFILE(obj)->fptr = ALLOC(OpenFile);\ @@ -486,12 +486,12 @@ class TkLabel<TkWindow tk_call 'label', @path end def textvariable(v) - v = v.id2name unless v.kind_of "String" + v = v.id2name unless v.kind_of? String vn = @path + v - vset = format("global {%s}; set {%s}", vn, vn) - tk_call vset, eval(v).inspect + vset = format("global {%s}; set {%s} %%s", vn, vn) + tk_write vset, eval(v).inspect trace_var v, proc{|val| - tk_call vset, val.inspect + tk_write vset, val.inspect } configure 'textvariable', vn end @@ -520,7 +520,7 @@ class TkRadioButton<TkButton tk_send 'select' end def variable(v) - v = v.id2name unless v.kind_of "String" + v = v.id2name unless v.kind_of? String if v =~ /^\$/ v = $' else @@ -528,13 +528,13 @@ class TkRadioButton<TkButton end vn = 'btns_selected_' + v trace_var v, proc{|val| - tk_call 'set', vn, val + tk_write 'global %s; set %s %s', vn, val } @var_id = install_cmd(proc{|name1,| - val = tk_call('set', name1) + val = tk_call(format('global %s; set', name1), name1) eval(format("%s = '%s'", v.id2name, val)) }) - tk_call 'trace variable', vn, 'w', @var_id + tk_call 'trace', 'variable', vn, 'w', @var_id configure 'variable', vn end def destroy @@ -732,7 +732,7 @@ module TkComposite def delegate(option, *wins) @delegates = {} if not @delegates @delegates['DEFAULT'] = @frame - if option.kind_of? String + if option.kind_of?(String) @delegates[option] = wins else for i in option diff --git a/lib/tkcore.rb b/lib/tkcore.rb index df4af669ba..018e140ef0 100644 --- a/lib/tkcore.rb +++ b/lib/tkcore.rb @@ -185,7 +185,7 @@ after 120000 keepalive' end $tk_event_queue = [] - def tk_call(*args) + def tk_call(str, *args) args = args.collect{|s| next if s == None if s.kind_of?(Hash) @@ -204,7 +204,8 @@ after 120000 keepalive' "{#{s}}" end } - str = args.join(" ") + str += " " + str += args.join(" ") print str, "\n" if $DEBUG tk_write 'rb_ans %s', str while PORT.gets diff --git a/lib/tkthcore.rb b/lib/tkthcore.rb index adbad775d0..5e0abd72c5 100644 --- a/lib/tkthcore.rb +++ b/lib/tkthcore.rb @@ -109,7 +109,7 @@ module Tk val end - def tk_call(*args) + def tk_call(str, *args) Tk.init if $tk_not_init args = args.collect{|s| next if s == None @@ -129,7 +129,8 @@ module Tk "{#{s}}" end } - str = args.join(" ") + str += " " + str += args.join(" ") Qin.push str return Qout.pop end @@ -3,7 +3,7 @@ main.c - $Author: matz $ - $Date: 1994/08/19 09:32:03 $ + $Date: 1996/12/25 09:32:03 $ created at: Fri Aug 19 13:19:58 JST 1994 ************************************************/ @@ -3,7 +3,7 @@ math.c - $Author: matz $ - $Date: 1994/11/01 08:28:03 $ + $Date: 1996/12/25 09:28:03 $ created at: Tue Jan 25 14:12:56 JST 1994 Copyright (C) 1993-1996 Yukihiro Matsumoto @@ -3,7 +3,7 @@ node.h - $Author: matz $ - $Date: 1995/01/10 10:42:41 $ + $Date: 1996/12/25 10:42:41 $ created at: Fri May 28 15:14:02 JST 1993 Copyright (C) 1993-1996 Yukihiro Matsumoto @@ -3,7 +3,7 @@ numeric.c - $Author: matz $ - $Date: 1995/01/10 10:42:42 $ + $Date: 1996/12/25 10:42:42 $ created at: Fri Aug 13 18:33:09 JST 1993 Copyright (C) 1993-1996 Yukihiro Matsumoto @@ -3,7 +3,7 @@ object.c - $Author: matz $ - $Date: 1995/01/12 08:54:49 $ + $Date: 1996/12/25 08:54:49 $ created at: Thu Jul 15 12:01:24 JST 1993 Copyright (C) 1993-1996 Yukihiro Matsumoto @@ -3,7 +3,7 @@ pack.c - $Author: matz $ - $Date: 1994/12/09 09:40:22 $ + $Date: 1996/12/25 09:40:22 $ created at: Thu Feb 10 15:17:05 JST 1994 Copyright (C) 1993-1996 Yukihiro Matsumoto @@ -3,7 +3,7 @@ parse.y - $Author: matz $ - $Date: 1995/01/12 08:54:50 $ + $Date: 1996/12/25 08:54:50 $ created at: Fri May 28 18:02:42 JST 1993 Copyright (C) 1993-1996 Yukihiro Matsumoto @@ -3093,7 +3093,10 @@ top_local_init() else { lvtbl->tbl = 0; } - lvtbl->dlev = (the_dyna_vars?1:0); + if (the_dyna_vars && the_dyna_vars->id) + lvtbl->dlev = 1; + else + lvtbl->dlev = 0; } static void @@ -3,7 +3,7 @@ process.c - $Author: matz $ - $Date: 1995/01/10 10:42:47 $ + $Date: 1996/12/25 10:42:47 $ created at: Tue Aug 10 14:30:50 JST 1993 Copyright (C) 1993-1996 Yukihiro Matsumoto @@ -76,7 +76,12 @@ rb_waitpid(pid, flags, st) retry: result = waitpid(pid, st, flags); if (result < 0) { - if (errno == EINTR) goto retry; + if (errno == EINTR) { +#ifdef THREAD + thread_schedule(); +#endif + goto retry; + } return -1; } #else @@ -84,7 +89,12 @@ rb_waitpid(pid, flags, st) retry: result = wait4(pid, st, flags, NULL); if (result < 0) { - if (errno == EINTR) goto retry; + if (errno == EINTR) { +#ifdef THREAD + thread_schedule(); +#endif + goto retry; + } return -1; } #else @@ -94,13 +104,19 @@ rb_waitpid(pid, flags, st) return pid; } - if (flags) - Fatal("Can't do waitpid with flags"); + if (flags) { + ArgError("Can't do waitpid with flags"); + } for (;;) { result = wait(st); if (result < 0) { - if (errno != EINTR) continue; + if (errno == EINTR) { +#ifdef THREAD + thread_schedule(); +#endif + continue; + } return -1; } if (result == pid) { @@ -122,7 +138,8 @@ struct wait_data { int status; } -static wait_each(key, value, data) +static int +wait_each(key, value, data) int key, value; struct wait_data *data; { @@ -149,7 +166,13 @@ f_wait() } #endif - if ((pid = wait(&state)) < 0) { + while ((pid = wait(&state)) < 0) { + if (errno == EINTR) { +#ifdef THREAD + thread_schedule(); +#endif + continue; + } if (errno == ECHILD) return Qnil; rb_sys_fail(0); } @@ -252,13 +275,13 @@ rb_proc_exec(str) for (s=str; *s; s++) { if (*s != ' ' && !isalpha(*s) && strchr("*?{}[]<>()~&|\\$;'`\"\n",*s)) { - before_exec(); #if defined(MSDOS) system(str); #else + before_exec(); execl("/bin/sh", "sh", "-c", str, (char *)NULL); -#endif after_exec(); +#endif return -1; } } @@ -529,7 +552,7 @@ proc_setpgid(obj, pid, pgrp) ipid = NUM2INT(pid); ipgrp = NUM2INT(pgrp); - if (setpgid(ipid, ipgrp) == -1) rb_sys_fail(0); + if (setpgid(ipid, ipgrp) < 0) rb_sys_fail(0); return Qnil; } #endif @@ -545,7 +568,7 @@ proc_getpriority(obj, which, who) iwho = NUM2INT(who); prio = getpriority(iwhich, iwho); - if (prio == -1) rb_sys_fail(0); + if (prio < 0) rb_sys_fail(0); return INT2FIX(prio); #else rb_notimplement(); @@ -563,7 +586,7 @@ proc_setpriority(obj, which, who, prio) iwho = NUM2INT(who); iprio = NUM2INT(prio); - if (setpriority(iwhich, iwho, iprio) == -1) + if (setpriority(iwhich, iwho, iprio) < 0) rb_sys_fail(0); return INT2FIX(0); #else @@ -649,10 +672,10 @@ proc_seteuid(obj, euid) VALUE obj, euid; { #ifdef HAVE_SETEUID - if (seteuid(NUM2INT(euid)) == -1) rb_sys_fail(0); + if (seteuid(NUM2INT(euid)) < 0) rb_sys_fail(0); #else #ifdef HAVE_SETREUID - if (setreuid(-1, NUM2INT(euid)) == -1) rb_sys_fail(0); + if (setreuid(-1, NUM2INT(euid)) < 0) rb_sys_fail(0); #else euid = NUM2INT(euid); if (euid == getuid()) @@ -677,10 +700,10 @@ proc_setegid(obj, egid) VALUE obj, egid; { #ifdef HAVE_SETEGID - if (setegid(NUM2INT(egid)) == -1) rb_sys_fail(0); + if (setegid(NUM2INT(egid)) < 0) rb_sys_fail(0); #else #ifdef HAVE_SETREGID - if (setregid(-1, NUM2INT(egid)) == -1) rb_sys_fail(0); + if (setregid(-1, NUM2INT(egid)) < 0) rb_sys_fail(0); #else egid = NUM2INT(egid); if (egid == getgid()) @@ -3,7 +3,7 @@ random.c - $Author: matz $ - $Date: 1995/01/10 10:42:48 $ + $Date: 1996/12/25 10:42:48 $ created at: Fri Dec 24 16:39:21 JST 1993 Copyright (C) 1993-1996 Yukihiro Matsumoto @@ -3,7 +3,7 @@ range.c - $Author: matz $ - $Date: 1994/12/06 09:30:12 $ + $Date: 1996/12/25 09:30:12 $ created at: Thu Aug 19 17:46:47 JST 1993 Copyright (C) 1993-1996 Yukihiro Matsumoto @@ -3,7 +3,7 @@ re.c - $Author: matz $ - $Date: 1995/01/10 10:42:49 $ + $Date: 1996/12/25 10:42:49 $ created at: Mon Aug 9 18:24:49 JST 1993 Copyright (C) 1993-1996 Yukihiro Matsumoto @@ -4,7 +4,7 @@ $Author: matz $ $Revision: 1.2 $ - $Date: 1994/08/12 04:47:52 $ + $Date: 1996/12/25 09:47:52 $ created at: Thu Sep 30 14:18:32 JST 1993 Copyright (C) 1993-1996 Yukihiro Matsumoto @@ -3,7 +3,7 @@ ruby.c - $Author: matz $ - $Date: 1995/01/10 10:42:51 $ + $Date: 1996/12/25 10:42:51 $ created at: Tue Aug 10 12:47:31 JST 1993 Copyright (C) 1993-1996 Yukihiro Matsumoto @@ -3,7 +3,7 @@ ruby.h - $Author: matz $ - $Date: 1995/01/12 08:54:52 $ + $Date: 1996/12/25 08:54:52 $ created at: Thu Jun 10 14:26:32 JST 1993 Copyright (C) 1993-1996 Yukihiro Matsumoto diff --git a/sample/tktimer.rb b/sample/tktimer.rb index b8b3617646..34377e2f39 100644 --- a/sample/tktimer.rb +++ b/sample/tktimer.rb @@ -22,6 +22,7 @@ TkButton.new { TkButton.new { text 'Stop' command proc{ + exit if $stopped $stopped = TRUE } pack('side'=>'right','fill'=>'both','expand'=>'yes') @@ -3,7 +3,7 @@ signal.c - $Author: matz $ - $Date: 1995/01/10 10:42:53 $ + $Date: 1996/12/25 10:42:53 $ created at: Tue Dec 20 10:13:44 JST 1994 ************************************************/ @@ -3,7 +3,7 @@ sprintf.c - $Author: matz $ - $Date: 1995/01/10 10:42:59 $ + $Date: 1996/12/25 10:42:59 $ created at: Fri Oct 15 10:39:26 JST 1993 Copyright (C) 1993-1996 Yukihiro Matsumoto @@ -3,7 +3,7 @@ string.c - $Author: matz $ - $Date: 1995/01/10 10:43:01 $ + $Date: 1996/12/25 10:43:01 $ created at: Mon Aug 9 17:12:58 JST 1993 Copyright (C) 1993-1996 Yukihiro Matsumoto @@ -3,7 +3,7 @@ struct.c - $Author: matz $ - $Date: 1995/01/10 10:43:02 $ + $Date: 1996/12/25 10:43:02 $ created at: Tue Mar 22 18:44:30 JST 1995 ************************************************/ @@ -3,7 +3,7 @@ time.c - $Author: matz $ - $Date: 1994/12/06 09:30:28 $ + $Date: 1996/12/25 09:30:28 $ created at: Tue Dec 28 14:31:59 JST 1993 Copyright (C) 1993-1996 Yukihiro Matsumoto diff --git a/variable.c b/variable.c index 1d6449bcab..668385f18a 100644 --- a/variable.c +++ b/variable.c @@ -3,7 +3,7 @@ variable.c - $Author: matz $ - $Date: 1995/01/12 08:54:53 $ + $Date: 1996/12/25 08:54:53 $ created at: Tue Apr 19 23:55:15 JST 1994 ************************************************/ @@ -4,7 +4,7 @@ $Author: matz $ $Revision: 1.5 $ - $Date: 1995/01/12 08:54:54 $ + $Date: 1996/12/25 08:54:54 $ created at: Thu Sep 30 20:08:01 JST 1993 Copyright (C) 1993-1996 Yukihiro Matsumoto @@ -1,2 +1,2 @@ -#define RUBY_VERSION "0.99.4-961224" -#define VERSION_DATE "96/12/24" +#define RUBY_VERSION "1.0-961225" +#define VERSION_DATE "96/12/25" |