summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--args.c10
-rw-r--r--args.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/args.c b/args.c
index 7c62baee..9377d357 100644
--- a/args.c
+++ b/args.c
@@ -97,6 +97,16 @@ struct args *args_cat_zap(struct args *to, struct args *from)
return to;
}
+struct args *args_cat_zap_from(struct args *to, struct args *from, cnum index)
+{
+ size_t size = sizeof *from->arg * (from->fill - index);
+ to->list = from->list;
+ memcpy(to->arg + to->fill, from->arg + index, size);
+ to->fill += from->fill - index;
+ memset(from->arg, 0, size);
+ return to;
+}
+
val args_copy_to_list(struct args *args)
{
list_collect_decl (out, ptail);
diff --git a/args.h b/args.h
index c9f6bd9a..68d301b8 100644
--- a/args.h
+++ b/args.h
@@ -185,4 +185,5 @@ val args_get_checked(val name, struct args *args, cnum *arg_index);
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);
val args_copy_to_list(struct args *args);