summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-16 01:14:56 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-16 01:14:56 +0000
commit36159149ea41780e0ebc7bbfbfe0edfb8eb78f59 (patch)
tree470fdac13550cd0bf54b08798a3cc5aa94655e84
parente974694c9a33c156c7fe456540467f0a59fa54b3 (diff)
downloadruby-36159149ea41780e0ebc7bbfbfe0edfb8eb78f59.tar.gz
ruby-36159149ea41780e0ebc7bbfbfe0edfb8eb78f59.tar.xz
ruby-36159149ea41780e0ebc7bbfbfe0edfb8eb78f59.zip
* README.EXT, README.EXT.ja (rb_protect, rb_jump_tag): added.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--README.EXT15
-rw-r--r--README.EXT.ja12
3 files changed, 30 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index b67afcf2a..d772b35df 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Wed Sep 16 10:14:54 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * README.EXT, README.EXT.ja (rb_protect, rb_jump_tag): added.
+
Wed Sep 16 10:12:56 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* common.mk (main): makes also encs.
diff --git a/README.EXT b/README.EXT
index 75f52f71c..9917d1b49 100644
--- a/README.EXT
+++ b/README.EXT
@@ -1194,7 +1194,20 @@ exception occurs, from func2 otherwise.
Calls the function func1 with arg1 as the argument, then calls func2
with arg2 if execution terminated. The return value from
-rb_ensure() is that of func1.
+rb_ensure() is that of func1 when no exception occured.
+
+ VALUE rb_protect(VALUE (*func) (VALUE), VALUE arg, int *state)
+
+Calls the function func with arg as the argument. If no exception
+occured during func, it returns the result of func and *state is zero.
+Otherwise, it returns Qnil and sets *state to nonzero. If state is
+NULL, it is not set in both cases.
+
+ void rb_jump_tag(int state)
+
+Continues the exception caught by rb_protect() and rb_eval_string_protect().
+state must be the returned value from those functions. This function
+never return to the caller.
** Exceptions and Errors
diff --git a/README.EXT.ja b/README.EXT.ja
index c6b5dfed9..8cb917977 100644
--- a/README.EXT.ja
+++ b/README.EXT.ja
@@ -1292,6 +1292,18 @@ VALUE rb_ensure(VALUE (*func1)(), VALUE arg1, void (*func2)(), VALUE arg2)
発生しても) func2をarg2を引数として実行する.戻り値はfunc1
の戻り値である(例外が発生した時は戻らない).
+VALUE rb_protect(VALUE (*func) (VALUE), VALUE arg, int *state)
+
+ 関数funcをargを引数として実行し, 例外が発生しなければその戻
+ り値を返す.例外が発生した場合は, *stateに非0をセットして
+ Qnilを返す.
+
+void rb_jump_tag(int state)
+
+ rb_protect()やrb_eval_string_protect()で捕捉された例外を再
+ 送する.stateはそれらの関数から返された値でなければならない.
+ この関数は直接の呼び出し元に戻らない.
+
** 例外・エラー
void rb_warning(const char *fmt, ...)