Windows: remove trailing whitespace
[openafs.git] / src / WINNT / kfw / inc / netidmgr / kherror.h
1 /*
2  * Copyright (c) 2005 Massachusetts Institute of Technology
3  *
4  * Permission is hereby granted, free of charge, to any person
5  * obtaining a copy of this software and associated documentation
6  * files (the "Software"), to deal in the Software without
7  * restriction, including without limitation the rights to use, copy,
8  * modify, merge, publish, distribute, sublicense, and/or sell copies
9  * of the Software, and to permit persons to whom the Software is
10  * furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be
13  * included in all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
24
25 /* $Id$ */
26
27 /* Exported */
28 #ifndef __KHIMAIRA_KHERROR_H
29 #define __KHIMAIRA_KHERROR_H
30
31 /*! \defgroup kherror NetIDMgr errors
32
33 @{*/
34 /*! \brief Base for error codes
35
36     NetIDMgr errors range from \a KHM_ERROR_BASE to KHM_ERROR_BASE +
37     KHM_ERROR_RANGE, with the exception of KHM_ERROR_SUCCESS and
38     KHM_ERROR_NONE.
39     */
40 #define KHM_ERROR_BASE 0x40000000L
41
42 /*! \brief Range for error codes
43
44     NetIDMgr errors range from \a KHM_ERROR_BASE to
45     KHM_ERROR_BASE + KHM_ERROR_RANGE.
46 */
47 #define KHM_ERROR_RANGE 256L
48
49 /*! \defgroup kherror_codes Error codes
50   @{*/
51
52 /*! \brief No error */
53 #define KHM_ERROR_NONE 0x00000000L
54
55 /*! \brief Success. Same as \a KHM_ERROR_NONE */
56 #define KHM_ERROR_SUCCESS KHM_ERROR_NONE
57
58 /*! \brief The supplied name was invalid */
59 #define KHM_ERROR_INVALID_NAME      (KHM_ERROR_BASE + 1)
60
61 /*! \brief Too much data
62
63     A supplied buffer was invalid, was of insufficient size, or a
64     buffer was of a larger size than expected
65  */
66 #define KHM_ERROR_TOO_LONG          (KHM_ERROR_BASE + 2)
67
68 /*! \brief One or more parameters supplied to a function were invalid */
69 #define KHM_ERROR_INVALID_PARAM      (KHM_ERROR_BASE + 3)
70
71 /*! \brief A duplicate.
72
73     Usually means that something that should have been unique was
74     found to be not.
75  */
76 #define KHM_ERROR_DUPLICATE         (KHM_ERROR_BASE + 4)
77
78 /*! \brief An object was not found
79
80     An object referenced in a parameter was not found.
81  */
82 #define KHM_ERROR_NOT_FOUND         (KHM_ERROR_BASE + 5)
83
84 /*! \brief The relevant subsystem is not ready
85
86     Indicates that initialization has not been completed for a
87     subsystem.
88  */
89 #define KHM_ERROR_NOT_READY         (KHM_ERROR_BASE + 6)
90
91 /*! \brief No more resources
92
93     A limited resource has been exhausted.
94  */
95 #define KHM_ERROR_NO_RESOURCES      (KHM_ERROR_BASE + 7)
96
97 /*! \brief Type mismatch
98  */
99 #define KHM_ERROR_TYPE_MISMATCH     (KHM_ERROR_BASE + 8)
100
101 /*! \brief Already exists
102
103     Usually indicates that an exclusive create operation failed due to
104     the existence of a similar object.  Subtly different from
105     ::KHM_ERROR_DUPLICATE
106  */
107 #define KHM_ERROR_EXISTS            (KHM_ERROR_BASE + 9)
108
109 /*! \brief Operation timed out
110  */
111 #define KHM_ERROR_TIMEOUT           (KHM_ERROR_BASE + 10)
112
113 /*! \brief An EXIT message was received
114  */
115 #define KHM_ERROR_EXIT              (KHM_ERROR_BASE + 11)
116
117 /*! \brief Unknown or unspecified error
118  */
119 #define KHM_ERROR_UNKNOWN           (KHM_ERROR_BASE + 12)
120
121 /*! \brief General error
122  */
123 #define KHM_ERROR_GENERAL           KHM_ERROR_UNKNOWN
124
125 /*! \brief An index was out of bounds
126  */
127 #define KHM_ERROR_OUT_OF_BOUNDS     (KHM_ERROR_BASE + 13)
128
129 /*! \brief Object already deleted
130
131     One or more objects that were referenced were found to have been
132     already deleted.
133  */
134 #define KHM_ERROR_DELETED           (KHM_ERROR_BASE + 14)
135
136 /*! \brief Invalid operation
137
138     The operation was not permitted to continue for some reason.
139     Usually because the necessary conditions for the operation haven't
140     been met yet or the operation can only be performed at certain
141     times during the execution of NetIDMgr.
142  */
143 #define KHM_ERROR_INVALID_OPERATION (KHM_ERROR_BASE + 15)
144
145 /*! \brief Signature check failed
146  */
147 #define KHM_ERROR_INVALID_SIGNATURE (KHM_ERROR_BASE + 16)
148
149 /*! \brief Not implemented yet
150
151     The operation that was attempted involved invoking functionality
152     that has not been implemented yet.
153  */
154 #define KHM_ERROR_NOT_IMPLEMENTED   (KHM_ERROR_BASE + 17)
155
156 /*! \brief The objects were equivalent
157  */
158 #define KHM_ERROR_EQUIVALENT        (KHM_ERROR_BASE + 18)
159
160 /*! \brief No provider exists to service the request
161 */
162 #define KHM_ERROR_NO_PROVIDER       (KHM_ERROR_BASE + 19)
163
164 /*! \brief The operation succeeded, but with errors
165 */
166 #define KHM_ERROR_PARTIAL           (KHM_ERROR_BASE + 20)
167
168 /*! \brief An incompatibility was found */
169 #define KHM_ERROR_INCOMPATIBLE      (KHM_ERROR_BASE + 21)
170
171 /*@}*/ /*kherror_codes*/
172
173 /*! \brief Tests whether a return value indicates success */
174 #define KHM_SUCCEEDED(rv) ((rv)==KHM_ERROR_NONE)
175
176 /*! \brief Tests whether a return value indicates failure */
177 #define KHM_FAILED(rv) ((rv)!=KHM_ERROR_NONE)
178
179 /*@}*/
180 #endif