ruby-changes:23988
From: akr <ko1@a...>
Date: Tue, 12 Jun 2012 20:35:03 +0900 (JST)
Subject: [ruby-changes:23988] akr:r36039 (trunk): * include/ruby/intern.h (rb_exec_arg_init): deprecated.
akr 2012-06-12 20:34:51 +0900 (Tue, 12 Jun 2012) New Revision: 36039 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=36039 Log: * include/ruby/intern.h (rb_exec_arg_init): deprecated. (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. Modified files: trunk/ChangeLog trunk/ext/pty/pty.c trunk/include/ruby/intern.h trunk/internal.h trunk/io.c trunk/process.c Index: include/ruby/intern.h =================================================================== --- include/ruby/intern.h (revision 36038) +++ include/ruby/intern.h (revision 36039) @@ -609,11 +609,11 @@ }; DEPRECATED(int rb_proc_exec_n(int, VALUE*, const char*)); int rb_proc_exec(const char*); -VALUE rb_exec_arg_init(int argc, VALUE *argv, int accept_shell, struct rb_exec_arg *e); -int rb_exec_arg_addopt(struct rb_exec_arg *e, VALUE key, VALUE val); -void rb_exec_arg_fixup(struct rb_exec_arg *e); -int rb_run_exec_options(const struct rb_exec_arg *e, struct rb_exec_arg *s); -int rb_run_exec_options_err(const struct rb_exec_arg *e, struct rb_exec_arg *s, char*, size_t); +DEPRECATED(VALUE rb_exec_arg_init(int argc, VALUE *argv, int accept_shell, struct rb_exec_arg *e)); +DEPRECATED(int rb_exec_arg_addopt(struct rb_exec_arg *e, VALUE key, VALUE val)); +DEPRECATED(void rb_exec_arg_fixup(struct rb_exec_arg *e)); +DEPRECATED(int rb_run_exec_options(const struct rb_exec_arg *e, struct rb_exec_arg *s)); +DEPRECATED(int rb_run_exec_options_err(const struct rb_exec_arg *e, struct rb_exec_arg *s, char*, size_t)); DEPRECATED(int rb_exec(const struct rb_exec_arg*)); DEPRECATED(int rb_exec_err(const struct rb_exec_arg*, char*, size_t)); DEPRECATED(rb_pid_t rb_fork(int*, int (*)(void*), void*, VALUE)); Index: ChangeLog =================================================================== --- ChangeLog (revision 36038) +++ ChangeLog (revision 36039) @@ -1,3 +1,34 @@ +Tue Jun 12 20:29:19 2012 Tanaka Akira <akr@f...> + + * include/ruby/intern.h (rb_exec_arg_init): deprecated. + (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. + Tue Jun 12 18:39:59 2012 URABE Shyouhei <shyouhei@r...> * configure.in: enable strict ANSI mode by default in case of GCC, Index: io.c =================================================================== --- io.c (revision 36038) +++ io.c (revision 36039) @@ -5517,27 +5517,27 @@ rb_sys_fail_str(prog); } if (eargp) { - rb_exec_arg_addopt(eargp, INT2FIX(0), INT2FIX(arg.write_pair[0])); - rb_exec_arg_addopt(eargp, INT2FIX(1), INT2FIX(arg.pair[1])); + rb_execarg_addopt(eargp, INT2FIX(0), INT2FIX(arg.write_pair[0])); + rb_execarg_addopt(eargp, INT2FIX(1), INT2FIX(arg.pair[1])); } break; case FMODE_READABLE: if (rb_pipe(arg.pair) < 0) rb_sys_fail_str(prog); if (eargp) - rb_exec_arg_addopt(eargp, INT2FIX(1), INT2FIX(arg.pair[1])); + rb_execarg_addopt(eargp, INT2FIX(1), INT2FIX(arg.pair[1])); break; case FMODE_WRITABLE: if (rb_pipe(arg.pair) < 0) rb_sys_fail_str(prog); if (eargp) - rb_exec_arg_addopt(eargp, INT2FIX(0), INT2FIX(arg.pair[0])); + rb_execarg_addopt(eargp, INT2FIX(0), INT2FIX(arg.pair[0])); break; default: rb_sys_fail_str(prog); } if (eargp) { - rb_exec_arg_fixup(arg.execp); + rb_execarg_fixup(arg.execp); pid = rb_fork_async_signal_safe(&status, popen_exec, &arg, arg.execp->redirect_fds, errmsg, sizeof(errmsg)); } else { @@ -5595,28 +5595,28 @@ rb_sys_fail_str(prog); } if (eargp) { - rb_exec_arg_addopt(eargp, INT2FIX(0), INT2FIX(write_pair[0])); - rb_exec_arg_addopt(eargp, INT2FIX(1), INT2FIX(pair[1])); + rb_execarg_addopt(eargp, INT2FIX(0), INT2FIX(write_pair[0])); + rb_execarg_addopt(eargp, INT2FIX(1), INT2FIX(pair[1])); } break; case FMODE_READABLE: if (rb_pipe(pair) < 0) rb_sys_fail_str(prog); if (eargp) - rb_exec_arg_addopt(eargp, INT2FIX(1), INT2FIX(pair[1])); + rb_execarg_addopt(eargp, INT2FIX(1), INT2FIX(pair[1])); break; case FMODE_WRITABLE: if (rb_pipe(pair) < 0) rb_sys_fail_str(prog); if (eargp) - rb_exec_arg_addopt(eargp, INT2FIX(0), INT2FIX(pair[0])); + rb_execarg_addopt(eargp, INT2FIX(0), INT2FIX(pair[0])); break; default: rb_sys_fail_str(prog); } if (eargp) { - rb_exec_arg_fixup(eargp); - rb_run_exec_options(eargp, &sarg); + rb_execarg_fixup(eargp); + rb_execarg_run_options(eargp, &sarg, NULL, 0); } while ((pid = (args ? rb_w32_aspawn(P_NOWAIT, cmd, args) : @@ -5633,7 +5633,7 @@ { int e = errno; if (eargp) - rb_run_exec_options(&sarg, NULL); + rb_execarg_run_options(&sarg, NULL, NULL, 0); close(pair[0]); close(pair[1]); if ((fmode & (FMODE_READABLE|FMODE_WRITABLE)) == (FMODE_READABLE|FMODE_WRITABLE)) { @@ -5650,7 +5650,7 @@ RB_GC_GUARD(argbuf); if (eargp) - rb_run_exec_options(&sarg, NULL); + rb_execarg_run_options(&sarg, NULL, NULL, 0); if ((fmode & FMODE_READABLE) && (fmode & FMODE_WRITABLE)) { close(pair[1]); fd = pair[0]; @@ -5671,12 +5671,12 @@ cmd = StringValueCStr(prog); } if (eargp) { - rb_exec_arg_fixup(eargp); - rb_run_exec_options(eargp, &sarg); + rb_execarg_fixup(eargp); + rb_execarg_run_options(eargp, &sarg, NULL, 0); } fp = popen(cmd, modestr); if (eargp) - rb_run_exec_options(&sarg, NULL); + rb_execarg_run_options(&sarg, NULL, NULL, 0); if (!fp) rb_sys_fail_path(prog); fd = fileno(fp); #endif @@ -5727,7 +5727,7 @@ pipe_open_v(int argc, VALUE *argv, const char *modestr, int fmode, convconfig_t *convconfig) { struct rb_exec_arg earg; - rb_exec_arg_init(argc, argv, FALSE, &earg); + rb_execarg_init(argc, argv, FALSE, &earg); return pipe_open(&earg, modestr, fmode, convconfig); } @@ -5747,7 +5747,7 @@ return pipe_open(NULL, modestr, fmode, convconfig); } - rb_exec_arg_init(argc, argv, TRUE, &earg); + rb_execarg_init(argc, argv, TRUE, &earg); return pipe_open(&earg, modestr, fmode, convconfig); } Index: process.c =================================================================== --- process.c (revision 36038) +++ process.c (revision 36039) @@ -1503,7 +1503,7 @@ #endif int -rb_exec_arg_addopt(struct rb_exec_arg *e, VALUE key, VALUE val) +rb_execarg_addopt(struct rb_exec_arg *e, VALUE key, VALUE val) { VALUE options = e->options; ID id; @@ -1636,13 +1636,19 @@ return ST_CONTINUE; } +int +rb_exec_arg_addopt(struct rb_exec_arg *e, VALUE key, VALUE val) +{ + return rb_execarg_addopt(e, key, val); +} + static int check_exec_options_i(st_data_t st_key, st_data_t st_val, st_data_t arg) { VALUE key = (VALUE)st_key; VALUE val = (VALUE)st_val; struct rb_exec_arg *e = (struct rb_exec_arg *)arg; - return rb_exec_arg_addopt(e, key, val); + return rb_execarg_addopt(e, key, val); } static VALUE @@ -1942,7 +1948,7 @@ } VALUE -rb_exec_arg_init(int argc, VALUE *argv, int accept_shell, struct rb_exec_arg *e) +rb_execarg_init(int argc, VALUE *argv, int accept_shell, struct rb_exec_arg *e) { VALUE prog; VALUE env = Qnil, opthash = Qnil; @@ -1951,6 +1957,12 @@ return e->use_shell ? e->invoke.sh.shell_script : e->invoke.cmd.command_name; } +VALUE +rb_exec_arg_init(int argc, VALUE *argv, int accept_shell, struct rb_exec_arg *e) +{ + return rb_execarg_init(argc, argv, accept_shell, e); +} + static int fill_envp_buf_i(st_data_t st_key, st_data_t st_val, st_data_t arg) { @@ -1970,7 +1982,7 @@ static long run_exec_dup2_tmpbuf_size(long n); void -rb_exec_arg_fixup(struct rb_exec_arg *e) +rb_execarg_fixup(struct rb_exec_arg *e) { VALUE unsetenv_others, envopts; VALUE ary; @@ -2040,11 +2052,17 @@ } } +void +rb_exec_arg_fixup(struct rb_exec_arg *e) +{ + return rb_execarg_fixup(e); +} + static void rb_exec_arg_prepare(struct rb_exec_arg *earg, int argc, VALUE *argv) { - rb_exec_arg_init(argc, argv, TRUE, earg); - rb_exec_arg_fixup(earg); + rb_execarg_init(argc, argv, TRUE, earg); + rb_execarg_fixup(earg); } static int rb_exec_without_timer_thread(const struct rb_exec_arg *e, char *errmsg, size_t errmsg_buflen); @@ -2556,7 +2574,7 @@ /* This function should be async-signal-safe when _s_ is not NULL. Hopefully it is. */ int -rb_run_exec_options_err(const struct rb_exec_arg *e, struct rb_exec_arg *s, char *errmsg, size_t errmsg_buflen) +rb_execarg_run_options(const struct rb_exec_arg *e, struct rb_exec_arg *s, char *errmsg, size_t errmsg_buflen) { VALUE options = e->options; VALUE soptions = Qnil; @@ -2682,9 +2700,15 @@ } int +rb_run_exec_options_err(const struct rb_exec_arg *e, struct rb_exec_arg *s, char *errmsg, size_t errmsg_buflen) +{ + return rb_execarg_run_options(e, s, errmsg, errmsg_buflen); +} + +int rb_run_exec_options(const struct rb_exec_arg *e, struct rb_exec_arg *s) { - return rb_run_exec_options_err(e, s, NULL, 0); + return rb_execarg_run_options(e, s, NULL, 0); } /* This function should be async-signal-safe. Hopefully it is. */ @@ -2699,7 +2723,7 @@ before_exec_async_signal_safe(); /* async-signal-safe */ - if (rb_run_exec_options_err(e, sargp, errmsg, errmsg_buflen) < 0) { /* hopefully async-signal-safe */ + if (rb_execarg_run_options(e, sargp, errmsg, errmsg_buflen) < 0) { /* hopefully async-signal-safe */ goto failure; } Index: ext/pty/pty.c =================================================================== --- ext/pty/pty.c (revision 36038) +++ ext/pty/pty.c (revision 36039) @@ -176,8 +176,8 @@ argv = &v; } - rb_exec_arg_init(argc, argv, 1, &carg.earg); - rb_exec_arg_fixup(&carg.earg); + rb_execarg_init(argc, argv, 1, &carg.earg); + rb_execarg_fixup(&carg.earg); getDevice(&master, &slave, SlaveName, 0); Index: internal.h =================================================================== --- internal.h (revision 36038) +++ internal.h (revision 36039) @@ -266,6 +266,10 @@ /* process.c */ int rb_exec_async_signal_safe(const struct rb_exec_arg *e, char *errmsg, size_t errmsg_buflen); rb_pid_t rb_fork_async_signal_safe(int *status, int (*chfunc)(void*, char *, size_t), void *charg, VALUE fds, char *errmsg, size_t errmsg_buflen); +VALUE rb_execarg_init(int argc, VALUE *argv, int accept_shell, struct rb_exec_arg *e); +int rb_execarg_addopt(struct rb_exec_arg *e, VALUE key, VALUE val); +void rb_execarg_fixup(struct rb_exec_arg *e); +int rb_execarg_run_options(const struct rb_exec_arg *e, struct rb_exec_arg *s, char* errmsg, size_t errmsg_buflen); #if defined __GNUC__ && __GNUC__ >= 4 #pragma GCC visibility pop -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/