]> granicus.if.org Git - postgresql/blob - src/include/access/sdir.h
pgindent run over code.
[postgresql] / src / include / access / sdir.h
1 /*-------------------------------------------------------------------------
2  *
3  * sdir.h
4  *        POSTGRES scan direction definitions.
5  *
6  *
7  * Copyright (c) 1994, Regents of the University of California
8  *
9  * $Id: sdir.h,v 1.6 1999/05/25 16:13:34 momjian Exp $
10  *
11  *-------------------------------------------------------------------------
12  */
13 #ifndef SDIR_H
14 #define SDIR_H
15
16
17 /*
18  * ScanDirection was an int8 for no apparent reason. I kept the original
19  * values because I'm not sure if I'll break anything otherwise.  -ay 2/95
20  */
21 typedef enum ScanDirection
22 {
23         BackwardScanDirection = -1,
24         NoMovementScanDirection = 0,
25         ForwardScanDirection = 1
26 } ScanDirection;
27
28 /*
29  * ScanDirectionIsValid
30  *              True iff scan direction is valid.
31  */
32 #define ScanDirectionIsValid(direction) \
33         ((bool) (BackwardScanDirection <= direction && \
34                          direction <= ForwardScanDirection))
35
36 /*
37  * ScanDirectionIsBackward
38  *              True iff scan direction is backward.
39  */
40 #define ScanDirectionIsBackward(direction) \
41         ((bool) (direction == BackwardScanDirection))
42
43 /*
44  * ScanDirectionIsNoMovement
45  *              True iff scan direction indicates no movement.
46  */
47 #define ScanDirectionIsNoMovement(direction) \
48         ((bool) (direction == NoMovementScanDirection))
49
50 /*
51  * ScanDirectionIsForward
52  *              True iff scan direction is forward.
53  */
54 #define ScanDirectionIsForward(direction) \
55         ((bool) (direction == ForwardScanDirection))
56
57 #endif   /* SDIR_H */