X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=utils%2Fion-statusd%2Fexec.c;fp=utils%2Fion-statusd%2Fexec.c;h=9ccc2d91f7d684f1b370425090deaaf7e785ae1f;hb=a6561c9679cd701b0d50c3cfd44e4664f7df2b2f;hp=0000000000000000000000000000000000000000;hpb=cd09055902de482a1be019bf4b4efdae64c98d35;p=ion3.git diff --git a/utils/ion-statusd/exec.c b/utils/ion-statusd/exec.c new file mode 100644 index 0000000..9ccc2d9 --- /dev/null +++ b/utils/ion-statusd/exec.c @@ -0,0 +1,39 @@ +/* + * ion/utils/ion-statusd/exec.c + * + * Copyright (c) Tuomo Valkonen 2005-2006. + * + * Ion is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + */ + + +#include +#include + + +/*EXTL_DOC + * Run \var{cmd} in the background. + */ +EXTL_SAFE +EXTL_EXPORT +int statusd_exec(const char *cmd) +{ + return mainloop_spawn(cmd); +} + + +/*EXTL_DOC + * Run \var{cmd} with a read pipe connected to its stdout. + * When data is received through the pipe, \var{h} is called + * with that data. + */ +EXTL_SAFE +EXTL_EXPORT +int statusd_popen_bgread(const char *cmd, ExtlFn h, ExtlFn errh) +{ + return mainloop_popen_bgread(cmd, NULL, NULL, h, errh); +} +