mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
2000-03-06
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b014cc337e
commit
d7b8e448bf
18 changed files with 127 additions and 67 deletions
27
ChangeLog
27
ChangeLog
|
@ -1,3 +1,30 @@
|
||||||
|
Mon Mar 6 12:28:37 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
|
||||||
|
|
||||||
|
* ext/socket/socket.c (ip_addrsetup): should check length of hostname.
|
||||||
|
|
||||||
|
* ext/socket/socket.c (ip_addrsetup): check newline at the end of
|
||||||
|
hostname. These fixes suggested by Muvaw Pnazte <bugathlon@yahoo.com>.
|
||||||
|
|
||||||
|
Sun Mar 5 20:35:45 2000 WATANABE Hirofumi <eban@os.rim.or.jp>
|
||||||
|
|
||||||
|
* ext/Win32API/Win32API.c (Win32API_initialize): should call
|
||||||
|
LoadLibrary() everytime and should assign the hdll to Win32API
|
||||||
|
object(protect the hdll from GC).
|
||||||
|
|
||||||
|
Sun Mar 5 18:49:06 2000 Nakada.Nobuyoshi <nobu.nokada@softhome.net>
|
||||||
|
|
||||||
|
* misc/ruby-mode.el (ruby-parse-region): not treat method `begin'
|
||||||
|
and `end' as reserved words.
|
||||||
|
|
||||||
|
* misc/ruby-mode.el (ruby-font-lock-docs): ignore after `=begin'
|
||||||
|
and `=end'.
|
||||||
|
|
||||||
|
* misc/ruby-mode.el (ruby-font-lock-keywords, hilit-set-mode-patterns):
|
||||||
|
added `yield' to keywords.
|
||||||
|
|
||||||
|
* misc/ruby-mode.el (ruby-font-lock-keywords, hilit-set-mode-patterns):
|
||||||
|
matches keywords at end of buffer.
|
||||||
|
|
||||||
Tue Feb 29 01:08:26 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
|
Tue Feb 29 01:08:26 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
|
||||||
|
|
||||||
* range.c (range_initialize): initialization done in `initialize';
|
* range.c (range_initialize): initialization done in `initialize';
|
||||||
|
|
13
README.EXT
13
README.EXT
|
@ -67,7 +67,7 @@ data-types, the code will be like:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* raise exception */
|
/* raise exception */
|
||||||
Fail("not valid value");
|
rb_raise(rb_eTypeError, "not valid value");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,6 +203,11 @@ To define class or module, use functions below:
|
||||||
These functions return the newly created class or module. You may
|
These functions return the newly created class or module. You may
|
||||||
want to save this reference into the variable to use later.
|
want to save this reference into the variable to use later.
|
||||||
|
|
||||||
|
To define nested class or module, use functions below:
|
||||||
|
|
||||||
|
VALUE rb_define_class_under(VALUE outer, char *name, VALUE super)
|
||||||
|
VALUE rb_define_module_under(VALUE outer, char *name)
|
||||||
|
|
||||||
2.1.2 Method/singleton method definition
|
2.1.2 Method/singleton method definition
|
||||||
|
|
||||||
To define methods or singleton methods, use functions below:
|
To define methods or singleton methods, use functions below:
|
||||||
|
@ -389,7 +394,7 @@ DATA), use Data_Wrap_Struct().
|
||||||
|
|
||||||
Data_Wrap_Struct(klass, mark, free, ptr)
|
Data_Wrap_Struct(klass, mark, free, ptr)
|
||||||
|
|
||||||
Data_Wrap_Struct() returns a created DATA object. The class argument
|
Data_Wrap_Struct() returns a created DATA object. The klass argument
|
||||||
is the class for the DATA object. The mark argument is the function
|
is the class for the DATA object. The mark argument is the function
|
||||||
to mark Ruby objects pointed by this data. The free argument is the
|
to mark Ruby objects pointed by this data. The free argument is the
|
||||||
function to free the pointer allocation. The functions, mark and
|
function to free the pointer allocation. The functions, mark and
|
||||||
|
@ -657,8 +662,6 @@ ruby language core
|
||||||
utility functions
|
utility functions
|
||||||
|
|
||||||
dln.c
|
dln.c
|
||||||
fnmatch.c
|
|
||||||
glob.c
|
|
||||||
regex.c
|
regex.c
|
||||||
st.c
|
st.c
|
||||||
util.c
|
util.c
|
||||||
|
@ -681,9 +684,11 @@ class library
|
||||||
file.c
|
file.c
|
||||||
hash.c
|
hash.c
|
||||||
io.c
|
io.c
|
||||||
|
marshal.c
|
||||||
math.c
|
math.c
|
||||||
numeric.c
|
numeric.c
|
||||||
pack.c
|
pack.c
|
||||||
|
prec.c
|
||||||
process.c
|
process.c
|
||||||
random.c
|
random.c
|
||||||
range.c
|
range.c
|
||||||
|
|
|
@ -73,7 +73,7 @@ ruby.h
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* 例外を発生させる */
|
/* 例外を発生させる */
|
||||||
TypeError("not valid value");
|
rb_raise(rb_eTypeError, "not valid value");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -252,7 +252,7 @@ Ruby
|
||||||
|
|
||||||
メソッドや特異メソッドを定義するには以下の関数を使います.
|
メソッドや特異メソッドを定義するには以下の関数を使います.
|
||||||
|
|
||||||
void rb_define_method(VALUE class, char *name,
|
void rb_define_method(VALUE klass, char *name,
|
||||||
VALUE (*func)(), int argc)
|
VALUE (*func)(), int argc)
|
||||||
|
|
||||||
void rb_define_singleton_method(VALUE object, char *name,
|
void rb_define_singleton_method(VALUE object, char *name,
|
||||||
|
@ -277,7 +277,7 @@ argc
|
||||||
メソッドを定義する関数はもう二つあります.ひとつはprivateメ
|
メソッドを定義する関数はもう二つあります.ひとつはprivateメ
|
||||||
ソッドを定義する関数で,引数はrb_define_method()と同じです.
|
ソッドを定義する関数で,引数はrb_define_method()と同じです.
|
||||||
|
|
||||||
void rb_define_private_method(VALUE class, char *name,
|
void rb_define_private_method(VALUE klass, char *name,
|
||||||
VALUE (*func)(), int argc)
|
VALUE (*func)(), int argc)
|
||||||
|
|
||||||
privateメソッドとは関数形式でしか呼び出すことの出来ないメソッ
|
privateメソッドとは関数形式でしか呼び出すことの出来ないメソッ
|
||||||
|
@ -312,7 +312,7 @@ private
|
||||||
拡張ライブラリが必要な定数はあらかじめ定義しておいた方が良い
|
拡張ライブラリが必要な定数はあらかじめ定義しておいた方が良い
|
||||||
でしょう.定数を定義する関数は二つあります.
|
でしょう.定数を定義する関数は二つあります.
|
||||||
|
|
||||||
void rb_define_const(VALUE class, char *name, VALUE val)
|
void rb_define_const(VALUE klass, char *name, VALUE val)
|
||||||
void rb_define_global_const(char *name, VALUE val)
|
void rb_define_global_const(char *name, VALUE val)
|
||||||
|
|
||||||
前者は特定のクラス/モジュールに属する定数を定義するもの,後
|
前者は特定のクラス/モジュールに属する定数を定義するもの,後
|
||||||
|
@ -467,11 +467,11 @@ Ruby
|
||||||
Dataオブジェクトを生成して構造体をRubyオブジェクトにカプセル
|
Dataオブジェクトを生成して構造体をRubyオブジェクトにカプセル
|
||||||
化するためには,以下のマクロを使います.
|
化するためには,以下のマクロを使います.
|
||||||
|
|
||||||
Data_Wrap_Struct(class,mark,free,ptr)
|
Data_Wrap_Struct(klass, mark, free, ptr)
|
||||||
|
|
||||||
このマクロの戻り値は生成されたDataオブジェクトです.
|
このマクロの戻り値は生成されたDataオブジェクトです.
|
||||||
|
|
||||||
classはこのDataオブジェクトのクラスです.ptrはカプセル化する
|
klassはこのDataオブジェクトのクラスです.ptrはカプセル化する
|
||||||
Cの構造体へのポインタです.markはこの構造体がRubyのオブジェ
|
Cの構造体へのポインタです.markはこの構造体がRubyのオブジェ
|
||||||
クトへの参照がある時に使う関数です.そのような参照を含まない
|
クトへの参照がある時に使う関数です.そのような参照を含まない
|
||||||
時には0を指定します.
|
時には0を指定します.
|
||||||
|
@ -484,11 +484,11 @@ free
|
||||||
Cの構造体の割当とDataオブジェクトの生成を同時に行うマクロと
|
Cの構造体の割当とDataオブジェクトの生成を同時に行うマクロと
|
||||||
して以下のものが提供されています.
|
して以下のものが提供されています.
|
||||||
|
|
||||||
Data_Make_Struct(class, type, mark, free, sval)
|
Data_Make_Struct(klass, type, mark, free, sval)
|
||||||
|
|
||||||
このマクロの戻り値は生成されたDataオブジェクトです.
|
このマクロの戻り値は生成されたDataオブジェクトです.
|
||||||
|
|
||||||
class, mark, freeはData_Wrap_Structと同じ働きをします.type
|
klass, mark, freeはData_Wrap_Structと同じ働きをします.type
|
||||||
は割り当てるC構造体の型です.割り当てられた構造体は変数sval
|
は割り当てるC構造体の型です.割り当てられた構造体は変数sval
|
||||||
に代入されます.この変数の型は (type*) である必要があります.
|
に代入されます.この変数の型は (type*) である必要があります.
|
||||||
|
|
||||||
|
@ -588,7 +588,7 @@ struct dbmdata {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
obj = Data_Make_Struct(class,struct dbmdata,0,free_dbm,dbmp);
|
obj = Data_Make_Struct(klass, struct dbmdata, 0, free_dbm, dbmp);
|
||||||
--
|
--
|
||||||
|
|
||||||
ここではdbmstruct構造体へのポインタをDataにカプセル化してい
|
ここではdbmstruct構造体へのポインタをDataにカプセル化してい
|
||||||
|
@ -633,10 +633,10 @@ fdbm_delete(obj, keystr)
|
||||||
|
|
||||||
--
|
--
|
||||||
static VALUE
|
static VALUE
|
||||||
fdbm_s_open(argc, argv, class)
|
fdbm_s_open(argc, argv, klass)
|
||||||
int argc;
|
int argc;
|
||||||
VALUE *argv;
|
VALUE *argv;
|
||||||
VALUE class;
|
VALUE klass;
|
||||||
{
|
{
|
||||||
:
|
:
|
||||||
if (rb_scan_args(argc, argv, "11", &file, &vmode) == 1) {
|
if (rb_scan_args(argc, argv, "11", &file, &vmode) == 1) {
|
||||||
|
@ -793,8 +793,6 @@ Ruby
|
||||||
ユーティリティ関数
|
ユーティリティ関数
|
||||||
|
|
||||||
dln.c
|
dln.c
|
||||||
fnmatch.c
|
|
||||||
glob.c
|
|
||||||
regex.c
|
regex.c
|
||||||
st.c
|
st.c
|
||||||
util.c
|
util.c
|
||||||
|
@ -821,6 +819,7 @@ Ruby
|
||||||
math.c
|
math.c
|
||||||
numeric.c
|
numeric.c
|
||||||
pack.c
|
pack.c
|
||||||
|
prec.c
|
||||||
process.c
|
process.c
|
||||||
random.c
|
random.c
|
||||||
range.c
|
range.c
|
||||||
|
@ -860,7 +859,7 @@ Qfalse
|
||||||
|
|
||||||
** Cデータのカプセル化
|
** Cデータのカプセル化
|
||||||
|
|
||||||
Data_Wrap_Struct(VALUE class, void (*mark)(), void (*free)(), void *sval)
|
Data_Wrap_Struct(VALUE klass, void (*mark)(), void (*free)(), void *sval)
|
||||||
|
|
||||||
Cの任意のポインタをカプセル化したRubyオブジェクトを返す.こ
|
Cの任意のポインタをカプセル化したRubyオブジェクトを返す.こ
|
||||||
のポインタがRubyからアクセスされなくなった時,freeで指定した
|
のポインタがRubyからアクセスされなくなった時,freeで指定した
|
||||||
|
@ -868,7 +867,7 @@ Data_Wrap_Struct(VALUE class, void (*mark)(), void (*free)(), void *sval)
|
||||||
ジェクトを指している場合,markに指定する関数でマークする必要
|
ジェクトを指している場合,markに指定する関数でマークする必要
|
||||||
がある.
|
がある.
|
||||||
|
|
||||||
Data_Make_Struct(class, type, mark, free, sval)
|
Data_Make_Struct(klass, type, mark, free, sval)
|
||||||
|
|
||||||
type型のメモリをmallocし,変数svalに代入した後,それをカプセ
|
type型のメモリをmallocし,変数svalに代入した後,それをカプセ
|
||||||
ル化したデータを返すマクロ.
|
ル化したデータを返すマクロ.
|
||||||
|
@ -915,7 +914,7 @@ VALUE rb_define_module_under(VALUE module, char *name, VALUE super)
|
||||||
|
|
||||||
新しいRubyモジュールを定義し,moduleの定数として定義する.
|
新しいRubyモジュールを定義し,moduleの定数として定義する.
|
||||||
|
|
||||||
void rb_include_module(VALUE class, VALUE module)
|
void rb_include_module(VALUE klass, VALUE module)
|
||||||
|
|
||||||
モジュールをインクルードする.classがすでにmoduleをインク
|
モジュールをインクルードする.classがすでにmoduleをインク
|
||||||
ルードしている時には何もしない(多重インクルードの禁止).
|
ルードしている時には何もしない(多重インクルードの禁止).
|
||||||
|
@ -974,7 +973,7 @@ void rb_define_global_const(char *name, VALUE val)
|
||||||
|
|
||||||
** メソッド定義
|
** メソッド定義
|
||||||
|
|
||||||
rb_define_method(VALUE class, char *name, VALUE (*func)(), int argc)
|
rb_define_method(VALUE klass, char *name, VALUE (*func)(), int argc)
|
||||||
|
|
||||||
メソッドを定義する.argcはselfを除く引数の数.argcが-1の時,
|
メソッドを定義する.argcはselfを除く引数の数.argcが-1の時,
|
||||||
関数には引数の数(selfを含まない)を第1引数, 引数の配列を第2
|
関数には引数の数(selfを含まない)を第1引数, 引数の配列を第2
|
||||||
|
@ -982,11 +981,11 @@ rb_define_method(VALUE class, char *name, VALUE (*func)(), int argc)
|
||||||
第1引数がself, 第2引数がargs(argsは引数を含むRubyの配列)と
|
第1引数がself, 第2引数がargs(argsは引数を含むRubyの配列)と
|
||||||
いう形式で与えられる.
|
いう形式で与えられる.
|
||||||
|
|
||||||
rb_define_private_method(VALUE class, char *name, VALUE (*func)(), int argc)
|
rb_define_private_method(VALUE klass, char *name, VALUE (*func)(), int argc)
|
||||||
|
|
||||||
privateメソッドを定義する.引数はrb_define_method()と同じ.
|
privateメソッドを定義する.引数はrb_define_method()と同じ.
|
||||||
|
|
||||||
rb_define_singleton_method(VALUE class, char *name, VALUE (*func)(), int argc)
|
rb_define_singleton_method(VALUE klass, char *name, VALUE (*func)(), int argc)
|
||||||
|
|
||||||
特異メソッドを定義する.引数はrb_define_method()と同じ.
|
特異メソッドを定義する.引数はrb_define_method()と同じ.
|
||||||
|
|
||||||
|
@ -1023,9 +1022,9 @@ char *rb_id2name(ID id)
|
||||||
|
|
||||||
IDに対応する文字列を返す(デバッグ用).
|
IDに対応する文字列を返す(デバッグ用).
|
||||||
|
|
||||||
char *rb_class2name(VALUE class)
|
char *rb_class2name(VALUE klass)
|
||||||
|
|
||||||
classの名前を返す(デバッグ用).classが名前を持たない時には,
|
クラスの名前を返す(デバッグ用).クラスが名前を持たない時には,
|
||||||
祖先を遡って名前を持つクラスの名前を返す.
|
祖先を遡って名前を持つクラスの名前を返す.
|
||||||
|
|
||||||
int rb_respond_to(VALUE obj, ID id)
|
int rb_respond_to(VALUE obj, ID id)
|
||||||
|
@ -1134,7 +1133,6 @@ find_library(lib, func, path...)
|
||||||
|
|
||||||
関数funcを定義しているライブラリlibの存在を -Lpath を追加
|
関数funcを定義しているライブラリlibの存在を -Lpath を追加
|
||||||
しながらチェックする.ライブラリが見付かった時,trueを返す.
|
しながらチェックする.ライブラリが見付かった時,trueを返す.
|
||||||
結果をキャッシュしない.
|
|
||||||
|
|
||||||
have_func(func)
|
have_func(func)
|
||||||
|
|
||||||
|
@ -1150,8 +1148,7 @@ have_header(header)
|
||||||
find_header(header)
|
find_header(header)
|
||||||
|
|
||||||
ヘッダファイルの存在を -Ipath を追加しながらチェックする.
|
ヘッダファイルの存在を -Ipath を追加しながらチェックする.
|
||||||
ヘッダファイルが見付かった時trueを返す.結果をキャッシュし
|
ヘッダファイルが見付かった時trueを返す.
|
||||||
ない.
|
|
||||||
|
|
||||||
create_makefile(target)
|
create_makefile(target)
|
||||||
|
|
||||||
|
|
21
eval.c
21
eval.c
|
@ -4300,6 +4300,27 @@ rb_funcall3(recv, mid, argc, argv)
|
||||||
return rb_call(CLASS_OF(recv), recv, mid, argc, argv, 0);
|
return rb_call(CLASS_OF(recv), recv, mid, argc, argv, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VALUE
|
||||||
|
rb_call_super(argc, argv)
|
||||||
|
int argc;
|
||||||
|
VALUE *argv;
|
||||||
|
{
|
||||||
|
VALUE result;
|
||||||
|
|
||||||
|
if (ruby_frame->last_class == 0) {
|
||||||
|
rb_raise(rb_eNameError, "superclass method `%s' disabled",
|
||||||
|
rb_id2name(ruby_frame->last_func));
|
||||||
|
}
|
||||||
|
|
||||||
|
PUSH_ITER(ruby_iter->iter?ITER_PRE:ITER_NOT);
|
||||||
|
result = rb_call(RCLASS(ruby_frame->last_class)->super,
|
||||||
|
ruby_frame->self, ruby_frame->last_func,
|
||||||
|
argc, argv, 3);
|
||||||
|
POP_ITER();
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
backtrace(lev)
|
backtrace(lev)
|
||||||
int lev;
|
int lev;
|
||||||
|
|
|
@ -52,13 +52,10 @@ Win32API_initialize(self, dllname, proc, import, export)
|
||||||
int len;
|
int len;
|
||||||
int ex;
|
int ex;
|
||||||
|
|
||||||
hdll = GetModuleHandle(RSTRING(dllname)->ptr);
|
|
||||||
if (!hdll) {
|
|
||||||
hdll = LoadLibrary(RSTRING(dllname)->ptr);
|
hdll = LoadLibrary(RSTRING(dllname)->ptr);
|
||||||
if (!hdll)
|
if (!hdll)
|
||||||
rb_raise(rb_eRuntimeError, "LoadLibrary: %s\n", RSTRING(dllname)->ptr);
|
rb_raise(rb_eRuntimeError, "LoadLibrary: %s\n", RSTRING(dllname)->ptr);
|
||||||
Data_Wrap_Struct(self, 0, Win32API_FreeLibrary, hdll);
|
rb_iv_set(self, "__hdll__", Data_Wrap_Struct(self, 0, Win32API_FreeLibrary, hdll));
|
||||||
}
|
|
||||||
hproc = GetProcAddress(hdll, RSTRING(proc)->ptr);
|
hproc = GetProcAddress(hdll, RSTRING(proc)->ptr);
|
||||||
if (!hproc) {
|
if (!hproc) {
|
||||||
str = rb_str_new3(proc);
|
str = rb_str_new3(proc);
|
||||||
|
|
|
@ -424,7 +424,6 @@ window_s_new(class, h, w, top, left)
|
||||||
wclear(window);
|
wclear(window);
|
||||||
win = prep_window(class, window);
|
win = prep_window(class, window);
|
||||||
args[0] = h; args[1] = w; args[2] = top; args[3] = left;
|
args[0] = h; args[1] = w; args[2] = top; args[3] = left;
|
||||||
rb_obj_call_init(win, 4, args);
|
|
||||||
|
|
||||||
return win;
|
return win;
|
||||||
}
|
}
|
||||||
|
@ -448,7 +447,6 @@ window_subwin(obj, h, w, top, left)
|
||||||
NUM2INT(top), NUM2INT(left));
|
NUM2INT(top), NUM2INT(left));
|
||||||
win = prep_window(cWindow, window);
|
win = prep_window(cWindow, window);
|
||||||
args[0] = h; args[1] = w; args[2] = top; args[3] = left;
|
args[0] = h; args[1] = w; args[2] = top; args[3] = left;
|
||||||
rb_obj_call_init(win, 4, args);
|
|
||||||
|
|
||||||
return win;
|
return win;
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,7 +91,6 @@ fdbm_s_open(argc, argv, klass)
|
||||||
obj = Data_Make_Struct(klass,struct dbmdata,0,free_dbm,dbmp);
|
obj = Data_Make_Struct(klass,struct dbmdata,0,free_dbm,dbmp);
|
||||||
dbmp->di_dbm = dbm;
|
dbmp->di_dbm = dbm;
|
||||||
dbmp->di_size = -1;
|
dbmp->di_size = -1;
|
||||||
rb_obj_call_init(obj, argc, argv);
|
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
|
@ -560,7 +560,11 @@ def extmake(target)
|
||||||
elsif $clean
|
elsif $clean
|
||||||
system "#{$make} clean"
|
system "#{$make} clean"
|
||||||
else
|
else
|
||||||
system "#{$make} all" or exit
|
unless system "#{$make} all"
|
||||||
|
if ENV["MAKEFLAGS"] != "k" and ENV["MFLAGS"] != "-k"
|
||||||
|
exit
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if $static
|
if $static
|
||||||
|
|
|
@ -88,7 +88,6 @@ fgdbm_s_open(argc, argv, klass)
|
||||||
obj = Data_Make_Struct(klass,struct dbmdata,0,free_dbm,dbmp);
|
obj = Data_Make_Struct(klass,struct dbmdata,0,free_dbm,dbmp);
|
||||||
dbmp->di_dbm = dbm;
|
dbmp->di_dbm = dbm;
|
||||||
dbmp->di_size = -1;
|
dbmp->di_size = -1;
|
||||||
rb_obj_call_init(obj, argc, argv);
|
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,7 +95,6 @@ md5_new(argc, argv, class)
|
||||||
if (!NIL_P(arg)) {
|
if (!NIL_P(arg)) {
|
||||||
md5_update(obj, arg);
|
md5_update(obj, arg);
|
||||||
}
|
}
|
||||||
rb_obj_call_init(obj, argc, argv);
|
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
|
@ -530,6 +530,9 @@ ip_addrsetup(host, port)
|
||||||
else if (name[0] == '<' && strcmp(name, "<broadcast>") == 0) {
|
else if (name[0] == '<' && strcmp(name, "<broadcast>") == 0) {
|
||||||
mkinetaddr(INADDR_BROADCAST, hbuf, sizeof(hbuf));
|
mkinetaddr(INADDR_BROADCAST, hbuf, sizeof(hbuf));
|
||||||
}
|
}
|
||||||
|
else if (strlen(name) > sizeof(hbuf)-1) {
|
||||||
|
rb_raise(rb_eArgError, "hostname too long (%d)", strlen(name));
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
strcpy(hbuf, name);
|
strcpy(hbuf, name);
|
||||||
}
|
}
|
||||||
|
@ -551,6 +554,9 @@ ip_addrsetup(host, port)
|
||||||
hints.ai_socktype = SOCK_DGRAM;
|
hints.ai_socktype = SOCK_DGRAM;
|
||||||
error = getaddrinfo(hostp, portp, &hints, &res);
|
error = getaddrinfo(hostp, portp, &hints, &res);
|
||||||
if (error) {
|
if (error) {
|
||||||
|
if (hostp && hostp[strlen(hostp)-1] == '\n') {
|
||||||
|
rb_raise(rb_eSocket, "newline at the end of hostname");
|
||||||
|
}
|
||||||
rb_raise(rb_eSocket, "%s", gai_strerror(error));
|
rb_raise(rb_eSocket, "%s", gai_strerror(error));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -648,10 +648,12 @@ convert string charset, and set language to "ja".
|
||||||
=end
|
=end
|
||||||
def Cookie::parse(raw_cookie)
|
def Cookie::parse(raw_cookie)
|
||||||
cookies = Hash.new([])
|
cookies = Hash.new([])
|
||||||
|
return cookies unless raw_cookie
|
||||||
|
|
||||||
raw_cookie.split('; ').each do |pairs|
|
raw_cookie.split('; ').each do |pairs|
|
||||||
name, values = pairs.split('=',2)
|
name, values = pairs.split('=',2)
|
||||||
name = CGI::unescape(name)
|
name = CGI::unescape(name)
|
||||||
|
values ||= ""
|
||||||
values = values.split('&').filter{|v| CGI::unescape(v) }
|
values = values.split('&').filter{|v| CGI::unescape(v) }
|
||||||
if cookies.has_key?(name)
|
if cookies.has_key?(name)
|
||||||
cookies[name].value.push(*values)
|
cookies[name].value.push(*values)
|
||||||
|
@ -877,8 +879,7 @@ convert string charset, and set language to "ja".
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
@cookies = CGI::Cookie::parse((env_table['HTTP_COOKIE'] or
|
@cookies = CGI::Cookie::parse((env_table['HTTP_COOKIE'] or env_table['COOKIE']))
|
||||||
env_table['COOKIE'] or ""))
|
|
||||||
|
|
||||||
end
|
end
|
||||||
private :initialize_query
|
private :initialize_query
|
||||||
|
|
|
@ -52,6 +52,10 @@ class PStore
|
||||||
in_transaction
|
in_transaction
|
||||||
@table[name] = value
|
@table[name] = value
|
||||||
end
|
end
|
||||||
|
def delete(name)
|
||||||
|
in_transaction
|
||||||
|
@table.delete name
|
||||||
|
end
|
||||||
|
|
||||||
def roots
|
def roots
|
||||||
in_transaction
|
in_transaction
|
||||||
|
|
|
@ -40,7 +40,7 @@ class WeakRef<Delegator
|
||||||
ObjectSpace.call_finalizer orig
|
ObjectSpace.call_finalizer orig
|
||||||
ObjectSpace.call_finalizer self
|
ObjectSpace.call_finalizer self
|
||||||
ID_MAP[@__id] = [] unless ID_MAP[@__id]
|
ID_MAP[@__id] = [] unless ID_MAP[@__id]
|
||||||
ID_MAP[@__id].concat self.__id__
|
ID_MAP[@__id].push self.__id__
|
||||||
ID_REV_MAP[self.id] = @__id
|
ID_REV_MAP[self.id] = @__id
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -314,7 +314,9 @@ The variable ruby-indent-level controls the amount of indentation.
|
||||||
(if (or (and (not (bolp))
|
(if (or (and (not (bolp))
|
||||||
(progn
|
(progn
|
||||||
(forward-char -1)
|
(forward-char -1)
|
||||||
(eq ?_ (char-after (point)))))
|
(setq w (char-after (point)))
|
||||||
|
(or (eq ?_ w)
|
||||||
|
(eq ?. w))))
|
||||||
(progn
|
(progn
|
||||||
(goto-char pnt)
|
(goto-char pnt)
|
||||||
(setq w (char-after (point)))
|
(setq w (char-after (point)))
|
||||||
|
@ -339,7 +341,9 @@ The variable ruby-indent-level controls the amount of indentation.
|
||||||
(or (bolp)
|
(or (bolp)
|
||||||
(progn
|
(progn
|
||||||
(forward-char -1)
|
(forward-char -1)
|
||||||
(not (eq ?_ (char-after (point))))))
|
(setq w (char-after (point)))
|
||||||
|
(not (or (eq ?_ w)
|
||||||
|
(eq ?. w)))))
|
||||||
(goto-char pnt)
|
(goto-char pnt)
|
||||||
(setq w (char-after (point)))
|
(setq w (char-after (point)))
|
||||||
(not (eq ?_ w))
|
(not (eq ?_ w))
|
||||||
|
@ -622,12 +626,12 @@ An end of a defun is found by moving forward from the beginning of one."
|
||||||
(setq font-lock-keywords ruby-font-lock-keywords)))
|
(setq font-lock-keywords ruby-font-lock-keywords)))
|
||||||
|
|
||||||
(defun ruby-font-lock-docs (limit)
|
(defun ruby-font-lock-docs (limit)
|
||||||
(if (re-search-forward "^=begin\\s *$" limit t)
|
(if (re-search-forward "^=begin\\(\\s \\|$\\)" limit t)
|
||||||
(let (beg)
|
(let (beg)
|
||||||
(beginning-of-line)
|
(beginning-of-line)
|
||||||
(setq beg (point))
|
(setq beg (point))
|
||||||
(forward-line 1)
|
(forward-line 1)
|
||||||
(if (re-search-forward "^=end\\s *$" limit t)
|
(if (re-search-forward "^=end\\(\\s \\|$\\)" limit t)
|
||||||
(progn
|
(progn
|
||||||
(set-match-data (list beg (point)))
|
(set-match-data (list beg (point)))
|
||||||
t)))))
|
t)))))
|
||||||
|
@ -672,12 +676,13 @@ An end of a defun is found by moving forward from the beginning of one."
|
||||||
"until"
|
"until"
|
||||||
"when"
|
"when"
|
||||||
"while"
|
"while"
|
||||||
|
"yield"
|
||||||
)
|
)
|
||||||
"\\|")
|
"\\|")
|
||||||
"\\)\\>[^_]")
|
"\\)\\>\\([^_]\\|$\\)")
|
||||||
2)
|
2)
|
||||||
;; variables
|
;; variables
|
||||||
'("\\(^\\|[^_:.@$]\\|\\.\\.\\)\\b\\(nil\\|self\\|true\\|false\\)\\b[^_]"
|
'("\\(^\\|[^_:.@$]\\|\\.\\.\\)\\b\\(nil\\|self\\|true\\|false\\)\\b\\([^_]\\|$\\)"
|
||||||
2 font-lock-variable-name-face)
|
2 font-lock-variable-name-face)
|
||||||
;; variables
|
;; variables
|
||||||
'("[$@].\\(\\w\\|_\\)*"
|
'("[$@].\\(\\w\\|_\\)*"
|
||||||
|
@ -708,8 +713,8 @@ An end of a defun is found by moving forward from the beginning of one."
|
||||||
("^\\s *\\(require\\|load\\).*$" nil include)
|
("^\\s *\\(require\\|load\\).*$" nil include)
|
||||||
("^\\s *\\(include\\|alias\\|undef\\).*$" nil decl)
|
("^\\s *\\(include\\|alias\\|undef\\).*$" nil decl)
|
||||||
("^\\s *\\<\\(class\\|def\\|module\\)\\>" "[)\n;]" defun)
|
("^\\s *\\<\\(class\\|def\\|module\\)\\>" "[)\n;]" defun)
|
||||||
("[^_]\\<\\(begin\\|case\\|else\\|elsif\\|end\\|ensure\\|for\\|if\\|unless\\|rescue\\|then\\|when\\|while\\|until\\|do\\)\\>[^_]" 1 defun)
|
("[^_]\\<\\(begin\\|case\\|else\\|elsif\\|end\\|ensure\\|for\\|if\\|unless\\|rescue\\|then\\|when\\|while\\|until\\|do\\|yield\\)\\>\\([^_]\\|$\\)" 1 defun)
|
||||||
("[^_]\\<\\(and\\|break\\|next\\|raise\\|fail\\|in\\|not\\|or\\|redo\\|retry\\|return\\|super\\|yield\\|catch\\|throw\\|self\\|nil\\)\\>[^_]" 1 keyword)
|
("[^_]\\<\\(and\\|break\\|next\\|raise\\|fail\\|in\\|not\\|or\\|redo\\|retry\\|return\\|super\\|yield\\|catch\\|throw\\|self\\|nil\\)\\>\\([^_]\\|$\\)" 1 keyword)
|
||||||
("\\$\\(.\\|\\sw+\\)" nil type)
|
("\\$\\(.\\|\\sw+\\)" nil type)
|
||||||
("[$@].[a-zA-Z_0-9]*" nil struct)
|
("[$@].[a-zA-Z_0-9]*" nil struct)
|
||||||
("^__END__" nil label))))
|
("^__END__" nil label))))
|
||||||
|
|
3
node.h
3
node.h
|
@ -325,9 +325,6 @@ typedef struct RNode {
|
||||||
#define NEW_PREEXE(b) NEW_SCOPE(b)
|
#define NEW_PREEXE(b) NEW_SCOPE(b)
|
||||||
#define NEW_POSTEXE() rb_node_newnode(NODE_POSTEXE,0,0,0)
|
#define NEW_POSTEXE() rb_node_newnode(NODE_POSTEXE,0,0,0)
|
||||||
|
|
||||||
NODE *rb_node_newnode();
|
|
||||||
VALUE rb_method_booundp();
|
|
||||||
|
|
||||||
#define NOEX_PUBLIC 0
|
#define NOEX_PUBLIC 0
|
||||||
#define NOEX_UNDEF 1
|
#define NOEX_UNDEF 1
|
||||||
#define NOEX_CFUNC 1
|
#define NOEX_CFUNC 1
|
||||||
|
|
1
ruby.h
1
ruby.h
|
@ -422,6 +422,7 @@ VALUE rb_funcall __((VALUE, ID, int, ...));
|
||||||
VALUE rb_funcall2 _((VALUE, ID, int, VALUE*));
|
VALUE rb_funcall2 _((VALUE, ID, int, VALUE*));
|
||||||
VALUE rb_funcall3 _((VALUE, ID, int, VALUE*));
|
VALUE rb_funcall3 _((VALUE, ID, int, VALUE*));
|
||||||
int rb_scan_args __((int, VALUE*, const char*, ...));
|
int rb_scan_args __((int, VALUE*, const char*, ...));
|
||||||
|
VALUE rb_call_super _((int, VALUE*));
|
||||||
|
|
||||||
VALUE rb_gv_set _((const char*, VALUE));
|
VALUE rb_gv_set _((const char*, VALUE));
|
||||||
VALUE rb_gv_get _((const char*));
|
VALUE rb_gv_get _((const char*));
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#define RUBY_VERSION "1.5.2"
|
#define RUBY_VERSION "1.5.2"
|
||||||
#define RUBY_RELEASE_DATE "2000-02-29"
|
#define RUBY_RELEASE_DATE "2000-03-06"
|
||||||
#define RUBY_VERSION_CODE 152
|
#define RUBY_VERSION_CODE 152
|
||||||
#define RUBY_RELEASE_CODE 20000229
|
#define RUBY_RELEASE_CODE 20000306
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue