mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2026-01-26 21:41:34 +03:00
io: Use switch statement in xmlIOErr
This commit is contained in:
103
xmlIO.c
103
xmlIO.c
@@ -127,155 +127,156 @@ xmlIOErr(int err)
|
|||||||
{
|
{
|
||||||
xmlParserErrors code;
|
xmlParserErrors code;
|
||||||
|
|
||||||
if (err == 0) code = XML_IO_UNKNOWN;
|
switch (err) {
|
||||||
#ifdef EACCES
|
#ifdef EACCES
|
||||||
else if (err == EACCES) code = XML_IO_EACCES;
|
case EACCES: code = XML_IO_EACCES; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef EAGAIN
|
#ifdef EAGAIN
|
||||||
else if (err == EAGAIN) code = XML_IO_EAGAIN;
|
case EAGAIN: code = XML_IO_EAGAIN; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef EBADF
|
#ifdef EBADF
|
||||||
else if (err == EBADF) code = XML_IO_EBADF;
|
case EBADF: code = XML_IO_EBADF; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef EBADMSG
|
#ifdef EBADMSG
|
||||||
else if (err == EBADMSG) code = XML_IO_EBADMSG;
|
case EBADMSG: code = XML_IO_EBADMSG; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef EBUSY
|
#ifdef EBUSY
|
||||||
else if (err == EBUSY) code = XML_IO_EBUSY;
|
case EBUSY: code = XML_IO_EBUSY; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef ECANCELED
|
#ifdef ECANCELED
|
||||||
else if (err == ECANCELED) code = XML_IO_ECANCELED;
|
case ECANCELED: code = XML_IO_ECANCELED; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef ECHILD
|
#ifdef ECHILD
|
||||||
else if (err == ECHILD) code = XML_IO_ECHILD;
|
case ECHILD: code = XML_IO_ECHILD; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef EDEADLK
|
#ifdef EDEADLK
|
||||||
else if (err == EDEADLK) code = XML_IO_EDEADLK;
|
case EDEADLK: code = XML_IO_EDEADLK; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef EDOM
|
#ifdef EDOM
|
||||||
else if (err == EDOM) code = XML_IO_EDOM;
|
case EDOM: code = XML_IO_EDOM; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef EEXIST
|
#ifdef EEXIST
|
||||||
else if (err == EEXIST) code = XML_IO_EEXIST;
|
case EEXIST: code = XML_IO_EEXIST; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef EFAULT
|
#ifdef EFAULT
|
||||||
else if (err == EFAULT) code = XML_IO_EFAULT;
|
case EFAULT: code = XML_IO_EFAULT; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef EFBIG
|
#ifdef EFBIG
|
||||||
else if (err == EFBIG) code = XML_IO_EFBIG;
|
case EFBIG: code = XML_IO_EFBIG; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef EINPROGRESS
|
#ifdef EINPROGRESS
|
||||||
else if (err == EINPROGRESS) code = XML_IO_EINPROGRESS;
|
case EINPROGRESS: code = XML_IO_EINPROGRESS; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef EINTR
|
#ifdef EINTR
|
||||||
else if (err == EINTR) code = XML_IO_EINTR;
|
case EINTR: code = XML_IO_EINTR; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef EINVAL
|
#ifdef EINVAL
|
||||||
else if (err == EINVAL) code = XML_IO_EINVAL;
|
case EINVAL: code = XML_IO_EINVAL; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef EIO
|
#ifdef EIO
|
||||||
else if (err == EIO) code = XML_IO_EIO;
|
case EIO: code = XML_IO_EIO; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef EISDIR
|
#ifdef EISDIR
|
||||||
else if (err == EISDIR) code = XML_IO_EISDIR;
|
case EISDIR: code = XML_IO_EISDIR; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef EMFILE
|
#ifdef EMFILE
|
||||||
else if (err == EMFILE) code = XML_IO_EMFILE;
|
case EMFILE: code = XML_IO_EMFILE; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef EMLINK
|
#ifdef EMLINK
|
||||||
else if (err == EMLINK) code = XML_IO_EMLINK;
|
case EMLINK: code = XML_IO_EMLINK; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef EMSGSIZE
|
#ifdef EMSGSIZE
|
||||||
else if (err == EMSGSIZE) code = XML_IO_EMSGSIZE;
|
case EMSGSIZE: code = XML_IO_EMSGSIZE; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENAMETOOLONG
|
#ifdef ENAMETOOLONG
|
||||||
else if (err == ENAMETOOLONG) code = XML_IO_ENAMETOOLONG;
|
case ENAMETOOLONG: code = XML_IO_ENAMETOOLONG; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENFILE
|
#ifdef ENFILE
|
||||||
else if (err == ENFILE) code = XML_IO_ENFILE;
|
case ENFILE: code = XML_IO_ENFILE; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENODEV
|
#ifdef ENODEV
|
||||||
else if (err == ENODEV) code = XML_IO_ENODEV;
|
case ENODEV: code = XML_IO_ENODEV; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENOENT
|
#ifdef ENOENT
|
||||||
else if (err == ENOENT) code = XML_IO_ENOENT;
|
case ENOENT: code = XML_IO_ENOENT; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENOEXEC
|
#ifdef ENOEXEC
|
||||||
else if (err == ENOEXEC) code = XML_IO_ENOEXEC;
|
case ENOEXEC: code = XML_IO_ENOEXEC; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENOLCK
|
#ifdef ENOLCK
|
||||||
else if (err == ENOLCK) code = XML_IO_ENOLCK;
|
case ENOLCK: code = XML_IO_ENOLCK; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENOMEM
|
#ifdef ENOMEM
|
||||||
else if (err == ENOMEM) code = XML_IO_ENOMEM;
|
case ENOMEM: code = XML_IO_ENOMEM; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENOSPC
|
#ifdef ENOSPC
|
||||||
else if (err == ENOSPC) code = XML_IO_ENOSPC;
|
case ENOSPC: code = XML_IO_ENOSPC; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENOSYS
|
#ifdef ENOSYS
|
||||||
else if (err == ENOSYS) code = XML_IO_ENOSYS;
|
case ENOSYS: code = XML_IO_ENOSYS; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENOTDIR
|
#ifdef ENOTDIR
|
||||||
else if (err == ENOTDIR) code = XML_IO_ENOTDIR;
|
case ENOTDIR: code = XML_IO_ENOTDIR; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENOTEMPTY
|
#ifdef ENOTEMPTY
|
||||||
else if (err == ENOTEMPTY) code = XML_IO_ENOTEMPTY;
|
case ENOTEMPTY: code = XML_IO_ENOTEMPTY; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENOTSUP
|
#ifdef ENOTSUP
|
||||||
else if (err == ENOTSUP) code = XML_IO_ENOTSUP;
|
case ENOTSUP: code = XML_IO_ENOTSUP; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENOTTY
|
#ifdef ENOTTY
|
||||||
else if (err == ENOTTY) code = XML_IO_ENOTTY;
|
case ENOTTY: code = XML_IO_ENOTTY; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENXIO
|
#ifdef ENXIO
|
||||||
else if (err == ENXIO) code = XML_IO_ENXIO;
|
case ENXIO: code = XML_IO_ENXIO; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef EPERM
|
#ifdef EPERM
|
||||||
else if (err == EPERM) code = XML_IO_EPERM;
|
case EPERM: code = XML_IO_EPERM; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef EPIPE
|
#ifdef EPIPE
|
||||||
else if (err == EPIPE) code = XML_IO_EPIPE;
|
case EPIPE: code = XML_IO_EPIPE; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef ERANGE
|
#ifdef ERANGE
|
||||||
else if (err == ERANGE) code = XML_IO_ERANGE;
|
case ERANGE: code = XML_IO_ERANGE; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef EROFS
|
#ifdef EROFS
|
||||||
else if (err == EROFS) code = XML_IO_EROFS;
|
case EROFS: code = XML_IO_EROFS; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef ESPIPE
|
#ifdef ESPIPE
|
||||||
else if (err == ESPIPE) code = XML_IO_ESPIPE;
|
case ESPIPE: code = XML_IO_ESPIPE; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef ESRCH
|
#ifdef ESRCH
|
||||||
else if (err == ESRCH) code = XML_IO_ESRCH;
|
case ESRCH: code = XML_IO_ESRCH; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef ETIMEDOUT
|
#ifdef ETIMEDOUT
|
||||||
else if (err == ETIMEDOUT) code = XML_IO_ETIMEDOUT;
|
case ETIMEDOUT: code = XML_IO_ETIMEDOUT; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef EXDEV
|
#ifdef EXDEV
|
||||||
else if (err == EXDEV) code = XML_IO_EXDEV;
|
case EXDEV: code = XML_IO_EXDEV; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENOTSOCK
|
#ifdef ENOTSOCK
|
||||||
else if (err == ENOTSOCK) code = XML_IO_ENOTSOCK;
|
case ENOTSOCK: code = XML_IO_ENOTSOCK; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef EISCONN
|
#ifdef EISCONN
|
||||||
else if (err == EISCONN) code = XML_IO_EISCONN;
|
case EISCONN: code = XML_IO_EISCONN; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef ECONNREFUSED
|
#ifdef ECONNREFUSED
|
||||||
else if (err == ECONNREFUSED) code = XML_IO_ECONNREFUSED;
|
case ECONNREFUSED: code = XML_IO_ECONNREFUSED; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENETUNREACH
|
#ifdef ENETUNREACH
|
||||||
else if (err == ENETUNREACH) code = XML_IO_ENETUNREACH;
|
case ENETUNREACH: code = XML_IO_ENETUNREACH; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef EADDRINUSE
|
#ifdef EADDRINUSE
|
||||||
else if (err == EADDRINUSE) code = XML_IO_EADDRINUSE;
|
case EADDRINUSE: code = XML_IO_EADDRINUSE; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef EALREADY
|
#ifdef EALREADY
|
||||||
else if (err == EALREADY) code = XML_IO_EALREADY;
|
case EALREADY: code = XML_IO_EALREADY; break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef EAFNOSUPPORT
|
#ifdef EAFNOSUPPORT
|
||||||
else if (err == EAFNOSUPPORT) code = XML_IO_EAFNOSUPPORT;
|
case EAFNOSUPPORT: code = XML_IO_EAFNOSUPPORT; break;
|
||||||
#endif
|
#endif
|
||||||
else code = XML_IO_UNKNOWN;
|
default: code = XML_IO_UNKNOWN; break;
|
||||||
|
}
|
||||||
|
|
||||||
return(code);
|
return(code);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user