From 5d8bfd130e4dd61a7abd044acf0c266bd0527d16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org> Date: Sun, 29 Dec 2013 18:02:46 +0100 Subject: [PATCH] darwin/error: there is no need to re-implement the C run-time error array unless the deprecated sys_errlist array is actually removed some day --- src/darwin/error.c | 125 +-------------------------------------------- 1 file changed, 1 insertion(+), 124 deletions(-) diff --git a/src/darwin/error.c b/src/darwin/error.c index 1171703e0fe4..971934dda9f5 100644 --- a/src/darwin/error.c +++ b/src/darwin/error.c @@ -28,139 +28,16 @@ #include <vlc_common.h> -typedef struct -{ - int code; - const char *msg; -} darwinerrmsg_t; - -static const darwinerrmsg_t darwinerrmsg[] = -{ - { EPERM, "Operation not permitted" }, - { ENOENT, "No such file or directory" }, - { ESRCH, "No such process" }, - { EINTR, "Interrupted system call" }, - { EIO, "Input/output error" }, - { ENXIO, "Device not configured" }, - { E2BIG, "Argument list too long" }, - { ENOEXEC, "Exec format error" }, - { EBADF, "Bad file descriptor" }, - { ECHILD, "No child processes" }, - { EDEADLK, "Resource deadlock avoided" }, - { ENOMEM, "Cannot allocate memory" }, - { EACCES, "Permission denied" }, - { EFAULT, "Bad address" }, - { ENOTBLK, "Block device required" }, - { EBUSY, "Device / Resource busy" }, - { EEXIST, "File exists" }, - { EXDEV, "Cross-device link" }, - { ENODEV, "Operation not supported by device" }, - { ENOTDIR, "Not a directory" }, - { EISDIR, "Is a directory" }, - { EINVAL, "Invalid argument" }, - { ENFILE, "Too many open files in system" }, - { EMFILE, "Too many open files" }, - { ENOTTY, "Inappropriate ioctl for device" }, - { ETXTBSY, "Text file busy" }, - { EFBIG, "File too large" }, - { ENOSPC, "No space left on device" }, - { ESPIPE, "Illegal seek" }, - { EROFS, "Read-only file system" }, - { EMLINK, "Too many links" }, - { EPIPE, "Broken pipe" }, - { EDOM, "Numerical argument out of domain" }, - { ERANGE, "Result too large" }, - { EAGAIN, "Resource temporarily unavailable" }, - { EWOULDBLOCK, "Operation would block" }, - { EINPROGRESS, "Operation now in progress" }, - { EALREADY, "Operation already in progress" }, - { ENOTSOCK, "Socket operation on non-socket" }, - { EDESTADDRREQ, "Destination address required" }, - { EMSGSIZE, "Message too long" }, - { EPROTOTYPE, "Protocol wrong type for socket" }, - { ENOPROTOOPT, "Protocol not available" }, - { EPROTONOSUPPORT, "Protocol not supported" }, - { ESOCKTNOSUPPORT, "Socket type not supported" }, - { ENOTSUP, "Operation not supported" }, - { EOPNOTSUPP, "Operation not supported on socket" }, - { EPFNOSUPPORT, "Protocol family not supported" }, - { EAFNOSUPPORT, "Address family not supported by protocol family" }, - { EADDRINUSE, "Address already in use" }, - { EADDRNOTAVAIL, "Can't assign requested address" }, - { ENETDOWN, "Network is down" }, - { ENETUNREACH, "Network is unreachable" }, - { ENETRESET, "Network dropped connection on reset" }, - { ECONNABORTED, "Software caused connection abort" }, - { ECONNRESET, "Connection reset by peer" }, - { ENOBUFS, "No buffer space available" }, - { EISCONN, "Socket is already connected" }, - { ENOTCONN, "Socket is not connected" }, - { ESHUTDOWN, "Can't send after socket shutdown" }, - { ETOOMANYREFS, "Too many references: can't splice" }, - { ETIMEDOUT, "Operation timed out" }, - { ECONNREFUSED, "Connection refused" }, - { ELOOP, "Too many levels of symbolic links" }, - { ENAMETOOLONG, "File name too long" }, - { EHOSTDOWN, "Host is down" }, - { EHOSTUNREACH, "No route to host" }, - { ENOTEMPTY, "Directory not empty" }, - { EPROCLIM, "Too many processes" }, - { EUSERS, "Too many users" }, - { EDQUOT, "Disc quota exceeded" }, - { ESTALE, "Stale NFS file handle" }, - { EREMOTE, "Too many levels of remote in path" }, - { EBADRPC, "RPC struct is bad" }, - { ERPCMISMATCH, "RPC version wrong" }, - { EPROGUNAVAIL, "RPC prog. not avail" }, - { EPROGMISMATCH, "Program version wrong" }, - { EPROCUNAVAIL, "Bad procedure for program" }, - { ENOLCK, "No locks available" }, - { ENOSYS, "Function not implemented" }, - { EFTYPE, "Inappropriate file type or format" }, - { EAUTH, "Authentication error" }, - { ENEEDAUTH, "Need authenticator" }, - { EPWROFF, "Device power is off" }, - { EDEVERR, "Device error, e.g. paper out" }, - { EOVERFLOW, "Value too large to be stored in data type" }, - { EBADEXEC, "Bad executable" }, - { EBADARCH, "Bad CPU type in executable" }, - { ESHLIBVERS, "Shared library version mismatch" }, - { EBADMACHO, "Malformed Macho file" }, - { ECANCELED, "Operation canceled" }, - { EIDRM, "Identifier removed" }, - { ENOMSG, "No message of desired type" }, - { EILSEQ, "Illegal byte sequence" }, - { ENOATTR, "Attribute not found" }, - { EBADMSG, "Bad message" }, - { EMULTIHOP, "Reserved" }, - { ENODATA, "No message available on STREAM" }, - { ENOLINK, "Reserved" }, - { ENOSR, "No STREAM resources" }, - { ENOSTR, "Not a STREAM" }, - { EPROTO, "Protocol error" }, - { ETIME, "STREAM ioctl timeout" }, - { ENOPOLICY, "No such policy registered" }, - { ENOTRECOVERABLE, "State not recoverable" }, - { EOWNERDEAD, "Previous owner died" }, - { EQFULL, "Interface output queue is full" }, - { 0, NULL } -}; - const char *vlc_strerror_c(int errnum) { /* C run-time errors */ if ((unsigned)errnum < (unsigned)sys_nerr) return sys_errlist[errnum]; - /* Darwin socket errors */ - for (const darwinerrmsg_t *e = darwinerrmsg; e->msg != NULL; e++) - if (e->code == errnum) - return e->msg; - return "Unknown error"; } const char *vlc_strerror(int errnum) { - return /*vlc_gettext*/(vlc_strerror_c(errnum)); + return vlc_gettext(vlc_strerror_c(errnum)); } -- GitLab