00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 #ifndef APR_ERRNO_H
00056 #define APR_ERRNO_H
00057
00063 #include "apr.h"
00064
00065 #if APR_HAVE_ERRNO_H
00066 #include <errno.h>
00067 #endif
00068
00069 #ifdef __cplusplus
00070 extern "C" {
00071 #endif
00072
00082 typedef int apr_status_t;
00083
00090 APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
00091 apr_size_t bufsize);
00092
00093 #if defined(DOXYGEN)
00094
00102 #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR)
00103
00113 #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR)
00114
00150 #endif
00151
00155 #define APR_OS_START_ERROR 20000
00156
00161 #define APR_OS_ERRSPACE_SIZE 50000
00162
00165 #define APR_OS_START_STATUS (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
00166
00173 #define APR_OS_START_USERERR (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
00174
00178 #define APR_OS_START_USEERR APR_OS_START_USERERR
00179
00183 #define APR_OS_START_CANONERR (APR_OS_START_USERERR \
00184 + (APR_OS_ERRSPACE_SIZE * 10))
00185
00189 #define APR_OS_START_EAIERR (APR_OS_START_CANONERR + APR_OS_ERRSPACE_SIZE)
00190
00194 #define APR_OS_START_SYSERR (APR_OS_START_EAIERR + APR_OS_ERRSPACE_SIZE)
00195
00197 #define APR_SUCCESS 0
00198
00259 #define APR_ENOSTAT (APR_OS_START_ERROR + 1)
00260
00261 #define APR_ENOPOOL (APR_OS_START_ERROR + 2)
00262
00264 #define APR_EBADDATE (APR_OS_START_ERROR + 4)
00265
00266 #define APR_EINVALSOCK (APR_OS_START_ERROR + 5)
00267
00268 #define APR_ENOPROC (APR_OS_START_ERROR + 6)
00269
00270 #define APR_ENOTIME (APR_OS_START_ERROR + 7)
00271
00272 #define APR_ENODIR (APR_OS_START_ERROR + 8)
00273
00274 #define APR_ENOLOCK (APR_OS_START_ERROR + 9)
00275
00276 #define APR_ENOPOLL (APR_OS_START_ERROR + 10)
00277
00278 #define APR_ENOSOCKET (APR_OS_START_ERROR + 11)
00279
00280 #define APR_ENOTHREAD (APR_OS_START_ERROR + 12)
00281
00282 #define APR_ENOTHDKEY (APR_OS_START_ERROR + 13)
00283
00284 #define APR_EGENERAL (APR_OS_START_ERROR + 14)
00285
00286 #define APR_ENOSHMAVAIL (APR_OS_START_ERROR + 15)
00287
00288 #define APR_EBADIP (APR_OS_START_ERROR + 16)
00289
00290 #define APR_EBADMASK (APR_OS_START_ERROR + 17)
00291
00293 #define APR_EDSOOPEN (APR_OS_START_ERROR + 19)
00294
00295 #define APR_EABSOLUTE (APR_OS_START_ERROR + 20)
00296
00297 #define APR_ERELATIVE (APR_OS_START_ERROR + 21)
00298
00299 #define APR_EINCOMPLETE (APR_OS_START_ERROR + 22)
00300
00301 #define APR_EABOVEROOT (APR_OS_START_ERROR + 23)
00302
00303 #define APR_EBADPATH (APR_OS_START_ERROR + 24)
00304
00305 #define APR_EPATHWILD (APR_OS_START_ERROR + 25)
00306
00307 #define APR_ESYMNOTFOUND (APR_OS_START_ERROR + 26)
00308
00309 #define APR_EPROC_UNKNOWN (APR_OS_START_ERROR + 27)
00310
00328 #define APR_STATUS_IS_ENOSTAT(s) ((s) == APR_ENOSTAT)
00329
00334 #define APR_STATUS_IS_ENOPOOL(s) ((s) == APR_ENOPOOL)
00335
00336 #define APR_STATUS_IS_EBADDATE(s) ((s) == APR_EBADDATE)
00337
00338 #define APR_STATUS_IS_EINVALSOCK(s) ((s) == APR_EINVALSOCK)
00339
00340 #define APR_STATUS_IS_ENOPROC(s) ((s) == APR_ENOPROC)
00341
00342 #define APR_STATUS_IS_ENOTIME(s) ((s) == APR_ENOTIME)
00343
00344 #define APR_STATUS_IS_ENODIR(s) ((s) == APR_ENODIR)
00345
00346 #define APR_STATUS_IS_ENOLOCK(s) ((s) == APR_ENOLOCK)
00347
00348 #define APR_STATUS_IS_ENOPOLL(s) ((s) == APR_ENOPOLL)
00349
00350 #define APR_STATUS_IS_ENOSOCKET(s) ((s) == APR_ENOSOCKET)
00351
00352 #define APR_STATUS_IS_ENOTHREAD(s) ((s) == APR_ENOTHREAD)
00353
00354 #define APR_STATUS_IS_ENOTHDKEY(s) ((s) == APR_ENOTHDKEY)
00355
00356 #define APR_STATUS_IS_EGENERAL(s) ((s) == APR_EGENERAL)
00357
00358 #define APR_STATUS_IS_ENOSHMAVAIL(s) ((s) == APR_ENOSHMAVAIL)
00359
00360 #define APR_STATUS_IS_EBADIP(s) ((s) == APR_EBADIP)
00361
00362 #define APR_STATUS_IS_EBADMASK(s) ((s) == APR_EBADMASK)
00363
00368 #if defined(WIN32)
00369 #define APR_STATUS_IS_EDSOOPEN(s) ((s) == APR_EDSOOPEN \
00370 || APR_TO_OS_ERROR(s) == ERROR_MOD_NOT_FOUND)
00371 #else
00372 #define APR_STATUS_IS_EDSOOPEN(s) ((s) == APR_EDSOOPEN)
00373 #endif
00374
00375 #define APR_STATUS_IS_EABSOLUTE(s) ((s) == APR_EABSOLUTE)
00376
00377 #define APR_STATUS_IS_ERELATIVE(s) ((s) == APR_ERELATIVE)
00378
00379 #define APR_STATUS_IS_EINCOMPLETE(s) ((s) == APR_EINCOMPLETE)
00380
00381 #define APR_STATUS_IS_EABOVEROOT(s) ((s) == APR_EABOVEROOT)
00382
00383 #define APR_STATUS_IS_EBADPATH(s) ((s) == APR_EBADPATH)
00384
00385 #define APR_STATUS_IS_EPATHWILD(s) ((s) == APR_EPATHWILD)
00386
00389 #if defined(WIN32)
00390 #define APR_STATUS_IS_ESYMNOTFOUND(s) ((s) == APR_ESYMNOTFOUND \
00391 || APR_TO_OS_ERROR(s) == ERROR_PROC_NOT_FOUND)
00392 #else
00393 #define APR_STATUS_IS_ESYMNOTFOUND(s) ((s) == APR_ESYMNOTFOUND)
00394 #endif
00395
00396 #define APR_STATUS_IS_EPROC_UNKNOWN(s) ((s) == APR_EPROC_UNKNOWN)
00397
00405 #define APR_INCHILD (APR_OS_START_STATUS + 1)
00406
00407 #define APR_INPARENT (APR_OS_START_STATUS + 2)
00408
00409 #define APR_DETACH (APR_OS_START_STATUS + 3)
00410
00411 #define APR_NOTDETACH (APR_OS_START_STATUS + 4)
00412
00413 #define APR_CHILD_DONE (APR_OS_START_STATUS + 5)
00414
00415 #define APR_CHILD_NOTDONE (APR_OS_START_STATUS + 6)
00416
00417 #define APR_TIMEUP (APR_OS_START_STATUS + 7)
00418
00419 #define APR_INCOMPLETE (APR_OS_START_STATUS + 8)
00420
00421
00422
00424 #define APR_BADCH (APR_OS_START_STATUS + 12)
00425
00426 #define APR_BADARG (APR_OS_START_STATUS + 13)
00427
00428 #define APR_EOF (APR_OS_START_STATUS + 14)
00429
00430 #define APR_NOTFOUND (APR_OS_START_STATUS + 15)
00431
00432
00433
00435 #define APR_ANONYMOUS (APR_OS_START_STATUS + 19)
00436
00437 #define APR_FILEBASED (APR_OS_START_STATUS + 20)
00438
00439 #define APR_KEYBASED (APR_OS_START_STATUS + 21)
00440
00441 #define APR_EINIT (APR_OS_START_STATUS + 22)
00442
00443 #define APR_ENOTIMPL (APR_OS_START_STATUS + 23)
00444
00445 #define APR_EMISMATCH (APR_OS_START_STATUS + 24)
00446
00447 #define APR_EBUSY (APR_OS_START_STATUS + 25)
00448
00459 #define APR_STATUS_IS_INCHILD(s) ((s) == APR_INCHILD)
00460
00466 #define APR_STATUS_IS_INPARENT(s) ((s) == APR_INPARENT)
00467
00473 #define APR_STATUS_IS_DETACH(s) ((s) == APR_DETACH)
00474
00480 #define APR_STATUS_IS_NOTDETACH(s) ((s) == APR_NOTDETACH)
00481
00487 #define APR_STATUS_IS_CHILD_DONE(s) ((s) == APR_CHILD_DONE)
00488
00494 #define APR_STATUS_IS_CHILD_NOTDONE(s) ((s) == APR_CHILD_NOTDONE)
00495
00501 #define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP)
00502
00509 #define APR_STATUS_IS_INCOMPLETE(s) ((s) == APR_INCOMPLETE)
00510
00511
00512
00519 #define APR_STATUS_IS_BADCH(s) ((s) == APR_BADCH)
00520
00527 #define APR_STATUS_IS_BADARG(s) ((s) == APR_BADARG)
00528
00534 #define APR_STATUS_IS_EOF(s) ((s) == APR_EOF)
00535
00541 #define APR_STATUS_IS_NOTFOUND(s) ((s) == APR_NOTFOUND)
00542
00543
00544
00551 #define APR_STATUS_IS_ANONYMOUS(s) ((s) == APR_ANONYMOUS)
00552
00558 #define APR_STATUS_IS_FILEBASED(s) ((s) == APR_FILEBASED)
00559
00565 #define APR_STATUS_IS_KEYBASED(s) ((s) == APR_KEYBASED)
00566
00573 #define APR_STATUS_IS_EINIT(s) ((s) == APR_EINIT)
00574
00582 #define APR_STATUS_IS_ENOTIMPL(s) ((s) == APR_ENOTIMPL)
00583
00589 #define APR_STATUS_IS_EMISMATCH(s) ((s) == APR_EMISMATCH)
00590
00595 #define APR_STATUS_IS_EBUSY(s) ((s) == APR_EBUSY)
00596
00603
00605 #ifdef EACCES
00606 #define APR_EACCES EACCES
00607 #else
00608 #define APR_EACCES (APR_OS_START_CANONERR + 1)
00609 #endif
00610
00612 #ifdef EEXIST
00613 #define APR_EEXIST EEXIST
00614 #else
00615 #define APR_EEXIST (APR_OS_START_CANONERR + 2)
00616 #endif
00617
00619 #ifdef ENAMETOOLONG
00620 #define APR_ENAMETOOLONG ENAMETOOLONG
00621 #else
00622 #define APR_ENAMETOOLONG (APR_OS_START_CANONERR + 3)
00623 #endif
00624
00626 #ifdef ENOENT
00627 #define APR_ENOENT ENOENT
00628 #else
00629 #define APR_ENOENT (APR_OS_START_CANONERR + 4)
00630 #endif
00631
00633 #ifdef ENOTDIR
00634 #define APR_ENOTDIR ENOTDIR
00635 #else
00636 #define APR_ENOTDIR (APR_OS_START_CANONERR + 5)
00637 #endif
00638
00640 #ifdef ENOSPC
00641 #define APR_ENOSPC ENOSPC
00642 #else
00643 #define APR_ENOSPC (APR_OS_START_CANONERR + 6)
00644 #endif
00645
00647 #ifdef ENOMEM
00648 #define APR_ENOMEM ENOMEM
00649 #else
00650 #define APR_ENOMEM (APR_OS_START_CANONERR + 7)
00651 #endif
00652
00654 #ifdef EMFILE
00655 #define APR_EMFILE EMFILE
00656 #else
00657 #define APR_EMFILE (APR_OS_START_CANONERR + 8)
00658 #endif
00659
00661 #ifdef ENFILE
00662 #define APR_ENFILE ENFILE
00663 #else
00664 #define APR_ENFILE (APR_OS_START_CANONERR + 9)
00665 #endif
00666
00668 #ifdef EBADF
00669 #define APR_EBADF EBADF
00670 #else
00671 #define APR_EBADF (APR_OS_START_CANONERR + 10)
00672 #endif
00673
00675 #ifdef EINVAL
00676 #define APR_EINVAL EINVAL
00677 #else
00678 #define APR_EINVAL (APR_OS_START_CANONERR + 11)
00679 #endif
00680
00682 #ifdef ESPIPE
00683 #define APR_ESPIPE ESPIPE
00684 #else
00685 #define APR_ESPIPE (APR_OS_START_CANONERR + 12)
00686 #endif
00687
00692 #ifdef EAGAIN
00693 #define APR_EAGAIN EAGAIN
00694 #elif defined(EWOULDBLOCK)
00695 #define APR_EAGAIN EWOULDBLOCK
00696 #else
00697 #define APR_EAGAIN (APR_OS_START_CANONERR + 13)
00698 #endif
00699
00701 #ifdef EINTR
00702 #define APR_EINTR EINTR
00703 #else
00704 #define APR_EINTR (APR_OS_START_CANONERR + 14)
00705 #endif
00706
00708 #ifdef ENOTSOCK
00709 #define APR_ENOTSOCK ENOTSOCK
00710 #else
00711 #define APR_ENOTSOCK (APR_OS_START_CANONERR + 15)
00712 #endif
00713
00715 #ifdef ECONNREFUSED
00716 #define APR_ECONNREFUSED ECONNREFUSED
00717 #else
00718 #define APR_ECONNREFUSED (APR_OS_START_CANONERR + 16)
00719 #endif
00720
00722 #ifdef EINPROGRESS
00723 #define APR_EINPROGRESS EINPROGRESS
00724 #else
00725 #define APR_EINPROGRESS (APR_OS_START_CANONERR + 17)
00726 #endif
00727
00733 #ifdef ECONNABORTED
00734 #define APR_ECONNABORTED ECONNABORTED
00735 #else
00736 #define APR_ECONNABORTED (APR_OS_START_CANONERR + 18)
00737 #endif
00738
00740 #ifdef ECONNRESET
00741 #define APR_ECONNRESET ECONNRESET
00742 #else
00743 #define APR_ECONNRESET (APR_OS_START_CANONERR + 19)
00744 #endif
00745
00747 #ifdef ETIMEDOUT
00748 #define APR_ETIMEDOUT ETIMEDOUT
00749 #else
00750 #define APR_ETIMEDOUT (APR_OS_START_CANONERR + 20)
00751 #endif
00752
00754 #ifdef EHOSTUNREACH
00755 #define APR_EHOSTUNREACH EHOSTUNREACH
00756 #else
00757 #define APR_EHOSTUNREACH (APR_OS_START_CANONERR + 21)
00758 #endif
00759
00761 #ifdef ENETUNREACH
00762 #define APR_ENETUNREACH ENETUNREACH
00763 #else
00764 #define APR_ENETUNREACH (APR_OS_START_CANONERR + 22)
00765 #endif
00766
00768 #ifdef EFTYPE
00769 #define APR_EFTYPE EFTYPE
00770 #else
00771 #define APR_EFTYPE (APR_OS_START_CANONERR + 23)
00772 #endif
00773
00775 #ifdef EPIPE
00776 #define APR_EPIPE EPIPE
00777 #else
00778 #define APR_EPIPE (APR_OS_START_CANONERR + 24)
00779 #endif
00780
00782 #ifdef EXDEV
00783 #define APR_EXDEV EXDEV
00784 #else
00785 #define APR_EXDEV (APR_OS_START_CANONERR + 25)
00786 #endif
00787
00789 #ifdef ENOTEMPTY
00790 #define APR_ENOTEMPTY ENOTEMPTY
00791 #else
00792 #define APR_ENOTEMPTY (APR_OS_START_CANONERR + 26)
00793 #endif
00794
00797 #if defined(OS2) && !defined(DOXYGEN)
00798
00799 #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR)
00800 #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR)
00801
00802 #define INCL_DOSERRORS
00803 #define INCL_DOS
00804
00805
00806
00807
00808
00809
00810
00811
00812
00813
00814
00815
00816 #define apr_get_netos_error() (APR_FROM_OS_ERROR(errno))
00817 #define apr_set_netos_error(e) (errno = APR_TO_OS_ERROR(e))
00818
00819
00820
00821 #define APR_OS2_STATUS(e) (APR_FROM_OS_ERROR(e))
00822
00823 #define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS \
00824 || (s) == APR_OS_START_SYSERR + NO_ERROR)
00825
00826
00827
00828
00829 #define SOCBASEERR 10000
00830 #define SOCEPERM (SOCBASEERR+1)
00831 #define SOCESRCH (SOCBASEERR+3)
00832 #define SOCEINTR (SOCBASEERR+4)
00833 #define SOCENXIO (SOCBASEERR+6)
00834 #define SOCEBADF (SOCBASEERR+9)
00835 #define SOCEACCES (SOCBASEERR+13)
00836 #define SOCEFAULT (SOCBASEERR+14)
00837 #define SOCEINVAL (SOCBASEERR+22)
00838 #define SOCEMFILE (SOCBASEERR+24)
00839 #define SOCEPIPE (SOCBASEERR+32)
00840 #define SOCEOS2ERR (SOCBASEERR+100)
00841 #define SOCEWOULDBLOCK (SOCBASEERR+35)
00842 #define SOCEINPROGRESS (SOCBASEERR+36)
00843 #define SOCEALREADY (SOCBASEERR+37)
00844 #define SOCENOTSOCK (SOCBASEERR+38)
00845 #define SOCEDESTADDRREQ (SOCBASEERR+39)
00846 #define SOCEMSGSIZE (SOCBASEERR+40)
00847 #define SOCEPROTOTYPE (SOCBASEERR+41)
00848 #define SOCENOPROTOOPT (SOCBASEERR+42)
00849 #define SOCEPROTONOSUPPORT (SOCBASEERR+43)
00850 #define SOCESOCKTNOSUPPORT (SOCBASEERR+44)
00851 #define SOCEOPNOTSUPP (SOCBASEERR+45)
00852 #define SOCEPFNOSUPPORT (SOCBASEERR+46)
00853 #define SOCEAFNOSUPPORT (SOCBASEERR+47)
00854 #define SOCEADDRINUSE (SOCBASEERR+48)
00855 #define SOCEADDRNOTAVAIL (SOCBASEERR+49)
00856 #define SOCENETDOWN (SOCBASEERR+50)
00857 #define SOCENETUNREACH (SOCBASEERR+51)
00858 #define SOCENETRESET (SOCBASEERR+52)
00859 #define SOCECONNABORTED (SOCBASEERR+53)
00860 #define SOCECONNRESET (SOCBASEERR+54)
00861 #define SOCENOBUFS (SOCBASEERR+55)
00862 #define SOCEISCONN (SOCBASEERR+56)
00863 #define SOCENOTCONN (SOCBASEERR+57)
00864 #define SOCESHUTDOWN (SOCBASEERR+58)
00865 #define SOCETOOMANYREFS (SOCBASEERR+59)
00866 #define SOCETIMEDOUT (SOCBASEERR+60)
00867 #define SOCECONNREFUSED (SOCBASEERR+61)
00868 #define SOCELOOP (SOCBASEERR+62)
00869 #define SOCENAMETOOLONG (SOCBASEERR+63)
00870 #define SOCEHOSTDOWN (SOCBASEERR+64)
00871 #define SOCEHOSTUNREACH (SOCBASEERR+65)
00872 #define SOCENOTEMPTY (SOCBASEERR+66)
00873
00874
00875 #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES \
00876 || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED \
00877 || (s) == APR_OS_START_SYSERR + ERROR_SHARING_VIOLATION)
00878 #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST \
00879 || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED \
00880 || (s) == APR_OS_START_SYSERR + ERROR_FILE_EXISTS \
00881 || (s) == APR_OS_START_SYSERR + ERROR_ALREADY_EXISTS \
00882 || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED)
00883 #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG \
00884 || (s) == APR_OS_START_SYSERR + ERROR_FILENAME_EXCED_RANGE \
00885 || (s) == APR_OS_START_SYSERR + SOCENAMETOOLONG)
00886 #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \
00887 || (s) == APR_OS_START_SYSERR + ERROR_FILE_NOT_FOUND \
00888 || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \
00889 || (s) == APR_OS_START_SYSERR + ERROR_NO_MORE_FILES \
00890 || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED)
00891 #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR)
00892 #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC \
00893 || (s) == APR_OS_START_SYSERR + ERROR_DISK_FULL)
00894 #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM)
00895 #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE \
00896 || (s) == APR_OS_START_SYSERR + ERROR_TOO_MANY_OPEN_FILES)
00897 #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE)
00898 #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF \
00899 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_HANDLE)
00900 #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL \
00901 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_PARAMETER \
00902 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_FUNCTION)
00903 #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE \
00904 || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK)
00905 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \
00906 || (s) == APR_OS_START_SYSERR + ERROR_NO_DATA \
00907 || (s) == APR_OS_START_SYSERR + SOCEWOULDBLOCK \
00908 || (s) == APR_OS_START_SYSERR + ERROR_LOCK_VIOLATION)
00909 #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \
00910 || (s) == APR_OS_START_SYSERR + SOCEINTR)
00911 #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \
00912 || (s) == APR_OS_START_SYSERR + SOCENOTSOCK)
00913 #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED \
00914 || (s) == APR_OS_START_SYSERR + SOCECONNREFUSED)
00915 #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \
00916 || (s) == APR_OS_START_SYSERR + SOCEINPROGRESS)
00917 #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \
00918 || (s) == APR_OS_START_SYSERR + SOCECONNABORTED)
00919 #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \
00920 || (s) == APR_OS_START_SYSERR + SOCECONNRESET)
00921 #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \
00922 || (s) == APR_OS_START_SYSERR + SOCETIMEDOUT)
00923 #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \
00924 || (s) == APR_OS_START_SYSERR + SOCEHOSTUNREACH)
00925 #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH \
00926 || (s) == APR_OS_START_SYSERR + SOCENETUNREACH)
00927 #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE)
00928 #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE \
00929 || (s) == APR_OS_START_SYSERR + ERROR_BROKEN_PIPE \
00930 || (s) == APR_OS_START_SYSERR + SOCEPIPE)
00931 #define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV \
00932 || (s) == APR_OS_START_SYSERR + ERROR_NOT_SAME_DEVICE)
00933 #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY \
00934 || (s) == APR_OS_START_SYSERR + ERROR_DIR_NOT_EMPTY \
00935 || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED)
00936
00937
00938
00939
00940
00941
00942
00943
00944
00945
00946
00947
00948
00949
00950
00951
00952
00953
00954
00955
00956
00957
00958
00959
00960
00961
00962
00963
00964
00965
00966
00967 #elif defined(WIN32) && !defined(DOXYGEN)
00968
00969 #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR)
00970 #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR)
00971
00972 #define apr_get_os_error() (APR_FROM_OS_ERROR(GetLastError()))
00973 #define apr_set_os_error(e) (SetLastError(APR_TO_OS_ERROR(e)))
00974
00975
00976
00977 #define apr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError()))
00978 #define apr_set_netos_error(e) (WSASetLastError(APR_TO_OS_ERROR(e)))
00979
00980 #define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS \
00981 || (s) == APR_OS_START_SYSERR + ERROR_SUCCESS)
00982
00983
00984 #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES \
00985 || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED \
00986 || (s) == APR_OS_START_SYSERR + ERROR_CANNOT_MAKE \
00987 || (s) == APR_OS_START_SYSERR + ERROR_CURRENT_DIRECTORY \
00988 || (s) == APR_OS_START_SYSERR + ERROR_DRIVE_LOCKED \
00989 || (s) == APR_OS_START_SYSERR + ERROR_FAIL_I24 \
00990 || (s) == APR_OS_START_SYSERR + ERROR_LOCK_VIOLATION \
00991 || (s) == APR_OS_START_SYSERR + ERROR_LOCK_FAILED \
00992 || (s) == APR_OS_START_SYSERR + ERROR_NOT_LOCKED \
00993 || (s) == APR_OS_START_SYSERR + ERROR_NETWORK_ACCESS_DENIED \
00994 || (s) == APR_OS_START_SYSERR + ERROR_SHARING_VIOLATION)
00995 #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST \
00996 || (s) == APR_OS_START_SYSERR + ERROR_FILE_EXISTS \
00997 || (s) == APR_OS_START_SYSERR + ERROR_ALREADY_EXISTS)
00998 #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG \
00999 || (s) == APR_OS_START_SYSERR + ERROR_FILENAME_EXCED_RANGE \
01000 || (s) == APR_OS_START_SYSERR + WSAENAMETOOLONG)
01001 #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \
01002 || (s) == APR_OS_START_SYSERR + ERROR_FILE_NOT_FOUND \
01003 || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \
01004 || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED \
01005 || (s) == APR_OS_START_SYSERR + ERROR_NO_MORE_FILES)
01006 #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR \
01007 || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \
01008 || (s) == APR_OS_START_SYSERR + ERROR_BAD_NETPATH \
01009 || (s) == APR_OS_START_SYSERR + ERROR_BAD_NET_NAME \
01010 || (s) == APR_OS_START_SYSERR + ERROR_BAD_PATHNAME \
01011 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_DRIVE)
01012 #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC \
01013 || (s) == APR_OS_START_SYSERR + ERROR_DISK_FULL)
01014 #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM \
01015 || (s) == APR_OS_START_SYSERR + ERROR_ARENA_TRASHED \
01016 || (s) == APR_OS_START_SYSERR + ERROR_NOT_ENOUGH_MEMORY \
01017 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_BLOCK \
01018 || (s) == APR_OS_START_SYSERR + ERROR_NOT_ENOUGH_QUOTA \
01019 || (s) == APR_OS_START_SYSERR + ERROR_OUTOFMEMORY)
01020 #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE \
01021 || (s) == APR_OS_START_SYSERR + ERROR_TOO_MANY_OPEN_FILES)
01022 #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE)
01023 #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF \
01024 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_HANDLE \
01025 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_TARGET_HANDLE)
01026 #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL \
01027 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_ACCESS \
01028 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_DATA \
01029 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_FUNCTION \
01030 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_HANDLE \
01031 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_PARAMETER \
01032 || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK)
01033 #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE \
01034 || (s) == APR_OS_START_SYSERR + ERROR_SEEK_ON_DEVICE \
01035 || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK)
01036 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \
01037 || (s) == APR_OS_START_SYSERR + ERROR_NO_DATA \
01038 || (s) == APR_OS_START_SYSERR + ERROR_NO_PROC_SLOTS \
01039 || (s) == APR_OS_START_SYSERR + ERROR_NESTING_NOT_ALLOWED \
01040 || (s) == APR_OS_START_SYSERR + ERROR_MAX_THRDS_REACHED \
01041 || (s) == APR_OS_START_SYSERR + ERROR_LOCK_VIOLATION \
01042 || (s) == APR_OS_START_SYSERR + WSAEWOULDBLOCK)
01043 #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \
01044 || (s) == APR_OS_START_SYSERR + WSAEINTR)
01045 #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \
01046 || (s) == APR_OS_START_SYSERR + WSAENOTSOCK)
01047 #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED \
01048 || (s) == APR_OS_START_SYSERR + WSAECONNREFUSED)
01049 #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \
01050 || (s) == APR_OS_START_SYSERR + WSAEINPROGRESS)
01051 #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \
01052 || (s) == APR_OS_START_SYSERR + WSAECONNABORTED)
01053 #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \
01054 || (s) == APR_OS_START_SYSERR + ERROR_NETNAME_DELETED \
01055 || (s) == APR_OS_START_SYSERR + WSAECONNRESET)
01056 #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \
01057 || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \
01058 || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT)
01059 #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \
01060 || (s) == APR_OS_START_SYSERR + WSAEHOSTUNREACH)
01061 #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH \
01062 || (s) == APR_OS_START_SYSERR + WSAENETUNREACH)
01063 #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE \
01064 || (s) == APR_OS_START_SYSERR + ERROR_EXE_MACHINE_TYPE_MISMATCH \
01065 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_DLL \
01066 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_MODULETYPE \
01067 || (s) == APR_OS_START_SYSERR + ERROR_BAD_EXE_FORMAT \
01068 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_EXE_SIGNATURE \
01069 || (s) == APR_OS_START_SYSERR + ERROR_FILE_CORRUPT \
01070 || (s) == APR_OS_START_SYSERR + ERROR_BAD_FORMAT)
01071 #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE \
01072 || (s) == APR_OS_START_SYSERR + ERROR_BROKEN_PIPE)
01073 #define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV \
01074 || (s) == APR_OS_START_SYSERR + ERROR_NOT_SAME_DEVICE)
01075 #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY \
01076 || (s) == APR_OS_START_SYSERR + ERROR_DIR_NOT_EMPTY)
01077
01078 #elif defined(NETWARE) && !defined(DOXYGEN)
01079
01080 #define APR_FROM_OS_ERROR(e) (e)
01081 #define APR_TO_OS_ERROR(e) (e)
01082
01083 #define apr_get_os_error() (errno)
01084 #define apr_set_os_error(e) (errno = (e))
01085
01086 #define apr_get_netos_error() (WSAGetLastError()+APR_OS_START_SYSERR)
01087 #define apr_set_netos_error(e) (WSASetLastError((e)-APR_OS_START_SYSERR))
01088
01089 #define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS)
01090
01091
01092 #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES)
01093 #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST)
01094 #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG)
01095 #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT)
01096 #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR)
01097 #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC)
01098 #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM)
01099 #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE)
01100 #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE)
01101 #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF)
01102 #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL)
01103 #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE)
01104
01105 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \
01106 || (s) == EWOULDBLOCK \
01107 || (s) == APR_OS_START_SYSERR + WSAEWOULDBLOCK)
01108 #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \
01109 || (s) == APR_OS_START_SYSERR + WSAEINTR)
01110 #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \
01111 || (s) == APR_OS_START_SYSERR + WSAENOTSOCK)
01112 #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED \
01113 || (s) == APR_OS_START_SYSERR + WSAECONNREFUSED)
01114 #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \
01115 || (s) == APR_OS_START_SYSERR + WSAEINPROGRESS)
01116 #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \
01117 || (s) == APR_OS_START_SYSERR + WSAECONNABORTED)
01118 #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \
01119 || (s) == APR_OS_START_SYSERR + WSAECONNRESET)
01120 #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \
01121 || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \
01122 || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT)
01123 #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \
01124 || (s) == APR_OS_START_SYSERR + WSAEHOSTUNREACH)
01125 #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH \
01126 || (s) == APR_OS_START_SYSERR + WSAENETUNREACH)
01127 #define APR_STATUS_IS_ENETDOWN(s) ((s) == APR_OS_START_SYSERR + WSAENETDOWN)
01128 #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE)
01129 #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE)
01130 #define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV)
01131 #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY)
01132
01133 #else
01134
01135
01136
01137
01138 #define APR_FROM_OS_ERROR(e) (e)
01139 #define APR_TO_OS_ERROR(e) (e)
01140
01141 #define apr_get_os_error() (errno)
01142 #define apr_set_os_error(e) (errno = (e))
01143
01144
01145
01146 #define apr_get_netos_error() (errno)
01147 #define apr_set_netos_error(e) (errno = (e))
01148
01155 #define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS)
01156
01158 #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES)
01159
01160 #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST)
01161
01162 #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG)
01163
01164 #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT)
01165
01166 #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR)
01167
01168 #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC)
01169
01170 #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM)
01171
01172 #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE)
01173
01174 #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE)
01175
01176 #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF)
01177
01178 #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL)
01179
01180 #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE)
01181
01183 #if !defined(EWOULDBLOCK) || !defined(EAGAIN)
01184 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN)
01185 #elif (EWOULDBLOCK == EAGAIN)
01186 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN)
01187 #else
01188 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \
01189 || (s) == EWOULDBLOCK)
01190 #endif
01191
01193 #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR)
01194
01195 #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK)
01196
01197 #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED)
01198
01199 #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS)
01200
01212 #ifdef EPROTO
01213 #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \
01214 || (s) == EPROTO)
01215 #else
01216 #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED)
01217 #endif
01218
01220 #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET)
01221
01222 #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT)
01223
01224 #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH)
01225
01226 #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH)
01227
01228 #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE)
01229
01230 #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE)
01231
01232 #define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV)
01233
01234 #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY || \
01235 (s) == APR_EEXIST)
01236
01238 #endif
01239
01242 #ifdef __cplusplus
01243 }
01244 #endif
01245
01246 #endif