From 78693c89d77cf6443a1a98fc38a83d9d563e2aa4 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Wed, 16 Feb 2000 13:15:26 +0000 Subject: [PATCH] Clean up include files use in psql. --- src/bin/pg_id/pg_id.c | 4 ++-- src/bin/psql/command.c | 11 ++++------- src/bin/psql/command.h | 6 ++---- src/bin/psql/common.c | 15 ++++++--------- src/bin/psql/common.h | 5 ++--- src/bin/psql/copy.c | 9 +++------ src/bin/psql/copy.h | 6 ++---- src/bin/psql/describe.c | 10 +++------- src/bin/psql/describe.h | 3 +-- src/bin/psql/help.c | 10 ++++------ src/bin/psql/help.h | 4 +--- src/bin/psql/input.c | 7 +++---- src/bin/psql/input.h | 5 +---- src/bin/psql/large_obj.c | 10 +++------- src/bin/psql/large_obj.h | 4 +--- src/bin/psql/mainloop.c | 10 +++------- src/bin/psql/mainloop.h | 4 +--- src/bin/psql/print.c | 11 ++++------- src/bin/psql/print.h | 8 ++------ src/bin/psql/prompt.c | 10 +++------- src/bin/psql/prompt.h | 4 +--- src/bin/psql/settings.h | 10 ++-------- src/bin/psql/startup.c | 7 ++----- src/bin/psql/stringutils.c | 9 +++------ src/bin/psql/tab-complete.c | 9 +++------ src/bin/psql/variables.c | 5 ++--- src/bin/psql/variables.h | 3 +-- 27 files changed, 65 insertions(+), 134 deletions(-) diff --git a/src/bin/pg_id/pg_id.c b/src/bin/pg_id/pg_id.c index 59c86eeb9a..b118e5e207 100644 --- a/src/bin/pg_id/pg_id.c +++ b/src/bin/pg_id/pg_id.c @@ -6,9 +6,9 @@ * * Copyright (C) 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/pg_id.c,v 1.12 2000/02/09 16:23:42 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/pg_id.c,v 1.13 2000/02/16 13:15:25 momjian Exp $ */ -#include +#include #ifdef HAVE_GETOPT_H #include diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c index ba198d7d91..a4353124cc 100644 --- a/src/bin/psql/command.c +++ b/src/bin/psql/command.c @@ -3,16 +3,13 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.18 2000/02/07 23:10:04 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.19 2000/02/16 13:15:26 momjian Exp $ */ -#include +#include "postgres.h" #include "command.h" #include #include -#include -#include -#include #include #ifndef WIN32 #include /* for umask() */ @@ -22,8 +19,8 @@ #include #endif -#include -#include +#include "libpq-fe.h" +#include "pqexpbuffer.h" #include "common.h" #include "copy.h" diff --git a/src/bin/psql/command.h b/src/bin/psql/command.h index 65431e9c9e..4fcbf61fce 100644 --- a/src/bin/psql/command.h +++ b/src/bin/psql/command.h @@ -3,14 +3,12 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/command.h,v 1.7 2000/01/29 16:58:48 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/command.h,v 1.8 2000/02/16 13:15:26 momjian Exp $ */ #ifndef COMMAND_H #define COMMAND_H -#include - -#include +#include "pqexpbuffer.h" #include "settings.h" #include "print.h" diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c index 49249c27db..340f053bdf 100644 --- a/src/bin/psql/common.c +++ b/src/bin/psql/common.c @@ -3,15 +3,12 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/common.c,v 1.13 2000/02/13 21:45:14 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/common.c,v 1.14 2000/02/16 13:15:26 momjian Exp $ */ -#include +#include "postgres.h" #include "common.h" #include -#include -#include -#include #include #ifdef HAVE_TERMIOS_H #include @@ -27,10 +24,10 @@ #include #endif -#include -#include -#include -#include +#include "libpq-fe.h" +#include "postgres_ext.h" +#include "pqsignal.h" +#include "version.h" #include "settings.h" #include "variables.h" diff --git a/src/bin/psql/common.h b/src/bin/psql/common.h index b4b7d93abe..af6f04965d 100644 --- a/src/bin/psql/common.h +++ b/src/bin/psql/common.h @@ -3,13 +3,12 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/common.h,v 1.5 2000/01/29 16:58:48 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/common.h,v 1.6 2000/02/16 13:15:26 momjian Exp $ */ #ifndef COMMON_H #define COMMON_H -#include -#include +#include "libpq-fe.h" char * xstrdup(const char *string); diff --git a/src/bin/psql/copy.c b/src/bin/psql/copy.c index d2d638c066..b0bba40889 100644 --- a/src/bin/psql/copy.c +++ b/src/bin/psql/copy.c @@ -3,14 +3,11 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/copy.c,v 1.9 2000/01/29 16:58:48 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/copy.c,v 1.10 2000/02/16 13:15:26 momjian Exp $ */ -#include +#include "postgres.h" #include "copy.h" -#include -#include -#include #include #include #ifndef WIN32 @@ -19,7 +16,7 @@ #include /* I think */ #endif -#include +#include "libpq-fe.h" #include "settings.h" #include "common.h" diff --git a/src/bin/psql/copy.h b/src/bin/psql/copy.h index 8a57e7a66d..cf36d324c0 100644 --- a/src/bin/psql/copy.h +++ b/src/bin/psql/copy.h @@ -3,14 +3,12 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/copy.h,v 1.6 2000/01/29 16:58:48 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/copy.h,v 1.7 2000/02/16 13:15:26 momjian Exp $ */ #ifndef COPY_H #define COPY_H -#include -#include -#include +#include "libpq-fe.h" /* handler for \copy */ bool do_copy(const char *args); diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index 6ab7c2f519..0282906064 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -3,16 +3,12 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.16 2000/02/07 23:10:06 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.17 2000/02/16 13:15:26 momjian Exp $ */ -#include +#include "postgres.h" #include "describe.h" -#include - -#include /* for VARHDRSZ, int4 type */ -#include -#include +#include "libpq-fe.h" #include "common.h" #include "settings.h" diff --git a/src/bin/psql/describe.h b/src/bin/psql/describe.h index 36f4ceca4e..673f3fe486 100644 --- a/src/bin/psql/describe.h +++ b/src/bin/psql/describe.h @@ -3,12 +3,11 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/describe.h,v 1.7 2000/01/29 16:58:48 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/describe.h,v 1.8 2000/02/16 13:15:26 momjian Exp $ */ #ifndef DESCRIBE_H #define DESCRIBE_H -#include #include "settings.h" /* \da */ diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c index ac252086d4..63e4bda5d7 100644 --- a/src/bin/psql/help.c +++ b/src/bin/psql/help.c @@ -3,13 +3,11 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/help.c,v 1.18 2000/02/13 21:45:14 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/help.c,v 1.19 2000/02/16 13:15:26 momjian Exp $ */ -#include +#include "postgres.h" #include "help.h" -#include -#include #include #include @@ -24,8 +22,8 @@ #include #endif -#include -#include +#include "pqsignal.h" +#include "libpq-fe.h" #include "settings.h" #include "common.h" diff --git a/src/bin/psql/help.h b/src/bin/psql/help.h index cbd9a81488..47fed65b41 100644 --- a/src/bin/psql/help.h +++ b/src/bin/psql/help.h @@ -3,13 +3,11 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/help.h,v 1.5 2000/01/29 16:58:48 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/help.h,v 1.6 2000/02/16 13:15:26 momjian Exp $ */ #ifndef HELP_H #define HELP_H -#include - void usage(void); void slashUsage(void); diff --git a/src/bin/psql/input.c b/src/bin/psql/input.c index 560d5b2c38..6d05370d21 100644 --- a/src/bin/psql/input.c +++ b/src/bin/psql/input.c @@ -3,15 +3,14 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/input.c,v 1.9 2000/02/07 23:10:06 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/input.c,v 1.10 2000/02/16 13:15:26 momjian Exp $ */ -#include +#include "postgres.h" #include "input.h" #include -#include - +#include "pqexpbuffer.h" #include "settings.h" #include "tab-complete.h" #include "common.h" diff --git a/src/bin/psql/input.h b/src/bin/psql/input.h index d12b45bfa3..e539ba2914 100644 --- a/src/bin/psql/input.h +++ b/src/bin/psql/input.h @@ -3,14 +3,11 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/input.h,v 1.7 2000/02/07 23:10:06 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/input.h,v 1.8 2000/02/16 13:15:26 momjian Exp $ */ #ifndef INPUT_H #define INPUT_H -#include -#include - /* * If some other file needs to have access to readline/history, include this * file and save yourself all this work. diff --git a/src/bin/psql/large_obj.c b/src/bin/psql/large_obj.c index add2f77cfc..c5b4a63477 100644 --- a/src/bin/psql/large_obj.c +++ b/src/bin/psql/large_obj.c @@ -3,16 +3,12 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/large_obj.c,v 1.8 2000/02/07 23:10:06 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/large_obj.c,v 1.9 2000/02/16 13:15:26 momjian Exp $ */ -#include +#include "postgres.h" #include "large_obj.h" -#include -#include - -#include -#include +#include "libpq-fe.h" #include "settings.h" #include "variables.h" diff --git a/src/bin/psql/large_obj.h b/src/bin/psql/large_obj.h index 17e1c81d6d..b8fcfde04d 100644 --- a/src/bin/psql/large_obj.h +++ b/src/bin/psql/large_obj.h @@ -3,13 +3,11 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/large_obj.h,v 1.7 2000/01/29 16:58:49 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/large_obj.h,v 1.8 2000/02/16 13:15:26 momjian Exp $ */ #ifndef LARGE_OBJ_H #define LARGE_OBJ_H -#include - bool do_lo_export(const char *loid_arg, const char *filename_arg); bool do_lo_import(const char *filename_arg, const char *comment_arg); bool do_lo_unlink(const char *loid_arg); diff --git a/src/bin/psql/mainloop.c b/src/bin/psql/mainloop.c index 1d5023925d..8d5f53087d 100644 --- a/src/bin/psql/mainloop.c +++ b/src/bin/psql/mainloop.c @@ -3,16 +3,12 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/mainloop.c,v 1.19 2000/02/13 21:45:14 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/mainloop.c,v 1.20 2000/02/16 13:15:26 momjian Exp $ */ -#include +#include "postgres.h" #include "mainloop.h" -#include -#include -#include - -#include +#include "pqexpbuffer.h" #include "settings.h" #include "prompt.h" diff --git a/src/bin/psql/mainloop.h b/src/bin/psql/mainloop.h index 0664ddfcaf..72d46d76db 100644 --- a/src/bin/psql/mainloop.h +++ b/src/bin/psql/mainloop.h @@ -3,13 +3,11 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/mainloop.h,v 1.6 2000/01/29 16:58:49 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/mainloop.h,v 1.7 2000/02/16 13:15:26 momjian Exp $ */ #ifndef MAINLOOP_H #define MAINLOOP_H -#include - int MainLoop(FILE *source); #endif /* MAINLOOP_H */ diff --git a/src/bin/psql/print.c b/src/bin/psql/print.c index 8acc18827a..82cb64b7cf 100644 --- a/src/bin/psql/print.c +++ b/src/bin/psql/print.c @@ -3,13 +3,11 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/print.c,v 1.11 2000/02/09 16:23:43 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/print.c,v 1.12 2000/02/16 13:15:26 momjian Exp $ */ -#include +#include "postgres.h" #include "print.h" -#include -#include #include #include #ifndef WIN32 @@ -20,9 +18,8 @@ #define pclose(x) _pclose(x) #endif -#include -#include -#include /* for Oid type */ +#include "pqsignal.h" +#include "libpq-fe.h" #ifndef __CYGWIN__ #define DEFAULT_PAGER "more" diff --git a/src/bin/psql/print.h b/src/bin/psql/print.h index 1098ff8e01..4706b8fba0 100644 --- a/src/bin/psql/print.h +++ b/src/bin/psql/print.h @@ -3,16 +3,12 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/print.h,v 1.6 2000/01/29 16:58:49 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/print.h,v 1.7 2000/02/16 13:15:26 momjian Exp $ */ #ifndef PRINT_H #define PRINT_H -#include -#include - -#include -#include +#include "libpq-fe.h" enum printFormat { diff --git a/src/bin/psql/prompt.c b/src/bin/psql/prompt.c index 1149fd65ab..505f5fa830 100644 --- a/src/bin/psql/prompt.c +++ b/src/bin/psql/prompt.c @@ -3,16 +3,12 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/prompt.c,v 1.8 2000/02/07 23:10:06 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/prompt.c,v 1.9 2000/02/16 13:15:26 momjian Exp $ */ -#include +#include "postgres.h" #include "prompt.h" -#include -#include -#include - -#include +#include "libpq-fe.h" #include "settings.h" #include "common.h" diff --git a/src/bin/psql/prompt.h b/src/bin/psql/prompt.h index 61b4b9f543..46d3dab93b 100644 --- a/src/bin/psql/prompt.h +++ b/src/bin/psql/prompt.h @@ -3,13 +3,11 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/prompt.h,v 1.6 2000/02/07 23:10:06 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/prompt.h,v 1.7 2000/02/16 13:15:26 momjian Exp $ */ #ifndef PROMPT_H #define PROMPT_H -#include - typedef enum _promptStatus { PROMPT_READY, diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h index af8171e7da..d56b0c77e9 100644 --- a/src/bin/psql/settings.h +++ b/src/bin/psql/settings.h @@ -3,18 +3,12 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/settings.h,v 1.8 2000/01/29 16:58:49 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/settings.h,v 1.9 2000/02/16 13:15:26 momjian Exp $ */ #ifndef SETTINGS_H #define SETTINGS_H -#include - -#include -#include - -#include -#include +#include "libpq-fe.h" #include "variables.h" #include "print.h" diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c index 2905e72144..ccb5f477e6 100644 --- a/src/bin/psql/startup.c +++ b/src/bin/psql/startup.c @@ -3,14 +3,11 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.23 2000/02/13 21:45:14 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.24 2000/02/16 13:15:26 momjian Exp $ */ -#include +#include "postgres.h" #include -#include -#include -#include #ifndef WIN32 #include diff --git a/src/bin/psql/stringutils.c b/src/bin/psql/stringutils.c index a0d3769fd2..95b0501027 100644 --- a/src/bin/psql/stringutils.c +++ b/src/bin/psql/stringutils.c @@ -3,18 +3,15 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/stringutils.c,v 1.24 2000/02/07 23:10:06 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/stringutils.c,v 1.25 2000/02/16 13:15:26 momjian Exp $ */ -#include +#include "postgres.h" #include "stringutils.h" #include -#include -#include #include -#include -#include +#include "libpq-fe.h" diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index 8f8c2fad8c..83e3041fd9 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -3,7 +3,7 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/tab-complete.c,v 1.11 2000/02/15 20:49:22 tgl Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/tab-complete.c,v 1.12 2000/02/16 13:15:26 momjian Exp $ */ /*----------- @@ -32,7 +32,7 @@ gracefully. -------------*/ -#include +#include "postgres.h" #include "tab-complete.h" #include "input.h" @@ -40,15 +40,12 @@ /* If we don't have this, we might as well forget about the whole thing: */ #ifdef USE_READLINE -#include -#include #include /* toupper */ -#include /* malloc, free */ #ifdef USE_ASSERT_CHECKING #include #endif -#include +#include "libpq-fe.h" #include "common.h" #include "settings.h" diff --git a/src/bin/psql/variables.c b/src/bin/psql/variables.c index e7d67d6dc5..667066cbfd 100644 --- a/src/bin/psql/variables.c +++ b/src/bin/psql/variables.c @@ -3,12 +3,11 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/variables.c,v 1.6 2000/02/13 21:45:14 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/variables.c,v 1.7 2000/02/16 13:15:26 momjian Exp $ */ -#include +#include "postgres.h" #include "variables.h" -#include #include diff --git a/src/bin/psql/variables.h b/src/bin/psql/variables.h index 521efc51dd..d0f01a7d79 100644 --- a/src/bin/psql/variables.h +++ b/src/bin/psql/variables.h @@ -3,7 +3,7 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/variables.h,v 1.6 2000/02/13 21:45:14 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/variables.h,v 1.7 2000/02/16 13:15:26 momjian Exp $ */ /* @@ -14,7 +14,6 @@ #ifndef VARIABLES_H #define VARIABLES_H -#include #define VALID_VARIABLE_CHARS "abcdefghijklmnopqrstuvwxyz"\ "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "0123456789_"