diff options
-rw-r--r-- | args.c | 11 | ||||
-rw-r--r-- | args.h | 1 |
2 files changed, 12 insertions, 0 deletions
@@ -117,6 +117,17 @@ struct args *args_cat_zap_from(struct args *to, struct args *from, cnum index) return to; } +struct args *args_copy_reverse(struct args *to, struct args *from, cnum nargs) +{ + cnum i, index = 0; + + for (i = nargs - 1; i >= 0; i--) + to->arg[i] = args_get(from, &index); + + to->fill = nargs; + return to; +} + val args_copy_to_list(struct args *args) { list_collect_decl (out, ptail); @@ -187,6 +187,7 @@ struct args *args_copy(struct args *to, struct args *from); struct args *args_copy_zap(struct args *to, struct args *from); struct args *args_cat_zap(struct args *to, struct args *from); struct args *args_cat_zap_from(struct args *to, struct args *from, cnum index); +struct args *args_copy_reverse(struct args *to, struct args *from, cnum nargs); val args_copy_to_list(struct args *args); void args_for_each(struct args *args, int (*fn)(val arg, int ix, mem_t *ctx), |