summaryrefslogtreecommitdiff
path: root/libs/pbd/pbd/system_exec.h
diff options
context:
space:
mode:
authorColin Fletcher <colin.m.fletcher@googlemail.com>2014-05-19 20:54:36 +0100
committerColin Fletcher <colin.m.fletcher@googlemail.com>2014-05-19 20:54:36 +0100
commit5399425f534e2d96d07cf29f427bfa0f39d904b7 (patch)
treeb2134c0b8e624b9df89904b942909ea3a688c563 /libs/pbd/pbd/system_exec.h
parent529a31bde7d17cade6c942e11e098f2c37d984a3 (diff)
parentc464feb6aa96226856305531fedb8fba2e06689e (diff)
Merge branch 'export-dialog' into cairocanvas
Fix merge conflicts in: gtk2_ardour/export_range_markers_dialog.cc gtk2_ardour/wscript libs/ardour/ardour/export_handler.h libs/ardour/system_exec.cc libs/pbd/pbd/system_exec.h libs/pbd/system_exec.cc
Diffstat (limited to 'libs/pbd/pbd/system_exec.h')
-rw-r--r--libs/pbd/pbd/system_exec.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/libs/pbd/pbd/system_exec.h b/libs/pbd/pbd/system_exec.h
index 1232175fec..ce6e5a9c4f 100644
--- a/libs/pbd/pbd/system_exec.h
+++ b/libs/pbd/pbd/system_exec.h
@@ -42,6 +42,8 @@
#include <string>
#include <pthread.h>
#include <signal.h>
+#include <map>
+
#ifdef NOPBD /* unit-test outside ardour */
#include <sigc++/bind.h>
#include <sigc++/signal.h>
@@ -94,6 +96,23 @@ class LIBPBD_API SystemExec
*
*/
SystemExec (std::string c, char ** a);
+
+ /** similar to \ref SystemExec but expects a whole command line, and
+ * handles some simple escape sequences.
+ *
+ * @param command complete command-line to be executed
+ * @param subs a map of <char, std::string> listing the % substitutions to
+ * be made.
+ *
+ * creates an argv array from the given command string, splitting into
+ * parameters at spaces.
+ * "\ " is non-splitting space, "\\" (and "\" at end of command) as "\",
+ * for "%<char>", <char> is looked up in subs and the corresponding string
+ * substituted. "%%" (and "%" at end of command)
+ * returns an argv array suitable for creating a new SystemExec with
+ */
+ SystemExec (std::string command, const std::map<char, std::string> subs);
+
virtual ~SystemExec ();
/** fork and execute the given program
@@ -182,6 +201,7 @@ class LIBPBD_API SystemExec
int nicelevel; ///< process nice level - defaults to 0
void make_argp(std::string);
+ void make_argp_escaped(std::string command, const std::map<char, std::string> subs);
void make_envp();
char **argp;
@@ -198,6 +218,7 @@ class LIBPBD_API SystemExec
#else
pid_t pid;
#endif
+ void init ();
pthread_mutex_t write_lock;
int fdin; ///< file-descriptor for writing to child's STDIN. This variable is identical to pin[1] but also used as status check if the stdin pipe is open: <0 means closed.