47 lines
1.4 KiB
C
47 lines
1.4 KiB
C
#ifndef FX_DIAGNOSTICS_PROCESS_H_
|
|
#define FX_DIAGNOSTICS_PROCESS_H_
|
|
|
|
#include <fx/collections/hashtable.h>
|
|
#include <fx/macros.h>
|
|
#include <fx/stream.h>
|
|
|
|
FX_DECLS_BEGIN;
|
|
|
|
#define FX_DIAGNOSTICS_TYPE_PROCESS (fx_process_get_type())
|
|
|
|
FX_DECLARE_TYPE(fx_process);
|
|
|
|
FX_TYPE_CLASS_DECLARATION_BEGIN(fx_process)
|
|
FX_TYPE_CLASS_DECLARATION_END(fx_process)
|
|
|
|
typedef struct fx_process_start_info {
|
|
bool proc_redirect_stdin, proc_redirect_stdout, proc_redirect_stderr;
|
|
const char *proc_file_name;
|
|
const char **proc_args;
|
|
size_t proc_args_count;
|
|
const fx_hashtable *proc_environment;
|
|
} fx_process_start_info;
|
|
|
|
FX_API fx_type_id fx_process_get_type(void);
|
|
|
|
FX_API fx_process *fx_process_create(const fx_process_start_info *info);
|
|
|
|
FX_API fx_process *fx_process_get_self(void);
|
|
|
|
FX_API fx_status fx_process_start(fx_process *proc);
|
|
FX_API fx_status fx_process_wait(fx_process *proc, int *out_result);
|
|
FX_API fx_status fx_process_kill(fx_process *proc);
|
|
|
|
FX_API const fx_hashtable *fx_process_get_environment(const fx_process *proc);
|
|
FX_API fx_stream *fx_process_get_stdin(fx_process *proc);
|
|
FX_API fx_stream *fx_process_get_stdout(fx_process *proc);
|
|
FX_API fx_stream *fx_process_get_stderr(fx_process *proc);
|
|
|
|
FX_API void fx_process_close_stdin(fx_process *proc);
|
|
FX_API void fx_process_close_stdout(fx_process *proc);
|
|
FX_API void fx_process_close_stderr(fx_process *proc);
|
|
|
|
FX_DECLS_END;
|
|
|
|
#endif
|