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

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 DBINTERFACE_H
  14. #define DBINTERFACE_H
  15. /***************************************************************/
  16. /* I N C L U D E D   F I L E S                                 */
  17. /***************************************************************/
  18. #include "testDefinitions.h"
  19. /***************************************************************
  20. * M A C R O S                                                  *
  21. ***************************************************************/
  22. /***************************************************************/
  23. /* C O N S T A N T S                                           */
  24. /***************************************************************/
  25. /*-----------------------*/
  26. /* Default Database Name */
  27. /*-----------------------*/
  28. #define DEFAULTDB "TestDbClient"
  29. /***************************************************************
  30. * D A T A   S T R U C T U R E S                                *
  31. ***************************************************************/
  32. typedef struct {
  33.   struct Ndb           * pNDB;
  34.   struct NdbConnection * pCurrTrans;
  35. } UserHandle;
  36. /***************************************************************
  37. * P U B L I C    F U N C T I O N S                             *
  38. ***************************************************************/
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif
  42. extern double userGetTimeSync(void);
  43. extern void userCheckpoint(UserHandle *uh);
  44. extern UserHandle *userDbConnect(uint32 createDb, char *dbName);
  45. extern void        userDbDisconnect(UserHandle *uh);
  46. extern int userDbInsertServer(UserHandle      *uh,
  47.                               ServerId         serverId,
  48.                       SubscriberSuffix suffix,
  49.                       ServerName       name);
  50. extern int userDbInsertSubscriber(UserHandle      *uh,
  51.                           SubscriberNumber number,
  52.                                   uint32           groupId,
  53.                           SubscriberName   name);
  54. extern int userDbInsertGroup(UserHandle *uh,
  55.              GroupId     groupId, 
  56.              GroupName   name,
  57.              Permission  allowRead,
  58.              Permission  allowInsert,
  59.              Permission  allowDelete);
  60. extern int userDbCommit(UserHandle *uh);
  61. extern int userDbRollback(UserHandle *uh);
  62. extern void userTransaction_T1(UserHandle      *uh,
  63.                                SubscriberNumber number,
  64.                                Location         new_location,
  65.                                ChangedBy        changed_by,
  66.                                ChangedTime      changed_time);
  67. extern void userTransaction_T2(UserHandle       *uh,
  68.                                SubscriberNumber  number,
  69.                                Location         *new_location,
  70.                                ChangedBy         changed_by,
  71.                                ChangedTime       changed_time,
  72.                                SubscriberName    subscriberName);
  73. extern void userTransaction_T3(UserHandle      *uh,
  74.                                SubscriberNumber number,
  75.                                ServerId         server_id,
  76.                                ServerBit        server_bit,
  77.                                SessionDetails   session_details,
  78.                                unsigned int    *branch_executed);
  79. extern void userTransaction_T4(UserHandle      *uh,
  80.                                SubscriberNumber number,
  81.                                ServerId         server_id,
  82.                                ServerBit        server_bit,
  83.                                SessionDetails   session_details,
  84.                                unsigned int     do_rollback,
  85.                                unsigned int    *branch_executed);
  86. extern void userTransaction_T5(UserHandle      *uh,
  87.                                SubscriberNumber number,
  88.                                ServerId         server_id,
  89.                                ServerBit        server_bit,
  90.                                unsigned int     do_rollback,
  91.                                unsigned int    *branch_executed);
  92. #ifdef __cplusplus
  93. }
  94. #endif
  95. /***************************************************************
  96. * E X T E R N A L   D A T A                                    *
  97. ***************************************************************/
  98. #endif /* DBINTERFACE_H */