aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2016-03-23 20:22:08 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2016-03-23 20:22:08 -0400
commit2c6af4f44228d76d3351fe26f68b00b55cdd239a (patch)
tree6a5ce32658ba9ad51ea05d6f46ef0aaf44b1f244 /src/include
parent3df9c374e279db37b00cd9c86219471d0cdaa97c (diff)
downloadpostgresql-2c6af4f44228d76d3351fe26f68b00b55cdd239a.tar.gz
postgresql-2c6af4f44228d76d3351fe26f68b00b55cdd239a.zip
Move keywords.c/kwlookup.c into src/common/.
Now that we have src/common/ for code shared between frontend and backend, we can get rid of (most of) the klugy ways that the keyword table and keyword lookup code were formerly shared between different uses. This is a first step towards a more general plan of getting rid of special-purpose kluges for sharing code in src/bin/. I chose to merge kwlookup.c back into keywords.c, as it once was, and always has been so far as keywords.h is concerned. We could have kept them separate, but there is noplace that uses ScanKeywordLookup without also wanting access to the backend's keyword list, so there seems little point. ecpg is still a bit weird, but at least now the trickiness is documented. I think that the MSVC build script should require no adjustments beyond what's done here ... but we'll soon find out.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/common/keywords.h (renamed from src/include/parser/keywords.h)3
-rw-r--r--src/include/parser/gramparse.h4
-rw-r--r--src/include/parser/scanner.h2
3 files changed, 5 insertions, 4 deletions
diff --git a/src/include/parser/keywords.h b/src/include/common/keywords.h
index 4ac861646d6..577100d1b95 100644
--- a/src/include/parser/keywords.h
+++ b/src/include/common/keywords.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * src/include/parser/keywords.h
+ * src/include/common/keywords.h
*
*-------------------------------------------------------------------------
*/
@@ -31,6 +31,7 @@ typedef struct ScanKeyword
extern PGDLLIMPORT const ScanKeyword ScanKeywords[];
extern PGDLLIMPORT const int NumScanKeywords;
+
extern const ScanKeyword *ScanKeywordLookup(const char *text,
const ScanKeyword *keywords,
int num_keywords);
diff --git a/src/include/parser/gramparse.h b/src/include/parser/gramparse.h
index c3ec1992c65..6d8e4937ee0 100644
--- a/src/include/parser/gramparse.h
+++ b/src/include/parser/gramparse.h
@@ -4,8 +4,8 @@
* Shared definitions for the "raw" parser (flex and bison phases only)
*
* NOTE: this file is only meant to be included in the core parsing files,
- * ie, parser.c, gram.y, scan.l, and keywords.c. Definitions that are needed
- * outside the core parser should be in parser.h.
+ * ie, parser.c, gram.y, scan.l, and src/common/keywords.c.
+ * Definitions that are needed outside the core parser should be in parser.h.
*
*
* Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
diff --git a/src/include/parser/scanner.h b/src/include/parser/scanner.h
index 0060501937f..b885e67a83b 100644
--- a/src/include/parser/scanner.h
+++ b/src/include/parser/scanner.h
@@ -19,7 +19,7 @@
#ifndef SCANNER_H
#define SCANNER_H
-#include "parser/keywords.h"
+#include "common/keywords.h"
/*
* The scanner returns extra data about scanned tokens in this union type.