Remove building with NOCRYPTO option
[minix.git] / external / bsd / bind / dist / lib / isccc / result.c
blobb974066934dc9b546583e5409558a55c00ae97b0
1 /* $NetBSD: result.c,v 1.4 2014/12/10 04:38:01 christos Exp $ */
3 /*
4 * Portions Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
5 * Portions Copyright (C) 2001, 2003 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 AND NOMINUM DISCLAIMS ALL
12 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
13 * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY
14 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 * Portions Copyright (C) 2001 Nominum, Inc.
21 * Permission to use, copy, modify, and/or distribute this software for any
22 * purpose with or without fee is hereby granted, provided that the above
23 * copyright notice and this permission notice appear in all copies.
25 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC AND NOMINUM DISCLAIMS ALL
26 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
27 * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY
28 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
29 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
30 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
31 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
34 /* Id: result.c,v 1.10 2007/08/28 07:20:43 tbox Exp */
36 /*! \file */
38 #include <config.h>
40 #include <isc/once.h>
41 #include <isc/util.h>
43 #include <isccc/result.h>
44 #include <isccc/lib.h>
46 static const char *text[ISCCC_R_NRESULTS] = {
47 "unknown version", /* 1 */
48 "syntax error", /* 2 */
49 "bad auth", /* 3 */
50 "expired", /* 4 */
51 "clock skew", /* 5 */
52 "duplicate" /* 6 */
55 #define ISCCC_RESULT_RESULTSET 2
57 static isc_once_t once = ISC_ONCE_INIT;
59 static void
60 initialize_action(void) {
61 isc_result_t result;
63 result = isc_result_register(ISC_RESULTCLASS_ISCCC, ISCCC_R_NRESULTS,
64 text, isccc_msgcat,
65 ISCCC_RESULT_RESULTSET);
66 if (result != ISC_R_SUCCESS)
67 UNEXPECTED_ERROR(__FILE__, __LINE__,
68 "isc_result_register() failed: %u", result);
71 static void
72 initialize(void) {
73 isccc_lib_initmsgcat();
74 RUNTIME_CHECK(isc_once_do(&once, initialize_action) == ISC_R_SUCCESS);
77 const char *
78 isccc_result_totext(isc_result_t result) {
79 initialize();
81 return (isc_result_totext(result));
84 void
85 isccc_result_register(void) {
86 initialize();