]> granicus.if.org Git - postgresql/blob - src/include/access/relscan.h
OK, folks, here is the pgindent output.
[postgresql] / src / include / access / relscan.h
1 /*-------------------------------------------------------------------------
2  *
3  * relscan.h--
4  *        POSTGRES internal relation scan descriptor definitions.
5  *
6  *
7  * Copyright (c) 1994, Regents of the University of California
8  *
9  * $Id: relscan.h,v 1.12 1998/09/01 04:34:23 momjian Exp $
10  *
11  *-------------------------------------------------------------------------
12  */
13 #ifndef RELSCAN_H
14 #define RELSCAN_H
15
16 #include <storage/buf.h>
17 #include <utils/rel.h>
18 #include <access/htup.h>
19 #include <utils/tqual.h>
20
21 typedef ItemPointerData MarkData;
22
23 typedef struct HeapScanDescData
24 {
25         Relation        rs_rd;                  /* pointer to relation descriptor */
26         HeapTuple       rs_ptup;                /* previous tuple in scan */
27         HeapTuple       rs_ctup;                /* current tuple in scan */
28         HeapTuple       rs_ntup;                /* next tuple in scan */
29         Buffer          rs_pbuf;                /* previous buffer in scan */
30         Buffer          rs_cbuf;                /* current buffer in scan */
31         Buffer          rs_nbuf;                /* next buffer in scan */
32         ItemPointerData rs_mptid;       /* marked previous tid */
33         ItemPointerData rs_mctid;       /* marked current tid */
34         ItemPointerData rs_mntid;       /* marked next tid */
35         ItemPointerData rs_mcd;         /* marked current delta XXX ??? */
36         Snapshot        rs_snapshot;    /* snapshot to see */
37         bool            rs_atend;               /* restart scan at end? */
38         uint16          rs_cdelta;              /* current delta in chain */
39         uint16          rs_nkeys;               /* number of attributes in keys */
40         ScanKey         rs_key;                 /* key descriptors */
41 } HeapScanDescData;
42
43 typedef HeapScanDescData *HeapScanDesc;
44
45 typedef struct IndexScanDescData
46 {
47         Relation        relation;               /* relation descriptor */
48         void       *opaque;                     /* am-specific slot */
49         ItemPointerData previousItemData;       /* previous index pointer */
50         ItemPointerData currentItemData;        /* current index pointer */
51         ItemPointerData nextItemData;           /* next index pointer */
52         MarkData        previousMarkData;               /* marked previous pointer */
53         MarkData        currentMarkData;/* marked current  pointer */
54         MarkData        nextMarkData;   /* marked next pointer */
55         uint8           flags;                  /* scan position flags */
56         bool            scanFromEnd;    /* restart scan at end? */
57         uint16          numberOfKeys;   /* number of key attributes */
58         ScanKey         keyData;                /* key descriptor */
59 } IndexScanDescData;
60
61 typedef IndexScanDescData *IndexScanDesc;
62
63 /* ----------------
64  *              IndexScanDescPtr is used in the executor where we have to
65  *              keep track of several index scans when using several indices
66  *              - cim 9/10/89
67  * ----------------
68  */
69 typedef IndexScanDesc *IndexScanDescPtr;
70
71 /*
72  * HeapScanIsValid --
73  *              True iff the heap scan is valid.
74  */
75 #define HeapScanIsValid(scan) PointerIsValid(scan)
76
77 /*
78  * IndexScanIsValid --
79  *              True iff the index scan is valid.
80  */
81 #define IndexScanIsValid(scan) PointerIsValid(scan)
82
83 #endif   /* RELSCAN_H */