/* -*- mode: c++; indent-tabs-mode: nil -*- */
/*
  qc_errno.qpp

  Qore Programming Language

  Copyright (C) 2003 - 2023 David Nichols

  Permission is hereby granted, free of charge, to any person obtaining a
  copy of this software and associated documentation files (the "Software"),
  to deal in the Software without restriction, including without limitation
  the rights to use, copy, modify, merge, publish, distribute, sublicense,
  and/or sell copies of the Software, and to permit persons to whom the
  Software is furnished to do so, subject to the following conditions:

  The above copyright notice and this permission notice shall be included in
  all copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  DEALINGS IN THE SOFTWARE.

  Note that the Qore library is released under a choice of three open-source
  licenses: MIT (as above), LGPL 2+, or GPL 2+; see README-LICENSE for more
  information.
*/

#include <qore/Qore.h>

#ifndef E2BIG
#define E2BIG -1
#endif
#ifndef EACCES
#define EACCES -1
#endif
#ifndef EADDRINUSE
#define EADDRINUSE -1
#endif
#ifndef EADDRNOTAVAIL
#define EADDRNOTAVAIL -1
#endif
#ifndef EAFNOSUPPORT
#define EAFNOSUPPORT -1
#endif
#ifndef EAGAIN
#define EAGAIN -1
#endif
#ifndef EALREADY
#define EALREADY -1
#endif
#ifndef EBADF
#define EBADF -1
#endif
#ifndef EBADMSG
#define EBADMSG -1
#endif
#ifndef EBUSY
#define EBUSY -1
#endif
#ifndef ECHILD
#define ECHILD -1
#endif
#ifndef ECONNABORTED
#define ECONNABORTED -1
#endif
#ifndef ECONNREFUSED
#define ECONNREFUSED -1
#endif
#ifndef ECONNRESET
#define ECONNRESET -1
#endif
#ifndef EDEADLK
#define EDEADLK -1
#endif
#ifndef EDEADLOCK
#define EDEADLOCK -1
#endif
#ifndef EDESTADDRREQ
#define EDESTADDRREQ -1
#endif
#ifndef EDOM
#define EDOM -1
#endif
#ifndef EDQUOT
#define EDQUOT -1
#endif
#ifndef EEXIST
#define EEXIST -1
#endif
#ifndef EFAULT
#define EFAULT -1
#endif
#ifndef EFBIG
#define EFBIG -1
#endif
#ifndef EHOSTDOWN
#define EHOSTDOWN -1
#endif
#ifndef EHOSTUNREACH
#define EHOSTUNREACH -1
#endif
#ifndef EIDRM
#define EIDRM -1
#endif
#ifndef EILSEQ
#define EILSEQ -1
#endif
#ifndef EINPROGRESS
#define EINPROGRESS -1
#endif
#ifndef EINTR
#define EINTR -1
#endif
#ifndef EINVAL
#define EINVAL -1
#endif
#ifndef EIO
#define EIO -1
#endif
#ifndef EISCONN
#define EISCONN -1
#endif
#ifndef EISDIR
#define EISDIR -1
#endif
#ifndef ELOOP
#define ELOOP -1
#endif
#ifndef EMFILE
#define EMFILE -1
#endif
#ifndef EMLINK
#define EMLINK -1
#endif
#ifndef EMSGSIZE
#define EMSGSIZE -1
#endif
#ifndef EMULTIHOP
#define EMULTIHOP -1
#endif
#ifndef ENAMETOOLONG
#define ENAMETOOLONG -1
#endif
#ifndef ENETDOWN
#define ENETDOWN -1
#endif
#ifndef ENETRESET
#define ENETRESET -1
#endif
#ifndef ENETUNREACH
#define ENETUNREACH -1
#endif
#ifndef ENFILE
#define ENFILE -1
#endif
#ifndef ENOBUFS
#define ENOBUFS -1
#endif
#ifndef ENODATA
#define ENODATA -1
#endif
#ifndef ENODEV
#define ENODEV -1
#endif
#ifndef ENOENT
#define ENOENT -1
#endif
#ifndef ENOEXEC
#define ENOEXEC -1
#endif
#ifndef ENOLCK
#define ENOLCK -1
#endif
#ifndef ENOLINK
#define ENOLINK -1
#endif
#ifndef ENOMEM
#define ENOMEM -1
#endif
#ifndef ENOMSG
#define ENOMSG -1
#endif
#ifndef ENOPROTOOPT
#define ENOPROTOOPT -1
#endif
#ifndef ENOSPC
#define ENOSPC -1
#endif
#ifndef ENOSR
#define ENOSR -1
#endif
#ifndef ENOSTR
#define ENOSTR -1
#endif
#ifndef ENOSYS
#define ENOSYS -1
#endif
#ifndef ENOTBLK
#define ENOTBLK -1
#endif
#ifndef ENOTCONN
#define ENOTCONN -1
#endif
#ifndef ENOTDIR
#define ENOTDIR -1
#endif
#ifndef ENOTEMPTY
#define ENOTEMPTY -1
#endif
#ifndef ENOTNAM
#define ENOTNAM -1
#endif
#ifndef ENOTSOCK
#define ENOTSOCK -1
#endif
#ifndef ENOTTY
#define ENOTTY -1
#endif
#ifndef ENXIO
#define ENXIO -1
#endif
#ifndef EOPNOTSUPP
#define EOPNOTSUPP -1
#endif
#ifndef EOVERFLOW
#define EOVERFLOW -1
#endif
#ifndef EPERM
#define EPERM -1
#endif
#ifndef EPFNOSUPPORT
#define EPFNOSUPPORT -1
#endif
#ifndef EPIPE
#define EPIPE -1
#endif
#ifndef EPROTO
#define EPROTO -1
#endif
#ifndef EPROTONOSUPPORT
#define EPROTONOSUPPORT -1
#endif
#ifndef EPROTOTYPE
#define EPROTOTYPE -1
#endif
#ifndef ERANGE
#define ERANGE -1
#endif
#ifndef EREMOTE
#define EREMOTE -1
#endif
#ifndef EROFS
#define EROFS -1
#endif
#ifndef ESHUTDOWN
#define ESHUTDOWN -1
#endif
#ifndef ESOCKTNOSUPPORT
#define ESOCKTNOSUPPORT -1
#endif
#ifndef ESTALE
#define ESTALE -1
#endif
#ifndef ETIME
#define ETIME -1
#endif
#ifndef ETIMEDOUT
#define ETIMEDOUT -1
#endif
#ifndef ETOOMANYREFS
#define ETOOMANYREFS -1
#endif
#ifndef ETXTBSY
#define ETXTBSY -1
#endif
#ifndef EUSERS
#define EUSERS -1
#endif
#ifndef EWOULDBLOCK
#define EWOULDBLOCK -1
#endif
#ifndef EXDEV
#define EXDEV -1
#endif
#ifndef ESRCH
#define ESRCH -1
#endif

/** @defgroup error_constants Error Constants
    The constants in this group reflect the value of the host system's errno constant of the same name.  If any of these constants are not defined on the current system, then they will have the value -1 in %Qore.
*/
///@{
namespace Qore::Err;

//! Argument list too long
const E2BIG = E2BIG;

//! Permission denied
const EACCES = EACCES;

//! Address already in use
const EADDRINUSE = EADDRINUSE;

//! Can't assign requested address
const EADDRNOTAVAIL = EADDRNOTAVAIL;

//! Address family not supported by protocol family
const EAFNOSUPPORT = EAFNOSUPPORT;

//! Resource temporarily unavailable
const EAGAIN = EAGAIN;

//! Operation already in progress
const EALREADY = EALREADY;

//! Bad file descriptor
const EBADF = EBADF;

//! Bad message
const EBADMSG = EBADMSG;

//! Device or Resource busy
const EBUSY = EBUSY;

//! No child processes
const ECHILD = ECHILD;

//! Software caused connection abort
const ECONNABORTED = ECONNABORTED;

//! Connection refused
const ECONNREFUSED = ECONNREFUSED;

//! Connection reset by peer
const ECONNRESET = ECONNRESET;

//! Resource deadlock avoided
const EDEADLK = EDEADLK;

//! Resource deadlock avoided
const EDEADLOCK = EDEADLOCK;

//! Destination address required
const EDESTADDRREQ = EDESTADDRREQ;

//! Numerical argument out of domain
const EDOM = EDOM;

//! Disc quota exceeded
const EDQUOT = EDQUOT;

//! File exists
const EEXIST = EEXIST;

//! Bad address
const EFAULT = EFAULT;

//! File too large
const EFBIG = EFBIG;

//! Host is down
const EHOSTDOWN = EHOSTDOWN;

//! No route to host
const EHOSTUNREACH = EHOSTUNREACH;

//! Identifier removed
const EIDRM = EIDRM;

//! Illegal byte sequence
const EILSEQ = EILSEQ;

//! Operation now in progress
const EINPROGRESS = EINPROGRESS;

//! Interrupted system call
const EINTR = EINTR;

//! Invalid argument
const EINVAL = EINVAL;

//! Input/output error
const EIO = EIO;

//! Socket is already connected
const EISCONN = EISCONN;

//! Is a directory
const EISDIR = EISDIR;

//! Too many levels of symbolic links
const ELOOP = ELOOP;

//! Too many open files
const EMFILE = EMFILE;

//! Too many links
const EMLINK = EMLINK;

//! Message too long
const EMSGSIZE = EMSGSIZE;

//! Reserved
const EMULTIHOP = EMULTIHOP;

//! File name too long
const ENAMETOOLONG = ENAMETOOLONG;

//! Network is down
const ENETDOWN = ENETDOWN;

//! Network dropped connection on reset
const ENETRESET = ENETRESET;

//! Network is unreachable
const ENETUNREACH = ENETUNREACH;

//! Too many open files in system
const ENFILE = ENFILE;

//! No buffer space available
const ENOBUFS = ENOBUFS;

//! No message available on STREAM
const ENODATA = ENODATA;

//! Operation not supported by device
const ENODEV = ENODEV;

//! No such file or directory
const ENOENT = ENOENT;

//! Exec format error
const ENOEXEC = ENOEXEC;

//! No locks available
const ENOLCK = ENOLCK;

//! Reserved
const ENOLINK = ENOLINK;

//! Cannot allocate memory
const ENOMEM = ENOMEM;

//! No message of desired type
const ENOMSG = ENOMSG;

//! Protocol not available
const ENOPROTOOPT = ENOPROTOOPT;

//! No space left on device
const ENOSPC = ENOSPC;

//! No STREAM resources
const ENOSR = ENOSR;

//! Not a STREAM
const ENOSTR = ENOSTR;

//! Function not implemented
const ENOSYS = ENOSYS;

//! Block device required
const ENOTBLK = ENOTBLK;

//! Socket is not connected
const ENOTCONN = ENOTCONN;

//! Not a directory
const ENOTDIR = ENOTDIR;

//! Directory not empty
const ENOTEMPTY = ENOTEMPTY;

//! 
const ENOTNAM = ENOTNAM;

//! Socket operation on non-socket
const ENOTSOCK = ENOTSOCK;

//! Inappropriate ioctl for device
const ENOTTY = ENOTTY;

//! Device not configured
const ENXIO = ENXIO;

//! Operation not supported on socket
const EOPNOTSUPP = EOPNOTSUPP;

//! Value too large to be stored in data type
const EOVERFLOW = EOVERFLOW;

//! Operation not permitted
const EPERM = EPERM;

//! Protocol family not supported
const EPFNOSUPPORT = EPFNOSUPPORT;

//! Broken pipe
const EPIPE = EPIPE;

//! Protocol error
const EPROTO = EPROTO;

//! Protocol not supported
const EPROTONOSUPPORT = EPROTONOSUPPORT;

//! Protocol wrong type for socket
const EPROTOTYPE = EPROTOTYPE;

//! Result too large
const ERANGE = ERANGE;

//! Too many levels of remote in path
const EREMOTE = EREMOTE;

//! Read-only file system
const EROFS = EROFS;

//! Can't send after socket shutdown
const ESHUTDOWN = ESHUTDOWN;

//! Socket type not supported
const ESOCKTNOSUPPORT = ESOCKTNOSUPPORT;

//! Stale NFS file handle
const ESTALE = ESTALE;

//! STREAM ioctl timeout
const ETIME = ETIME;

//! Operation timed out
const ETIMEDOUT = ETIMEDOUT;

//! Too many references: can't splice
const ETOOMANYREFS = ETOOMANYREFS;

//! Text file busy
const ETXTBSY = ETXTBSY;

//! Too many users
const EUSERS = EUSERS;

//! Operation would block
const EWOULDBLOCK = EWOULDBLOCK;

//! Cross-device link
const EXDEV = EXDEV;

//! search error
const ESRCH = ESRCH;
///@}
