summaryrefslogtreecommitdiff
path: root/run-command.h
diff options
context:
space:
mode:
Diffstat (limited to 'run-command.h')
-rw-r--r--run-command.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/run-command.h b/run-command.h
index 56491b9f23..d6868dc8c8 100644
--- a/run-command.h
+++ b/run-command.h
@@ -5,8 +5,12 @@
#include <pthread.h>
#endif
+#include "argv-array.h"
+
struct child_process {
const char **argv;
+ struct argv_array args;
+ struct argv_array env_array;
pid_t pid;
/*
* Using .in, .out, .err:
@@ -38,20 +42,27 @@ struct child_process {
unsigned silent_exec_failure:1;
unsigned stdout_to_stderr:1;
unsigned use_shell:1;
- void (*preexec_cb)(void);
+ unsigned clean_on_exit:1;
};
+#define CHILD_PROCESS_INIT { NULL, ARGV_ARRAY_INIT, ARGV_ARRAY_INIT }
+void child_process_init(struct child_process *);
+
int start_command(struct child_process *);
int finish_command(struct child_process *);
int run_command(struct child_process *);
-extern int run_hook(const char *index_file, const char *name, ...);
+extern char *find_hook(const char *name);
+LAST_ARG_MUST_BE_NULL
+extern int run_hook_le(const char *const *env, const char *name, ...);
+extern int run_hook_ve(const char *const *env, const char *name, va_list args);
#define RUN_COMMAND_NO_STDIN 1
#define RUN_GIT_CMD 2 /*If this is to be git sub-command */
#define RUN_COMMAND_STDOUT_TO_STDERR 4
#define RUN_SILENT_EXEC_FAILURE 8
#define RUN_USING_SHELL 16
+#define RUN_CLEAN_ON_EXIT 32
int run_command_v_opt(const char **argv, int opt);
/*