Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
return -errno;
}
+int collecty_args_pushv(collecty_args* self, const char* args[]) {
+ int r;
+
+ // Check inputs
+ if (!args)
+ return -EINVAL;
+
+ for (unsigned int i = 0; args[i]; i++) {
+ r = collecty_args_push(self, "%s", args[i]);
+ if (r < 0)
+ return r;
+ }
+
+ return 0;
+}
+
int collecty_args_dump(collecty_args* self) {
for (int i = 0; i < self->argc; i++) {
DEBUG(self->ctx, "argv[%d]: %s\n", i, self->argv[i]);
int collecty_args_push(collecty_args* self, const char* format, ...)
__attribute__((format(printf, 2, 3)));
+int collecty_args_pushv(collecty_args* self, const char* args[]);
+
int collecty_args_dump(collecty_args* self);
#endif /* COLLECTY_ARGS_H */