~ubuntu-branches/ubuntu/utopic/gridengine/utopic

« back to all changes in this revision

Viewing changes to source/libs/sgeobj/sge_answer.h

  • Committer: Bazaar Package Importer
  • Author(s): Mark Hymers
  • Date: 2008-06-25 22:36:13 UTC
  • Revision ID: james.westby@ubuntu.com-20080625223613-tvd9xlhuoct9kyhm
Tags: upstream-6.2~beta2
ImportĀ upstreamĀ versionĀ 6.2~beta2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef __SGE_ANSWER_H
 
2
#define __SGE_ANSWER_H
 
3
/*___INFO__MARK_BEGIN__*/
 
4
/*************************************************************************
 
5
 * 
 
6
 *  The Contents of this file are made available subject to the terms of
 
7
 *  the Sun Industry Standards Source License Version 1.2
 
8
 * 
 
9
 *  Sun Microsystems Inc., March, 2001
 
10
 * 
 
11
 * 
 
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
 
18
 * 
 
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.
 
25
 * 
 
26
 *   The Initial Developer of the Original Code is: Sun Microsystems, Inc.
 
27
 * 
 
28
 *   Copyright: 2001 by Sun Microsystems, Inc.
 
29
 * 
 
30
 *   All Rights Reserved.
 
31
 * 
 
32
 ************************************************************************/
 
33
/*___INFO__MARK_END__*/
 
34
 
 
35
#include "sge_answerL.h"
 
36
 
 
37
typedef enum {
 
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 */
 
43
} answer_quality_t;
 
44
 
 
45
/* 
 
46
 * valid values for AN_status 
 
47
 */
 
48
typedef enum {
 
49
   STATUS_OK = 1,            /* everything was fine */
 
50
   STATUS_ESEMANTIC,         /* semantic error */
 
51
   STATUS_EEXIST,            /* elem does not exist OR it exists for a
 
52
                              * "add" request */
 
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
 
71
                              * GDI version */
 
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. 
 
78
                              */
 
79
   STATUS_NOTOK_DOAGAIN=25   /*
 
80
                              * transaction was rejected. Try again later 
 
81
                              * (value will be used as return value for
 
82
                              * qsub)
 
83
                              */
 
84
} an_status_t;
 
85
 
 
86
 
 
87
bool answer_has_quality(const lListElem *answer, answer_quality_t quality);
 
88
 
 
89
void answer_exit_if_not_recoverable(const lListElem *answer);
 
90
 
 
91
const char *answer_get_quality_text(const lListElem *answer);
 
92
 
 
93
u_long32 answer_get_status(const lListElem *answer);
 
94
 
 
95
void answer_print_text(const lListElem *answer, 
 
96
                       FILE *stream,
 
97
                       const char *prefix,
 
98
                       const char *suffix);
 
99
 
 
100
void answer_to_dstring(const lListElem *answer, dstring *diag);
 
101
 
 
102
void answer_list_to_dstring(const lList *alp, dstring *diag);
 
103
 
 
104
bool answer_list_add_sprintf(lList **answer_list, u_long32 status, 
 
105
                             answer_quality_t quality, const char *fmt, ...);
 
106
 
 
107
bool answer_list_has_quality(lList **answer_list, 
 
108
                             answer_quality_t quality);
 
109
 
 
110
bool answer_list_has_status(lList **answer_list, 
 
111
                            u_long32 status);
 
112
 
 
113
bool answer_list_has_error(lList **answer_list);
 
114
 
 
115
void answer_list_on_error_print_or_exit(lList **answer_list, FILE *stream);
 
116
 
 
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);
 
121
 
 
122
bool answer_list_output(lList **answer_list);
 
123
 
 
124
bool answer_list_log(lList **answer_list, bool is_free_list, bool show_info);
 
125
 
 
126
int answer_list_handle_request_answer_list(lList **answer_list, FILE *stream);
 
127
 
 
128
bool answer_list_add(lList **answer_list, const char *text,
 
129
                     u_long32 status, answer_quality_t quality);
 
130
 
 
131
bool answer_list_add_elem(lList **answer_list, lListElem *answer);
 
132
 
 
133
void answer_list_replace(lList **answer_list, lList **new_list);
 
134
 
 
135
void answer_list_append_list(lList **answer_list, lList **new_list);
 
136
 
 
137
int show_answer(lList *alp);
 
138
 
 
139
int show_answer_list(lList *alp);
 
140
 
 
141
 
 
142
#endif /* __SGE_ANSWER_H */