home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / postgres / postgre4.z / postgre4 / src / storage / page / internal.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-27  |  1.0 KB  |  44 lines

  1. /*
  2.  * item/internal.h --
  3.  *    Internal definitions.
  4.  *
  5.  * Identification:
  6.  *    $Header: /private/postgres/src/storage/page/RCS/internal.h,v 1.5 1991/04/28 09:14:32 cimarron Exp $
  7.  */
  8.  
  9. #ifndef    InternalIncluded    /* Include this file only once. */
  10. #define InternalIncluded    1
  11.  
  12. #include "tmp/c.h"
  13.  
  14. #include "storage/part.h"
  15.  
  16. /*
  17.  * PagePartitionGetNumberOfPageBits --
  18.  *    Returns the number of bits needed to represent a page.
  19.  */
  20. #define PagePartitionGetNumberOfPageBits(partition)    (partition)
  21.  
  22. /*
  23.  * PagePartitionGetNumberOfOffsetBits --
  24.  *    Returns the number of bits needed to represent a offset.
  25.  */
  26. #define PagePartitionGetNumberOfOffsetBits(partition)\
  27.     (16 - PagePartitionGetNumberOfPageBits(partition))
  28.  
  29. /*
  30.  * PageNumberMask --
  31.  *    Mask for a page number.
  32.  */
  33. #define PageNumberMask(partition)\
  34.     (0xffff & (0xffff << PagePartitionGetNumberOfOffsetBits(partition)))
  35.  
  36. /*
  37.  * OffsetNumberMask --
  38.  *    Mask for an offset number.
  39.  */
  40. #define OffsetNumberMask(partition)\
  41.     (0xffff >> PagePartitionGetNumberOfPageBits(partition))
  42.  
  43. #endif    /* !defined(InternalIncluded) */
  44.