]> git.decadent.org.uk Git - ion3.git/blobdiff - ioncore/exec.c
Update cfg_kludge_flash for Flash 10
[ion3.git] / ioncore / exec.c
index 06838a65bc2ccbd0542dd17fad40fe769332ed0c..9da70032c12d2a4d7ccf74ff806994d87eb309a9 100644 (file)
@@ -1,12 +1,9 @@
 /*
  * ion/ioncore/exec.c
  *
- * Copyright (c) Tuomo Valkonen 1999-2007
+ * Copyright (c) Tuomo Valkonen 1999-2009
  *
- * Ion is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
+ * See the included file LICENSE for details.
  */
 
 #include <limits.h>
@@ -126,18 +123,22 @@ int ioncore_exec(const char *cmd)
 
 
 /*EXTL_DOC
- * Run \var{cmd} with a read pipe connected to its stdout.
- * When data is received through the pipe, \var{handler} is called
- * with that data.
+ * Run \var{cmd} in directory \var{wd} with a read pipe connected to its
+ * stdout and stderr.
+ * When data is received through one of these pipes, \var{h} or \var{errh} 
+ * is called with that data. When the pipe is closed, the handler is called
+ * with \code{nil} argument. The PID of the new process is returned, or
+ * -1 on error.
  */
 EXTL_SAFE
 EXTL_EXPORT
-int ioncore_popen_bgread(const char *cmd, ExtlFn h, ExtlFn errh)
+int ioncore_popen_bgread(const char *cmd, ExtlFn h, ExtlFn errh,
+                         const char *wd)
 {
     WExecP p;
     
     p.target=NULL;
-    p.wd=NULL;
+    p.wd=wd;
     p.cmd=cmd;
     
     return mainloop_popen_bgread(cmd, setup_exec, (void*)&p, h, errh);