err.h revision 93032
121173Sjkh/*-
250479Speter * Copyright (c) 1993
350479Speter *	The Regents of the University of California.  All rights reserved.
421173Sjkh *
521173Sjkh * Redistribution and use in source and binary forms, with or without
621173Sjkh * modification, are permitted provided that the following conditions
721173Sjkh * are met:
821173Sjkh * 1. Redistributions of source code must retain the above copyright
921173Sjkh *    notice, this list of conditions and the following disclaimer.
1021173Sjkh * 2. Redistributions in binary form must reproduce the above copyright
1121173Sjkh *    notice, this list of conditions and the following disclaimer in the
1221173Sjkh *    documentation and/or other materials provided with the distribution.
1321173Sjkh * 3. All advertising materials mentioning features or use of this software
14159363Strhodes *    must display the following acknowledgement:
15159363Strhodes *	This product includes software developed by the University of
16159363Strhodes *	California, Berkeley and its contributors.
17159363Strhodes * 4. Neither the name of the University nor the names of its contributors
18159363Strhodes *    may be used to endorse or promote products derived from this software
19159363Strhodes *    without specific prior written permission.
20159363Strhodes *
2164057Salex * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2264057Salex * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2364057Salex * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2421173Sjkh * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2564057Salex * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2664057Salex * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27100446Swosch * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2821369Smax * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2964057Salex * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3093217Sru * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3164057Salex * SUCH DAMAGE.
3221173Sjkh *
3393217Sru *	@(#)err.h	8.1 (Berkeley) 6/2/93
3421173Sjkh * $FreeBSD: head/include/err.h 93032 2002-03-23 17:24:55Z imp $
3521173Sjkh */
3664047Salex
3764047Salex#ifndef _ERR_H_
3864047Salex#define	_ERR_H_
3964047Salex
4021173Sjkh/*
4121173Sjkh * Don't use va_list in the err/warn prototypes.   Va_list is typedef'd in two
4221173Sjkh * places (<machine/varargs.h> and <machine/stdarg.h>), so if we include one
4321173Sjkh * of them here we may collide with the utility's includes.  It's unreasonable
4493217Sru * for utilities to have to include one of them to include err.h, so we get
4521173Sjkh * _BSD_VA_LIST_ from <machine/ansi.h> and use it.
46215293Sjoel */
47215293Sjoel#include <machine/ansi.h>
48215293Sjoel#include <sys/cdefs.h>
4921173Sjkh
5021173Sjkh__BEGIN_DECLS
5164047Salexvoid	err(int, const char *, ...) __dead2 __printf0like(2, 3);
5221173Sjkhvoid	verr(int, const char *, _BSD_VA_LIST_) __dead2
5393217Sru	    __printf0like(2, 0);
5421173Sjkhvoid	errc(int, int, const char *, ...) __dead2 __printf0like(3, 4);
5521173Sjkhvoid	verrc(int, int, const char *, _BSD_VA_LIST_) __dead2
5621173Sjkh	    __printf0like(3, 0);
5721173Sjkhvoid	errx(int, const char *, ...) __dead2 __printf0like(2, 3);
5821173Sjkhvoid	verrx(int, const char *, _BSD_VA_LIST_) __dead2
5921173Sjkh	    __printf0like(2, 0);
6021173Sjkhvoid	warn(const char *, ...) __printf0like(1, 2);
6121173Sjkhvoid	vwarn(const char *, _BSD_VA_LIST_) __printf0like(1, 0);
6293217Sruvoid	warnc(int, const char *, ...) __printf0like(2, 3);
6337283Sjkhvoid	vwarnc(int, const char *, _BSD_VA_LIST_) __printf0like(2, 0);
6421173Sjkhvoid	warnx(const char *, ...) __printflike(1, 2);
6521173Sjkhvoid	vwarnx(const char *, _BSD_VA_LIST_) __printflike(1, 0);
6621173Sjkhvoid	err_set_file(void *);
6721173Sjkhvoid	err_set_exit(void (*)(int));
6821173Sjkh__END_DECLS
6921173Sjkh
70156171Sceri#endif /* !_ERR_H_ */
71156171Sceri