hjl / source-git / glibc

Forked from source-git/glibc 3 years ago
Clone

Blame stdlib/fmtmsg.h

Packit 6c4009
/* Message display handling.
Packit 6c4009
   Copyright (C) 1997-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#ifndef __FMTMSG_H
Packit 6c4009
#define __FMTMSG_H	1
Packit 6c4009
Packit 6c4009
#include <features.h>
Packit 6c4009
Packit 6c4009
Packit 6c4009
__BEGIN_DECLS
Packit 6c4009
Packit 6c4009
/* Values to control `fmtmsg' function.  */
Packit 6c4009
enum
Packit 6c4009
{
Packit 6c4009
  MM_HARD = 0x001,	/* Source of the condition is hardware.  */
Packit 6c4009
#define MM_HARD MM_HARD
Packit 6c4009
  MM_SOFT = 0x002,	/* Source of the condition is software.  */
Packit 6c4009
#define MM_SOFT MM_SOFT
Packit 6c4009
  MM_FIRM = 0x004,	/* Source of the condition is firmware.  */
Packit 6c4009
#define MM_FIRM MM_FIRM
Packit 6c4009
  MM_APPL = 0x008,	/* Condition detected by application.  */
Packit 6c4009
#define MM_APPL MM_APPL
Packit 6c4009
  MM_UTIL = 0x010,	/* Condition detected by utility.  */
Packit 6c4009
#define MM_UTIL MM_UTIL
Packit 6c4009
  MM_OPSYS = 0x020,	/* Condition detected by operating system.  */
Packit 6c4009
#define MM_OPSYS MM_OPSYS
Packit 6c4009
  MM_RECOVER = 0x040,	/* Recoverable error.  */
Packit 6c4009
#define MM_RECOVER MM_RECOVER
Packit 6c4009
  MM_NRECOV = 0x080,	/* Non-recoverable error.  */
Packit 6c4009
#define MM_NRECOV MM_NRECOV
Packit 6c4009
  MM_PRINT = 0x100,	/* Display message in standard error.  */
Packit 6c4009
#define MM_PRINT MM_PRINT
Packit 6c4009
  MM_CONSOLE = 0x200	/* Display message on system console.  */
Packit 6c4009
#define MM_CONSOLE MM_CONSOLE
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
/* Values to be for SEVERITY parameter of `fmtmsg'.  */
Packit 6c4009
enum
Packit 6c4009
{
Packit 6c4009
  MM_NOSEV = 0,		/* No severity level provided for the message.  */
Packit 6c4009
#define MM_NOSEV MM_NOSEV
Packit 6c4009
  MM_HALT,		/* Error causing application to halt.  */
Packit 6c4009
#define MM_HALT MM_HALT
Packit 6c4009
  MM_ERROR,		/* Application has encountered a non-fatal fault.  */
Packit 6c4009
#define MM_ERROR MM_ERROR
Packit 6c4009
  MM_WARNING,		/* Application has detected unusual non-error
Packit 6c4009
			   condition.  */
Packit 6c4009
#define MM_WARNING MM_WARNING
Packit 6c4009
  MM_INFO		/* Informative message.  */
Packit 6c4009
#define MM_INFO MM_INFO
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Macros which can be used as null values for the arguments of `fmtmsg'.  */
Packit 6c4009
#define MM_NULLLBL	((char *) 0)
Packit 6c4009
#define MM_NULLSEV	0
Packit 6c4009
#define MM_NULLMC	((long int) 0)
Packit 6c4009
#define MM_NULLTXT	((char *) 0)
Packit 6c4009
#define MM_NULLACT	((char *) 0)
Packit 6c4009
#define MM_NULLTAG	((char *) 0)
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Possible return values of `fmtmsg'.  */
Packit 6c4009
enum
Packit 6c4009
{
Packit 6c4009
  MM_NOTOK = -1,
Packit 6c4009
#define MM_NOTOK MM_NOTOK
Packit 6c4009
  MM_OK = 0,
Packit 6c4009
#define MM_OK MM_OK
Packit 6c4009
  MM_NOMSG = 1,
Packit 6c4009
#define MM_NOMSG MM_NOMSG
Packit 6c4009
  MM_NOCON = 4
Packit 6c4009
#define MM_NOCON MM_NOCON
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Print message with given CLASSIFICATION, LABEL, SEVERITY, TEXT, ACTION
Packit 6c4009
   and TAG to console or standard error.  */
Packit 6c4009
extern int fmtmsg (long int __classification, const char *__label,
Packit 6c4009
		   int __severity, const char *__text,
Packit 6c4009
		   const char *__action, const char *__tag);
Packit 6c4009
Packit 6c4009
#ifdef __USE_MISC
Packit 6c4009
/* Add or remove severity level.  */
Packit 6c4009
extern int addseverity (int __severity, const char *__string) __THROW;
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
__END_DECLS
Packit 6c4009
Packit 6c4009
#endif /* fmtmsg.h */