ndberror.h
上传用户:romrleung
上传日期:2022-05-23
资源大小:18897k
文件大小:2k
源码类别:

MySQL数据库

开发平台:

Visual C++

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