summaryrefslogtreecommitdiff
path: root/src/include/access/genam.h
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2008-06-19 00:46:06 +0000
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2008-06-19 00:46:06 +0000
commita3540b0f657c6352ae91884a9ee47c67395ce122 (patch)
treec0447efbf3f5a885f29d080e4005ff5562484513 /src/include/access/genam.h
parentd1da215d325a1b8923def0a59cf2b948186164c8 (diff)
downloadpostgresql-a3540b0f657c6352ae91884a9ee47c67395ce122.tar.gz
Improve our #include situation by moving pointer types away from the
corresponding struct definitions. This allows other headers to avoid including certain highly-loaded headers such as rel.h and relscan.h, instead using just relcache.h, heapam.h or genam.h, which are more lightweight and thus cause less unnecessary dependencies.
Diffstat (limited to 'src/include/access/genam.h')
-rw-r--r--src/include/access/genam.h27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/include/access/genam.h b/src/include/access/genam.h
index c59c3b9d52..3667c7c843 100644
--- a/src/include/access/genam.h
+++ b/src/include/access/genam.h
@@ -7,19 +7,20 @@
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/access/genam.h,v 1.73 2008/06/08 22:41:04 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/access/genam.h,v 1.74 2008/06/19 00:46:05 alvherre Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef GENAM_H
#define GENAM_H
-#include "access/relscan.h"
#include "access/sdir.h"
+#include "access/skey.h"
#include "nodes/tidbitmap.h"
#include "storage/buf.h"
#include "storage/lock.h"
-#include "utils/rel.h"
+#include "utils/relcache.h"
+#include "utils/snapshot.h"
/*
* Struct for statistics returned by ambuild
@@ -73,21 +74,21 @@ typedef struct IndexBulkDeleteResult
/* Typedef for callback function to determine if a tuple is bulk-deletable */
typedef bool (*IndexBulkDeleteCallback) (ItemPointer itemptr, void *state);
-/* Struct for heap-or-index scans of system tables */
-typedef struct SysScanDescData
-{
- Relation heap_rel; /* catalog being scanned */
- Relation irel; /* NULL if doing heap scan */
- HeapScanDesc scan; /* only valid in heap-scan case */
- IndexScanDesc iscan; /* only valid in index-scan case */
-} SysScanDescData;
-
-typedef SysScanDescData *SysScanDesc;
+/* struct definitions appear in relscan.h */
+typedef struct IndexScanDescData *IndexScanDesc;
+typedef struct SysScanDescData *SysScanDesc;
/*
* generalized index_ interface routines (in indexam.c)
*/
+
+/*
+ * IndexScanIsValid
+ * True iff the index scan is valid.
+ */
+#define IndexScanIsValid(scan) PointerIsValid(scan)
+
extern Relation index_open(Oid relationId, LOCKMODE lockmode);
extern void index_close(Relation relation, LOCKMODE lockmode);