00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef DEBIAN_INSTALLER__EXEC_H
00021 #define DEBIAN_INSTALLER__EXEC_H
00022
00023 #include <debian-installer/types.h>
00024
00025 #include <sys/types.h>
00026 #include <sys/wait.h>
00027 #include <unistd.h>
00028
00034 di_io_handler
00038 di_exec_io_log;
00039 di_process_handler
00045 di_exec_prepare_chdir,
00051 di_exec_prepare_chroot;
00052
00068 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);
00069
00078 static inline int di_exec (const char *path, const char *const argv[])
00079 {
00080 return di_exec_full (path, argv, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
00081 }
00082
00099 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);
00100
00110 static inline int di_exec_env (const char *path, const char *const argv[], const char *const envp[])
00111 {
00112 return di_exec_env_full (path, argv, envp, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
00113 }
00114
00130 int di_exec_path_full (const char *file, 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);
00131
00140 static inline int di_exec_path (const char *file, const char *const argv[])
00141 {
00142 return di_exec_path_full (file, argv, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
00143 }
00144
00159 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);
00160
00168 static inline int di_exec_shell (const char *const cmd)
00169 {
00170 return di_exec_shell_full (cmd, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
00171 }
00172
00180 inline static int di_exec_shell_log (const char *const cmd)
00181 {
00182 return di_exec_shell_full (cmd, di_exec_io_log, NULL, NULL, NULL, NULL, NULL, NULL);
00183 }
00184
00190 int di_exec_mangle_status (int status);
00191
00196 inline static int di_execlog (const char *const cmd) __attribute__ ((deprecated));
00197 inline static int di_execlog (const char *const cmd)
00198 {
00199 return di_exec_shell_log (cmd);
00200 }
00201
00203 #endif