git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2000-07-10 04:49:24 +00:00
parent 3043170b14
commit c67a74570d
22 changed files with 560 additions and 440 deletions

View File

@ -1,3 +1,28 @@
Mon Jul 10 09:07:54 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
* error.c (rb_bug): print version number and such too.
Sat Jul 8 23:08:40 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
* eval.c (rb_thread_start_0): should copy previous scopes to
prevent rb_gc_force_recylce().
Fri Jul 7 23:36:36 2000 Katsuyuki Komatsu <komatsu@sarion.co.jp>
* ext/socket/addrinfo.h: move IN_EXPERIMENTAL and IN_LOOPBACKNET
definitions to ext/socket/sockport.h.
* ext/socket/extconf.rb: add getservbyport() and arpa/inet.h check.
* ext/socket/getaddrinfo.c (getaddrinfo): SOCK_RAW may not be
defined (ex. BeOS, Palm OS 2.x or before).
* ext/socket/getnameinfo.c (getnameinfo): getservbyport() may not
exist (ex. BeOS, Palm OS).
* ext/socket/sockport.h: add IN_EXPERIMENTAL, IN_CLASSA_NSHIFT,
IN_LOOPBACKNET, AF_UNSPEC, PF_UNSPEC and PF_INET.
Fri Jul 7 03:30:00 2000 Yukihiro Matsumoto <matz@netlab.co.jp> Fri Jul 7 03:30:00 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
* parse.y (aref_args): should allow Hash[:a=>2] etc. * parse.y (aref_args): should allow Hash[:a=>2] etc.

View File

@ -150,6 +150,15 @@ interpreter. Useful functions are listed below (not all):
Creates a new Ruby string from C string. This is equivalent to Creates a new Ruby string from C string. This is equivalent to
rb_str_new(ptr, strlen(ptr)). rb_str_new(ptr, strlen(ptr)).
rb_tainted_str_new(char *ptr, int len)
Creates a new tainted Ruby string. Strings from external data
should be tainted.
rb_tainted_str_new2(char *ptr)
Creates a new tainted Ruby string from C string.
rb_str_cat(VALUE str, char *ptr, int len) rb_str_cat(VALUE str, char *ptr, int len)
Appends len bytes data from ptr to the Ruby string. Appends len bytes data from ptr to the Ruby string.
@ -266,6 +275,9 @@ in Kernel module, can be defined using:
void rb_define_global_function(char *name, VALUE (*func)(), int argc) void rb_define_global_function(char *name, VALUE (*func)(), int argc)
To define alias to the method,
void rb_define_alias(VALUE module, const char* new, const char* old);
2.1.3 Constant definition 2.1.3 Constant definition

View File

@ -180,6 +180,16 @@ Ruby
Cの文字列からRubyの文字列を生成するこの関数の機能は Cの文字列からRubyの文字列を生成するこの関数の機能は
rb_str_new(ptr, strlen(ptr))と同等である. rb_str_new(ptr, strlen(ptr))と同等である.
rb_tainted_str_new(char *ptr, int len)
汚染マークが付加された新しいRubyの文字列を生成する外部
からのデータに基づく文字列には汚染マークが付加されるべき
である.
rb_tainted_str_new2(char *ptr)
Cの文字列から汚染マークが付加されたRubyの文字列を生成する
rb_str_cat(VALUE str, char *ptr, int len) rb_str_cat(VALUE str, char *ptr, int len)
Rubyの文字列strにlenバイトの文字列ptrを追加する Rubyの文字列strにlenバイトの文字列ptrを追加する
@ -307,6 +317,10 @@ private
void rb_define_global_function(char *name, VALUE (*func)(), int argc) void rb_define_global_function(char *name, VALUE (*func)(), int argc)
メソッドの別名を定義するための関数は以下の通りです。
void rb_define_alias(VALUE module, const char* new, const char* old);
2.1.3 定数定義 2.1.3 定数定義
拡張ライブラリが必要な定数はあらかじめ定義しておいた方が良い 拡張ライブラリが必要な定数はあらかじめ定義しておいた方が良い

View File

@ -159,6 +159,7 @@ rb_bug(fmt, va_alist)
va_init_list(args, fmt); va_init_list(args, fmt);
err_print(buf, args); err_print(buf, args);
va_end(args); va_end(args);
ruby_show_version();
abort(); abort();
} }

10
eval.c
View File

@ -778,6 +778,9 @@ static VALUE ruby_wrapper; /* security wrapper */
ruby_scope = _scope; \ ruby_scope = _scope; \
scope_vmode = SCOPE_PUBLIC; scope_vmode = SCOPE_PUBLIC;
typedef struct thread * rb_thread_t;
static rb_thread_t curr_thread = 0;
#define SCOPE_DONT_RECYCLE FL_USER2 #define SCOPE_DONT_RECYCLE FL_USER2
#define POP_SCOPE() \ #define POP_SCOPE() \
if (FL_TEST(ruby_scope, SCOPE_DONT_RECYCLE)) {\ if (FL_TEST(ruby_scope, SCOPE_DONT_RECYCLE)) {\
@ -6315,7 +6318,7 @@ enum thread_status {
/* +infty, for this purpose */ /* +infty, for this purpose */
#define DELAY_INFTY 1E30 #define DELAY_INFTY 1E30
typedef struct thread * rb_thread_t; /* typedef struct thread * rb_thread_t; */
struct thread { struct thread {
struct thread *next, *prev; struct thread *next, *prev;
@ -6372,7 +6375,7 @@ struct thread {
#define THREAD_RAISED 0x200 #define THREAD_RAISED 0x200
static rb_thread_t main_thread; static rb_thread_t main_thread;
static rb_thread_t curr_thread = 0; /*static rb_thread_t curr_thread = 0;*/
#define FOREACH_THREAD_FROM(f,x) x = f; do { x = x->next; #define FOREACH_THREAD_FROM(f,x) x = f; do { x = x->next;
#define END_FOREACH_FROM(f,x) } while (x != f) #define END_FOREACH_FROM(f,x) } while (x != f)
@ -7513,6 +7516,9 @@ rb_thread_start_0(fn, arg, th)
} }
#endif #endif
if (ruby_block) { /* should nail down higher scopes */
blk_copy_prev(ruby_block);
}
scope_dup(ruby_scope); scope_dup(ruby_scope);
FL_SET(ruby_scope, SCOPE_SHARED); FL_SET(ruby_scope, SCOPE_SHARED);
if (THREAD_SAVE_CONTEXT(curr_thread)) { if (THREAD_SAVE_CONTEXT(curr_thread)) {

View File

@ -127,11 +127,6 @@
#define NI_NUMERICSERV 0x00000008 #define NI_NUMERICSERV 0x00000008
#define NI_DGRAM 0x00000010 #define NI_DGRAM 0x00000010
#ifdef NT
#define IN_EXPERIMENTAL(x) 0
#define IN_LOOPBACKNET 0
#endif
struct addrinfo { struct addrinfo {
int ai_flags; /* AI_PASSIVE, AI_CANONNAME */ int ai_flags; /* AI_PASSIVE, AI_CANONNAME */
int ai_family; /* PF_xxx */ int ai_family; /* PF_xxx */

View File

@ -306,6 +306,8 @@ else
$objs += ["getnameinfo.#{$OBJEXT}"] $objs += ["getnameinfo.#{$OBJEXT}"]
have_func("inet_ntop") or have_func("inet_ntoa") have_func("inet_ntop") or have_func("inet_ntoa")
have_func("inet_pton") or have_func("inet_aton") have_func("inet_pton") or have_func("inet_aton")
have_func("getservbyport")
have_header("arpa/inet.h")
have_header("arpa/nameser.h") have_header("arpa/nameser.h")
have_header("resolv.h") have_header("resolv.h")
end end

View File

@ -42,9 +42,15 @@
#include <sys/types.h> #include <sys/types.h>
#ifndef NT #ifndef NT
#include <sys/param.h> #include <sys/param.h>
#if defined(__BEOS__)
# include <net/socket.h>
#else
# include <sys/socket.h> # include <sys/socket.h>
#endif
#include <netinet/in.h> #include <netinet/in.h>
#if defined(HAVE_ARPA_INET_H)
#include <arpa/inet.h> #include <arpa/inet.h>
#endif
#if defined(HAVE_ARPA_NAMESER_H) #if defined(HAVE_ARPA_NAMESER_H)
#include <arpa/nameser.h> #include <arpa/nameser.h>
#endif #endif
@ -330,12 +336,16 @@ getaddrinfo(hostname, servname, hints, res)
pai->ai_socktype = SOCK_STREAM; pai->ai_socktype = SOCK_STREAM;
break; break;
default: default:
#if defined(SOCK_RAW)
pai->ai_socktype = SOCK_RAW; pai->ai_socktype = SOCK_RAW;
#endif
break; break;
} }
break; break;
#if defined(SOCK_RAW)
case SOCK_RAW: case SOCK_RAW:
break; break;
#endif
case SOCK_DGRAM: case SOCK_DGRAM:
if (pai->ai_protocol != IPPROTO_UDP && if (pai->ai_protocol != IPPROTO_UDP &&
pai->ai_protocol != ANY) pai->ai_protocol != ANY)

View File

@ -37,9 +37,15 @@
#include "config.h" #include "config.h"
#include <sys/types.h> #include <sys/types.h>
#ifndef NT #ifndef NT
#if defined(__BEOS__)
# include <net/socket.h>
#else
# include <sys/socket.h> # include <sys/socket.h>
#endif
#include <netinet/in.h> #include <netinet/in.h>
#if defined(HAVE_ARPA_INET_H)
#include <arpa/inet.h> #include <arpa/inet.h>
#endif
#if defined(HAVE_ARPA_NAMESER_H) #if defined(HAVE_ARPA_NAMESER_H)
#include <arpa/nameser.h> #include <arpa/nameser.h>
#endif #endif
@ -178,6 +184,7 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
return ENI_MEMORY; return ENI_MEMORY;
strcpy(serv, numserv); strcpy(serv, numserv);
} else { } else {
#if defined(HAVE_GETSERVBYPORT)
sp = getservbyport(port, (flags & NI_DGRAM) ? "udp" : "tcp"); sp = getservbyport(port, (flags & NI_DGRAM) ? "udp" : "tcp");
if (sp) { if (sp) {
if (strlen(sp->s_name) > servlen) if (strlen(sp->s_name) > servlen)
@ -185,6 +192,9 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
strcpy(serv, sp->s_name); strcpy(serv, sp->s_name);
} else } else
return ENI_NOSERVNAME; return ENI_NOSERVNAME;
#else
return ENI_NOSERVNAME;
#endif
} }
switch (sa->sa_family) { switch (sa->sa_family) {

View File

@ -21,7 +21,11 @@
#endif #endif
#ifndef NT #ifndef NT
#if defined(__BEOS__)
# include <net/socket.h>
#else
# include <sys/socket.h> # include <sys/socket.h>
#endif
#include <netinet/in.h> #include <netinet/in.h>
#ifdef HAVE_NETINET_TCP_H #ifdef HAVE_NETINET_TCP_H
# include <netinet/tcp.h> # include <netinet/tcp.h>

View File

@ -45,4 +45,28 @@
# define IN_MULTICAST(i) IN_CLASSD(i) # define IN_MULTICAST(i) IN_CLASSD(i)
#endif #endif
#ifndef IN_EXPERIMENTAL
# define IN_EXPERIMENTAL(i) ((((long)(i)) & 0xe0000000) == 0xe0000000)
#endif
#ifndef IN_CLASSA_NSHIFT
# define IN_CLASSA_NSHIFT 24
#endif
#ifndef IN_LOOPBACKNET
# define IN_LOOPBACKNET 127
#endif
#ifndef AF_UNSPEC
# define AF_UNSPEC 0
#endif
#ifndef PF_UNSPEC
# define PF_UNSPEC AF_UNSPEC
#endif
#ifndef PF_INET
# define PF_INET AF_INET
#endif
#endif #endif

View File

@ -1,8 +1,8 @@
# #
# Date.rb - # Date.rb -
# $Release Version: $ # $Release Version: $
# $Revision: 1.1.1.2 $ # $Revision: 1.2 $
# $Date: 1999/01/20 04:59:35 $ # $Date: 2000/07/06 07:21:23 $
# by Yasuo OHBA(SHL Japan Inc. Technology Dept.) # by Yasuo OHBA(SHL Japan Inc. Technology Dept.)
# #
# -- # --
@ -168,12 +168,10 @@ class Date
m = Date.daylist(@year) m = Date.daylist(@year)
if @month < 1 || @month > 12 if @month < 1 || @month > 12
raise ArgumentError, "argument(month) out of range." raise ArgumentError, "argument(month) out of range."
return nil
end end
if @year == 1752 && @month == 9 if @year == 1752 && @month == 9
if @day >= 3 && @day <= 13 if @day >= 3 && @day <= 13
raise ArgumentError, "argument(1752/09/3-13) out of range." raise ArgumentError, "argument(1752/09/3-13) out of range."
return nil
end end
d = 30 d = 30
else else
@ -181,7 +179,6 @@ class Date
end end
if @day < 1 || @day > d if @day < 1 || @day > d
raise ArgumentError, "argument(day) out of range." raise ArgumentError, "argument(day) out of range."
return nil
end end
return self return self
end end
@ -299,4 +296,3 @@ def Date.jan1!(y)
end end
return (d % 7) return (d % 7)
end end

View File

@ -147,7 +147,7 @@ class Date
def new3(y=-4712, m=1, d=1, sg=ITALY) def new3(y=-4712, m=1, d=1, sg=ITALY)
unless jd = exist3?(y, m, d, sg) unless jd = exist3?(y, m, d, sg)
fail ArgumentError, 'invalid date' raise ArgumentError, 'invalid date'
end end
new(jd, sg) new(jd, sg)
end end
@ -169,7 +169,7 @@ class Date
def new2(y=-4712, d=1, sg=ITALY) def new2(y=-4712, d=1, sg=ITALY)
unless jd = exist2?(y, d, sg) unless jd = exist2?(y, d, sg)
fail ArgumentError, 'invalid date' raise ArgumentError, 'invalid date'
end end
new(jd, sg) new(jd, sg)
end end
@ -189,7 +189,7 @@ class Date
def neww(y=1582, w=41, d=5, sg=ITALY) def neww(y=1582, w=41, d=5, sg=ITALY)
unless jd = existw?(y, w, d, sg) unless jd = existw?(y, w, d, sg)
fail ArgumentError, 'invalid date' raise ArgumentError, 'invalid date'
end end
new(jd, sg) new(jd, sg)
end end
@ -280,7 +280,7 @@ class Date
case n case n
when Numeric; return type.new(@rjd + n, @sg) when Numeric; return type.new(@rjd + n, @sg)
end end
fail TypeError, 'expected numeric' raise TypeError, 'expected numeric'
end end
def - (x) def - (x)
@ -288,7 +288,7 @@ class Date
when Numeric; return type.new(@rjd - x, @sg) when Numeric; return type.new(@rjd - x, @sg)
when Date; return @rjd - x.rjd when Date; return @rjd - x.rjd
end end
fail TypeError, 'expected numeric or date' raise TypeError, 'expected numeric or date'
end end
def <=> (other) def <=> (other)
@ -296,7 +296,7 @@ class Date
when Numeric; return @rjd <=> other when Numeric; return @rjd <=> other
when Date; return @rjd <=> other.rjd when Date; return @rjd <=> other.rjd
end end
fail TypeError, 'expected numeric or date' raise TypeError, 'expected numeric or date'
end end
def === (other) def === (other)
@ -304,7 +304,7 @@ class Date
when Numeric; return jd == other when Numeric; return jd == other
when Date; return jd == other.jd when Date; return jd == other.jd
end end
fail TypeError, 'expected numeric or date' raise TypeError, 'expected numeric or date'
end end
def >> (n) def >> (n)

View File

@ -1,6 +1,6 @@
# jcode.rb - ruby code to handle japanese (EUC/SJIS) string # jcode.rb - ruby code to handle japanese (EUC/SJIS) string
$vsave, $VERBOSE = $VERBOSE, FALSE $vsave, $VERBOSE = $VERBOSE, false
class String class String
printf STDERR, "feel free for some warnings:\n" if $VERBOSE printf STDERR, "feel free for some warnings:\n" if $VERBOSE

View File

@ -37,7 +37,7 @@
# creates a matrix where `rows' indicates rows. # creates a matrix where `rows' indicates rows.
# `rows' is an array of arrays, # `rows' is an array of arrays,
# e.g, Matrix[[11, 12], [21, 22]] # e.g, Matrix[[11, 12], [21, 22]]
# Matrix.rows(rows, copy = TRUE) # Matrix.rows(rows, copy = true)
# creates a matrix where `rows' indicates rows. # creates a matrix where `rows' indicates rows.
# if optional argument `copy' is false, use the array as # if optional argument `copy' is false, use the array as
# internal structure of the metrix without copying. # internal structure of the metrix without copying.
@ -143,7 +143,7 @@
# #
# INSTANCE CREATION: # INSTANCE CREATION:
# Vector.[](*array) # Vector.[](*array)
# Vector.elements(array, copy = TRUE) # Vector.elements(array, copy = true)
# ACCSESSING: # ACCSESSING:
# [](i) # [](i)
# size # size
@ -193,10 +193,10 @@ class Matrix
private_class_method :new private_class_method :new
def Matrix.[](*rows) def Matrix.[](*rows)
new(:init_rows, rows, FALSE) new(:init_rows, rows, false)
end end
def Matrix.rows(rows, copy = TRUE) def Matrix.rows(rows, copy = true)
new(:init_rows, rows, copy) new(:init_rows, rows, copy)
end end
@ -208,7 +208,7 @@ class Matrix
columns[j][i] columns[j][i]
} }
} }
Matrix.rows(rows, FALSE) Matrix.rows(rows, false)
end end
def Matrix.diagonal(*values) def Matrix.diagonal(*values)
@ -220,7 +220,7 @@ class Matrix
row row
} }
self self
rows(rows, FALSE) rows(rows, false)
end end
def Matrix.scalar(n, value) def Matrix.scalar(n, value)
@ -242,11 +242,11 @@ class Matrix
def Matrix.row_vector(row) def Matrix.row_vector(row)
case row case row
when Vector when Vector
Matrix.rows([row.to_a], FALSE) Matrix.rows([row.to_a], false)
when Array when Array
Matrix.rows([row.dup], FALSE) Matrix.rows([row.dup], false)
else else
Matrix.row([[row]], FALSE) Matrix.row([[row]], false)
end end
end end
@ -311,13 +311,13 @@ class Matrix
|i| |i|
@rows[i][j] @rows[i][j]
} }
Vector.elements(col, FALSE) Vector.elements(col, false)
end end
end end
def collect def collect
rows = @rows.collect{|row| row.collect{|e| yield e}} rows = @rows.collect{|row| row.collect{|e| yield e}}
Matrix.rows(rows, FALSE) Matrix.rows(rows, false)
end end
alias map collect alias map collect
@ -345,7 +345,7 @@ class Matrix
|row| |row|
row[from_col, size_col] row[from_col, size_col]
} }
Matrix.rows(rows, FALSE) Matrix.rows(rows, false)
end end
# TESTING # TESTING
@ -363,20 +363,20 @@ class Matrix
# COMPARING # COMPARING
def ==(other) def ==(other)
return FALSE unless Matrix === other return false unless Matrix === other
other.compare_by_row_vectors(@rows) other.compare_by_row_vectors(@rows)
end end
alias eql? == alias eql? ==
def compare_by_row_vectors(rows) def compare_by_row_vectors(rows)
return FALSE unless @rows.size == rows.size return false unless @rows.size == rows.size
0.upto(@rows.size - 1) do 0.upto(@rows.size - 1) do
|i| |i|
return FALSE unless @rows[i] == rows[i] return false unless @rows[i] == rows[i]
end end
TRUE true
end end
def clone def clone
@ -405,7 +405,7 @@ class Matrix
e * m e * m
} }
} }
return Matrix.rows(rows, FALSE) return Matrix.rows(rows, false)
when Vector when Vector
m = Matrix.column_vector(m) m = Matrix.column_vector(m)
r = self * m r = self * m
@ -425,7 +425,7 @@ class Matrix
vij vij
} }
} }
return Matrix.rows(rows, FALSE) return Matrix.rows(rows, false)
else else
x, y = m.coerce(self) x, y = m.coerce(self)
return x * y return x * y
@ -453,7 +453,7 @@ class Matrix
self[i, j] + m[i, j] self[i, j] + m[i, j]
} }
} }
Matrix.rows(rows, FALSE) Matrix.rows(rows, false)
end end
def -(m) def -(m)
@ -477,7 +477,7 @@ class Matrix
self[i, j] - m[i, j] self[i, j] - m[i, j]
} }
} }
Matrix.rows(rows, FALSE) Matrix.rows(rows, false)
end end
def /(other) def /(other)
@ -490,7 +490,7 @@ class Matrix
e / other e / other
} }
} }
return Matrix.rows(rows, FALSE) return Matrix.rows(rows, false)
when Matrix when Matrix
return self * other.inverse return self * other.inverse
else else
@ -825,10 +825,10 @@ class Vector
private_class_method :new private_class_method :new
def Vector.[](*array) def Vector.[](*array)
new(:init_elements, array, copy = FALSE) new(:init_elements, array, copy = false)
end end
def Vector.elements(array, copy = TRUE) def Vector.elements(array, copy = true)
new(:init_elements, array, copy) new(:init_elements, array, copy)
end end
@ -873,7 +873,7 @@ class Vector
# COMPARING # COMPARING
def ==(other) def ==(other)
return FALSE unless Vector === other return false unless Vector === other
other.compare_by(@elements) other.compare_by(@elements)
end end
@ -897,7 +897,7 @@ class Vector
case x case x
when Numeric when Numeric
els = @elements.collect{|e| e * x} els = @elements.collect{|e| e * x}
Vector.elements(els, FALSE) Vector.elements(els, false)
when Matrix when Matrix
self.covector * x self.covector * x
else else
@ -914,7 +914,7 @@ class Vector
|v1, v2| |v1, v2|
v1 + v2 v1 + v2
} }
Vector.elements(els, FALSE) Vector.elements(els, false)
when Matrix when Matrix
Matrix.column_vector(self) + v Matrix.column_vector(self) + v
else else
@ -931,7 +931,7 @@ class Vector
|v1, v2| |v1, v2|
v1 - v2 v1 - v2
} }
Vector.elements(els, FALSE) Vector.elements(els, false)
when Matrix when Matrix
Matrix.column_vector(self) - v Matrix.column_vector(self) - v
else else
@ -958,7 +958,7 @@ class Vector
|v| |v|
yield v yield v
} }
Vector.elements(els, FALSE) Vector.elements(els, false)
end end
alias map collect alias map collect
@ -967,7 +967,7 @@ class Vector
|v1, v2| |v1, v2|
yield v1, v2 yield v1, v2
} }
Vector.elements(els, FALSE) Vector.elements(els, false)
end end
def r def r

View File

@ -377,7 +377,7 @@ module Net
end end
end end
def putbinaryfile(localfile, remotefile, blocksize, callback = nil) def putbinaryfile(localfile, remotefile, blocksize = 4096, callback = nil)
if iterator? if iterator?
callback = Proc.new callback = Proc.new
end end
@ -635,7 +635,7 @@ module Net
host = (@sock.peeraddr())[3] host = (@sock.peeraddr())[3]
return host, port return host, port
end end
private :parse228 private :parse229
def parse257(resp) def parse257(resp)
if resp[0, 3] != "257" if resp[0, 3] != "257"

View File

@ -17,10 +17,10 @@ class Tracer
@RCS_ID='-$Id: tracer.rb,v 1.8 1998/05/19 03:42:49 keiju Exp keiju $-' @RCS_ID='-$Id: tracer.rb,v 1.8 1998/05/19 03:42:49 keiju Exp keiju $-'
class << self class << self
attr :verbose, TRUE attr :verbose, true
alias verbose? verbose alias verbose? verbose
end end
verbose = TRUE verbose = true
MY_FILE_NAME = caller(0)[0].scan(/^(.*):[0-9]+$/)[0][0] MY_FILE_NAME = caller(0)[0].scan(/^(.*):[0-9]+$/)[0][0]
@ -114,14 +114,14 @@ class Tracer
return unless p.call event, file, line, id, binding return unless p.call event, file, line, id, binding
end end
Thread.critical = TRUE Thread.critical = true
printf("#%d:%s:%d:%s: %s", printf("#%d:%s:%d:%s: %s",
get_thread_no, get_thread_no,
file, file,
line, line,
EVENT_SYMBOL[event], EVENT_SYMBOL[event],
get_line(file, line)) get_line(file, line))
Thread.critical = FALSE Thread.critical = false
end end
Single = new Single = new

View File

@ -19,6 +19,9 @@ class WeakRef<Delegator
ID_MAP = {} # obj -> [ref,...] ID_MAP = {} # obj -> [ref,...]
ID_REV_MAP = {} # ref -> obj ID_REV_MAP = {} # ref -> obj
ObjectSpace.add_finalizer(lambda{|id| ObjectSpace.add_finalizer(lambda{|id|
__old_status = Thread.critical
Thread.critical = true
begin
rids = ID_MAP[id] rids = ID_MAP[id]
if rids if rids
for rid in rids for rid in rids
@ -32,6 +35,9 @@ class WeakRef<Delegator
ID_MAP[rid].delete(id) ID_MAP[rid].delete(id)
ID_MAP[rid] = nil if ID_MAP[rid].empty? ID_MAP[rid] = nil if ID_MAP[rid].empty?
end end
ensure
Thread.critical = __old_status
end
}) })
def initialize(orig) def initialize(orig)

View File

@ -11,6 +11,20 @@
# #
# #
# probably based on:
#
# Newsgroups: comp.sources.misc,de.comp.sources.os9
# From: fkk@stasys.sta.sub.org (Frank Kaefer)
# Subject: v41i126: br - Biorhythm v3.0, Part01/01
# Message-ID: <1994Feb1.070616.15982@sparky.sterling.com>
# Sender: kent@sparky.sterling.com (Kent Landfield)
# Organization: Sterling Software
# Date: Tue, 1 Feb 1994 07:06:16 GMT
#
# Posting-number: Volume 41, Issue 126
# Archive-name: br/part01
# Environment: basic, dos, os9
include Math include Math
require "date.rb" require "date.rb"
require "parsearg.rb" require "parsearg.rb"

View File

@ -1,4 +1,4 @@
#! /usr/local/bin/ruby #! /usr/bin/env ruby
# cal.rb: Written by Tadayoshi Funaba 1998-2000 # cal.rb: Written by Tadayoshi Funaba 1998-2000
# $Id: cal.rb,v 1.10 2000/05/20 02:09:47 tadf Exp $ # $Id: cal.rb,v 1.10 2000/05/20 02:09:47 tadf Exp $

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
#define RUBY_VERSION "1.5.4" #define RUBY_VERSION "1.5.4"
#define RUBY_RELEASE_DATE "2000-07-06" #define RUBY_RELEASE_DATE "2000-07-10"
#define RUBY_VERSION_CODE 154 #define RUBY_VERSION_CODE 154
#define RUBY_RELEASE_CODE 20000706 #define RUBY_RELEASE_CODE 20000710