diff options
| author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-11-16 07:29:44 +0000 |
|---|---|---|
| committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-11-16 07:29:44 +0000 |
| commit | f102f28a12bc44dda029d4b7725a5e15fa4c4477 (patch) | |
| tree | 3a0ac0df4ee028ca80e7c632a66900f7bfa89ee1 /include/ruby/ruby.h | |
| parent | 6c127c1ed870413eb3a16b46440fc243fbc3ccb3 (diff) | |
| download | ruby-f102f28a12bc44dda029d4b7725a5e15fa4c4477.tar.gz ruby-f102f28a12bc44dda029d4b7725a5e15fa4c4477.tar.xz ruby-f102f28a12bc44dda029d4b7725a5e15fa4c4477.zip | |
* include/ruby/ruby.h: added some declarations for event hooks.
* lib/profile.rb: set VM::InstructionSequence.compile_option.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include/ruby/ruby.h')
| -rw-r--r-- | include/ruby/ruby.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 6ba9ffb87..581c1957d 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -940,6 +940,36 @@ void ruby_sysinit(int *, char ***); #define HAVE_NATIVETHREAD int is_ruby_native_thread(void); +#define RUBY_EVENT_NONE 0x00 +#define RUBY_EVENT_LINE 0x01 +#define RUBY_EVENT_CLASS 0x02 +#define RUBY_EVENT_END 0x04 +#define RUBY_EVENT_CALL 0x08 +#define RUBY_EVENT_RETURN 0x10 +#define RUBY_EVENT_C_CALL 0x20 +#define RUBY_EVENT_C_RETURN 0x40 +#define RUBY_EVENT_RAISE 0x80 +#define RUBY_EVENT_ALL 0xff +#define RUBY_EVENT_VM 0x100 +#define RUBY_EVENT_SWITCH 0x200 + +typedef unsigned int rb_event_flag_t; +typedef void (*rb_event_hook_func_t)(rb_event_flag_t, VALUE data, VALUE, ID, VALUE klass); + +typedef struct rb_event_hook_struct { + rb_event_flag_t flag; + rb_event_hook_func_t func; + VALUE data; + struct rb_event_hook_struct *next; +} rb_event_hook_t; + +void rb_thread_add_event_hook(rb_thread_t *th, rb_event_hook_func_t func, + rb_event_flag_t events, VALUE data); +void rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events, + VALUE data); +int rb_thread_remove_event_hook(rb_thread_t *th, rb_event_hook_func_t func); +int rb_remove_event_hook(rb_event_hook_func_t func); + #if defined(__cplusplus) #if 0 { /* satisfy cc-mode */ |
