Allow each C include file to compile on its own by including any needed

header files.
This commit is contained in:
Bruce Momjian 2006-07-11 13:54:25 +00:00
parent 45a4309074
commit b85a965f5f
13 changed files with 58 additions and 34 deletions

View File

@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup.h,v 1.39 2006/05/28 21:13:54 tgl Exp $
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup.h,v 1.40 2006/07/11 13:54:24 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -26,6 +26,7 @@
#include "postgres_fe.h"
#include "pg_dump.h"
#include "dumputils.h"
#include "libpq-fe.h"
#include "pqexpbuffer.h"

View File

@ -17,7 +17,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.h,v 1.70 2006/05/28 21:13:54 tgl Exp $
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.h,v 1.71 2006/07/11 13:54:24 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -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 (*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 (*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 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 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 size_t (*CustomOutPtr) (struct _archiveHandle *AH, const void *buf, size_t len);
typedef enum _archiveMode
{

View File

@ -2,11 +2,18 @@
* Definitions for pg_backup_db.c
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_db.h,v 1.11 2005/06/21 20:45:44 tgl Exp $
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_db.h,v 1.12 2006/07/11 13:54:24 momjian Exp $
*/
#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

View File

@ -3,7 +3,7 @@
* header file for postgres inverted index access method implementation.
*
* Copyright (c) 2006, PostgreSQL Global Development Group
* $PostgreSQL: pgsql/src/include/access/gin.h,v 1.3 2006/07/03 22:45:39 tgl Exp $
* $PostgreSQL: pgsql/src/include/access/gin.h,v 1.4 2006/07/11 13:54:24 momjian Exp $
*--------------------------------------------------------------------------
*/
@ -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;

View File

@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/commands/sequence.h,v 1.36 2006/03/24 04:32:13 tgl Exp $
* $PostgreSQL: pgsql/src/include/commands/sequence.h,v 1.37 2006/07/11 13:54:24 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -14,6 +14,7 @@
#define SEQUENCE_H
#include "nodes/parsenodes.h"
#include "storage/relfilenode.h"
#include "access/xlog.h"
#include "fmgr.h"

View File

@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/port.h,v 1.93 2006/06/25 00:18:24 momjian Exp $
* $PostgreSQL: pgsql/src/include/port.h,v 1.94 2006/07/11 13:54:24 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -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)

View File

@ -7,13 +7,14 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/rewrite/rewriteHandler.h,v 1.26 2006/03/05 15:58:58 momjian Exp $
* $PostgreSQL: pgsql/src/include/rewrite/rewriteHandler.h,v 1.27 2006/07/11 13:54:24 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef REWRITEHANDLER_H
#define REWRITEHANDLER_H
#include "utils/rel.h"
#include "nodes/parsenodes.h"
extern List *QueryRewrite(Query *parsetree);

View File

@ -7,13 +7,15 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/utils/inet.h,v 1.23 2006/03/05 15:59:07 momjian Exp $
* $PostgreSQL: pgsql/src/include/utils/inet.h,v 1.24 2006/07/11 13:54:24 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef INET_H
#define INET_H
#include "fmgr.h"
/*
* This is the internal storage format for IP addresses
* (both INET and CIDR datatypes):

View File

@ -7,13 +7,15 @@
*
* Copyright (c) 1998-2006, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/include/utils/numeric.h,v 1.21 2006/03/05 15:59:07 momjian Exp $
* $PostgreSQL: pgsql/src/include/utils/numeric.h,v 1.22 2006/07/11 13:54:24 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#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.

View File

@ -9,7 +9,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/utils/syscache.h,v 1.63 2006/05/03 22:45:26 tgl Exp $
* $PostgreSQL: pgsql/src/include/utils/syscache.h,v 1.64 2006/07/11 13:54:24 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -17,6 +17,7 @@
#define SYSCACHE_H
#include "access/htup.h"
#include "utils/catcache.h"
/*
* Declarations for util/syscache.c.

View File

@ -1,7 +1,7 @@
/*
* this is a small part of c.h since we don't want to leak all postgres
* definitions into ecpg programs
* $PostgreSQL: pgsql/src/interfaces/ecpg/include/ecpglib.h,v 1.66 2006/03/11 04:38:39 momjian Exp $
* $PostgreSQL: pgsql/src/interfaces/ecpg/include/ecpglib.h,v 1.67 2006/07/11 13:54:25 momjian Exp $
*/
#ifndef _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 *);

View File

@ -9,7 +9,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/timezone/pgtz.h,v 1.16 2006/03/05 15:59:11 momjian Exp $
* $PostgreSQL: pgsql/src/timezone/pgtz.h,v 1.17 2006/07/11 13:54:25 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -17,6 +17,7 @@
#define _PGTZ_H
#include "tzfile.h"
#include "pgtime.h"
extern char *pg_TZDIR(void);

View File

@ -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.