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