00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef APR_ERRNO_H
00018 #define APR_ERRNO_H
00019
00025 #include "apr.h"
00026
00027 #if APR_HAVE_ERRNO_H
00028 #include <errno.h>
00029 #endif
00030
00031 #ifdef __cplusplus
00032 extern "C" {
00033 #endif
00034
00044 typedef int apr_status_t;
00045
00052 APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
00053 apr_size_t bufsize);
00054
00055 #if defined(DOXYGEN)
00064 #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR)
00065
00075 #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR)
00076
00112 #endif
00113
00117 #define APR_OS_START_ERROR 20000
00123 #define APR_OS_ERRSPACE_SIZE 50000
00127 #define APR_OS_START_STATUS (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
00135 #define APR_OS_START_USERERR (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
00140 #define APR_OS_START_USEERR APR_OS_START_USERERR
00145 #define APR_OS_START_CANONERR (APR_OS_START_USERERR \
00146 + (APR_OS_ERRSPACE_SIZE * 10))
00151 #define APR_OS_START_EAIERR (APR_OS_START_CANONERR + APR_OS_ERRSPACE_SIZE)
00156 #define APR_OS_START_SYSERR (APR_OS_START_EAIERR + APR_OS_ERRSPACE_SIZE)
00157
00159 #define APR_SUCCESS 0
00160
00221 #define APR_ENOSTAT (APR_OS_START_ERROR + 1)
00223 #define APR_ENOPOOL (APR_OS_START_ERROR + 2)
00224
00226 #define APR_EBADDATE (APR_OS_START_ERROR + 4)
00228 #define APR_EINVALSOCK (APR_OS_START_ERROR + 5)
00230 #define APR_ENOPROC (APR_OS_START_ERROR + 6)
00232 #define APR_ENOTIME (APR_OS_START_ERROR + 7)
00234 #define APR_ENODIR (APR_OS_START_ERROR + 8)
00236 #define APR_ENOLOCK (APR_OS_START_ERROR + 9)
00238 #define APR_ENOPOLL (APR_OS_START_ERROR + 10)
00240 #define APR_ENOSOCKET (APR_OS_START_ERROR + 11)
00242 #define APR_ENOTHREAD (APR_OS_START_ERROR + 12)
00244 #define APR_ENOTHDKEY (APR_OS_START_ERROR + 13)
00246 #define APR_EGENERAL (APR_OS_START_ERROR + 14)
00248 #define APR_ENOSHMAVAIL (APR_OS_START_ERROR + 15)
00250 #define APR_EBADIP (APR_OS_START_ERROR + 16)
00252 #define APR_EBADMASK (APR_OS_START_ERROR + 17)
00253
00255 #define APR_EDSOOPEN (APR_OS_START_ERROR + 19)
00257 #define APR_EABSOLUTE (APR_OS_START_ERROR + 20)
00259 #define APR_ERELATIVE (APR_OS_START_ERROR + 21)
00261 #define APR_EINCOMPLETE (APR_OS_START_ERROR + 22)
00263 #define APR_EABOVEROOT (APR_OS_START_ERROR + 23)
00265 #define APR_EBADPATH (APR_OS_START_ERROR + 24)
00267 #define APR_EPATHWILD (APR_OS_START_ERROR + 25)
00269 #define APR_ESYMNOTFOUND (APR_OS_START_ERROR + 26)
00271 #define APR_EPROC_UNKNOWN (APR_OS_START_ERROR + 27)
00290 #define APR_STATUS_IS_ENOSTAT(s) ((s) == APR_ENOSTAT)
00296 #define APR_STATUS_IS_ENOPOOL(s) ((s) == APR_ENOPOOL)
00298 #define APR_STATUS_IS_EBADDATE(s) ((s) == APR_EBADDATE)
00300 #define APR_STATUS_IS_EINVALSOCK(s) ((s) == APR_EINVALSOCK)
00302 #define APR_STATUS_IS_ENOPROC(s) ((s) == APR_ENOPROC)
00304 #define APR_STATUS_IS_ENOTIME(s) ((s) == APR_ENOTIME)
00306 #define APR_STATUS_IS_ENODIR(s) ((s) == APR_ENODIR)
00308 #define APR_STATUS_IS_ENOLOCK(s) ((s) == APR_ENOLOCK)
00310 #define APR_STATUS_IS_ENOPOLL(s) ((s) == APR_ENOPOLL)
00312 #define APR_STATUS_IS_ENOSOCKET(s) ((s) == APR_ENOSOCKET)
00314 #define APR_STATUS_IS_ENOTHREAD(s) ((s) == APR_ENOTHREAD)
00316 #define APR_STATUS_IS_ENOTHDKEY(s) ((s) == APR_ENOTHDKEY)
00318 #define APR_STATUS_IS_EGENERAL(s) ((s) == APR_EGENERAL)
00320 #define APR_STATUS_IS_ENOSHMAVAIL(s) ((s) == APR_ENOSHMAVAIL)
00322 #define APR_STATUS_IS_EBADIP(s) ((s) == APR_EBADIP)
00324 #define APR_STATUS_IS_EBADMASK(s) ((s) == APR_EBADMASK)
00325
00330 #if defined(WIN32)
00331 #define APR_STATUS_IS_EDSOOPEN(s) ((s) == APR_EDSOOPEN \
00332 || APR_TO_OS_ERROR(s) == ERROR_MOD_NOT_FOUND)
00333 #else
00334 #define APR_STATUS_IS_EDSOOPEN(s) ((s) == APR_EDSOOPEN)
00335 #endif
00337 #define APR_STATUS_IS_EABSOLUTE(s) ((s) == APR_EABSOLUTE)
00339 #define APR_STATUS_IS_ERELATIVE(s) ((s) == APR_ERELATIVE)
00341 #define APR_STATUS_IS_EINCOMPLETE(s) ((s) == APR_EINCOMPLETE)
00343 #define APR_STATUS_IS_EABOVEROOT(s) ((s) == APR_EABOVEROOT)
00345 #define APR_STATUS_IS_EBADPATH(s) ((s) == APR_EBADPATH)
00347 #define APR_STATUS_IS_EPATHWILD(s) ((s) == APR_EPATHWILD)
00351 #if defined(WIN32)
00352 #define APR_STATUS_IS_ESYMNOTFOUND(s) ((s) == APR_ESYMNOTFOUND \
00353 || APR_TO_OS_ERROR(s) == ERROR_PROC_NOT_FOUND)
00354 #else
00355 #define APR_STATUS_IS_ESYMNOTFOUND(s) ((s) == APR_ESYMNOTFOUND)
00356 #endif
00358 #define APR_STATUS_IS_EPROC_UNKNOWN(s) ((s) == APR_EPROC_UNKNOWN)
00359
00367 #define APR_INCHILD (APR_OS_START_STATUS + 1)
00369 #define APR_INPARENT (APR_OS_START_STATUS + 2)
00371 #define APR_DETACH (APR_OS_START_STATUS + 3)
00373 #define APR_NOTDETACH (APR_OS_START_STATUS + 4)
00375 #define APR_CHILD_DONE (APR_OS_START_STATUS + 5)
00377 #define APR_CHILD_NOTDONE (APR_OS_START_STATUS + 6)
00379 #define APR_TIMEUP (APR_OS_START_STATUS + 7)
00381 #define APR_INCOMPLETE (APR_OS_START_STATUS + 8)
00382
00383
00384
00386 #define APR_BADCH (APR_OS_START_STATUS + 12)
00388 #define APR_BADARG (APR_OS_START_STATUS + 13)
00390 #define APR_EOF (APR_OS_START_STATUS + 14)
00392 #define APR_NOTFOUND (APR_OS_START_STATUS + 15)
00393
00394
00395
00397 #define APR_ANONYMOUS (APR_OS_START_STATUS + 19)
00399 #define APR_FILEBASED (APR_OS_START_STATUS + 20)
00401 #define APR_KEYBASED (APR_OS_START_STATUS + 21)
00403 #define APR_EINIT (APR_OS_START_STATUS + 22)
00405 #define APR_ENOTIMPL (APR_OS_START_STATUS + 23)
00407 #define APR_EMISMATCH (APR_OS_START_STATUS + 24)
00409 #define APR_EBUSY (APR_OS_START_STATUS + 25)
00421 #define APR_STATUS_IS_INCHILD(s) ((s) == APR_INCHILD)
00428 #define APR_STATUS_IS_INPARENT(s) ((s) == APR_INPARENT)
00435 #define APR_STATUS_IS_DETACH(s) ((s) == APR_DETACH)
00442 #define APR_STATUS_IS_NOTDETACH(s) ((s) == APR_NOTDETACH)
00449 #define APR_STATUS_IS_CHILD_DONE(s) ((s) == APR_CHILD_DONE)
00456 #define APR_STATUS_IS_CHILD_NOTDONE(s) ((s) == APR_CHILD_NOTDONE)
00463 #define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP)
00471 #define APR_STATUS_IS_INCOMPLETE(s) ((s) == APR_INCOMPLETE)
00472
00473
00474
00481 #define APR_STATUS_IS_BADCH(s) ((s) == APR_BADCH)
00489 #define APR_STATUS_IS_BADARG(s) ((s) == APR_BADARG)
00496 #define APR_STATUS_IS_EOF(s) ((s) == APR_EOF)
00503 #define APR_STATUS_IS_NOTFOUND(s) ((s) == APR_NOTFOUND)
00504
00505
00506
00513 #define APR_STATUS_IS_ANONYMOUS(s) ((s) == APR_ANONYMOUS)
00520 #define APR_STATUS_IS_FILEBASED(s) ((s) == APR_FILEBASED)
00527 #define APR_STATUS_IS_KEYBASED(s) ((s) == APR_KEYBASED)
00535 #define APR_STATUS_IS_EINIT(s) ((s) == APR_EINIT)
00544 #define APR_STATUS_IS_ENOTIMPL(s) ((s) == APR_ENOTIMPL)
00551 #define APR_STATUS_IS_EMISMATCH(s) ((s) == APR_EMISMATCH)
00557 #define APR_STATUS_IS_EBUSY(s) ((s) == APR_EBUSY)
00558
00565
00567 #ifdef EACCES
00568 #define APR_EACCES EACCES
00569 #else
00570 #define APR_EACCES (APR_OS_START_CANONERR + 1)
00571 #endif
00572
00574 #ifdef EEXIST
00575 #define APR_EEXIST EEXIST
00576 #else
00577 #define APR_EEXIST (APR_OS_START_CANONERR + 2)
00578 #endif
00579
00581 #ifdef ENAMETOOLONG
00582 #define APR_ENAMETOOLONG ENAMETOOLONG
00583 #else
00584 #define APR_ENAMETOOLONG (APR_OS_START_CANONERR + 3)
00585 #endif
00586
00588 #ifdef ENOENT
00589 #define APR_ENOENT ENOENT
00590 #else
00591 #define APR_ENOENT (APR_OS_START_CANONERR + 4)
00592 #endif
00593
00595 #ifdef ENOTDIR
00596 #define APR_ENOTDIR ENOTDIR
00597 #else
00598 #define APR_ENOTDIR (APR_OS_START_CANONERR + 5)
00599 #endif
00600
00602 #ifdef ENOSPC
00603 #define APR_ENOSPC ENOSPC
00604 #else
00605 #define APR_ENOSPC (APR_OS_START_CANONERR + 6)
00606 #endif
00607
00609 #ifdef ENOMEM
00610 #define APR_ENOMEM ENOMEM
00611 #else
00612 #define APR_ENOMEM (APR_OS_START_CANONERR + 7)
00613 #endif
00614
00616 #ifdef EMFILE
00617 #define APR_EMFILE EMFILE
00618 #else
00619 #define APR_EMFILE (APR_OS_START_CANONERR + 8)
00620 #endif
00621
00623 #ifdef ENFILE
00624 #define APR_ENFILE ENFILE
00625 #else
00626 #define APR_ENFILE (APR_OS_START_CANONERR + 9)
00627 #endif
00628
00630 #ifdef EBADF
00631 #define APR_EBADF EBADF
00632 #else
00633 #define APR_EBADF (APR_OS_START_CANONERR + 10)
00634 #endif
00635
00637 #ifdef EINVAL
00638 #define APR_EINVAL EINVAL
00639 #else
00640 #define APR_EINVAL (APR_OS_START_CANONERR + 11)
00641 #endif
00642
00644 #ifdef ESPIPE
00645 #define APR_ESPIPE ESPIPE
00646 #else
00647 #define APR_ESPIPE (APR_OS_START_CANONERR + 12)
00648 #endif
00649
00654 #ifdef EAGAIN
00655 #define APR_EAGAIN EAGAIN
00656 #elif defined(EWOULDBLOCK)
00657 #define APR_EAGAIN EWOULDBLOCK
00658 #else
00659 #define APR_EAGAIN (APR_OS_START_CANONERR + 13)
00660 #endif
00661
00663 #ifdef EINTR
00664 #define APR_EINTR EINTR
00665 #else
00666 #define APR_EINTR (APR_OS_START_CANONERR + 14)
00667 #endif
00668
00670 #ifdef ENOTSOCK
00671 #define APR_ENOTSOCK ENOTSOCK
00672 #else
00673 #define APR_ENOTSOCK (APR_OS_START_CANONERR + 15)
00674 #endif
00675
00677 #ifdef ECONNREFUSED
00678 #define APR_ECONNREFUSED ECONNREFUSED
00679 #else
00680 #define APR_ECONNREFUSED (APR_OS_START_CANONERR + 16)
00681 #endif
00682
00684 #ifdef EINPROGRESS
00685 #define APR_EINPROGRESS EINPROGRESS
00686 #else
00687 #define APR_EINPROGRESS (APR_OS_START_CANONERR + 17)
00688 #endif
00689
00695 #ifdef ECONNABORTED
00696 #define APR_ECONNABORTED ECONNABORTED
00697 #else
00698 #define APR_ECONNABORTED (APR_OS_START_CANONERR + 18)
00699 #endif
00700
00702 #ifdef ECONNRESET
00703 #define APR_ECONNRESET ECONNRESET
00704 #else
00705 #define APR_ECONNRESET (APR_OS_START_CANONERR + 19)
00706 #endif
00707
00709 #ifdef ETIMEDOUT
00710 #define APR_ETIMEDOUT ETIMEDOUT
00711 #else
00712 #define APR_ETIMEDOUT (APR_OS_START_CANONERR + 20)
00713 #endif
00714
00716 #ifdef EHOSTUNREACH
00717 #define APR_EHOSTUNREACH EHOSTUNREACH
00718 #else
00719 #define APR_EHOSTUNREACH (APR_OS_START_CANONERR + 21)
00720 #endif
00721
00723 #ifdef ENETUNREACH
00724 #define APR_ENETUNREACH ENETUNREACH
00725 #else
00726 #define APR_ENETUNREACH (APR_OS_START_CANONERR + 22)
00727 #endif
00728
00730 #ifdef EFTYPE
00731 #define APR_EFTYPE EFTYPE
00732 #else
00733 #define APR_EFTYPE (APR_OS_START_CANONERR + 23)
00734 #endif
00735
00737 #ifdef EPIPE
00738 #define APR_EPIPE EPIPE
00739 #else
00740 #define APR_EPIPE (APR_OS_START_CANONERR + 24)
00741 #endif
00742
00744 #ifdef EXDEV
00745 #define APR_EXDEV EXDEV
00746 #else
00747 #define APR_EXDEV (APR_OS_START_CANONERR + 25)
00748 #endif
00749
00751 #ifdef ENOTEMPTY
00752 #define APR_ENOTEMPTY ENOTEMPTY
00753 #else
00754 #define APR_ENOTEMPTY (APR_OS_START_CANONERR + 26)
00755 #endif
00756
00759 #if defined(OS2) && !defined(DOXYGEN)
00760
00761 #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR)
00762 #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR)
00763
00764 #define INCL_DOSERRORS
00765 #define INCL_DOS
00766
00767
00768
00769
00770
00771
00772
00773
00774
00775
00776
00777
00778 #define apr_get_netos_error() (APR_FROM_OS_ERROR(errno))
00779 #define apr_set_netos_error(e) (errno = APR_TO_OS_ERROR(e))
00780
00781
00782
00783 #define APR_OS2_STATUS(e) (APR_FROM_OS_ERROR(e))
00784
00785 #define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS \
00786 || (s) == APR_OS_START_SYSERR + NO_ERROR)
00787
00788
00789
00790
00791 #define SOCBASEERR 10000
00792 #define SOCEPERM (SOCBASEERR+1)
00793 #define SOCESRCH (SOCBASEERR+3)
00794 #define SOCEINTR (SOCBASEERR+4)
00795 #define SOCENXIO (SOCBASEERR+6)
00796 #define SOCEBADF (SOCBASEERR+9)
00797 #define SOCEACCES (SOCBASEERR+13)
00798 #define SOCEFAULT (SOCBASEERR+14)
00799 #define SOCEINVAL (SOCBASEERR+22)
00800 #define SOCEMFILE (SOCBASEERR+24)
00801 #define SOCEPIPE (SOCBASEERR+32)
00802 #define SOCEOS2ERR (SOCBASEERR+100)
00803 #define SOCEWOULDBLOCK (SOCBASEERR+35)
00804 #define SOCEINPROGRESS (SOCBASEERR+36)
00805 #define SOCEALREADY (SOCBASEERR+37)
00806 #define SOCENOTSOCK (SOCBASEERR+38)
00807 #define SOCEDESTADDRREQ (SOCBASEERR+39)
00808 #define SOCEMSGSIZE (SOCBASEERR+40)
00809 #define SOCEPROTOTYPE (SOCBASEERR+41)
00810 #define SOCENOPROTOOPT (SOCBASEERR+42)
00811 #define SOCEPROTONOSUPPORT (SOCBASEERR+43)
00812 #define SOCESOCKTNOSUPPORT (SOCBASEERR+44)
00813 #define SOCEOPNOTSUPP (SOCBASEERR+45)
00814 #define SOCEPFNOSUPPORT (SOCBASEERR+46)
00815 #define SOCEAFNOSUPPORT (SOCBASEERR+47)
00816 #define SOCEADDRINUSE (SOCBASEERR+48)
00817 #define SOCEADDRNOTAVAIL (SOCBASEERR+49)
00818 #define SOCENETDOWN (SOCBASEERR+50)
00819 #define SOCENETUNREACH (SOCBASEERR+51)
00820 #define SOCENETRESET (SOCBASEERR+52)
00821 #define SOCECONNABORTED (SOCBASEERR+53)
00822 #define SOCECONNRESET (SOCBASEERR+54)
00823 #define SOCENOBUFS (SOCBASEERR+55)
00824 #define SOCEISCONN (SOCBASEERR+56)
00825 #define SOCENOTCONN (SOCBASEERR+57)
00826 #define SOCESHUTDOWN (SOCBASEERR+58)
00827 #define SOCETOOMANYREFS (SOCBASEERR+59)
00828 #define SOCETIMEDOUT (SOCBASEERR+60)
00829 #define SOCECONNREFUSED (SOCBASEERR+61)
00830 #define SOCELOOP (SOCBASEERR+62)
00831 #define SOCENAMETOOLONG (SOCBASEERR+63)
00832 #define SOCEHOSTDOWN (SOCBASEERR+64)
00833 #define SOCEHOSTUNREACH (SOCBASEERR+65)
00834 #define SOCENOTEMPTY (SOCBASEERR+66)
00835
00836
00837 #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES \
00838 || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED \
00839 || (s) == APR_OS_START_SYSERR + ERROR_SHARING_VIOLATION)
00840 #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST \
00841 || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED \
00842 || (s) == APR_OS_START_SYSERR + ERROR_FILE_EXISTS \
00843 || (s) == APR_OS_START_SYSERR + ERROR_ALREADY_EXISTS \
00844 || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED)
00845 #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG \
00846 || (s) == APR_OS_START_SYSERR + ERROR_FILENAME_EXCED_RANGE \
00847 || (s) == APR_OS_START_SYSERR + SOCENAMETOOLONG)
00848 #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \
00849 || (s) == APR_OS_START_SYSERR + ERROR_FILE_NOT_FOUND \
00850 || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \
00851 || (s) == APR_OS_START_SYSERR + ERROR_NO_MORE_FILES \
00852 || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED)
00853 #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR)
00854 #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC \
00855 || (s) == APR_OS_START_SYSERR + ERROR_DISK_FULL)
00856 #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM)
00857 #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE \
00858 || (s) == APR_OS_START_SYSERR + ERROR_TOO_MANY_OPEN_FILES)
00859 #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE)
00860 #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF \
00861 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_HANDLE)
00862 #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL \
00863 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_PARAMETER \
00864 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_FUNCTION)
00865 #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE \
00866 || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK)
00867 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \
00868 || (s) == APR_OS_START_SYSERR + ERROR_NO_DATA \
00869 || (s) == APR_OS_START_SYSERR + SOCEWOULDBLOCK \
00870 || (s) == APR_OS_START_SYSERR + ERROR_LOCK_VIOLATION)
00871 #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \
00872 || (s) == APR_OS_START_SYSERR + SOCEINTR)
00873 #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \
00874 || (s) == APR_OS_START_SYSERR + SOCENOTSOCK)
00875 #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED \
00876 || (s) == APR_OS_START_SYSERR + SOCECONNREFUSED)
00877 #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \
00878 || (s) == APR_OS_START_SYSERR + SOCEINPROGRESS)
00879 #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \
00880 || (s) == APR_OS_START_SYSERR + SOCECONNABORTED)
00881 #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \
00882 || (s) == APR_OS_START_SYSERR + SOCECONNRESET)
00883 #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \
00884 || (s) == APR_OS_START_SYSERR + SOCETIMEDOUT)
00885 #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \
00886 || (s) == APR_OS_START_SYSERR + SOCEHOSTUNREACH)
00887 #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH \
00888 || (s) == APR_OS_START_SYSERR + SOCENETUNREACH)
00889 #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE)
00890 #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE \
00891 || (s) == APR_OS_START_SYSERR + ERROR_BROKEN_PIPE \
00892 || (s) == APR_OS_START_SYSERR + SOCEPIPE)
00893 #define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV \
00894 || (s) == APR_OS_START_SYSERR + ERROR_NOT_SAME_DEVICE)
00895 #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY \
00896 || (s) == APR_OS_START_SYSERR + ERROR_DIR_NOT_EMPTY \
00897 || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED)
00898
00899
00900
00901
00902
00903
00904
00905
00906
00907
00908
00909
00910
00911
00912
00913
00914
00915
00916
00917
00918
00919
00920
00921
00922
00923
00924
00925
00926
00927
00928
00929 #elif defined(WIN32) && !defined(DOXYGEN)
00930
00931 #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR)
00932 #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR)
00933
00934 #define apr_get_os_error() (APR_FROM_OS_ERROR(GetLastError()))
00935 #define apr_set_os_error(e) (SetLastError(APR_TO_OS_ERROR(e)))
00936
00937
00938
00939 #define apr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError()))
00940 #define apr_set_netos_error(e) (WSASetLastError(APR_TO_OS_ERROR(e)))
00941
00942 #define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS \
00943 || (s) == APR_OS_START_SYSERR + ERROR_SUCCESS)
00944
00945
00946 #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES \
00947 || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED \
00948 || (s) == APR_OS_START_SYSERR + ERROR_CANNOT_MAKE \
00949 || (s) == APR_OS_START_SYSERR + ERROR_CURRENT_DIRECTORY \
00950 || (s) == APR_OS_START_SYSERR + ERROR_DRIVE_LOCKED \
00951 || (s) == APR_OS_START_SYSERR + ERROR_FAIL_I24 \
00952 || (s) == APR_OS_START_SYSERR + ERROR_LOCK_VIOLATION \
00953 || (s) == APR_OS_START_SYSERR + ERROR_LOCK_FAILED \
00954 || (s) == APR_OS_START_SYSERR + ERROR_NOT_LOCKED \
00955 || (s) == APR_OS_START_SYSERR + ERROR_NETWORK_ACCESS_DENIED \
00956 || (s) == APR_OS_START_SYSERR + ERROR_SHARING_VIOLATION)
00957 #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST \
00958 || (s) == APR_OS_START_SYSERR + ERROR_FILE_EXISTS \
00959 || (s) == APR_OS_START_SYSERR + ERROR_ALREADY_EXISTS)
00960 #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG \
00961 || (s) == APR_OS_START_SYSERR + ERROR_FILENAME_EXCED_RANGE \
00962 || (s) == APR_OS_START_SYSERR + WSAENAMETOOLONG)
00963 #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \
00964 || (s) == APR_OS_START_SYSERR + ERROR_FILE_NOT_FOUND \
00965 || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \
00966 || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED \
00967 || (s) == APR_OS_START_SYSERR + ERROR_NO_MORE_FILES)
00968 #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR \
00969 || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \
00970 || (s) == APR_OS_START_SYSERR + ERROR_BAD_NETPATH \
00971 || (s) == APR_OS_START_SYSERR + ERROR_BAD_NET_NAME \
00972 || (s) == APR_OS_START_SYSERR + ERROR_BAD_PATHNAME \
00973 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_DRIVE)
00974 #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC \
00975 || (s) == APR_OS_START_SYSERR + ERROR_DISK_FULL)
00976 #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM \
00977 || (s) == APR_OS_START_SYSERR + ERROR_ARENA_TRASHED \
00978 || (s) == APR_OS_START_SYSERR + ERROR_NOT_ENOUGH_MEMORY \
00979 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_BLOCK \
00980 || (s) == APR_OS_START_SYSERR + ERROR_NOT_ENOUGH_QUOTA \
00981 || (s) == APR_OS_START_SYSERR + ERROR_OUTOFMEMORY)
00982 #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE \
00983 || (s) == APR_OS_START_SYSERR + ERROR_TOO_MANY_OPEN_FILES)
00984 #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE)
00985 #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF \
00986 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_HANDLE \
00987 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_TARGET_HANDLE)
00988 #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL \
00989 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_ACCESS \
00990 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_DATA \
00991 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_FUNCTION \
00992 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_HANDLE \
00993 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_PARAMETER \
00994 || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK)
00995 #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE \
00996 || (s) == APR_OS_START_SYSERR + ERROR_SEEK_ON_DEVICE \
00997 || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK)
00998 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \
00999 || (s) == APR_OS_START_SYSERR + ERROR_NO_DATA \
01000 || (s) == APR_OS_START_SYSERR + ERROR_NO_PROC_SLOTS \
01001 || (s) == APR_OS_START_SYSERR + ERROR_NESTING_NOT_ALLOWED \
01002 || (s) == APR_OS_START_SYSERR + ERROR_MAX_THRDS_REACHED \
01003 || (s) == APR_OS_START_SYSERR + ERROR_LOCK_VIOLATION \
01004 || (s) == APR_OS_START_SYSERR + WSAEWOULDBLOCK)
01005 #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \
01006 || (s) == APR_OS_START_SYSERR + WSAEINTR)
01007 #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \
01008 || (s) == APR_OS_START_SYSERR + WSAENOTSOCK)
01009 #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED \
01010 || (s) == APR_OS_START_SYSERR + WSAECONNREFUSED)
01011 #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \
01012 || (s) == APR_OS_START_SYSERR + WSAEINPROGRESS)
01013 #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \
01014 || (s) == APR_OS_START_SYSERR + WSAECONNABORTED)
01015 #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \
01016 || (s) == APR_OS_START_SYSERR + ERROR_NETNAME_DELETED \
01017 || (s) == APR_OS_START_SYSERR + WSAECONNRESET)
01018 #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \
01019 || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \
01020 || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT)
01021 #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \
01022 || (s) == APR_OS_START_SYSERR + WSAEHOSTUNREACH)
01023 #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH \
01024 || (s) == APR_OS_START_SYSERR + WSAENETUNREACH)
01025 #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE \
01026 || (s) == APR_OS_START_SYSERR + ERROR_EXE_MACHINE_TYPE_MISMATCH \
01027 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_DLL \
01028 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_MODULETYPE \
01029 || (s) == APR_OS_START_SYSERR + ERROR_BAD_EXE_FORMAT \
01030 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_EXE_SIGNATURE \
01031 || (s) == APR_OS_START_SYSERR + ERROR_FILE_CORRUPT \
01032 || (s) == APR_OS_START_SYSERR + ERROR_BAD_FORMAT)
01033 #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE \
01034 || (s) == APR_OS_START_SYSERR + ERROR_BROKEN_PIPE)
01035 #define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV \
01036 || (s) == APR_OS_START_SYSERR + ERROR_NOT_SAME_DEVICE)
01037 #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY \
01038 || (s) == APR_OS_START_SYSERR + ERROR_DIR_NOT_EMPTY)
01039
01040 #elif defined(NETWARE) && !defined(DOXYGEN)
01041
01042 #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR)
01043 #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR)
01044
01045 #define apr_get_os_error() (errno)
01046 #define apr_set_os_error(e) (errno = (e))
01047
01048
01049 #define apr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError()))
01050 #define apr_set_netos_error(e) (WSASetLastError(APR_TO_OS_ERROR(e)))
01051
01052 #define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS)
01053
01054
01055 #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES)
01056 #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST)
01057 #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG)
01058 #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT)
01059 #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR)
01060 #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC)
01061 #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM)
01062 #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE)
01063 #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE)
01064 #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF)
01065 #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL)
01066 #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE)
01067
01068 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \
01069 || (s) == EWOULDBLOCK \
01070 || (s) == APR_OS_START_SYSERR + WSAEWOULDBLOCK)
01071 #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \
01072 || (s) == APR_OS_START_SYSERR + WSAEINTR)
01073 #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \
01074 || (s) == APR_OS_START_SYSERR + WSAENOTSOCK)
01075 #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED \
01076 || (s) == APR_OS_START_SYSERR + WSAECONNREFUSED)
01077 #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \
01078 || (s) == APR_OS_START_SYSERR + WSAEINPROGRESS)
01079 #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \
01080 || (s) == APR_OS_START_SYSERR + WSAECONNABORTED)
01081 #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \
01082 || (s) == APR_OS_START_SYSERR + WSAECONNRESET)
01083 #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \
01084 || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \
01085 || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT)
01086 #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \
01087 || (s) == APR_OS_START_SYSERR + WSAEHOSTUNREACH)
01088 #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH \
01089 || (s) == APR_OS_START_SYSERR + WSAENETUNREACH)
01090 #define APR_STATUS_IS_ENETDOWN(s) ((s) == APR_OS_START_SYSERR + WSAENETDOWN)
01091 #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE)
01092 #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE)
01093 #define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV)
01094 #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY)
01095
01096 #else
01097
01098
01099
01100
01101 #define APR_FROM_OS_ERROR(e) (e)
01102 #define APR_TO_OS_ERROR(e) (e)
01103
01104 #define apr_get_os_error() (errno)
01105 #define apr_set_os_error(e) (errno = (e))
01106
01107
01108
01109 #define apr_get_netos_error() (errno)
01110 #define apr_set_netos_error(e) (errno = (e))
01118 #define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS)
01119
01121 #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES)
01123 #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST)
01125 #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG)
01132 #ifdef EMVSCATLG
01133 #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \
01134 || (s) == EMVSCATLG)
01135 #else
01136 #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT)
01137 #endif
01139 #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR)
01141 #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC)
01143 #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM)
01145 #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE)
01147 #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE)
01149 #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF)
01151 #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL)
01153 #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE)
01154
01156 #if !defined(EWOULDBLOCK) || !defined(EAGAIN)
01157 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN)
01158 #elif (EWOULDBLOCK == EAGAIN)
01159 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN)
01160 #else
01161 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \
01162 || (s) == EWOULDBLOCK)
01163 #endif
01164
01166 #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR)
01168 #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK)
01170 #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED)
01172 #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS)
01173
01185 #ifdef EPROTO
01186 #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \
01187 || (s) == EPROTO)
01188 #else
01189 #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED)
01190 #endif
01191
01193 #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET)
01195 #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT)
01197 #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH)
01199 #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH)
01201 #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE)
01203 #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE)
01205 #define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV)
01207 #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY || \
01208 (s) == APR_EEXIST)
01211 #endif
01212
01215 #ifdef __cplusplus
01216 }
01217 #endif
01218
01219 #endif