home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / postgres / postgre3.z / postgre3 / src / lib / H / access / xact.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-27  |  3.6 KB  |  118 lines

  1. /* ----------------------------------------------------------------
  2.  *   FILE
  3.  *    xact.h
  4.  *    
  5.  *   DESCRIPTION
  6.  *    postgres transaction system header
  7.  *
  8.  *   NOTES
  9.  *    
  10.  *   IDENTIFICATION
  11.  *    $Header: /private/postgres/src/lib/H/access/RCS/xact.h,v 1.6 1992/05/28 20:26:30 mer Exp $
  12.  * ----------------------------------------------------------------
  13.  */
  14.  
  15. #ifndef XactIncluded       /* include this file only once */
  16. #define XactIncluded 1
  17.  
  18. #include <signal.h>
  19.  
  20. #include "access/xcxt.h"
  21. #include "access/xlog.h"
  22. #include "storage/ipci.h"
  23. #include "tmp/miscadmin.h"
  24. #include "tmp/portal.h"
  25. #include "utils/log.h"
  26. #include "utils/mcxt.h"
  27.  
  28. /* ----------------
  29.  *    transaction state structure
  30.  * ----------------
  31.  */
  32. typedef struct TransactionStateData {
  33.     TransactionId    transactionIdData;
  34.     CommandId        commandId;
  35.     Time        startTime;
  36.     int            state;
  37.     int            blockState;
  38. } TransactionStateData;
  39.  
  40. /* ----------------
  41.  *    transaction states
  42.  * ----------------
  43.  */
  44. #define TRANS_DEFAULT        0
  45. #define TRANS_START        1
  46. #define TRANS_INPROGRESS    2
  47. #define TRANS_COMMIT        3
  48. #define TRANS_ABORT        4
  49. #define TRANS_DISABLED        5
  50.  
  51. /* ----------------
  52.  *    transaction block states
  53.  * ----------------
  54.  */
  55. #define TBLOCK_DEFAULT        0
  56. #define TBLOCK_BEGIN        1
  57. #define TBLOCK_INPROGRESS    2
  58. #define TBLOCK_END        3
  59. #define TBLOCK_ABORT        4
  60. #define TBLOCK_ENDABORT        5
  61.  
  62. typedef TransactionStateData *TransactionState;
  63.  
  64. /* ----------------
  65.  *    extern definitions
  66.  * ----------------
  67.  */
  68. extern bool IsTransactionState ARGS(());
  69. extern void OverrideTransactionSystem ARGS((bool flag));
  70. extern TransactionId GetCurrentTransactionId ARGS(());
  71. extern CommandId GetCurrentCommandId ARGS(());
  72. extern Time GetCurrentTransactionStartTime ARGS(());
  73. extern bool TransactionIdIsCurrentTransactionId ARGS((TransactionId xid));
  74. extern bool CommandIdIsCurrentCommandId ARGS((CommandId cid));
  75. extern void ClearCommandIdCounterOverflowFlag ARGS(());
  76. extern void CommandCounterIncrement ARGS(());
  77. extern void InitializeTransactionSystem ARGS(());
  78. extern void AtStart_Cache ARGS(());
  79. extern void AtStart_Locks ARGS(());
  80. extern void AtStart_Memory ARGS(());
  81. extern void RecordTransactionCommit ARGS(());
  82. extern void AtCommit_Cache ARGS(());
  83. extern void AtCommit_Locks ARGS(());
  84. extern void AtCommit_Memory ARGS(());
  85. extern void RecordTransactionAbort ARGS(());
  86. extern void AtAbort_Cache ARGS(());
  87. extern void AtAbort_Locks ARGS(());
  88. extern void AtAbort_Memory ARGS(());
  89. extern void StartTransaction ARGS(());
  90. extern bool CurrentXactInProgress ARGS(());
  91. extern void CommitTransaction ARGS(());
  92. extern void AbortTransaction ARGS(());
  93. extern void StartTransactionCommand ARGS(());
  94. extern void CommitTransactionCommand ARGS(());
  95. extern void AbortCurrentTransaction ARGS(());
  96. extern void BeginTransactionBlock ARGS(());
  97. extern void EndTransactionBlock ARGS(());
  98. extern void AbortTransactionBlock ARGS(());
  99. extern void UserErrorEndWithoutBegin ARGS(());
  100. extern void UserErrorBeginAfterBegin ARGS(());
  101. extern void UserErrorAbortWithoutBegin ARGS(());
  102. extern void InternalErrorIllegalStateTransition ARGS(());
  103. extern void FsaMachine ARGS(());
  104. extern void InitializeTransactionState ARGS(());
  105. extern void OverrideTransactionState ARGS(());
  106. extern bool IsBlockTransactionState ARGS(());
  107. extern bool IsOverrideTransactionState ARGS(());
  108. extern void StartTransactionStateBlock ARGS(());
  109. extern void StartTransactionStateCommand ARGS(());
  110. extern void CommitTransactionStateCommand ARGS(());
  111. extern void CommitTransactionStateBlock ARGS(());
  112. extern void AbortCurrentTransactionState ARGS(());
  113. extern void AbortTransactionStateBlock ARGS(());
  114. extern void StartTransactionBlock ARGS(());
  115. extern void CommitTransactionBlock ARGS(());
  116.  
  117. #endif XactIncluded
  118.