bootstrap: Add dependency checks
[petitboot] / lib / process / process.h
index ae7fe32d06350679660ac21473b8cd45fa6fc986..4904ffc8f5126977f1407bcb8d08703ea5b57037 100644 (file)
@@ -23,6 +23,7 @@
 
 struct process;
 struct procset;
+struct process_info;
 
 typedef void   (*process_exit_cb)(struct process *);
 
@@ -32,8 +33,11 @@ struct process {
        const char              **argv;
        bool                    keep_stdout;
        bool                    add_stderr;
+       bool                    raw_stdout;
        process_exit_cb         exit_cb;
        void                    *data;
+       waiter_cb               stdout_cb;
+       void                    *stdout_data;
 
        /* runtime data */
        pid_t                   pid;
@@ -42,6 +46,7 @@ struct process {
 
        /* post-execution information */
        int                     exit_status;
+       bool                    cancelled;
 };
 
 /* Process management system init. process_init must be called before
@@ -74,4 +79,14 @@ int process_run_simple(void *ctx, const char *name, ...)
 int process_run_async(struct process *process);
 
 void process_stop_async(struct process *process);
+void process_stop_async_all(void);
+
+/* helper function to determine if a process exited cleanly, with a non-zero
+ * exit status */
+bool process_exit_ok(struct process *process);
+
+/* Functions to assist callers using a custom stdout callback */
+struct process *procinfo_get_process(struct process_info *procinfo);
+int process_stdout_custom(struct process_info *procinfo, char **line);
+
 #endif /* PROCESS_H */