• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* process.h
2  *
3  * Copyright (C) 2008 Till Kamppeter <till.kamppeter@gmail.com>
4  * Copyright (C) 2008 Lars Karlitski (formerly Uebernickel) <lars@karlitski.net>
5  *
6  * This file is part of foomatic-rip.
7  *
8  * Foomatic-rip 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  * Foomatic-rip is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the
20  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
24 #ifndef process_h
25 #define process_h
26 
27 #include <stdio.h>
28 #include <sys/types.h>
29 #include <sys/wait.h>
30 
31 pid_t start_process(const char *name, int (*proc_func)(), void *user_arg, FILE **fdin, FILE **fdout);
32 pid_t start_system_process(const char *name, const char *command, FILE **fdin, FILE **fdout);
33 
34 /* returns command's return status (see waitpid(2)) */
35 int run_system_process(const char *name, const char *command);
36 
37 pid_t create_pipe_process(const char *name,
38                           FILE *src,
39                           FILE *dest,
40                           const char *alreadyread,
41                           size_t alreadyread_len);
42 
43 int wait_for_process(int pid);
44 
45 void kill_all_processes();
46 
47 #endif
48 
49