chiark / gitweb /
gpg agent lockup fix: Interrupt main loop when active_connections_value==0
[gnupg2.git] / g10 / gpg.h
1 /* gpg.h - top level include file for gpg etc.
2  * Copyright (C) 2003, 2006, 2010 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 #ifndef GNUPG_G10_GPG_H
20 #define GNUPG_G10_GPG_H
21
22 /* Note, that this file should be the first one after the system
23    header files.  This is required to set the error source to the
24    correct value and may be of advantage if we ever have to do
25    special things. */
26
27 #ifdef GPG_ERR_SOURCE_DEFAULT
28 #error GPG_ERR_SOURCE_DEFAULT already defined
29 #endif
30 #define GPG_ERR_SOURCE_DEFAULT  GPG_ERR_SOURCE_GPG
31 #define map_assuan_err(a) \
32         map_assuan_err_with_source (GPG_ERR_SOURCE_DEFAULT, (a))
33 #include <gpg-error.h>
34 #include <gcrypt.h>
35
36
37 /* Number of bits we accept when reading or writing MPIs. */
38 #define MAX_EXTERN_MPI_BITS 16384
39
40 /* The maximum length of a binary fingerprints.  This is used to
41    provide a static buffer and will be increased if we need to support
42    longer fingerprints.
43    Warning: At some places we still use 20 instead of this macro. */
44 #define MAX_FINGERPRINT_LEN 20
45
46 /* The maximum length of a formatted fingerprint as returned by
47    format_hexfingerprint().  */
48 #define MAX_FORMATTED_FINGERPRINT_LEN 50
49
50
51 /*
52    Forward declarations.
53  */
54
55 /* Object used to keep state locally to server.c . */
56 struct server_local_s;
57
58 /* Object used to keep state locally to call-dirmngr.c .  */
59 struct dirmngr_local_s;
60 typedef struct dirmngr_local_s *dirmngr_local_t;
61
62 /* Object used to describe a keyblok node.  */
63 typedef struct kbnode_struct *KBNODE;   /* Deprecated use kbnode_t. */
64 typedef struct kbnode_struct *kbnode_t;
65
66 /* TOFU database meta object.  */
67 struct tofu_dbs_s;
68 typedef struct tofu_dbs_s *tofu_dbs_t;
69
70
71 /* Session control object.  This object is passed to most functions to
72    convey the status of a session.  Note that the defaults are set by
73    gpg_init_default_ctrl(). */
74 struct server_control_s
75 {
76   /* Local data for server.c  */
77   struct server_local_s *server_local;
78
79   /* Local data for call-dirmngr.c  */
80   dirmngr_local_t dirmngr_local;
81
82   /* Local data for tofu.c  */
83   struct {
84     tofu_dbs_t dbs;
85     int batch_updated_wanted;
86   } tofu;
87
88 };
89
90
91
92 #endif /*GNUPG_G10_GPG_H*/