]>
Commit | Line | Data |
---|---|---|
1e02eddb MW |
1 | /* |
2 | * Copyright (C) 2008-2014 Tobias Brunner | |
3 | * Copyright (C) 2008 Martin Willi | |
19ef2aec TB |
4 | * |
5 | * Copyright (C) secunet Security Networks AG | |
1e02eddb MW |
6 | * |
7 | * This program is free software; you can redistribute it and/or modify it | |
8 | * under the terms of the GNU General Public License as published by the | |
9 | * Free Software Foundation; either version 2 of the License, or (at your | |
10 | * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>. | |
11 | * | |
12 | * This program is distributed in the hope that it will be useful, but | |
13 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | |
14 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 | * for more details. | |
16 | */ | |
17 | ||
18 | /** | |
19 | * @defgroup status_i status | |
20 | * @{ @ingroup utils_i | |
21 | */ | |
22 | ||
23 | #ifndef STATUS_H_ | |
24 | #define STATUS_H_ | |
25 | ||
26 | typedef enum status_t status_t; | |
27 | ||
28 | /** | |
29 | * Return values of function calls. | |
30 | */ | |
31 | enum status_t { | |
32 | /** Call succeeded */ | |
33 | SUCCESS, | |
34 | /** Call failed */ | |
35 | FAILED, | |
36 | /** Out of resources */ | |
37 | OUT_OF_RES, | |
38 | /** The suggested operation is already done */ | |
39 | ALREADY_DONE, | |
40 | /** Not supported */ | |
41 | NOT_SUPPORTED, | |
42 | /** One of the arguments is invalid */ | |
43 | INVALID_ARG, | |
44 | /** Something could not be found */ | |
45 | NOT_FOUND, | |
46 | /** Error while parsing */ | |
47 | PARSE_ERROR, | |
48 | /** Error while verifying */ | |
49 | VERIFY_ERROR, | |
50 | /** Object in invalid state */ | |
51 | INVALID_STATE, | |
52 | /** Destroy object which called method belongs to */ | |
53 | DESTROY_ME, | |
54 | /** Another call to the method is required */ | |
55 | NEED_MORE, | |
56 | }; | |
57 | ||
58 | /** | |
59 | * enum_names for type status_t. | |
60 | */ | |
61 | extern enum_name_t *status_names; | |
62 | ||
63 | /** | |
64 | * returns FAILED | |
65 | */ | |
66 | status_t return_failed(); | |
67 | ||
68 | /** | |
69 | * returns SUCCESS | |
70 | */ | |
71 | status_t return_success(); | |
72 | ||
73 | #endif /** STATUS_H_ @} */ |