aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-03-27 03:57:34 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-03-27 03:57:34 +0000
commit039dfbfd5d29e11da553f4a77a49ca52eafe8217 (patch)
tree2fecf592610135b5679c6e02acb5744efd5a099f /src/backend/parser
parent73b0300b2a9c170f67f5202f5003be10b529e0f5 (diff)
downloadpostgresql-039dfbfd5d29e11da553f4a77a49ca52eafe8217.tar.gz
postgresql-039dfbfd5d29e11da553f4a77a49ca52eafe8217.zip
Reduce the need for frontend programs to include "postgres.h" by refactoring
inclusions in src/include/catalog/*.h files. The main idea here is to push function declarations for src/backend/catalog/*.c files into separate headers, rather than sticking them into the corresponding catalog definition file as has been done in the past. This commit only carries out that idea fully for pg_proc, pg_type and pg_conversion, but that's enough for the moment --- if pg_list.h ever becomes unsafe for frontend code to include, we'll need to work a bit more. Zdenek Kotala
Diffstat (limited to 'src/backend/parser')
-rw-r--r--src/backend/parser/keywords.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/backend/parser/keywords.c b/src/backend/parser/keywords.c
index 301be227d9f..b5312a487fd 100644
--- a/src/backend/parser/keywords.c
+++ b/src/backend/parser/keywords.c
@@ -3,25 +3,34 @@
* keywords.c
* lexical token lookup for key words in PostgreSQL
*
+ * NB: This file is also used by pg_dump.
+ *
+ *
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/parser/keywords.c,v 1.194 2008/01/01 19:45:50 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/keywords.c,v 1.195 2008/03/27 03:57:33 tgl Exp $
*
*-------------------------------------------------------------------------
*/
-#include "postgres.h"
+
+/* Use c.h so that this file can be built in either frontend or backend */
+#include "c.h"
#include <ctype.h>
-#include "nodes/parsenodes.h"
-#include "parser/gramparse.h" /* required before parser/parse.h! */
+/*
+ * This macro definition overrides the YYSTYPE union definition in parse.h.
+ * We don't need that struct in this file, and including the real definition
+ * would require sucking in some backend-only include files.
+ */
+#define YYSTYPE int
+
#include "parser/keywords.h"
#include "parser/parse.h"
-/* NB: This file is also used by pg_dump. */
/*
* List of keyword (name, token-value, category) entries.