1 /* gpg.h - top level include file for gpg etc.
2 * Copyright (C) 2003, 2006 Free Software Foundation, Inc.
4 * This file is part of GnuPG.
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 2 of the License, or
9 * (at your option) any later version.
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.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
21 #ifndef GNUPG_G10_GPG_H
22 #define GNUPG_G10_GPG_H
24 /* Note, that this file should be the first one after the system
25 header files. This is required to set the error source to the
26 correct value and may be of advantage if we ever have to do
29 #ifdef GPG_ERR_SOURCE_DEFAULT
30 #error GPG_ERR_SOURCE_DEFAULT already defined
32 #define GPG_ERR_SOURCE_DEFAULT GPG_ERR_SOURCE_GPG
33 #define map_assuan_err(a) \
34 map_assuan_err_with_source (GPG_ERR_SOURCE_DEFAULT, (a))
35 #include <gpg-error.h>
39 /* Number of bits we accept when reading or writing MPIs. */
40 #define MAX_EXTERN_MPI_BITS 16384
42 /* The maximum length of a binary fingerprints. */
43 #define MAX_FINGERPRINT_LEN 20
50 /* Object used to keep state locally to server.c . */
51 struct server_local_s
;
53 /* Object used to describe a keyblok node. */
54 typedef struct kbnode_struct
*KBNODE
;
55 /* Object used for looking ob keys. */
56 typedef struct keydb_search_desc KEYDB_SEARCH_DESC
;
60 /* Session control object. This object is passed to most functions to
61 convey the status of a session. Note that the defaults are set by
62 gpg_init_default_ctrl(). */
63 struct server_control_s
65 struct server_local_s
*server_local
;
67 typedef struct server_control_s
*ctrl_t
;
73 int gpg_server (ctrl_t
);
81 Compatibility stuff to be faded out over time.
84 /* Simple wrappers. */
85 #define g10_errstr(a) gpg_strerror ((a))
88 /* Mapping of the old erro codes to the gpg-error ones. Fixme: This
89 is just a temporary solution: We need to do all these gpg_error()
91 #define G10ERR_BAD_KEY GPG_ERR_BAD_KEY
92 #define G10ERR_BAD_PASS GPG_ERR_BAD_PASS
93 #define G10ERR_BAD_PUBKEY GPG_ERR_BAD_PUBKEY
94 #define G10ERR_BAD_SIGN GPG_ERR_BAD_SIGNATURE
95 #define G10ERR_BAD_URI GPG_ERR_BAD_URI
96 #define G10ERR_CHECKSUM GPG_ERR_CHECKSUM
97 #define G10ERR_CIPHER_ALGO GPG_ERR_CIPHER_ALGO
98 #define G10ERR_CLOSE_FILE GPG_ERR_CLOSE_FILE
99 #define G10ERR_COMPR_ALGO GPG_ERR_COMPR_ALGO
100 #define G10ERR_CREATE_FILE GPG_ERR_CREATE_FILE
101 #define G10ERR_DIGEST_ALGO GPG_ERR_DIGEST_ALGO
102 #define G10ERR_FILE_EXISTS GPG_ERR_EEXIST
103 #define G10ERR_GENERAL GPG_ERR_GENERAL
104 #define G10ERR_INV_ARG GPG_ERR_INV_ARG
105 #define G10ERR_INV_KEYRING GPG_ERR_INV_KEYRING
106 #define G10ERR_INV_USER_ID GPG_ERR_INV_USER_ID
107 #define G10ERR_INVALID_ARMOR GPG_ERR_INV_ARMOR
108 #define G10ERR_INVALID_PACKET GPG_ERR_INV_PACKET
109 #define G10ERR_KEYRING_OPEN GPG_ERR_KEYRING_OPEN
110 #define G10ERR_KEYSERVER GPG_ERR_KEYSERVER
111 #define G10ERR_NO_DATA GPG_ERR_NO_DATA
112 #define G10ERR_NO_PUBKEY GPG_ERR_NO_PUBKEY
113 #define G10ERR_NO_SECKEY GPG_ERR_NO_SECKEY
114 #define G10ERR_NO_USER_ID GPG_ERR_NO_USER_ID
115 #define G10ERR_NOT_PROCESSED GPG_ERR_NOT_PROCESSED
116 #define G10ERR_OPEN_FILE GPG_ERR_OPEN_FILE
117 #define G10ERR_PASSPHRASE GPG_ERR_PASSPHRASE
118 #define G10ERR_PUBKEY_ALGO GPG_ERR_PUBKEY_ALGO
119 #define G10ERR_READ_FILE GPG_ERR_READ_FILE
120 #define G10ERR_RENAME_FILE GPG_ERR_RENAME_FILE
121 #define G10ERR_RESOURCE_LIMIT GPG_ERR_RESOURCE_LIMIT
122 #define G10ERR_SIG_CLASS GPG_ERR_SIG_CLASS
123 #define G10ERR_TIME_CONFLICT GPG_ERR_TIME_CONFLICT
124 #define G10ERR_TRUSTDB GPG_ERR_TRUSTDB
125 #define G10ERR_UNEXPECTED GPG_ERR_UNEXPECTED
126 #define G10ERR_UNKNOWN_PACKET GPG_ERR_UNKNOWN_PACKET
127 #define G10ERR_UNSUPPORTED GPG_ERR_UNSUPPORTED
128 #define G10ERR_UNU_PUBKEY GPG_ERR_UNUSABLE_PUBKEY
129 #define G10ERR_UNU_SECKEY GPG_ERR_UNUSABLE_SECKEY
130 #define G10ERR_WRONG_SECKEY GPG_ERR_WRONG_SECKEY
133 #endif /*GNUPG_G10_GPG_H*/