lib/process: Allow process output to be retrieved on each event
[petitboot] / lib / process / process.h
index f75f1976c718df3970930c88be9bf1de2bde299f..65fdba8d537beeb9e43efe9d3f3b08429d143530 100644 (file)
@@ -23,6 +23,7 @@
 
 struct process;
 struct procset;
+struct process_info;
 
 typedef void   (*process_exit_cb)(struct process *);
 
@@ -34,6 +35,8 @@ struct process {
        bool                    add_stderr;
        process_exit_cb         exit_cb;
        void                    *data;
+       waiter_cb               stdout_cb;
+       void                    *stdout_data;
 
        /* runtime data */
        pid_t                   pid;
@@ -79,4 +82,8 @@ void process_stop_async(struct process *process);
  * 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 */