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

  1. /* ----------------------------------------------------------------
  2.  *   FILE
  3.  *    iqual.h
  4.  *
  5.  *   DESCRIPTION
  6.  *    Index scan key qualification definitions.
  7.  *
  8.  *   IDENTIFICATION
  9.  *    $Header: /private/postgres/src/lib/H/access/RCS/iqual.h,v 1.3 1991/05/01 02:50:09 cimarron Exp $
  10.  * ----------------------------------------------------------------
  11.  */
  12.  
  13. #ifndef    IQualDefined    /* Include this file only once. */
  14. #define IQualDefined    1
  15.  
  16. #include "tmp/c.h"
  17.  
  18. #include "storage/itemid.h"
  19. #include "utils/rel.h"
  20. #include "access/skey.h"
  21.  
  22. /* ----------------
  23.  *    index tuple qualification support
  24.  * ----------------
  25.  */
  26.  
  27. /* 
  28.  *    index_keytest
  29.  *    index_satisifies
  30.  */
  31. extern
  32. bool
  33. index_keytest ARGS((
  34.     IndexTuple        tuple,
  35.     TupleDescriptor tupdesc,
  36.     ScanKeySize        scanKeySize,
  37.     ScanKey        key
  38. ));            
  39.  
  40. extern
  41. bool
  42. index_satisifies ARGS((
  43.     ItemId    itemId,
  44.     Page    page,
  45.     Relation    relation,
  46.     ScanKeySize    scanKeySize,
  47.     ScanKey    key
  48. ));
  49.  
  50. /* ----------------
  51.  *    old interface macros
  52.  * ----------------
  53.  */
  54. /*
  55.  * ikeytest_tupdesc
  56.  * ikeytest
  57.  */
  58. #define ikeytest_tupdesc(tuple, tupdesc, scanKeySize, key) \
  59.     index_keytest(tuple, tupdesc, scanKeySize, key)
  60.  
  61. #define ikeytest(tuple, relation, scanKeySize, key) \
  62.     index_keytest(tuple, \
  63.           RelationGetTupleDescriptor(relation), scanKeySize, key)
  64.  
  65. /*
  66.  * ItemIdSatisfiesScanKey --
  67.  *    Returns true iff item associated with an item identifier satisifes
  68.  *    the index scan key qualification.
  69.  *
  70.  * Note:
  71.  *    Assumes item identifier is valid.
  72.  *    Assumes standard page.
  73.  *    Assumes relation is valid.
  74.  *    Assumes scan key is valid.
  75.  */
  76. #define ItemIdSatisfiesScanKey(itemId, page, relation, scanKeySize, key) \
  77.     index_satisifies(itemId, page, relation, scanKeySize, key)
  78.  
  79. #endif    /* !defined(IQualDefined) */
  80.