summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian2006-07-11 13:54:25 +0000
committerBruce Momjian2006-07-11 13:54:25 +0000
commit185c45d2a622e7fb029d995a2a38420c628aa845 (patch)
treec6aa504e51fdac6209a9c959cac43d4ba9d01389
parent7e02b707880b60f9efea68d600b9dde5fa97cee3 (diff)
Allow each C include file to compile on its own by including any needed
header files.
-rw-r--r--src/bin/pg_dump/pg_backup.h1
-rw-r--r--src/bin/pg_dump/pg_backup_archiver.h46
-rw-r--r--src/bin/pg_dump/pg_backup_db.h7
-rw-r--r--src/include/access/gin.h4
-rw-r--r--src/include/commands/sequence.h1
-rw-r--r--src/include/port.h4
-rw-r--r--src/include/rewrite/rewriteHandler.h1
-rw-r--r--src/include/utils/inet.h2
-rw-r--r--src/include/utils/numeric.h2
-rw-r--r--src/include/utils/syscache.h1
-rw-r--r--src/interfaces/ecpg/include/ecpglib.h3
-rw-r--r--src/timezone/pgtz.h1
-rw-r--r--src/tools/pginclude/README3
13 files changed, 50 insertions, 26 deletions
diff --git a/src/bin/pg_dump/pg_backup.h b/src/bin/pg_dump/pg_backup.h
index d0ad8ce913..81613d9741 100644
--- a/src/bin/pg_dump/pg_backup.h
+++ b/src/bin/pg_dump/pg_backup.h
@@ -26,6 +26,7 @@
#include "postgres_fe.h"
#include "pg_dump.h"
+#include "dumputils.h"
#include "libpq-fe.h"
#include "pqexpbuffer.h"
diff --git a/src/bin/pg_dump/pg_backup_archiver.h b/src/bin/pg_dump/pg_backup_archiver.h
index e62e408303..60ff90898d 100644
--- a/src/bin/pg_dump/pg_backup_archiver.h
+++ b/src/bin/pg_dump/pg_backup_archiver.h
@@ -98,29 +98,29 @@ struct _archiveHandle;
struct _tocEntry;
struct _restoreList;
-typedef void (*ClosePtr) (struct _archiveHandle * AH);
-typedef void (*ArchiveEntryPtr) (struct _archiveHandle * AH, struct _tocEntry * te);
-
-typedef void (*StartDataPtr) (struct _archiveHandle * AH, struct _tocEntry * te);
-typedef size_t (*WriteDataPtr) (struct _archiveHandle * AH, const void *data, size_t dLen);
-typedef void (*EndDataPtr) (struct _archiveHandle * AH, struct _tocEntry * te);
-
-typedef void (*StartBlobsPtr) (struct _archiveHandle * AH, struct _tocEntry * te);
-typedef void (*StartBlobPtr) (struct _archiveHandle * AH, struct _tocEntry * te, Oid oid);
-typedef void (*EndBlobPtr) (struct _archiveHandle * AH, struct _tocEntry * te, Oid oid);
-typedef void (*EndBlobsPtr) (struct _archiveHandle * AH, struct _tocEntry * te);
-
-typedef int (*WriteBytePtr) (struct _archiveHandle * AH, const int i);
-typedef int (*ReadBytePtr) (struct _archiveHandle * AH);
-typedef size_t (*WriteBufPtr) (struct _archiveHandle * AH, const void *c, size_t len);
-typedef size_t (*ReadBufPtr) (struct _archiveHandle * AH, void *buf, size_t len);
-typedef void (*SaveArchivePtr) (struct _archiveHandle * AH);
-typedef void (*WriteExtraTocPtr) (struct _archiveHandle * AH, struct _tocEntry * te);
-typedef void (*ReadExtraTocPtr) (struct _archiveHandle * AH, struct _tocEntry * te);
-typedef void (*PrintExtraTocPtr) (struct _archiveHandle * AH, struct _tocEntry * te);
-typedef void (*PrintTocDataPtr) (struct _archiveHandle * AH, struct _tocEntry * te, RestoreOptions *ropt);
-
-typedef size_t (*CustomOutPtr) (struct _archiveHandle * AH, const void *buf, size_t len);
+typedef void (*ClosePtr) (struct _archiveHandle *AH);
+typedef void (*ArchiveEntryPtr) (struct _archiveHandle *AH, struct _tocEntry *te);
+
+typedef void (*StartDataPtr) (struct _archiveHandle *AH, struct _tocEntry *te);
+typedef size_t (*WriteDataPtr) (struct _archiveHandle *AH, const void *data, size_t dLen);
+typedef void (*EndDataPtr) (struct _archiveHandle *AH, struct _tocEntry *te);
+
+typedef void (*StartBlobsPtr) (struct _archiveHandle *AH, struct _tocEntry *te);
+typedef void (*StartBlobPtr) (struct _archiveHandle *AH, struct _tocEntry *te, Oid oid);
+typedef void (*EndBlobPtr) (struct _archiveHandle *AH, struct _tocEntry *te, Oid oid);
+typedef void (*EndBlobsPtr) (struct _archiveHandle *AH, struct _tocEntry *te);
+
+typedef int (*WriteBytePtr) (struct _archiveHandle *AH, const int i);
+typedef int (*ReadBytePtr) (struct _archiveHandle *AH);
+typedef size_t (*WriteBufPtr) (struct _archiveHandle *AH, const void *c, size_t len);
+typedef size_t (*ReadBufPtr) (struct _archiveHandle *AH, void *buf, size_t len);
+typedef void (*SaveArchivePtr) (struct _archiveHandle *AH);
+typedef void (*WriteExtraTocPtr) (struct _archiveHandle *AH, struct _tocEntry *te);
+typedef void (*ReadExtraTocPtr) (struct _archiveHandle *AH, struct _tocEntry *te);
+typedef void (*PrintExtraTocPtr) (struct _archiveHandle *AH, struct _tocEntry *te);
+typedef void (*PrintTocDataPtr) (struct _archiveHandle *AH, struct _tocEntry *te, RestoreOptions *ropt);
+
+typedef size_t (*CustomOutPtr) (struct _archiveHandle *AH, const void *buf, size_t len);
typedef enum _archiveMode
{
diff --git a/src/bin/pg_dump/pg_backup_db.h b/src/bin/pg_dump/pg_backup_db.h
index 659f74efe3..9a2e2119c8 100644
--- a/src/bin/pg_dump/pg_backup_db.h
+++ b/src/bin/pg_dump/pg_backup_db.h
@@ -5,8 +5,15 @@
* $PostgreSQL$
*/
+#ifndef PG_BACKUP_DB_H
+#define PG_BACKUP_DB_H
+
+#include "pg_backup_archiver.h"
+
extern int ExecuteSqlCommand(ArchiveHandle *AH, PQExpBuffer qry, char *desc);
extern int ExecuteSqlCommandBuf(ArchiveHandle *AH, void *qry, size_t bufLen);
extern void StartTransaction(ArchiveHandle *AH);
extern void CommitTransaction(ArchiveHandle *AH);
+
+#endif
diff --git a/src/include/access/gin.h b/src/include/access/gin.h
index 4d08ef4c80..b9cea5e478 100644
--- a/src/include/access/gin.h
+++ b/src/include/access/gin.h
@@ -11,6 +11,8 @@
#ifndef GIN_H
#define GIN_H
+#include "access/relscan.h"
+#include "access/skey.h"
#include "access/xlog.h"
#include "access/xlogdefs.h"
#include "storage/bufpage.h"
@@ -385,7 +387,7 @@ extern Datum ginendscan(PG_FUNCTION_ARGS);
extern Datum ginrescan(PG_FUNCTION_ARGS);
extern Datum ginmarkpos(PG_FUNCTION_ARGS);
extern Datum ginrestrpos(PG_FUNCTION_ARGS);
-extern void newScanKey( IndexScanDesc scan );
+extern void newScanKey(IndexScanDesc scan);
/* ginget.c */
extern DLLIMPORT int GinFuzzySearchLimit;
diff --git a/src/include/commands/sequence.h b/src/include/commands/sequence.h
index e1d6c6cd57..0b37b10139 100644
--- a/src/include/commands/sequence.h
+++ b/src/include/commands/sequence.h
@@ -14,6 +14,7 @@
#define SEQUENCE_H
#include "nodes/parsenodes.h"
+#include "storage/relfilenode.h"
#include "access/xlog.h"
#include "fmgr.h"
diff --git a/src/include/port.h b/src/include/port.h
index 7018d7bed8..fe60703ee7 100644
--- a/src/include/port.h
+++ b/src/include/port.h
@@ -184,6 +184,10 @@ extern char *simple_prompt(const char *prompt, int maxlen, bool echo);
* pgpipe, but in other cases we define rename to pgrename just on Win32.
*/
#ifndef WIN32
+/*
+ * The function prototypes are not supplied because every C file
+ * includes this file.
+ */
#define pgpipe(a) pipe(a)
#define piperead(a,b,c) read(a,b,c)
#define pipewrite(a,b,c) write(a,b,c)
diff --git a/src/include/rewrite/rewriteHandler.h b/src/include/rewrite/rewriteHandler.h
index bcd7bdc4c9..542f54d0cd 100644
--- a/src/include/rewrite/rewriteHandler.h
+++ b/src/include/rewrite/rewriteHandler.h
@@ -14,6 +14,7 @@
#ifndef REWRITEHANDLER_H
#define REWRITEHANDLER_H
+#include "utils/rel.h"
#include "nodes/parsenodes.h"
extern List *QueryRewrite(Query *parsetree);
diff --git a/src/include/utils/inet.h b/src/include/utils/inet.h
index a62a2b417b..2f2e32f61f 100644
--- a/src/include/utils/inet.h
+++ b/src/include/utils/inet.h
@@ -14,6 +14,8 @@
#ifndef INET_H
#define INET_H
+#include "fmgr.h"
+
/*
* This is the internal storage format for IP addresses
* (both INET and CIDR datatypes):
diff --git a/src/include/utils/numeric.h b/src/include/utils/numeric.h
index f05de3c3d2..70c74813fe 100644
--- a/src/include/utils/numeric.h
+++ b/src/include/utils/numeric.h
@@ -14,6 +14,8 @@
#ifndef _PG_NUMERIC_H_
#define _PG_NUMERIC_H_
+#include "fmgr.h"
+
/*
* Hardcoded precision limit - arbitrary, but must be small enough that
* dscale values will fit in 14 bits.
diff --git a/src/include/utils/syscache.h b/src/include/utils/syscache.h
index 20cc7b2980..3f433ce0cf 100644
--- a/src/include/utils/syscache.h
+++ b/src/include/utils/syscache.h
@@ -17,6 +17,7 @@
#define SYSCACHE_H
#include "access/htup.h"
+#include "utils/catcache.h"
/*
* Declarations for util/syscache.c.
diff --git a/src/interfaces/ecpg/include/ecpglib.h b/src/interfaces/ecpg/include/ecpglib.h
index c5d73c96e9..f869a17f6c 100644
--- a/src/interfaces/ecpg/include/ecpglib.h
+++ b/src/interfaces/ecpg/include/ecpglib.h
@@ -9,6 +9,7 @@
#include "libpq-fe.h"
#include "ecpgtype.h"
+#include "sqlca.h"
#include <string.h>
#ifndef __cplusplus
@@ -39,7 +40,7 @@ extern "C"
struct sqlca_t;
-void ECPGinit_sqlca(struct sqlca_t * sqlca);
+void ECPGinit_sqlca(struct sqlca_t *sqlca);
void ECPGdebug(int, FILE *);
bool ECPGstatus(int, const char *);
bool ECPGsetcommit(int, const char *, const char *);
diff --git a/src/timezone/pgtz.h b/src/timezone/pgtz.h
index 65d7c3f9b6..bae20d073c 100644
--- a/src/timezone/pgtz.h
+++ b/src/timezone/pgtz.h
@@ -17,6 +17,7 @@
#define _PGTZ_H
#include "tzfile.h"
+#include "pgtime.h"
extern char *pg_TZDIR(void);
diff --git a/src/tools/pginclude/README b/src/tools/pginclude/README
index 93b8f2777d..893cdd6303 100644
--- a/src/tools/pginclude/README
+++ b/src/tools/pginclude/README
@@ -13,4 +13,5 @@ pgrminclude [-v]
pgdefine create macro calls for all defines in the file (used by
the above routines)
-
+It is also a good idea to sort the pg-specific include files in alphabetic
+order. This is best done with a text editor.