From: Masahiro Tanaka Date: 2001-02-01T07:46:59+09:00 Subject: [ruby-talk:10195] Re: Embedded Ruby problems Hi, > 2. The worst problem is that the called script interpreter makes and > exit() to stop, wich has the disastrous consequence of stopping my > calling program! > Is there a function to stop cleanly the ruby interpreter so that I can > replace each exit() into ruby's source code and continue my program > after a ruby_run() call? Function "rb_set_end_proc(func, data)" might help. -- example -- #include #include static void end_proc(data) VALUE data; { puts(STR2CSTR(data)); } main() { ruby_init(); rb_set_end_proc( end_proc, rb_str_new2("end_proc called") ); rb_load_file("foo.rb"); ruby_run(); } -- M.Tanaka