1101353Smike/*- 2101353Smike * Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> 3101353Smike * All rights reserved. 4101353Smike * 5101353Smike * Redistribution and use in source and binary forms, with or without 6101353Smike * modification, are permitted provided that the following conditions 7101353Smike * are met: 8101353Smike * 1. Redistributions of source code must retain the above copyright 9101353Smike * notice, this list of conditions and the following disclaimer. 10101353Smike * 2. Redistributions in binary form must reproduce the above copyright 11101353Smike * notice, this list of conditions and the following disclaimer in the 12101353Smike * documentation and/or other materials provided with the distribution. 13101353Smike * 14101353Smike * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15101353Smike * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16101353Smike * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17101353Smike * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18101353Smike * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19101353Smike * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20101353Smike * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21101353Smike * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22101353Smike * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23101353Smike * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24101353Smike * SUCH DAMAGE. 25101353Smike * 26101353Smike * $FreeBSD: releng/10.2/include/fmtmsg.h 236629 2012-06-05 19:42:57Z ed $ 27101353Smike */ 28101353Smike 29101353Smike#ifndef _FMTMSG_H_ 30101353Smike#define _FMTMSG_H_ 31101353Smike 32101353Smike/* Source of condition is... */ 33101390Smike#define MM_HARD 0x0001 /* ...hardware. */ 34101390Smike#define MM_SOFT 0x0002 /* ...software. */ 35236629Sed#define MM_FIRM 0x0004 /* ...firmware. */ 36101353Smike 37101353Smike/* Condition detected by... */ 38101390Smike#define MM_APPL 0x0010 /* ...application. */ 39101390Smike#define MM_UTIL 0x0020 /* ...utility. */ 40101390Smike#define MM_OPSYS 0x0040 /* ...operating system. */ 41101353Smike 42101353Smike/* Display on... */ 43101390Smike#define MM_PRINT 0x0100 /* ...standard error. */ 44101390Smike#define MM_CONSOLE 0x0200 /* ...system console. */ 45101353Smike 46101353Smike#define MM_RECOVER 0x1000 /* Recoverable error. */ 47101353Smike#define MM_NRECOV 0x2000 /* Non-recoverable error. */ 48101353Smike 49101353Smike/* Severity levels. */ 50101353Smike#define MM_NOSEV 0 /* No severity level provided. */ 51101353Smike#define MM_HALT 1 /* Error causing application to halt. */ 52101353Smike#define MM_ERROR 2 /* Non-fault fault. */ 53101353Smike#define MM_WARNING 3 /* Unusual non-error condition. */ 54101353Smike#define MM_INFO 4 /* Informative message. */ 55101353Smike 56101353Smike/* Null options. */ 57101353Smike#define MM_NULLLBL (char *)0 58101353Smike#define MM_NULLSEV 0 59101353Smike#define MM_NULLMC 0L 60101353Smike#define MM_NULLTXT (char *)0 61101353Smike#define MM_NULLACT (char *)0 62101353Smike#define MM_NULLTAG (char *)0 63101353Smike 64101353Smike/* Return values. */ 65101353Smike#define MM_OK 0 /* Success. */ 66101353Smike#define MM_NOMSG 1 /* Failed to output to stderr. */ 67101353Smike#define MM_NOCON 2 /* Failed to output to console. */ 68101353Smike#define MM_NOTOK 3 /* Failed to output anything. */ 69101353Smike 70101390Smikeint fmtmsg(long, const char *, int, const char *, const char *, 71101390Smike const char *); 72101353Smike 73101390Smike#endif /* !_FMTMSG_H_ */ 74