1 /*-------------------------------------------------------------------------
4 * Standard POSTGRES buffer page item identifier definitions.
7 * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
10 * $PostgreSQL: pgsql/src/include/storage/itemid.h,v 1.27 2007/01/05 22:19:58 momjian Exp $
12 *-------------------------------------------------------------------------
18 * An item pointer (also called line pointer) on a buffer page
20 typedef struct ItemIdData
22 unsigned lp_off:15, /* offset to start of tuple */
23 lp_flags:2, /* flags for tuple */
24 lp_len:15; /* length of tuple */
27 typedef ItemIdData *ItemId;
30 * lp_flags contains these flags:
32 #define LP_USED 0x01 /* this line pointer is being used */
34 #define LP_DELETE 0x02 /* item is to be deleted */
36 #define ItemIdDeleted(itemId) \
37 (((itemId)->lp_flags & LP_DELETE) != 0)
40 * This bit may be passed to PageAddItem together with
41 * LP_USED & LP_DELETE bits to specify overwrite mode
43 #define OverwritePageMode 0x10
46 * Item offsets, lengths, and flags are represented by these types when
47 * they're not actually stored in an ItemIdData.
49 typedef uint16 ItemOffset;
50 typedef uint16 ItemLength;
52 typedef bits16 ItemIdFlags;
63 #define ItemIdGetLength(itemId) \
69 #define ItemIdGetOffset(itemId) \
75 #define ItemIdGetFlags(itemId) \
80 * True iff disk item identifier is valid.
82 #define ItemIdIsValid(itemId) PointerIsValid(itemId)
86 * True iff disk item identifier is in use.
89 * Assumes disk item identifier is valid.
91 #define ItemIdIsUsed(itemId) \
93 AssertMacro(ItemIdIsValid(itemId)), \
94 (bool) (((itemId)->lp_flags & LP_USED) != 0) \