Header And Logo

PostgreSQL
| The world's most advanced open source database.

sdir.h

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  * sdir.h
00004  *    POSTGRES scan direction definitions.
00005  *
00006  *
00007  * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
00008  * Portions Copyright (c) 1994, Regents of the University of California
00009  *
00010  * src/include/access/sdir.h
00011  *
00012  *-------------------------------------------------------------------------
00013  */
00014 #ifndef SDIR_H
00015 #define SDIR_H
00016 
00017 
00018 /*
00019  * ScanDirection was an int8 for no apparent reason. I kept the original
00020  * values because I'm not sure if I'll break anything otherwise.  -ay 2/95
00021  */
00022 typedef enum ScanDirection
00023 {
00024     BackwardScanDirection = -1,
00025     NoMovementScanDirection = 0,
00026     ForwardScanDirection = 1
00027 } ScanDirection;
00028 
00029 /*
00030  * ScanDirectionIsValid
00031  *      True iff scan direction is valid.
00032  */
00033 #define ScanDirectionIsValid(direction) \
00034     ((bool) (BackwardScanDirection <= (direction) && \
00035              (direction) <= ForwardScanDirection))
00036 
00037 /*
00038  * ScanDirectionIsBackward
00039  *      True iff scan direction is backward.
00040  */
00041 #define ScanDirectionIsBackward(direction) \
00042     ((bool) ((direction) == BackwardScanDirection))
00043 
00044 /*
00045  * ScanDirectionIsNoMovement
00046  *      True iff scan direction indicates no movement.
00047  */
00048 #define ScanDirectionIsNoMovement(direction) \
00049     ((bool) ((direction) == NoMovementScanDirection))
00050 
00051 /*
00052  * ScanDirectionIsForward
00053  *      True iff scan direction is forward.
00054  */
00055 #define ScanDirectionIsForward(direction) \
00056     ((bool) ((direction) == ForwardScanDirection))
00057 
00058 #endif   /* SDIR_H */