Line data Source code
1 : /* gpg-error.h - Public interface to libgpg-error. -*- c -*-
2 : * Copyright (C) 2003, 2004, 2010, 2013, 2014, 2015, 2016 g10 Code GmbH
3 : *
4 : * This file is part of libgpg-error.
5 : *
6 : * libgpg-error is free software; you can redistribute it and/or
7 : * modify it under the terms of the GNU Lesser General Public License
8 : * as published by the Free Software Foundation; either version 2.1 of
9 : * the License, or (at your option) any later version.
10 : *
11 : * libgpg-error is distributed in the hope that it will be useful, but
12 : * WITHOUT ANY WARRANTY; without even the implied warranty of
13 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 : * Lesser General Public License for more details.
15 : *
16 : * You should have received a copy of the GNU Lesser General Public
17 : * License along with this program; if not, see <https://www.gnu.org/licenses/>.
18 : *
19 : * Do not edit. Generated from gpg-error.h.in for:
20 : x86_64-pc-linux-gnu
21 : */
22 :
23 : #ifndef GPG_ERROR_H
24 : #define GPG_ERROR_H 1
25 :
26 : #include <stddef.h>
27 : #include <stdio.h>
28 : #include <stdarg.h>
29 :
30 : /* The version string of this header. */
31 : #define GPG_ERROR_VERSION "1.26"
32 : #define GPGRT_VERSION "1.26"
33 :
34 : /* The version number of this header. */
35 : #define GPG_ERROR_VERSION_NUMBER 0x011a00
36 : #define GPGRT_VERSION_NUMBER 0x011a00
37 :
38 :
39 : #ifdef __GNUC__
40 : # define GPG_ERR_INLINE __inline__
41 : #elif defined(_MSC_VER) && _MSC_VER >= 1300
42 : # define GPG_ERR_INLINE __inline
43 : #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
44 : # define GPG_ERR_INLINE inline
45 : #else
46 : # ifndef GPG_ERR_INLINE
47 : # define GPG_ERR_INLINE
48 : # endif
49 : #endif
50 :
51 : #ifdef __cplusplus
52 : extern "C" {
53 : #if 0 /* just to make Emacs auto-indent happy */
54 : }
55 : #endif
56 : #endif /* __cplusplus */
57 :
58 : /* The GnuPG project consists of many components. Error codes are
59 : exchanged between all components. The common error codes and their
60 : user-presentable descriptions are kept into a shared library to
61 : allow adding new error codes and components without recompiling any
62 : of the other components. The interface will not change in a
63 : backward incompatible way.
64 :
65 : An error code together with an error source build up an error
66 : value. As the error value is been passed from one component to
67 : another, it preserver the information about the source and nature
68 : of the error.
69 :
70 : A component of the GnuPG project can define the following macros to
71 : tune the behaviour of the library:
72 :
73 : GPG_ERR_SOURCE_DEFAULT: Define to an error source of type
74 : gpg_err_source_t to make that source the default for gpg_error().
75 : Otherwise GPG_ERR_SOURCE_UNKNOWN is used as default.
76 :
77 : GPG_ERR_ENABLE_GETTEXT_MACROS: Define to provide macros to map the
78 : internal gettext API to standard names. This has only an effect on
79 : Windows platforms.
80 :
81 : GPGRT_ENABLE_ES_MACROS: Define to provide "es_" macros for the
82 : estream functions.
83 :
84 : In addition to the error codes, Libgpg-error also provides a set of
85 : functions used by most GnuPG components. */
86 :
87 :
88 : /* The error source type gpg_err_source_t.
89 :
90 : Where as the Poo out of a welle small
91 : Taketh his firste springing and his sours.
92 : --Chaucer. */
93 :
94 : /* Only use free slots, never change or reorder the existing
95 : entries. */
96 : typedef enum
97 : {
98 : GPG_ERR_SOURCE_UNKNOWN = 0,
99 : GPG_ERR_SOURCE_GCRYPT = 1,
100 : GPG_ERR_SOURCE_GPG = 2,
101 : GPG_ERR_SOURCE_GPGSM = 3,
102 : GPG_ERR_SOURCE_GPGAGENT = 4,
103 : GPG_ERR_SOURCE_PINENTRY = 5,
104 : GPG_ERR_SOURCE_SCD = 6,
105 : GPG_ERR_SOURCE_GPGME = 7,
106 : GPG_ERR_SOURCE_KEYBOX = 8,
107 : GPG_ERR_SOURCE_KSBA = 9,
108 : GPG_ERR_SOURCE_DIRMNGR = 10,
109 : GPG_ERR_SOURCE_GSTI = 11,
110 : GPG_ERR_SOURCE_GPA = 12,
111 : GPG_ERR_SOURCE_KLEO = 13,
112 : GPG_ERR_SOURCE_G13 = 14,
113 : GPG_ERR_SOURCE_ASSUAN = 15,
114 : GPG_ERR_SOURCE_TLS = 17,
115 : GPG_ERR_SOURCE_ANY = 31,
116 : GPG_ERR_SOURCE_USER_1 = 32,
117 : GPG_ERR_SOURCE_USER_2 = 33,
118 : GPG_ERR_SOURCE_USER_3 = 34,
119 : GPG_ERR_SOURCE_USER_4 = 35,
120 :
121 : /* This is one more than the largest allowed entry. */
122 : GPG_ERR_SOURCE_DIM = 128
123 : } gpg_err_source_t;
124 :
125 :
126 : /* The error code type gpg_err_code_t. */
127 :
128 : /* Only use free slots, never change or reorder the existing
129 : entries. */
130 : typedef enum
131 : {
132 : GPG_ERR_NO_ERROR = 0,
133 : GPG_ERR_GENERAL = 1,
134 : GPG_ERR_UNKNOWN_PACKET = 2,
135 : GPG_ERR_UNKNOWN_VERSION = 3,
136 : GPG_ERR_PUBKEY_ALGO = 4,
137 : GPG_ERR_DIGEST_ALGO = 5,
138 : GPG_ERR_BAD_PUBKEY = 6,
139 : GPG_ERR_BAD_SECKEY = 7,
140 : GPG_ERR_BAD_SIGNATURE = 8,
141 : GPG_ERR_NO_PUBKEY = 9,
142 : GPG_ERR_CHECKSUM = 10,
143 : GPG_ERR_BAD_PASSPHRASE = 11,
144 : GPG_ERR_CIPHER_ALGO = 12,
145 : GPG_ERR_KEYRING_OPEN = 13,
146 : GPG_ERR_INV_PACKET = 14,
147 : GPG_ERR_INV_ARMOR = 15,
148 : GPG_ERR_NO_USER_ID = 16,
149 : GPG_ERR_NO_SECKEY = 17,
150 : GPG_ERR_WRONG_SECKEY = 18,
151 : GPG_ERR_BAD_KEY = 19,
152 : GPG_ERR_COMPR_ALGO = 20,
153 : GPG_ERR_NO_PRIME = 21,
154 : GPG_ERR_NO_ENCODING_METHOD = 22,
155 : GPG_ERR_NO_ENCRYPTION_SCHEME = 23,
156 : GPG_ERR_NO_SIGNATURE_SCHEME = 24,
157 : GPG_ERR_INV_ATTR = 25,
158 : GPG_ERR_NO_VALUE = 26,
159 : GPG_ERR_NOT_FOUND = 27,
160 : GPG_ERR_VALUE_NOT_FOUND = 28,
161 : GPG_ERR_SYNTAX = 29,
162 : GPG_ERR_BAD_MPI = 30,
163 : GPG_ERR_INV_PASSPHRASE = 31,
164 : GPG_ERR_SIG_CLASS = 32,
165 : GPG_ERR_RESOURCE_LIMIT = 33,
166 : GPG_ERR_INV_KEYRING = 34,
167 : GPG_ERR_TRUSTDB = 35,
168 : GPG_ERR_BAD_CERT = 36,
169 : GPG_ERR_INV_USER_ID = 37,
170 : GPG_ERR_UNEXPECTED = 38,
171 : GPG_ERR_TIME_CONFLICT = 39,
172 : GPG_ERR_KEYSERVER = 40,
173 : GPG_ERR_WRONG_PUBKEY_ALGO = 41,
174 : GPG_ERR_TRIBUTE_TO_D_A = 42,
175 : GPG_ERR_WEAK_KEY = 43,
176 : GPG_ERR_INV_KEYLEN = 44,
177 : GPG_ERR_INV_ARG = 45,
178 : GPG_ERR_BAD_URI = 46,
179 : GPG_ERR_INV_URI = 47,
180 : GPG_ERR_NETWORK = 48,
181 : GPG_ERR_UNKNOWN_HOST = 49,
182 : GPG_ERR_SELFTEST_FAILED = 50,
183 : GPG_ERR_NOT_ENCRYPTED = 51,
184 : GPG_ERR_NOT_PROCESSED = 52,
185 : GPG_ERR_UNUSABLE_PUBKEY = 53,
186 : GPG_ERR_UNUSABLE_SECKEY = 54,
187 : GPG_ERR_INV_VALUE = 55,
188 : GPG_ERR_BAD_CERT_CHAIN = 56,
189 : GPG_ERR_MISSING_CERT = 57,
190 : GPG_ERR_NO_DATA = 58,
191 : GPG_ERR_BUG = 59,
192 : GPG_ERR_NOT_SUPPORTED = 60,
193 : GPG_ERR_INV_OP = 61,
194 : GPG_ERR_TIMEOUT = 62,
195 : GPG_ERR_INTERNAL = 63,
196 : GPG_ERR_EOF_GCRYPT = 64,
197 : GPG_ERR_INV_OBJ = 65,
198 : GPG_ERR_TOO_SHORT = 66,
199 : GPG_ERR_TOO_LARGE = 67,
200 : GPG_ERR_NO_OBJ = 68,
201 : GPG_ERR_NOT_IMPLEMENTED = 69,
202 : GPG_ERR_CONFLICT = 70,
203 : GPG_ERR_INV_CIPHER_MODE = 71,
204 : GPG_ERR_INV_FLAG = 72,
205 : GPG_ERR_INV_HANDLE = 73,
206 : GPG_ERR_TRUNCATED = 74,
207 : GPG_ERR_INCOMPLETE_LINE = 75,
208 : GPG_ERR_INV_RESPONSE = 76,
209 : GPG_ERR_NO_AGENT = 77,
210 : GPG_ERR_AGENT = 78,
211 : GPG_ERR_INV_DATA = 79,
212 : GPG_ERR_ASSUAN_SERVER_FAULT = 80,
213 : GPG_ERR_ASSUAN = 81,
214 : GPG_ERR_INV_SESSION_KEY = 82,
215 : GPG_ERR_INV_SEXP = 83,
216 : GPG_ERR_UNSUPPORTED_ALGORITHM = 84,
217 : GPG_ERR_NO_PIN_ENTRY = 85,
218 : GPG_ERR_PIN_ENTRY = 86,
219 : GPG_ERR_BAD_PIN = 87,
220 : GPG_ERR_INV_NAME = 88,
221 : GPG_ERR_BAD_DATA = 89,
222 : GPG_ERR_INV_PARAMETER = 90,
223 : GPG_ERR_WRONG_CARD = 91,
224 : GPG_ERR_NO_DIRMNGR = 92,
225 : GPG_ERR_DIRMNGR = 93,
226 : GPG_ERR_CERT_REVOKED = 94,
227 : GPG_ERR_NO_CRL_KNOWN = 95,
228 : GPG_ERR_CRL_TOO_OLD = 96,
229 : GPG_ERR_LINE_TOO_LONG = 97,
230 : GPG_ERR_NOT_TRUSTED = 98,
231 : GPG_ERR_CANCELED = 99,
232 : GPG_ERR_BAD_CA_CERT = 100,
233 : GPG_ERR_CERT_EXPIRED = 101,
234 : GPG_ERR_CERT_TOO_YOUNG = 102,
235 : GPG_ERR_UNSUPPORTED_CERT = 103,
236 : GPG_ERR_UNKNOWN_SEXP = 104,
237 : GPG_ERR_UNSUPPORTED_PROTECTION = 105,
238 : GPG_ERR_CORRUPTED_PROTECTION = 106,
239 : GPG_ERR_AMBIGUOUS_NAME = 107,
240 : GPG_ERR_CARD = 108,
241 : GPG_ERR_CARD_RESET = 109,
242 : GPG_ERR_CARD_REMOVED = 110,
243 : GPG_ERR_INV_CARD = 111,
244 : GPG_ERR_CARD_NOT_PRESENT = 112,
245 : GPG_ERR_NO_PKCS15_APP = 113,
246 : GPG_ERR_NOT_CONFIRMED = 114,
247 : GPG_ERR_CONFIGURATION = 115,
248 : GPG_ERR_NO_POLICY_MATCH = 116,
249 : GPG_ERR_INV_INDEX = 117,
250 : GPG_ERR_INV_ID = 118,
251 : GPG_ERR_NO_SCDAEMON = 119,
252 : GPG_ERR_SCDAEMON = 120,
253 : GPG_ERR_UNSUPPORTED_PROTOCOL = 121,
254 : GPG_ERR_BAD_PIN_METHOD = 122,
255 : GPG_ERR_CARD_NOT_INITIALIZED = 123,
256 : GPG_ERR_UNSUPPORTED_OPERATION = 124,
257 : GPG_ERR_WRONG_KEY_USAGE = 125,
258 : GPG_ERR_NOTHING_FOUND = 126,
259 : GPG_ERR_WRONG_BLOB_TYPE = 127,
260 : GPG_ERR_MISSING_VALUE = 128,
261 : GPG_ERR_HARDWARE = 129,
262 : GPG_ERR_PIN_BLOCKED = 130,
263 : GPG_ERR_USE_CONDITIONS = 131,
264 : GPG_ERR_PIN_NOT_SYNCED = 132,
265 : GPG_ERR_INV_CRL = 133,
266 : GPG_ERR_BAD_BER = 134,
267 : GPG_ERR_INV_BER = 135,
268 : GPG_ERR_ELEMENT_NOT_FOUND = 136,
269 : GPG_ERR_IDENTIFIER_NOT_FOUND = 137,
270 : GPG_ERR_INV_TAG = 138,
271 : GPG_ERR_INV_LENGTH = 139,
272 : GPG_ERR_INV_KEYINFO = 140,
273 : GPG_ERR_UNEXPECTED_TAG = 141,
274 : GPG_ERR_NOT_DER_ENCODED = 142,
275 : GPG_ERR_NO_CMS_OBJ = 143,
276 : GPG_ERR_INV_CMS_OBJ = 144,
277 : GPG_ERR_UNKNOWN_CMS_OBJ = 145,
278 : GPG_ERR_UNSUPPORTED_CMS_OBJ = 146,
279 : GPG_ERR_UNSUPPORTED_ENCODING = 147,
280 : GPG_ERR_UNSUPPORTED_CMS_VERSION = 148,
281 : GPG_ERR_UNKNOWN_ALGORITHM = 149,
282 : GPG_ERR_INV_ENGINE = 150,
283 : GPG_ERR_PUBKEY_NOT_TRUSTED = 151,
284 : GPG_ERR_DECRYPT_FAILED = 152,
285 : GPG_ERR_KEY_EXPIRED = 153,
286 : GPG_ERR_SIG_EXPIRED = 154,
287 : GPG_ERR_ENCODING_PROBLEM = 155,
288 : GPG_ERR_INV_STATE = 156,
289 : GPG_ERR_DUP_VALUE = 157,
290 : GPG_ERR_MISSING_ACTION = 158,
291 : GPG_ERR_MODULE_NOT_FOUND = 159,
292 : GPG_ERR_INV_OID_STRING = 160,
293 : GPG_ERR_INV_TIME = 161,
294 : GPG_ERR_INV_CRL_OBJ = 162,
295 : GPG_ERR_UNSUPPORTED_CRL_VERSION = 163,
296 : GPG_ERR_INV_CERT_OBJ = 164,
297 : GPG_ERR_UNKNOWN_NAME = 165,
298 : GPG_ERR_LOCALE_PROBLEM = 166,
299 : GPG_ERR_NOT_LOCKED = 167,
300 : GPG_ERR_PROTOCOL_VIOLATION = 168,
301 : GPG_ERR_INV_MAC = 169,
302 : GPG_ERR_INV_REQUEST = 170,
303 : GPG_ERR_UNKNOWN_EXTN = 171,
304 : GPG_ERR_UNKNOWN_CRIT_EXTN = 172,
305 : GPG_ERR_LOCKED = 173,
306 : GPG_ERR_UNKNOWN_OPTION = 174,
307 : GPG_ERR_UNKNOWN_COMMAND = 175,
308 : GPG_ERR_NOT_OPERATIONAL = 176,
309 : GPG_ERR_NO_PASSPHRASE = 177,
310 : GPG_ERR_NO_PIN = 178,
311 : GPG_ERR_NOT_ENABLED = 179,
312 : GPG_ERR_NO_ENGINE = 180,
313 : GPG_ERR_MISSING_KEY = 181,
314 : GPG_ERR_TOO_MANY = 182,
315 : GPG_ERR_LIMIT_REACHED = 183,
316 : GPG_ERR_NOT_INITIALIZED = 184,
317 : GPG_ERR_MISSING_ISSUER_CERT = 185,
318 : GPG_ERR_NO_KEYSERVER = 186,
319 : GPG_ERR_INV_CURVE = 187,
320 : GPG_ERR_UNKNOWN_CURVE = 188,
321 : GPG_ERR_DUP_KEY = 189,
322 : GPG_ERR_AMBIGUOUS = 190,
323 : GPG_ERR_NO_CRYPT_CTX = 191,
324 : GPG_ERR_WRONG_CRYPT_CTX = 192,
325 : GPG_ERR_BAD_CRYPT_CTX = 193,
326 : GPG_ERR_CRYPT_CTX_CONFLICT = 194,
327 : GPG_ERR_BROKEN_PUBKEY = 195,
328 : GPG_ERR_BROKEN_SECKEY = 196,
329 : GPG_ERR_MAC_ALGO = 197,
330 : GPG_ERR_FULLY_CANCELED = 198,
331 : GPG_ERR_UNFINISHED = 199,
332 : GPG_ERR_BUFFER_TOO_SHORT = 200,
333 : GPG_ERR_SEXP_INV_LEN_SPEC = 201,
334 : GPG_ERR_SEXP_STRING_TOO_LONG = 202,
335 : GPG_ERR_SEXP_UNMATCHED_PAREN = 203,
336 : GPG_ERR_SEXP_NOT_CANONICAL = 204,
337 : GPG_ERR_SEXP_BAD_CHARACTER = 205,
338 : GPG_ERR_SEXP_BAD_QUOTATION = 206,
339 : GPG_ERR_SEXP_ZERO_PREFIX = 207,
340 : GPG_ERR_SEXP_NESTED_DH = 208,
341 : GPG_ERR_SEXP_UNMATCHED_DH = 209,
342 : GPG_ERR_SEXP_UNEXPECTED_PUNC = 210,
343 : GPG_ERR_SEXP_BAD_HEX_CHAR = 211,
344 : GPG_ERR_SEXP_ODD_HEX_NUMBERS = 212,
345 : GPG_ERR_SEXP_BAD_OCT_CHAR = 213,
346 : GPG_ERR_SUBKEYS_EXP_OR_REV = 217,
347 : GPG_ERR_DB_CORRUPTED = 218,
348 : GPG_ERR_SERVER_FAILED = 219,
349 : GPG_ERR_NO_NAME = 220,
350 : GPG_ERR_NO_KEY = 221,
351 : GPG_ERR_LEGACY_KEY = 222,
352 : GPG_ERR_REQUEST_TOO_SHORT = 223,
353 : GPG_ERR_REQUEST_TOO_LONG = 224,
354 : GPG_ERR_OBJ_TERM_STATE = 225,
355 : GPG_ERR_NO_CERT_CHAIN = 226,
356 : GPG_ERR_CERT_TOO_LARGE = 227,
357 : GPG_ERR_INV_RECORD = 228,
358 : GPG_ERR_BAD_MAC = 229,
359 : GPG_ERR_UNEXPECTED_MSG = 230,
360 : GPG_ERR_COMPR_FAILED = 231,
361 : GPG_ERR_WOULD_WRAP = 232,
362 : GPG_ERR_FATAL_ALERT = 233,
363 : GPG_ERR_NO_CIPHER = 234,
364 : GPG_ERR_MISSING_CLIENT_CERT = 235,
365 : GPG_ERR_CLOSE_NOTIFY = 236,
366 : GPG_ERR_TICKET_EXPIRED = 237,
367 : GPG_ERR_BAD_TICKET = 238,
368 : GPG_ERR_UNKNOWN_IDENTITY = 239,
369 : GPG_ERR_BAD_HS_CERT = 240,
370 : GPG_ERR_BAD_HS_CERT_REQ = 241,
371 : GPG_ERR_BAD_HS_CERT_VER = 242,
372 : GPG_ERR_BAD_HS_CHANGE_CIPHER = 243,
373 : GPG_ERR_BAD_HS_CLIENT_HELLO = 244,
374 : GPG_ERR_BAD_HS_SERVER_HELLO = 245,
375 : GPG_ERR_BAD_HS_SERVER_HELLO_DONE = 246,
376 : GPG_ERR_BAD_HS_FINISHED = 247,
377 : GPG_ERR_BAD_HS_SERVER_KEX = 248,
378 : GPG_ERR_BAD_HS_CLIENT_KEX = 249,
379 : GPG_ERR_BOGUS_STRING = 250,
380 : GPG_ERR_FORBIDDEN = 251,
381 : GPG_ERR_KEY_DISABLED = 252,
382 : GPG_ERR_KEY_ON_CARD = 253,
383 : GPG_ERR_INV_LOCK_OBJ = 254,
384 : GPG_ERR_TRUE = 255,
385 : GPG_ERR_FALSE = 256,
386 : GPG_ERR_ASS_GENERAL = 257,
387 : GPG_ERR_ASS_ACCEPT_FAILED = 258,
388 : GPG_ERR_ASS_CONNECT_FAILED = 259,
389 : GPG_ERR_ASS_INV_RESPONSE = 260,
390 : GPG_ERR_ASS_INV_VALUE = 261,
391 : GPG_ERR_ASS_INCOMPLETE_LINE = 262,
392 : GPG_ERR_ASS_LINE_TOO_LONG = 263,
393 : GPG_ERR_ASS_NESTED_COMMANDS = 264,
394 : GPG_ERR_ASS_NO_DATA_CB = 265,
395 : GPG_ERR_ASS_NO_INQUIRE_CB = 266,
396 : GPG_ERR_ASS_NOT_A_SERVER = 267,
397 : GPG_ERR_ASS_NOT_A_CLIENT = 268,
398 : GPG_ERR_ASS_SERVER_START = 269,
399 : GPG_ERR_ASS_READ_ERROR = 270,
400 : GPG_ERR_ASS_WRITE_ERROR = 271,
401 : GPG_ERR_ASS_TOO_MUCH_DATA = 273,
402 : GPG_ERR_ASS_UNEXPECTED_CMD = 274,
403 : GPG_ERR_ASS_UNKNOWN_CMD = 275,
404 : GPG_ERR_ASS_SYNTAX = 276,
405 : GPG_ERR_ASS_CANCELED = 277,
406 : GPG_ERR_ASS_NO_INPUT = 278,
407 : GPG_ERR_ASS_NO_OUTPUT = 279,
408 : GPG_ERR_ASS_PARAMETER = 280,
409 : GPG_ERR_ASS_UNKNOWN_INQUIRE = 281,
410 : GPG_ERR_ENGINE_TOO_OLD = 300,
411 : GPG_ERR_WINDOW_TOO_SMALL = 301,
412 : GPG_ERR_WINDOW_TOO_LARGE = 302,
413 : GPG_ERR_MISSING_ENVVAR = 303,
414 : GPG_ERR_USER_ID_EXISTS = 304,
415 : GPG_ERR_NAME_EXISTS = 305,
416 : GPG_ERR_DUP_NAME = 306,
417 : GPG_ERR_TOO_YOUNG = 307,
418 : GPG_ERR_TOO_OLD = 308,
419 : GPG_ERR_UNKNOWN_FLAG = 309,
420 : GPG_ERR_INV_ORDER = 310,
421 : GPG_ERR_ALREADY_FETCHED = 311,
422 : GPG_ERR_TRY_LATER = 312,
423 : GPG_ERR_SYSTEM_BUG = 666,
424 : GPG_ERR_DNS_UNKNOWN = 711,
425 : GPG_ERR_DNS_SECTION = 712,
426 : GPG_ERR_DNS_ADDRESS = 713,
427 : GPG_ERR_DNS_NO_QUERY = 714,
428 : GPG_ERR_DNS_NO_ANSWER = 715,
429 : GPG_ERR_DNS_CLOSED = 716,
430 : GPG_ERR_DNS_VERIFY = 717,
431 : GPG_ERR_DNS_TIMEOUT = 718,
432 : GPG_ERR_LDAP_GENERAL = 721,
433 : GPG_ERR_LDAP_ATTR_GENERAL = 722,
434 : GPG_ERR_LDAP_NAME_GENERAL = 723,
435 : GPG_ERR_LDAP_SECURITY_GENERAL = 724,
436 : GPG_ERR_LDAP_SERVICE_GENERAL = 725,
437 : GPG_ERR_LDAP_UPDATE_GENERAL = 726,
438 : GPG_ERR_LDAP_E_GENERAL = 727,
439 : GPG_ERR_LDAP_X_GENERAL = 728,
440 : GPG_ERR_LDAP_OTHER_GENERAL = 729,
441 : GPG_ERR_LDAP_X_CONNECTING = 750,
442 : GPG_ERR_LDAP_REFERRAL_LIMIT = 751,
443 : GPG_ERR_LDAP_CLIENT_LOOP = 752,
444 : GPG_ERR_LDAP_NO_RESULTS = 754,
445 : GPG_ERR_LDAP_CONTROL_NOT_FOUND = 755,
446 : GPG_ERR_LDAP_NOT_SUPPORTED = 756,
447 : GPG_ERR_LDAP_CONNECT = 757,
448 : GPG_ERR_LDAP_NO_MEMORY = 758,
449 : GPG_ERR_LDAP_PARAM = 759,
450 : GPG_ERR_LDAP_USER_CANCELLED = 760,
451 : GPG_ERR_LDAP_FILTER = 761,
452 : GPG_ERR_LDAP_AUTH_UNKNOWN = 762,
453 : GPG_ERR_LDAP_TIMEOUT = 763,
454 : GPG_ERR_LDAP_DECODING = 764,
455 : GPG_ERR_LDAP_ENCODING = 765,
456 : GPG_ERR_LDAP_LOCAL = 766,
457 : GPG_ERR_LDAP_SERVER_DOWN = 767,
458 : GPG_ERR_LDAP_SUCCESS = 768,
459 : GPG_ERR_LDAP_OPERATIONS = 769,
460 : GPG_ERR_LDAP_PROTOCOL = 770,
461 : GPG_ERR_LDAP_TIMELIMIT = 771,
462 : GPG_ERR_LDAP_SIZELIMIT = 772,
463 : GPG_ERR_LDAP_COMPARE_FALSE = 773,
464 : GPG_ERR_LDAP_COMPARE_TRUE = 774,
465 : GPG_ERR_LDAP_UNSUPPORTED_AUTH = 775,
466 : GPG_ERR_LDAP_STRONG_AUTH_RQRD = 776,
467 : GPG_ERR_LDAP_PARTIAL_RESULTS = 777,
468 : GPG_ERR_LDAP_REFERRAL = 778,
469 : GPG_ERR_LDAP_ADMINLIMIT = 779,
470 : GPG_ERR_LDAP_UNAVAIL_CRIT_EXTN = 780,
471 : GPG_ERR_LDAP_CONFIDENT_RQRD = 781,
472 : GPG_ERR_LDAP_SASL_BIND_INPROG = 782,
473 : GPG_ERR_LDAP_NO_SUCH_ATTRIBUTE = 784,
474 : GPG_ERR_LDAP_UNDEFINED_TYPE = 785,
475 : GPG_ERR_LDAP_BAD_MATCHING = 786,
476 : GPG_ERR_LDAP_CONST_VIOLATION = 787,
477 : GPG_ERR_LDAP_TYPE_VALUE_EXISTS = 788,
478 : GPG_ERR_LDAP_INV_SYNTAX = 789,
479 : GPG_ERR_LDAP_NO_SUCH_OBJ = 800,
480 : GPG_ERR_LDAP_ALIAS_PROBLEM = 801,
481 : GPG_ERR_LDAP_INV_DN_SYNTAX = 802,
482 : GPG_ERR_LDAP_IS_LEAF = 803,
483 : GPG_ERR_LDAP_ALIAS_DEREF = 804,
484 : GPG_ERR_LDAP_X_PROXY_AUTH_FAIL = 815,
485 : GPG_ERR_LDAP_BAD_AUTH = 816,
486 : GPG_ERR_LDAP_INV_CREDENTIALS = 817,
487 : GPG_ERR_LDAP_INSUFFICIENT_ACC = 818,
488 : GPG_ERR_LDAP_BUSY = 819,
489 : GPG_ERR_LDAP_UNAVAILABLE = 820,
490 : GPG_ERR_LDAP_UNWILL_TO_PERFORM = 821,
491 : GPG_ERR_LDAP_LOOP_DETECT = 822,
492 : GPG_ERR_LDAP_NAMING_VIOLATION = 832,
493 : GPG_ERR_LDAP_OBJ_CLS_VIOLATION = 833,
494 : GPG_ERR_LDAP_NOT_ALLOW_NONLEAF = 834,
495 : GPG_ERR_LDAP_NOT_ALLOW_ON_RDN = 835,
496 : GPG_ERR_LDAP_ALREADY_EXISTS = 836,
497 : GPG_ERR_LDAP_NO_OBJ_CLASS_MODS = 837,
498 : GPG_ERR_LDAP_RESULTS_TOO_LARGE = 838,
499 : GPG_ERR_LDAP_AFFECTS_MULT_DSAS = 839,
500 : GPG_ERR_LDAP_VLV = 844,
501 : GPG_ERR_LDAP_OTHER = 848,
502 : GPG_ERR_LDAP_CUP_RESOURCE_LIMIT = 881,
503 : GPG_ERR_LDAP_CUP_SEC_VIOLATION = 882,
504 : GPG_ERR_LDAP_CUP_INV_DATA = 883,
505 : GPG_ERR_LDAP_CUP_UNSUP_SCHEME = 884,
506 : GPG_ERR_LDAP_CUP_RELOAD = 885,
507 : GPG_ERR_LDAP_CANCELLED = 886,
508 : GPG_ERR_LDAP_NO_SUCH_OPERATION = 887,
509 : GPG_ERR_LDAP_TOO_LATE = 888,
510 : GPG_ERR_LDAP_CANNOT_CANCEL = 889,
511 : GPG_ERR_LDAP_ASSERTION_FAILED = 890,
512 : GPG_ERR_LDAP_PROX_AUTH_DENIED = 891,
513 : GPG_ERR_USER_1 = 1024,
514 : GPG_ERR_USER_2 = 1025,
515 : GPG_ERR_USER_3 = 1026,
516 : GPG_ERR_USER_4 = 1027,
517 : GPG_ERR_USER_5 = 1028,
518 : GPG_ERR_USER_6 = 1029,
519 : GPG_ERR_USER_7 = 1030,
520 : GPG_ERR_USER_8 = 1031,
521 : GPG_ERR_USER_9 = 1032,
522 : GPG_ERR_USER_10 = 1033,
523 : GPG_ERR_USER_11 = 1034,
524 : GPG_ERR_USER_12 = 1035,
525 : GPG_ERR_USER_13 = 1036,
526 : GPG_ERR_USER_14 = 1037,
527 : GPG_ERR_USER_15 = 1038,
528 : GPG_ERR_USER_16 = 1039,
529 : GPG_ERR_MISSING_ERRNO = 16381,
530 : GPG_ERR_UNKNOWN_ERRNO = 16382,
531 : GPG_ERR_EOF = 16383,
532 :
533 : /* The following error codes are used to map system errors. */
534 : #define GPG_ERR_SYSTEM_ERROR (1 << 15)
535 : GPG_ERR_E2BIG = GPG_ERR_SYSTEM_ERROR | 0,
536 : GPG_ERR_EACCES = GPG_ERR_SYSTEM_ERROR | 1,
537 : GPG_ERR_EADDRINUSE = GPG_ERR_SYSTEM_ERROR | 2,
538 : GPG_ERR_EADDRNOTAVAIL = GPG_ERR_SYSTEM_ERROR | 3,
539 : GPG_ERR_EADV = GPG_ERR_SYSTEM_ERROR | 4,
540 : GPG_ERR_EAFNOSUPPORT = GPG_ERR_SYSTEM_ERROR | 5,
541 : GPG_ERR_EAGAIN = GPG_ERR_SYSTEM_ERROR | 6,
542 : GPG_ERR_EALREADY = GPG_ERR_SYSTEM_ERROR | 7,
543 : GPG_ERR_EAUTH = GPG_ERR_SYSTEM_ERROR | 8,
544 : GPG_ERR_EBACKGROUND = GPG_ERR_SYSTEM_ERROR | 9,
545 : GPG_ERR_EBADE = GPG_ERR_SYSTEM_ERROR | 10,
546 : GPG_ERR_EBADF = GPG_ERR_SYSTEM_ERROR | 11,
547 : GPG_ERR_EBADFD = GPG_ERR_SYSTEM_ERROR | 12,
548 : GPG_ERR_EBADMSG = GPG_ERR_SYSTEM_ERROR | 13,
549 : GPG_ERR_EBADR = GPG_ERR_SYSTEM_ERROR | 14,
550 : GPG_ERR_EBADRPC = GPG_ERR_SYSTEM_ERROR | 15,
551 : GPG_ERR_EBADRQC = GPG_ERR_SYSTEM_ERROR | 16,
552 : GPG_ERR_EBADSLT = GPG_ERR_SYSTEM_ERROR | 17,
553 : GPG_ERR_EBFONT = GPG_ERR_SYSTEM_ERROR | 18,
554 : GPG_ERR_EBUSY = GPG_ERR_SYSTEM_ERROR | 19,
555 : GPG_ERR_ECANCELED = GPG_ERR_SYSTEM_ERROR | 20,
556 : GPG_ERR_ECHILD = GPG_ERR_SYSTEM_ERROR | 21,
557 : GPG_ERR_ECHRNG = GPG_ERR_SYSTEM_ERROR | 22,
558 : GPG_ERR_ECOMM = GPG_ERR_SYSTEM_ERROR | 23,
559 : GPG_ERR_ECONNABORTED = GPG_ERR_SYSTEM_ERROR | 24,
560 : GPG_ERR_ECONNREFUSED = GPG_ERR_SYSTEM_ERROR | 25,
561 : GPG_ERR_ECONNRESET = GPG_ERR_SYSTEM_ERROR | 26,
562 : GPG_ERR_ED = GPG_ERR_SYSTEM_ERROR | 27,
563 : GPG_ERR_EDEADLK = GPG_ERR_SYSTEM_ERROR | 28,
564 : GPG_ERR_EDEADLOCK = GPG_ERR_SYSTEM_ERROR | 29,
565 : GPG_ERR_EDESTADDRREQ = GPG_ERR_SYSTEM_ERROR | 30,
566 : GPG_ERR_EDIED = GPG_ERR_SYSTEM_ERROR | 31,
567 : GPG_ERR_EDOM = GPG_ERR_SYSTEM_ERROR | 32,
568 : GPG_ERR_EDOTDOT = GPG_ERR_SYSTEM_ERROR | 33,
569 : GPG_ERR_EDQUOT = GPG_ERR_SYSTEM_ERROR | 34,
570 : GPG_ERR_EEXIST = GPG_ERR_SYSTEM_ERROR | 35,
571 : GPG_ERR_EFAULT = GPG_ERR_SYSTEM_ERROR | 36,
572 : GPG_ERR_EFBIG = GPG_ERR_SYSTEM_ERROR | 37,
573 : GPG_ERR_EFTYPE = GPG_ERR_SYSTEM_ERROR | 38,
574 : GPG_ERR_EGRATUITOUS = GPG_ERR_SYSTEM_ERROR | 39,
575 : GPG_ERR_EGREGIOUS = GPG_ERR_SYSTEM_ERROR | 40,
576 : GPG_ERR_EHOSTDOWN = GPG_ERR_SYSTEM_ERROR | 41,
577 : GPG_ERR_EHOSTUNREACH = GPG_ERR_SYSTEM_ERROR | 42,
578 : GPG_ERR_EIDRM = GPG_ERR_SYSTEM_ERROR | 43,
579 : GPG_ERR_EIEIO = GPG_ERR_SYSTEM_ERROR | 44,
580 : GPG_ERR_EILSEQ = GPG_ERR_SYSTEM_ERROR | 45,
581 : GPG_ERR_EINPROGRESS = GPG_ERR_SYSTEM_ERROR | 46,
582 : GPG_ERR_EINTR = GPG_ERR_SYSTEM_ERROR | 47,
583 : GPG_ERR_EINVAL = GPG_ERR_SYSTEM_ERROR | 48,
584 : GPG_ERR_EIO = GPG_ERR_SYSTEM_ERROR | 49,
585 : GPG_ERR_EISCONN = GPG_ERR_SYSTEM_ERROR | 50,
586 : GPG_ERR_EISDIR = GPG_ERR_SYSTEM_ERROR | 51,
587 : GPG_ERR_EISNAM = GPG_ERR_SYSTEM_ERROR | 52,
588 : GPG_ERR_EL2HLT = GPG_ERR_SYSTEM_ERROR | 53,
589 : GPG_ERR_EL2NSYNC = GPG_ERR_SYSTEM_ERROR | 54,
590 : GPG_ERR_EL3HLT = GPG_ERR_SYSTEM_ERROR | 55,
591 : GPG_ERR_EL3RST = GPG_ERR_SYSTEM_ERROR | 56,
592 : GPG_ERR_ELIBACC = GPG_ERR_SYSTEM_ERROR | 57,
593 : GPG_ERR_ELIBBAD = GPG_ERR_SYSTEM_ERROR | 58,
594 : GPG_ERR_ELIBEXEC = GPG_ERR_SYSTEM_ERROR | 59,
595 : GPG_ERR_ELIBMAX = GPG_ERR_SYSTEM_ERROR | 60,
596 : GPG_ERR_ELIBSCN = GPG_ERR_SYSTEM_ERROR | 61,
597 : GPG_ERR_ELNRNG = GPG_ERR_SYSTEM_ERROR | 62,
598 : GPG_ERR_ELOOP = GPG_ERR_SYSTEM_ERROR | 63,
599 : GPG_ERR_EMEDIUMTYPE = GPG_ERR_SYSTEM_ERROR | 64,
600 : GPG_ERR_EMFILE = GPG_ERR_SYSTEM_ERROR | 65,
601 : GPG_ERR_EMLINK = GPG_ERR_SYSTEM_ERROR | 66,
602 : GPG_ERR_EMSGSIZE = GPG_ERR_SYSTEM_ERROR | 67,
603 : GPG_ERR_EMULTIHOP = GPG_ERR_SYSTEM_ERROR | 68,
604 : GPG_ERR_ENAMETOOLONG = GPG_ERR_SYSTEM_ERROR | 69,
605 : GPG_ERR_ENAVAIL = GPG_ERR_SYSTEM_ERROR | 70,
606 : GPG_ERR_ENEEDAUTH = GPG_ERR_SYSTEM_ERROR | 71,
607 : GPG_ERR_ENETDOWN = GPG_ERR_SYSTEM_ERROR | 72,
608 : GPG_ERR_ENETRESET = GPG_ERR_SYSTEM_ERROR | 73,
609 : GPG_ERR_ENETUNREACH = GPG_ERR_SYSTEM_ERROR | 74,
610 : GPG_ERR_ENFILE = GPG_ERR_SYSTEM_ERROR | 75,
611 : GPG_ERR_ENOANO = GPG_ERR_SYSTEM_ERROR | 76,
612 : GPG_ERR_ENOBUFS = GPG_ERR_SYSTEM_ERROR | 77,
613 : GPG_ERR_ENOCSI = GPG_ERR_SYSTEM_ERROR | 78,
614 : GPG_ERR_ENODATA = GPG_ERR_SYSTEM_ERROR | 79,
615 : GPG_ERR_ENODEV = GPG_ERR_SYSTEM_ERROR | 80,
616 : GPG_ERR_ENOENT = GPG_ERR_SYSTEM_ERROR | 81,
617 : GPG_ERR_ENOEXEC = GPG_ERR_SYSTEM_ERROR | 82,
618 : GPG_ERR_ENOLCK = GPG_ERR_SYSTEM_ERROR | 83,
619 : GPG_ERR_ENOLINK = GPG_ERR_SYSTEM_ERROR | 84,
620 : GPG_ERR_ENOMEDIUM = GPG_ERR_SYSTEM_ERROR | 85,
621 : GPG_ERR_ENOMEM = GPG_ERR_SYSTEM_ERROR | 86,
622 : GPG_ERR_ENOMSG = GPG_ERR_SYSTEM_ERROR | 87,
623 : GPG_ERR_ENONET = GPG_ERR_SYSTEM_ERROR | 88,
624 : GPG_ERR_ENOPKG = GPG_ERR_SYSTEM_ERROR | 89,
625 : GPG_ERR_ENOPROTOOPT = GPG_ERR_SYSTEM_ERROR | 90,
626 : GPG_ERR_ENOSPC = GPG_ERR_SYSTEM_ERROR | 91,
627 : GPG_ERR_ENOSR = GPG_ERR_SYSTEM_ERROR | 92,
628 : GPG_ERR_ENOSTR = GPG_ERR_SYSTEM_ERROR | 93,
629 : GPG_ERR_ENOSYS = GPG_ERR_SYSTEM_ERROR | 94,
630 : GPG_ERR_ENOTBLK = GPG_ERR_SYSTEM_ERROR | 95,
631 : GPG_ERR_ENOTCONN = GPG_ERR_SYSTEM_ERROR | 96,
632 : GPG_ERR_ENOTDIR = GPG_ERR_SYSTEM_ERROR | 97,
633 : GPG_ERR_ENOTEMPTY = GPG_ERR_SYSTEM_ERROR | 98,
634 : GPG_ERR_ENOTNAM = GPG_ERR_SYSTEM_ERROR | 99,
635 : GPG_ERR_ENOTSOCK = GPG_ERR_SYSTEM_ERROR | 100,
636 : GPG_ERR_ENOTSUP = GPG_ERR_SYSTEM_ERROR | 101,
637 : GPG_ERR_ENOTTY = GPG_ERR_SYSTEM_ERROR | 102,
638 : GPG_ERR_ENOTUNIQ = GPG_ERR_SYSTEM_ERROR | 103,
639 : GPG_ERR_ENXIO = GPG_ERR_SYSTEM_ERROR | 104,
640 : GPG_ERR_EOPNOTSUPP = GPG_ERR_SYSTEM_ERROR | 105,
641 : GPG_ERR_EOVERFLOW = GPG_ERR_SYSTEM_ERROR | 106,
642 : GPG_ERR_EPERM = GPG_ERR_SYSTEM_ERROR | 107,
643 : GPG_ERR_EPFNOSUPPORT = GPG_ERR_SYSTEM_ERROR | 108,
644 : GPG_ERR_EPIPE = GPG_ERR_SYSTEM_ERROR | 109,
645 : GPG_ERR_EPROCLIM = GPG_ERR_SYSTEM_ERROR | 110,
646 : GPG_ERR_EPROCUNAVAIL = GPG_ERR_SYSTEM_ERROR | 111,
647 : GPG_ERR_EPROGMISMATCH = GPG_ERR_SYSTEM_ERROR | 112,
648 : GPG_ERR_EPROGUNAVAIL = GPG_ERR_SYSTEM_ERROR | 113,
649 : GPG_ERR_EPROTO = GPG_ERR_SYSTEM_ERROR | 114,
650 : GPG_ERR_EPROTONOSUPPORT = GPG_ERR_SYSTEM_ERROR | 115,
651 : GPG_ERR_EPROTOTYPE = GPG_ERR_SYSTEM_ERROR | 116,
652 : GPG_ERR_ERANGE = GPG_ERR_SYSTEM_ERROR | 117,
653 : GPG_ERR_EREMCHG = GPG_ERR_SYSTEM_ERROR | 118,
654 : GPG_ERR_EREMOTE = GPG_ERR_SYSTEM_ERROR | 119,
655 : GPG_ERR_EREMOTEIO = GPG_ERR_SYSTEM_ERROR | 120,
656 : GPG_ERR_ERESTART = GPG_ERR_SYSTEM_ERROR | 121,
657 : GPG_ERR_EROFS = GPG_ERR_SYSTEM_ERROR | 122,
658 : GPG_ERR_ERPCMISMATCH = GPG_ERR_SYSTEM_ERROR | 123,
659 : GPG_ERR_ESHUTDOWN = GPG_ERR_SYSTEM_ERROR | 124,
660 : GPG_ERR_ESOCKTNOSUPPORT = GPG_ERR_SYSTEM_ERROR | 125,
661 : GPG_ERR_ESPIPE = GPG_ERR_SYSTEM_ERROR | 126,
662 : GPG_ERR_ESRCH = GPG_ERR_SYSTEM_ERROR | 127,
663 : GPG_ERR_ESRMNT = GPG_ERR_SYSTEM_ERROR | 128,
664 : GPG_ERR_ESTALE = GPG_ERR_SYSTEM_ERROR | 129,
665 : GPG_ERR_ESTRPIPE = GPG_ERR_SYSTEM_ERROR | 130,
666 : GPG_ERR_ETIME = GPG_ERR_SYSTEM_ERROR | 131,
667 : GPG_ERR_ETIMEDOUT = GPG_ERR_SYSTEM_ERROR | 132,
668 : GPG_ERR_ETOOMANYREFS = GPG_ERR_SYSTEM_ERROR | 133,
669 : GPG_ERR_ETXTBSY = GPG_ERR_SYSTEM_ERROR | 134,
670 : GPG_ERR_EUCLEAN = GPG_ERR_SYSTEM_ERROR | 135,
671 : GPG_ERR_EUNATCH = GPG_ERR_SYSTEM_ERROR | 136,
672 : GPG_ERR_EUSERS = GPG_ERR_SYSTEM_ERROR | 137,
673 : GPG_ERR_EWOULDBLOCK = GPG_ERR_SYSTEM_ERROR | 138,
674 : GPG_ERR_EXDEV = GPG_ERR_SYSTEM_ERROR | 139,
675 : GPG_ERR_EXFULL = GPG_ERR_SYSTEM_ERROR | 140,
676 :
677 : /* This is one more than the largest allowed entry. */
678 : GPG_ERR_CODE_DIM = 65536
679 : } gpg_err_code_t;
680 :
681 :
682 : /* The error value type gpg_error_t. */
683 :
684 : /* We would really like to use bit-fields in a struct, but using
685 : structs as return values can cause binary compatibility issues, in
686 : particular if you want to do it efficiently (also see
687 : -freg-struct-return option to GCC). */
688 : typedef unsigned int gpg_error_t;
689 :
690 : /* We use the lowest 16 bits of gpg_error_t for error codes. The 16th
691 : bit indicates system errors. */
692 : #define GPG_ERR_CODE_MASK (GPG_ERR_CODE_DIM - 1)
693 :
694 : /* Bits 17 to 24 are reserved. */
695 :
696 : /* We use the upper 7 bits of gpg_error_t for error sources. */
697 : #define GPG_ERR_SOURCE_MASK (GPG_ERR_SOURCE_DIM - 1)
698 : #define GPG_ERR_SOURCE_SHIFT 24
699 :
700 : /* The highest bit is reserved. It shouldn't be used to prevent
701 : potential negative numbers when transmitting error values as
702 : text. */
703 :
704 :
705 : /* GCC feature test. */
706 : #if __GNUC__
707 : # define _GPG_ERR_GCC_VERSION (__GNUC__ * 10000 \
708 : + __GNUC_MINOR__ * 100 \
709 : + __GNUC_PATCHLEVEL__)
710 : #else
711 : # define _GPG_ERR_GCC_VERSION 0
712 : #endif
713 :
714 : #undef _GPG_ERR_HAVE_CONSTRUCTOR
715 : #if _GPG_ERR_GCC_VERSION > 30100
716 : # define _GPG_ERR_CONSTRUCTOR __attribute__ ((__constructor__))
717 : # define _GPG_ERR_HAVE_CONSTRUCTOR
718 : #else
719 : # define _GPG_ERR_CONSTRUCTOR
720 : #endif
721 :
722 : #define GPGRT_GCC_VERSION _GCC_ERR_GCC_VERSION
723 :
724 : #if _GPG_ERR_GCC_VERSION >= 29200
725 : # define _GPGRT__RESTRICT __restrict__
726 : #else
727 : # define _GPGRT__RESTRICT
728 : #endif
729 :
730 : /* The noreturn attribute. */
731 : #if _GPG_ERR_GCC_VERSION >= 20500
732 : # define GPGRT_ATTR_NORETURN __attribute__ ((noreturn))
733 : #else
734 : # define GPGRT_ATTR_NORETURN
735 : #endif
736 :
737 : /* The printf attributes. */
738 : #if _GPG_ERR_GCC_VERSION >= 40400
739 : # define GPGRT_ATTR_PRINTF(f, a) \
740 : __attribute__ ((format(__gnu_printf__,f,a)))
741 : # define GPGRT_ATTR_NR_PRINTF(f, a) \
742 : __attribute__ ((noreturn, format(__gnu_printf__,f,a)))
743 : #elif _GPG_ERR_GCC_VERSION >= 20500
744 : # define GPGRT_ATTR_PRINTF(f, a) \
745 : __attribute__ ((format(printf,f,a)))
746 : # define GPGRT_ATTR_NR_PRINTF(f, a) \
747 : __attribute__ ((noreturn, format(printf,f,a)))
748 : #else
749 : # define GPGRT_ATTR_PRINTF(f, a)
750 : # define GPGRT_ATTR_NR_PRINTF(f, a)
751 : #endif
752 : #if _GPG_ERR_GCC_VERSION >= 20800
753 : # define GPGRT_ATTR_FORMAT_ARG(a) __attribute__ ((__format_arg__ (a)))
754 : #else
755 : # define GPGRT_ATTR_FORMAT_ARG(a)
756 : #endif
757 :
758 : /* The sentinel attribute. */
759 : #if _GPG_ERR_GCC_VERSION >= 40000
760 : # define GPGRT_ATTR_SENTINEL(a) __attribute__ ((sentinel(a)))
761 : #else
762 : # define GPGRT_ATTR_SENTINEL(a)
763 : #endif
764 :
765 : /* The used and unused attributes.
766 : I am not sure since when the unused attribute is really supported.
767 : In any case it it only needed for gcc versions which print a
768 : warning. Thus let us require gcc >= 3.5. */
769 : #if _GPG_ERR_GCC_VERSION >= 40000
770 : # define GPGRT_ATTR_USED __attribute__ ((used))
771 : #else
772 : # define GPGRT_ATTR_USED
773 : #endif
774 : #if _GPG_ERR_GCC_VERSION >= 30500
775 : # define GPGRT_ATTR_UNUSED __attribute__ ((unused))
776 : #else
777 : # define GPGRT_ATTR_UNUSED
778 : #endif
779 :
780 : /* The deprecated attribute. */
781 : #if _GPG_ERR_GCC_VERSION >= 30100
782 : # define GPGRT_ATTR_DEPRECATED __attribute__ ((__deprecated__))
783 : #else
784 : # define GPGRT_ATTR_DEPRECATED
785 : #endif
786 :
787 : /* The pure attribute. */
788 : #if _GPG_ERR_GCC_VERSION >= 29600
789 : # define GPGRT_ATTR_PURE __attribute__ ((__pure__))
790 : #else
791 : # define GPGRT_ATTR_PURE
792 : #endif
793 :
794 : /* The malloc attribute. */
795 : #if _GPG_ERR_GCC_VERSION >= 30200
796 : # define GPGRT_ATTR_MALLOC __attribute__ ((__malloc__))
797 : #else
798 : # define GPGRT_ATTR_MALLOC
799 : #endif
800 :
801 : /* A macro defined if a GCC style __FUNCTION__ macro is available. */
802 : #undef GPGRT_HAVE_MACRO_FUNCTION
803 : #if _GPG_ERR_GCC_VERSION >= 20500
804 : # define GPGRT_HAVE_MACRO_FUNCTION 1
805 : #endif
806 :
807 : /* A macro defined if the pragma GCC push_options is available. */
808 : #undef GPGRT_HAVE_PRAGMA_GCC_PUSH
809 : #if _GPG_ERR_GCC_VERSION >= 40400
810 : # define GPGRT_HAVE_PRAGMA_GCC_PUSH 1
811 : #endif
812 :
813 : /* Detect LeakSanitizer (LSan) support for GCC and Clang based on
814 : * whether AddressSanitizer (ASAN) is enabled via -fsanitize=address).
815 : * Note that -fsanitize=leak just affect the linker options which
816 : * cannot be detected here. In that case you have to define the
817 : * GPGRT_HAVE_LEAK_SANITIZER macro manually. */
818 : #ifdef __GNUC__
819 : # ifdef __SANITIZE_ADDRESS__
820 : # define GPGRT_HAVE_LEAK_SANITIZER
821 : # elif defined(__has_feature)
822 : # if __has_feature(address_sanitizer)
823 : # define GPGRT_HAVE_LEAK_SANITIZER
824 : # endif
825 : # endif
826 : #endif
827 :
828 :
829 : /* The new name for the inline macro. */
830 : #define GPGRT_INLINE GPG_ERR_INLINE
831 :
832 : #ifdef GPGRT_HAVE_LEAK_SANITIZER
833 : # include <sanitizer/lsan_interface.h>
834 : #endif
835 :
836 : /* Mark heap objects as non-leaked memory. */
837 : static GPGRT_INLINE void
838 : gpgrt_annotate_leaked_object (const void *p)
839 : {
840 : #ifdef GPGRT_HAVE_LEAK_SANITIZER
841 : __lsan_ignore_object(p);
842 : #else
843 : (void)p;
844 : #endif
845 : }
846 :
847 :
848 : /* Initialization function. */
849 :
850 : /* Initialize the library. This function should be run early. */
851 : gpg_error_t gpg_err_init (void) _GPG_ERR_CONSTRUCTOR;
852 :
853 : /* If this is defined, the library is already initialized by the
854 : constructor and does not need to be initialized explicitely. */
855 : #undef GPG_ERR_INITIALIZED
856 : #ifdef _GPG_ERR_HAVE_CONSTRUCTOR
857 : # define GPG_ERR_INITIALIZED 1
858 : # define gpgrt_init() do { gpg_err_init (); } while (0)
859 : #else
860 : # define gpgrt_init() do { ; } while (0)
861 : #endif
862 :
863 : /* See the source on how to use the deinit function; it is usually not
864 : required. */
865 : void gpg_err_deinit (int mode);
866 :
867 : /* Register blocking system I/O clamping functions. */
868 : void gpgrt_set_syscall_clamp (void (*pre)(void), void (*post)(void));
869 :
870 : /* Get current I/O clamping functions. */
871 : void gpgrt_get_syscall_clamp (void (**r_pre)(void), void (**r_post)(void));
872 :
873 : /* Register a custom malloc/realloc/free function. */
874 : void gpgrt_set_alloc_func (void *(*f)(void *a, size_t n));
875 :
876 :
877 :
878 : /* Constructor and accessor functions. */
879 :
880 : /* Construct an error value from an error code and source. Within a
881 : subsystem, use gpg_error. */
882 : static GPG_ERR_INLINE gpg_error_t
883 5 : gpg_err_make (gpg_err_source_t source, gpg_err_code_t code)
884 : {
885 : return code == GPG_ERR_NO_ERROR ? GPG_ERR_NO_ERROR
886 10 : : (((source & GPG_ERR_SOURCE_MASK) << GPG_ERR_SOURCE_SHIFT)
887 5 : | (code & GPG_ERR_CODE_MASK));
888 : }
889 :
890 :
891 : /* The user should define GPG_ERR_SOURCE_DEFAULT before including this
892 : file to specify a default source for gpg_error. */
893 : #ifndef GPG_ERR_SOURCE_DEFAULT
894 : #define GPG_ERR_SOURCE_DEFAULT GPG_ERR_SOURCE_UNKNOWN
895 : #endif
896 :
897 : static GPG_ERR_INLINE gpg_error_t
898 0 : gpg_error (gpg_err_code_t code)
899 : {
900 0 : return gpg_err_make (GPG_ERR_SOURCE_DEFAULT, code);
901 : }
902 :
903 :
904 : /* Retrieve the error code from an error value. */
905 : static GPG_ERR_INLINE gpg_err_code_t
906 59 : gpg_err_code (gpg_error_t err)
907 : {
908 59 : return (gpg_err_code_t) (err & GPG_ERR_CODE_MASK);
909 : }
910 :
911 :
912 : /* Retrieve the error source from an error value. */
913 : static GPG_ERR_INLINE gpg_err_source_t
914 : gpg_err_source (gpg_error_t err)
915 : {
916 : return (gpg_err_source_t) ((err >> GPG_ERR_SOURCE_SHIFT)
917 : & GPG_ERR_SOURCE_MASK);
918 : }
919 :
920 :
921 : /* String functions. */
922 :
923 : /* Return a pointer to a string containing a description of the error
924 : code in the error value ERR. This function is not thread-safe. */
925 : const char *gpg_strerror (gpg_error_t err);
926 :
927 : /* Return the error string for ERR in the user-supplied buffer BUF of
928 : size BUFLEN. This function is, in contrast to gpg_strerror,
929 : thread-safe if a thread-safe strerror_r() function is provided by
930 : the system. If the function succeeds, 0 is returned and BUF
931 : contains the string describing the error. If the buffer was not
932 : large enough, ERANGE is returned and BUF contains as much of the
933 : beginning of the error string as fits into the buffer. */
934 : int gpg_strerror_r (gpg_error_t err, char *buf, size_t buflen);
935 :
936 : /* Return a pointer to a string containing a description of the error
937 : source in the error value ERR. */
938 : const char *gpg_strsource (gpg_error_t err);
939 :
940 :
941 : /* Mapping of system errors (errno). */
942 :
943 : /* Retrieve the error code for the system error ERR. This returns
944 : GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped (report
945 : this). */
946 : gpg_err_code_t gpg_err_code_from_errno (int err);
947 :
948 :
949 : /* Retrieve the system error for the error code CODE. This returns 0
950 : if CODE is not a system error code. */
951 : int gpg_err_code_to_errno (gpg_err_code_t code);
952 :
953 :
954 : /* Retrieve the error code directly from the ERRNO variable. This
955 : returns GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped
956 : (report this) and GPG_ERR_MISSING_ERRNO if ERRNO has the value 0. */
957 : gpg_err_code_t gpg_err_code_from_syserror (void);
958 :
959 :
960 : /* Set the ERRNO variable. This function is the preferred way to set
961 : ERRNO due to peculiarities on WindowsCE. */
962 : void gpg_err_set_errno (int err);
963 :
964 : /* Return or check the version. Both functions are identical. */
965 : const char *gpgrt_check_version (const char *req_version);
966 : const char *gpg_error_check_version (const char *req_version);
967 :
968 : /* System specific type definitions. */
969 : #include <sys/types.h>
970 : typedef ssize_t gpgrt_ssize_t;
971 :
972 : typedef long gpgrt_off_t;
973 :
974 :
975 :
976 :
977 : /* Self-documenting convenience functions. */
978 :
979 : static GPG_ERR_INLINE gpg_error_t
980 : gpg_err_make_from_errno (gpg_err_source_t source, int err)
981 : {
982 : return gpg_err_make (source, gpg_err_code_from_errno (err));
983 : }
984 :
985 :
986 : static GPG_ERR_INLINE gpg_error_t
987 : gpg_error_from_errno (int err)
988 : {
989 : return gpg_error (gpg_err_code_from_errno (err));
990 : }
991 :
992 : static GPG_ERR_INLINE gpg_error_t
993 0 : gpg_error_from_syserror (void)
994 : {
995 0 : return gpg_error (gpg_err_code_from_syserror ());
996 : }
997 :
998 :
999 :
1000 : /* Lock functions. */
1001 :
1002 :
1003 : typedef struct
1004 : {
1005 : long _vers;
1006 : union {
1007 : volatile char _priv[40];
1008 : long _x_align;
1009 : long *_xp_align;
1010 : } u;
1011 : } gpgrt_lock_t;
1012 :
1013 : #define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
1014 : 0,0,0,0,0,0,0,0, \
1015 : 0,0,0,0,0,0,0,0, \
1016 : 0,0,0,0,0,0,0,0, \
1017 : 0,0,0,0,0,0,0,0}}}
1018 :
1019 :
1020 : #define GPGRT_LOCK_DEFINE(name) \
1021 : static gpgrt_lock_t name = GPGRT_LOCK_INITIALIZER
1022 :
1023 : /* NB: If GPGRT_LOCK_DEFINE is not used, zero out the lock variable
1024 : before passing it to gpgrt_lock_init. */
1025 : gpg_err_code_t gpgrt_lock_init (gpgrt_lock_t *lockhd);
1026 : gpg_err_code_t gpgrt_lock_lock (gpgrt_lock_t *lockhd);
1027 : gpg_err_code_t gpgrt_lock_trylock (gpgrt_lock_t *lockhd);
1028 : gpg_err_code_t gpgrt_lock_unlock (gpgrt_lock_t *lockhd);
1029 : gpg_err_code_t gpgrt_lock_destroy (gpgrt_lock_t *lockhd);
1030 :
1031 :
1032 :
1033 : /* Thread functions. */
1034 :
1035 : gpg_err_code_t gpgrt_yield (void);
1036 :
1037 :
1038 :
1039 :
1040 : /* Estream */
1041 :
1042 : /* The definition of this struct is entirely private. You must not
1043 : use it for anything. It is only here so some functions can be
1044 : implemented as macros. */
1045 : struct _gpgrt_stream_internal;
1046 : struct _gpgrt__stream
1047 : {
1048 : /* The layout of this struct must never change. It may be grown,
1049 : but only if all functions which access the new members are
1050 : versioned. */
1051 :
1052 : /* Various flags. */
1053 : struct {
1054 : unsigned int magic: 16;
1055 : unsigned int writing: 1;
1056 : unsigned int reserved: 15;
1057 : } flags;
1058 :
1059 : /* A pointer to the stream buffer. */
1060 : unsigned char *buffer;
1061 :
1062 : /* The size of the buffer in bytes. */
1063 : size_t buffer_size;
1064 :
1065 : /* The length of the usable data in the buffer, only valid when in
1066 : read mode (see flags). */
1067 : size_t data_len;
1068 :
1069 : /* The current position of the offset pointer, valid in read and
1070 : write mode. */
1071 : size_t data_offset;
1072 :
1073 : size_t data_flushed;
1074 : unsigned char *unread_buffer;
1075 : size_t unread_buffer_size;
1076 :
1077 : /* The number of unread bytes. */
1078 : size_t unread_data_len;
1079 :
1080 : /* A pointer to our internal data for this stream. */
1081 : struct _gpgrt_stream_internal *intern;
1082 : };
1083 :
1084 : /* The opaque type for an estream. */
1085 : typedef struct _gpgrt__stream *gpgrt_stream_t;
1086 : #ifdef GPGRT_ENABLE_ES_MACROS
1087 : typedef struct _gpgrt__stream *estream_t;
1088 : #endif
1089 :
1090 : typedef ssize_t (*gpgrt_cookie_read_function_t) (void *cookie,
1091 : void *buffer, size_t size);
1092 : typedef ssize_t (*gpgrt_cookie_write_function_t) (void *cookie,
1093 : const void *buffer,
1094 : size_t size);
1095 : typedef int (*gpgrt_cookie_seek_function_t) (void *cookie,
1096 : gpgrt_off_t *pos, int whence);
1097 : typedef int (*gpgrt_cookie_close_function_t) (void *cookie);
1098 :
1099 : struct _gpgrt_cookie_io_functions
1100 : {
1101 : gpgrt_cookie_read_function_t func_read;
1102 : gpgrt_cookie_write_function_t func_write;
1103 : gpgrt_cookie_seek_function_t func_seek;
1104 : gpgrt_cookie_close_function_t func_close;
1105 : };
1106 : typedef struct _gpgrt_cookie_io_functions gpgrt_cookie_io_functions_t;
1107 : #ifdef GPGRT_ENABLE_ES_MACROS
1108 : typedef struct _gpgrt_cookie_io_functions es_cookie_io_functions_t;
1109 : #define es_cookie_read_function_t gpgrt_cookie_read_function_t
1110 : #define es_cookie_write_function_t gpgrt_cookie_read_function_t
1111 : #define es_cookie_seek_function_t gpgrt_cookie_read_function_t
1112 : #define es_cookie_close_function_t gpgrt_cookie_read_function_t
1113 : #endif
1114 :
1115 : enum gpgrt_syshd_types
1116 : {
1117 : GPGRT_SYSHD_NONE = 0, /* No system handle available. */
1118 : GPGRT_SYSHD_FD = 1, /* A file descriptor as returned by open(). */
1119 : GPGRT_SYSHD_SOCK = 2, /* A socket as returned by socket(). */
1120 : GPGRT_SYSHD_RVID = 3, /* A rendezvous id (see libassuan's gpgcedev.c). */
1121 : GPGRT_SYSHD_HANDLE = 4 /* A HANDLE object (Windows). */
1122 : };
1123 :
1124 : struct _gpgrt_syshd
1125 : {
1126 : enum gpgrt_syshd_types type;
1127 : union {
1128 : int fd;
1129 : int sock;
1130 : int rvid;
1131 : void *handle;
1132 : } u;
1133 : };
1134 : typedef struct _gpgrt_syshd gpgrt_syshd_t;
1135 : #ifdef GPGRT_ENABLE_ES_MACROS
1136 : typedef struct _gpgrt_syshd es_syshd_t;
1137 : #define ES_SYSHD_NONE GPGRT_SYSHD_NONE
1138 : #define ES_SYSHD_FD GPGRT_SYSHD_FD
1139 : #define ES_SYSHD_SOCK GPGRT_SYSHD_SOCK
1140 : #define ES_SYSHD_RVID GPGRT_SYSHD_RVID
1141 : #define ES_SYSHD_HANDLE GPGRT_SYSHD_HANDLE
1142 : #endif
1143 :
1144 : /* The object used with gpgrt_poll. */
1145 : struct _gpgrt_poll_s
1146 : {
1147 : gpgrt_stream_t stream;
1148 : unsigned int want_read:1;
1149 : unsigned int want_write:1;
1150 : unsigned int want_oob:1;
1151 : unsigned int want_rdhup:1;
1152 : unsigned int _reserv1:4;
1153 : unsigned int got_read:1;
1154 : unsigned int got_write:1;
1155 : unsigned int got_oob:1;
1156 : unsigned int got_rdhup:1;
1157 : unsigned int _reserv2:4;
1158 : unsigned int got_err:1;
1159 : unsigned int got_hup:1;
1160 : unsigned int got_nval:1;
1161 : unsigned int _reserv3:4;
1162 : unsigned int ignore:1;
1163 : unsigned int user:8; /* For application use. */
1164 : };
1165 : typedef struct _gpgrt_poll_s gpgrt_poll_t;
1166 : #ifdef GPGRT_ENABLE_ES_MACROS
1167 : typedef struct _gpgrt_poll_s es_poll_t;
1168 : #endif
1169 :
1170 : gpgrt_stream_t gpgrt_fopen (const char *_GPGRT__RESTRICT path,
1171 : const char *_GPGRT__RESTRICT mode);
1172 : gpgrt_stream_t gpgrt_mopen (void *_GPGRT__RESTRICT data,
1173 : size_t data_n, size_t data_len,
1174 : unsigned int grow,
1175 : void *(*func_realloc) (void *mem, size_t size),
1176 : void (*func_free) (void *mem),
1177 : const char *_GPGRT__RESTRICT mode);
1178 : gpgrt_stream_t gpgrt_fopenmem (size_t memlimit,
1179 : const char *_GPGRT__RESTRICT mode);
1180 : gpgrt_stream_t gpgrt_fopenmem_init (size_t memlimit,
1181 : const char *_GPGRT__RESTRICT mode,
1182 : const void *data, size_t datalen);
1183 : gpgrt_stream_t gpgrt_fdopen (int filedes, const char *mode);
1184 : gpgrt_stream_t gpgrt_fdopen_nc (int filedes, const char *mode);
1185 : gpgrt_stream_t gpgrt_sysopen (gpgrt_syshd_t *syshd, const char *mode);
1186 : gpgrt_stream_t gpgrt_sysopen_nc (gpgrt_syshd_t *syshd, const char *mode);
1187 : gpgrt_stream_t gpgrt_fpopen (FILE *fp, const char *mode);
1188 : gpgrt_stream_t gpgrt_fpopen_nc (FILE *fp, const char *mode);
1189 : gpgrt_stream_t gpgrt_freopen (const char *_GPGRT__RESTRICT path,
1190 : const char *_GPGRT__RESTRICT mode,
1191 : gpgrt_stream_t _GPGRT__RESTRICT stream);
1192 : gpgrt_stream_t gpgrt_fopencookie (void *_GPGRT__RESTRICT cookie,
1193 : const char *_GPGRT__RESTRICT mode,
1194 : gpgrt_cookie_io_functions_t functions);
1195 : int gpgrt_fclose (gpgrt_stream_t stream);
1196 : int gpgrt_fclose_snatch (gpgrt_stream_t stream,
1197 : void **r_buffer, size_t *r_buflen);
1198 : int gpgrt_onclose (gpgrt_stream_t stream, int mode,
1199 : void (*fnc) (gpgrt_stream_t, void*), void *fnc_value);
1200 : int gpgrt_fileno (gpgrt_stream_t stream);
1201 : int gpgrt_fileno_unlocked (gpgrt_stream_t stream);
1202 : int gpgrt_syshd (gpgrt_stream_t stream, gpgrt_syshd_t *syshd);
1203 : int gpgrt_syshd_unlocked (gpgrt_stream_t stream, gpgrt_syshd_t *syshd);
1204 :
1205 : void _gpgrt_set_std_fd (int no, int fd);
1206 : gpgrt_stream_t _gpgrt_get_std_stream (int fd);
1207 :
1208 : #define gpgrt_stdin _gpgrt_get_std_stream (0)
1209 : #define gpgrt_stdout _gpgrt_get_std_stream (1)
1210 : #define gpgrt_stderr _gpgrt_get_std_stream (2)
1211 :
1212 :
1213 : void gpgrt_flockfile (gpgrt_stream_t stream);
1214 : int gpgrt_ftrylockfile (gpgrt_stream_t stream);
1215 : void gpgrt_funlockfile (gpgrt_stream_t stream);
1216 :
1217 : int gpgrt_feof (gpgrt_stream_t stream);
1218 : int gpgrt_feof_unlocked (gpgrt_stream_t stream);
1219 : int gpgrt_ferror (gpgrt_stream_t stream);
1220 : int gpgrt_ferror_unlocked (gpgrt_stream_t stream);
1221 : void gpgrt_clearerr (gpgrt_stream_t stream);
1222 : void gpgrt_clearerr_unlocked (gpgrt_stream_t stream);
1223 :
1224 : int _gpgrt_pending (gpgrt_stream_t stream); /* (private) */
1225 : int _gpgrt_pending_unlocked (gpgrt_stream_t stream); /* (private) */
1226 :
1227 : #define gpgrt_pending(stream) _gpgrt_pending (stream)
1228 :
1229 : #define gpgrt_pending_unlocked(stream) \
1230 : (((!(stream)->flags.writing) \
1231 : && (((stream)->data_offset < (stream)->data_len) \
1232 : || ((stream)->unread_data_len))) \
1233 : ? 1 : _gpgrt_pending_unlocked ((stream)))
1234 :
1235 : int gpgrt_fflush (gpgrt_stream_t stream);
1236 : int gpgrt_fseek (gpgrt_stream_t stream, long int offset, int whence);
1237 : int gpgrt_fseeko (gpgrt_stream_t stream, gpgrt_off_t offset, int whence);
1238 : long int gpgrt_ftell (gpgrt_stream_t stream);
1239 : gpgrt_off_t gpgrt_ftello (gpgrt_stream_t stream);
1240 : void gpgrt_rewind (gpgrt_stream_t stream);
1241 :
1242 : int gpgrt_fgetc (gpgrt_stream_t stream);
1243 : int gpgrt_fputc (int c, gpgrt_stream_t stream);
1244 :
1245 : int _gpgrt_getc_underflow (gpgrt_stream_t stream); /* (private) */
1246 : int _gpgrt_putc_overflow (int c, gpgrt_stream_t stream); /* (private) */
1247 :
1248 : #define gpgrt_getc_unlocked(stream) \
1249 : (((!(stream)->flags.writing) \
1250 : && ((stream)->data_offset < (stream)->data_len) \
1251 : && (! (stream)->unread_data_len)) \
1252 : ? ((int) (stream)->buffer[((stream)->data_offset)++]) \
1253 : : _gpgrt_getc_underflow ((stream)))
1254 :
1255 : #define gpgrt_putc_unlocked(c, stream) \
1256 : (((stream)->flags.writing \
1257 : && ((stream)->data_offset < (stream)->buffer_size) \
1258 : && (c != '\n')) \
1259 : ? ((int) ((stream)->buffer[((stream)->data_offset)++] = (c))) \
1260 : : _gpgrt_putc_overflow ((c), (stream)))
1261 :
1262 : #define gpgrt_getc(stream) gpgrt_fgetc (stream)
1263 : #define gpgrt_putc(c, stream) gpgrt_fputc (c, stream)
1264 :
1265 : int gpgrt_ungetc (int c, gpgrt_stream_t stream);
1266 :
1267 : int gpgrt_read (gpgrt_stream_t _GPGRT__RESTRICT stream,
1268 : void *_GPGRT__RESTRICT buffer, size_t bytes_to_read,
1269 : size_t *_GPGRT__RESTRICT bytes_read);
1270 : int gpgrt_write (gpgrt_stream_t _GPGRT__RESTRICT stream,
1271 : const void *_GPGRT__RESTRICT buffer, size_t bytes_to_write,
1272 : size_t *_GPGRT__RESTRICT bytes_written);
1273 : int gpgrt_write_sanitized (gpgrt_stream_t _GPGRT__RESTRICT stream,
1274 : const void *_GPGRT__RESTRICT buffer, size_t length,
1275 : const char *delimiters,
1276 : size_t *_GPGRT__RESTRICT bytes_written);
1277 : int gpgrt_write_hexstring (gpgrt_stream_t _GPGRT__RESTRICT stream,
1278 : const void *_GPGRT__RESTRICT buffer, size_t length,
1279 : int reserved,
1280 : size_t *_GPGRT__RESTRICT bytes_written);
1281 :
1282 : size_t gpgrt_fread (void *_GPGRT__RESTRICT ptr, size_t size, size_t nitems,
1283 : gpgrt_stream_t _GPGRT__RESTRICT stream);
1284 : size_t gpgrt_fwrite (const void *_GPGRT__RESTRICT ptr, size_t size, size_t memb,
1285 : gpgrt_stream_t _GPGRT__RESTRICT stream);
1286 :
1287 : char *gpgrt_fgets (char *_GPGRT__RESTRICT s, int n,
1288 : gpgrt_stream_t _GPGRT__RESTRICT stream);
1289 : int gpgrt_fputs (const char *_GPGRT__RESTRICT s,
1290 : gpgrt_stream_t _GPGRT__RESTRICT stream);
1291 : int gpgrt_fputs_unlocked (const char *_GPGRT__RESTRICT s,
1292 : gpgrt_stream_t _GPGRT__RESTRICT stream);
1293 :
1294 : ssize_t gpgrt_getline (char *_GPGRT__RESTRICT *_GPGRT__RESTRICT lineptr,
1295 : size_t *_GPGRT__RESTRICT n,
1296 : gpgrt_stream_t stream);
1297 : ssize_t gpgrt_read_line (gpgrt_stream_t stream,
1298 : char **addr_of_buffer, size_t *length_of_buffer,
1299 : size_t *max_length);
1300 : void gpgrt_free (void *a);
1301 :
1302 : int gpgrt_fprintf (gpgrt_stream_t _GPGRT__RESTRICT stream,
1303 : const char *_GPGRT__RESTRICT format, ...)
1304 : GPGRT_ATTR_PRINTF(2,3);
1305 : int gpgrt_fprintf_unlocked (gpgrt_stream_t _GPGRT__RESTRICT stream,
1306 : const char *_GPGRT__RESTRICT format, ...)
1307 : GPGRT_ATTR_PRINTF(2,3);
1308 :
1309 : int gpgrt_printf (const char *_GPGRT__RESTRICT format, ...)
1310 : GPGRT_ATTR_PRINTF(1,2);
1311 : int gpgrt_printf_unlocked (const char *_GPGRT__RESTRICT format, ...)
1312 : GPGRT_ATTR_PRINTF(1,2);
1313 :
1314 : int gpgrt_vfprintf (gpgrt_stream_t _GPGRT__RESTRICT stream,
1315 : const char *_GPGRT__RESTRICT format, va_list ap)
1316 : GPGRT_ATTR_PRINTF(2,0);
1317 : int gpgrt_vfprintf_unlocked (gpgrt_stream_t _GPGRT__RESTRICT stream,
1318 : const char *_GPGRT__RESTRICT format, va_list ap)
1319 : GPGRT_ATTR_PRINTF(2,0);
1320 :
1321 : int gpgrt_setvbuf (gpgrt_stream_t _GPGRT__RESTRICT stream,
1322 : char *_GPGRT__RESTRICT buf, int mode, size_t size);
1323 : void gpgrt_setbuf (gpgrt_stream_t _GPGRT__RESTRICT stream,
1324 : char *_GPGRT__RESTRICT buf);
1325 :
1326 : void gpgrt_set_binary (gpgrt_stream_t stream);
1327 : int gpgrt_set_nonblock (gpgrt_stream_t stream, int onoff);
1328 : int gpgrt_get_nonblock (gpgrt_stream_t stream);
1329 :
1330 : int gpgrt_poll (gpgrt_poll_t *fdlist, unsigned int nfds, int timeout);
1331 :
1332 : gpgrt_stream_t gpgrt_tmpfile (void);
1333 :
1334 : void gpgrt_opaque_set (gpgrt_stream_t _GPGRT__RESTRICT stream,
1335 : void *_GPGRT__RESTRICT opaque);
1336 : void *gpgrt_opaque_get (gpgrt_stream_t stream);
1337 :
1338 : void gpgrt_fname_set (gpgrt_stream_t stream, const char *fname);
1339 : const char *gpgrt_fname_get (gpgrt_stream_t stream);
1340 :
1341 : int gpgrt_asprintf (char **r_buf, const char * _GPGRT__RESTRICT format, ...)
1342 : GPGRT_ATTR_PRINTF(2,3);
1343 : int gpgrt_vasprintf (char **r_buf, const char * _GPGRT__RESTRICT format,
1344 : va_list ap)
1345 : GPGRT_ATTR_PRINTF(2,0);
1346 : char *gpgrt_bsprintf (const char * _GPGRT__RESTRICT format, ...)
1347 : GPGRT_ATTR_PRINTF(1,2);
1348 : char *gpgrt_vbsprintf (const char * _GPGRT__RESTRICT format, va_list ap)
1349 : GPGRT_ATTR_PRINTF(1,0);
1350 : int gpgrt_snprintf (char *buf, size_t bufsize,
1351 : const char * _GPGRT__RESTRICT format, ...)
1352 : GPGRT_ATTR_PRINTF(3,4);
1353 : int gpgrt_vsnprintf (char *buf,size_t bufsize,
1354 : const char * _GPGRT__RESTRICT format, va_list arg_ptr)
1355 : GPGRT_ATTR_PRINTF(3,0);
1356 :
1357 :
1358 : #ifdef GPGRT_ENABLE_ES_MACROS
1359 : # define es_fopen gpgrt_fopen
1360 : # define es_mopen gpgrt_mopen
1361 : # define es_fopenmem gpgrt_fopenmem
1362 : # define es_fopenmem_init gpgrt_fopenmem_init
1363 : # define es_fdopen gpgrt_fdopen
1364 : # define es_fdopen_nc gpgrt_fdopen_nc
1365 : # define es_sysopen gpgrt_sysopen
1366 : # define es_sysopen_nc gpgrt_sysopen_nc
1367 : # define es_fpopen gpgrt_fpopen
1368 : # define es_fpopen_nc gpgrt_fpopen_nc
1369 : # define es_freopen gpgrt_freopen
1370 : # define es_fopencookie gpgrt_fopencookie
1371 : # define es_fclose gpgrt_fclose
1372 : # define es_fclose_snatch gpgrt_fclose_snatch
1373 : # define es_onclose gpgrt_onclose
1374 : # define es_fileno gpgrt_fileno
1375 : # define es_fileno_unlocked gpgrt_fileno_unlocked
1376 : # define es_syshd gpgrt_syshd
1377 : # define es_syshd_unlocked gpgrt_syshd_unlocked
1378 : # define es_stdin _gpgrt_get_std_stream (0)
1379 : # define es_stdout _gpgrt_get_std_stream (1)
1380 : # define es_stderr _gpgrt_get_std_stream (2)
1381 : # define es_flockfile gpgrt_flockfile
1382 : # define es_ftrylockfile gpgrt_ftrylockfile
1383 : # define es_funlockfile gpgrt_funlockfile
1384 : # define es_feof gpgrt_feof
1385 : # define es_feof_unlocked gpgrt_feof_unlocked
1386 : # define es_ferror gpgrt_ferror
1387 : # define es_ferror_unlocked gpgrt_ferror_unlocked
1388 : # define es_clearerr gpgrt_clearerr
1389 : # define es_clearerr_unlocked gpgrt_clearerr_unlocked
1390 : # define es_pending gpgrt_pending
1391 : # define es_pending_unlocked gpgrt_pending_unlocked
1392 : # define es_fflush gpgrt_fflush
1393 : # define es_fseek gpgrt_fseek
1394 : # define es_fseeko gpgrt_fseeko
1395 : # define es_ftell gpgrt_ftell
1396 : # define es_ftello gpgrt_ftello
1397 : # define es_rewind gpgrt_rewind
1398 : # define es_fgetc gpgrt_fgetc
1399 : # define es_fputc gpgrt_fputc
1400 : # define es_getc_unlocked gpgrt_getc_unlocked
1401 : # define es_putc_unlocked gpgrt_putc_unlocked
1402 : # define es_getc gpgrt_getc
1403 : # define es_putc gpgrt_putc
1404 : # define es_ungetc gpgrt_ungetc
1405 : # define es_read gpgrt_read
1406 : # define es_write gpgrt_write
1407 : # define es_write_sanitized gpgrt_write_sanitized
1408 : # define es_write_hexstring gpgrt_write_hexstring
1409 : # define es_fread gpgrt_fread
1410 : # define es_fwrite gpgrt_fwrite
1411 : # define es_fgets gpgrt_fgets
1412 : # define es_fputs gpgrt_fputs
1413 : # define es_fputs_unlocked gpgrt_fputs_unlocked
1414 : # define es_getline gpgrt_getline
1415 : # define es_read_line gpgrt_read_line
1416 : # define es_free gpgrt_free
1417 : # define es_fprintf gpgrt_fprintf
1418 : # define es_fprintf_unlocked gpgrt_fprintf_unlocked
1419 : # define es_printf gpgrt_printf
1420 : # define es_printf_unlocked gpgrt_printf_unlocked
1421 : # define es_vfprintf gpgrt_vfprintf
1422 : # define es_vfprintf_unlocked gpgrt_vfprintf_unlocked
1423 : # define es_setvbuf gpgrt_setvbuf
1424 : # define es_setbuf gpgrt_setbuf
1425 : # define es_set_binary gpgrt_set_binary
1426 : # define es_set_nonblock gpgrt_set_nonblock
1427 : # define es_get_nonblock gpgrt_get_nonblock
1428 : # define es_poll gpgrt_poll
1429 : # define es_tmpfile gpgrt_tmpfile
1430 : # define es_opaque_set gpgrt_opaque_set
1431 : # define es_opaque_get gpgrt_opaque_get
1432 : # define es_fname_set gpgrt_fname_set
1433 : # define es_fname_get gpgrt_fname_get
1434 : # define es_asprintf gpgrt_asprintf
1435 : # define es_vasprintf gpgrt_vasprintf
1436 : # define es_bsprintf gpgrt_bsprintf
1437 : # define es_vbsprintf gpgrt_vbsprintf
1438 : #endif /*GPGRT_ENABLE_ES_MACROS*/
1439 :
1440 : #ifdef __cplusplus
1441 : }
1442 : #endif
1443 : #endif /* GPG_ERROR_H */
1444 : /*
1445 : Local Variables:
1446 : buffer-read-only: t
1447 : End:
1448 : */
|