[gnome-builder] runner: add push_args() helper



commit 92590a7ae3fcc4b1d80464cf5c571a0e3afbc5cf
Author: Christian Hergert <chergert redhat com>
Date:   Sun Oct 22 15:47:23 2017 -0700

    runner: add push_args() helper

 src/libide/runner/ide-runner.c |   21 +++++++++++++++++++++
 src/libide/runner/ide-runner.h |    2 ++
 2 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/src/libide/runner/ide-runner.c b/src/libide/runner/ide-runner.c
index 96881d8..e0a372e 100644
--- a/src/libide/runner/ide-runner.c
+++ b/src/libide/runner/ide-runner.c
@@ -1304,3 +1304,24 @@ ide_runner_set_failed (IdeRunner *self,
 
   IDE_EXIT;
 }
+
+/**
+ * ide_runner_push_args:
+ * @self: a #IdeRunner
+ * @args: an array of args to add
+ *
+ * Helper to call ide_runner_append_argv() for every argument
+ * contained in @args.
+ *
+ * Since: 3.28
+ */
+void
+ide_runner_push_args (IdeRunner           *self,
+                      const gchar * const *args)
+{
+  g_return_if_fail (IDE_IS_RUNNER (self));
+  g_return_if_fail (args != NULL);
+
+  for (guint i = 0; args[i] != NULL; i++)
+    ide_runner_append_argv (self, args[i]);
+}
diff --git a/src/libide/runner/ide-runner.h b/src/libide/runner/ide-runner.h
index e23ac77..176b827 100644
--- a/src/libide/runner/ide-runner.h
+++ b/src/libide/runner/ide-runner.h
@@ -85,6 +85,8 @@ void               ide_runner_prepend_argv    (IdeRunner            *self,
                                                const gchar          *param);
 void               ide_runner_append_argv     (IdeRunner            *self,
                                                const gchar          *param);
+void               ide_runner_push_args       (IdeRunner            *self,
+                                               const gchar * const  *args);
 gchar            **ide_runner_get_argv        (IdeRunner            *self);
 void               ide_runner_set_argv        (IdeRunner            *self,
                                                const gchar * const  *argv);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]