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
46 /* Forward declarations. */
47 typedef struct kbnode_struct
*KBNODE
;
48 typedef struct keydb_search_desc KEYDB_SEARCH_DESC
;
52 /* Simple wrappers. */
53 #define g10_errstr(a) gpg_strerror ((a))
56 /* Mapping of the old erro codes to the gpg-error ones. Fixme: This
57 is just a temporary solution: We need to do all these gpg_error()
59 #define G10ERR_BAD_KEY GPG_ERR_BAD_KEY
60 #define G10ERR_BAD_PASS GPG_ERR_BAD_PASS
61 #define G10ERR_BAD_PUBKEY GPG_ERR_BAD_PUBKEY
62 #define G10ERR_BAD_SIGN GPG_ERR_BAD_SIGNATURE
63 #define G10ERR_BAD_URI GPG_ERR_BAD_URI
64 #define G10ERR_CHECKSUM GPG_ERR_CHECKSUM
65 #define G10ERR_CIPHER_ALGO GPG_ERR_CIPHER_ALGO
66 #define G10ERR_CLOSE_FILE GPG_ERR_CLOSE_FILE
67 #define G10ERR_COMPR_ALGO GPG_ERR_COMPR_ALGO
68 #define G10ERR_CREATE_FILE GPG_ERR_CREATE_FILE
69 #define G10ERR_DIGEST_ALGO GPG_ERR_DIGEST_ALGO
70 #define G10ERR_FILE_EXISTS GPG_ERR_EEXIST
71 #define G10ERR_GENERAL GPG_ERR_GENERAL
72 #define G10ERR_INV_ARG GPG_ERR_INV_ARG
73 #define G10ERR_INV_KEYRING GPG_ERR_INV_KEYRING
74 #define G10ERR_INV_USER_ID GPG_ERR_INV_USER_ID
75 #define G10ERR_INVALID_ARMOR GPG_ERR_INV_ARMOR
76 #define G10ERR_INVALID_PACKET GPG_ERR_INV_PACKET
77 #define G10ERR_KEYRING_OPEN GPG_ERR_KEYRING_OPEN
78 #define G10ERR_KEYSERVER GPG_ERR_KEYSERVER
79 #define G10ERR_NO_DATA GPG_ERR_NO_DATA
80 #define G10ERR_NO_PUBKEY GPG_ERR_NO_PUBKEY
81 #define G10ERR_NO_SECKEY GPG_ERR_NO_SECKEY
82 #define G10ERR_NO_USER_ID GPG_ERR_NO_USER_ID
83 #define G10ERR_NOT_PROCESSED GPG_ERR_NOT_PROCESSED
84 #define G10ERR_OPEN_FILE GPG_ERR_OPEN_FILE
85 #define G10ERR_PASSPHRASE GPG_ERR_PASSPHRASE
86 #define G10ERR_PUBKEY_ALGO GPG_ERR_PUBKEY_ALGO
87 #define G10ERR_READ_FILE GPG_ERR_READ_FILE
88 #define G10ERR_RENAME_FILE GPG_ERR_RENAME_FILE
89 #define G10ERR_RESOURCE_LIMIT GPG_ERR_RESOURCE_LIMIT
90 #define G10ERR_SIG_CLASS GPG_ERR_SIG_CLASS
91 #define G10ERR_TIME_CONFLICT GPG_ERR_TIME_CONFLICT
92 #define G10ERR_TRUSTDB GPG_ERR_TRUSTDB
93 #define G10ERR_UNEXPECTED GPG_ERR_UNEXPECTED
94 #define G10ERR_UNKNOWN_PACKET GPG_ERR_UNKNOWN_PACKET
95 #define G10ERR_UNSUPPORTED GPG_ERR_UNSUPPORTED
96 #define G10ERR_UNU_PUBKEY GPG_ERR_UNUSABLE_PUBKEY
97 #define G10ERR_UNU_SECKEY GPG_ERR_UNUSABLE_SECKEY
98 #define G10ERR_WRONG_SECKEY GPG_ERR_WRONG_SECKEY
102 #endif /*GNUPG_G10_GPG_H*/