Almroth.com
Home Software Projects Documents Links Photos Contact us

gpgerror.ads
------------------------------------------------------------------------------
-- --
-- GPGError --
-- --
-- Binding Specification --
-- --
-- --
-- Copyright (C) 2003,2005 Andreas Almroth --
-- --
-- GPGError is free software; you can redistribute it and/or modify it --
-- under terms of the GNU General Public License as published by the Free --
-- Software Foundation; either version 2, or (at your option) any later --
-- version. GPGError is distributed in the hope that it will be useful, --
-- but WITH OUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General --
-- Public License for more details. You should have received a copy of the --
-- GNU General Public License distributed with GPGError; see file COPYING. --
-- If not, write to the Free Software Foundation, 59 Temple Place - --
-- Suite 330, Boston, MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
------------------------------------------------------------------------------
--
-- This is an Ada95 thin binding to GPG-error
-- !!! This version is synchronised to 1.0 !!!
--
-- The original GPGError library is copyrighted by;
-- Copyright (C) 2003,2004 g10 Code GmbH
------------------------------------------------------------------------------
-- $Author: Andreas Almroth $
-- $Date: 2005-03-28 10:54 $
-- $Workfile: gpgerror.ads $
-- $Revision: 5 $
-- $State: Unstable $
--
-- HISTORY:
--
-- Revision 5: Updated to libgpg-error version 1.0 and some code cleanup
-- 2005-03-28 10:54
--
-- Revision 4: Changes to reflect 0.5 of C API
-- 2003-10-11 01:44
--
-- Revision 3: Version upgrade only
--
-- Revision 2: Minor updates to constants
--
-- Revision 1: Initial release
--

with Interfaces; use Interfaces;
with Interfaces.C;
with Interfaces.C.Strings;

package Gpgerror is
pragma Linker_Options("-lgpg-error");

-- The error source type gpg_err_source_t.
--
-- Only use free slots, never change or reorder the existing
-- entries.

-- Line: 73
subtype Gpg_Err_Source_T is Interfaces.Unsigned_32;

GPG_ERR_SOURCE_UNKNOWN : constant := 0;
GPG_ERR_SOURCE_GCRYPT : constant := 1;
GPG_ERR_SOURCE_GPG : constant := 2;
GPG_ERR_SOURCE_GPGSM : constant := 3;
GPG_ERR_SOURCE_GPGAGENT : constant := 4;
GPG_ERR_SOURCE_PINENTRY : constant := 5;
GPG_ERR_SOURCE_SCD : constant := 6;
GPG_ERR_SOURCE_GPGME : constant := 7;
GPG_ERR_SOURCE_KEYBOX : constant := 8;
GPG_ERR_SOURCE_DIRMNGR : constant := 10;
GPG_ERR_SOURCE_GSTI : constant := 11;
GPG_ERR_SOURCE_USER_1 : constant := 32;
GPG_ERR_SOURCE_USER_2 : constant := 33;
GPG_ERR_SOURCE_USER_3 : constant := 34;
GPG_ERR_SOURCE_USER_4 : constant := 35;
GPG_ERR_SOURCE_DIM : constant := 256;

-- The error code type gpg_err_code_t.
--
-- Only use free slots, never change or reorder the existing
-- entries.

-- Line: 101
subtype Gpg_Err_Code_T is Unsigned_32;

GPG_ERR_NO_ERROR : constant := 0;
GPG_ERR_GENERAL : constant := 1;
GPG_ERR_UNKNOWN_PACKET : constant := 2;
GPG_ERR_UNKNOWN_VERSION : constant := 3;
GPG_ERR_PUBKEY_ALGO : constant := 4;
GPG_ERR_DIGEST_ALGO : constant := 5;
GPG_ERR_BAD_PUBKEY : constant := 6;
GPG_ERR_BAD_SECKEY : constant := 7;
GPG_ERR_BAD_SIGNATURE : constant := 8;
GPG_ERR_NO_PUBKEY : constant := 9;
GPG_ERR_CHECKSUM : constant := 10;
GPG_ERR_BAD_PASSPHRASE : constant := 11;
GPG_ERR_CIPHER_ALGO : constant := 12;
GPG_ERR_KEYRING_OPEN : constant := 13;
GPG_ERR_INV_PACKET : constant := 14;
GPG_ERR_INV_ARMOR : constant := 15;
GPG_ERR_NO_USER_ID : constant := 16;
GPG_ERR_NO_SECKEY : constant := 17;
GPG_ERR_WRONG_SECKEY : constant := 18;
GPG_ERR_BAD_KEY : constant := 19;
GPG_ERR_COMPR_ALGO : constant := 20;
GPG_ERR_NO_PRIME : constant := 21;
GPG_ERR_NO_ENCODING_METHOD : constant := 22;
GPG_ERR_NO_ENCRYPTION_SCHEME : constant := 23;
GPG_ERR_NO_SIGNATURE_SCHEME : constant := 24;
GPG_ERR_INV_ATTR : constant := 25;
GPG_ERR_NO_VALUE : constant := 26;
GPG_ERR_NOT_FOUND : constant := 27;
GPG_ERR_VALUE_NOT_FOUND : constant := 28;
GPG_ERR_SYNTAX : constant := 29;
GPG_ERR_BAD_MPI : constant := 30;
GPG_ERR_INV_PASSPHRASE : constant := 31;
GPG_ERR_SIG_CLASS : constant := 32;
GPG_ERR_RESOURCE_LIMIT : constant := 33;
GPG_ERR_INV_KEYRING : constant := 34;
GPG_ERR_TRUSTDB : constant := 35;
GPG_ERR_BAD_CERT : constant := 36;
GPG_ERR_INV_USER_ID : constant := 37;
GPG_ERR_UNEXPECTED : constant := 38;
GPG_ERR_TIME_CONFLICT : constant := 39;
GPG_ERR_KEYSERVER : constant := 40;
GPG_ERR_WRONG_PUBKEY_ALGO : constant := 41;
GPG_ERR_TRIBUTE_TO_D_A : constant := 42;
GPG_ERR_WEAK_KEY : constant := 43;
GPG_ERR_INV_KEYLEN : constant := 44;
GPG_ERR_INV_ARG : constant := 45;
GPG_ERR_BAD_URI : constant := 46;
GPG_ERR_INV_URI : constant := 47;
GPG_ERR_NETWORK : constant := 48;
GPG_ERR_UNKNOWN_HOST : constant := 49;
GPG_ERR_SELFTEST_FAILED : constant := 50;
GPG_ERR_NOT_ENCRYPTED : constant := 51;
GPG_ERR_NOT_PROCESSED : constant := 52;
GPG_ERR_UNUSABLE_PUBKEY : constant := 53;
GPG_ERR_UNUSABLE_SECKEY : constant := 54;
GPG_ERR_INV_VALUE : constant := 55;
GPG_ERR_BAD_CERT_CHAIN : constant := 56;
GPG_ERR_MISSING_CERT : constant := 57;
GPG_ERR_NO_DATA : constant := 58;
GPG_ERR_BUG : constant := 59;
GPG_ERR_NOT_SUPPORTED : constant := 60;
GPG_ERR_INV_OP : constant := 61;
GPG_ERR_TIMEOUT : constant := 62;
GPG_ERR_INTERNAL : constant := 63;
GPG_ERR_EOF_GCRYPT : constant := 64;
GPG_ERR_INV_OBJ : constant := 65;
GPG_ERR_TOO_SHORT : constant := 66;
GPG_ERR_TOO_LARGE : constant := 67;
GPG_ERR_NO_OBJ : constant := 68;
GPG_ERR_NOT_IMPLEMENTED : constant := 69;
GPG_ERR_CONFLICT : constant := 70;
GPG_ERR_INV_CIPHER_MODE : constant := 71;
GPG_ERR_INV_FLAG : constant := 72;
GPG_ERR_INV_HANDLE : constant := 73;
GPG_ERR_TRUNCATED : constant := 74;
GPG_ERR_INCOMPLETE_LINE : constant := 75;
GPG_ERR_INV_RESPONSE : constant := 76;
GPG_ERR_NO_AGENT : constant := 77;
GPG_ERR_AGENT : constant := 78;
GPG_ERR_INV_DATA : constant := 79;
GPG_ERR_ASSUAN_SERVER_FAULT : constant := 80;
GPG_ERR_ASSUAN : constant := 81;
GPG_ERR_INV_SESSION_KEY : constant := 82;
GPG_ERR_INV_SEXP : constant := 83;
GPG_ERR_UNSUPPORTED_ALGORITHM : constant := 84;
GPG_ERR_NO_PIN_ENTRY : constant := 85;
GPG_ERR_PIN_ENTRY : constant := 86;
GPG_ERR_BAD_PIN : constant := 87;
GPG_ERR_INV_NAME : constant := 88;
GPG_ERR_BAD_DATA : constant := 89;
GPG_ERR_INV_PARAMETER : constant := 90;
GPG_ERR_WRONG_CARD : constant := 91;
GPG_ERR_NO_DIRMNGR : constant := 92;
GPG_ERR_DIRMNGR : constant := 93;
GPG_ERR_CERT_REVOKED : constant := 94;
GPG_ERR_NO_CRL_KNOWN : constant := 95;
GPG_ERR_CRL_TOO_OLD : constant := 96;
GPG_ERR_LINE_TOO_LONG : constant := 97;
GPG_ERR_NOT_TRUSTED : constant := 98;
GPG_ERR_CANCELED : constant := 99;
GPG_ERR_BAD_CA_CERT : constant := 100;
GPG_ERR_CERT_EXPIRED : constant := 101;
GPG_ERR_CERT_TOO_YOUNG : constant := 102;
GPG_ERR_UNSUPPORTED_CERT : constant := 103;
GPG_ERR_UNKNOWN_SEXP : constant := 104;
GPG_ERR_UNSUPPORTED_PROTECTION : constant := 105;
GPG_ERR_CORRUPTED_PROTECTION : constant := 106;
GPG_ERR_AMBIGUOUS_NAME : constant := 107;
GPG_ERR_CARD : constant := 108;
GPG_ERR_CARD_RESET : constant := 109;
GPG_ERR_CARD_REMOVED : constant := 110;
GPG_ERR_INV_CARD : constant := 111;
GPG_ERR_CARD_NOT_PRESENT : constant := 112;
GPG_ERR_NO_PKCS15_APP : constant := 113;
GPG_ERR_NOT_CONFIRMED : constant := 114;
GPG_ERR_CONFIGURATION : constant := 115;
GPG_ERR_NO_POLICY_MATCH : constant := 116;
GPG_ERR_INV_INDEX : constant := 117;
GPG_ERR_INV_ID : constant := 118;
GPG_ERR_NO_SCDAEMON : constant := 119;
GPG_ERR_SCDAEMON : constant := 120;
GPG_ERR_UNSUPPORTED_PROTOCOL : constant := 121;
GPG_ERR_BAD_PIN_METHOD : constant := 122;
GPG_ERR_CARD_NOT_INITIALIZED : constant := 123;
GPG_ERR_UNSUPPORTED_OPERATION : constant := 124;
GPG_ERR_WRONG_KEY_USAGE : constant := 125;
GPG_ERR_NOTHING_FOUND : constant := 126;
GPG_ERR_WRONG_BLOB_TYPE : constant := 127;
GPG_ERR_MISSING_VALUE : constant := 128;
GPG_ERR_HARDWARE : constant := 129;
GPG_ERR_PIN_BLOCKED : constant := 130;
GPG_ERR_USE_CONDITIONS : constant := 131;
GPG_ERR_PIN_NOT_SYNCED : constant := 132;
GPG_ERR_INV_CRL : constant := 133;
GPG_ERR_BAD_BER : constant := 134;
GPG_ERR_INV_BER : constant := 135;
GPG_ERR_ELEMENT_NOT_FOUND : constant := 136;
GPG_ERR_IDENTIFIER_NOT_FOUND : constant := 137;
GPG_ERR_INV_TAG : constant := 138;
GPG_ERR_INV_LENGTH : constant := 139;
GPG_ERR_INV_KEYINFO : constant := 140;
GPG_ERR_UNEXPECTED_TAG : constant := 141;
GPG_ERR_NOT_DER_ENCODED : constant := 142;
GPG_ERR_NO_CMS_OBJ : constant := 143;
GPG_ERR_INV_CMS_OBJ : constant := 144;
GPG_ERR_UNKNOWN_CMS_OBJ : constant := 145;
GPG_ERR_UNSUPPORTED_CMS_OBJ : constant := 146;
GPG_ERR_UNSUPPORTED_ENCODING : constant := 147;
GPG_ERR_UNSUPPORTED_CMS_VERSION : constant := 148;
GPG_ERR_UNKNOWN_ALGORITHM : constant := 149;
GPG_ERR_INV_ENGINE : constant := 150;
GPG_ERR_PUBKEY_NOT_TRUSTED : constant := 151;
GPG_ERR_DECRYPT_FAILED : constant := 152;
GPG_ERR_KEY_EXPIRED : constant := 153;
GPG_ERR_SIG_EXPIRED : constant := 154;
GPG_ERR_ENCODING_PROBLEM : constant := 155;
GPG_ERR_INV_STATE : constant := 156;
GPG_ERR_DUP_VALUE : constant := 157;
GPG_ERR_MISSING_ACTION : constant := 158;
GPG_ERR_MODULE_NOT_FOUND : constant := 159;
GPG_ERR_INV_OID_STRING : constant := 160;
GPG_ERR_INV_TIME : constant := 161;
GPG_ERR_INV_CRL_OBJ : constant := 162;
GPG_ERR_UNSUPPORTED_CRL_VERSION : constant := 163;
GPG_ERR_INV_CERT_OBJ : constant := 164;
GPG_ERR_UNKNOWN_NAME : constant := 165;
GPG_ERR_LOCALE_PROBLEM : constant := 166;
GPG_ERR_NOT_LOCKED : constant := 167;
GPG_ERR_PROTOCOL_VIOLATION : constant := 168;
GPG_ERR_INV_MAC : constant := 169;
GPG_ERR_INV_REQUEST : constant := 170;
GPG_ERR_BUFFER_TOO_SHORT : constant := 200;
GPG_ERR_SEXP_INV_LEN_SPEC : constant := 201;
GPG_ERR_SEXP_STRING_TOO_LONG : constant := 202;
GPG_ERR_SEXP_UNMATCHED_PAREN : constant := 203;
GPG_ERR_SEXP_NOT_CANONICAL : constant := 204;
GPG_ERR_SEXP_BAD_CHARACTER : constant := 205;
GPG_ERR_SEXP_BAD_QUOTATION : constant := 206;
GPG_ERR_SEXP_ZERO_PREFIX : constant := 207;
GPG_ERR_SEXP_NESTED_DH : constant := 208;
GPG_ERR_SEXP_UNMATCHED_DH : constant := 209;
GPG_ERR_SEXP_UNEXPECTED_PUNC : constant := 210;
GPG_ERR_SEXP_BAD_HEX_CHAR : constant := 211;
GPG_ERR_SEXP_ODD_HEX_NUMBERS : constant := 212;
GPG_ERR_SEXP_BAD_OCT_CHAR : constant := 213;
GPG_ERR_USER_1 : constant := 1024;
GPG_ERR_USER_2 : constant := 1025;
GPG_ERR_USER_3 : constant := 1026;
GPG_ERR_USER_4 : constant := 1027;
GPG_ERR_USER_5 : constant := 1028;
GPG_ERR_USER_6 : constant := 1029;
GPG_ERR_USER_7 : constant := 1030;
GPG_ERR_USER_8 : constant := 1031;
GPG_ERR_USER_9 : constant := 1032;
GPG_ERR_USER_10 : constant := 1033;
GPG_ERR_USER_11 : constant := 1034;
GPG_ERR_USER_12 : constant := 1035;
GPG_ERR_USER_13 : constant := 1036;
GPG_ERR_USER_14 : constant := 1037;
GPG_ERR_USER_15 : constant := 1038;
GPG_ERR_USER_16 : constant := 1039;
GPG_ERR_UNKNOWN_ERRNO : constant := 16382;
GPG_ERR_EOF : constant := 16383;

-- Line: 308
GPG_ERR_SYSTEM_ERROR : constant := 32768;

GPG_ERR_E2BIG : constant := GPG_ERR_SYSTEM_ERROR + 0;
GPG_ERR_EACCES : constant := GPG_ERR_SYSTEM_ERROR + 1;
GPG_ERR_EADDRINUSE : constant := GPG_ERR_SYSTEM_ERROR + 2;
GPG_ERR_EADDRNOTAVAIL : constant := GPG_ERR_SYSTEM_ERROR + 3;
GPG_ERR_EADV : constant := GPG_ERR_SYSTEM_ERROR + 4;
GPG_ERR_EAFNOSUPPORT : constant := GPG_ERR_SYSTEM_ERROR + 5;
GPG_ERR_EAGAIN : constant := GPG_ERR_SYSTEM_ERROR + 6;
GPG_ERR_EALREADY : constant := GPG_ERR_SYSTEM_ERROR + 7;
GPG_ERR_EAUTH : constant := GPG_ERR_SYSTEM_ERROR + 8;
GPG_ERR_EBACKGROUND : constant := GPG_ERR_SYSTEM_ERROR + 9;
GPG_ERR_EBADE : constant := GPG_ERR_SYSTEM_ERROR + 10;
GPG_ERR_EBADF : constant := GPG_ERR_SYSTEM_ERROR + 11;
GPG_ERR_EBADFD : constant := GPG_ERR_SYSTEM_ERROR + 12;
GPG_ERR_EBADMSG : constant := GPG_ERR_SYSTEM_ERROR + 13;
GPG_ERR_EBADR : constant := GPG_ERR_SYSTEM_ERROR + 14;
GPG_ERR_EBADRPC : constant := GPG_ERR_SYSTEM_ERROR + 15;
GPG_ERR_EBADRQC : constant := GPG_ERR_SYSTEM_ERROR + 16;
GPG_ERR_EBADSLT : constant := GPG_ERR_SYSTEM_ERROR + 17;
GPG_ERR_EBFONT : constant := GPG_ERR_SYSTEM_ERROR + 18;
GPG_ERR_EBUSY : constant := GPG_ERR_SYSTEM_ERROR + 19;
GPG_ERR_ECANCELED : constant := GPG_ERR_SYSTEM_ERROR + 20;
GPG_ERR_ECHILD : constant := GPG_ERR_SYSTEM_ERROR + 21;
GPG_ERR_ECHRNG : constant := GPG_ERR_SYSTEM_ERROR + 22;
GPG_ERR_ECOMM : constant := GPG_ERR_SYSTEM_ERROR + 23;
GPG_ERR_ECONNABORTED : constant := GPG_ERR_SYSTEM_ERROR + 24;
GPG_ERR_ECONNREFUSED : constant := GPG_ERR_SYSTEM_ERROR + 25;
GPG_ERR_ECONNRESET : constant := GPG_ERR_SYSTEM_ERROR + 26;
GPG_ERR_ED : constant := GPG_ERR_SYSTEM_ERROR + 27;
GPG_ERR_EDEADLK : constant := GPG_ERR_SYSTEM_ERROR + 28;
GPG_ERR_EDEADLOCK : constant := GPG_ERR_SYSTEM_ERROR + 29;
GPG_ERR_EDESTADDRREQ : constant := GPG_ERR_SYSTEM_ERROR + 30;
GPG_ERR_EDIED : constant := GPG_ERR_SYSTEM_ERROR + 31;
GPG_ERR_EDOM : constant := GPG_ERR_SYSTEM_ERROR + 32;
GPG_ERR_EDOTDOT : constant := GPG_ERR_SYSTEM_ERROR + 33;
GPG_ERR_EDQUOT : constant := GPG_ERR_SYSTEM_ERROR + 34;
GPG_ERR_EEXIST : constant := GPG_ERR_SYSTEM_ERROR + 35;
GPG_ERR_EFAULT : constant := GPG_ERR_SYSTEM_ERROR + 36;
GPG_ERR_EFBIG : constant := GPG_ERR_SYSTEM_ERROR + 37;
GPG_ERR_EFTYPE : constant := GPG_ERR_SYSTEM_ERROR + 38;
GPG_ERR_EGRATUITOUS : constant := GPG_ERR_SYSTEM_ERROR + 39;
GPG_ERR_EGREGIOUS : constant := GPG_ERR_SYSTEM_ERROR + 40;
GPG_ERR_EHOSTDOWN : constant := GPG_ERR_SYSTEM_ERROR + 41;
GPG_ERR_EHOSTUNREACH : constant := GPG_ERR_SYSTEM_ERROR + 42;
GPG_ERR_EIDRM : constant := GPG_ERR_SYSTEM_ERROR + 43;
GPG_ERR_EIEIO : constant := GPG_ERR_SYSTEM_ERROR + 44;
GPG_ERR_EILSEQ : constant := GPG_ERR_SYSTEM_ERROR + 45;
GPG_ERR_EINPROGRESS : constant := GPG_ERR_SYSTEM_ERROR + 46;
GPG_ERR_EINTR : constant := GPG_ERR_SYSTEM_ERROR + 47;
GPG_ERR_EINVAL : constant := GPG_ERR_SYSTEM_ERROR + 48;
GPG_ERR_EIO : constant := GPG_ERR_SYSTEM_ERROR + 49;
GPG_ERR_EISCONN : constant := GPG_ERR_SYSTEM_ERROR + 50;
GPG_ERR_EISDIR : constant := GPG_ERR_SYSTEM_ERROR + 51;
GPG_ERR_EISNAM : constant := GPG_ERR_SYSTEM_ERROR + 52;
GPG_ERR_EL2HLT : constant := GPG_ERR_SYSTEM_ERROR + 53;
GPG_ERR_EL2NSYNC : constant := GPG_ERR_SYSTEM_ERROR + 54;
GPG_ERR_EL3HLT : constant := GPG_ERR_SYSTEM_ERROR + 55;
GPG_ERR_EL3RST : constant := GPG_ERR_SYSTEM_ERROR + 56;
GPG_ERR_ELIBACC : constant := GPG_ERR_SYSTEM_ERROR + 57;
GPG_ERR_ELIBBAD : constant := GPG_ERR_SYSTEM_ERROR + 58;
GPG_ERR_ELIBEXEC : constant := GPG_ERR_SYSTEM_ERROR + 59;
GPG_ERR_ELIBMAX : constant := GPG_ERR_SYSTEM_ERROR + 60;
GPG_ERR_ELIBSCN : constant := GPG_ERR_SYSTEM_ERROR + 61;
GPG_ERR_ELNRNG : constant := GPG_ERR_SYSTEM_ERROR + 62;
GPG_ERR_ELOOP : constant := GPG_ERR_SYSTEM_ERROR + 63;
GPG_ERR_EMEDIUMTYPE : constant := GPG_ERR_SYSTEM_ERROR + 64;
GPG_ERR_EMFILE : constant := GPG_ERR_SYSTEM_ERROR + 65;
GPG_ERR_EMLINK : constant := GPG_ERR_SYSTEM_ERROR + 66;
GPG_ERR_EMSGSIZE : constant := GPG_ERR_SYSTEM_ERROR + 67;
GPG_ERR_EMULTIHOP : constant := GPG_ERR_SYSTEM_ERROR + 68;
GPG_ERR_ENAMETOOLONG : constant := GPG_ERR_SYSTEM_ERROR + 69;
GPG_ERR_ENAVAIL : constant := GPG_ERR_SYSTEM_ERROR + 70;
GPG_ERR_ENEEDAUTH : constant := GPG_ERR_SYSTEM_ERROR + 71;
GPG_ERR_ENETDOWN : constant := GPG_ERR_SYSTEM_ERROR + 72;
GPG_ERR_ENETRESET : constant := GPG_ERR_SYSTEM_ERROR + 73;
GPG_ERR_ENETUNREACH : constant := GPG_ERR_SYSTEM_ERROR + 74;
GPG_ERR_ENFILE : constant := GPG_ERR_SYSTEM_ERROR + 75;
GPG_ERR_ENOANO : constant := GPG_ERR_SYSTEM_ERROR + 76;
GPG_ERR_ENOBUFS : constant := GPG_ERR_SYSTEM_ERROR + 77;
GPG_ERR_ENOCSI : constant := GPG_ERR_SYSTEM_ERROR + 78;
GPG_ERR_ENODATA : constant := GPG_ERR_SYSTEM_ERROR + 79;
GPG_ERR_ENODEV : constant := GPG_ERR_SYSTEM_ERROR + 80;
GPG_ERR_ENOENT : constant := GPG_ERR_SYSTEM_ERROR + 81;
GPG_ERR_ENOEXEC : constant := GPG_ERR_SYSTEM_ERROR + 82;
GPG_ERR_ENOLCK : constant := GPG_ERR_SYSTEM_ERROR + 83;
GPG_ERR_ENOLINK : constant := GPG_ERR_SYSTEM_ERROR + 84;
GPG_ERR_ENOMEDIUM : constant := GPG_ERR_SYSTEM_ERROR + 85;
GPG_ERR_ENOMEM : constant := GPG_ERR_SYSTEM_ERROR + 86;
GPG_ERR_ENOMSG : constant := GPG_ERR_SYSTEM_ERROR + 87;
GPG_ERR_ENONET : constant := GPG_ERR_SYSTEM_ERROR + 88;
GPG_ERR_ENOPKG : constant := GPG_ERR_SYSTEM_ERROR + 89;
GPG_ERR_ENOPROTOOPT : constant := GPG_ERR_SYSTEM_ERROR + 90;
GPG_ERR_ENOSPC : constant := GPG_ERR_SYSTEM_ERROR + 91;
GPG_ERR_ENOSR : constant := GPG_ERR_SYSTEM_ERROR + 92;
GPG_ERR_ENOSTR : constant := GPG_ERR_SYSTEM_ERROR + 93;
GPG_ERR_ENOSYS : constant := GPG_ERR_SYSTEM_ERROR + 94;
GPG_ERR_ENOTBLK : constant := GPG_ERR_SYSTEM_ERROR + 95;
GPG_ERR_ENOTCONN : constant := GPG_ERR_SYSTEM_ERROR + 96;
GPG_ERR_ENOTDIR : constant := GPG_ERR_SYSTEM_ERROR + 97;
GPG_ERR_ENOTEMPTY : constant := GPG_ERR_SYSTEM_ERROR + 98;
GPG_ERR_ENOTNAM : constant := GPG_ERR_SYSTEM_ERROR + 99;
GPG_ERR_ENOTSOCK : constant := GPG_ERR_SYSTEM_ERROR + 100;
GPG_ERR_ENOTSUP : constant := GPG_ERR_SYSTEM_ERROR + 101;
GPG_ERR_ENOTTY : constant := GPG_ERR_SYSTEM_ERROR + 102;
GPG_ERR_ENOTUNIQ : constant := GPG_ERR_SYSTEM_ERROR + 103;
GPG_ERR_ENXIO : constant := GPG_ERR_SYSTEM_ERROR + 104;
GPG_ERR_EOPNOTSUPP : constant := GPG_ERR_SYSTEM_ERROR + 105;
GPG_ERR_EOVERFLOW : constant := GPG_ERR_SYSTEM_ERROR + 106;
GPG_ERR_EPERM : constant := GPG_ERR_SYSTEM_ERROR + 107;
GPG_ERR_EPFNOSUPPORT : constant := GPG_ERR_SYSTEM_ERROR + 108;
GPG_ERR_EPIPE : constant := GPG_ERR_SYSTEM_ERROR + 109;
GPG_ERR_EPROCLIM : constant := GPG_ERR_SYSTEM_ERROR + 110;
GPG_ERR_EPROCUNAVAIL : constant := GPG_ERR_SYSTEM_ERROR + 111;
GPG_ERR_EPROGMISMATCH : constant := GPG_ERR_SYSTEM_ERROR + 112;
GPG_ERR_EPROGUNAVAIL : constant := GPG_ERR_SYSTEM_ERROR + 113;
GPG_ERR_EPROTO : constant := GPG_ERR_SYSTEM_ERROR + 114;
GPG_ERR_EPROTONOSUPPORT : constant := GPG_ERR_SYSTEM_ERROR + 115;
GPG_ERR_EPROTOTYPE : constant := GPG_ERR_SYSTEM_ERROR + 116;
GPG_ERR_ERANGE : constant := GPG_ERR_SYSTEM_ERROR + 117;
GPG_ERR_EREMCHG : constant := GPG_ERR_SYSTEM_ERROR + 118;
GPG_ERR_EREMOTE : constant := GPG_ERR_SYSTEM_ERROR + 119;
GPG_ERR_EREMOTEIO : constant := GPG_ERR_SYSTEM_ERROR + 120;
GPG_ERR_ERESTART : constant := GPG_ERR_SYSTEM_ERROR + 121;
GPG_ERR_EROFS : constant := GPG_ERR_SYSTEM_ERROR + 122;
GPG_ERR_ERPCMISMATCH : constant := GPG_ERR_SYSTEM_ERROR + 123;
GPG_ERR_ESHUTDOWN : constant := GPG_ERR_SYSTEM_ERROR + 124;
GPG_ERR_ESOCKTNOSUPPORT : constant := GPG_ERR_SYSTEM_ERROR + 125;
GPG_ERR_ESPIPE : constant := GPG_ERR_SYSTEM_ERROR + 126;
GPG_ERR_ESRCH : constant := GPG_ERR_SYSTEM_ERROR + 127;
GPG_ERR_ESRMNT : constant := GPG_ERR_SYSTEM_ERROR + 128;
GPG_ERR_ESTALE : constant := GPG_ERR_SYSTEM_ERROR + 129;
GPG_ERR_ESTRPIPE : constant := GPG_ERR_SYSTEM_ERROR + 130;
GPG_ERR_ETIME : constant := GPG_ERR_SYSTEM_ERROR + 131;
GPG_ERR_ETIMEDOUT : constant := GPG_ERR_SYSTEM_ERROR + 132;
GPG_ERR_ETOOMANYREFS : constant := GPG_ERR_SYSTEM_ERROR + 133;
GPG_ERR_ETXTBSY : constant := GPG_ERR_SYSTEM_ERROR + 134;
GPG_ERR_EUCLEAN : constant := GPG_ERR_SYSTEM_ERROR + 135;
GPG_ERR_EUNATCH : constant := GPG_ERR_SYSTEM_ERROR + 136;
GPG_ERR_EUSERS : constant := GPG_ERR_SYSTEM_ERROR + 137;
GPG_ERR_EWOULDBLOCK : constant := GPG_ERR_SYSTEM_ERROR + 138;
GPG_ERR_EXDEV : constant := GPG_ERR_SYSTEM_ERROR + 139;
GPG_ERR_EXFULL : constant := GPG_ERR_SYSTEM_ERROR + 140;
GPG_ERR_CODE_DIM : constant := 65536;

-- The error value type gpg_error_t;

-- We would really like to use bit-fields in a struct, but using
-- structs as return values can cause binary compatibility issues, is
-- particular if you want to do it effeciently (also see
-- -freg-struct-return option to GCC)

-- Line: 462
subtype Gpg_Error_T is Unsigned_32;

-- We use the lowest 16 bits of gpg_error_t for error codes. The 17t;
-- bit indicates system errors;
GPG_ERR_CODE_MASK : constant Unsigned_32 := GPG_ERR_CODE_DIM - 1;

-- Line: 490
GPG_ERR_SOURCE_DEFAULT : constant := GPG_ERR_SOURCE_UNKNOWN;

-- Bits 17 to 24 are reserved.

-- We use the upper 8 bits of gpg_error_t for error sources.
GPG_ERR_SOURCE_MASK : constant Unsigned_32:=GPG_ERR_SOURCE_DIM-1;

GPG_ERR_SOURCE_SHIFT : constant Unsigned_32 := 24;

-- Constructor and accessor functions.

--------------------------------------------------------------------------
-- Construct an error value from an error code and source. Within a
-- subsystem, use gpg_error.
--------------------------------------------------------------------------
function Gpg_Err_Make(Source : Gpg_Err_Source_T;
Code : Gpg_Err_Code_T)
return Gpg_Error_T;
pragma Inline(Gpg_Err_Make);

--------------------------------------------------------------------------
--
--------------------------------------------------------------------------
function Gpg_Error (Code : Gpg_Err_Code_T) return Gpg_Error_T;
pragma Inline(Gpg_Error);

--------------------------------------------------------------------------
-- Retrieve the error code from an error value.
--------------------------------------------------------------------------
function Gpg_Err_Code(Err : Gpg_Error_T) return Gpg_Error_T;
pragma Inline(Gpg_Err_Code);

--------------------------------------------------------------------------
-- Retrieve the error source from an error value.
--------------------------------------------------------------------------
function Gpg_Err_Source(Err : Gpg_Error_T) return Gpg_Err_Source_T;
pragma Inline(Gpg_Err_Source);

--------------------------------------------------------------------------
-- String functions.
--------------------------------------------------------------------------

--------------------------------------------------------------------------
-- Return a pointer to a string containing a description of the error
-- code in the error value ERR.
--------------------------------------------------------------------------
function Gpg_Strerror(Err : gpg_error_t)
return C.Strings.Chars_Ptr;
--------------------------------------------------------------------------
-- Return the error string for ERR in the user-supplied buffer BUF of
-- size BUFLEN. This function is, in contrast to gpg_strerror,
-- thread-safe if a thread-safe strerror_r() function is provided by
-- the system. If the function succeeds, 0 is returned and BUF
-- contains the string describing the error. If the buffer was not
-- large enough, ERANGE is returned and BUF contains as much of the
-- beginning of the error string as fits into the buffer.
--------------------------------------------------------------------------
function Gpg_Strerror_R(Err : Gpg_Error_T;
Buf : C.Strings.Chars_Ptr;
Buflen : C.Size_T) return Gpg_Error_T;

--------------------------------------------------------------------------
-- Return a pointer to a string containing a description of the error
-- source in the error value ERR.
--------------------------------------------------------------------------
function Gpg_Strsource(Err : Gpg_Error_T)
return C.Strings.Chars_Ptr;

--------------------------------------------------------------------------
-- Mapping of system errors (errno).
--------------------------------------------------------------------------

--------------------------------------------------------------------------
-- Retrieve the error code for the system error ERR. This returns
-- GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped (report
-- this).
--------------------------------------------------------------------------
function Gpg_Err_Code_From_Errno(Err : C.Int)
return Gpg_Err_Code_T;

--------------------------------------------------------------------------
-- Retrieve the system error for the error code CODE. This returns 0
-- if CODE is not a system error code.
--------------------------------------------------------------------------
function Gpg_Err_Code_To_Errno(Code : Gpg_Err_Code_T)
return C.Int;

--------------------------------------------------------------------------
-- Self-documenting convenience functions.
--------------------------------------------------------------------------

--------------------------------------------------------------------------
--
--------------------------------------------------------------------------
function Gpg_Err_Make_From_Errno (Source : Gpg_Err_Source_T;
Err : C.int)
return Gpg_Error_T;
pragma Inline(Gpg_Err_Make_From_Errno);

--------------------------------------------------------------------------
--
--------------------------------------------------------------------------
function Gpg_Error_From_Errno(Err : C.Int)
return Gpg_Error_T;
pragma Inline(Gpg_Error_From_Errno);
private
pragma Import(C,Gpg_Strsource,"gpg_strsource");
pragma Import(C,Gpg_Err_Code_From_Errno,"gpg_err_code_from_errno");
pragma Import(C,Gpg_Err_Code_To_Errno,"gpg_err_code_to_errno");
pragma Import(C,Gpg_Strerror,"gpg_strerror");
pragma Import(C,Gpg_Strerror_R,"gpg_strerror_r");

end Gpgerror;




© 2005 Andreas Almroth