]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/basic/exec-util.h
basic/exec-util: add support for synchronous (ordered) execution
[thirdparty/systemd.git] / src / basic / exec-util.h
index 9f8daa9fc878b88926d421fefc34e6389ed8fc2f..2c58e4bd5c66a2f15fff98825acad1e7edc6b79c 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <stdbool.h>
+
 #include "time-util.h"
 
-void execute_directories(const char* const* directories, usec_t timeout, char *argv[]);
+typedef int (*gather_stdout_callback_t) (int fd, void *arg);
+
+enum {
+        STDOUT_GENERATE,   /* from generators to helper process */
+        STDOUT_COLLECT,    /* from helper process to main process */
+        STDOUT_CONSUME,    /* process data in main process */
+        _STDOUT_CONSUME_MAX,
+};
+
+int execute_directories(
+                const char* const* directories,
+                usec_t timeout,
+                gather_stdout_callback_t const callbacks[_STDOUT_CONSUME_MAX],
+                void* const callback_args[_STDOUT_CONSUME_MAX],
+                char *argv[]);