Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit d08741e

Browse files
committed
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.
1 parent cf21985 commit d08741e

File tree

144 files changed

+1053
-1244
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+1053
-1244
lines changed

GNUmakefile.in

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# PostgreSQL top level makefile
33
#
4-
# $Header: /cvsroot/pgsql/GNUmakefile.in,v 1.16 2001/01/06 21:24:01 petere Exp $
4+
# $Header: /cvsroot/pgsql/GNUmakefile.in,v 1.17 2001/02/10 02:31:25 tgl Exp $
55
#
66

77
subdir =
@@ -22,6 +22,9 @@ installdirs uninstall distprep:
2222
$(MAKE) -C doc $@
2323
$(MAKE) -C src $@
2424

25+
install-all-headers:
26+
$(MAKE) -C src $@
27+
2528
# clean, distclean, etc should apply to contrib too, even though
2629
# it's not built by default
2730
clean:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# GNUmakefile won't exist yet, so we catch that case as well.
1212

1313

14-
all check install installdirs installcheck uninstall dep depend clean distclean maintainer-clean:
14+
all check install installdirs install-all-headers installcheck uninstall dep depend clean distclean maintainer-clean:
1515
@if [ ! -f GNUmakefile ] ; then \
1616
echo "You need to run the 'configure' program first. See the file"; \
1717
echo "'INSTALL' for installation instructions." ; \

contrib/cube/cubedata.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/*#include "postgres.h"*/
2-
31
typedef struct NDBOX {
42
unsigned int size; /* required to be a Postgres varlena type */
53
unsigned int dim;

contrib/earthdistance/earthdistance.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1+
#include "postgres.h"
2+
13
#include <math.h>
2-
#include <stdio.h>
3-
#include <string.h>
44

5-
#include <postgres.h>
6-
#include <utils/geo_decls.h> /* for Pt */
7-
#include <utils/palloc.h> /* for palloc */
5+
#include "utils/geo_decls.h" /* for Pt */
6+
87

98
/* Earth's radius is in statute miles. */
109
const int EARTH_RADIUS = 3958.747716;

contrib/fulltextindex/fti.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#include "postgres.h"
2+
3+
#include <ctype.h>
4+
25
#include "executor/spi.h"
36
#include "commands/trigger.h"
4-
#include <ctype.h>
5-
#include <stdio.h> /* debugging */
67

78
/*
89
* Trigger function takes 2 arguments:

contrib/intarray/_int.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
format for these routines is dictated by Postgres architecture.
55
******************************************************************************/
66

7-
#include <stdio.h>
7+
#include "postgres.h"
8+
89
#include <float.h>
910
#include <string.h>
1011

11-
#include "postgres.h"
1212
#include "access/gist.h"
1313
#include "access/itup.h"
1414
#include "access/rtree.h"

contrib/isbn_issn/isbn_issn.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
/*
22
* PostgreSQL type definitions for ISBNs.
33
*
4-
* $Id: isbn_issn.c,v 1.2 2000/06/19 13:53:39 momjian Exp $
4+
* $Id: isbn_issn.c,v 1.3 2001/02/10 02:31:25 tgl Exp $
55
*/
66

7-
#include <stdio.h>
7+
#include "postgres.h"
88

9-
#include <postgres.h>
10-
#include <utils/palloc.h>
119

1210
/*
1311
* This is the internal storage format for ISBNs.

contrib/lo/lo.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
/*
22
* PostgreSQL type definitions for managed LargeObjects.
33
*
4-
* $Header: /cvsroot/pgsql/contrib/lo/lo.c,v 1.6 2000/11/21 21:51:58 tgl Exp $
4+
* $Header: /cvsroot/pgsql/contrib/lo/lo.c,v 1.7 2001/02/10 02:31:25 tgl Exp $
55
*
66
*/
77

88
#include "postgres.h"
99

10-
#include <stdio.h>
11-
12-
#include "utils/palloc.h"
13-
1410
/* Required for largeobjects */
1511
#include "libpq/libpq-fs.h"
1612
#include "libpq/be-fsstubs.h"

contrib/pg_dumplo/main.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
/* -------------------------------------------------------------------------
22
* pg_dumplo
33
*
4-
* $Header: /cvsroot/pgsql/contrib/pg_dumplo/Attic/main.c,v 1.5 2001/01/24 19:42:45 momjian Exp $
4+
* $Header: /cvsroot/pgsql/contrib/pg_dumplo/Attic/main.c,v 1.6 2001/02/10 02:31:25 tgl Exp $
55
*
66
* Karel Zak 1999-2000
77
* -------------------------------------------------------------------------
88
*/
99

10+
/* We import postgres_fe.h mostly to get the HAVE_GETOPT_LONG configure result. */
11+
#ifndef OUT_OF_PG
12+
#include "postgres_fe.h"
13+
#endif
14+
1015
#include <stdio.h>
1116
#include <unistd.h>
1217
#include <stdlib.h>
1318
#include <string.h>
1419
#include <errno.h>
1520

16-
/* We import postgres.h mostly to get the HAVE_GETOPT_LONG configure result. */
17-
#ifndef OUT_OF_PG
18-
#include "postgres.h"
19-
#endif
20-
2121
#include <libpq-fe.h>
2222
#include <libpq/libpq-fs.h>
2323

contrib/pgbench/pgbench.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* $Header: /cvsroot/pgsql/contrib/pgbench/pgbench.c,v 1.7 2000/11/01 00:45:46 ishii Exp $
2+
* $Header: /cvsroot/pgsql/contrib/pgbench/pgbench.c,v 1.8 2001/02/10 02:31:25 tgl Exp $
33
*
44
* pgbench: a simple TPC-B like benchmark program for PostgreSQL
55
* written by Tatsuo Ishii
@@ -17,11 +17,8 @@
1717
* suitability of this software for any purpose. It is provided "as
1818
* is" without express or implied warranty.
1919
*/
20+
#include "postgres_fe.h"
2021

21-
#include "config.h"
22-
23-
#include <stdio.h>
24-
#include "postgres.h"
2522
#include "libpq-fe.h"
2623

2724
#include <errno.h>

contrib/pgcrypto/encode.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $Id: encode.c,v 1.2 2001/02/06 18:05:13 momjian Exp $
29+
* $Id: encode.c,v 1.3 2001/02/10 02:31:25 tgl Exp $
3030
*/
3131

32-
#include <postgres.h>
33-
#include <fmgr.h>
32+
#include "postgres.h"
33+
34+
#include "fmgr.h"
3435

3536
#include "encode.h"
3637

contrib/pgcrypto/internal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $Id: internal.c,v 1.1 2000/10/31 13:11:28 petere Exp $
29+
* $Id: internal.c,v 1.2 2001/02/10 02:31:25 tgl Exp $
3030
*/
3131

32-
#include <postgres.h>
32+
#include "postgres.h"
3333

3434
#include "pgcrypto.h"
3535

contrib/pgcrypto/krb.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@
3131
* It is possible that this works with other SHA1/MD5
3232
* implementations too.
3333
*
34-
* $Id: krb.c,v 1.1 2000/10/31 13:11:28 petere Exp $
34+
* $Id: krb.c,v 1.2 2001/02/10 02:31:25 tgl Exp $
3535
*/
3636

37-
#include <postgres.h>
37+
#include "postgres.h"
3838

3939
#include "pgcrypto.h"
4040

41-
#include <md5.h>
42-
#include <sha.h>
41+
#include "md5.h"
42+
#include "sha.h"
4343

4444
#ifndef MD5_DIGEST_LENGTH
4545
#define MD5_DIGEST_LENGTH 16

contrib/pgcrypto/md5.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $Id: md5.c,v 1.3 2001/01/09 16:07:13 momjian Exp $ */
1+
/* $Id: md5.c,v 1.4 2001/02/10 02:31:25 tgl Exp $ */
22
/* $KAME: md5.c,v 1.3 2000/02/22 14:01:17 itojun Exp $ */
33

44
/*
@@ -30,7 +30,7 @@
3030
* SUCH DAMAGE.
3131
*/
3232

33-
#include <postgres.h>
33+
#include "postgres.h"
3434

3535
#include "md5.h"
3636

contrib/pgcrypto/mhash.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $Id: mhash.c,v 1.1 2000/10/31 13:11:28 petere Exp $
29+
* $Id: mhash.c,v 1.2 2001/02/10 02:31:26 tgl Exp $
3030
*/
3131

32-
#include <postgres.h>
32+
#include "postgres.h"
33+
3334
#include "pgcrypto.h"
3435

3536
#include <mhash.h>

contrib/pgcrypto/openssl.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $Id: openssl.c,v 1.1 2000/10/31 13:11:28 petere Exp $
29+
* $Id: openssl.c,v 1.2 2001/02/10 02:31:26 tgl Exp $
3030
*/
3131

32-
#include <postgres.h>
32+
#include "postgres.h"
33+
3334
#include "pgcrypto.h"
3435

3536
#include <evp.h>

contrib/pgcrypto/pgcrypto.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $Id: pgcrypto.c,v 1.5 2001/02/06 18:05:13 momjian Exp $
29+
* $Id: pgcrypto.c,v 1.6 2001/02/10 02:31:26 tgl Exp $
3030
*/
3131

32-
#include <postgres.h>
33-
#include <utils/builtins.h>
32+
#include "postgres.h"
33+
34+
#include "utils/builtins.h"
3435

3536
#include "pgcrypto.h"
3637

contrib/pgcrypto/sha1.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $Id: sha1.c,v 1.3 2001/01/09 16:07:13 momjian Exp $ */
1+
/* $Id: sha1.c,v 1.4 2001/02/10 02:31:26 tgl Exp $ */
22
/* $KAME: sha1.c,v 1.3 2000/02/22 14:01:18 itojun Exp $ */
33

44
/*
@@ -35,7 +35,7 @@
3535
* implemented by Jun-ichiro itojun Itoh <itojun@itojun.org>
3636
*/
3737

38-
#include <postgres.h>
38+
#include "postgres.h"
3939

4040
#include "sha1.h"
4141

contrib/soundex/soundex.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
/* $Header: /cvsroot/pgsql/contrib/soundex/Attic/soundex.c,v 1.9 2000/12/03 20:45:31 tgl Exp $ */
1+
/* $Header: /cvsroot/pgsql/contrib/soundex/Attic/soundex.c,v 1.10 2001/02/10 02:31:26 tgl Exp $ */
22
#include "postgres.h"
3+
4+
#include <ctype.h>
5+
36
#include "fmgr.h"
47
#include "utils/builtins.h"
5-
#include <ctype.h>
6-
#include <string.h>
7-
#include <stdio.h>
88

99

1010
Datum text_soundex(PG_FUNCTION_ARGS);

contrib/string/string_io.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@
99
* either version 2, or (at your option) any later version.
1010
*/
1111

12+
#include "postgres.h"
13+
1214
#include <ctype.h>
13-
#include <string.h>
1415

15-
#include "postgres.h"
16-
#include "utils/elog.h"
17-
#include "utils/palloc.h"
1816
#include "utils/builtins.h"
1917

2018
#include "string_io.h"

doc/src/sgml/installation.sgml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/installation.sgml,v 1.34 2001/01/15 21:17:27 petere Exp $ -->
1+
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/installation.sgml,v 1.35 2001/02/10 02:31:26 tgl Exp $ -->
22

33
<chapter id="installation">
44
<title><![%flattext-install-include[<productname>PostgreSQL</>]]> Installation Instructions</title>
@@ -783,11 +783,26 @@ All of PostgreSQL is successfully made. Ready to install.
783783
them, but how to do that is left as an exercise.
784784
</para>
785785

786+
<para>
787+
The standard install installs only the header files needed for client
788+
application development. If you plan to do any server-side program
789+
development (such as custom functions or datatypes written in C),
790+
then you may want to install the entire <productname>PostgreSQL</>
791+
include tree into your target include directory. To do that, enter
792+
<screen>
793+
<userinput>gmake install-all-headers</userinput>
794+
</screen>
795+
This adds a megabyte or two to the install footprint, and is only
796+
useful if you don't plan to keep the whole source tree around for
797+
reference. (If you do, you can just use the source's include
798+
directory when building server-side software.)
799+
</para>
800+
786801
<formalpara>
787802
<title>Client-only installation</title>
788803
<para>
789804
If you want to install only the client applications and
790-
interfaces, then you can use these commands:
805+
interface libraries, then you can use these commands:
791806
<screen>
792807
<userinput>gmake -C src/bin install</>
793808
<userinput>gmake -C src/interfaces install</>

src/GNUmakefile.in

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $Header: /cvsroot/pgsql/src/Attic/GNUmakefile.in,v 1.60 2000/09/29 17:17:32 petere Exp $
7+
# $Header: /cvsroot/pgsql/src/Attic/GNUmakefile.in,v 1.61 2001/02/10 02:31:26 tgl Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -20,6 +20,9 @@ all install installdirs uninstall dep depend distprep:
2020
$(MAKE) -C bin $@
2121
$(MAKE) -C pl $@
2222

23+
install-all-headers:
24+
$(MAKE) -C include $@
25+
2326
clean:
2427
$(MAKE) -C backend $@
2528
$(MAKE) -C include $@

src/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# GNUmakefile won't exist yet, so we catch that case as well.
1212

1313

14-
all check install installdirs installcheck uninstall dep depend clean distclean maintainer-clean:
14+
all check install installdirs install-all-headers installcheck uninstall dep depend clean distclean maintainer-clean:
1515
@if [ ! -f GNUmakefile ] ; then \
1616
echo "You need to run the 'configure' program first. See the file"; \
1717
echo "'INSTALL' for installation instructions." ; \

0 commit comments

Comments
 (0)