diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-10-09 10:15:47 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-10-09 10:15:47 -0700 |
commit | 4ad96a94657fe688da3f89102c5cc0decd268037 (patch) | |
tree | d24f63422dda2ec0610d57fb9d7ece9139b55fc7 | |
parent | cf0a731f592b7165cb050c3fd014daa7f31d71d1 (diff) | |
download | txr-4ad96a94657fe688da3f89102c5cc0decd268037.tar.gz txr-4ad96a94657fe688da3f89102c5cc0decd268037.tar.bz2 txr-4ad96a94657fe688da3f89102c5cc0decd268037.zip |
New function: args_cat_zap_from.
* args.c (args_cat_zap): New function.
* args.c (args_cat_zap): Declared.
-rw-r--r-- | args.c | 10 | ||||
-rw-r--r-- | args.h | 1 |
2 files changed, 11 insertions, 0 deletions
@@ -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); @@ -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); |