|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1983 Eric P. Allman ! 3: * Copyright (c) 1988 Regents of the University of California. ! 4: * All rights reserved. ! 5: * ! 6: * Redistribution and use in source and binary forms are permitted ! 7: * provided that the above copyright notice and this paragraph are ! 8: * duplicated in all such forms and that any documentation, ! 9: * advertising materials, and other materials related to such ! 10: * distribution and use acknowledge that the software was developed ! 11: * by the University of California, Berkeley. The name of the ! 12: * University may not be used to endorse or promote products derived ! 13: * from this software without specific prior written permission. ! 14: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ! 15: * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ! 16: * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 17: */ ! 18: ! 19: #ifndef lint ! 20: static char sccsid[] = "@(#)sysexits.c 5.5 (Berkeley) 6/30/88"; ! 21: #endif /* not lint */ ! 22: ! 23: #include <sysexits.h> ! 24: ! 25: /* ! 26: * SYSEXITS.C -- error messages corresponding to sysexits.h ! 27: */ ! 28: char *SysExMsg[] = { ! 29: /* 64 USAGE */ "500 Bad usage", ! 30: /* 65 DATAERR */ "501 Data format error", ! 31: /* 66 NOINPUT */ "550 Cannot open input", ! 32: /* 67 NOUSER */ "550 User unknown", ! 33: /* 68 NOHOST */ "550 Host unknown", ! 34: /* 69 UNAVAILABLE */ "554 Service unavailable", ! 35: /* 70 SOFTWARE */ "554 Internal error", ! 36: /* 71 OSERR */ "451 Operating system error", ! 37: /* 72 OSFILE */ "554 System file missing", ! 38: /* 73 CANTCREAT */ "550 Can't create output", ! 39: /* 74 IOERR */ "451 I/O error", ! 40: /* 75 TEMPFAIL */ "250 Deferred", ! 41: /* 76 PROTOCOL */ "554 Remote protocol error", ! 42: /* 77 NOPERM */ "550 Insufficient permission", ! 43: /* 78 CONFIG */ "554 Local configuration error", ! 44: }; ! 45: ! 46: int N_SysEx = sizeof(SysExMsg) / sizeof(SysExMsg[0]); ! 47: ! 48: /* ! 49: * STATSTRING -- return string corresponding to an error status ! 50: * ! 51: * Parameters: ! 52: * stat -- the status to decode. ! 53: * ! 54: * Returns: ! 55: * The string corresponding to that status ! 56: * ! 57: * Side Effects: ! 58: * none. ! 59: */ ! 60: char * ! 61: statstring(stat) ! 62: int stat; ! 63: { ! 64: static char ebuf[50]; ! 65: ! 66: stat -= EX__BASE; ! 67: if (stat < 0 || stat >= N_SysEx) { ! 68: (void)sprintf(ebuf, "554 Unknown status %d", stat + EX__BASE); ! 69: return(ebuf); ! 70: } ! 71: return(SysExMsg[stat]); ! 72: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.