1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-24 00:23:06 +03:00

Restructure the key include files per recent pghackers discussion: there

are now separate files "postgres.h" and "postgres_fe.h", which are meant
to be the primary include files for backend .c files and frontend .c files
respectively.  By default, only include files meant for frontend use are
installed into the installation include directory.  There is a new make
target 'make install-all-headers' that adds the whole content of the
src/include tree to the installed fileset, for use by people who want to
develop server-side code without keeping the complete source tree on hand.
Cleaned up a whole lot of crufty and inconsistent header inclusions.
This commit is contained in:
Tom Lane
2001-02-10 02:31:31 +00:00
parent cf21985ab5
commit d08741eab5
144 changed files with 1088 additions and 1279 deletions

View File

@@ -5,9 +5,10 @@
*
*-------------------------------------------------------------------------
*/
#include "postgres_fe.h"
#include <ctype.h>
#include "postgres.h"
#include "extern.h"
#include "preproc.h"

View File

@@ -2,7 +2,8 @@
* functions needed for descriptor handling
*/
#include "postgres.h"
#include "postgres_fe.h"
#include "extern.h"
/*

View File

@@ -2,8 +2,9 @@
/* (C) Michael Meskes <meskes@postgresql.org> Feb 5th, 1998 */
/* Placed under the same copyright as PostgresSQL */
#include "postgres_fe.h"
#include <unistd.h>
#include "postgres.h"
#ifdef HAVE_GETOPT_H
#include "getopt.h"

View File

@@ -5,9 +5,10 @@
*
*-------------------------------------------------------------------------
*/
#include "postgres_fe.h"
#include <ctype.h>
#include "postgres.h"
#include "extern.h"
#include "preproc.h"

View File

@@ -1,5 +1,5 @@
#include "parser/keywords.h"
#include "type.h"
#include <errno.h>
/* defines */
@@ -74,6 +74,7 @@ extern void reset_variables(void);
extern void check_indicator(struct ECPGtype *);
extern void remove_variables(int);
extern struct variable *new_variable(const char *, struct ECPGtype *);
extern ScanKeyword *ScanKeywordLookup(char *text);
/* return codes */

View File

@@ -8,18 +8,16 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.36 2001/01/24 19:43:29 momjian Exp $
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.37 2001/02/10 02:31:29 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "postgres_fe.h"
#include <ctype.h>
#include "postgres.h"
#include "nodes/parsenodes.h"
#include "nodes/pg_list.h"
#include "type.h"
#include "extern.h"
#include "preproc.h"
#include "parser/keywords.h"
/*
* List of (keyword-name, keyword-token-value) pairs.

View File

@@ -1,6 +1,5 @@
#include <stdarg.h>
#include "postgres_fe.h"
#include "postgres.h"
#include "extern.h"
void

View File

@@ -12,23 +12,19 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.75 2001/02/09 15:13:49 momjian Exp $
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.76 2001/02/10 02:31:29 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "postgres_fe.h"
#include <ctype.h>
#include <sys/types.h>
#include <limits.h>
#include <errno.h>
#include "postgres.h"
#include "miscadmin.h"
#include "nodes/parsenodes.h"
#include "nodes/pg_list.h"
#include "parser/scansup.h"
#include "extern.h"
#include "preproc.h"
#include "utils/builtins.h"
/* some versions of lex define this as a macro */
#if defined(yywrap)

View File

@@ -1,13 +1,6 @@
/* Copyright comment */
%{
#include <stdarg.h>
#include "postgres.h"
#include "access/htup.h"
#include "catalog/catname.h"
#include "utils/numeric.h"
#include "utils/memutils.h"
#include "storage/bufpage.h"
#include "postgres_fe.h"
#include "extern.h"
@@ -2976,10 +2969,6 @@ Geometric: PATH_P { $$ = make_str("path"); };
opt_float: '(' PosIntConst ')'
{
if (atol($2) < 1)
mmerror(ET_ERROR, "precision for FLOAT must be at least 1");
else if (atol($2) >= 16)
mmerror(ET_ERROR, "precision for FLOAT must be less than 16");
$$ = cat_str(3, make_str("("), $2, make_str(")"));
}
| /*EMPTY*/
@@ -2990,22 +2979,10 @@ opt_float: '(' PosIntConst ')'
opt_numeric: '(' PosIntConst ',' PosIntConst ')'
{
if (atol($2) < 1 || atol($2) > NUMERIC_MAX_PRECISION) {
sprintf(errortext, "NUMERIC precision %s must be between 1 and %d", $2, NUMERIC_MAX_PRECISION);
mmerror(ET_ERROR, errortext);
}
if (atol($4) < 0 || atol($4) > atol($2)) {
sprintf(errortext, "NUMERIC scale %s must be between 0 and precision %s", $4, $2);
mmerror(ET_ERROR, errortext);
}
$$ = cat_str(5, make_str("("), $2, make_str(","), $4, make_str(")"));
}
| '(' PosIntConst ')'
{
if (atol($2) < 1 || atol($2) > NUMERIC_MAX_PRECISION) {
sprintf(errortext, "NUMERIC precision %s must be between 1 and %d", $2, NUMERIC_MAX_PRECISION);
mmerror(ET_ERROR, errortext);
}
$$ = cat_str(3, make_str("("), $2, make_str(")"));
}
| /*EMPTY*/
@@ -3016,22 +2993,10 @@ opt_numeric: '(' PosIntConst ',' PosIntConst ')'
opt_decimal: '(' PosIntConst ',' PosIntConst ')'
{
if (atol($2) < 1 || atol($2) > NUMERIC_MAX_PRECISION) {
sprintf(errortext, "NUMERIC precision %s must be between 1 and %d", $2, NUMERIC_MAX_PRECISION);
mmerror(ET_ERROR, errortext);
}
if (atol($4) < 0 || atol($4) > atol($2)) {
sprintf(errortext, "NUMERIC scale %s must be between 0 and precision %s", $4, $2);
mmerror(ET_ERROR, errortext);
}
$$ = cat_str(5, make_str("("), $2, make_str(","), $4, make_str(")"));
}
| '(' PosIntConst ')'
{
if (atol($2) < 1 || atol($2) > NUMERIC_MAX_PRECISION) {
sprintf(errortext, "NUMERIC precision %s must be between 1 and %d", $2, NUMERIC_MAX_PRECISION);
mmerror(ET_ERROR, errortext);
}
$$ = cat_str(3, make_str("("), $2, make_str(")"));
}
| /*EMPTY*/
@@ -3045,23 +3010,12 @@ opt_decimal: '(' PosIntConst ',' PosIntConst ')'
* The following implements BIT() and BIT VARYING().
*/
Bit: bit '(' PosIntConst ')'
{
$$ = cat_str(4, $1, make_str("("), $3, make_str(")"));
if (atol($3) < 1)
{
sprintf(errortext,"length for type '%s' must be at least 1",$1);
mmerror(ET_ERROR, errortext);
}
else if (atol($3) > (MaxAttrSize * BITS_PER_BYTE))
{
sprintf(errortext, "length for type '%s' cannot exceed %d", $1,
(MaxAttrSize * BITS_PER_BYTE));
mmerror(ET_ERROR, errortext);
}
}
{
$$ = cat_str(4, $1, make_str("("), $3, make_str(")"));
}
| bit
{
$$ = $1;
{
$$ = $1;
}
;
@@ -3077,17 +3031,6 @@ bit: BIT opt_varying
*/
Character: character '(' PosIntConst ')'
{
if (atol($3) < 1)
{
sprintf(errortext, "length for type '%s' type must be at least 1",$1);
mmerror(ET_ERROR, errortext);
}
else if (atol($3) > MaxAttrSize)
{
sprintf(errortext, "length for type '%s' cannot exceed %d", $1, MaxAttrSize);
mmerror(ET_ERROR, errortext);
}
$$ = cat_str(4, $1, make_str("("), $3, make_str(")"));
}
| character
@@ -3730,14 +3673,7 @@ relation_name: SpecialRuleRelation
}
| ColId
{
/* disallow refs to variable system tables */
if (strcmp(LogRelationName, $1) == 0
|| strcmp(VariableRelationName, $1) == 0) {
sprintf(errortext, make_str("%s cannot be accessed by users"),$1);
mmerror(ET_ERROR, errortext);
}
else
$$ = $1;
$$ = $1;
}
;

View File

@@ -1,8 +1,5 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "postgres_fe.h"
#include "postgres.h"
#include "extern.h"
/* malloc + error check */

View File

@@ -163,3 +163,9 @@ struct fetch_desc
char *str;
char *name;
};
typedef struct ScanKeyword
{
char *name;
int value;
} ScanKeyword;

View File

@@ -1,4 +1,4 @@
#include "postgres.h"
#include "postgres_fe.h"
#include "extern.h"