From e373aa7b92bf1c6365d9878307c793bf843cb238 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Sat, 9 Nov 2013 14:13:14 +0900 Subject: [PATCH] add missing pic_apply_argv definition --- src/vm.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/vm.c b/src/vm.c index f701cbe9..36e746ec 100644 --- a/src/vm.c +++ b/src/vm.c @@ -228,6 +228,23 @@ pic_get_args(pic_state *pic, const char *format, ...) return i; } +pic_value +pic_apply_argv(pic_state *pic, struct pic_proc *proc, size_t argc, ...) +{ + va_list ap; + pic_value v; + + va_start(ap, argc); + + v = pic_nil_value(); + while (argc--) { + v = pic_cons(pic, va_arg(ap, pic_value), v); + } + + va_end(ap); + return pic_apply(pic, proc, v); +} + #if VM_DEBUG # define OPCODE_EXEC_HOOK printf("OP = %d\n", c.insn) #else