xref: /illumos-gate/usr/src/head/pfmt.h (revision b4203d757c7c247e39c94c09a94021a3a8121062)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24  */
25 /*	Copyright (c) 1988 AT&T	*/
26 /*	  All Rights Reserved	*/
27 
28 #ifndef	_PFMT_H
29 #define	_PFMT_H
30 
31 #include <stdio.h>
32 #ifndef va_args
33 #include <stdarg.h>
34 #endif
35 
36 #ifdef	__cplusplus
37 extern "C" {
38 #endif
39 
40 #define	MM_STD		0
41 #define	MM_NOSTD	0x100
42 #define	MM_GET		0
43 #define	MM_NOGET	0x200
44 
45 #define	MM_ACTION	0x400
46 
47 #define	MM_NOCONSOLE	0
48 #define	MM_CONSOLE	0x800
49 
50 /* Classification */
51 #define	MM_NULLMC	0
52 #define	MM_HARD		0x1000
53 #define	MM_SOFT		0x2000
54 #define	MM_FIRM		0x4000
55 #define	MM_APPL		0x8000
56 #define	MM_UTIL		0x10000
57 #define	MM_OPSYS	0x20000
58 
59 /* Most commonly used combinations */
60 #define	MM_SVCMD	MM_UTIL|MM_SOFT
61 
62 #define	MM_ERROR	0
63 #define	MM_HALT		1
64 #define	MM_WARNING	2
65 #define	MM_INFO		3
66 
67 int pfmt(FILE *, long, const char *, ...);
68 int lfmt(FILE *, long, const char *, ...);
69 int vpfmt(FILE *, long, const char *, va_list);
70 int vlfmt(FILE *, long, const char *, va_list);
71 const char *setcat(const char *);
72 int setlabel(const char *);
73 int addsev(int, const char *);
74 
75 #define	DB_NAME_LEN		15
76 #define	MAXLABEL		25
77 
78 #ifdef	__cplusplus
79 }
80 #endif
81 
82 #endif	/* _PFMT_H */
83