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