1 | /* err.h,v 1.2 2004/09/14 22:27:32 bird Exp */
|
---|
2 | /** @file
|
---|
3 | * FreeBSD 5.1
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*-
|
---|
7 | * Copyright (c) 1993
|
---|
8 | * The Regents of the University of California. All rights reserved.
|
---|
9 | *
|
---|
10 | * Redistribution and use in source and binary forms, with or without
|
---|
11 | * modification, are permitted provided that the following conditions
|
---|
12 | * are met:
|
---|
13 | * 1. Redistributions of source code must retain the above copyright
|
---|
14 | * notice, this list of conditions and the following disclaimer.
|
---|
15 | * 2. Redistributions in binary form must reproduce the above copyright
|
---|
16 | * notice, this list of conditions and the following disclaimer in the
|
---|
17 | * documentation and/or other materials provided with the distribution.
|
---|
18 | * 3. All advertising materials mentioning features or use of this software
|
---|
19 | * must display the following acknowledgement:
|
---|
20 | * This product includes software developed by the University of
|
---|
21 | * California, Berkeley and its contributors.
|
---|
22 | * 4. Neither the name of the University nor the names of its contributors
|
---|
23 | * may be used to endorse or promote products derived from this software
|
---|
24 | * without specific prior written permission.
|
---|
25 | *
|
---|
26 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
---|
27 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
---|
28 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
---|
29 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
---|
30 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
---|
31 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
---|
32 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
---|
33 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
---|
34 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
---|
35 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
---|
36 | * SUCH DAMAGE.
|
---|
37 | *
|
---|
38 | * @(#)err.h 8.1 (Berkeley) 6/2/93
|
---|
39 | * $FreeBSD: src/include/err.h,v 1.11 2002/08/21 16:19:55 mike Exp $
|
---|
40 | */
|
---|
41 |
|
---|
42 | #ifndef _ERR_H_
|
---|
43 | #define _ERR_H_
|
---|
44 |
|
---|
45 | /*
|
---|
46 | * Don't use va_list in the err/warn prototypes. Va_list is typedef'd in two
|
---|
47 | * places (<machine/varargs.h> and <machine/stdarg.h>), so if we include one
|
---|
48 | * of them here we may collide with the utility's includes. It's unreasonable
|
---|
49 | * for utilities to have to include one of them to include err.h, so we get
|
---|
50 | * __va_list from <sys/_types.h> and use it.
|
---|
51 | */
|
---|
52 | #include <sys/cdefs.h>
|
---|
53 | #include <sys/_types.h>
|
---|
54 |
|
---|
55 | __BEGIN_DECLS
|
---|
56 | void err(int, const char *, ...) __dead2 __printf0like(2, 3);
|
---|
57 | void verr(int, const char *, __va_list) __dead2 __printf0like(2, 0);
|
---|
58 | void errc(int, int, const char *, ...) __dead2 __printf0like(3, 4);
|
---|
59 | void verrc(int, int, const char *, __va_list) __dead2
|
---|
60 | __printf0like(3, 0);
|
---|
61 | void errx(int, const char *, ...) __dead2 __printf0like(2, 3);
|
---|
62 | void verrx(int, const char *, __va_list) __dead2 __printf0like(2, 0);
|
---|
63 | void warn(const char *, ...) __printf0like(1, 2);
|
---|
64 | void vwarn(const char *, __va_list) __printf0like(1, 0);
|
---|
65 | void warnc(int, const char *, ...) __printf0like(2, 3);
|
---|
66 | void vwarnc(int, const char *, __va_list) __printf0like(2, 0);
|
---|
67 | void warnx(const char *, ...) __printflike(1, 2);
|
---|
68 | void vwarnx(const char *, __va_list) __printflike(1, 0);
|
---|
69 | void err_set_file(void *);
|
---|
70 | void err_set_exit(void (*)(int));
|
---|
71 | __END_DECLS
|
---|
72 |
|
---|
73 | #endif /* !_ERR_H_ */
|
---|