From bd82d030011cd8b9655e5ded6b6df9343b42a6bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 4 Feb 2015 14:09:54 +0100 Subject: Imported Upstream version 3.22 --- include/libHX/proc.h | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 include/libHX/proc.h (limited to 'include/libHX/proc.h') diff --git a/include/libHX/proc.h b/include/libHX/proc.h new file mode 100644 index 0000000..cb682ed --- /dev/null +++ b/include/libHX/proc.h @@ -0,0 +1,49 @@ +#ifndef _LIBHX_PROC_H +#define _LIBHX_PROC_H + +#ifndef __cplusplus +# include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +enum { + HXPROC_VERBOSE = 1 << 0, + HXPROC_EXECV = 1 << 1, + HXPROC_A0 = 1 << 2, + HXPROC_STDIN = 1 << 3, + HXPROC_STDOUT = 1 << 4, + HXPROC_STDERR = 1 << 5, + HXPROC_NULL_STDIN = 1 << 6, + HXPROC_NULL_STDOUT = 1 << 7, + HXPROC_NULL_STDERR = 1 << 8, +}; + +struct HXproc_ops { + void (*p_prefork)(void *); + void (*p_postfork)(void *); + void (*p_complete)(void *); +}; + +struct HXproc { + const struct HXproc_ops *p_ops; + void *p_data; + unsigned int p_flags; + + int p_stdin, p_stdout, p_stderr; + int p_pid; + char p_status; + bool p_exited, p_terminated; +}; + +extern int HXproc_run_async(const char *const *, struct HXproc *); +extern int HXproc_run_sync(const char *const *, unsigned int); +extern int HXproc_wait(struct HXproc *); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* _LIBHX_PROC_H */ -- cgit v1.2.3