xa.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /**
  2. * This file has no copyright assigned and is placed in the Public Domain.
  3. * This file is part of the mingw-w64 runtime package.
  4. * No warranty is given; refer to the file DISCLAIMER.PD within this package.
  5. */
  6. #ifndef XA_H
  7. #define XA_H
  8. #define XIDDATASIZE 128
  9. #define MAXGTRIDSIZE 64
  10. #define MAXBQUALSIZE 64
  11. #ifndef _XID_T_DEFINED
  12. #define _XID_T_DEFINED
  13. struct xid_t {
  14. __LONG32 formatID;
  15. __LONG32 gtrid_length;
  16. __LONG32 bqual_length;
  17. char data[XIDDATASIZE];
  18. };
  19. #endif
  20. typedef struct xid_t XID;
  21. #ifdef _TMPROTOTYPES
  22. extern int __cdecl ax_reg(int,XID *,__LONG32);
  23. extern int __cdecl ax_unreg(int,__LONG32);
  24. #else
  25. extern int __cdecl ax_reg();
  26. extern int __cdecl ax_unreg();
  27. #endif
  28. #define RMNAMESZ 32
  29. #define MAXINFOSIZE 256
  30. #ifndef _XA_SWITCH_T_DEFINED
  31. #define _XA_SWITCH_T_DEFINED
  32. struct xa_switch_t {
  33. char name[RMNAMESZ];
  34. __LONG32 flags;
  35. __LONG32 version;
  36. int (__cdecl *xa_open_entry)(char *,int,__LONG32);
  37. int (__cdecl *xa_close_entry)(char *,int,__LONG32);
  38. int (__cdecl *xa_start_entry)(XID *,int,__LONG32);
  39. int (__cdecl *xa_end_entry)(XID *,int,__LONG32);
  40. int (__cdecl *xa_rollback_entry)(XID *,int,__LONG32);
  41. int (__cdecl *xa_prepare_entry)(XID *,int,__LONG32);
  42. int (__cdecl *xa_commit_entry)(XID *,int,__LONG32);
  43. int (__cdecl *xa_recover_entry)(XID *,__LONG32,int,__LONG32);
  44. int (__cdecl *xa_forget_entry)(XID *,int,__LONG32);
  45. int (__cdecl *xa_complete_entry)(int *,int *,int,__LONG32);
  46. };
  47. typedef struct xa_switch_t xa_switch_t;
  48. #endif
  49. #define TMNOFLAGS __MSABI_LONG(0x00000000)
  50. #define TMREGISTER __MSABI_LONG(0x00000001)
  51. #define TMNOMIGRATE __MSABI_LONG(0x00000002)
  52. #define TMUSEASYNC __MSABI_LONG(0x00000004)
  53. #define TMASYNC __MSABI_LONG(0x80000000)
  54. #define TMONEPHASE __MSABI_LONG(0x40000000)
  55. #define TMFAIL __MSABI_LONG(0x20000000)
  56. #define TMNOWAIT __MSABI_LONG(0x10000000)
  57. #define TMRESUME __MSABI_LONG(0x08000000)
  58. #define TMSUCCESS __MSABI_LONG(0x04000000)
  59. #define TMSUSPEND __MSABI_LONG(0x02000000)
  60. #define TMSTARTRSCAN __MSABI_LONG(0x01000000)
  61. #define TMENDRSCAN __MSABI_LONG(0x00800000)
  62. #define TMMULTIPLE __MSABI_LONG(0x00400000)
  63. #define TMJOIN __MSABI_LONG(0x00200000)
  64. #define TMMIGRATE __MSABI_LONG(0x00100000)
  65. #define TM_JOIN 2
  66. #define TM_RESUME 1
  67. #define TM_OK 0
  68. #define TMER_TMERR (-1)
  69. #define TMER_INVAL (-2)
  70. #define TMER_PROTO (-3)
  71. #define XA_RBBASE 100
  72. #define XA_RBROLLBACK XA_RBBASE
  73. #define XA_RBCOMMFAIL XA_RBBASE+1
  74. #define XA_RBDEADLOCK XA_RBBASE+2
  75. #define XA_RBINTEGRITY XA_RBBASE+3
  76. #define XA_RBOTHER XA_RBBASE+4
  77. #define XA_RBPROTO XA_RBBASE+5
  78. #define XA_RBTIMEOUT XA_RBBASE+6
  79. #define XA_RBTRANSIENT XA_RBBASE+7
  80. #define XA_RBEND XA_RBTRANSIENT
  81. #define XA_NOMIGRATE 9
  82. #define XA_HEURHAZ 8
  83. #define XA_HEURCOM 7
  84. #define XA_HEURRB 6
  85. #define XA_HEURMIX 5
  86. #define XA_RETRY 4
  87. #define XA_RDONLY 3
  88. #define XA_OK 0
  89. #define XAER_ASYNC (-2)
  90. #define XAER_RMERR (-3)
  91. #define XAER_NOTA (-4)
  92. #define XAER_INVAL (-5)
  93. #define XAER_PROTO (-6)
  94. #define XAER_RMFAIL (-7)
  95. #define XAER_DUPID (-8)
  96. #define XAER_OUTSIDE (-9)
  97. typedef int (__cdecl *XA_OPEN_EPT)(char *,int,__LONG32);
  98. typedef int (__cdecl *XA_CLOSE_EPT)(char *,int,__LONG32);
  99. typedef int (__cdecl *XA_START_EPT)(XID *,int,__LONG32);
  100. typedef int (__cdecl *XA_END_EPT)(XID *,int,__LONG32);
  101. typedef int (__cdecl *XA_ROLLBACK_EPT)(XID *,int,__LONG32);
  102. typedef int (__cdecl *XA_PREPARE_EPT)(XID *,int,__LONG32);
  103. typedef int (__cdecl *XA_COMMIT_EPT)(XID *,int,__LONG32);
  104. typedef int (__cdecl *XA_RECOVER_EPT)(XID *,__LONG32,int,__LONG32);
  105. typedef int (__cdecl *XA_FORGET_EPT)(XID *,int,__LONG32);
  106. typedef int (__cdecl *XA_COMPLETE_EPT)(int *,int *,int,__LONG32);
  107. #endif