chiark / gitweb /
Import gnupg2_2.1.17.orig.tar.bz2
[gnupg2.git] / g10 / exec.h
1 /* exec.h
2  * Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
3  *
4  * This file is part of GnuPG.
5  *
6  * GnuPG is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * GnuPG is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, see <https://www.gnu.org/licenses/>.
18  */
19
20 #ifndef _EXEC_H_
21 #define _EXEC_H_
22
23 #include <unistd.h>
24 #include <stdio.h>
25
26 #include "../common/iobuf.h"
27
28 struct exec_info
29 {
30   int progreturn;
31   struct
32   {
33     unsigned int binary:1;
34     unsigned int writeonly:1;
35     unsigned int madedir:1;
36     unsigned int use_temp_files:1;
37     unsigned int keep_temp_files:1;
38   } flags;
39   pid_t child;
40   FILE *tochild;
41   iobuf_t fromchild;
42   char *command,*name,*tempdir,*tempfile_in,*tempfile_out;
43 };
44
45 int exec_write(struct exec_info **info,const char *program,
46                const char *args_in,const char *name,int writeonly,int binary);
47 int exec_read(struct exec_info *info);
48 int exec_finish(struct exec_info *info);
49 int set_exec_path(const char *path);
50
51 #endif /* !_EXEC_H_ */