void pyepg_init ( void )
{
+ char buf[256];
+
/* Internal module */
- epggrab_module_int_create(NULL, "/usr/bin/pyepg", "PyEPG", 4,
- "/usr/bin/pyepg",
- NULL, _pyepg_parse, NULL, NULL);
+ if (find_exec("pyepg", buf, sizeof(buf)-1))
+ epggrab_module_int_create(NULL, "pyepg-internal", "PyEPG", 4, buf,
+ NULL, _pyepg_parse, NULL, NULL);
/* External module */
_pyepg_module = (epggrab_module_t*)
/*
* Search PATH for executable
*/
-static int
-_find_exec ( const char *name, char *out, size_t len )
+int
+find_exec ( const char *name, char *out, size_t len )
{
int ret = 0;
char bin[512];
const char *local_argv[2] = { NULL, NULL };
if (*prog != '/' && *prog != '.') {
- if (!_find_exec(prog, bin, sizeof(bin))) return -1;
+ if (!find_exec(prog, bin, sizeof(bin))) return -1;
prog = bin;
}
const char *local_argv[2] = { NULL, NULL };
if (*prog != '/' && *prog != '.') {
- if (!_find_exec(prog, bin, sizeof(bin))) return -1;
+ if (!find_exec(prog, bin, sizeof(bin))) return -1;
prog = bin;
}
#ifndef SPAWN_H
#define SPAWN_H
+int find_exec ( const char *name, char *out, size_t len );
+
int spawn_and_store_stdout(const char *prog, char *argv[], char **outp);
int spawnv(const char *prog, char *argv[]);