home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GEMini Atari
/
GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso
/
zip
/
mint
/
mntlib16.lzh
/
MNTLIB16
/
STRERROR.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-08-03
|
3KB
|
121 lines
/* from Henry Spencer's stringlib */
#include <string.h>
#define SYS_NERR (90)
static char nullstr[] = "unknown error";
int sys_nerr = SYS_NERR;
char *sys_errlist[SYS_NERR] =
{
"OK", /* 0 */
"error", /* 1 */
"drive not ready", /* 2 */
"unknown command", /* 3 */
"crc error", /* 4 */
"bad request", /* 5 */
"seek error", /* 6 */
"unknown media", /* 7 */
"sector not found", /* 8 */
"out of paper", /* 9 */
"write failure", /* 10 */
"read failure", /* 11 */
"general mishap", /* 12 */
"media write protected", /* 13 */
"media changed", /* 14 */
"unknown device", /* 15 */
"bad sectors on format", /* 16 */
"disk swap request", /* 17 */
nullstr, /* 18 */
nullstr, /* 19 */
nullstr, /* 20 */
nullstr, /* 21 */
nullstr, /* 22 */
nullstr, /* 23 */
nullstr, /* 24 */
nullstr, /* 25 */
nullstr, /* 26 */
nullstr, /* 27 */
nullstr, /* 28 */
nullstr, /* 29 */
nullstr, /* 30 */
nullstr, /* 31 */
"invalid function number", /* 32 */
"file not found", /* 33 */
"path not found", /* 34 */
"no more handles", /* 35 */
"access denied", /* 36 */
"invalid handle", /* 37 */
nullstr, /* 38 */
"out of memory", /* 39 */
"invalid memory block", /* 40 */
nullstr, /* 41 */
nullstr, /* 42 */
nullstr, /* 43 */
nullstr, /* 44 */
nullstr, /* 45 */
"invalid drive id", /* 46 */
nullstr, /* 47 */
"rename across drives", /* 48 */
"no more files", /* 49 */
nullstr, /* 50 */
nullstr, /* 51 */
nullstr, /* 52 */
nullstr, /* 53 */
nullstr, /* 54 */
nullstr, /* 55 */
nullstr, /* 56 */
nullstr, /* 57 */
nullstr, /* 58 */
nullstr, /* 59 */
nullstr, /* 60 */
nullstr, /* 61 */
nullstr, /* 62 */
nullstr, /* 63 */
"range error/bad argument", /* 64 */
"internal error", /* 65 */
"bad executable format", /* 66 */
"memory block growth failure", /* 67 */
nullstr, /* 68 */
nullstr, /* 69 */
nullstr, /* 70 */
nullstr, /* 71 */
nullstr, /* 72 */
nullstr, /* 73 */
nullstr, /* 74 */
nullstr, /* 75 */
nullstr, /* 76 */
nullstr, /* 77 */
nullstr, /* 78 */
nullstr, /* 79 */
"too many symbolic links", /* 80 */
nullstr, /* 81 */
nullstr, /* 82 */
nullstr, /* 83 */
nullstr, /* 84 */
"file already exists", /* 85 */
"name too long", /* 86 */
"not a tty", /* 87 */
"range error", /* 88 */
"domain error" /* 89 */
};
/*
* strerror - map error number to descriptive string
*
*/
char *
strerror(errnum)
int errnum;
{
extern int sys_nerr;
extern char *sys_errlist[];
if (errnum >= 0 && errnum < sys_nerr)
return(sys_errlist[errnum]);
else
return(nullstr);
}