summaryrefslogtreecommitdiff
path: root/internal.h
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-04 10:19:32 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-04 10:19:32 +0000
commit41819dc447067891a2154f1c99c0cb4589f7b73f (patch)
tree5e3c46fd9377e473f4611332c1e4999fe59c55cd /internal.h
parent06513cc1cf5bbe1e23f871f920df7e2b7b793d9d (diff)
* internal.h (ARGVSTR2ARGC): defined.
(ARGVSTR2ARGV): defined. * process.c (proc_exec_v): use ARGVSTR2ARGV. (rb_spawn_process): use ARGVSTR2ARGC and ARGVSTR2ARGV. * io.c (pipe_open): use ARGVSTR2ARGV. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'internal.h')
-rw-r--r--internal.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/internal.h b/internal.h
index 6bf4cf3a01..37541cc145 100644
--- a/internal.h
+++ b/internal.h
@@ -157,6 +157,13 @@ int rb_is_junk_name(VALUE name);
VALUE rb_proc_location(VALUE self);
st_index_t rb_hash_proc(st_index_t hash, VALUE proc);
+/* process.c */
+
+/* argv_str contains an extra element for terminating NULL used by execve..
+ * See rb_exec_fillarg() in process.c. */
+#define ARGVSTR2ARGC(argv_str) (RSTRING_LEN(argv_str) / sizeof(char *) - 1)
+#define ARGVSTR2ARGV(argv_str) ((char **)RSTRING_PTR(argv_str))
+
/* rational.c */
VALUE rb_lcm(VALUE x, VALUE y);
VALUE rb_rational_reciprocal(VALUE x);