summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2012-06-27Module#prependnobu
* class.c (rb_prepend_module): prepend module into another module. * eval.c (rb_mod_prepend): new method Module#prepend. [Feature #1102] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-22error.c: rb_check_copyablenobu
* error.c (rb_check_copyable): new function, to ensure the target is not frozen and the source is not tainted nor untrusted. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-20* internal.h (struct rb_execarg) moved and renamed fromakr
struct rb_exec_arg in intern.h. * include/ruby/intern.h (struct rb_exec_arg): refer Data object which contains struct rb_execarg. * process.c: use struct rb_execarg instead of struct rb_exec_arg except functions declared in intern.h. (rb_exec_arg_addopt): extract a pointer to struct rb_execarg from struct rb_exec_arg. (rb_exec_arg_init): ditto. (rb_exec_arg_fixup): ditto. (rb_run_exec_options_err): ditto. (rb_run_exec_options): ditto. (rb_exec_err): ditto. (rb_exec): ditto. * io.c: use struct rb_execarg instead of struct rb_exec_arg. * ext/pty/pty.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-19* include/ruby/missing.h: include math.h before checking INFINITYkosaki
and NAN. Otherwise, strange macro redefinition will occur. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-19[Bug #6607]nobu
* include/ruby/backward/rubysig.h: fix visibility. [Bug #6607] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-14fix r36079nobu
* include/ruby/ruby.h: public symbols must have default visibility. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-14Embedding CRuby interpreter without internal headers has been difficultyugui
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
2012-06-13include/ruby/win32.h: fix comment stylenobu
* include/ruby/win32.h: get rid of C99 style one line comments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-12* include/ruby/intern.h (rb_exec_arg_init): deprecated.akr
(rb_exec_arg_addopt): ditto. (rb_exec_arg_fixup): ditto. (rb_run_exec_options): ditto. (rb_run_exec_options_err): ditto. * internal.h (rb_execarg_init): declared. (rb_execarg_addopt): ditto. (rb_execarg_fixup): ditto. (rb_execarg_run_options): ditto. * process.c: call rb_execarg_addopt, rb_execarg_fixup, rb_execarg_run_options, rb_execarg_init. (rb_execarg_addopt): renamed from rb_exec_arg_addopt. (rb_exec_arg_addopt): stub to call rb_execarg_addopt. (rb_execarg_init): renamed from rb_exec_arg_init. (rb_exec_arg_init): stub to call rb_execarg_init. (rb_execarg_fixup): renamed from rb_exec_arg_fixup. (rb_exec_arg_fixup): stub to call rb_execarg_fixup. (rb_execarg_run_options): renamed from rb_run_exec_options_err. (rb_run_exec_options_err): stub to call rb_execarg_run_options. (rb_run_exec_options): call rb_execarg_run_options. * io.c: call rb_execarg_addopt, rb_execarg_fixup, rb_execarg_run_options, rb_execarg_init. * ext/pty/pty.c (establishShell): call rb_execarg_init and rb_execarg_fixup. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-11* include/ruby/intern.h (rb_proc_exec_n): deprecated.akr
(rb_exec): ditto. (rb_exec_err): ditto. (rb_fork): ditto. (rb_fork_err): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10* process.c (rb_proc_exec_n): revert the function removed at r35889.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-08* include/ruby/intern.h (rb_exec_arg_init): declaration changed toakr
return a value. * process.c (rb_exec_arg_init): return a value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-07* include/ruby/intern.h: rb_exec_arg and related stuff moved back fromakr
internal.h git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-06* win32/win32.c, include/ruby/win32.h (rb_w32_wrap_io_handle): new API.usa
this API wraps an I/O handle (HANDLE or SOCKET) and returns fd. the second parameter should be combination of O_*, for example, O_RDWR | O_BINARY | O_NOINHERT. * win32/win32.c, include/ruby/win32.h (rb_w32_unwrap_io_handle): new API. this API unwraps an I/O handle and close the fd (not closes the handle itself). [Feature #4960] [ruby-core:37227] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-05* internal.h: rb_exec_arg and related stuff moved from intern.hakr
* include/ruby/intern.h (rb_proc_exec_n): removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-05* process.c (rb_exec_arg_fixup): allocate a temporary buffer forakr
run_exec_dup2 here because it should be async-signal-safe. (run_exec_dup2): use the temporary buffer. (run_exec_dup2_tmpbuf_size): new function. * include/ruby/intern.h (rb_exec_arg): add dup2_tmpbuf field. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-05obj_init_copynobu
* object.c (rb_obj_init_copy): should check if trusted too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-03 * marshal.c: experimental test aborted.tadf
* complex.c: ditto. * rational.c: ditto. * include/ruby/intern.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-03* include/ruby/intern.h (rb_exec_arg): remove argc and argv fields.akr
add use_shell, argv_str and argv_buf fields. * process.c (rb_proc_exec_e): don't split shell command line arguments here to avoid memory allocation in a child process. (rb_exec_fillarg): split shell command line arguments here. (proc_exec_v): takes argv_str argument instead of argv. (rb_proc_exec_ne): removed. (rb_proc_exec_n): removed. (rb_run_exec_options_err): don't initialize the removed fields. (rb_exec_err): don't initialize the removed fields. call proc_exec_v directly instead of rb_proc_exec_ne. (rb_spawn_process): use use_shell field. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-03 * marshal.c: calls directly rb_{Complex,Rational}_marshal_load().tadf
But now disabled. [experimental] * complex.c: followed the above. * rational.c: ditto. * include/rub/intern.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-03* use execve() to preserve environment variables when exec method isakr
failed. [ruby-core:44093] [ruby-trunk - Bug #6249] * include/ruby/intern.h (rb_exec_arg): add envp_str and envp_buf field to store envp of execve(). * process.c (proc_exec_v): takes envp_str as an argument and use it for execve(). (rb_proc_exec_ne): extended version of rb_proc_exec_n(). (rb_proc_exec_n): use rb_proc_exec_ne(). (rb_proc_exec): follow proc_exec_v() change. (fill_envp_buf_i): new function. (rb_exec_arg_fixup): set up envp_str and envp_buf. (save_env_i): removed. (save_env): removed. (rb_run_exec_options_err): don't modify environment variables. (rb_exec_err): use rb_proc_exec_ne(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-24Feature #5896nobu
* vsnprintf.c (BSD_vfprintf): [EXPERIMENTAL] object representation in rb_enc_vsprintf(). [Feature #5896] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-08* include/ruby/win32.h (FD_SET): change function to macro.shirosaki
To avoid buffer overflow when smaller FD_SETSISE is used in ext libraries. * win32/win32.c (rb_w32_fdset): this function is not used anymore. But we leave this for compatibility. * win32/win32.c (rb_w32_select_with_thread): fix SEGV when smaller FD_SETSISE is used in ext libraries. Dereference of fd_set pointer causes SEGV. * test/-ext-/win32/test_fd_setsize.rb(TestFdSetSize): add tests for above. * ext/-test-/win32/fd_setsize/depend: ditto. * ext/-test-/win32/fd_setsize/extconf.rb: ditto. * ext/-test-/win32/fd_setsize/fd_setsize.c: ditto. [ruby-core:44588] [Bug #6352] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-16* win32/win32.c (gmtime_r, localtime_r): POSIX compliant reentrantnobu
versions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-11* parse.y (rb_check_id_cstr): new function to check if ID isnobu
registered with NUL-terminated C string. * sprintf.c (rb_str_format): avoid inadvertent symbol creation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-10* error.c (rb_enc_raise): new function to raise an exception withnobu
the message in the given encoding. patched by now (Nikolai Weibull) at [ruby-core:41160]. [Feature #5650] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-07* include/ruby/win32.h (rb_w32_aspawn_flags): add the declaration ofshirosaki
new function. * process.c (enum): add EXEC_OPTION_PGROUP and move the position above for the usage in proc_spawn_n(). * process.c (proc_spawn_n): add an argument to pass new option `new_pgroup`. The option specifies CREATE_NEW_PROCESS_GROUP flag to CreateProcessW(). This flag is necessary for the usage of Process.kill on the subprocess on Windows. * process.c (rb_exec_arg_addopt): ditto. * process.c (rb_spawn_process): ditto. * process.c (documentation for rb_f_spawn): add documentation for new option `new_pgroup` of spawn. * test/ruby/test_process.rb (TestProcess#test_execopts_new_pgroup): add tests for option `new_pgroup`. * test/ruby/test_thread.rb (TestThreadGroup#test_thread_timer_and_interrupt): add option `new_pgroup: true` to spawn on Windows. It's needed for Process.kill on a subprocess. * win32/win32.c (CreateChild): add an argument to pass dwCreationFlags of CreateProcessW(). * win32/win32.c (rb_w32_spawn): ditto. * win32/win32.c (rb_w32_aspawn_flags): add new function to pass dwCreationFlags. * win32/win32.c (rb_w32_aspawn): refactor to move the content to rb_w32_aspawn_flags(). [ruby-core:43245][Bug #6131] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-29* st.c (st_update): pass pointer to key to the callback function.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-29* st.c (st_update): add existing parameter to the callback function.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-23* bignum.c (rb_str_to_inum): must be ASCII compatible encoding asnobu
well as String#hex and String#oct. [ruby-core:43566][Bug #6192] * string.c (rb_must_asciicompat): check if ASCII compatible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-22* include/ruby/win32.h (fstati64): fix macro conflicts.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-22* win32/win32.c (rb_w32_fstat, rb_w32_fstati64): convert FILETIMEnobu
to time_t directly, not to be affected by TZ unnecessarily. * win32/win32.c (unixtime_to_filetime): convert time_t to FILETIME simply. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15* enum.c (rb_enum_values_pack): rename from enum_values_pack, andshugo
remove static. * enumerator.c (lazy_init_iterator, lazy_init_yielder, lazy_select_func, lazy_reject_func, lazy_grep_func): handle multiple values correctly. * enumerator.c (lazy_grep): change the behavior when a block is given, to be consistent with Enumerable#grep. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15* win32/win32.c, include/ruby/win32.h (rb_w32_ugetenv): new API tousa
accept and to return UTF-8 strings. * win32/win32.c (rb_w32_getenv): follow above change. * win32/win32.c (rb_w32_get_environ): returns UTF-8 environment area. * hash.c (env_str_new, rb_f_getenv, env_fetch): follow above changes. [Bug #5570] [ruby-core:40737] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-14* include/ruby/intern.h: Add rb_check_arity, rb_error_arity [#6085]marcandre
* array.c: Use rb_check_arity / rb_error_arity * class.c: ditto * enumerator.c: ditto * eval.c: ditto * file.c: ditto * hash.c: ditto * numeric.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * re.c: ditto * signal.c: ditto * string.c: ditto * struct.c: ditto * transcode.c: ditto * vm_eval.c: ditto * vm_insnhelper.c: ditto & implementation of rb_error_arity * test/ruby/test_arity.rb: tests for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-14* vm_insnhelper.c: improve number of arguments error in case ofmarcandre
optional parameters (issue #6085) * include/ruby/intern.h: define UNLIMITED_ARGUMENTS * test/ruby/test_arity.rb: test for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-12* encoding.c (rb_find_encoding): new function find encoding fromnobu
arbitrary object as a pointer to rb_encoding, and return NULL if not found. * io.c (io_encoding_set): just warn unsupported encodings, but not exception. [ruby-core:40726] [Bug #5567] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-10* st.c: add st_foreach_check for fixing iteration over packed tablenobu
and st_delete_safe. patched by Sokolov Yura at https://github.com/ruby/ruby/pull/84 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-10* st.c: fix packed num_entries on delete_safe. patched by Sokolovnobu
Yura at https://github.com/ruby/ruby/pull/84 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-07rb_load_failnobu
* error.c (rb_load_fail): use path as a string, not char*. * internal.h: (rb_load_fail): moved from ruby/intern.h. * ruby.c (load_file_internal): fname cannot be NULL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-06* error.c (rb_loaderror_with_path): Adding the missing file as antenderlove
instance variable to the LoadError exception. * load.c: call rb_loaderror_with_path so that the missing path is added to the exception. * ruby.c: call rb_loaderror rather than raising our own LoadError exception. * include/ruby/intern.h: add declaration for rb_loaderror_with_path. * test/ruby/test_require.rb: add supporting test for LoadError#path method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-05* st.c (unpack_entries): use union instead of casted pointer.nobu
patched by Sokolov Yura <funny.falcon AT gmail.com>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-01* internal.h (rb_file_const, rb_file_load_ok): moved functions fornobu
internal use only. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-27* io.c, process.c, time.c, ext: use rb_sys_fail_str instead ofnobu
rb_sys_fail. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-24* error.c: new functions to deal exceptions with string instances.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-24* configure.in (__builtin_unreachable): check for clang.nobu
[ruby-core:42849] * include/ruby/ruby.h (UNREACHABLE): fallback definition. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-17* Merge Onigmo-5.13.1. [ruby-dev:45057] [Feature #5820]naruse
https://github.com/k-takata/Onigmo cp reg{comp,enc,error,exec,parse,syntax}.c reg{enc,int,parse}.h cp oniguruma.h cp tool/enc-unicode.rb cp -r enc/ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-12* include/ruby/ruby.h (rb_event_hook_func_t): add argument names.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-08* string.c (rb_str_modify_expand): fix memory leak.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-25* file.c (rb_enc_path_next, rb_enc_path_skip_prefix)nobu
(rb_enc_path_last_separator, rb_enc_path_end) (ruby_enc_find_basename, ruby_enc_find_extname): encoding-aware path handling functions. * file.c (rb_home_dir, file_expand_path, rb_realpath_internal) (rb_file_s_basename, rb_file_dirname, rb_file_s_extname) (rb_file_join): should respect the encodings of arguments than file system encoding. [ruby-dev:45145] [Bug #5919] * dir.c (check_dirname, ruby_glob0): ditto. * ext/pathname/pathname.c (path_sub_ext): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e