Remove building with NOCRYPTO option
[minix.git] / external / bsd / bind / dist / unit / atf-src / atf-c / error.h
blobf4ad9f3e331e211cf59e42143f89836a6efdcc49
1 /* $NetBSD: error.h,v 1.3 2014/12/10 04:38:03 christos Exp $ */
3 /*
4 * Automated Testing Framework (atf)
6 * Copyright (c) 2008 The NetBSD Foundation, Inc.
7 * All rights reserved.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
18 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
19 * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
20 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
23 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
25 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
27 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
28 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
29 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 #if !defined(ATF_C_ERROR_H)
33 #define ATF_C_ERROR_H
35 #include <stdbool.h>
36 #include <stddef.h>
38 #include <atf-c/error_fwd.h>
40 /* ---------------------------------------------------------------------
41 * The "atf_error" type.
42 * --------------------------------------------------------------------- */
44 struct atf_error {
45 bool m_free;
46 const char *m_type;
47 void *m_data;
49 void (*m_format)(struct atf_error *, char *, size_t);
52 atf_error_t atf_error_new(const char *, void *, size_t,
53 void (*)(const atf_error_t, char *, size_t));
54 void atf_error_free(atf_error_t);
56 atf_error_t atf_no_error(void);
57 bool atf_is_error(const atf_error_t);
59 bool atf_error_is(const atf_error_t, const char *);
60 const void *atf_error_data(const atf_error_t);
61 void atf_error_format(const atf_error_t, char *, size_t);
63 /* ---------------------------------------------------------------------
64 * Common error types.
65 * --------------------------------------------------------------------- */
67 atf_error_t atf_libc_error(int, const char *, ...);
68 int atf_libc_error_code(const atf_error_t);
69 const char *atf_libc_error_msg(const atf_error_t);
71 atf_error_t atf_no_memory_error(void);
73 #endif /* ATF_C_ERROR_H */