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

  1. /*
  2.  * rac.h --
  3.  *    POSTGRES rule lock access definitions.
  4.  *
  5.  * Identification:
  6.  *    $Header: /private/postgres/src/lib/H/rules/RCS/rac.h,v 1.10 1991/10/01 16:27:41 glass Exp $
  7.  */
  8.  
  9. #ifndef    RAcIncluded    /* Include this file only once. */
  10. #define RAcIncluded    1
  11.  
  12. #include "tmp/c.h"
  13.  
  14. #include "storage/block.h"
  15. #include "storage/buf.h"
  16. #include "access/htup.h"
  17. #include "utils/rel.h"
  18. #include "rules/rlock.h"
  19.  
  20. /*
  21.  * HeapTupleFreeRuleLock
  22.  *    Free a rule lock but only if it is a main memory pointer.
  23.  */
  24. extern
  25. void
  26. HeapTupleFreeRuleLock ARGS((
  27.     HeapTuple    tuple
  28. ));
  29.  
  30. /*
  31.  * HeapTupleGetRuleLock --
  32.  *    Returns the rule lock for a heap tuple or InvalidRuleLock if
  33.  *    the rule lock is NULL.
  34.  *
  35.  * Note:
  36.  *    Assumes heap tuple is valid.
  37.  */
  38. extern
  39. RuleLock
  40. HeapTupleGetRuleLock ARGS((
  41.     HeapTuple    tuple,
  42.     Buffer        buffer
  43. ));
  44.  
  45. /*
  46.  * HeapTupleHasEmptyRuleLock
  47.  * return true iff the given tuple has an empty rule lock
  48.  */
  49. extern
  50. bool
  51. HeapTupleHasEmptyRuleLock ARGS((
  52.     HeapTuple    tuple,
  53.     Buffer        buffer
  54. ));
  55.  
  56. /*
  57.  * HeapTupleSetRuleLock --
  58.  *    Sets the rule lock for a heap tuple.
  59.  *
  60.  * Note:
  61.  *    Assumes heap tuple is valid.
  62.  * NOTE #2: SOS !
  63.  *    XXX: if the previous old lock was a memory pointer,
  64.  *    then this old lock is pfreed !!!!!
  65.  * NOTE #3: SOS !
  66.  *      XXX: NO copy of the 'lock' or 'tuple' is made!
  67.  *
  68.  */
  69. extern
  70. void
  71. HeapTupleSetRuleLock ARGS((
  72.     HeapTuple    tuple,
  73.     Buffer        buffer,
  74.     RuleLock    lock
  75. ));
  76.  
  77. /*
  78.  * HeapTupleStoreRuleLock --
  79.  *    If a tuple has a "main memory" rule lock (i.e. a RuleLock)
  80.  *     thn it stores this lock to the relation (in the same page
  81.  *     as the tuple if possible).
  82.  *    Finally the tuple is linked to this new "disk" lock.
  83.  *
  84.  *    NOTE: (*DANGER*, DANGER Mr. Robinson......)
  85.  *    XXX:the old (main memory) lock is pfreed!!!!!!
  86.  */
  87. extern
  88. void
  89. HeapTupleStoreRuleLock ARGS((
  90.     HeapTuple    tuple,
  91.     Buffer        buffer
  92. ));
  93.  
  94. #endif    /* !defined(RAcIncluded) */
  95.