]> git.decadent.org.uk Git - ion3.git/blob - mod_statusbar/ion-statusd/exec.c
[svn-inject] Installing original source of ion3
[ion3.git] / mod_statusbar / ion-statusd / exec.c
1 /*
2  * ion/mod_statusbar/ion-statusd/exec.c
3  *
4  * Copyright (c) Tuomo Valkonen 2005-2006. 
5  *
6  * Ion is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation; either version 2.1 of the License, or
9  * (at your option) any later version.
10  */
11
12
13 #include <libmainloop/select.h>
14 #include <libmainloop/exec.h>
15
16
17 /*EXTL_DOC
18  * Run \var{cmd} in the background. 
19  */
20 EXTL_SAFE
21 EXTL_EXPORT
22 int statusd_exec(const char *cmd)
23 {
24     return mainloop_spawn(cmd);
25 }
26
27
28 /*EXTL_DOC
29  * Run \var{cmd} with a read pipe connected to its stdout.
30  * When data is received through the pipe, \var{h} is called
31  * with that data.
32  */
33 EXTL_SAFE
34 EXTL_EXPORT
35 int statusd_popen_bgread(const char *cmd, ExtlFn h, ExtlFn errh)
36 {
37     return mainloop_popen_bgread(cmd, NULL, NULL, h, errh);
38 }
39