mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
*** empty log message ***
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d148ffef29
commit
997ff23758
21 changed files with 229 additions and 154 deletions
16
ChangeLog
16
ChangeLog
|
@ -1,3 +1,19 @@
|
||||||
|
Wed Feb 10 15:20:03 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
|
||||||
|
|
||||||
|
* regex.c (re_match): empty pattern should not cause infinite
|
||||||
|
pattern match loop.
|
||||||
|
|
||||||
|
* regex.c (re_compile_pattern): RE_OPTIMIZE_ANCHOR for /.*/, not
|
||||||
|
for /(.|\n)/.
|
||||||
|
|
||||||
|
* numeric.c (fix_pow): `fixnum**nil' should raise TypeError.
|
||||||
|
|
||||||
|
* bignum.c (rb_big_pow): need to normalize results.
|
||||||
|
|
||||||
|
Wed Feb 10 01:42:41 1999 EGUCHI Osamu <eguchi@shizuokanet.ne.jp>
|
||||||
|
|
||||||
|
* numeric.c (fix_pow): `(5**1).type' should be Integer.
|
||||||
|
|
||||||
Tue Feb 9 01:22:49 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
|
Tue Feb 9 01:22:49 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
|
||||||
|
|
||||||
* parse.y (yylex): do not ignore newlines in mbchars.
|
* parse.y (yylex): do not ignore newlines in mbchars.
|
||||||
|
|
34
Makefile.in
34
Makefile.in
|
@ -2,12 +2,6 @@ SHELL = /bin/sh
|
||||||
|
|
||||||
#### Start of system configuration section. ####
|
#### Start of system configuration section. ####
|
||||||
|
|
||||||
MAJOR= @MAJOR@
|
|
||||||
MINOR= @MINOR@
|
|
||||||
TEENY= @TEENY@
|
|
||||||
|
|
||||||
RUBY_INSTALL_NAME=@RUBY_INSTALL_NAME@
|
|
||||||
|
|
||||||
srcdir = @srcdir@
|
srcdir = @srcdir@
|
||||||
VPATH = @srcdir@:@srcdir@/missing
|
VPATH = @srcdir@:@srcdir@/missing
|
||||||
|
|
||||||
|
@ -27,10 +21,16 @@ LDSHARED = @LDSHARED@
|
||||||
DLDFLAGS = @DLDFLAGS@
|
DLDFLAGS = @DLDFLAGS@
|
||||||
SOLIBS = @SOLIBS@
|
SOLIBS = @SOLIBS@
|
||||||
|
|
||||||
|
RUBY_INSTALL_NAME=@RUBY_INSTALL_NAME@
|
||||||
binsuffix = @binsuffix@
|
binsuffix = @binsuffix@
|
||||||
|
PROGRAM=$(RUBY_INSTALL_NAME)$(binsuffix)
|
||||||
|
|
||||||
#### End of system configuration section. ####
|
#### End of system configuration section. ####
|
||||||
|
|
||||||
|
MAJOR= @MAJOR@
|
||||||
|
MINOR= @MINOR@
|
||||||
|
TEENY= @TEENY@
|
||||||
|
|
||||||
LIBRUBY_A = @LIBRUBY_A@
|
LIBRUBY_A = @LIBRUBY_A@
|
||||||
LIBRUBY_SO = @LIBRUBY_SO@
|
LIBRUBY_SO = @LIBRUBY_SO@
|
||||||
LIBRUBY_ALIASES= @LIBRUBY_ALIASES@
|
LIBRUBY_ALIASES= @LIBRUBY_ALIASES@
|
||||||
|
@ -58,13 +58,13 @@ OBJS = array.o \
|
||||||
inits.o \
|
inits.o \
|
||||||
io.o \
|
io.o \
|
||||||
marshal.o \
|
marshal.o \
|
||||||
prec.o \
|
|
||||||
math.o \
|
math.o \
|
||||||
numeric.o \
|
numeric.o \
|
||||||
object.o \
|
object.o \
|
||||||
pack.o \
|
pack.o \
|
||||||
parse.o \
|
parse.o \
|
||||||
process.o \
|
process.o \
|
||||||
|
prec.o \
|
||||||
random.o \
|
random.o \
|
||||||
range.o \
|
range.o \
|
||||||
re.o \
|
re.o \
|
||||||
|
@ -84,11 +84,11 @@ OBJS = array.o \
|
||||||
all: miniruby$(binsuffix) rbconfig.rb
|
all: miniruby$(binsuffix) rbconfig.rb
|
||||||
@./miniruby$(binsuffix) -Xext extmk.rb @EXTSTATIC@
|
@./miniruby$(binsuffix) -Xext extmk.rb @EXTSTATIC@
|
||||||
|
|
||||||
miniruby$(binsuffix): $(LIBRUBY_A) $(MAINOBJ) dmyext.o
|
miniruby$(binsuffix): config.status $(LIBRUBY_A) $(MAINOBJ) dmyext.o
|
||||||
@rm -f $@
|
@rm -f $@
|
||||||
$(PURIFY) $(CC) $(LDFLAGS) $(MAINOBJ) dmyext.o $(LIBRUBY_A) $(LIBS) -o $@
|
$(PURIFY) $(CC) $(LDFLAGS) $(MAINOBJ) dmyext.o $(LIBRUBY_A) $(LIBS) -o $@
|
||||||
|
|
||||||
ruby$(binsuffix): $(LIBRUBY) $(MAINOBJ) $(EXTOBJS)
|
$(PROGRAM): $(LIBRUBY) $(MAINOBJ) $(EXTOBJS)
|
||||||
@rm -f $@
|
@rm -f $@
|
||||||
$(PURIFY) $(CC) $(LDFLAGS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@
|
$(PURIFY) $(CC) $(LDFLAGS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@
|
||||||
|
|
||||||
|
@ -98,26 +98,22 @@ $(LIBRUBY_A): $(OBJS) dmyext.o
|
||||||
|
|
||||||
$(LIBRUBY_SO): $(OBJS) dmyext.o
|
$(LIBRUBY_SO): $(OBJS) dmyext.o
|
||||||
$(LDSHARED) $(DLDFLAGS) $(SOLIBS) $(OBJS) dmyext.o -o $@
|
$(LDSHARED) $(DLDFLAGS) $(SOLIBS) $(OBJS) dmyext.o -o $@
|
||||||
@for alias in $(LIBRUBY_ALIASES); do \
|
@-./miniruby -e 'ARGV.each{|link| File.delete link if File.exist? link; \
|
||||||
rm -f $$alias \
|
File.symlink "$(LIBRUBY_SO)", link}' \
|
||||||
&& @LN_S@ $(LIBRUBY_SO) $$alias \
|
$(LIBRUBY_ALIASES) || true
|
||||||
&& echo ln @LN_S@ $(LIBRUBY_SO) $$alias; \
|
|
||||||
done
|
|
||||||
|
|
||||||
install: rbconfig.rb
|
install: rbconfig.rb
|
||||||
./miniruby$(binsuffix) $(srcdir)/instruby.rb $(DESTDIR)
|
./miniruby$(binsuffix) $(srcdir)/instruby.rb $(DESTDIR)
|
||||||
|
|
||||||
clean:; @rm -f $(OBJS) $(LIBRUBY_A) $(LIBRUBY_SO) $(LIBRUBY_ALIASES) $(MAINOBJ) rbconfig.rb
|
clean:; @rm -f $(OBJS) $(LIBRUBY_A) $(LIBRUBY_SO) $(LIBRUBY_ALIASES) $(MAINOBJ) rbconfig.rb
|
||||||
@rm -f ext/extinit.c ext/extinit.o dmyext.o
|
@rm -f ext/extinit.c ext/extinit.o dmyext.o
|
||||||
@if test -f ./miniruby$(binsuffix); then \
|
@-./miniruby$(binsuffix) -Xext extmk.rb clean 2> /dev/null || true
|
||||||
./miniruby$(binsuffix) -Xext extmk.rb clean; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
distclean: clean
|
distclean: clean
|
||||||
@rm -f Makefile ext/extmk.rb config.h
|
@rm -f Makefile ext/extmk.rb config.h
|
||||||
@rm -f ext/config.cache config.cache config.log config.status
|
@rm -f ext/config.cache config.cache config.log config.status
|
||||||
@rm -f parse.c *~ core *.core gmon.out y.tab.c y.output
|
@rm -f parse.c *~ core *.core gmon.out y.tab.c y.output
|
||||||
@rm -f ruby$(binsuffix) miniruby$(binsuffix)
|
@rm -f $(PROGRAM) miniruby$(binsuffix)
|
||||||
|
|
||||||
realclean: distclean
|
realclean: distclean
|
||||||
@rm -f lex.c
|
@rm -f lex.c
|
||||||
|
@ -125,7 +121,7 @@ realclean: distclean
|
||||||
test: miniruby$(binsuffix)
|
test: miniruby$(binsuffix)
|
||||||
@./miniruby$(binsuffix) $(srcdir)/rubytest.rb
|
@./miniruby$(binsuffix) $(srcdir)/rubytest.rb
|
||||||
|
|
||||||
rbconfig.rb: config.status miniruby$(binsuffix)
|
rbconfig.rb: miniruby$(binsuffix)
|
||||||
@./miniruby$(binsuffix) $(srcdir)/mkconfig.rb rbconfig.rb
|
@./miniruby$(binsuffix) $(srcdir)/mkconfig.rb rbconfig.rb
|
||||||
|
|
||||||
config.status: $(srcdir)/configure
|
config.status: $(srcdir)/configure
|
||||||
|
|
64
README.EXT
64
README.EXT
|
@ -113,7 +113,7 @@ To convert C data to the values of Ruby:
|
||||||
|
|
||||||
* FIXNUM
|
* FIXNUM
|
||||||
|
|
||||||
right shift 1 bit, and turn on LSB.
|
left shift 1 bit, and turn on LSB.
|
||||||
|
|
||||||
* Other pointer values
|
* Other pointer values
|
||||||
|
|
||||||
|
@ -726,11 +726,11 @@ const: nil object
|
||||||
|
|
||||||
Qtrue
|
Qtrue
|
||||||
|
|
||||||
const: Qtrue object(default true value)
|
const: true object(default true value)
|
||||||
|
|
||||||
Qfalse
|
Qfalse
|
||||||
|
|
||||||
const: Qfalse object
|
const: false object
|
||||||
|
|
||||||
** C pointer wrapping
|
** C pointer wrapping
|
||||||
|
|
||||||
|
@ -744,12 +744,13 @@ C
|
||||||
|
|
||||||
Data_Make_Struct(class, type, mark, free, sval)
|
Data_Make_Struct(class, type, mark, free, sval)
|
||||||
|
|
||||||
type型のメモリをmallocし,変数svalに代入した後,それをカプセ
|
This macro allocates memory using malloc(), assigns it to the variable
|
||||||
ル化したデータを返すマクロ.
|
sval, and returns the DATA encapsulating the pointer to memory region.
|
||||||
|
|
||||||
Data_Get_Struct(data, type, sval)
|
Data_Get_Struct(data, type, sval)
|
||||||
|
|
||||||
dataからtype型のポインタを取り出し変数svalに代入するマクロ.
|
This macro retrieves the pointer value from DATA, and assigns it to
|
||||||
|
the variable sval.
|
||||||
|
|
||||||
** defining class/module
|
** defining class/module
|
||||||
|
|
||||||
|
@ -905,48 +906,54 @@ Sets the value of the instance variable.
|
||||||
|
|
||||||
VALUE rb_iterate(VALUE (*func1)(), void *arg1, VALUE (*func2)(), void *arg2)
|
VALUE rb_iterate(VALUE (*func1)(), void *arg1, VALUE (*func2)(), void *arg2)
|
||||||
|
|
||||||
func2をブロックとして設定し, func1をイテレータとして呼ぶ.
|
Calls the function func1, supplying func2 as the block. func1 will be
|
||||||
func1には arg1が引数として渡され, func2には第1引数にイテレー
|
called with the argument arg1. func2 receives the value from yield as
|
||||||
タから与えられた値, 第2引数にarg2が渡される.
|
the first argument, arg2 as the second argument.
|
||||||
|
|
||||||
|
|
||||||
VALUE rb_yield(VALUE val)
|
VALUE rb_yield(VALUE val)
|
||||||
|
|
||||||
valを値としてイテレータブロックを呼び出す.
|
Evaluates the block with value val.
|
||||||
|
|
||||||
VALUE rb_rescue(VALUE (*func1)(), void *arg1, VALUE (*func2)(), void *arg2)
|
VALUE rb_rescue(VALUE (*func1)(), void *arg1, VALUE (*func2)(), void *arg2)
|
||||||
|
|
||||||
関数func1をarg1を引数に呼び出す.func1の実行中に例外が発生し
|
Calls the function func1, with arg1 as the argument. If exception
|
||||||
た時には func2をarg2を引数として呼ぶ.戻り値は例外が発生しな
|
occurs during func1, it calls func2 with arg2 as the argument. The
|
||||||
かった時はfunc1の戻り値, 例外が発生した時にはfunc2の戻り値で
|
return value of rb_rescue() is the return value from func1 if no
|
||||||
ある.
|
exception occurs, from func2 otherwise.
|
||||||
|
|
||||||
VALUE rb_ensure(VALUE (*func1)(), void *arg1, void (*func2)(), void *arg2)
|
VALUE rb_ensure(VALUE (*func1)(), void *arg1, void (*func2)(), void *arg2)
|
||||||
|
|
||||||
関数func1をarg1を引数として実行し, 実行終了後(たとえ例外が発
|
Calls the function func1 with arg1 as the argument, then calls func2
|
||||||
生しても) func2をarg2を引数として実行する.戻り値はfunc1の戻
|
with arg2, whenever execution terminated. The return value from
|
||||||
り値である(例外が発生した時は戻らない).
|
rb_ensure() is that of func1.
|
||||||
|
|
||||||
** 例外・エラー
|
** Exceptions and Errors
|
||||||
|
|
||||||
|
void rb_warn(char *fmt, ...)
|
||||||
|
|
||||||
|
Prints warning message according to the printf-like format.
|
||||||
|
|
||||||
void rb_warning(char *fmt, ...)
|
void rb_warning(char *fmt, ...)
|
||||||
|
|
||||||
rb_verbose時に標準エラー出力に警告情報を表示する.引数はprintf()と同じ.
|
Prints warning message according to the printf-like format, if
|
||||||
|
$VERBOSE is true.
|
||||||
|
|
||||||
void rb_raise(rb_eRuntimeError, char *fmt, ...)
|
void rb_raise(VALUE exception, char *fmt, ...)
|
||||||
|
|
||||||
例外を発生させる.引数はprintf()と同じ.
|
Raises an exception of class exception. The fmt is the format string
|
||||||
|
just like printf().
|
||||||
|
|
||||||
void rb_fatal(char *fmt, ...)
|
void rb_fatal(char *fmt, ...)
|
||||||
|
|
||||||
致命的例外を発生させる.通常の例外処理は行なわれず, インター
|
Raises fatal error, terminates the interpreter. No exception handling
|
||||||
プリタが終了する(ただしensureで指定されたコードは終了前に実
|
will be done for fatal error, but ensure blocks will be executed.
|
||||||
行される).
|
|
||||||
|
|
||||||
void rb_bug(char *fmt, ...)
|
void rb_bug(char *fmt, ...)
|
||||||
|
|
||||||
インタープリタなどプログラムのバグでしか発生するはずのない状
|
Termintates the interpreter immediately. This function should be
|
||||||
況の時呼ぶ.インタープリタはコアダンプし直ちに終了する.例外
|
called under the situation caused by the bug in the interpreter. No
|
||||||
処理は一切行なわれない.
|
exception handling nor ensure execution will be done.
|
||||||
|
|
||||||
** Initialize and Starts the Interpreter
|
** Initialize and Starts the Interpreter
|
||||||
|
|
||||||
|
@ -966,8 +973,7 @@ Specifies the name of the script ($0).
|
||||||
|
|
||||||
Appendix B. Functions Available in extconf.rb
|
Appendix B. Functions Available in extconf.rb
|
||||||
|
|
||||||
extconf.rbの中では利用可能なコンパイル条件チェックの関数は以
|
These functions are available in extconf.rb:
|
||||||
下の通りである.
|
|
||||||
|
|
||||||
have_library(lib, func)
|
have_library(lib, func)
|
||||||
|
|
||||||
|
|
|
@ -134,7 +134,7 @@ VALUE
|
||||||
|
|
||||||
* FIXNUMの場合
|
* FIXNUMの場合
|
||||||
|
|
||||||
1bit右シフトして,LSBを立てる.
|
1bit左シフトして,LSBを立てる.
|
||||||
|
|
||||||
* その他のポインタの場合
|
* その他のポインタの場合
|
||||||
|
|
||||||
|
|
1
bignum.c
1
bignum.c
|
@ -943,6 +943,7 @@ rb_big_pow(x, y)
|
||||||
}
|
}
|
||||||
z = rb_big_mul(z, x);
|
z = rb_big_mul(z, x);
|
||||||
}
|
}
|
||||||
|
if (!FIXNUM_P(z)) z = bignorm(z);
|
||||||
return z;
|
return z;
|
||||||
}
|
}
|
||||||
d = (double)yy;
|
d = (double)yy;
|
||||||
|
|
44
configure
vendored
44
configure
vendored
|
@ -3787,6 +3787,7 @@ echo "configure:3765: checking whether OS depend dynamic link works" >&5
|
||||||
LDFLAGS="-Wl,-E"
|
LDFLAGS="-Wl,-E"
|
||||||
rb_cv_dlopen=yes;;
|
rb_cv_dlopen=yes;;
|
||||||
solaris*) LDSHARED='ld -G'
|
solaris*) LDSHARED='ld -G'
|
||||||
|
LDFLAGS="-Wl,-E"
|
||||||
rb_cv_dlopen=yes;;
|
rb_cv_dlopen=yes;;
|
||||||
sunos*) LDSHARED='ld -assert nodefinitions'
|
sunos*) LDSHARED='ld -assert nodefinitions'
|
||||||
rb_cv_dlopen=yes;;
|
rb_cv_dlopen=yes;;
|
||||||
|
@ -3799,8 +3800,8 @@ echo "configure:3765: checking whether OS depend dynamic link works" >&5
|
||||||
linux*) LDSHARED="gcc -shared"
|
linux*) LDSHARED="gcc -shared"
|
||||||
rb_cv_dlopen=yes ;;
|
rb_cv_dlopen=yes ;;
|
||||||
freebsd*) LDSHARED="gcc -shared"
|
freebsd*) LDSHARED="gcc -shared"
|
||||||
if test -x /usr/bin/objformat -a \
|
if test -x /usr/bin/objformat && \
|
||||||
`/usr/bin/objformat` = "elf" ; then
|
test `/ust/bin/objformat` = "elf" ; then
|
||||||
LDFLAGS="-rdynamic"
|
LDFLAGS="-rdynamic"
|
||||||
DLDFLAGS='-Wl,-soname,$(.TARGET)'
|
DLDFLAGS='-Wl,-soname,$(.TARGET)'
|
||||||
rb_cv_freebsd_elf=yes
|
rb_cv_freebsd_elf=yes
|
||||||
|
@ -3854,12 +3855,12 @@ if test "$ac_cv_header_a_out_h" = yes; then
|
||||||
if test "$with_dln_a_out" = yes || test "$rb_cv_dlopen" = unknown; then
|
if test "$with_dln_a_out" = yes || test "$rb_cv_dlopen" = unknown; then
|
||||||
cat confdefs.h > config.h
|
cat confdefs.h > config.h
|
||||||
echo $ac_n "checking whether matz's dln works""... $ac_c" 1>&6
|
echo $ac_n "checking whether matz's dln works""... $ac_c" 1>&6
|
||||||
echo "configure:3858: checking whether matz's dln works" >&5
|
echo "configure:3859: checking whether matz's dln works" >&5
|
||||||
if eval "test \"`echo '$''{'rb_cv_dln_a_out'+set}'`\" = set"; then
|
if eval "test \"`echo '$''{'rb_cv_dln_a_out'+set}'`\" = set"; then
|
||||||
echo $ac_n "(cached) $ac_c" 1>&6
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
else
|
else
|
||||||
cat > conftest.$ac_ext <<EOF
|
cat > conftest.$ac_ext <<EOF
|
||||||
#line 3863 "configure"
|
#line 3864 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
|
|
||||||
#define USE_DLN_A_OUT
|
#define USE_DLN_A_OUT
|
||||||
|
@ -3869,7 +3870,7 @@ int main() {
|
||||||
|
|
||||||
; return 0; }
|
; return 0; }
|
||||||
EOF
|
EOF
|
||||||
if { (eval echo configure:3873: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
if { (eval echo configure:3874: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||||
rm -rf conftest*
|
rm -rf conftest*
|
||||||
rb_cv_dln_a_out=yes
|
rb_cv_dln_a_out=yes
|
||||||
else
|
else
|
||||||
|
@ -3971,7 +3972,7 @@ fi
|
||||||
case "$host_os" in
|
case "$host_os" in
|
||||||
human*)
|
human*)
|
||||||
echo $ac_n "checking for _harderr in -lsignal""... $ac_c" 1>&6
|
echo $ac_n "checking for _harderr in -lsignal""... $ac_c" 1>&6
|
||||||
echo "configure:3975: checking for _harderr in -lsignal" >&5
|
echo "configure:3976: checking for _harderr in -lsignal" >&5
|
||||||
ac_lib_var=`echo signal'_'_harderr | sed 'y%./+-%__p_%'`
|
ac_lib_var=`echo signal'_'_harderr | sed 'y%./+-%__p_%'`
|
||||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||||
echo $ac_n "(cached) $ac_c" 1>&6
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
|
@ -3979,7 +3980,7 @@ else
|
||||||
ac_save_LIBS="$LIBS"
|
ac_save_LIBS="$LIBS"
|
||||||
LIBS="-lsignal $LIBS"
|
LIBS="-lsignal $LIBS"
|
||||||
cat > conftest.$ac_ext <<EOF
|
cat > conftest.$ac_ext <<EOF
|
||||||
#line 3983 "configure"
|
#line 3984 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
/* Override any gcc2 internal prototype to avoid an error. */
|
/* Override any gcc2 internal prototype to avoid an error. */
|
||||||
/* We use char because int might match the return type of a gcc2
|
/* We use char because int might match the return type of a gcc2
|
||||||
|
@ -3990,7 +3991,7 @@ int main() {
|
||||||
_harderr()
|
_harderr()
|
||||||
; return 0; }
|
; return 0; }
|
||||||
EOF
|
EOF
|
||||||
if { (eval echo configure:3994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
if { (eval echo configure:3995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||||
rm -rf conftest*
|
rm -rf conftest*
|
||||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||||
else
|
else
|
||||||
|
@ -4018,7 +4019,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo $ac_n "checking for hmemset in -lhmem""... $ac_c" 1>&6
|
echo $ac_n "checking for hmemset in -lhmem""... $ac_c" 1>&6
|
||||||
echo "configure:4022: checking for hmemset in -lhmem" >&5
|
echo "configure:4023: checking for hmemset in -lhmem" >&5
|
||||||
ac_lib_var=`echo hmem'_'hmemset | sed 'y%./+-%__p_%'`
|
ac_lib_var=`echo hmem'_'hmemset | sed 'y%./+-%__p_%'`
|
||||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||||
echo $ac_n "(cached) $ac_c" 1>&6
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
|
@ -4026,7 +4027,7 @@ else
|
||||||
ac_save_LIBS="$LIBS"
|
ac_save_LIBS="$LIBS"
|
||||||
LIBS="-lhmem $LIBS"
|
LIBS="-lhmem $LIBS"
|
||||||
cat > conftest.$ac_ext <<EOF
|
cat > conftest.$ac_ext <<EOF
|
||||||
#line 4030 "configure"
|
#line 4031 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
/* Override any gcc2 internal prototype to avoid an error. */
|
/* Override any gcc2 internal prototype to avoid an error. */
|
||||||
/* We use char because int might match the return type of a gcc2
|
/* We use char because int might match the return type of a gcc2
|
||||||
|
@ -4037,7 +4038,7 @@ int main() {
|
||||||
hmemset()
|
hmemset()
|
||||||
; return 0; }
|
; return 0; }
|
||||||
EOF
|
EOF
|
||||||
if { (eval echo configure:4041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
if { (eval echo configure:4042: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||||
rm -rf conftest*
|
rm -rf conftest*
|
||||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||||
else
|
else
|
||||||
|
@ -4067,12 +4068,12 @@ fi
|
||||||
for ac_func in select
|
for ac_func in select
|
||||||
do
|
do
|
||||||
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
|
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
|
||||||
echo "configure:4071: checking for $ac_func" >&5
|
echo "configure:4072: checking for $ac_func" >&5
|
||||||
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
|
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
|
||||||
echo $ac_n "(cached) $ac_c" 1>&6
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
else
|
else
|
||||||
cat > conftest.$ac_ext <<EOF
|
cat > conftest.$ac_ext <<EOF
|
||||||
#line 4076 "configure"
|
#line 4077 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
/* System header to define __stub macros and hopefully few prototypes,
|
/* System header to define __stub macros and hopefully few prototypes,
|
||||||
which can conflict with char $ac_func(); below. */
|
which can conflict with char $ac_func(); below. */
|
||||||
|
@ -4095,7 +4096,7 @@ $ac_func();
|
||||||
|
|
||||||
; return 0; }
|
; return 0; }
|
||||||
EOF
|
EOF
|
||||||
if { (eval echo configure:4099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
if { (eval echo configure:4100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||||
rm -rf conftest*
|
rm -rf conftest*
|
||||||
eval "ac_cv_func_$ac_func=yes"
|
eval "ac_cv_func_$ac_func=yes"
|
||||||
else
|
else
|
||||||
|
@ -4120,7 +4121,7 @@ fi
|
||||||
done
|
done
|
||||||
|
|
||||||
echo $ac_n "checking whether PD libc _dtos18 fail to convert big number""... $ac_c" 1>&6
|
echo $ac_n "checking whether PD libc _dtos18 fail to convert big number""... $ac_c" 1>&6
|
||||||
echo "configure:4124: checking whether PD libc _dtos18 fail to convert big number" >&5
|
echo "configure:4125: checking whether PD libc _dtos18 fail to convert big number" >&5
|
||||||
if eval "test \"`echo '$''{'rb_cv_missing__dtos18'+set}'`\" = set"; then
|
if eval "test \"`echo '$''{'rb_cv_missing__dtos18'+set}'`\" = set"; then
|
||||||
echo $ac_n "(cached) $ac_c" 1>&6
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
else
|
else
|
||||||
|
@ -4128,7 +4129,7 @@ else
|
||||||
rb_cv_missing__dtos18=no
|
rb_cv_missing__dtos18=no
|
||||||
else
|
else
|
||||||
cat > conftest.$ac_ext <<EOF
|
cat > conftest.$ac_ext <<EOF
|
||||||
#line 4132 "configure"
|
#line 4133 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -4140,7 +4141,7 @@ main ()
|
||||||
}
|
}
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
if { (eval echo configure:4144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
|
if { (eval echo configure:4145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
|
||||||
then
|
then
|
||||||
rb_cv_missing__dtos18=yes
|
rb_cv_missing__dtos18=yes
|
||||||
else
|
else
|
||||||
|
@ -4162,7 +4163,7 @@ EOF
|
||||||
|
|
||||||
fi
|
fi
|
||||||
echo $ac_n "checking whether PD libc fconvert fail to round""... $ac_c" 1>&6
|
echo $ac_n "checking whether PD libc fconvert fail to round""... $ac_c" 1>&6
|
||||||
echo "configure:4166: checking whether PD libc fconvert fail to round" >&5
|
echo "configure:4167: checking whether PD libc fconvert fail to round" >&5
|
||||||
if eval "test \"`echo '$''{'rb_cv_missing_fconvert'+set}'`\" = set"; then
|
if eval "test \"`echo '$''{'rb_cv_missing_fconvert'+set}'`\" = set"; then
|
||||||
echo $ac_n "(cached) $ac_c" 1>&6
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
else
|
else
|
||||||
|
@ -4170,7 +4171,7 @@ else
|
||||||
rb_cv_missing_fconvert=no
|
rb_cv_missing_fconvert=no
|
||||||
else
|
else
|
||||||
cat > conftest.$ac_ext <<EOF
|
cat > conftest.$ac_ext <<EOF
|
||||||
#line 4174 "configure"
|
#line 4175 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -4183,7 +4184,7 @@ main ()
|
||||||
}
|
}
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
if { (eval echo configure:4187: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
|
if { (eval echo configure:4188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
|
||||||
then
|
then
|
||||||
rb_cv_missing_fconvert=yes
|
rb_cv_missing_fconvert=yes
|
||||||
else
|
else
|
||||||
|
@ -4310,7 +4311,8 @@ test "$program_suffix" != NONE &&
|
||||||
ri_suffix=$program_suffix
|
ri_suffix=$program_suffix
|
||||||
|
|
||||||
RUBY_INSTALL_NAME="${ri_prefix}ruby${ri_suffix}"
|
RUBY_INSTALL_NAME="${ri_prefix}ruby${ri_suffix}"
|
||||||
RUBY_LIB_PATH="${prefix}/lib/${RUBY_INSTALL_NAME}/${MAJOR}.${MINOR}"
|
#RUBY_LIB_PATH="${prefix}/lib/${RUBY_INSTALL_NAME}/${MAJOR}.${MINOR}"
|
||||||
|
RUBY_LIB_PATH="${prefix}/lib/ruby/${MAJOR}.${MINOR}"
|
||||||
cat >> confdefs.h <<EOF
|
cat >> confdefs.h <<EOF
|
||||||
#define RUBY_LIB "${RUBY_LIB_PATH}"
|
#define RUBY_LIB "${RUBY_LIB_PATH}"
|
||||||
EOF
|
EOF
|
||||||
|
|
|
@ -402,6 +402,7 @@ if test "$with_dln_a_out" != yes; then
|
||||||
LDFLAGS="-Wl,-E"
|
LDFLAGS="-Wl,-E"
|
||||||
rb_cv_dlopen=yes;;
|
rb_cv_dlopen=yes;;
|
||||||
solaris*) LDSHARED='ld -G'
|
solaris*) LDSHARED='ld -G'
|
||||||
|
LDFLAGS="-Wl,-E"
|
||||||
rb_cv_dlopen=yes;;
|
rb_cv_dlopen=yes;;
|
||||||
sunos*) LDSHARED='ld -assert nodefinitions'
|
sunos*) LDSHARED='ld -assert nodefinitions'
|
||||||
rb_cv_dlopen=yes;;
|
rb_cv_dlopen=yes;;
|
||||||
|
@ -414,8 +415,8 @@ if test "$with_dln_a_out" != yes; then
|
||||||
linux*) LDSHARED="gcc -shared"
|
linux*) LDSHARED="gcc -shared"
|
||||||
rb_cv_dlopen=yes ;;
|
rb_cv_dlopen=yes ;;
|
||||||
freebsd*) LDSHARED="gcc -shared"
|
freebsd*) LDSHARED="gcc -shared"
|
||||||
if test -x /usr/bin/objformat -a \
|
if test -x /usr/bin/objformat && \
|
||||||
`/usr/bin/objformat` = "elf" ; then
|
test `/ust/bin/objformat` = "elf" ; then
|
||||||
LDFLAGS="-rdynamic"
|
LDFLAGS="-rdynamic"
|
||||||
DLDFLAGS='-Wl,-soname,$(.TARGET)'
|
DLDFLAGS='-Wl,-soname,$(.TARGET)'
|
||||||
rb_cv_freebsd_elf=yes
|
rb_cv_freebsd_elf=yes
|
||||||
|
@ -685,7 +686,8 @@ test "$program_suffix" != NONE &&
|
||||||
ri_suffix=$program_suffix
|
ri_suffix=$program_suffix
|
||||||
|
|
||||||
RUBY_INSTALL_NAME="${ri_prefix}ruby${ri_suffix}"
|
RUBY_INSTALL_NAME="${ri_prefix}ruby${ri_suffix}"
|
||||||
RUBY_LIB_PATH="${prefix}/lib/${RUBY_INSTALL_NAME}/${MAJOR}.${MINOR}"
|
#RUBY_LIB_PATH="${prefix}/lib/${RUBY_INSTALL_NAME}/${MAJOR}.${MINOR}"
|
||||||
|
RUBY_LIB_PATH="${prefix}/lib/ruby/${MAJOR}.${MINOR}"
|
||||||
AC_DEFINE_UNQUOTED(RUBY_LIB, "${RUBY_LIB_PATH}")
|
AC_DEFINE_UNQUOTED(RUBY_LIB, "${RUBY_LIB_PATH}")
|
||||||
AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, "${RUBY_LIB_PATH}/site_ruby")
|
AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, "${RUBY_LIB_PATH}/site_ruby")
|
||||||
AC_SUBST(arch)dnl
|
AC_SUBST(arch)dnl
|
||||||
|
|
|
@ -294,13 +294,14 @@ LDSHARED = @LDSHARED@
|
||||||
|
|
||||||
mfile.printf "\
|
mfile.printf "\
|
||||||
|
|
||||||
program_transform_name = -e @program_transform_name@
|
#program_transform_name = -e @program_transform_name@
|
||||||
RUBY_INSTALL_NAME = `t='$(program_transform_name)'; echo @RUBY_INSTALL_NAME@ | sed $$t`
|
#RUBY_INSTALL_NAME = `t='$(program_transform_name)'; echo @RUBY_INSTALL_NAME@ | sed $$t`
|
||||||
|
|
||||||
prefix = @prefix@
|
prefix = @prefix@
|
||||||
exec_prefix = @exec_prefix@
|
exec_prefix = @exec_prefix@
|
||||||
libdir = @libdir@
|
libdir = @libdir@
|
||||||
pkglibdir = $(libdir)/$(RUBY_INSTALL_NAME)/@MAJOR@.@MINOR@
|
#pkglibdir = $(libdir)/$(RUBY_INSTALL_NAME)/@MAJOR@.@MINOR@
|
||||||
|
pkglibdir = $(libdir)/ruby/@MAJOR@.@MINOR@
|
||||||
archdir = $(pkglibdir)/@arch@
|
archdir = $(pkglibdir)/@arch@
|
||||||
@SET_MAKE@
|
@SET_MAKE@
|
||||||
|
|
||||||
|
@ -560,9 +561,9 @@ if $extlist.size > 0
|
||||||
system format('make ruby@binsuffix@ EXTOBJS="%s" EXTLIBS="%s"', $extobjs, $extlibs)
|
system format('make ruby@binsuffix@ EXTOBJS="%s" EXTLIBS="%s"', $extobjs, $extlibs)
|
||||||
else
|
else
|
||||||
Dir.chdir ".."
|
Dir.chdir ".."
|
||||||
if older("ruby@binsuffix@", "miniruby@binsuffix@")
|
if older("@RUBY_INSTALL_NAME@@binsuffix@", "miniruby@binsuffix@")
|
||||||
`rm -f ruby@binsuffix@`
|
`rm -f @RUBY_INSTALL_NAME@@binsuffix@`
|
||||||
system("make ruby@binsuffix@")
|
system("make @RUBY_INSTALL_NAME@@binsuffix@")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,8 @@ end
|
||||||
ruby_install_name = CONFIG["ruby_install_name"]
|
ruby_install_name = CONFIG["ruby_install_name"]
|
||||||
bindir = destdir+CONFIG["bindir"]
|
bindir = destdir+CONFIG["bindir"]
|
||||||
libdir = destdir+CONFIG["libdir"]
|
libdir = destdir+CONFIG["libdir"]
|
||||||
pkglibdir = libdir + "/" + ruby_install_name+"/"+CONFIG["MAJOR"]+"."+CONFIG["MINOR"]
|
#pkglibdir = libdir + "/" + ruby_install_name+"/"+CONFIG["MAJOR"]+"."+CONFIG["MINOR"]
|
||||||
|
pkglibdir = libdir + "/ruby/"+CONFIG["MAJOR"]+"."+CONFIG["MINOR"]
|
||||||
archdir = pkglibdir + "/" + CONFIG["arch"]
|
archdir = pkglibdir + "/" + CONFIG["arch"]
|
||||||
mandir = destdir+CONFIG["mandir"] + "/man1"
|
mandir = destdir+CONFIG["mandir"] + "/man1"
|
||||||
wdir = Dir.getwd
|
wdir = Dir.getwd
|
||||||
|
|
70
io.c
70
io.c
|
@ -1088,6 +1088,39 @@ rb_io_mode_flags2(mode)
|
||||||
return flags;
|
return flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char*
|
||||||
|
rb_io_flags_mode(flags)
|
||||||
|
int flags;
|
||||||
|
{
|
||||||
|
static char mode[4];
|
||||||
|
char *p = mode;
|
||||||
|
|
||||||
|
switch (flags & (O_RDONLY|O_WRONLY|O_RDWR)) {
|
||||||
|
case O_RDONLY:
|
||||||
|
*p++ = 'r';
|
||||||
|
break;
|
||||||
|
case O_WRONLY:
|
||||||
|
*p++ = 'w';
|
||||||
|
break;
|
||||||
|
case O_RDWR:
|
||||||
|
*p++ = 'w';
|
||||||
|
*p++ = '+';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
*p++ = '\0';
|
||||||
|
#ifdef O_BINARY
|
||||||
|
if (flags & O_BINARY) {
|
||||||
|
if (mode[1] == '+') {
|
||||||
|
mode[1] = 'b'; mode[2] = '+'; mode[3] = '\0';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
mode[1] = 'b'; mode[2] = '\0';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return mode;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
rb_open(fname, flag, mode)
|
rb_open(fname, flag, mode)
|
||||||
char *fname;
|
char *fname;
|
||||||
|
@ -1171,6 +1204,12 @@ rb_file_sysopen(fname, flags, mode)
|
||||||
char *fname;
|
char *fname;
|
||||||
int flags, mode;
|
int flags, mode;
|
||||||
{
|
{
|
||||||
|
#ifdef USE_CWGUSI
|
||||||
|
if (mode != 0666) {
|
||||||
|
rb_warn("can't specify file mode on this platform");
|
||||||
|
}
|
||||||
|
return rb_file_open(fname, rb_io_flags_mode(flags));
|
||||||
|
#else
|
||||||
OpenFile *fptr;
|
OpenFile *fptr;
|
||||||
int fd;
|
int fd;
|
||||||
char *m;
|
char *m;
|
||||||
|
@ -1185,6 +1224,7 @@ rb_file_sysopen(fname, flags, mode)
|
||||||
rb_obj_call_init((VALUE)port);
|
rb_obj_call_init((VALUE)port);
|
||||||
|
|
||||||
return (VALUE)port;
|
return (VALUE)port;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined (NT) || defined(DJGPP) || defined(__CYGWIN32__) || defined(__human68k__)
|
#if defined (NT) || defined(DJGPP) || defined(__CYGWIN32__) || defined(__human68k__)
|
||||||
|
@ -1476,33 +1516,7 @@ rb_f_open(argc, argv)
|
||||||
mode = "r";
|
mode = "r";
|
||||||
}
|
}
|
||||||
else if (FIXNUM_P(pmode)) {
|
else if (FIXNUM_P(pmode)) {
|
||||||
int flags = FIX2INT(pmode);
|
mode = rb_io_flags_mode(FIX2INT(pmode));
|
||||||
char *p;
|
|
||||||
|
|
||||||
mode = p = ALLOCA_N(char, 4);
|
|
||||||
switch (flags & (O_RDONLY|O_WRONLY|O_RDWR)) {
|
|
||||||
case O_RDONLY:
|
|
||||||
*p++ = 'r';
|
|
||||||
break;
|
|
||||||
case O_WRONLY:
|
|
||||||
*p++ = 'w';
|
|
||||||
break;
|
|
||||||
case O_RDWR:
|
|
||||||
*p++ = 'w';
|
|
||||||
*p++ = '+';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
*p++ = '\0';
|
|
||||||
#ifdef O_BINARY
|
|
||||||
if (flags & O_BINARY) {
|
|
||||||
if (mode[1] == '+') {
|
|
||||||
mode[1] = 'b'; mode[2] = '+'; mode[3] = '\0';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
mode[1] = 'b'; mode[2] = '\0';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int len;
|
int len;
|
||||||
|
@ -1513,7 +1527,7 @@ rb_f_open(argc, argv)
|
||||||
rb_raise(rb_eArgError, "illegal access mode %s", mode);
|
rb_raise(rb_eArgError, "illegal access mode %s", mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
port = pipe_open(RSTRING(pname)->ptr, mode);
|
port = pipe_open(RSTRING(pname)->ptr+1, mode);
|
||||||
if (rb_iterator_p()) {
|
if (rb_iterator_p()) {
|
||||||
return rb_ensure(rb_yield, port, rb_io_close, port);
|
return rb_ensure(rb_yield, port, rb_io_close, port);
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,11 @@
|
||||||
# CGI.tag("HR")
|
# CGI.tag("HR")
|
||||||
# }
|
# }
|
||||||
# }
|
# }
|
||||||
|
#
|
||||||
|
# print HTTP header and strings to STDOUT
|
||||||
|
# CGI.print{ "string" } # add HTTP header "Content-Type: text/html"
|
||||||
|
# CGI.print("Content-Type: text/plain"){ "string" }
|
||||||
|
# CGI.print("HTTP/1.0 200 OK", "Content-Type: text/html"){ "string" }
|
||||||
|
|
||||||
|
|
||||||
# if running on Windows(IIS or PWS) then change cwd.
|
# if running on Windows(IIS or PWS) then change cwd.
|
||||||
|
@ -150,25 +155,33 @@ class CGI < SimpleDelegator
|
||||||
(iterator? ? yield.to_s + "</" + escapeHTML(element) + ">" : "")
|
(iterator? ? yield.to_s + "</" + escapeHTML(element) + ">" : "")
|
||||||
end
|
end
|
||||||
|
|
||||||
def CGI.message(msg, title = "", header = ["Content-Type: text/html"])
|
def CGI.print(*header)
|
||||||
print CGI.header(*header)
|
header.push("Content-Type: text/html") if header.empty?
|
||||||
print "<html><head><title>"
|
STDOUT.print CGI.header(*header) + yield.to_s
|
||||||
print title
|
end
|
||||||
print "</title></head><body>\n"
|
|
||||||
print msg
|
def CGI.message(message, title = "", header = ["Content-Type: text/html"])
|
||||||
print "</body></html>\n"
|
if message.kind_of?(Hash)
|
||||||
|
title = message['title']
|
||||||
|
header = message['header']
|
||||||
|
message = message['body']
|
||||||
|
end
|
||||||
|
CGI.print(*header){
|
||||||
|
CGI.tag("HTML"){
|
||||||
|
CGI.tag("HEAD"){ CGI.tag("TITLE"){ title } } +
|
||||||
|
CGI.tag("BODY"){ message }
|
||||||
|
}
|
||||||
|
}
|
||||||
TRUE
|
TRUE
|
||||||
end
|
end
|
||||||
|
|
||||||
def CGI.error
|
def CGI.error
|
||||||
m = $!.to_s.dup
|
CGI.message({'title'=>'ERROR', 'body'=>
|
||||||
m.gsub!(/&/, '&')
|
CGI.tag("PRE"){
|
||||||
m.gsub!(/</, '<')
|
"ERROR: " + CGI.tag("STRONG"){ escapeHTML($!.to_s) } + "\n" +
|
||||||
m.gsub!(/>/, '>')
|
escapeHTML($@.join("\n"))
|
||||||
msgs = ["<pre>ERROR: <strong>#{m}</strong>"]
|
}
|
||||||
msgs << $@
|
})
|
||||||
msgs << "</pre>"
|
|
||||||
CGI.message(msgs.join("\n"), "ERROR")
|
|
||||||
exit
|
exit
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
24
lib/date2.rb
24
lib/date2.rb
|
@ -1,11 +1,11 @@
|
||||||
# date.rb: Written by Tadayoshi Funaba 1998
|
# date.rb: Written by Tadayoshi Funaba 1998, 1999
|
||||||
# $Id: date.rb,v 1.4 1998/06/01 12:52:33 tadf Exp $
|
# $Id: date.rb,v 1.5 1999/02/06 08:51:56 tadf Exp $
|
||||||
|
|
||||||
class Date
|
class Date
|
||||||
|
|
||||||
include Comparable
|
include Comparable
|
||||||
|
|
||||||
MONTHNAMES = [ '', 'January', 'February', 'March', 'April', 'May', 'June',
|
MONTHNAMES = [ nil, 'January', 'February', 'March', 'April', 'May', 'June',
|
||||||
'July', 'August', 'September', 'October', 'November', 'December' ]
|
'July', 'August', 'September', 'October', 'November', 'December' ]
|
||||||
|
|
||||||
DAYNAMES = [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday',
|
DAYNAMES = [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday',
|
||||||
|
@ -162,26 +162,24 @@ class Date
|
||||||
end
|
end
|
||||||
|
|
||||||
def + (other)
|
def + (other)
|
||||||
if other.kind_of? Numeric then
|
case other
|
||||||
return Date.new(@jd + other, @gs)
|
when Numeric; return Date.new(@jd + other, @gs)
|
||||||
end
|
end
|
||||||
fail TypeError, 'expected numeric'
|
fail TypeError, 'expected numeric'
|
||||||
end
|
end
|
||||||
|
|
||||||
def - (other)
|
def - (other)
|
||||||
if other.kind_of? Numeric then
|
case other
|
||||||
return Date.new(@jd - other, @gs)
|
when Numeric; return Date.new(@jd - other, @gs)
|
||||||
elsif other.kind_of? Date then
|
when Date; return @jd - other.jd
|
||||||
return @jd - other.jd
|
|
||||||
end
|
end
|
||||||
fail TypeError, 'expected numeric or date'
|
fail TypeError, 'expected numeric or date'
|
||||||
end
|
end
|
||||||
|
|
||||||
def <=> (other)
|
def <=> (other)
|
||||||
if other.kind_of? Numeric then
|
case other
|
||||||
return @jd <=> other
|
when Numeric; return @jd <=> other
|
||||||
elsif other.kind_of? Date then
|
when Date; return @jd <=> other.jd
|
||||||
return @jd <=> other.jd
|
|
||||||
end
|
end
|
||||||
fail TypeError, 'expected numeric or date'
|
fail TypeError, 'expected numeric or date'
|
||||||
end
|
end
|
||||||
|
|
|
@ -31,7 +31,8 @@ if File.exist?($config_cache) then
|
||||||
end
|
end
|
||||||
|
|
||||||
$srcdir = CONFIG["srcdir"]
|
$srcdir = CONFIG["srcdir"]
|
||||||
$libdir = CONFIG["libdir"]+"/"+CONFIG["ruby_install_name"]
|
#$libdir = CONFIG["libdir"]+"/"+CONFIG["ruby_install_name"]
|
||||||
|
$libdir = CONFIG["libdir"]+"/ruby"
|
||||||
$libdir += "/"+CONFIG["MAJOR"]+"."+CONFIG["MINOR"]
|
$libdir += "/"+CONFIG["MAJOR"]+"."+CONFIG["MINOR"]
|
||||||
$archdir = $libdir+"/"+CONFIG["arch"]
|
$archdir = $libdir+"/"+CONFIG["arch"]
|
||||||
$install = CONFIG["INSTALL_PROGRAM"]
|
$install = CONFIG["INSTALL_PROGRAM"]
|
||||||
|
|
11
numeric.c
11
numeric.c
|
@ -13,6 +13,9 @@
|
||||||
#include "ruby.h"
|
#include "ruby.h"
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#ifdef __FreeBSD__
|
||||||
|
#include <floatingpoint.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
static ID coerce;
|
static ID coerce;
|
||||||
static ID to_i;
|
static ID to_i;
|
||||||
|
@ -985,15 +988,13 @@ fix_pow(x, y)
|
||||||
|
|
||||||
b = FIX2LONG(y);
|
b = FIX2LONG(y);
|
||||||
if (b == 0) return INT2FIX(1);
|
if (b == 0) return INT2FIX(1);
|
||||||
|
if (b == 1) return x;
|
||||||
a = FIX2LONG(x);
|
a = FIX2LONG(x);
|
||||||
if (b > 0) {
|
if (b > 0) {
|
||||||
return rb_big_pow(rb_int2big(a), y);
|
return rb_big_pow(rb_int2big(a), y);
|
||||||
}
|
}
|
||||||
return rb_float_new(pow((double)a, (double)b));
|
return rb_float_new(pow((double)a, (double)b));
|
||||||
}
|
}
|
||||||
else if (NIL_P(y)) {
|
|
||||||
return INT2FIX(1);
|
|
||||||
}
|
|
||||||
return rb_num_coerce_bin(x, y);
|
return rb_num_coerce_bin(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1402,6 +1403,10 @@ fix_zero_p(num)
|
||||||
void
|
void
|
||||||
Init_Numeric()
|
Init_Numeric()
|
||||||
{
|
{
|
||||||
|
#ifdef __FreeBSD__
|
||||||
|
/* allow divide by zero -- Inf */
|
||||||
|
fpsetmask(fpgetmask() & ~(FP_X_DZ|FP_X_INV));
|
||||||
|
#endif
|
||||||
coerce = rb_intern("coerce");
|
coerce = rb_intern("coerce");
|
||||||
to_i = rb_intern("to_i");
|
to_i = rb_intern("to_i");
|
||||||
|
|
||||||
|
|
4
parse.c
4
parse.c
|
@ -5719,7 +5719,7 @@ retry:
|
||||||
yylval.val = rb_str2inum(tok(), 2);
|
yylval.val = rb_str2inum(tok(), 2);
|
||||||
return tINTEGER;
|
return tINTEGER;
|
||||||
}
|
}
|
||||||
else if (c >= '0' && c <= '7' || c == '_') {
|
if (c >= '0' && c <= '7' || c == '_') {
|
||||||
/* octal */
|
/* octal */
|
||||||
do {
|
do {
|
||||||
if (c == '_') continue;
|
if (c == '_') continue;
|
||||||
|
@ -5731,7 +5731,7 @@ retry:
|
||||||
yylval.val = rb_str2inum(tok(), 8);
|
yylval.val = rb_str2inum(tok(), 8);
|
||||||
return tINTEGER;
|
return tINTEGER;
|
||||||
}
|
}
|
||||||
else if (c > '7' && c <= '9') {
|
if (c > '7' && c <= '9') {
|
||||||
yyerror("Illegal octal digit");
|
yyerror("Illegal octal digit");
|
||||||
}
|
}
|
||||||
else if (c == '.') {
|
else if (c == '.') {
|
||||||
|
|
4
parse.y
4
parse.y
|
@ -2808,7 +2808,7 @@ retry:
|
||||||
yylval.val = rb_str2inum(tok(), 2);
|
yylval.val = rb_str2inum(tok(), 2);
|
||||||
return tINTEGER;
|
return tINTEGER;
|
||||||
}
|
}
|
||||||
else if (c >= '0' && c <= '7' || c == '_') {
|
if (c >= '0' && c <= '7' || c == '_') {
|
||||||
/* octal */
|
/* octal */
|
||||||
do {
|
do {
|
||||||
if (c == '_') continue;
|
if (c == '_') continue;
|
||||||
|
@ -2820,7 +2820,7 @@ retry:
|
||||||
yylval.val = rb_str2inum(tok(), 8);
|
yylval.val = rb_str2inum(tok(), 8);
|
||||||
return tINTEGER;
|
return tINTEGER;
|
||||||
}
|
}
|
||||||
else if (c > '7' && c <= '9') {
|
if (c > '7' && c <= '9') {
|
||||||
yyerror("Illegal octal digit");
|
yyerror("Illegal octal digit");
|
||||||
}
|
}
|
||||||
else if (c == '.') {
|
else if (c == '.') {
|
||||||
|
|
14
regex.c
14
regex.c
|
@ -2069,7 +2069,16 @@ re_compile_pattern(pattern, size, bufp)
|
||||||
laststart++;
|
laststart++;
|
||||||
EXTRACT_NUMBER_AND_INCR(mcnt, laststart);
|
EXTRACT_NUMBER_AND_INCR(mcnt, laststart);
|
||||||
if (mcnt == 4 && *laststart == anychar) {
|
if (mcnt == 4 && *laststart == anychar) {
|
||||||
|
switch ((enum regexpcode)laststart[4]) {
|
||||||
|
case jump_n:
|
||||||
|
case finalize_jump:
|
||||||
|
case maybe_finalize_jump:
|
||||||
|
case jump:
|
||||||
|
case jump_past_alt:
|
||||||
|
case dummy_failure_jump:
|
||||||
bufp->options |= RE_OPTIMIZE_ANCHOR;
|
bufp->options |= RE_OPTIMIZE_ANCHOR;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (*laststart == charset || *laststart == charset_not) {
|
else if (*laststart == charset || *laststart == charset_not) {
|
||||||
p0 = laststart;
|
p0 = laststart;
|
||||||
|
@ -3692,6 +3701,11 @@ re_match(bufp, string_arg, size, pos, regs)
|
||||||
because didn't fail. Also remove the register information
|
because didn't fail. Also remove the register information
|
||||||
put on by the on_failure_jump. */
|
put on by the on_failure_jump. */
|
||||||
case finalize_jump:
|
case finalize_jump:
|
||||||
|
if (stackp[-2] == d) {
|
||||||
|
p = stackp[-3];
|
||||||
|
POP_FAILURE_POINT();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
POP_FAILURE_POINT();
|
POP_FAILURE_POINT();
|
||||||
/* Note fall through. */
|
/* Note fall through. */
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,15 @@
|
||||||
#! ./miniruby -I.
|
#! ./miniruby -I.
|
||||||
|
|
||||||
|
x = ENV["LD_LIBRARY_PATH"]
|
||||||
|
x = x ? x+":." : "."
|
||||||
|
ENV["LD_LIBRARY_PATH"] = x
|
||||||
|
|
||||||
require 'rbconfig'
|
require 'rbconfig'
|
||||||
include Config
|
include Config
|
||||||
|
|
||||||
$stderr.reopen($stdout)
|
$stderr.reopen($stdout)
|
||||||
error = ''
|
error = ''
|
||||||
`./ruby #{CONFIG["srcdir"]}/sample/test.rb`.each do |line|
|
`./#{CONFIG["ruby_install_name"]} #{CONFIG["srcdir"]}/sample/test.rb`.each do |line|
|
||||||
if line =~ /^end of test/
|
if line =~ /^end of test/
|
||||||
print "test succeeded\n"
|
print "test succeeded\n"
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#! /usr/local/bin/ruby
|
#! /usr/local/bin/ruby
|
||||||
|
|
||||||
# cal.rb (bsd compatible version): Written by Tadayoshi Funaba 1998
|
# cal.rb (bsd compatible version): Written by Tadayoshi Funaba 1998, 1999
|
||||||
# $Id: bsdcal.rb,v 1.2 1998/12/01 13:47:40 tadf Exp $
|
# $Id: bsdcal.rb,v 1.3 1999/02/06 08:52:21 tadf Exp $
|
||||||
|
|
||||||
require 'date2'
|
require 'date2'
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ def zip(xs)
|
||||||
yr
|
yr
|
||||||
end
|
end
|
||||||
|
|
||||||
while /^-(.*)$/no =~ $*[0]
|
while /^-([^-].*)$/no =~ $*[0]
|
||||||
a = $1
|
a = $1
|
||||||
if /^c(.+)?$/no =~ a then
|
if /^c(.+)?$/no =~ a then
|
||||||
if $1 then
|
if $1 then
|
||||||
|
@ -90,6 +90,7 @@ while /^-(.*)$/no =~ $*[0]
|
||||||
end
|
end
|
||||||
$*.shift
|
$*.shift
|
||||||
end
|
end
|
||||||
|
$*.shift if /^--/no =~ $*[0]
|
||||||
usage if (gs = $tab[$cc]).nil?
|
usage if (gs = $tab[$cc]).nil?
|
||||||
case $*.length
|
case $*.length
|
||||||
when 0
|
when 0
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/local/bin/ruby
|
#!/usr/bin/env ruby
|
||||||
|
|
||||||
if ARGV[0] == "-c"
|
if ARGV[0] == "-c"
|
||||||
out_stdout = 1
|
out_stdout = 1
|
||||||
|
@ -18,7 +18,7 @@ while gets()
|
||||||
out = open($file, "w") if $file != ""
|
out = open($file, "w") if $file != ""
|
||||||
end
|
end
|
||||||
out.binmode
|
out.binmode
|
||||||
next
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
#define RUBY_VERSION "1.3.1"
|
#define RUBY_VERSION "1.3.1"
|
||||||
#define VERSION_DATE "99/02/09"
|
#define VERSION_DATE "99/02/10"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue