summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2003-08-08 04:52:22 +0000
committerBruce Momjian <bruce@momjian.us>2003-08-08 04:52:22 +0000
commit63c4d156e0f5040725055e06c688cc3fdc5d3228 (patch)
treef97c8402810f38ce9727464f36615e4d76faba6a
parent522b4937b380de9c3eb7614c2ae37b3d4a667085 (diff)
downloadpostgresql-63c4d156e0f5040725055e06c688cc3fdc5d3228.tar.gz
Move simple_prompt()/sprompt.c into /port.
-rw-r--r--src/Makefile.global.in4
-rw-r--r--src/bin/pg_dump/Makefile10
-rw-r--r--src/bin/pg_dump/dumputils.h4
-rw-r--r--src/bin/pg_dump/pg_dump.h5
-rw-r--r--src/bin/psql/Makefile6
-rw-r--r--src/bin/psql/bcc32.mak2
-rw-r--r--src/bin/psql/common.h7
-rw-r--r--src/bin/psql/win32.mak2
-rw-r--r--src/bin/scripts/Makefile23
-rw-r--r--src/bin/scripts/common.h2
-rw-r--r--src/include/port.h20
-rw-r--r--src/interfaces/libpq/Makefile6
-rw-r--r--src/port/sprompt.c (renamed from src/bin/psql/sprompt.c)7
13 files changed, 40 insertions, 58 deletions
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index 6b351236bd..083198089b 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -1,5 +1,5 @@
# -*-makefile-*-
-# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.165 2003/08/08 02:48:24 momjian Exp $
+# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.166 2003/08/08 04:52:20 momjian Exp $
#------------------------------------------------------------------------------
# All PostgreSQL makefiles include this file and use the variables it sets,
@@ -341,7 +341,7 @@ endif
#
# substitute implementations of the C library
-LIBOBJS = @LIBOBJS@ path.o thread.o
+LIBOBJS = @LIBOBJS@ path.o sprompt.o thread.o
ifneq (,$(LIBOBJS))
LIBS += -lpgport
diff --git a/src/bin/pg_dump/Makefile b/src/bin/pg_dump/Makefile
index e8fec04dc4..559459373e 100644
--- a/src/bin/pg_dump/Makefile
+++ b/src/bin/pg_dump/Makefile
@@ -5,7 +5,7 @@
# Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
-# $Header: /cvsroot/pgsql/src/bin/pg_dump/Makefile,v 1.39 2002/12/12 21:02:00 tgl Exp $
+# $Header: /cvsroot/pgsql/src/bin/pg_dump/Makefile,v 1.40 2003/08/08 04:52:21 momjian Exp $
#
#-------------------------------------------------------------------------
@@ -13,9 +13,9 @@ subdir = src/bin/pg_dump
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
-OBJS= pg_backup_archiver.o pg_backup_db.o pg_backup_custom.o \
- pg_backup_files.o pg_backup_null.o pg_backup_tar.o \
- sprompt.o dumputils.o
+OBJS= pg_backup_archiver.o pg_backup_db.o pg_backup_custom.o \
+ pg_backup_files.o pg_backup_null.o pg_backup_tar.o \
+ dumputils.o
EXTRA_OBJS = $(top_builddir)/src/backend/parser/keywords.o
@@ -31,7 +31,7 @@ pg_restore: pg_restore.o $(OBJS) $(libpq_builddir)/libpq.a
$(CC) $(CFLAGS) pg_restore.o $(OBJS) $(EXTRA_OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@
pg_dumpall: pg_dumpall.o $(libpq_builddir)/libpq.a
- $(CC) $(CFLAGS) pg_dumpall.o dumputils.o sprompt.o $(EXTRA_OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@
+ $(CC) $(CFLAGS) pg_dumpall.o dumputils.o $(EXTRA_OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@
.PHONY: submake-backend
submake-backend:
diff --git a/src/bin/pg_dump/dumputils.h b/src/bin/pg_dump/dumputils.h
index 7a96ddeadb..2f2426c2da 100644
--- a/src/bin/pg_dump/dumputils.h
+++ b/src/bin/pg_dump/dumputils.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: dumputils.h,v 1.7 2003/08/04 02:40:09 momjian Exp $
+ * $Id: dumputils.h,v 1.8 2003/08/08 04:52:21 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -18,8 +18,6 @@
#include "pqexpbuffer.h"
-extern char *simple_prompt(const char *prompt, int maxlen, bool echo);
-
extern const char *fmtId(const char *identifier);
extern void appendStringLiteral(PQExpBuffer buf, const char *str,
bool escapeAll);
diff --git a/src/bin/pg_dump/pg_dump.h b/src/bin/pg_dump/pg_dump.h
index 1d03e989d8..a68a99ade0 100644
--- a/src/bin/pg_dump/pg_dump.h
+++ b/src/bin/pg_dump/pg_dump.h
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_dump.h,v 1.103 2003/08/04 02:40:09 momjian Exp $
+ * $Id: pg_dump.h,v 1.104 2003/08/08 04:52:21 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -235,7 +235,4 @@ extern void dumpTables(Archive *fout, TableInfo tblinfo[], int numTables,
const bool schemaOnly, const bool dataOnly);
extern void dumpIndexes(Archive *fout, TableInfo *tbinfo, int numTables);
-/* sprompt.h */
-extern char *simple_prompt(const char *prompt, int maxlen, bool echo);
-
#endif /* PG_DUMP_H */
diff --git a/src/bin/psql/Makefile b/src/bin/psql/Makefile
index ef3d21e66b..e8afcf6d2e 100644
--- a/src/bin/psql/Makefile
+++ b/src/bin/psql/Makefile
@@ -5,7 +5,7 @@
# Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
-# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.36 2003/06/06 22:17:42 momjian Exp $
+# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.37 2003/08/08 04:52:21 momjian Exp $
#
#-------------------------------------------------------------------------
@@ -17,9 +17,9 @@ REFDOCDIR= $(top_srcdir)/doc/src/sgml/ref
override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS) -DFRONTEND
-OBJS=command.o common.o help.o input.o stringutils.o mainloop.o copy.o \
+OBJS= command.o common.o help.o input.o stringutils.o mainloop.o copy.o \
startup.o prompt.o variables.o large_obj.o print.o describe.o \
- sprompt.o tab-complete.o mbprint.o
+ tab-complete.o mbprint.o
all: submake-libpq submake-libpgport psql
diff --git a/src/bin/psql/bcc32.mak b/src/bin/psql/bcc32.mak
index 360c4c75f2..7df1f664e8 100644
--- a/src/bin/psql/bcc32.mak
+++ b/src/bin/psql/bcc32.mak
@@ -65,7 +65,6 @@ CLEAN :
-@erase "$(INTDIR)\copy.obj"
-@erase "$(INTDIR)\startup.obj"
-@erase "$(INTDIR)\prompt.obj"
- -@erase "$(INTDIR)\sprompt.obj"
-@erase "$(INTDIR)\variables.obj"
-@erase "$(INTDIR)\large_obj.obj"
-@erase "$(INTDIR)\print.obj"
@@ -119,7 +118,6 @@ LINK32_OBJS= \
copy.obj \
startup.obj \
prompt.obj \
- sprompt.obj \
variables.obj \
large_obj.obj \
print.obj \
diff --git a/src/bin/psql/common.h b/src/bin/psql/common.h
index 6544ef74bd..08ec84acdf 100644
--- a/src/bin/psql/common.h
+++ b/src/bin/psql/common.h
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/bin/psql/common.h,v 1.27 2003/08/04 23:59:39 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/common.h,v 1.28 2003/08/08 04:52:21 momjian Exp $
*/
#ifndef COMMON_H
#define COMMON_H
@@ -24,8 +24,6 @@ __attribute__((format(printf, 1, 2)));
extern void NoticeProcessor(void *arg, const char *message);
-extern char *simple_prompt(const char *prompt, int maxlen, bool echo);
-
extern volatile bool cancel_pressed;
extern void ResetCancelConn(void);
@@ -40,9 +38,6 @@ extern bool SendQuery(const char *query);
extern bool is_superuser(void);
-/* sprompt.h */
-extern char *simple_prompt(const char *prompt, int maxlen, bool echo);
-
/* Parse a numeric character code from the string pointed at by *buf, e.g.
* one written as 0x0c (hexadecimal) or 015 (octal); advance *buf to the last
* character of the numeric character code.
diff --git a/src/bin/psql/win32.mak b/src/bin/psql/win32.mak
index 55064cab89..cfb63d478d 100644
--- a/src/bin/psql/win32.mak
+++ b/src/bin/psql/win32.mak
@@ -28,7 +28,6 @@ CLEAN :
-@erase "$(INTDIR)\copy.obj"
-@erase "$(INTDIR)\startup.obj"
-@erase "$(INTDIR)\prompt.obj"
- -@erase "$(INTDIR)\sprompt.obj"
-@erase "$(INTDIR)\variables.obj"
-@erase "$(INTDIR)\large_obj.obj"
-@erase "$(INTDIR)\print.obj"
@@ -66,7 +65,6 @@ LINK32_OBJS= \
"$(INTDIR)\copy.obj" \
"$(INTDIR)\startup.obj" \
"$(INTDIR)\prompt.obj" \
- "$(INTDIR)\sprompt.obj" \
"$(INTDIR)\variables.obj" \
"$(INTDIR)\large_obj.obj" \
"$(INTDIR)\print.obj" \
diff --git a/src/bin/scripts/Makefile b/src/bin/scripts/Makefile
index 66f13c4533..48908645e2 100644
--- a/src/bin/scripts/Makefile
+++ b/src/bin/scripts/Makefile
@@ -5,7 +5,7 @@
# Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
-# $Header: /cvsroot/pgsql/src/bin/scripts/Makefile,v 1.21 2003/06/18 12:19:11 petere Exp $
+# $Header: /cvsroot/pgsql/src/bin/scripts/Makefile,v 1.22 2003/08/08 04:52:21 momjian Exp $
#
#-------------------------------------------------------------------------
@@ -17,22 +17,21 @@ PROGRAMS = createdb createlang createuser dropdb droplang dropuser clusterdb vac
override CPPFLAGS := -I$(top_srcdir)/src/bin/pg_dump -I$(top_srcdir)/src/bin/psql -I$(libpq_srcdir) $(CPPFLAGS)
-
all: submake-libpq submake-backend $(PROGRAMS)
%: %.o
$(CC) $(CFLAGS) $^ $(libpq) $(LDFLAGS) $(LIBS) -o $@
-createdb: createdb.o common.o dumputils.o sprompt.o $(top_builddir)/src/backend/parser/keywords.o
-createlang: createlang.o common.o sprompt.o print.o mbprint.o
-createuser: createuser.o common.o dumputils.o sprompt.o $(top_builddir)/src/backend/parser/keywords.o
-dropdb: dropdb.o common.o dumputils.o sprompt.o $(top_builddir)/src/backend/parser/keywords.o
-droplang: droplang.o common.o sprompt.o print.o mbprint.o
-dropuser: dropuser.o common.o dumputils.o sprompt.o $(top_builddir)/src/backend/parser/keywords.o
-clusterdb: clusterdb.o common.o dumputils.o sprompt.o $(top_builddir)/src/backend/parser/keywords.o
-vacuumdb: vacuumdb.o common.o sprompt.o
+createdb: createdb.o common.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o
+createlang: createlang.o common.o print.o mbprint.o
+createuser: createuser.o common.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o
+dropdb: dropdb.o common.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o
+droplang: droplang.o common.o print.o mbprint.o
+dropuser: dropuser.o common.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o
+clusterdb: clusterdb.o common.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o
+vacuumdb: vacuumdb.o common.o
-dumputils.c sprompt.c : % : $(top_srcdir)/src/bin/pg_dump/%
+dumputils.c: % : $(top_srcdir)/src/bin/pg_dump/%
rm -f $@ && $(LN_S) $< .
print.c mbprint.c : % : $(top_srcdir)/src/bin/psql/%
@@ -61,4 +60,4 @@ uninstall:
clean distclean maintainer-clean:
- rm -f $(addsuffix $(X), $(PROGRAMS)) $(addsuffix .o, $(PROGRAMS)) common.o dumputils.o sprompt.o print.o mbprint.o dumputils.c sprompt.c print.c mbprint.c
+ rm -f $(addsuffix $(X), $(PROGRAMS)) $(addsuffix .o, $(PROGRAMS)) common.o dumputils.o print.o mbprint.o dumputils.c print.c mbprint.c
diff --git a/src/bin/scripts/common.h b/src/bin/scripts/common.h
index f8cba29eb3..3c9da3e013 100644
--- a/src/bin/scripts/common.h
+++ b/src/bin/scripts/common.h
@@ -17,8 +17,6 @@ typedef void (*help_handler) (const char *);
void handle_help_version_opts(int argc, char *argv[], const char *fixed_progname, help_handler hlp);
-extern char *simple_prompt(const char *prompt, int maxlen, bool echo);
-
PGconn *connectDatabase(const char *dbname, const char *pghost, const char *pgport,
const char *pguser, bool require_password, const char *progname);
diff --git a/src/include/port.h b/src/include/port.h
index ed8b5a2889..b27b885638 100644
--- a/src/include/port.h
+++ b/src/include/port.h
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: port.h,v 1.10 2003/08/04 02:40:10 momjian Exp $
+ * $Id: port.h,v 1.11 2003/08/08 04:52:22 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -18,14 +18,16 @@
#endif
/* Portable path handling for Unix/Win32 */
-bool is_absolute_path(const char *filename);
-char *first_path_separator(const char *filename);
-char *last_path_separator(const char *filename);
-char *get_progname(char *argv0);
+extern bool is_absolute_path(const char *filename);
+extern char *first_path_separator(const char *filename);
+extern char *last_path_separator(const char *filename);
+extern char *get_progname(char *argv0);
+
+extern char *simple_prompt(const char *prompt, int maxlen, bool echo);
#if defined(bsdi) || defined(netbsd)
-int fseeko(FILE *stream, off_t offset, int whence);
-off_t ftello(FILE *stream);
+extern int fseeko(FILE *stream, off_t offset, int whence);
+extern off_t ftello(FILE *stream);
#endif
#ifdef WIN32
@@ -33,8 +35,8 @@ off_t ftello(FILE *stream);
* Win32 doesn't have reliable rename/unlink during concurrent access
*/
#ifndef FRONTEND
-int pgrename(const char *from, const char *to);
-int pgunlink(const char *path);
+extern int pgrename(const char *from, const char *to);
+extern int pgunlink(const char *path);
#define rename(from, to) pgrename(from, to)
#define unlink(path) pgunlink(path)
diff --git a/src/interfaces/libpq/Makefile b/src/interfaces/libpq/Makefile
index 37a2d62ff5..2e90b05183 100644
--- a/src/interfaces/libpq/Makefile
+++ b/src/interfaces/libpq/Makefile
@@ -4,7 +4,7 @@
#
# Copyright (c) 1994, Regents of the University of California
#
-# $Header: /cvsroot/pgsql/src/interfaces/libpq/Makefile,v 1.89 2003/08/08 03:22:24 momjian Exp $
+# $Header: /cvsroot/pgsql/src/interfaces/libpq/Makefile,v 1.90 2003/08/08 04:52:22 momjian Exp $
#
#-------------------------------------------------------------------------
@@ -23,7 +23,7 @@ override CPPFLAGS := -I$(srcdir) $(CPPFLAGS) $(THREAD_CFLAGS) -DFRONTEND -DSYSCO
OBJS= fe-auth.o fe-connect.o fe-exec.o fe-misc.o fe-print.o fe-lobj.o \
fe-protocol2.o fe-protocol3.o pqexpbuffer.o pqsignal.o fe-secure.o \
dllist.o md5.o ip.o wchar.o encnames.o \
- $(filter crypt.o getaddrinfo.o inet_aton.o snprintf.o strerror.o path.o thread.o, $(LIBOBJS))
+ $(filter crypt.o getaddrinfo.o inet_aton.o snprintf.o sprompt.o strerror.o path.o thread.o, $(LIBOBJS))
# Add libraries that libpq depends (or might depend) on into the
@@ -46,7 +46,7 @@ backend_src = $(top_srcdir)/src/backend
# For port modules, this only happens if configure decides the module
# is needed (see filter hack in OBJS, above).
-crypt.c getaddrinfo.c inet_aton.c snprintf.c strerror.c path.c thread.c: % : $(top_srcdir)/src/port/%
+crypt.c getaddrinfo.c inet_aton.c snprintf.c sprompt.c strerror.c path.c thread.c: % : $(top_srcdir)/src/port/%
rm -f $@ && $(LN_S) $< .
md5.c ip.c: % : $(backend_src)/libpq/%
diff --git a/src/bin/psql/sprompt.c b/src/port/sprompt.c
index e08cb94c88..c47d6bc63d 100644
--- a/src/bin/psql/sprompt.c
+++ b/src/port/sprompt.c
@@ -3,13 +3,10 @@
*
* Copyright 2000 by PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/bin/psql/Attic/sprompt.c,v 1.6 2003/08/04 00:43:29 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/port/sprompt.c,v 1.1 2003/08/08 04:52:22 momjian Exp $
*/
-/* This file is shared by psql and pg_dump. */
-
-
/*
* simple_prompt
*
@@ -22,7 +19,7 @@
*
* Returns a malloc()'ed string with the input (w/o trailing newline).
*/
-#include "postgres_fe.h"
+#include "postgres.h"
#ifdef HAVE_TERMIOS_H
#include <termios.h>