~vlad-lesin/percona-server/mysql-5.0.33-original

« back to all changes in this revision

Viewing changes to ndb/include/ndbapi/ndberror.h

  • Committer: Vlad Lesin
  • Date: 2012-07-31 09:21:34 UTC
  • Revision ID: vladislav.lesin@percona.com-20120731092134-zfodx022b7992wsi
VirginĀ 5.0.33

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2003 MySQL AB
 
2
 
 
3
   This program is free software; you can redistribute it and/or modify
 
4
   it under the terms of the GNU General Public License as published by
 
5
   the Free Software Foundation; either version 2 of the License, or
 
6
   (at your option) any later version.
 
7
 
 
8
   This program is distributed in the hope that it will be useful,
 
9
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
   GNU General Public License for more details.
 
12
 
 
13
   You should have received a copy of the GNU General Public License
 
14
   along with this program; if not, write to the Free Software
 
15
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
16
 
 
17
#ifndef NDBERROR_H
 
18
#define NDBERROR_H
 
19
 
 
20
#ifdef __cplusplus
 
21
extern "C" {
 
22
#endif
 
23
 
 
24
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
 
25
 
 
26
typedef enum
 
27
{
 
28
  ndberror_st_success = 0,
 
29
  ndberror_st_temporary = 1,
 
30
  ndberror_st_permanent = 2,
 
31
  ndberror_st_unknown = 3
 
32
} ndberror_status_enum;
 
33
 
 
34
typedef enum
 
35
{
 
36
  ndberror_cl_none = 0,  
 
37
  ndberror_cl_application = 1,  
 
38
  ndberror_cl_no_data_found = 2,
 
39
  ndberror_cl_constraint_violation = 3,
 
40
  ndberror_cl_schema_error = 4,
 
41
  ndberror_cl_user_defined = 5,
 
42
  ndberror_cl_insufficient_space = 6,
 
43
  ndberror_cl_temporary_resource = 7,
 
44
  ndberror_cl_node_recovery = 8,
 
45
  ndberror_cl_overload = 9,
 
46
  ndberror_cl_timeout_expired = 10,
 
47
  ndberror_cl_unknown_result = 11,
 
48
  ndberror_cl_internal_error = 12,
 
49
  ndberror_cl_function_not_implemented = 13,
 
50
  ndberror_cl_unknown_error_code = 14,
 
51
  ndberror_cl_node_shutdown = 15,
 
52
  ndberror_cl_configuration = 16,
 
53
  ndberror_cl_schema_object_already_exists = 17 
 
54
} ndberror_classification_enum;
 
55
 
 
56
 
 
57
typedef struct {
 
58
 
 
59
  /**
 
60
   * Error status.  
 
61
   */
 
62
  ndberror_status_enum status;
 
63
 
 
64
  /**
 
65
   * Error type
 
66
   */
 
67
  ndberror_classification_enum classification;
 
68
  
 
69
  /**
 
70
   * Error code
 
71
   */
 
72
  int code;
 
73
 
 
74
  /**
 
75
   * Error message
 
76
   */
 
77
  const char * message;
 
78
 
 
79
  /**
 
80
   * The detailed description.  This is extra information regarding the 
 
81
   * error which is not included in the error message.
 
82
   *
 
83
   * @note Is NULL when no details specified
 
84
   */
 
85
  char * details;
 
86
 
 
87
} ndberror_struct;
 
88
 
 
89
 
 
90
typedef ndberror_status_enum ndberror_status;
 
91
typedef  ndberror_classification_enum ndberror_classification;
 
92
 
 
93
const char *ndberror_status_message(ndberror_status);
 
94
const char *ndberror_classification_message(ndberror_classification);
 
95
void ndberror_update(ndberror_struct *);
 
96
int ndb_error_string(int err_no, char *str, int size);
 
97
 
 
98
#endif /* doxygen skip internal*/
 
99
 
 
100
#ifdef __cplusplus
 
101
}
 
102
#endif
 
103
 
 
104
#endif