a C standard library for fx Casio calculators
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

29 lines
994 B

#include <string.h>
#include <errno.h>
static char *errno_strings [] = {
[0] = "Success",
[EDOM] = "Numerical argument out of domain",
[EILSEQ] = "Invalid or incomplete multibyte or wide character",
[ERANGE] = "Numerical result out of range",
[EACCES] = "Permission denied",
[EEXIST] = "File exists",
[EINVAL] = "Invalid argument",
[ENFILE] = "Too many open files in system",
[ENOENT] = "No such file or directory",
[ENOMEM] = "Cannot allocate memory",
[EDQUOT] = "Disk quota exceeded",
[ENOSPC] = "No space left on device",
[ENOTSUP] = "Operation not supported",
[EBADF] = "Bad file descriptor",
[ESPIPE] = "Illegal seek",
[EISDIR] = "Is a directory",
[ENOTDIR] = "Not a directory",
[ENOTEMPTY] = "Directory not empty",
};
char *strerror(int e)
{
int count = sizeof errno_strings / sizeof errno_strings[0];
return (e >= 0 && e < count) ? errno_strings[e] : "<Unknown errno>";
}