3
/*___INFO__MARK_BEGIN__*/
4
/*************************************************************************
6
* The Contents of this file are made available subject to the terms of
7
* the Sun Industry Standards Source License Version 1.2
9
* Sun Microsystems Inc., March, 2001
12
* Sun Industry Standards Source License Version 1.2
13
* =================================================
14
* The contents of this file are subject to the Sun Industry Standards
15
* Source License Version 1.2 (the "License"); You may not use this file
16
* except in compliance with the License. You may obtain a copy of the
17
* License at http://gridengine.sunsource.net/Gridengine_SISSL_license.html
19
* Software provided under this License is provided on an "AS IS" basis,
20
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
21
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
22
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
23
* See the License for the specific provisions governing your rights and
24
* obligations concerning the Software.
26
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
28
* Copyright: 2001 by Sun Microsystems, Inc.
30
* All Rights Reserved.
32
************************************************************************/
33
/*___INFO__MARK_END__*/
35
#include "sge_answerL.h"
38
ANSWER_QUALITY_CRITICAL = 0,
39
ANSWER_QUALITY_ERROR = 1,
40
ANSWER_QUALITY_WARNING = 2,
41
ANSWER_QUALITY_INFO = 3,
42
ANSWER_QUALITY_END = 4 /* needs to be last element */
46
* valid values for AN_status
49
STATUS_OK = 1, /* everything was fine */
50
STATUS_ESEMANTIC, /* semantic error */
51
STATUS_EEXIST, /* elem does not exist OR it exists for a
53
STATUS_EUNKNOWN, /* unknown error occured */
54
STATUS_ENOIMP, /* command not implemented for target */
55
STATUS_ENOKEY, /* missing key field in case of add,del,mod */
56
STATUS_ESYNTAX, /* syntax error parsing a_source field */
57
STATUS_EDENIED2HOST, /* operation denied to this host */
58
STATUS_ENOMGR, /* operation needs manager privileges */
59
STATUS_ENOOPR, /* operation needs operator privileges */
60
STATUS_NOQMASTER, /* failed to reach sge_qmaster */
61
STATUS_NOCOMMD, /* failed to reach commd */
62
STATUS_NOCONFIG, /* missing dir/conf (cell, common, bootstrap) */
63
STATUS_EDISK, /* disk operation failed */
64
STATUS_ENOSUCHUSER, /* can't resolve user */
65
STATUS_NOSUCHGROUP, /* can't resolve group */
66
STATUS_EMALLOC, /* can't allocate memory */
67
STATUS_ENOTOWNER, /* need to be owner for this operation */
68
STATUS_ESUBHLIC, /* too few submit host licenses */
69
STATUS_DENIED, /* not allowed to do whatever you try */
70
STATUS_EVERSION, /* qmaster GDI version differs from clients
72
STATUS_ERROR1, /* general error 1 */
73
STATUS_ERROR2, /* general error 2 */
74
STATUS_ERROR3, /* general error 3 */
75
STATUS_OK_DOAGAIN=24, /*
76
* everything was fine but transaction
77
* was not completly finished.
79
STATUS_NOTOK_DOAGAIN=25 /*
80
* transaction was rejected. Try again later
81
* (value will be used as return value for
87
bool answer_has_quality(const lListElem *answer, answer_quality_t quality);
89
void answer_exit_if_not_recoverable(const lListElem *answer);
91
const char *answer_get_quality_text(const lListElem *answer);
93
u_long32 answer_get_status(const lListElem *answer);
95
void answer_print_text(const lListElem *answer,
100
void answer_to_dstring(const lListElem *answer, dstring *diag);
102
void answer_list_to_dstring(const lList *alp, dstring *diag);
104
bool answer_list_add_sprintf(lList **answer_list, u_long32 status,
105
answer_quality_t quality, const char *fmt, ...);
107
bool answer_list_has_quality(lList **answer_list,
108
answer_quality_t quality);
110
bool answer_list_has_status(lList **answer_list,
113
bool answer_list_has_error(lList **answer_list);
115
void answer_list_on_error_print_or_exit(lList **answer_list, FILE *stream);
117
int answer_list_print_err_warn(lList **answer_list,
118
const char *critical_prefix,
119
const char *err_prefix,
120
const char *warn_prefix);
122
bool answer_list_output(lList **answer_list);
124
bool answer_list_log(lList **answer_list, bool is_free_list, bool show_info);
126
int answer_list_handle_request_answer_list(lList **answer_list, FILE *stream);
128
bool answer_list_add(lList **answer_list, const char *text,
129
u_long32 status, answer_quality_t quality);
131
bool answer_list_add_elem(lList **answer_list, lListElem *answer);
133
void answer_list_replace(lList **answer_list, lList **new_list);
135
void answer_list_append_list(lList **answer_list, lList **new_list);
137
int show_answer(lList *alp);
139
int show_answer_list(lList *alp);
142
#endif /* __SGE_ANSWER_H */