1 /*
2 **  Sendmail
3 **  Copyright (c) 1983  Eric P. Allman
4 **  Berkeley, California
5 **
6 **  Copyright (c) 1983 Regents of the University of California.
7 **  All rights reserved.  The Berkeley software License Agreement
8 **  specifies the terms and conditions for redistribution.
9 */
10 
11 #ifndef lint
12 static char	SccsId[] = "@(#)sysexits.c	5.2 (Berkeley) 06/07/85";
13 #endif not lint
14 
15 # include <sysexits.h>
16 # include "useful.h"
17 
18 /*
19 **  SYSEXITS.C -- error messages corresponding to sysexits.h
20 */
21 
22 char	*SysExMsg[] =
23 {
24 	/* 64 USAGE */		"500 Bad usage",
25 	/* 65 DATAERR */	"501 Data format error",
26 	/* 66 NOINPUT */	"550 Cannot open input",
27 	/* 67 NOUSER */		"550 User unknown",
28 	/* 68 NOHOST */		"550 Host unknown",
29 	/* 69 UNAVAILABLE */	"554 Service unavailable",
30 	/* 70 SOFTWARE */	"554 Internal error",
31 	/* 71 OSERR */		"451 Operating system error",
32 	/* 72 OSFILE */		"554 System file missing",
33 	/* 73 CANTCREAT */	"550 Can't create output",
34 	/* 74 IOERR */		"451 I/O error",
35 	/* 75 TEMPFAIL */	"250 Deferred",
36 	/* 76 PROTOCOL */	"554 Remote protocol error",
37 	/* 77 NOPERM */		"550 Insufficient permission",
38 };
39 
40 int	N_SysEx = sizeof SysExMsg / sizeof SysExMsg[0];
41 /*
42 **  STATSTRING -- return string corresponding to an error status
43 **
44 **	Parameters:
45 **		stat -- the status to decode.
46 **
47 **	Returns:
48 **		The string corresponding to that status
49 **
50 **	Side Effects:
51 **		none.
52 */
53 
54 char *
55 statstring(stat)
56 	int stat;
57 {
58 	static char ebuf[100];
59 
60 	stat -= EX__BASE;
61 	if (stat < 0 || stat >= N_SysEx)
62 	{
63 		(void) sprintf(ebuf, "554 Unknown status %d", stat + EX__BASE);
64 		return (ebuf);
65 	}
66 
67 	return (SysExMsg[stat]);
68 }
69