Merge branch 'msys2'
[git-cheetah.git] / common / exec.h
blob0bd1cf238d12f1844f16b4222f340037bbd59988
2 #define NORMALMODE (0)
3 #define HIDDENMODE (1 << 0) /* hide any windows, opened by execution */
4 #define WAITMODE (1 << 1) /* wait for execution to complete */
5 #define DETACHMODE (1 << 2) /* do *not* wait for execution to complete */
6 #define QUIETMODE (1 << 7) /* don't report any errors to user */
8 enum {
9 ERR_RUN_COMMAND_FORK = 10000,
10 ERR_RUN_COMMAND_EXEC,
11 ERR_RUN_COMMAND_PIPE,
12 ERR_RUN_COMMAND_WAITPID,
13 ERR_RUN_COMMAND_WAITPID_WRONG_PID,
14 ERR_RUN_COMMAND_WAITPID_SIGNAL,
15 ERR_RUN_COMMAND_WAITPID_NOEXIT,
19 * Varargs interface to mingw_spawnvpe with NULL as end-of-format indicator.
21 * - supports specifying working directory;
22 * - supports different modes of operation (see NORMALMODE & co. above).
24 int exec_program(const char *working_directory,
25 struct strbuf *output, struct strbuf *error_output,
26 int flags, ...);
28 int exec_program_v(const char *working_directory,
29 struct strbuf *output, struct strbuf *error_output,
30 int flags, const char **argv);