1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * Copyright (c) 2001 Sendmail, Inc. and its suppliers.
3*7c478bd9Sstevel@tonic-gate  *	All rights reserved.
4*7c478bd9Sstevel@tonic-gate  *
5*7c478bd9Sstevel@tonic-gate  * By using this file, you agree to the terms and conditions set
6*7c478bd9Sstevel@tonic-gate  * forth in the LICENSE file which can be found at the top level of
7*7c478bd9Sstevel@tonic-gate  * the sendmail distribution.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  */
10*7c478bd9Sstevel@tonic-gate 
11*7c478bd9Sstevel@tonic-gate #include <sendmail.h>
12*7c478bd9Sstevel@tonic-gate 
13*7c478bd9Sstevel@tonic-gate SM_RCSID("@(#)$Id: err.c,v 8.3 2001/01/24 01:27:30 gshapiro Exp $")
14*7c478bd9Sstevel@tonic-gate 
15*7c478bd9Sstevel@tonic-gate #include <ctype.h>
16*7c478bd9Sstevel@tonic-gate 
17*7c478bd9Sstevel@tonic-gate /*VARARGS1*/
18*7c478bd9Sstevel@tonic-gate void
19*7c478bd9Sstevel@tonic-gate #ifdef __STDC__
message(const char * msg,...)20*7c478bd9Sstevel@tonic-gate message(const char *msg, ...)
21*7c478bd9Sstevel@tonic-gate #else /* __STDC__ */
22*7c478bd9Sstevel@tonic-gate message(msg, va_alist)
23*7c478bd9Sstevel@tonic-gate 	const char *msg;
24*7c478bd9Sstevel@tonic-gate 	va_dcl
25*7c478bd9Sstevel@tonic-gate #endif /* __STDC__ */
26*7c478bd9Sstevel@tonic-gate {
27*7c478bd9Sstevel@tonic-gate 	const char *m;
28*7c478bd9Sstevel@tonic-gate 	SM_VA_LOCAL_DECL
29*7c478bd9Sstevel@tonic-gate 
30*7c478bd9Sstevel@tonic-gate 	m = msg;
31*7c478bd9Sstevel@tonic-gate 	if (isascii(m[0]) && isdigit(m[0]) &&
32*7c478bd9Sstevel@tonic-gate 	    isascii(m[1]) && isdigit(m[1]) &&
33*7c478bd9Sstevel@tonic-gate 	    isascii(m[2]) && isdigit(m[2]) && m[3] == ' ')
34*7c478bd9Sstevel@tonic-gate 		m += 4;
35*7c478bd9Sstevel@tonic-gate 	SM_VA_START(ap, msg);
36*7c478bd9Sstevel@tonic-gate 	(void) vfprintf(stderr, m, ap);
37*7c478bd9Sstevel@tonic-gate 	SM_VA_END(ap);
38*7c478bd9Sstevel@tonic-gate 	(void) fprintf(stderr, "\n");
39*7c478bd9Sstevel@tonic-gate }
40*7c478bd9Sstevel@tonic-gate 
41*7c478bd9Sstevel@tonic-gate /*VARARGS1*/
42*7c478bd9Sstevel@tonic-gate void
43*7c478bd9Sstevel@tonic-gate #ifdef __STDC__
syserr(const char * msg,...)44*7c478bd9Sstevel@tonic-gate syserr(const char *msg, ...)
45*7c478bd9Sstevel@tonic-gate #else /* __STDC__ */
46*7c478bd9Sstevel@tonic-gate syserr(msg, va_alist)
47*7c478bd9Sstevel@tonic-gate 	const char *msg;
48*7c478bd9Sstevel@tonic-gate 	va_dcl
49*7c478bd9Sstevel@tonic-gate #endif /* __STDC__ */
50*7c478bd9Sstevel@tonic-gate {
51*7c478bd9Sstevel@tonic-gate 	const char *m;
52*7c478bd9Sstevel@tonic-gate 	SM_VA_LOCAL_DECL
53*7c478bd9Sstevel@tonic-gate 
54*7c478bd9Sstevel@tonic-gate 	m = msg;
55*7c478bd9Sstevel@tonic-gate 	if (isascii(m[0]) && isdigit(m[0]) &&
56*7c478bd9Sstevel@tonic-gate 	    isascii(m[1]) && isdigit(m[1]) &&
57*7c478bd9Sstevel@tonic-gate 	    isascii(m[2]) && isdigit(m[2]) && m[3] == ' ')
58*7c478bd9Sstevel@tonic-gate 		m += 4;
59*7c478bd9Sstevel@tonic-gate 	SM_VA_START(ap, msg);
60*7c478bd9Sstevel@tonic-gate 	(void) vfprintf(stderr, m, ap);
61*7c478bd9Sstevel@tonic-gate 	SM_VA_END(ap);
62*7c478bd9Sstevel@tonic-gate 	(void) fprintf(stderr, "\n");
63*7c478bd9Sstevel@tonic-gate }
64