gmerlin
subprocess.h
1/*****************************************************************
2 * gmerlin - a general purpose multimedia framework and applications
3 *
4 * Copyright (c) 2001 - 2012 Members of the Gmerlin project
5 * gmerlin-general@lists.sourceforge.net
6 * http://gmerlin.sourceforge.net
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 * *****************************************************************/
21
32typedef struct
33 {
37
38 void * priv;
40
51bg_subprocess_t * bg_subprocess_create(const char * command, int do_stdin,
52 int do_stdout, int do_stderr);
53
61void bg_subprocess_kill(bg_subprocess_t* proc, int signal);
62
69
78int bg_subprocess_read_line(int fd, char ** ret, int * ret_alloc,
79 int timeout);
80
91int bg_subprocess_read_data(int fd, uint8_t * ret, int len);
92
100int bg_system(const char * command);
101
void bg_subprocess_kill(bg_subprocess_t *proc, int signal)
Send a signal to a process.
int bg_system(const char *command)
Run a command as a subprocess.
int bg_subprocess_read_data(int fd, uint8_t *ret, int len)
Read data from stdout or stderr of a process.
bg_subprocess_t * bg_subprocess_create(const char *command, int do_stdin, int do_stdout, int do_stderr)
Create a subprocess.
int bg_subprocess_close(bg_subprocess_t *proc)
Close a subprocess and free all associated memory.
int bg_subprocess_read_line(int fd, char **ret, int *ret_alloc, int timeout)
Read a line from stdout or stderr of a process.
Subprocess handle.
Definition subprocess.h:33
int stdin_fd
Filedescriptor, which is a pipe to the stdin of the process
Definition subprocess.h:34
void * priv
Internals made opaque.
Definition subprocess.h:38
int stdout_fd
Filedescriptor, which is a pipe to the stdout of the process.
Definition subprocess.h:35
int stderr_fd
Filedescriptor, which is a pipe to the stderr of the process.
Definition subprocess.h:36