2017-11-18 17:09:20 +01:00
|
|
|
/* SPDX-License-Identifier: LGPL-2.1+ */
|
2018-06-25 06:04:59 +02:00
|
|
|
#pragma once
|
2017-01-22 18:35:08 +01:00
|
|
|
|
2017-01-22 21:22:37 +01:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
2017-01-22 18:35:08 +01:00
|
|
|
#include "time-util.h"
|
|
|
|
|
2017-01-22 21:22:37 +01:00
|
|
|
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],
|
2018-09-12 19:19:13 +02:00
|
|
|
char *argv[],
|
|
|
|
char *envp[]);
|
2017-02-11 03:49:01 +01:00
|
|
|
|
|
|
|
extern const gather_stdout_callback_t gather_environment[_STDOUT_CONSUME_MAX];
|