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