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)
00056
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
00118
00123 #define APR_OS_ERRSPACE_SIZE 50000
00124
00127 #define APR_OS_START_STATUS (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
00128
00135 #define APR_OS_START_USERERR (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
00136
00140 #define APR_OS_START_USEERR APR_OS_START_USERERR
00141
00145 #define APR_OS_START_CANONERR (APR_OS_START_USERERR \
00146 + (APR_OS_ERRSPACE_SIZE * 10))
00147
00151 #define APR_OS_START_EAIERR (APR_OS_START_CANONERR + APR_OS_ERRSPACE_SIZE)
00152
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)
00222
00223 #define APR_ENOPOOL (APR_OS_START_ERROR + 2)
00224
00226 #define APR_EBADDATE (APR_OS_START_ERROR + 4)
00227
00228 #define APR_EINVALSOCK (APR_OS_START_ERROR + 5)
00229
00230 #define APR_ENOPROC (APR_OS_START_ERROR + 6)
00231
00232 #define APR_ENOTIME (APR_OS_START_ERROR + 7)
00233
00234 #define APR_ENODIR (APR_OS_START_ERROR + 8)
00235
00236 #define APR_ENOLOCK (APR_OS_START_ERROR + 9)
00237
00238 #define APR_ENOPOLL (APR_OS_START_ERROR + 10)
00239
00240 #define APR_ENOSOCKET (APR_OS_START_ERROR + 11)
00241
00242 #define APR_ENOTHREAD (APR_OS_START_ERROR + 12)
00243
00244 #define APR_ENOTHDKEY (APR_OS_START_ERROR + 13)
00245
00246 #define APR_EGENERAL (APR_OS_START_ERROR + 14)
00247
00248 #define APR_ENOSHMAVAIL (APR_OS_START_ERROR + 15)
00249
00250 #define APR_EBADIP (APR_OS_START_ERROR + 16)
00251
00252 #define APR_EBADMASK (APR_OS_START_ERROR + 17)
00253
00255 #define APR_EDSOOPEN (APR_OS_START_ERROR + 19)
00256
00257 #define APR_EABSOLUTE (APR_OS_START_ERROR + 20)
00258
00259 #define APR_ERELATIVE (APR_OS_START_ERROR + 21)
00260
00261 #define APR_EINCOMPLETE (APR_OS_START_ERROR + 22)
00262
00263 #define APR_EABOVEROOT (APR_OS_START_ERROR + 23)
00264
00265 #define APR_EBADPATH (APR_OS_START_ERROR + 24)
00266
00267 #define APR_EPATHWILD (APR_OS_START_ERROR + 25)
00268
00269 #define APR_ESYMNOTFOUND (APR_OS_START_ERROR + 26)
00270
00271 #define APR_EPROC_UNKNOWN (APR_OS_START_ERROR + 27)
00272
00273 #define APR_ENOTENOUGHENTROPY (APR_OS_START_ERROR + 28)
00274
00292 #define APR_STATUS_IS_ENOSTAT(s) ((s) == APR_ENOSTAT)
00293
00298 #define APR_STATUS_IS_ENOPOOL(s) ((s) == APR_ENOPOOL)
00299
00300 #define APR_STATUS_IS_EBADDATE(s) ((s) == APR_EBADDATE)
00301
00302 #define APR_STATUS_IS_EINVALSOCK(s) ((s) == APR_EINVALSOCK)
00303
00304 #define APR_STATUS_IS_ENOPROC(s) ((s) == APR_ENOPROC)
00305
00306 #define APR_STATUS_IS_ENOTIME(s) ((s) == APR_ENOTIME)
00307
00308 #define APR_STATUS_IS_ENODIR(s) ((s) == APR_ENODIR)
00309
00310 #define APR_STATUS_IS_ENOLOCK(s) ((s) == APR_ENOLOCK)
00311
00312 #define APR_STATUS_IS_ENOPOLL(s) ((s) == APR_ENOPOLL)
00313
00314 #define APR_STATUS_IS_ENOSOCKET(s) ((s) == APR_ENOSOCKET)
00315
00316 #define APR_STATUS_IS_ENOTHREAD(s) ((s) == APR_ENOTHREAD)
00317
00318 #define APR_STATUS_IS_ENOTHDKEY(s) ((s) == APR_ENOTHDKEY)
00319
00320 #define APR_STATUS_IS_EGENERAL(s) ((s) == APR_EGENERAL)
00321
00322 #define APR_STATUS_IS_ENOSHMAVAIL(s) ((s) == APR_ENOSHMAVAIL)
00323
00324 #define APR_STATUS_IS_EBADIP(s) ((s) == APR_EBADIP)
00325
00326 #define APR_STATUS_IS_EBADMASK(s) ((s) == APR_EBADMASK)
00327
00332 #if defined(WIN32)
00333 #define APR_STATUS_IS_EDSOOPEN(s) ((s) == APR_EDSOOPEN \
00334 || APR_TO_OS_ERROR(s) == ERROR_MOD_NOT_FOUND)
00335 #else
00336 #define APR_STATUS_IS_EDSOOPEN(s) ((s) == APR_EDSOOPEN)
00337 #endif
00338
00339 #define APR_STATUS_IS_EABSOLUTE(s) ((s) == APR_EABSOLUTE)
00340
00341 #define APR_STATUS_IS_ERELATIVE(s) ((s) == APR_ERELATIVE)
00342
00343 #define APR_STATUS_IS_EINCOMPLETE(s) ((s) == APR_EINCOMPLETE)
00344
00345 #define APR_STATUS_IS_EABOVEROOT(s) ((s) == APR_EABOVEROOT)
00346
00347 #define APR_STATUS_IS_EBADPATH(s) ((s) == APR_EBADPATH)
00348
00349 #define APR_STATUS_IS_EPATHWILD(s) ((s) == APR_EPATHWILD)
00350
00353 #if defined(WIN32)
00354 #define APR_STATUS_IS_ESYMNOTFOUND(s) ((s) == APR_ESYMNOTFOUND \
00355 || APR_TO_OS_ERROR(s) == ERROR_PROC_NOT_FOUND)
00356 #else
00357 #define APR_STATUS_IS_ESYMNOTFOUND(s) ((s) == APR_ESYMNOTFOUND)
00358 #endif
00359
00360 #define APR_STATUS_IS_EPROC_UNKNOWN(s) ((s) == APR_EPROC_UNKNOWN)
00361
00363 #define APR_STATUS_IS_ENOTENOUGHENTROPY(s) ((s) == APR_ENOTENOUGHENTROPY)
00364
00372 #define APR_INCHILD (APR_OS_START_STATUS + 1)
00373
00374 #define APR_INPARENT (APR_OS_START_STATUS + 2)
00375
00376 #define APR_DETACH (APR_OS_START_STATUS + 3)
00377
00378 #define APR_NOTDETACH (APR_OS_START_STATUS + 4)
00379
00380 #define APR_CHILD_DONE (APR_OS_START_STATUS + 5)
00381
00382 #define APR_CHILD_NOTDONE (APR_OS_START_STATUS + 6)
00383
00384 #define APR_TIMEUP (APR_OS_START_STATUS + 7)
00385
00386 #define APR_INCOMPLETE (APR_OS_START_STATUS + 8)
00387
00388
00389
00391 #define APR_BADCH (APR_OS_START_STATUS + 12)
00392
00393 #define APR_BADARG (APR_OS_START_STATUS + 13)
00394
00395 #define APR_EOF (APR_OS_START_STATUS + 14)
00396
00397 #define APR_NOTFOUND (APR_OS_START_STATUS + 15)
00398
00399
00400
00402 #define APR_ANONYMOUS (APR_OS_START_STATUS + 19)
00403
00404 #define APR_FILEBASED (APR_OS_START_STATUS + 20)
00405
00406 #define APR_KEYBASED (APR_OS_START_STATUS + 21)
00407
00408 #define APR_EINIT (APR_OS_START_STATUS + 22)
00409
00410 #define APR_ENOTIMPL (APR_OS_START_STATUS + 23)
00411
00412 #define APR_EMISMATCH (APR_OS_START_STATUS + 24)
00413
00414 #define APR_EBUSY (APR_OS_START_STATUS + 25)
00415
00426 #define APR_STATUS_IS_INCHILD(s) ((s) == APR_INCHILD)
00427
00433 #define APR_STATUS_IS_INPARENT(s) ((s) == APR_INPARENT)
00434
00440 #define APR_STATUS_IS_DETACH(s) ((s) == APR_DETACH)
00441
00447 #define APR_STATUS_IS_NOTDETACH(s) ((s) == APR_NOTDETACH)
00448
00454 #define APR_STATUS_IS_CHILD_DONE(s) ((s) == APR_CHILD_DONE)
00455
00461 #define APR_STATUS_IS_CHILD_NOTDONE(s) ((s) == APR_CHILD_NOTDONE)
00462
00468 #define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP)
00469
00476 #define APR_STATUS_IS_INCOMPLETE(s) ((s) == APR_INCOMPLETE)
00477
00478
00479
00486 #define APR_STATUS_IS_BADCH(s) ((s) == APR_BADCH)
00487
00494 #define APR_STATUS_IS_BADARG(s) ((s) == APR_BADARG)
00495
00501 #define APR_STATUS_IS_EOF(s) ((s) == APR_EOF)
00502
00508 #define APR_STATUS_IS_NOTFOUND(s) ((s) == APR_NOTFOUND)
00509
00510
00511
00518 #define APR_STATUS_IS_ANONYMOUS(s) ((s) == APR_ANONYMOUS)
00519
00525 #define APR_STATUS_IS_FILEBASED(s) ((s) == APR_FILEBASED)
00526
00532 #define APR_STATUS_IS_KEYBASED(s) ((s) == APR_KEYBASED)
00533
00540 #define APR_STATUS_IS_EINIT(s) ((s) == APR_EINIT)
00541
00549 #define APR_STATUS_IS_ENOTIMPL(s) ((s) == APR_ENOTIMPL)
00550
00556 #define APR_STATUS_IS_EMISMATCH(s) ((s) == APR_EMISMATCH)
00557
00562 #define APR_STATUS_IS_EBUSY(s) ((s) == APR_EBUSY)
00563
00570
00572 #ifdef EACCES
00573 #define APR_EACCES EACCES
00574 #else
00575 #define APR_EACCES (APR_OS_START_CANONERR + 1)
00576 #endif
00577
00579 #ifdef EEXIST
00580 #define APR_EEXIST EEXIST
00581 #else
00582 #define APR_EEXIST (APR_OS_START_CANONERR + 2)
00583 #endif
00584
00586 #ifdef ENAMETOOLONG
00587 #define APR_ENAMETOOLONG ENAMETOOLONG
00588 #else
00589 #define APR_ENAMETOOLONG (APR_OS_START_CANONERR + 3)
00590 #endif
00591
00593 #ifdef ENOENT
00594 #define APR_ENOENT ENOENT
00595 #else
00596 #define APR_ENOENT (APR_OS_START_CANONERR + 4)
00597 #endif
00598
00600 #ifdef ENOTDIR
00601 #define APR_ENOTDIR ENOTDIR
00602 #else
00603 #define APR_ENOTDIR (APR_OS_START_CANONERR + 5)
00604 #endif
00605
00607 #ifdef ENOSPC
00608 #define APR_ENOSPC ENOSPC
00609 #else
00610 #define APR_ENOSPC (APR_OS_START_CANONERR + 6)
00611 #endif
00612
00614 #ifdef ENOMEM
00615 #define APR_ENOMEM ENOMEM
00616 #else
00617 #define APR_ENOMEM (APR_OS_START_CANONERR + 7)
00618 #endif
00619
00621 #ifdef EMFILE
00622 #define APR_EMFILE EMFILE
00623 #else
00624 #define APR_EMFILE (APR_OS_START_CANONERR + 8)
00625 #endif
00626
00628 #ifdef ENFILE
00629 #define APR_ENFILE ENFILE
00630 #else
00631 #define APR_ENFILE (APR_OS_START_CANONERR + 9)
00632 #endif
00633
00635 #ifdef EBADF
00636 #define APR_EBADF EBADF
00637 #else
00638 #define APR_EBADF (APR_OS_START_CANONERR + 10)
00639 #endif
00640
00642 #ifdef EINVAL
00643 #define APR_EINVAL EINVAL
00644 #else
00645 #define APR_EINVAL (APR_OS_START_CANONERR + 11)
00646 #endif
00647
00649 #ifdef ESPIPE
00650 #define APR_ESPIPE ESPIPE
00651 #else
00652 #define APR_ESPIPE (APR_OS_START_CANONERR + 12)
00653 #endif
00654
00659 #ifdef EAGAIN
00660 #define APR_EAGAIN EAGAIN
00661 #elif defined(EWOULDBLOCK)
00662 #define APR_EAGAIN EWOULDBLOCK
00663 #else
00664 #define APR_EAGAIN (APR_OS_START_CANONERR + 13)
00665 #endif
00666
00668 #ifdef EINTR
00669 #define APR_EINTR EINTR
00670 #else
00671 #define APR_EINTR (APR_OS_START_CANONERR + 14)
00672 #endif
00673
00675 #ifdef ENOTSOCK
00676 #define APR_ENOTSOCK ENOTSOCK
00677 #else
00678 #define APR_ENOTSOCK (APR_OS_START_CANONERR + 15)
00679 #endif
00680
00682 #ifdef ECONNREFUSED
00683 #define APR_ECONNREFUSED ECONNREFUSED
00684 #else
00685 #define APR_ECONNREFUSED (APR_OS_START_CANONERR + 16)
00686 #endif
00687
00689 #ifdef EINPROGRESS
00690 #define APR_EINPROGRESS EINPROGRESS
00691 #else
00692 #define APR_EINPROGRESS (APR_OS_START_CANONERR + 17)
00693 #endif
00694
00700 #ifdef ECONNABORTED
00701 #define APR_ECONNABORTED ECONNABORTED
00702 #else
00703 #define APR_ECONNABORTED (APR_OS_START_CANONERR + 18)
00704 #endif
00705
00707 #ifdef ECONNRESET
00708 #define APR_ECONNRESET ECONNRESET
00709 #else
00710 #define APR_ECONNRESET (APR_OS_START_CANONERR + 19)
00711 #endif
00712
00715 #ifdef ETIMEDOUT
00716 #define APR_ETIMEDOUT ETIMEDOUT
00717 #else
00718 #define APR_ETIMEDOUT (APR_OS_START_CANONERR + 20)
00719 #endif
00720
00722 #ifdef EHOSTUNREACH
00723 #define APR_EHOSTUNREACH EHOSTUNREACH
00724 #else
00725 #define APR_EHOSTUNREACH (APR_OS_START_CANONERR + 21)
00726 #endif
00727
00729 #ifdef ENETUNREACH
00730 #define APR_ENETUNREACH ENETUNREACH
00731 #else
00732 #define APR_ENETUNREACH (APR_OS_START_CANONERR + 22)
00733 #endif
00734
00736 #ifdef EFTYPE
00737 #define APR_EFTYPE EFTYPE
00738 #else
00739 #define APR_EFTYPE (APR_OS_START_CANONERR + 23)
00740 #endif
00741
00743 #ifdef EPIPE
00744 #define APR_EPIPE EPIPE
00745 #else
00746 #define APR_EPIPE (APR_OS_START_CANONERR + 24)
00747 #endif
00748
00750 #ifdef EXDEV
00751 #define APR_EXDEV EXDEV
00752 #else
00753 #define APR_EXDEV (APR_OS_START_CANONERR + 25)
00754 #endif
00755
00757 #ifdef ENOTEMPTY
00758 #define APR_ENOTEMPTY ENOTEMPTY
00759 #else
00760 #define APR_ENOTEMPTY (APR_OS_START_CANONERR + 26)
00761 #endif
00762
00765 #if defined(OS2) && !defined(DOXYGEN)
00766
00767 #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR)
00768 #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR)
00769
00770 #define INCL_DOSERRORS
00771 #define INCL_DOS
00772
00773
00774
00775
00776
00777
00778
00779
00780
00781
00782
00783
00784 #define apr_get_netos_error() (APR_FROM_OS_ERROR(errno))
00785 #define apr_set_netos_error(e) (errno = APR_TO_OS_ERROR(e))
00786
00787
00788
00789 #define APR_OS2_STATUS(e) (APR_FROM_OS_ERROR(e))
00790
00791
00792
00793
00794 #define SOCBASEERR 10000
00795 #define SOCEPERM (SOCBASEERR+1)
00796 #define SOCESRCH (SOCBASEERR+3)
00797 #define SOCEINTR (SOCBASEERR+4)
00798 #define SOCENXIO (SOCBASEERR+6)
00799 #define SOCEBADF (SOCBASEERR+9)
00800 #define SOCEACCES (SOCBASEERR+13)
00801 #define SOCEFAULT (SOCBASEERR+14)
00802 #define SOCEINVAL (SOCBASEERR+22)
00803 #define SOCEMFILE (SOCBASEERR+24)
00804 #define SOCEPIPE (SOCBASEERR+32)
00805 #define SOCEOS2ERR (SOCBASEERR+100)
00806 #define SOCEWOULDBLOCK (SOCBASEERR+35)
00807 #define SOCEINPROGRESS (SOCBASEERR+36)
00808 #define SOCEALREADY (SOCBASEERR+37)
00809 #define SOCENOTSOCK (SOCBASEERR+38)
00810 #define SOCEDESTADDRREQ (SOCBASEERR+39)
00811 #define SOCEMSGSIZE (SOCBASEERR+40)
00812 #define SOCEPROTOTYPE (SOCBASEERR+41)
00813 #define SOCENOPROTOOPT (SOCBASEERR+42)
00814 #define SOCEPROTONOSUPPORT (SOCBASEERR+43)
00815 #define SOCESOCKTNOSUPPORT (SOCBASEERR+44)
00816 #define SOCEOPNOTSUPP (SOCBASEERR+45)
00817 #define SOCEPFNOSUPPORT (SOCBASEERR+46)
00818 #define SOCEAFNOSUPPORT (SOCBASEERR+47)
00819 #define SOCEADDRINUSE (SOCBASEERR+48)
00820 #define SOCEADDRNOTAVAIL (SOCBASEERR+49)
00821 #define SOCENETDOWN (SOCBASEERR+50)
00822 #define SOCENETUNREACH (SOCBASEERR+51)
00823 #define SOCENETRESET (SOCBASEERR+52)
00824 #define SOCECONNABORTED (SOCBASEERR+53)
00825 #define SOCECONNRESET (SOCBASEERR+54)
00826 #define SOCENOBUFS (SOCBASEERR+55)
00827 #define SOCEISCONN (SOCBASEERR+56)
00828 #define SOCENOTCONN (SOCBASEERR+57)
00829 #define SOCESHUTDOWN (SOCBASEERR+58)
00830 #define SOCETOOMANYREFS (SOCBASEERR+59)
00831 #define SOCETIMEDOUT (SOCBASEERR+60)
00832 #define SOCECONNREFUSED (SOCBASEERR+61)
00833 #define SOCELOOP (SOCBASEERR+62)
00834 #define SOCENAMETOOLONG (SOCBASEERR+63)
00835 #define SOCEHOSTDOWN (SOCBASEERR+64)
00836 #define SOCEHOSTUNREACH (SOCBASEERR+65)
00837 #define SOCENOTEMPTY (SOCBASEERR+66)
00838
00839
00840 #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES \
00841 || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED \
00842 || (s) == APR_OS_START_SYSERR + ERROR_SHARING_VIOLATION)
00843 #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST \
00844 || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED \
00845 || (s) == APR_OS_START_SYSERR + ERROR_FILE_EXISTS \
00846 || (s) == APR_OS_START_SYSERR + ERROR_ALREADY_EXISTS \
00847 || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED)
00848 #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG \
00849 || (s) == APR_OS_START_SYSERR + ERROR_FILENAME_EXCED_RANGE \
00850 || (s) == APR_OS_START_SYSERR + SOCENAMETOOLONG)
00851 #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \
00852 || (s) == APR_OS_START_SYSERR + ERROR_FILE_NOT_FOUND \
00853 || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \
00854 || (s) == APR_OS_START_SYSERR + ERROR_NO_MORE_FILES \
00855 || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED)
00856 #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR)
00857 #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC \
00858 || (s) == APR_OS_START_SYSERR + ERROR_DISK_FULL)
00859 #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM)
00860 #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE \
00861 || (s) == APR_OS_START_SYSERR + ERROR_TOO_MANY_OPEN_FILES)
00862 #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE)
00863 #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF \
00864 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_HANDLE)
00865 #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL \
00866 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_PARAMETER \
00867 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_FUNCTION)
00868 #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE \
00869 || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK)
00870 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \
00871 || (s) == APR_OS_START_SYSERR + ERROR_NO_DATA \
00872 || (s) == APR_OS_START_SYSERR + SOCEWOULDBLOCK \
00873 || (s) == APR_OS_START_SYSERR + ERROR_LOCK_VIOLATION)
00874 #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \
00875 || (s) == APR_OS_START_SYSERR + SOCEINTR)
00876 #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \
00877 || (s) == APR_OS_START_SYSERR + SOCENOTSOCK)
00878 #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED \
00879 || (s) == APR_OS_START_SYSERR + SOCECONNREFUSED)
00880 #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \
00881 || (s) == APR_OS_START_SYSERR + SOCEINPROGRESS)
00882 #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \
00883 || (s) == APR_OS_START_SYSERR + SOCECONNABORTED)
00884 #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \
00885 || (s) == APR_OS_START_SYSERR + SOCECONNRESET)
00886
00887 #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \
00888 || (s) == APR_OS_START_SYSERR + SOCETIMEDOUT)
00889 #undef APR_STATUS_IS_TIMEUP
00890 #define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP \
00891 || (s) == APR_OS_START_SYSERR + SOCETIMEDOUT)
00892 #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \
00893 || (s) == APR_OS_START_SYSERR + SOCEHOSTUNREACH)
00894 #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH \
00895 || (s) == APR_OS_START_SYSERR + SOCENETUNREACH)
00896 #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE)
00897 #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE \
00898 || (s) == APR_OS_START_SYSERR + ERROR_BROKEN_PIPE \
00899 || (s) == APR_OS_START_SYSERR + SOCEPIPE)
00900 #define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV \
00901 || (s) == APR_OS_START_SYSERR + ERROR_NOT_SAME_DEVICE)
00902 #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY \
00903 || (s) == APR_OS_START_SYSERR + ERROR_DIR_NOT_EMPTY \
00904 || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED)
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
00930
00931
00932
00933
00934
00935
00936 #elif defined(WIN32) && !defined(DOXYGEN)
00937
00938 #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR)
00939 #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR)
00940
00941 #define apr_get_os_error() (APR_FROM_OS_ERROR(GetLastError()))
00942 #define apr_set_os_error(e) (SetLastError(APR_TO_OS_ERROR(e)))
00943
00944
00945
00946 #define apr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError()))
00947 #define apr_set_netos_error(e) (WSASetLastError(APR_TO_OS_ERROR(e)))
00948
00949
00950 #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES \
00951 || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED \
00952 || (s) == APR_OS_START_SYSERR + ERROR_CANNOT_MAKE \
00953 || (s) == APR_OS_START_SYSERR + ERROR_CURRENT_DIRECTORY \
00954 || (s) == APR_OS_START_SYSERR + ERROR_DRIVE_LOCKED \
00955 || (s) == APR_OS_START_SYSERR + ERROR_FAIL_I24 \
00956 || (s) == APR_OS_START_SYSERR + ERROR_LOCK_VIOLATION \
00957 || (s) == APR_OS_START_SYSERR + ERROR_LOCK_FAILED \
00958 || (s) == APR_OS_START_SYSERR + ERROR_NOT_LOCKED \
00959 || (s) == APR_OS_START_SYSERR + ERROR_NETWORK_ACCESS_DENIED \
00960 || (s) == APR_OS_START_SYSERR + ERROR_SHARING_VIOLATION)
00961 #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST \
00962 || (s) == APR_OS_START_SYSERR + ERROR_FILE_EXISTS \
00963 || (s) == APR_OS_START_SYSERR + ERROR_ALREADY_EXISTS)
00964 #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG \
00965 || (s) == APR_OS_START_SYSERR + ERROR_FILENAME_EXCED_RANGE \
00966 || (s) == APR_OS_START_SYSERR + WSAENAMETOOLONG)
00967 #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \
00968 || (s) == APR_OS_START_SYSERR + ERROR_FILE_NOT_FOUND \
00969 || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \
00970 || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED \
00971 || (s) == APR_OS_START_SYSERR + ERROR_NO_MORE_FILES)
00972 #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR \
00973 || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \
00974 || (s) == APR_OS_START_SYSERR + ERROR_BAD_NETPATH \
00975 || (s) == APR_OS_START_SYSERR + ERROR_BAD_NET_NAME \
00976 || (s) == APR_OS_START_SYSERR + ERROR_BAD_PATHNAME \
00977 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_DRIVE)
00978 #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC \
00979 || (s) == APR_OS_START_SYSERR + ERROR_DISK_FULL)
00980 #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM \
00981 || (s) == APR_OS_START_SYSERR + ERROR_ARENA_TRASHED \
00982 || (s) == APR_OS_START_SYSERR + ERROR_NOT_ENOUGH_MEMORY \
00983 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_BLOCK \
00984 || (s) == APR_OS_START_SYSERR + ERROR_NOT_ENOUGH_QUOTA \
00985 || (s) == APR_OS_START_SYSERR + ERROR_OUTOFMEMORY)
00986 #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE \
00987 || (s) == APR_OS_START_SYSERR + ERROR_TOO_MANY_OPEN_FILES)
00988 #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE)
00989 #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF \
00990 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_HANDLE \
00991 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_TARGET_HANDLE)
00992 #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL \
00993 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_ACCESS \
00994 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_DATA \
00995 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_FUNCTION \
00996 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_HANDLE \
00997 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_PARAMETER \
00998 || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK)
00999 #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE \
01000 || (s) == APR_OS_START_SYSERR + ERROR_SEEK_ON_DEVICE \
01001 || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK)
01002 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \
01003 || (s) == APR_OS_START_SYSERR + ERROR_NO_DATA \
01004 || (s) == APR_OS_START_SYSERR + ERROR_NO_PROC_SLOTS \
01005 || (s) == APR_OS_START_SYSERR + ERROR_NESTING_NOT_ALLOWED \
01006 || (s) == APR_OS_START_SYSERR + ERROR_MAX_THRDS_REACHED \
01007 || (s) == APR_OS_START_SYSERR + ERROR_LOCK_VIOLATION \
01008 || (s) == APR_OS_START_SYSERR + WSAEWOULDBLOCK)
01009 #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \
01010 || (s) == APR_OS_START_SYSERR + WSAEINTR)
01011 #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \
01012 || (s) == APR_OS_START_SYSERR + WSAENOTSOCK)
01013 #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED \
01014 || (s) == APR_OS_START_SYSERR + WSAECONNREFUSED)
01015 #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \
01016 || (s) == APR_OS_START_SYSERR + WSAEINPROGRESS)
01017 #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \
01018 || (s) == APR_OS_START_SYSERR + WSAECONNABORTED)
01019 #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \
01020 || (s) == APR_OS_START_SYSERR + ERROR_NETNAME_DELETED \
01021 || (s) == APR_OS_START_SYSERR + WSAECONNRESET)
01022
01023 #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \
01024 || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \
01025 || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT)
01026 #undef APR_STATUS_IS_TIMEUP
01027 #define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP \
01028 || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \
01029 || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT)
01030 #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \
01031 || (s) == APR_OS_START_SYSERR + WSAEHOSTUNREACH)
01032 #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH \
01033 || (s) == APR_OS_START_SYSERR + WSAENETUNREACH)
01034 #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE \
01035 || (s) == APR_OS_START_SYSERR + ERROR_EXE_MACHINE_TYPE_MISMATCH \
01036 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_DLL \
01037 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_MODULETYPE \
01038 || (s) == APR_OS_START_SYSERR + ERROR_BAD_EXE_FORMAT \
01039 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_EXE_SIGNATURE \
01040 || (s) == APR_OS_START_SYSERR + ERROR_FILE_CORRUPT \
01041 || (s) == APR_OS_START_SYSERR + ERROR_BAD_FORMAT)
01042 #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE \
01043 || (s) == APR_OS_START_SYSERR + ERROR_BROKEN_PIPE)
01044 #define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV \
01045 || (s) == APR_OS_START_SYSERR + ERROR_NOT_SAME_DEVICE)
01046 #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY \
01047 || (s) == APR_OS_START_SYSERR + ERROR_DIR_NOT_EMPTY)
01048
01049 #elif defined(NETWARE) && defined(USE_WINSOCK) && !defined(DOXYGEN)
01050
01051 #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR)
01052 #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR)
01053
01054 #define apr_get_os_error() (errno)
01055 #define apr_set_os_error(e) (errno = (e))
01056
01057
01058 #define apr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError()))
01059 #define apr_set_netos_error(e) (WSASetLastError(APR_TO_OS_ERROR(e)))
01060
01061
01062 #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES)
01063 #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST)
01064 #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG)
01065 #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT)
01066 #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR)
01067 #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC)
01068 #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM)
01069 #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE)
01070 #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE)
01071 #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF)
01072 #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL)
01073 #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE)
01074
01075 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \
01076 || (s) == EWOULDBLOCK \
01077 || (s) == APR_OS_START_SYSERR + WSAEWOULDBLOCK)
01078 #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \
01079 || (s) == APR_OS_START_SYSERR + WSAEINTR)
01080 #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \
01081 || (s) == APR_OS_START_SYSERR + WSAENOTSOCK)
01082 #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED \
01083 || (s) == APR_OS_START_SYSERR + WSAECONNREFUSED)
01084 #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \
01085 || (s) == APR_OS_START_SYSERR + WSAEINPROGRESS)
01086 #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \
01087 || (s) == APR_OS_START_SYSERR + WSAECONNABORTED)
01088 #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \
01089 || (s) == APR_OS_START_SYSERR + WSAECONNRESET)
01090
01091 #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \
01092 || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \
01093 || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT)
01094 #undef APR_STATUS_IS_TIMEUP
01095 #define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP \
01096 || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \
01097 || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT)
01098 #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \
01099 || (s) == APR_OS_START_SYSERR + WSAEHOSTUNREACH)
01100 #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH \
01101 || (s) == APR_OS_START_SYSERR + WSAENETUNREACH)
01102 #define APR_STATUS_IS_ENETDOWN(s) ((s) == APR_OS_START_SYSERR + WSAENETDOWN)
01103 #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE)
01104 #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE)
01105 #define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV)
01106 #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY)
01107
01108 #else
01109
01110
01111
01112
01113 #define APR_FROM_OS_ERROR(e) (e)
01114 #define APR_TO_OS_ERROR(e) (e)
01115
01116 #define apr_get_os_error() (errno)
01117 #define apr_set_os_error(e) (errno = (e))
01118
01119
01120
01121 #define apr_get_netos_error() (errno)
01122 #define apr_set_netos_error(e) (errno = (e))
01123
01130 #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES)
01131
01132 #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST)
01133
01134 #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG)
01135
01141 #ifdef EMVSCATLG
01142 #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \
01143 || (s) == EMVSCATLG)
01144 #else
01145 #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT)
01146 #endif
01147
01148 #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR)
01149
01150 #ifdef EDQUOT
01151 #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC \
01152 || (s) == EDQUOT)
01153 #else
01154 #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC)
01155 #endif
01156
01157 #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM)
01158
01159 #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE)
01160
01161 #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE)
01162
01163 #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF)
01164
01165 #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL)
01166
01167 #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE)
01168
01170 #if !defined(EWOULDBLOCK) || !defined(EAGAIN)
01171 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN)
01172 #elif (EWOULDBLOCK == EAGAIN)
01173 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN)
01174 #else
01175 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \
01176 || (s) == EWOULDBLOCK)
01177 #endif
01178
01180 #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR)
01181
01182 #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK)
01183
01184 #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED)
01185
01186 #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS)
01187
01199 #ifdef EPROTO
01200 #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \
01201 || (s) == EPROTO)
01202 #else
01203 #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED)
01204 #endif
01205
01207 #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET)
01208
01210 #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT)
01211
01212 #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH)
01213
01214 #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH)
01215
01216 #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE)
01217
01218 #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE)
01219
01220 #define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV)
01221
01222 #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY || \
01223 (s) == APR_EEXIST)
01224
01226 #endif
01227
01230 #ifdef __cplusplus
01231 }
01232 #endif
01233
01234 #endif