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
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.
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]
24 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
25 * Use is subject to license terms.
28 /* Copyright (c) 1988 AT&T */
29 /* All Rights Reserved */
35 #pragma ident "%Z%%M% %I% %E% SMI"
39 * Include file for error message interface.
40 * Command and library version.
43 #define errmsg errtag(__FILE__, __LINE__), errtext
45 void erraction(int action
);
46 int errafter(int severity
, char *format
, ...);
47 void errbefore(int severity
, char *format
, ...);
49 void _errmsg(char *tag
, int severity
, char *format
, ...);
50 void errprefix(char *str
);
51 void errsource(char *str
);
52 void errtag(char *str
, int num
);
53 void errtext(int severity
, char *format
, ...);
54 void errtofix(char *str
);
55 void errusage(char *format
, ...);
56 char *errstrtok(char *string
, char *sepset
);
57 void errverb(char *s
);
59 /* severities first argument to errbefore(), errafter(), errtext() */
60 #define EIGNORE -1 /* special severity, no message, no action, returns */
66 /* special errtext() argument that prints a standard message based on errno */
70 * actions : returned by errafter() used as an argument to erraction()
76 /* used to set verbosity */
79 #define EDEF 2 /* default value -- setting ersyserr */
82 /* flags to adjust verbosity */
83 char vbell
; /* ring bell before message */
85 char vsource
; /* source information, including prefix */
86 char vsevmsg
; /* severity message */
87 char vsyserr
; /* system error message, perror() */
88 char vfix
; /* to fix msg */
91 /* message content and context */
92 char *prefix
; /* usually unique per manufacturer */
93 char *envsource
; /* source from ERRSOURCE environment variable */
94 char *source
; /* usually command name */
96 char **sevmsg
; /* error messages that depend on severity */
97 char *tofix
; /* set by errtofix() */
100 int exit
; /* exit(2) code to use if error causes exit */
103 extern struct Err Err
;
106 #include <sys/types.h>
108 extern void *zmalloc(int severity
, size_t n
);
109 FILE *zfopen(int severity
, char *path
, char *type
);
111 #endif /* _ERRMSG_H */