Move simple_prompt()/sprompt.c into /port.

This commit is contained in:
Bruce Momjian 2003-08-08 04:52:22 +00:00
parent 522b4937b3
commit 63c4d156e0
13 changed files with 40 additions and 58 deletions

View File

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

View File

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

View File

@ -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);

View File

@ -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 */

View File

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

View File

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

View File

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

View File

@ -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" \

View File

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

View File

@ -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);

View File

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

View File

@ -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/%

View File

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