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