chiark / gitweb /
gpg: Fix searching for mail addresses in keyrings.
[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
42 /* Initialize the components.  */
43 void gc_components_init (void);
44
45 /* Percent-Escape special characters.  The string is valid until the
46    next invocation of the function.  */
47 char *gc_percent_escape (const char *src);
48
49
50 void gc_error (int status, int errnum, const char *fmt, ...);
51
52 /* Launch given component.  */
53 gpg_error_t gc_component_launch (int component);
54
55 /* Kill given component.  */
56 void gc_component_kill (int component);
57
58 /* Reload given component.  */
59 void gc_component_reload (int component);
60
61 /* List all components that are available.  */
62 void gc_component_list_components (estream_t out);
63
64 /* List all programs along with their status.  */
65 void gc_check_programs (estream_t out);
66
67 /* Find the component with the name NAME.  Returns -1 if not
68    found.  */
69 int gc_component_find (const char *name);
70
71 /* Retrieve the currently active options and their defaults from all
72    involved backends for this component.  */
73 void gc_component_retrieve_options (int component);
74
75 /* List all options of the component COMPONENT.  */
76 void gc_component_list_options (int component, estream_t out);
77
78 /* Read the modifications from IN and apply them.  */
79 void gc_component_change_options (int component, estream_t in, estream_t out,
80                                   int verbatim);
81
82 /* Check the options of a single component.  Returns 0 if everything
83    is OK.  */
84 int gc_component_check_options (int component, estream_t out,
85                                 const char *conf_file);
86
87 /* Process global configuration file.  */
88 int gc_process_gpgconf_conf (const char *fname, int update, int defaults,
89                              estream_t listfp);
90
91 /* Apply a profile.  */
92 gpg_error_t gc_apply_profile (const char *fname);
93
94
95 #endif /*GPGCONF_H*/