PostgreSQL Source Code
git master
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
c
d
g
h
i
k
l
m
p
r
s
t
Functions
Variables
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
Data Fields
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
c
d
f
h
i
n
o
p
r
s
t
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
sdir.h
Go to the documentation of this file.
1
/*-------------------------------------------------------------------------
2
*
3
* sdir.h
4
* POSTGRES scan direction definitions.
5
*
6
*
7
* Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
8
* Portions Copyright (c) 1994, Regents of the University of California
9
*
10
* src/include/access/sdir.h
11
*
12
*-------------------------------------------------------------------------
13
*/
14
#ifndef SDIR_H
15
#define SDIR_H
16
17
18
/*
19
* Defines the direction for scanning a table or an index. Scans are never
20
* invoked using NoMovementScanDirection. For convenience, we use the values
21
* -1 and 1 for backward and forward scans. This allows us to perform a few
22
* mathematical tricks such as what is done in ScanDirectionCombine.
23
*/
24
typedef
enum
ScanDirection
25
{
26
BackwardScanDirection
= -1,
27
NoMovementScanDirection
= 0,
28
ForwardScanDirection
= 1
29
}
ScanDirection
;
30
31
/*
32
* Determine the net effect of two direction specifications.
33
* This relies on having ForwardScanDirection = +1, BackwardScanDirection = -1,
34
* and will probably not do what you want if applied to any other values.
35
*/
36
#define ScanDirectionCombine(a, b) ((a) * (b))
37
38
/*
39
* ScanDirectionIsValid
40
* True iff scan direction is valid.
41
*/
42
#define ScanDirectionIsValid(direction) \
43
((bool) (BackwardScanDirection <= (direction) && \
44
(direction) <= ForwardScanDirection))
45
46
/*
47
* ScanDirectionIsBackward
48
* True iff scan direction is backward.
49
*/
50
#define ScanDirectionIsBackward(direction) \
51
((bool) ((direction) == BackwardScanDirection))
52
53
/*
54
* ScanDirectionIsNoMovement
55
* True iff scan direction indicates no movement.
56
*/
57
#define ScanDirectionIsNoMovement(direction) \
58
((bool) ((direction) == NoMovementScanDirection))
59
60
/*
61
* ScanDirectionIsForward
62
* True iff scan direction is forward.
63
*/
64
#define ScanDirectionIsForward(direction) \
65
((bool) ((direction) == ForwardScanDirection))
66
67
#endif
/* SDIR_H */
ScanDirection
ScanDirection
Definition:
sdir.h:25
NoMovementScanDirection
@ NoMovementScanDirection
Definition:
sdir.h:27
BackwardScanDirection
@ BackwardScanDirection
Definition:
sdir.h:26
ForwardScanDirection
@ ForwardScanDirection
Definition:
sdir.h:28
src
include
access
sdir.h
Generated on Mon Apr 14 2025 18:13:26 for PostgreSQL Source Code by
1.9.4