Consistently use "superuser" instead of "super user"
[pgsql.git] / src / include / storage / off.h
bloba5df0ab219dd30235309ee74fde7776843bfcc31
1 /*-------------------------------------------------------------------------
3 * off.h
4 * POSTGRES disk "offset" definitions.
7 * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
10 * src/include/storage/off.h
12 *-------------------------------------------------------------------------
14 #ifndef OFF_H
15 #define OFF_H
17 #include "storage/itemid.h"
19 * OffsetNumber:
21 * this is a 1-based index into the linp (ItemIdData) array in the
22 * header of each disk page.
24 typedef uint16 OffsetNumber;
26 #define InvalidOffsetNumber ((OffsetNumber) 0)
27 #define FirstOffsetNumber ((OffsetNumber) 1)
28 #define MaxOffsetNumber ((OffsetNumber) (BLCKSZ / sizeof(ItemIdData)))
30 /* ----------------
31 * support macros
32 * ----------------
36 * OffsetNumberIsValid
37 * True iff the offset number is valid.
39 #define OffsetNumberIsValid(offsetNumber) \
40 ((bool) ((offsetNumber != InvalidOffsetNumber) && \
41 (offsetNumber <= MaxOffsetNumber)))
44 * OffsetNumberNext
45 * OffsetNumberPrev
46 * Increments/decrements the argument. These macros look pointless
47 * but they help us disambiguate the different manipulations on
48 * OffsetNumbers (e.g., sometimes we subtract one from an
49 * OffsetNumber to move back, and sometimes we do so to form a
50 * real C array index).
52 #define OffsetNumberNext(offsetNumber) \
53 ((OffsetNumber) (1 + (offsetNumber)))
54 #define OffsetNumberPrev(offsetNumber) \
55 ((OffsetNumber) (-1 + (offsetNumber)))
57 #endif /* OFF_H */