]>
Commit | Line | Data |
---|---|---|
ad412770 CW |
1 | /*- |
2 | * Copyright (c) 1993 | |
3 | * The Regents of the University of California. All rights reserved. | |
4 | * | |
5 | * Redistribution and use in source and binary forms, with or without | |
6 | * modification, are permitted provided that the following conditions | |
7 | * are met: | |
8 | * 1. Redistributions of source code must retain the above copyright | |
9 | * notice, this list of conditions and the following disclaimer. | |
10 | * 2. Redistributions in binary form must reproduce the above copyright | |
11 | * notice, this list of conditions and the following disclaimer in the | |
12 | * documentation and/or other materials provided with the distribution. | |
13 | * 4. Neither the name of the University nor the names of its contributors | |
14 | * may be used to endorse or promote products derived from this software | |
15 | * without specific prior written permission. | |
16 | * | |
17 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
27 | * SUCH DAMAGE. | |
28 | * | |
29 | * @(#)err.h 8.1 (Berkeley) 6/2/93 | |
30 | */ | |
31 | ||
32 | /* 2002-05-22 David A. Willis: modified license to the 'BSD no advert' | |
33 | * license, as required by the Director of the Office of | |
34 | * Technology Licensing of the University of California on | |
35 | * July 22, 1999. | |
36 | * See http://www.opensource.org/licenses/bsd-license.html | |
37 | */ | |
38 | ||
39 | #ifndef _ERR_H_ | |
40 | #define _ERR_H_ | |
41 | ||
42 | #ifdef HAVE_STDARG_H | |
43 | #include <stdarg.h> | |
44 | #define _BSD_VA_LIST_ va_list | |
45 | #define __dead | |
46 | #else /* not HAVE_STDARG_H */ | |
47 | /* | |
48 | * Don't use va_list in the err/warn prototypes. Va_list is typedef'd in two | |
49 | * places (<machine/varargs.h> and <machine/stdarg.h>), so if we include one | |
50 | * of them here we may collide with the utility's includes. It's unreasonable | |
51 | * for utilities to have to include one of them to include err.h, so we get | |
52 | * _BSD_VA_LIST_ from <machine/ansi.h> and use it. | |
53 | */ | |
54 | #include <machine/ansi.h> | |
55 | #endif /* not HAVE_STDARG_H */ | |
56 | ||
57 | #include <sys/cdefs.h> | |
58 | ||
59 | __BEGIN_DECLS | |
60 | #ifdef HAVE_STDARG_H | |
61 | void err_setprogname __P((const char *)); | |
62 | #endif /* HAVE_STDARG_H */ | |
63 | __dead void err __P((int, const char *, ...)); | |
64 | __dead void verr __P((int, const char *, _BSD_VA_LIST_)); | |
65 | __dead void errx __P((int, const char *, ...)); | |
66 | __dead void verrx __P((int, const char *, _BSD_VA_LIST_)); | |
67 | void warn __P((const char *, ...)); | |
68 | void vwarn __P((const char *, _BSD_VA_LIST_)); | |
69 | void warnx __P((const char *, ...)); | |
70 | void vwarnx __P((const char *, _BSD_VA_LIST_)); | |
71 | __END_DECLS | |
72 | ||
73 | #ifdef HAVE_STDARG_H | |
74 | #undef _BSD_VA_LIST | |
75 | #endif /* HAVE_STDARG_H */ | |
76 | ||
77 | #endif /* !_ERR_H_ */ |