meta: add fx.diagnostics namespace and assembly
the fx.diagnostics namespace includes a process class for starting and managing processes
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
#ifndef FX_DIAGNOSTICS_PROCESS_H_
|
||||
#define FX_DIAGNOSTICS_PROCESS_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;
|
||||
} 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_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 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
|
||||
Reference in New Issue
Block a user