-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Embedding CRuby interpreter without internal headers has been difficult
for few years because: * NODE is no longer accessible. * rb_iseq_eval_main crashes without preparing with rb_thread_t. * some existing APIs calls exit(3) without giving the opportunity to finalize or handle errors to the client. * No general-purpose function to compile a source to an iseq are published in the public headers. This commit solves the problems. * include/ruby/ruby.h: Grouped APIs for embedding CRuby interpreter. (ruby_setup, ruby_compile_main_from_file, ruby_compile_main_from_string, ruby_eval_main, ruby_set_script_name): new APIs to embed CRuby. (ruby_opaque_t) Opaque pointer to an internal data, to NODE or iseq in particular. * eval.c (ruby_setup): Similar to ruby_init but returns an error code instead of exit(3) on error. (ruby_eval_main): Similar to ruby_exec_node but returns the evaluation result. (ruby_eval_main_internal): renamed from ruby_exec_internal. * ruby.c (toplevel_context): new helper function. (PREPARE_EVAL_MAIN): moved. (process_options): refactored with new functions. (parse_and_compile_main) new helper funciton. (ruby_compile_main_from_file, ruby_compile_main_from_string) new API (ruby_set_script_name): new API. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
- Loading branch information
Showing
5 changed files
with
306 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,26 @@ | ||
Thu Jun 14 10:44:41 2012 Yuki Yugui Sonoda <[email protected]> | ||
|
||
* include/ruby/ruby.h: Grouped APIs for embedding CRuby interpreter. | ||
(ruby_setup, ruby_compile_main_from_file, | ||
ruby_compile_main_from_string, ruby_eval_main, | ||
ruby_set_script_name): new APIs to embed CRuby. | ||
(ruby_opaque_t) Opaque pointer to an internal data, to NODE or iseq | ||
in particular. | ||
|
||
* eval.c (ruby_setup): Similar to ruby_init but returns an error code | ||
instead of exit(3) on error. | ||
(ruby_eval_main): Similar to ruby_exec_node but returns the | ||
evaluation result. | ||
(ruby_eval_main_internal): renamed from ruby_exec_internal. | ||
|
||
* ruby.c (toplevel_context): new helper function. | ||
(PREPARE_EVAL_MAIN): moved. | ||
(process_options): refactored with new functions. | ||
(parse_and_compile_main) new helper funciton. | ||
(ruby_compile_main_from_file, ruby_compile_main_from_string) new API | ||
(ruby_set_script_name): new API. | ||
|
||
|
||
Thu Jun 14 10:39:48 2012 Yuki Yugui Sonoda <[email protected]> | ||
|
||
* eval.c: Add doxygen comments. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.