Annotation of parser3/src/lib/sdbm/pa-include/pa_errno.h, revision 1.1
1.1 ! moko 1: /* ====================================================================
! 2: * The Apache Software License, Version 1.1
! 3: *
! 4: * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
! 5: * reserved.
! 6: *
! 7: * Redistribution and use in source and binary forms, with or without
! 8: * modification, are permitted provided that the following conditions
! 9: * are met:
! 10: *
! 11: * 1. Redistributions of source code must retain the above copyright
! 12: * notice, this list of conditions and the following disclaimer.
! 13: *
! 14: * 2. Redistributions in binary form must reproduce the above copyright
! 15: * notice, this list of conditions and the following disclaimer in
! 16: * the documentation and/or other materials provided with the
! 17: * distribution.
! 18: *
! 19: * 3. The end-user documentation included with the redistribution,
! 20: * if any, must include the following acknowledgment:
! 21: * "This product includes software developed by the
! 22: * Apache Software Foundation (http://www.apache.org/)."
! 23: * Alternately, this acknowledgment may appear in the software itself,
! 24: * if and wherever such third-party acknowledgments normally appear.
! 25: *
! 26: * 4. The names "Apache" and "Apache Software Foundation" must
! 27: * not be used to endorse or promote products derived from this
! 28: * software without prior written permission. For written
! 29: * permission, please contact apache@apache.org.
! 30: *
! 31: * 5. Products derived from this software may not be called "Apache",
! 32: * nor may "Apache" appear in their name, without prior written
! 33: * permission of the Apache Software Foundation.
! 34: *
! 35: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
! 36: * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
! 37: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
! 38: * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
! 39: * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
! 40: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
! 41: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
! 42: * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
! 43: * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
! 44: * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
! 45: * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
! 46: * SUCH DAMAGE.
! 47: * ====================================================================
! 48: *
! 49: * This software consists of voluntary contributions made by many
! 50: * individuals on behalf of the Apache Software Foundation. For more
! 51: * information on the Apache Software Foundation, please see
! 52: * <http://www.apache.org/>.
! 53: */
! 54:
! 55: #ifndef PA_ERRNO_H
! 56: #define PA_ERRNO_H
! 57:
! 58: #include "pa_apr.h"
! 59:
! 60: #if PA_HAVE_ERRNO_H
! 61: #include <errno.h>
! 62: #endif
! 63:
! 64: #ifdef __cplusplus
! 65: extern "C" {
! 66: #endif /* __cplusplus */
! 67:
! 68: /**
! 69: * @file pa_errno.h
! 70: * @brief APR Error Codes
! 71: */
! 72: /**
! 73: * @defgroup PA_Error_Codes Error Codes
! 74: * @ingroup APR
! 75: * @{
! 76: */
! 77:
! 78: /**
! 79: * Type for specifying an error or status code.
! 80: */
! 81: typedef int pa_status_t;
! 82:
! 83: /**
! 84: * PA_OS_START_ERROR is where the APR specific error values start.
! 85: */
! 86: #define PA_OS_START_ERROR 20000
! 87: /**
! 88: * PA_OS_ERRSPACE_SIZE is the maximum number of errors you can fit
! 89: * into one of the error/status ranges below -- except for
! 90: * PA_OS_START_USERERR, which see.
! 91: */
! 92: #define PA_OS_ERRSPACE_SIZE 50000
! 93: /**
! 94: * PA_OS_START_STATUS is where the APR specific status codes start.
! 95: */
! 96: #define PA_OS_START_STATUS (PA_OS_START_ERROR + PA_OS_ERRSPACE_SIZE)
! 97: /**
! 98: * PA_OS_START_USERERR are reserved for applications that use APR that
! 99: * layer their own error codes along with APR's. Note that the
! 100: * error immediately following this one is set ten times farther
! 101: * away than usual, so that users of apr have a lot of room in
! 102: * which to declare custom error codes.
! 103: */
! 104: #define PA_OS_START_USERERR (PA_OS_START_STATUS + PA_OS_ERRSPACE_SIZE)
! 105: /**
! 106: * PA_OS_START_USEERR is obsolete, defined for compatibility only.
! 107: * Use PA_OS_START_USERERR instead.
! 108: */
! 109: #define PA_OS_START_USEERR PA_OS_START_USERERR
! 110: /**
! 111: * PA_OS_START_CANONERR is where APR versions of errno values are defined
! 112: * on systems which don't have the corresponding errno.
! 113: */
! 114: #define PA_OS_START_CANONERR (PA_OS_START_USERERR \
! 115: + (PA_OS_ERRSPACE_SIZE * 10))
! 116: /**
! 117: * PA_OS_START_EAIERR folds EAI_ error codes from getaddrinfo() into
! 118: * pa_status_t values.
! 119: */
! 120: #define PA_OS_START_EAIERR (PA_OS_START_CANONERR + PA_OS_ERRSPACE_SIZE)
! 121: /**
! 122: * PA_OS_START_SYSERR folds platform-specific system error values into
! 123: * pa_status_t values.
! 124: */
! 125: #define PA_OS_START_SYSERR (PA_OS_START_EAIERR + PA_OS_ERRSPACE_SIZE)
! 126:
! 127: /** no error. @see PA_STATUS_IS_SUCCESS */
! 128: #define PA_SUCCESS 0
! 129:
! 130: /* APR ERROR VALUES */
! 131: /**
! 132: * @defgroup APRErrorValues Error Values
! 133: * <PRE>
! 134: * <b>APR ERROR VALUES</b>
! 135: * PA_ENOSTAT APR was unable to perform a stat on the file
! 136: * PA_ENOPOOL APR was not provided a pool with which to allocate memory
! 137: * PA_EBADDATE APR was given an invalid date
! 138: * PA_EINVALSOCK APR was given an invalid socket
! 139: * PA_ENOPROC APR was not given a process structure
! 140: * PA_ENOTIME APR was not given a time structure
! 141: * PA_ENODIR APR was not given a directory structure
! 142: * PA_ENOLOCK APR was not given a lock structure
! 143: * PA_ENOPOLL APR was not given a poll structure
! 144: * PA_ENOSOCKET APR was not given a socket
! 145: * PA_ENOTHREAD APR was not given a thread structure
! 146: * PA_ENOTHDKEY APR was not given a thread key structure
! 147: * PA_ENOSHMAVAIL There is no more shared memory available
! 148: * PA_EDSOOPEN APR was unable to open the dso object. For more
! 149: * information call pa_dso_error().
! 150: * PA_EGENERAL General failure (specific information not available)
! 151: * PA_EBADIP The specified IP address is invalid
! 152: * PA_EBADMASK The specified netmask is invalid
! 153: * </PRE>
! 154: *
! 155: * <PRE>
! 156: * <b>APR STATUS VALUES</b>
! 157: * PA_INCHILD Program is currently executing in the child
! 158: * PA_INPARENT Program is currently executing in the parent
! 159: * PA_DETACH The thread is detached
! 160: * PA_NOTDETACH The thread is not detached
! 161: * PA_CHILD_DONE The child has finished executing
! 162: * PA_CHILD_NOTDONE The child has not finished executing
! 163: * PA_TIMEUP The operation did not finish before the timeout
! 164: * PA_INCOMPLETE The operation was incomplete although some processing
! 165: * was performed and the results are partially valid
! 166: * PA_BADCH Getopt found an option not in the option string
! 167: * PA_BADARG Getopt found an option that is missing an argument
! 168: * and an argument was specified in the option string
! 169: * PA_EOF APR has encountered the end of the file
! 170: * PA_NOTFOUND APR was unable to find the socket in the poll structure
! 171: * PA_ANONYMOUS APR is using anonymous shared memory
! 172: * PA_FILEBASED APR is using a file name as the key to the shared memory
! 173: * PA_KEYBASED APR is using a shared key as the key to the shared memory
! 174: * PA_EINIT Ininitalizer value. If no option has been found, but
! 175: * the status variable requires a value, this should be used
! 176: * PA_ENOTIMPL The APR function has not been implemented on this
! 177: * platform, either because nobody has gotten to it yet,
! 178: * or the function is impossible on this platform.
! 179: * PA_EMISMATCH Two passwords do not match.
! 180: * PA_EABSOLUTE The given path was absolute.
! 181: * PA_ERELATIVE The given path was relative.
! 182: * PA_EINCOMPLETE The given path was neither relative nor absolute.
! 183: * PA_EABOVEROOT The given path was above the root path.
! 184: * PA_EBUSY The given lock was busy.
! 185: * </PRE>
! 186: * @{
! 187: */
! 188: /** @see PA_STATUS_IS_ENOSTAT */
! 189: #define PA_ENOSTAT (PA_OS_START_ERROR + 1)
! 190: /** @see PA_STATUS_IS_ENOPOOL */
! 191: #define PA_ENOPOOL (PA_OS_START_ERROR + 2)
! 192: /* empty slot: +3 */
! 193: /** @see PA_STATUS_IS_EBADDATE */
! 194: #define PA_EBADDATE (PA_OS_START_ERROR + 4)
! 195: /** @see PA_STATUS_IS_EINVALSOCK */
! 196: #define PA_EINVALSOCK (PA_OS_START_ERROR + 5)
! 197: /** @see PA_STATUS_IS_ENOPROC */
! 198: #define PA_ENOPROC (PA_OS_START_ERROR + 6)
! 199: /** @see PA_STATUS_IS_ENOTIME */
! 200: #define PA_ENOTIME (PA_OS_START_ERROR + 7)
! 201: /** @see PA_STATUS_IS_ENODIR */
! 202: #define PA_ENODIR (PA_OS_START_ERROR + 8)
! 203: /** @see PA_STATUS_IS_ENOLOCK */
! 204: #define PA_ENOLOCK (PA_OS_START_ERROR + 9)
! 205: /** @see PA_STATUS_IS_ENOPOLL */
! 206: #define PA_ENOPOLL (PA_OS_START_ERROR + 10)
! 207: /** @see PA_STATUS_IS_ENOSOCKET */
! 208: #define PA_ENOSOCKET (PA_OS_START_ERROR + 11)
! 209: /** @see PA_STATUS_IS_ENOTHREAD */
! 210: #define PA_ENOTHREAD (PA_OS_START_ERROR + 12)
! 211: /** @see PA_STATUS_IS_ENOTHDKEY */
! 212: #define PA_ENOTHDKEY (PA_OS_START_ERROR + 13)
! 213: /** @see PA_STATUS_IS_EGENERAL */
! 214: #define PA_EGENERAL (PA_OS_START_ERROR + 14)
! 215: /** @see PA_STATUS_IS_ENOSHMAVAIL */
! 216: #define PA_ENOSHMAVAIL (PA_OS_START_ERROR + 15)
! 217: /** @see PA_STATUS_IS_EBADIP */
! 218: #define PA_EBADIP (PA_OS_START_ERROR + 16)
! 219: /** @see PA_STATUS_IS_EBADMASK */
! 220: #define PA_EBADMASK (PA_OS_START_ERROR + 17)
! 221: /* empty slot: +18 */
! 222: /** @see PA_STATUS_IS_EDSOPEN */
! 223: #define PA_EDSOOPEN (PA_OS_START_ERROR + 19)
! 224: /** @see PA_STATUS_IS_EABSOLUTE */
! 225: #define PA_EABSOLUTE (PA_OS_START_ERROR + 20)
! 226: /** @see PA_STATUS_IS_ERELATIVE */
! 227: #define PA_ERELATIVE (PA_OS_START_ERROR + 21)
! 228: /** @see PA_STATUS_IS_EINCOMPLETE */
! 229: #define PA_EINCOMPLETE (PA_OS_START_ERROR + 22)
! 230: /** @see PA_STATUS_IS_EABOVEROOT */
! 231: #define PA_EABOVEROOT (PA_OS_START_ERROR + 23)
! 232: /** @see PA_STATUS_IS_EBADPATH */
! 233: #define PA_EBADPATH (PA_OS_START_ERROR + 24)
! 234:
! 235: /* APR STATUS VALUES */
! 236: /** @see PA_STATUS_IS_INCHILD */
! 237: #define PA_INCHILD (PA_OS_START_STATUS + 1)
! 238: /** @see PA_STATUS_IS_INPARENT */
! 239: #define PA_INPARENT (PA_OS_START_STATUS + 2)
! 240: /** @see PA_STATUS_IS_DETACH */
! 241: #define PA_DETACH (PA_OS_START_STATUS + 3)
! 242: /** @see PA_STATUS_IS_NOTDETACH */
! 243: #define PA_NOTDETACH (PA_OS_START_STATUS + 4)
! 244: /** @see PA_STATUS_IS_CHILD_DONE */
! 245: #define PA_CHILD_DONE (PA_OS_START_STATUS + 5)
! 246: /** @see PA_STATUS_IS_CHILD_NOTDONE */
! 247: #define PA_CHILD_NOTDONE (PA_OS_START_STATUS + 6)
! 248: /** @see PA_STATUS_IS_TIMEUP */
! 249: #define PA_TIMEUP (PA_OS_START_STATUS + 7)
! 250: /** @see PA_STATUS_IS_INCOMPLETE */
! 251: #define PA_INCOMPLETE (PA_OS_START_STATUS + 8)
! 252: /* empty slot: +9 */
! 253: /* empty slot: +10 */
! 254: /* empty slot: +11 */
! 255: /** @see PA_STATUS_IS_BADCH */
! 256: #define PA_BADCH (PA_OS_START_STATUS + 12)
! 257: /** @see PA_STATUS_IS_BADARG */
! 258: #define PA_BADARG (PA_OS_START_STATUS + 13)
! 259: /** @see PA_STATUS_IS_EOF */
! 260: #define PA_EOF (PA_OS_START_STATUS + 14)
! 261: /** @see PA_STATUS_IS_NOTFOUND */
! 262: #define PA_NOTFOUND (PA_OS_START_STATUS + 15)
! 263: /* empty slot: +16 */
! 264: /* empty slot: +17 */
! 265: /* empty slot: +18 */
! 266: /** @see PA_STATUS_IS_ANONYMOUS */
! 267: #define PA_ANONYMOUS (PA_OS_START_STATUS + 19)
! 268: /** @see PA_STATUS_IS_FILEBASED */
! 269: #define PA_FILEBASED (PA_OS_START_STATUS + 20)
! 270: /** @see PA_STATUS_IS_KEYBASED */
! 271: #define PA_KEYBASED (PA_OS_START_STATUS + 21)
! 272: /** @see PA_STATUS_IS_EINIT */
! 273: #define PA_EINIT (PA_OS_START_STATUS + 22)
! 274: /** @see PA_STATUS_IS_ENOTIMPL */
! 275: #define PA_ENOTIMPL (PA_OS_START_STATUS + 23)
! 276: /** @see PA_STATUS_IS_EMISMATCH */
! 277: #define PA_EMISMATCH (PA_OS_START_STATUS + 24)
! 278: /** @see PA_STATUS_IS_EBUSY */
! 279: #define PA_EBUSY (PA_OS_START_STATUS + 25)
! 280:
! 281: /**
! 282: * @defgroup aprerrcanonical Canonical Errors
! 283: * @{
! 284: */
! 285: /* APR CANONICAL ERROR VALUES */
! 286: /** @see PA_STATUS_IS_EACCES */
! 287: #ifdef EACCES
! 288: #define PA_EACCES EACCES
! 289: #else
! 290: #define PA_EACCES (PA_OS_START_CANONERR + 1)
! 291: #endif
! 292:
! 293: /** @see PA_STATUS_IS_EXIST */
! 294: #ifdef EEXIST
! 295: #define PA_EEXIST EEXIST
! 296: #else
! 297: #define PA_EEXIST (PA_OS_START_CANONERR + 2)
! 298: #endif
! 299:
! 300: /** @see PA_STATUS_IS_ENAMETOOLONG */
! 301: #ifdef ENAMETOOLONG
! 302: #define PA_ENAMETOOLONG ENAMETOOLONG
! 303: #else
! 304: #define PA_ENAMETOOLONG (PA_OS_START_CANONERR + 3)
! 305: #endif
! 306:
! 307: /** @see PA_STATUS_IS_ENOENT */
! 308: #ifdef ENOENT
! 309: #define PA_ENOENT ENOENT
! 310: #else
! 311: #define PA_ENOENT (PA_OS_START_CANONERR + 4)
! 312: #endif
! 313:
! 314: /** @see PA_STATUS_IS_ENOTDIR */
! 315: #ifdef ENOTDIR
! 316: #define PA_ENOTDIR ENOTDIR
! 317: #else
! 318: #define PA_ENOTDIR (PA_OS_START_CANONERR + 5)
! 319: #endif
! 320:
! 321: /** @see PA_STATUS_IS_ENOSPC */
! 322: #ifdef ENOSPC
! 323: #define PA_ENOSPC ENOSPC
! 324: #else
! 325: #define PA_ENOSPC (PA_OS_START_CANONERR + 6)
! 326: #endif
! 327:
! 328: /** @see PA_STATUS_IS_ENOMEM */
! 329: #ifdef ENOMEM
! 330: #define PA_ENOMEM ENOMEM
! 331: #else
! 332: #define PA_ENOMEM (PA_OS_START_CANONERR + 7)
! 333: #endif
! 334:
! 335: /** @see PA_STATUS_IS_EMFILE */
! 336: #ifdef EMFILE
! 337: #define PA_EMFILE EMFILE
! 338: #else
! 339: #define PA_EMFILE (PA_OS_START_CANONERR + 8)
! 340: #endif
! 341:
! 342: /** @see PA_STATUS_IS_ENFILE */
! 343: #ifdef ENFILE
! 344: #define PA_ENFILE ENFILE
! 345: #else
! 346: #define PA_ENFILE (PA_OS_START_CANONERR + 9)
! 347: #endif
! 348:
! 349: /** @see PA_STATUS_IS_EBADF */
! 350: #ifdef EBADF
! 351: #define PA_EBADF EBADF
! 352: #else
! 353: #define PA_EBADF (PA_OS_START_CANONERR + 10)
! 354: #endif
! 355:
! 356: /** @see PA_STATUS_IS_EINVAL */
! 357: #ifdef EINVAL
! 358: #define PA_EINVAL EINVAL
! 359: #else
! 360: #define PA_EINVAL (PA_OS_START_CANONERR + 11)
! 361: #endif
! 362:
! 363: /** @see PA_STATUS_IS_ESPIPE */
! 364: #ifdef ESPIPE
! 365: #define PA_ESPIPE ESPIPE
! 366: #else
! 367: #define PA_ESPIPE (PA_OS_START_CANONERR + 12)
! 368: #endif
! 369:
! 370: /**
! 371: * @see PA_STATUS_IS_EAGAIN
! 372: * @warning use PA_STATUS_IS_EAGAIN instead of just testing this value
! 373: */
! 374: #ifdef EAGAIN
! 375: #define PA_EAGAIN EAGAIN
! 376: #elif defined(EWOULDBLOCK)
! 377: #define PA_EAGAIN EWOULDBLOCK
! 378: #else
! 379: #define PA_EAGAIN (PA_OS_START_CANONERR + 13)
! 380: #endif
! 381:
! 382: /** @see PA_STATUS_IS_EINTR */
! 383: #ifdef EINTR
! 384: #define PA_EINTR EINTR
! 385: #else
! 386: #define PA_EINTR (PA_OS_START_CANONERR + 14)
! 387: #endif
! 388:
! 389: /** @see PA_STATUS_IS_ENOTSOCK */
! 390: #ifdef ENOTSOCK
! 391: #define PA_ENOTSOCK ENOTSOCK
! 392: #else
! 393: #define PA_ENOTSOCK (PA_OS_START_CANONERR + 15)
! 394: #endif
! 395:
! 396: /** @see PA_STATUS_IS_ECONNREFUSED */
! 397: #ifdef ECONNREFUSED
! 398: #define PA_ECONNREFUSED ECONNREFUSED
! 399: #else
! 400: #define PA_ECONNREFUSED (PA_OS_START_CANONERR + 16)
! 401: #endif
! 402:
! 403: /** @see PA_STATUS_IS_EINPROGRESS */
! 404: #ifdef EINPROGRESS
! 405: #define PA_EINPROGRESS EINPROGRESS
! 406: #else
! 407: #define PA_EINPROGRESS (PA_OS_START_CANONERR + 17)
! 408: #endif
! 409:
! 410: /**
! 411: * @see PA_STATUS_IS_ECONNABORTED
! 412: * @warning use PA_STATUS_IS_ECONNABORTED instead of just testing this value
! 413: */
! 414:
! 415: #ifdef ECONNABORTED
! 416: #define PA_ECONNABORTED ECONNABORTED
! 417: #else
! 418: #define PA_ECONNABORTED (PA_OS_START_CANONERR + 18)
! 419: #endif
! 420:
! 421: /** @see PA_STATUS_IS_ECONNRESET */
! 422: #ifdef ECONNRESET
! 423: #define PA_ECONNRESET ECONNRESET
! 424: #else
! 425: #define PA_ECONNRESET (PA_OS_START_CANONERR + 19)
! 426: #endif
! 427:
! 428: /** @see PA_STATUS_IS_ETIMEDOUT */
! 429: #ifdef ETIMEDOUT
! 430: #define PA_ETIMEDOUT ETIMEDOUT
! 431: #else
! 432: #define PA_ETIMEDOUT (PA_OS_START_CANONERR + 20)
! 433: #endif
! 434:
! 435: /** @see PA_STATUS_IS_EHOSTUNREACH */
! 436: #ifdef EHOSTUNREACH
! 437: #define PA_EHOSTUNREACH EHOSTUNREACH
! 438: #else
! 439: #define PA_EHOSTUNREACH (PA_OS_START_CANONERR + 21)
! 440: #endif
! 441:
! 442: /** @see PA_STATUS_IS_ENETUNREACH */
! 443: #ifdef ENETUNREACH
! 444: #define PA_ENETUNREACH ENETUNREACH
! 445: #else
! 446: #define PA_ENETUNREACH (PA_OS_START_CANONERR + 22)
! 447: #endif
! 448:
! 449: /** @see PA_STATUS_IS_EFTYPE */
! 450: #ifdef EFTYPE
! 451: #define PA_EFTYPE EFTYPE
! 452: #else
! 453: #define PA_EFTYPE (PA_OS_START_CANONERR + 23)
! 454: #endif
! 455:
! 456: /** @see PA_STATUS_IS_EPIPE */
! 457: #ifdef EPIPE
! 458: #define PA_EPIPE EPIPE
! 459: #else
! 460: #define PA_EPIPE (PA_OS_START_CANONERR + 24)
! 461: #endif
! 462:
! 463: /** @see PA_STATUS_IS_EXDEV */
! 464: #ifdef EXDEV
! 465: #define PA_EXDEV EXDEV
! 466: #else
! 467: #define PA_EXDEV (PA_OS_START_CANONERR + 25)
! 468: #endif
! 469:
! 470: /** @see PA_STATUS_IS_ENOTEMPTY */
! 471: #ifdef ENOTEMPTY
! 472: #define PA_ENOTEMPTY ENOTEMPTY
! 473: #else
! 474: #define PA_ENOTEMPTY (PA_OS_START_CANONERR + 26)
! 475: #endif
! 476:
! 477: /** @} */
! 478:
! 479: #ifdef __cplusplus
! 480: }
! 481: #endif
! 482:
! 483: #endif /* ! PA_ERRNO_H */
E-mail: