00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef DEBIAN_INSTALLER__EXEC_H
00024 #define DEBIAN_INSTALLER__EXEC_H
00025
00026 #include <debian-installer/types.h>
00027
00028 #include <sys/types.h>
00029 #include <sys/wait.h>
00030 #include <unistd.h>
00031
00037 di_io_handler
00041 di_exec_io_log;
00042 di_process_handler
00048 di_exec_prepare_chdir,
00054 di_exec_prepare_chroot;
00055
00072 int di_exec_env_full (const char *path, const char *const argv[], const char *const envp[], di_io_handler *stdout_handler, di_io_handler *stderr_handler, void *io_user_data, di_process_handler *parent_prepare_handler, void *parent_prepare_user_data, di_process_handler *child_prepare_handler, void *child_prepare_user_data);
00073
00083 static inline int di_exec_env (const char *path, const char *const argv[], const char *const envp[])
00084 {
00085 return di_exec_env_full (path, argv, envp, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
00086 }
00087
00103 int di_exec_full (const char *path, const char *const argv[], di_io_handler *stdout_handler, di_io_handler *stderr_handler, void *io_user_data, di_process_handler *parent_prepare_handler, void *parent_prepare_user_data, di_process_handler *child_prepare_handler, void *child_prepare_user_data);
00104
00113 static inline int di_exec (const char *path, const char *const argv[])
00114 {
00115 return di_exec_full (path, argv, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
00116 }
00117
00132 int di_exec_shell_full (const char *const cmd, di_io_handler *stdout_handler, di_io_handler *stderr_handler, void *io_user_data, di_process_handler *parent_prepare_handler, void *parent_prepare_user_data, di_process_handler *child_prepare_handler, void *child_prepare_user_data);
00133
00141 static inline int di_exec_shell (const char *const cmd)
00142 {
00143 return di_exec_shell_full (cmd, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
00144 }
00145
00153 inline static int di_exec_shell_log (const char *const cmd)
00154 {
00155 return di_exec_shell_full (cmd, di_exec_io_log, NULL, NULL, NULL, NULL, NULL, NULL);
00156 }
00157
00163 int di_exec_mangle_status (int status);
00164
00169 inline static int di_execlog (const char *const cmd) __attribute__ ((deprecated));
00170 inline static int di_execlog (const char *const cmd)
00171 {
00172 return di_exec_shell_log (cmd);
00173 }
00174
00176 #endif