diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-05-21 03:07:45 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-05-21 03:07:45 +0000 |
commit | c6a24c45f8eb8f3e64dedaec492eaabfd5ec5ddc (patch) | |
tree | 394fcdbdc0ba1340addd525e78fe844bc954bb69 | |
parent | 060f433f48ccb293ed21bc99a89b162a548d2e74 (diff) |
* include/ruby/ruby.h (RB_EVENT_HOOKS_HAVE_CALLBACK_DATA):
new macro for compatibility check.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | README.EXT | 13 | ||||
-rw-r--r-- | README.EXT.ja | 12 | ||||
-rw-r--r-- | include/ruby/ruby.h | 1 |
4 files changed, 27 insertions, 4 deletions
@@ -1,3 +1,8 @@ +Thu May 21 12:07:43 2009 Nobuyoshi Nakada <[email protected]> + + * include/ruby/ruby.h (RB_EVENT_HOOKS_HAVE_CALLBACK_DATA): + new macro for compatibility check. + Thu May 21 01:43:40 2009 Nobuyoshi Nakada <[email protected]> * include/ruby/ruby.h (rb_long2int, RARRAY_LENINT): check long to diff --git a/README.EXT b/README.EXT index 7836545bbe..c28c259738 100644 --- a/README.EXT +++ b/README.EXT @@ -1234,7 +1234,7 @@ Specifies the name of the script ($0). ** Hooks for the Interpreter Events - void rb_add_event_hook(rb_event_hook_func_t func, rb_event_t events) + void rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data) Adds a hook function for the specified interpreter events. events should be Or'ed value of: @@ -1251,9 +1251,13 @@ events should be Or'ed value of: The definition of rb_event_hook_func_t is below: - typedef void (*rb_event_hook_func_t)(rb_event_t event, NODE *node, + typedef void (*rb_event_hook_func_t)(rb_event_t event, VALUE data, VALUE self, ID id, VALUE klass) +The third argument `data' to rb_add_event_hook() is passed to the hook +function as the second argument, which was the pointer to the current +NODE in 1.8. See RB_EVENT_HOOKS_HAVE_CALLBACK_DATA below. + int rb_remove_event_hook(rb_event_hook_func_t func) Removes the specified hook function. @@ -1293,6 +1297,11 @@ Defined in ruby.h and means correspoinding header is available. For instance, when HAVE_RUBY_ST_H is defined you should use ruby/st.h not mere st.h. + RB_EVENT_HOOKS_HAVE_CALLBACK_DATA + +Means that rb_add_event_hook() takes the third argument `data', to be +passed to the given event hook function. + Appendix C. Functions Available in extconf.rb These functions are available in extconf.rb: diff --git a/README.EXT.ja b/README.EXT.ja index 14192461b7..a07fddf09e 100644 --- a/README.EXT.ja +++ b/README.EXT.ja @@ -1332,7 +1332,7 @@ void ruby_script(char *name) ** ���ץ�Υ��٥�ȤΥեå� - void rb_add_event_hook(rb_event_hook_func_t func, rb_event_t events) + void rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data) ���ꤵ�줿���ץ�Υ��٥�Ȥ��Ф���եå��ؿ����ɲä��ޤ��� events�ϰʲ����ͤ�or�Ǥʤ���Фʤ�ޤ���: @@ -1349,9 +1349,13 @@ events�ϰʲ����ͤ�or�Ǥʤ���Фʤ�ޤ���: rb_event_hook_func_t������ϰʲ����̤�Ǥ�: - typedef void (*rb_event_hook_func_t)(rb_event_t event, NODE *node, + typedef void (*rb_event_hook_func_t)(rb_event_t event, VALUE data, VALUE self, ID id, VALUE klass) +rb_add_event_hook() ����3���� data �ϡ��եå��ؿ�����2������ +�����Ϥ���ޤ��������1.8�Ǥϸ��ߤ�NODE�ؤΥݥ��Ǥ������� +���� RB_EVENT_HOOKS_HAVE_CALLBACK_DATA �⻲�Ȥ��Ƥ��������� + int rb_remove_event_hook(rb_event_hook_func_t func) ���ꤵ�줿�եå��ؿ��������ޤ��� @@ -1393,6 +1397,10 @@ HAVE_RUBY_*_H ���̣���롥���Ȥ��С�HAVE_RUBY_ST_H ���������Ƥ������ ñ�ʤ� st.h �ǤϤʤ� ruby/st.h ����Ѥ��롥 +RB_EVENT_HOOKS_HAVE_CALLBACK_DATA + + rb_add_event_hook() ���եå��ؿ����Ϥ� data ����3�����Ȥ��� + ������뤳�Ȥ��̣���롥 Appendix C. extconf.rb�ǻȤ���ؿ����� diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 440bfe2ed1..8e8486b105 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -1220,6 +1220,7 @@ typedef struct rb_event_hook_struct { struct rb_event_hook_struct *next; } rb_event_hook_t; +#define RB_EVENT_HOOKS_HAVE_CALLBACK_DATA 1 void rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data); int rb_remove_event_hook(rb_event_hook_func_t func); |