Annotation of parser3/src/lib/sdbm/pa-include/pa_errno.h, revision 1.4
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_CANONERR is where APR versions of errno values are defined
65: * on systems which don't have the corresponding errno.
66: */
67: #define PA_OS_START_CANONERR (PA_OS_START_USERERR \
68: + (PA_OS_ERRSPACE_SIZE * 10))
69:
70: /** no error. @see PA_STATUS_IS_SUCCESS */
71: #define PA_SUCCESS 0
72:
73: /* APR ERROR VALUES */
74: /**
75: * @defgroup APRErrorValues Error Values
76: * <PRE>
77: * <b>APR ERROR VALUES</b>
78: * </PRE>
79: *
80: * <PRE>
81: * <b>APR STATUS VALUES</b>
82: * PA_EOF APR has encountered the end of the file
83: * </PRE>
84: * @{
85: */
86: #define PA_EGENERAL (PA_OS_START_ERROR + 14)
87: #define PA_EOF (PA_OS_START_STATUS + 14)
88:
89: /**
90: * @defgroup aprerrcanonical Canonical Errors
91: * @{
92: */
93: /* APR CANONICAL ERROR VALUES */
94: /** @see PA_STATUS_IS_EACCES */
95: #ifdef EACCES
96: #define PA_EACCES EACCES
97: #else
98: #define PA_EACCES (PA_OS_START_CANONERR + 1)
99: #endif
100:
101: /** @see PA_STATUS_IS_EXIST */
102: #ifdef EEXIST
103: #define PA_EEXIST EEXIST
104: #else
105: #define PA_EEXIST (PA_OS_START_CANONERR + 2)
106: #endif
107:
108: /** @see PA_STATUS_IS_ENOSPC */
109: #ifdef ENOSPC
110: #define PA_ENOSPC ENOSPC
111: #else
112: #define PA_ENOSPC (PA_OS_START_CANONERR + 6)
113: #endif
114:
115: /** @see PA_STATUS_IS_EINVAL */
116: #ifdef EINVAL
117: #define PA_EINVAL EINVAL
118: #else
119: #define PA_EINVAL (PA_OS_START_CANONERR + 11)
120: #endif
121:
122: /** @} */
123:
124: #ifdef __cplusplus
125: }
126: #endif
127:
128: #endif /* ! PA_ERRNO_H */
E-mail: