/*-1* SPDX-License-Identifier: BSD-2-Clause2*3* Copyright (c) 2002 Mike Barcroft <[email protected]>4* All rights reserved.5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions8* are met:9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11* 2. Redistributions in binary form must reproduce the above copyright12* notice, this list of conditions and the following disclaimer in the13* documentation and/or other materials provided with the distribution.14*15* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND16* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE17* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE18* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE19* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL20* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS21* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)22* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT23* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY24* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF25* SUCH DAMAGE.26*/2728#ifndef _FMTMSG_H_29#define _FMTMSG_H_3031/* Source of condition is... */32#define MM_HARD 0x0001 /* ...hardware. */33#define MM_SOFT 0x0002 /* ...software. */34#define MM_FIRM 0x0004 /* ...firmware. */3536/* Condition detected by... */37#define MM_APPL 0x0010 /* ...application. */38#define MM_UTIL 0x0020 /* ...utility. */39#define MM_OPSYS 0x0040 /* ...operating system. */4041/* Display on... */42#define MM_PRINT 0x0100 /* ...standard error. */43#define MM_CONSOLE 0x0200 /* ...system console. */4445#define MM_RECOVER 0x1000 /* Recoverable error. */46#define MM_NRECOV 0x2000 /* Non-recoverable error. */4748/* Severity levels. */49#define MM_NOSEV 0 /* No severity level provided. */50#define MM_HALT 1 /* Error causing application to halt. */51#define MM_ERROR 2 /* Non-fault fault. */52#define MM_WARNING 3 /* Unusual non-error condition. */53#define MM_INFO 4 /* Informative message. */5455/* Null options. */56#define MM_NULLLBL (char *)057#define MM_NULLSEV 058#define MM_NULLMC 0L59#define MM_NULLTXT (char *)060#define MM_NULLACT (char *)061#define MM_NULLTAG (char *)06263/* Return values. */64#define MM_OK 0 /* Success. */65#define MM_NOMSG 1 /* Failed to output to stderr. */66#define MM_NOCON 2 /* Failed to output to console. */67#define MM_NOTOK 3 /* Failed to output anything. */6869int fmtmsg(long, const char *, int, const char *, const char *,70const char *);7172#endif /* !_FMTMSG_H_ */737475