]> git.decadent.org.uk Git - ion3.git/blob - utils/ion-statusd/exec.c
d15f0ab1332860307ee7e1f2140e3b27ee591cc1
[ion3.git] / utils / ion-statusd / exec.c
1 /*
2  * ion/utils/ion-statusd/exec.c
3  *
4  * Copyright (c) Tuomo Valkonen 2005-2008. 
5  *
6  * See the included file LICENSE for details.
7  */
8
9
10 #include <libmainloop/select.h>
11 #include <libmainloop/exec.h>
12
13
14 /*EXTL_DOC
15  * Run \var{cmd} in the background. 
16  */
17 EXTL_SAFE
18 EXTL_EXPORT
19 int statusd_exec(const char *cmd)
20 {
21     return mainloop_spawn(cmd);
22 }
23
24
25 /*EXTL_DOC
26  * Run \var{cmd} with a read pipe connected to its stdout.
27  * When data is received through the pipe, \var{h} is called
28  * with that data.
29  */
30 EXTL_SAFE
31 EXTL_EXPORT
32 int statusd_popen_bgread(const char *cmd, ExtlFn h, ExtlFn errh)
33 {
34     return mainloop_popen_bgread(cmd, NULL, NULL, h, errh);
35 }
36