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 
32 typedef struct
33  {
34  int stdin_fd;
35  int stdout_fd;
36  int stderr_fd;
37 
38  void * priv;
40 
51 bg_subprocess_t * bg_subprocess_create(const char * command, int do_stdin,
52  int do_stdout, int do_stderr);
53 
61 void bg_subprocess_kill(bg_subprocess_t* proc, int signal);
62 
69 
78 int bg_subprocess_read_line(int fd, char ** ret, int * ret_alloc,
79  int timeout);
80 
91 int bg_subprocess_read_data(int fd, uint8_t * ret, int len);
92 
100 int bg_system(const char * command);
101