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

Commit b85a965

Browse files
committed
Allow each C include file to compile on its own by including any needed
header files.
1 parent 45a4309 commit b85a965

File tree

13 files changed

+62
-38
lines changed

13 files changed

+62
-38
lines changed

src/bin/pg_dump/pg_backup.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
*
1717
* IDENTIFICATION
18-
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup.h,v 1.39 2006/05/28 21:13:54 tgl Exp $
18+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup.h,v 1.40 2006/07/11 13:54:24 momjian Exp $
1919
*
2020
*-------------------------------------------------------------------------
2121
*/
@@ -26,6 +26,7 @@
2626
#include "postgres_fe.h"
2727

2828
#include "pg_dump.h"
29+
#include "dumputils.h"
2930

3031
#include "libpq-fe.h"
3132
#include "pqexpbuffer.h"

src/bin/pg_dump/pg_backup_archiver.h

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*
1818
*
1919
* IDENTIFICATION
20-
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.h,v 1.70 2006/05/28 21:13:54 tgl Exp $
20+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.h,v 1.71 2006/07/11 13:54:24 momjian Exp $
2121
*
2222
*-------------------------------------------------------------------------
2323
*/
@@ -98,29 +98,29 @@ struct _archiveHandle;
9898
struct _tocEntry;
9999
struct _restoreList;
100100

101-
typedef void (*ClosePtr) (struct _archiveHandle * AH);
102-
typedef void (*ArchiveEntryPtr) (struct _archiveHandle * AH, struct _tocEntry * te);
103-
104-
typedef void (*StartDataPtr) (struct _archiveHandle * AH, struct _tocEntry * te);
105-
typedef size_t (*WriteDataPtr) (struct _archiveHandle * AH, const void *data, size_t dLen);
106-
typedef void (*EndDataPtr) (struct _archiveHandle * AH, struct _tocEntry * te);
107-
108-
typedef void (*StartBlobsPtr) (struct _archiveHandle * AH, struct _tocEntry * te);
109-
typedef void (*StartBlobPtr) (struct _archiveHandle * AH, struct _tocEntry * te, Oid oid);
110-
typedef void (*EndBlobPtr) (struct _archiveHandle * AH, struct _tocEntry * te, Oid oid);
111-
typedef void (*EndBlobsPtr) (struct _archiveHandle * AH, struct _tocEntry * te);
112-
113-
typedef int (*WriteBytePtr) (struct _archiveHandle * AH, const int i);
114-
typedef int (*ReadBytePtr) (struct _archiveHandle * AH);
115-
typedef size_t (*WriteBufPtr) (struct _archiveHandle * AH, const void *c, size_t len);
116-
typedef size_t (*ReadBufPtr) (struct _archiveHandle * AH, void *buf, size_t len);
117-
typedef void (*SaveArchivePtr) (struct _archiveHandle * AH);
118-
typedef void (*WriteExtraTocPtr) (struct _archiveHandle * AH, struct _tocEntry * te);
119-
typedef void (*ReadExtraTocPtr) (struct _archiveHandle * AH, struct _tocEntry * te);
120-
typedef void (*PrintExtraTocPtr) (struct _archiveHandle * AH, struct _tocEntry * te);
121-
typedef void (*PrintTocDataPtr) (struct _archiveHandle * AH, struct _tocEntry * te, RestoreOptions *ropt);
122-
123-
typedef size_t (*CustomOutPtr) (struct _archiveHandle * AH, const void *buf, size_t len);
101+
typedef void (*ClosePtr) (struct _archiveHandle *AH);
102+
typedef void (*ArchiveEntryPtr) (struct _archiveHandle *AH, struct _tocEntry *te);
103+
104+
typedef void (*StartDataPtr) (struct _archiveHandle *AH, struct _tocEntry *te);
105+
typedef size_t (*WriteDataPtr) (struct _archiveHandle *AH, const void *data, size_t dLen);
106+
typedef void (*EndDataPtr) (struct _archiveHandle *AH, struct _tocEntry *te);
107+
108+
typedef void (*StartBlobsPtr) (struct _archiveHandle *AH, struct _tocEntry *te);
109+
typedef void (*StartBlobPtr) (struct _archiveHandle *AH, struct _tocEntry *te, Oid oid);
110+
typedef void (*EndBlobPtr) (struct _archiveHandle *AH, struct _tocEntry *te, Oid oid);
111+
typedef void (*EndBlobsPtr) (struct _archiveHandle *AH, struct _tocEntry *te);
112+
113+
typedef int (*WriteBytePtr) (struct _archiveHandle *AH, const int i);
114+
typedef int (*ReadBytePtr) (struct _archiveHandle *AH);
115+
typedef size_t (*WriteBufPtr) (struct _archiveHandle *AH, const void *c, size_t len);
116+
typedef size_t (*ReadBufPtr) (struct _archiveHandle *AH, void *buf, size_t len);
117+
typedef void (*SaveArchivePtr) (struct _archiveHandle *AH);
118+
typedef void (*WriteExtraTocPtr) (struct _archiveHandle *AH, struct _tocEntry *te);
119+
typedef void (*ReadExtraTocPtr) (struct _archiveHandle *AH, struct _tocEntry *te);
120+
typedef void (*PrintExtraTocPtr) (struct _archiveHandle *AH, struct _tocEntry *te);
121+
typedef void (*PrintTocDataPtr) (struct _archiveHandle *AH, struct _tocEntry *te, RestoreOptions *ropt);
122+
123+
typedef size_t (*CustomOutPtr) (struct _archiveHandle *AH, const void *buf, size_t len);
124124

125125
typedef enum _archiveMode
126126
{

src/bin/pg_dump/pg_backup_db.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,18 @@
22
* Definitions for pg_backup_db.c
33
*
44
* IDENTIFICATION
5-
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_db.h,v 1.11 2005/06/21 20:45:44 tgl Exp $
5+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_db.h,v 1.12 2006/07/11 13:54:24 momjian Exp $
66
*/
77

8+
#ifndef PG_BACKUP_DB_H
9+
#define PG_BACKUP_DB_H
10+
11+
#include "pg_backup_archiver.h"
12+
813
extern int ExecuteSqlCommand(ArchiveHandle *AH, PQExpBuffer qry, char *desc);
914
extern int ExecuteSqlCommandBuf(ArchiveHandle *AH, void *qry, size_t bufLen);
1015

1116
extern void StartTransaction(ArchiveHandle *AH);
1217
extern void CommitTransaction(ArchiveHandle *AH);
18+
19+
#endif

src/include/access/gin.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@
33
* header file for postgres inverted index access method implementation.
44
*
55
* Copyright (c) 2006, PostgreSQL Global Development Group
6-
* $PostgreSQL: pgsql/src/include/access/gin.h,v 1.3 2006/07/03 22:45:39 tgl Exp $
6+
* $PostgreSQL: pgsql/src/include/access/gin.h,v 1.4 2006/07/11 13:54:24 momjian Exp $
77
*--------------------------------------------------------------------------
88
*/
99

1010

1111
#ifndef GIN_H
1212
#define GIN_H
1313

14+
#include "access/relscan.h"
15+
#include "access/skey.h"
1416
#include "access/xlog.h"
1517
#include "access/xlogdefs.h"
1618
#include "storage/bufpage.h"
@@ -385,7 +387,7 @@ extern Datum ginendscan(PG_FUNCTION_ARGS);
385387
extern Datum ginrescan(PG_FUNCTION_ARGS);
386388
extern Datum ginmarkpos(PG_FUNCTION_ARGS);
387389
extern Datum ginrestrpos(PG_FUNCTION_ARGS);
388-
extern void newScanKey( IndexScanDesc scan );
390+
extern void newScanKey(IndexScanDesc scan);
389391

390392
/* ginget.c */
391393
extern DLLIMPORT int GinFuzzySearchLimit;

src/include/commands/sequence.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $PostgreSQL: pgsql/src/include/commands/sequence.h,v 1.36 2006/03/24 04:32:13 tgl Exp $
9+
* $PostgreSQL: pgsql/src/include/commands/sequence.h,v 1.37 2006/07/11 13:54:24 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
1313
#ifndef SEQUENCE_H
1414
#define SEQUENCE_H
1515

1616
#include "nodes/parsenodes.h"
17+
#include "storage/relfilenode.h"
1718
#include "access/xlog.h"
1819
#include "fmgr.h"
1920

src/include/port.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $PostgreSQL: pgsql/src/include/port.h,v 1.93 2006/06/25 00:18:24 momjian Exp $
9+
* $PostgreSQL: pgsql/src/include/port.h,v 1.94 2006/07/11 13:54:24 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -184,6 +184,10 @@ extern char *simple_prompt(const char *prompt, int maxlen, bool echo);
184184
* pgpipe, but in other cases we define rename to pgrename just on Win32.
185185
*/
186186
#ifndef WIN32
187+
/*
188+
* The function prototypes are not supplied because every C file
189+
* includes this file.
190+
*/
187191
#define pgpipe(a) pipe(a)
188192
#define piperead(a,b,c) read(a,b,c)
189193
#define pipewrite(a,b,c) write(a,b,c)

src/include/rewrite/rewriteHandler.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/include/rewrite/rewriteHandler.h,v 1.26 2006/03/05 15:58:58 momjian Exp $
10+
* $PostgreSQL: pgsql/src/include/rewrite/rewriteHandler.h,v 1.27 2006/07/11 13:54:24 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
1414
#ifndef REWRITEHANDLER_H
1515
#define REWRITEHANDLER_H
1616

17+
#include "utils/rel.h"
1718
#include "nodes/parsenodes.h"
1819

1920
extern List *QueryRewrite(Query *parsetree);

src/include/utils/inet.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/include/utils/inet.h,v 1.23 2006/03/05 15:59:07 momjian Exp $
10+
* $PostgreSQL: pgsql/src/include/utils/inet.h,v 1.24 2006/07/11 13:54:24 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
1414
#ifndef INET_H
1515
#define INET_H
1616

17+
#include "fmgr.h"
18+
1719
/*
1820
* This is the internal storage format for IP addresses
1921
* (both INET and CIDR datatypes):

src/include/utils/numeric.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77
*
88
* Copyright (c) 1998-2006, PostgreSQL Global Development Group
99
*
10-
* $PostgreSQL: pgsql/src/include/utils/numeric.h,v 1.21 2006/03/05 15:59:07 momjian Exp $
10+
* $PostgreSQL: pgsql/src/include/utils/numeric.h,v 1.22 2006/07/11 13:54:24 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
1414
#ifndef _PG_NUMERIC_H_
1515
#define _PG_NUMERIC_H_
1616

17+
#include "fmgr.h"
18+
1719
/*
1820
* Hardcoded precision limit - arbitrary, but must be small enough that
1921
* dscale values will fit in 14 bits.

src/include/utils/syscache.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@
99
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
1010
* Portions Copyright (c) 1994, Regents of the University of California
1111
*
12-
* $PostgreSQL: pgsql/src/include/utils/syscache.h,v 1.63 2006/05/03 22:45:26 tgl Exp $
12+
* $PostgreSQL: pgsql/src/include/utils/syscache.h,v 1.64 2006/07/11 13:54:24 momjian Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
1616
#ifndef SYSCACHE_H
1717
#define SYSCACHE_H
1818

1919
#include "access/htup.h"
20+
#include "utils/catcache.h"
2021

2122
/*
2223
* Declarations for util/syscache.c.

src/interfaces/ecpg/include/ecpglib.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
/*
22
* this is a small part of c.h since we don't want to leak all postgres
33
* definitions into ecpg programs
4-
* $PostgreSQL: pgsql/src/interfaces/ecpg/include/ecpglib.h,v 1.66 2006/03/11 04:38:39 momjian Exp $
4+
* $PostgreSQL: pgsql/src/interfaces/ecpg/include/ecpglib.h,v 1.67 2006/07/11 13:54:25 momjian Exp $
55
*/
66

77
#ifndef _ECPGLIB_H
88
#define _ECPGLIB_H
99

1010
#include "libpq-fe.h"
1111
#include "ecpgtype.h"
12+
#include "sqlca.h"
1213
#include <string.h>
1314

1415
#ifndef __cplusplus
@@ -39,7 +40,7 @@ extern "C"
3940

4041
struct sqlca_t;
4142

42-
void ECPGinit_sqlca(struct sqlca_t * sqlca);
43+
void ECPGinit_sqlca(struct sqlca_t *sqlca);
4344
void ECPGdebug(int, FILE *);
4445
bool ECPGstatus(int, const char *);
4546
bool ECPGsetcommit(int, const char *, const char *);

src/timezone/pgtz.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@
99
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/timezone/pgtz.h,v 1.16 2006/03/05 15:59:11 momjian Exp $
12+
* $PostgreSQL: pgsql/src/timezone/pgtz.h,v 1.17 2006/07/11 13:54:25 momjian Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
1616
#ifndef _PGTZ_H
1717
#define _PGTZ_H
1818

1919
#include "tzfile.h"
20+
#include "pgtime.h"
2021

2122
extern char *pg_TZDIR(void);
2223

src/tools/pginclude/README

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ pgrminclude [-v]
1313
pgdefine create macro calls for all defines in the file (used by
1414
the above routines)
1515

16-
16+
It is also a good idea to sort the pg-specific include files in alphabetic
17+
order. This is best done with a text editor.

0 commit comments

Comments
 (0)