21 #define PROCESS_MAX_WRITE (1024)
24 #define PROCESS_MAX_READ (1024)
57 typedef uint64_t process_exit_code_t;
58 typedef uint64_t process_pid_t;
60 typedef void (*process_read_callback_t)(
process_t *,
64 (*process_exit_callback_t)(
process_t *, process_exit_code_t);
72 #define process_free(s) FREE_AND_NULL(process_t, process_free_, (s))
80 process_read_callback_t);
82 process_read_callback_t);
84 process_exit_callback_t);
114 struct process_win32_t;
115 struct process_win32_t *process_get_win32_process(
const process_t *process);
119 const uint8_t *data,
size_t size);
121 const char *format, va_list args) CHECK_PRINTF(2, 0);
123 const char *format, ...) CHECK_PRINTF(2, 3);
129 process_exit_code_t);
131 #ifdef PROCESS_PRIVATE
138 struct buf_t *buffer,
139 process_read_callback_t callback);
141 struct buf_t *buffer,
142 process_read_callback_t callback);
144 struct buf_t *buffer,
145 process_read_callback_t callback);
tor_cmdline_mode_t command
Headers for util_malloc.c.
STATIC void process_read_data(process_t *process, buf_t *buffer, process_read_callback_t callback)
STATIC void process_write_stdin(process_t *process, buf_t *buffer)
STATIC void process_read_lines(process_t *process, buf_t *buffer, process_read_callback_t callback)
STATIC void process_read_buffer(process_t *process, buf_t *buffer, process_read_callback_t callback)
void process_reset_environment(process_t *process, const smartlist_t *env)
STATIC int process_read_stdout(process_t *process, buf_t *buffer)
STATIC int process_read_stderr(process_t *process, buf_t *buffer)
void process_notify_event_stdout(process_t *process)
void process_set_data(process_t *process, void *data)
void process_write(process_t *process, const uint8_t *data, size_t size)
void process_notify_event_stderr(process_t *process)
void process_free_(process_t *process)
void process_set_status(process_t *process, process_status_t status)
const char * process_status_to_string(process_status_t status)
void process_set_environment(process_t *process, const char *key, const char *value)
struct process_unix_t * process_get_unix_process(const process_t *process)
void process_append_argument(process_t *process, const char *argument)
void process_set_exit_callback(process_t *, process_exit_callback_t)
void * process_get_data(const process_t *process)
const struct smartlist_t * process_get_all_processes(void)
const char * process_get_command(const process_t *process)
const struct smartlist_t * process_get_arguments(const process_t *process)
process_t * process_new(const char *command)
void process_vprintf(process_t *process, const char *format, va_list args)
void process_free_all(void)
void process_set_stderr_read_callback(process_t *, process_read_callback_t)
void process_notify_event_exit(process_t *process, process_exit_code_t)
void process_set_stdout_read_callback(process_t *, process_read_callback_t)
process_protocol_t process_get_protocol(const process_t *process)
struct process_environment_t * process_get_environment(const process_t *)
void tor_disable_spawning_background_processes(void)
const char * process_protocol_to_string(process_protocol_t protocol)
process_status_t process_get_status(const process_t *process)
char ** process_get_argv(const process_t *process)
bool process_terminate(process_t *process)
void process_notify_event_stdin(process_t *process)
void process_printf(process_t *process, const char *format,...)
@ PROCESS_STATUS_NOT_RUNNING
process_status_t process_exec(process_t *process)
process_pid_t process_get_pid(process_t *process)
#define MOCK_DECL(rv, funcname, arglist)