Remove building with NOCRYPTO option
[minix.git] / external / bsd / bind / dist / lib / dns / dst_result.c
blob98c4ab1f9c2967644a7126af2c9bbb6c14c65ade
1 /* $NetBSD: dst_result.c,v 1.8 2014/12/10 04:37:58 christos Exp $ */
3 /*
4 * Copyright (C) 2004, 2005, 2007, 2008, 2012-2014 Internet Systems Consortium, Inc. ("ISC")
5 * Copyright (C) 1999-2001 Internet Software Consortium.
7 * Permission to use, copy, modify, and/or distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
11 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
12 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
14 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
16 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17 * PERFORMANCE OF THIS SOFTWARE.
20 /*%
21 * Principal Author: Brian Wellington
22 * Id: dst_result.c,v 1.7 2008/04/01 23:47:10 tbox Exp
25 #include <config.h>
27 #include <isc/once.h>
28 #include <isc/util.h>
30 #include <dst/result.h>
31 #include <dst/lib.h>
33 static const char *text[DST_R_NRESULTS] = {
34 "algorithm is unsupported", /*%< 0 */
35 "crypto failure", /*%< 1 */
36 "built with no crypto support", /*%< 2 */
37 "illegal operation for a null key", /*%< 3 */
38 "public key is invalid", /*%< 4 */
39 "private key is invalid", /*%< 5 */
40 "external key", /*%< 6 */
41 "error occurred writing key to disk", /*%< 7 */
42 "invalid algorithm specific parameter", /*%< 8 */
43 "UNUSED9", /*%< 9 */
44 "UNUSED10", /*%< 10 */
45 "sign failure", /*%< 11 */
46 "UNUSED12", /*%< 12 */
47 "UNUSED13", /*%< 13 */
48 "verify failure", /*%< 14 */
49 "not a public key", /*%< 15 */
50 "not a private key", /*%< 16 */
51 "not a key that can compute a secret", /*%< 17 */
52 "failure computing a shared secret", /*%< 18 */
53 "no randomness available", /*%< 19 */
54 "bad key type", /*%< 20 */
55 "no engine", /*%< 21 */
56 "illegal operation for an external key",/*%< 22 */
59 #define DST_RESULT_RESULTSET 2
61 static isc_once_t once = ISC_ONCE_INIT;
63 static void
64 initialize_action(void) {
65 isc_result_t result;
67 result = isc_result_register(ISC_RESULTCLASS_DST, DST_R_NRESULTS,
68 text, dst_msgcat, DST_RESULT_RESULTSET);
69 if (result != ISC_R_SUCCESS)
70 UNEXPECTED_ERROR(__FILE__, __LINE__,
71 "isc_result_register() failed: %u", result);
74 static void
75 initialize(void) {
76 dst_lib_initmsgcat();
77 RUNTIME_CHECK(isc_once_do(&once, initialize_action) == ISC_R_SUCCESS);
80 const char *
81 dst_result_totext(isc_result_t result) {
82 initialize();
84 return (isc_result_totext(result));
87 void
88 dst_result_register(void) {
89 initialize();
92 /*! \file */