1996-08-27 23:50:29 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
1999-02-14 00:22:53 +01:00
|
|
|
* sdir.h
|
1997-09-07 07:04:48 +02:00
|
|
|
* POSTGRES scan direction definitions.
|
1996-08-27 23:50:29 +02:00
|
|
|
*
|
|
|
|
*
|
2012-01-02 00:01:58 +01:00
|
|
|
* Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group
|
2000-01-26 06:58:53 +01:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
1996-08-27 23:50:29 +02:00
|
|
|
*
|
2010-09-20 22:08:53 +02:00
|
|
|
* src/include/access/sdir.h
|
1996-08-27 23:50:29 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
1997-09-07 07:04:48 +02:00
|
|
|
#ifndef SDIR_H
|
1996-08-27 23:50:29 +02:00
|
|
|
#define SDIR_H
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* ScanDirection was an int8 for no apparent reason. I kept the original
|
|
|
|
* values because I'm not sure if I'll break anything otherwise. -ay 2/95
|
|
|
|
*/
|
1997-09-07 07:04:48 +02:00
|
|
|
typedef enum ScanDirection
|
|
|
|
{
|
2001-10-28 07:26:15 +01:00
|
|
|
BackwardScanDirection = -1,
|
|
|
|
NoMovementScanDirection = 0,
|
|
|
|
ForwardScanDirection = 1
|
1996-08-27 23:50:29 +02:00
|
|
|
} ScanDirection;
|
|
|
|
|
|
|
|
/*
|
1999-05-25 18:15:34 +02:00
|
|
|
* ScanDirectionIsValid
|
1997-09-07 07:04:48 +02:00
|
|
|
* True iff scan direction is valid.
|
1996-08-27 23:50:29 +02:00
|
|
|
*/
|
|
|
|
#define ScanDirectionIsValid(direction) \
|
2000-11-03 00:11:03 +01:00
|
|
|
((bool) (BackwardScanDirection <= (direction) && \
|
|
|
|
(direction) <= ForwardScanDirection))
|
1996-08-27 23:50:29 +02:00
|
|
|
|
|
|
|
/*
|
1999-05-25 18:15:34 +02:00
|
|
|
* ScanDirectionIsBackward
|
1997-09-07 07:04:48 +02:00
|
|
|
* True iff scan direction is backward.
|
1996-08-27 23:50:29 +02:00
|
|
|
*/
|
|
|
|
#define ScanDirectionIsBackward(direction) \
|
2000-11-03 00:11:03 +01:00
|
|
|
((bool) ((direction) == BackwardScanDirection))
|
1996-08-27 23:50:29 +02:00
|
|
|
|
|
|
|
/*
|
1999-05-25 18:15:34 +02:00
|
|
|
* ScanDirectionIsNoMovement
|
1997-09-07 07:04:48 +02:00
|
|
|
* True iff scan direction indicates no movement.
|
1996-08-27 23:50:29 +02:00
|
|
|
*/
|
|
|
|
#define ScanDirectionIsNoMovement(direction) \
|
2000-11-03 00:11:03 +01:00
|
|
|
((bool) ((direction) == NoMovementScanDirection))
|
1996-08-27 23:50:29 +02:00
|
|
|
|
|
|
|
/*
|
1999-05-25 18:15:34 +02:00
|
|
|
* ScanDirectionIsForward
|
1997-09-07 07:04:48 +02:00
|
|
|
* True iff scan direction is forward.
|
1996-08-27 23:50:29 +02:00
|
|
|
*/
|
|
|
|
#define ScanDirectionIsForward(direction) \
|
2000-11-03 00:11:03 +01:00
|
|
|
((bool) ((direction) == ForwardScanDirection))
|
2001-10-28 07:26:15 +01:00
|
|
|
|
2001-11-05 18:46:40 +01:00
|
|
|
#endif /* SDIR_H */
|