chiark / gitweb /
agent: Allow threads to interrupt main select loop with SIGCONT.
[gnupg2.git] / tools / gpgconf.h
1 /* gpgconf.h - Global definitions for gpgconf
2  *      Copyright (C) 2003 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 GPGCONF_H
21 #define GPGCONF_H
22
23 #include "../common/util.h"
24
25 /* We keep all global options in the structure OPT.  */
26 struct
27 {
28   int verbose;          /* Verbosity level.  */
29   int quiet;            /* Be extra quiet.  */
30   int dry_run;          /* Don't change any persistent data.  */
31   int runtime;          /* Make changes active at runtime.  */
32   int null;             /* Option -0 active.  */
33   char *outfile;        /* Name of output file.  */
34
35   int component;        /* The active component.  */
36 } opt;
37
38
39
40 /*-- gpgconf-comp.c --*/
41 /* Percent-Escape special characters.  The string is valid until the
42    next invocation of the function.  */
43 char *gc_percent_escape (const char *src);
44
45
46 void gc_error (int status, int errnum, const char *fmt, ...);
47
48 /* Launch given component.  */
49 gpg_error_t gc_component_launch (int component);
50
51 /* Kill given component.  */
52 void gc_component_kill (int component);
53
54 /* Reload given component.  */
55 void gc_component_reload (int component);
56
57 /* List all components that are available.  */
58 void gc_component_list_components (estream_t out);
59
60 /* List all programs along with their status.  */
61 void gc_check_programs (estream_t out);
62
63 /* Find the component with the name NAME.  Returns -1 if not
64    found.  */
65 int gc_component_find (const char *name);
66
67 /* Retrieve the currently active options and their defaults from all
68    involved backends for this component.  */
69 void gc_component_retrieve_options (int component);
70
71 /* List all options of the component COMPONENT.  */
72 void gc_component_list_options (int component, estream_t out);
73
74 /* Read the modifications from IN and apply them.  */
75 void gc_component_change_options (int component, estream_t in, estream_t out,
76                                   int verbatim);
77
78 /* Check the options of a single component.  Returns 0 if everything
79    is OK.  */
80 int gc_component_check_options (int component, estream_t out,
81                                 const char *conf_file);
82
83 /* Process global configuration file.  */
84 int gc_process_gpgconf_conf (const char *fname, int update, int defaults,
85                              estream_t listfp);
86
87 /* Apply a profile.  */
88 gpg_error_t gc_apply_profile (const char *fname);
89
90
91 #endif /*GPGCONF_H*/