1 /* status.c - status code helper functions
2 * Copyright (C) 2007 Free Software Foundation, Inc.
4 * This file is part of GnuPG.
6 * This file is free software; you can redistribute it and/or modify
7 * it under the terms of either
9 * - the GNU Lesser General Public License as published by the Free
10 * Software Foundation; either version 3 of the License, or (at
11 * your option) any later version.
15 * - the GNU General Public License as published by the Free
16 * Software Foundation; either version 2 of the License, or (at
17 * your option) any later version.
19 * or both in parallel, as here.
21 * This file is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, see <https://www.gnu.org/licenses/>.
35 #include "status-codes.h"
38 /* Return the status string for code NO. */
40 get_status_string ( int no )
42 int idx = statusstr_msgidxof (no);
46 return statusstr_msgstr + statusstr_msgidx[idx];
51 get_inv_recpsgnr_code (gpg_error_t err)
55 switch (gpg_err_code (err))
57 case GPG_ERR_NO_PUBKEY: errstr = "1"; break;
58 case GPG_ERR_AMBIGUOUS_NAME: errstr = "2"; break;
59 case GPG_ERR_WRONG_KEY_USAGE: errstr = "3"; break;
60 case GPG_ERR_CERT_REVOKED: errstr = "4"; break;
61 case GPG_ERR_CERT_EXPIRED: errstr = "5"; break;
62 case GPG_ERR_NO_CRL_KNOWN: errstr = "6"; break;
63 case GPG_ERR_CRL_TOO_OLD: errstr = "7"; break;
64 case GPG_ERR_NO_POLICY_MATCH: errstr = "8"; break;
66 case GPG_ERR_UNUSABLE_SECKEY:
67 case GPG_ERR_NO_SECKEY: errstr = "9"; break;
69 case GPG_ERR_NOT_TRUSTED: errstr = "10"; break;
70 case GPG_ERR_MISSING_CERT: errstr = "11"; break;
71 case GPG_ERR_MISSING_ISSUER_CERT: errstr = "12"; break;
72 default: errstr = "0"; break;