diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-06-14 02:22:08 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-06-14 02:22:08 +0000 |
commit | 8c9a453f2d8ac78943df98c61cdbb9e4a4ad0eda (patch) | |
tree | 8c02f7b02f8573a90c761da60315134eb64e8dd4 /ChangeLog | |
parent | f8601bd903d6c9f288fc39cc9f277c1275291ff3 (diff) | |
download | ruby-8c9a453f2d8ac78943df98c61cdbb9e4a4ad0eda.tar.gz |
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
Diffstat (limited to 'ChangeLog')
-rw-r--r-- | ChangeLog | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -1,3 +1,26 @@ +Thu Jun 14 10:44:41 2012 Yuki Yugui Sonoda <yugui@google.com> + + * 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 <yugui@google.com> * eval.c: Add doxygen comments. |