mirror of
https://github.com/postgres/postgres.git
synced 2025-11-21 00:42:43 +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:
@@ -1,4 +1,4 @@
|
||||
#include "postgres.h"
|
||||
#include "postgres_fe.h"
|
||||
#include "libpq-fe.h"
|
||||
|
||||
/* Here are some methods used by the lib. */
|
||||
|
||||
@@ -5,9 +5,10 @@
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#include "postgres_fe.h"
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
#include "postgres.h"
|
||||
#include "extern.h"
|
||||
#include "preproc.h"
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
* functions needed for descriptor handling
|
||||
*/
|
||||
|
||||
#include "postgres.h"
|
||||
#include "postgres_fe.h"
|
||||
|
||||
#include "extern.h"
|
||||
|
||||
/*
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -5,9 +5,10 @@
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#include "postgres_fe.h"
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
#include "postgres.h"
|
||||
#include "extern.h"
|
||||
#include "preproc.h"
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <stdarg.h>
|
||||
#include "postgres_fe.h"
|
||||
|
||||
#include "postgres.h"
|
||||
#include "extern.h"
|
||||
|
||||
void
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
;
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -163,3 +163,9 @@ struct fetch_desc
|
||||
char *str;
|
||||
char *name;
|
||||
};
|
||||
|
||||
typedef struct ScanKeyword
|
||||
{
|
||||
char *name;
|
||||
int value;
|
||||
} ScanKeyword;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "postgres.h"
|
||||
#include "postgres_fe.h"
|
||||
|
||||
#include "extern.h"
|
||||
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtcl.c,v 1.19 2001/01/24 19:43:29 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtcl.c,v 1.20 2001/02/10 02:31:29 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "postgres.h"
|
||||
#include "postgres_fe.h"
|
||||
#include "libpgtcl.h"
|
||||
#include "pgtclCmds.h"
|
||||
#include "pgtclId.h"
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtclCmds.c,v 1.53 2001/01/24 19:43:29 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtclCmds.c,v 1.54 2001/02/10 02:31:29 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#include "postgres_fe.h"
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
#include "postgres.h"
|
||||
#include "pgtclCmds.h"
|
||||
#include "pgtclId.h"
|
||||
#include "libpq/libpq-fs.h" /* large-object interface */
|
||||
|
||||
@@ -13,14 +13,14 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtclId.c,v 1.24 2001/01/24 19:43:29 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtclId.c,v 1.25 2001/02/10 02:31:29 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#include "postgres_fe.h"
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#include "postgres.h"
|
||||
#include "pgtclCmds.h"
|
||||
#include "pgtclId.h"
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: pgconnection.h,v 1.9 2001/01/24 19:43:32 momjian Exp $
|
||||
* $Id: pgconnection.h,v 1.10 2001/02/10 02:31:30 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -38,7 +38,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
extern "C" {
|
||||
#include "postgres.h"
|
||||
#include "postgres_fe.h"
|
||||
#include "libpq-fe.h"
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* exceed INITIAL_EXPBUFFER_SIZE (currently 256 bytes).
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-auth.c,v 1.45 2001/01/24 19:43:29 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-auth.c,v 1.46 2001/02/10 02:31:30 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -28,9 +28,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef WIN32
|
||||
#include "postgres.h"
|
||||
#endif
|
||||
#include "postgres_fe.h"
|
||||
|
||||
#include "libpq-fe.h"
|
||||
#include "libpq-int.h"
|
||||
#include "fe-auth.h"
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.159 2001/01/24 19:43:30 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.160 2001/02/10 02:31:30 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "postgres.h"
|
||||
#include "postgres_fe.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <fcntl.h>
|
||||
@@ -45,7 +45,6 @@
|
||||
#endif
|
||||
|
||||
#ifdef MULTIBYTE
|
||||
#include "miscadmin.h"
|
||||
#include "mb/pg_wchar.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -8,15 +8,16 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.100 2001/02/06 02:02:27 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.101 2001/02/10 02:31:30 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#include "postgres_fe.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <ctype.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "postgres.h"
|
||||
#include "libpq-fe.h"
|
||||
#include "libpq-int.h"
|
||||
|
||||
|
||||
@@ -8,15 +8,15 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-lobj.c,v 1.32 2001/01/24 19:43:30 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-lobj.c,v 1.33 2001/02/10 02:31:30 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#include "postgres_fe.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "postgres.h"
|
||||
#include "libpq-fe.h"
|
||||
#include "libpq-int.h"
|
||||
|
||||
|
||||
@@ -25,12 +25,12 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.43 2001/01/24 19:43:30 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.44 2001/02/10 02:31:30 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "postgres.h"
|
||||
#include "postgres_fe.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#include "win32.h"
|
||||
@@ -52,7 +52,6 @@
|
||||
#include "pqsignal.h"
|
||||
|
||||
#ifdef MULTIBYTE
|
||||
#include "miscadmin.h"
|
||||
#include "mb/pg_wchar.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
* didn't really belong there.
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-print.c,v 1.40 2001/01/24 19:43:31 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-print.c,v 1.41 2001/02/10 02:31:30 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#include "postgres.h"
|
||||
#include "postgres_fe.h"
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: libpq-int.h,v 1.31 2001/01/24 19:43:31 momjian Exp $
|
||||
* $Id: libpq-int.h,v 1.32 2001/02/10 02:31:30 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -21,6 +21,7 @@
|
||||
#define LIBPQ_INT_H
|
||||
|
||||
/* We assume libpq-fe.h has already been included. */
|
||||
#include "postgres_fe.h"
|
||||
|
||||
/* include stuff common to fe and be */
|
||||
#include "libpq/pqcomm.h"
|
||||
|
||||
@@ -17,17 +17,16 @@
|
||||
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Header: /cvsroot/pgsql/src/interfaces/libpq/pqexpbuffer.c,v 1.8 2001/01/24 19:43:31 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/interfaces/libpq/pqexpbuffer.c,v 1.9 2001/02/10 02:31:30 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "postgres.h"
|
||||
#include "postgres_fe.h"
|
||||
|
||||
#include "pqexpbuffer.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include "win32.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: pqsignal.h,v 1.9 2001/01/24 19:43:31 momjian Exp $
|
||||
* $Id: pqsignal.h,v 1.10 2001/02/10 02:31:30 tgl Exp $
|
||||
*
|
||||
* NOTES
|
||||
* This shouldn't be in libpq, but the monitor and some other
|
||||
@@ -18,7 +18,7 @@
|
||||
#ifndef PQSIGNAL_H
|
||||
#define PQSIGNAL_H
|
||||
|
||||
#include "postgres.h"
|
||||
#include "postgres_fe.h"
|
||||
|
||||
typedef void (*pqsigfunc) (int);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user