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