2000-01-19 00:30:24 +01:00
|
|
|
/*
|
|
|
|
* psql - the PostgreSQL interactive terminal
|
|
|
|
*
|
2010-01-02 17:58:17 +01:00
|
|
|
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
|
2000-01-19 00:30:24 +01:00
|
|
|
*
|
2010-02-26 03:01:40 +01:00
|
|
|
* $PostgreSQL: pgsql/src/bin/psql/input.h,v 1.35 2010/02/26 02:01:19 momjian Exp $
|
2000-01-19 00:30:24 +01:00
|
|
|
*/
|
1999-11-04 22:56:02 +01:00
|
|
|
#ifndef INPUT_H
|
|
|
|
#define INPUT_H
|
|
|
|
|
2000-01-19 00:30:24 +01:00
|
|
|
/*
|
|
|
|
* If some other file needs to have access to readline/history, include this
|
1999-11-04 22:56:02 +01:00
|
|
|
* file and save yourself all this work.
|
|
|
|
*
|
2002-04-11 00:47:09 +02:00
|
|
|
* USE_READLINE is the definite pointers regarding existence or not.
|
1999-11-04 22:56:02 +01:00
|
|
|
*/
|
|
|
|
#ifdef HAVE_LIBREADLINE
|
2002-09-04 22:31:48 +02:00
|
|
|
#define USE_READLINE 1
|
2009-08-24 18:18:13 +02:00
|
|
|
|
2002-09-04 22:31:48 +02:00
|
|
|
#if defined(HAVE_READLINE_READLINE_H)
|
|
|
|
#include <readline/readline.h>
|
2009-08-24 18:18:13 +02:00
|
|
|
#if defined(HAVE_READLINE_HISTORY_H)
|
|
|
|
#include <readline/history.h>
|
|
|
|
#endif
|
2003-02-19 05:04:04 +01:00
|
|
|
#elif defined(HAVE_EDITLINE_READLINE_H)
|
|
|
|
#include <editline/readline.h>
|
2009-08-24 18:18:13 +02:00
|
|
|
#if defined(HAVE_EDITLINE_HISTORY_H)
|
|
|
|
#include <editline/history.h>
|
|
|
|
#endif
|
2002-09-04 22:31:48 +02:00
|
|
|
#elif defined(HAVE_READLINE_H)
|
|
|
|
#include <readline.h>
|
2009-08-24 18:18:13 +02:00
|
|
|
#if defined(HAVE_HISTORY_H)
|
2002-09-04 22:31:48 +02:00
|
|
|
#include <history.h>
|
|
|
|
#endif
|
2010-02-26 03:01:40 +01:00
|
|
|
#endif /* HAVE_READLINE_READLINE_H, etc */
|
|
|
|
#endif /* HAVE_LIBREADLINE */
|
1999-11-04 22:56:02 +01:00
|
|
|
|
2006-06-12 01:06:00 +02:00
|
|
|
#include "pqexpbuffer.h"
|
|
|
|
|
2003-03-20 07:00:12 +01:00
|
|
|
|
|
|
|
char *gets_interactive(const char *prompt);
|
2000-04-12 19:17:23 +02:00
|
|
|
char *gets_fromFile(FILE *source);
|
1999-11-04 22:56:02 +01:00
|
|
|
|
2000-04-12 19:17:23 +02:00
|
|
|
void initializeInput(int flags);
|
2009-09-14 00:18:22 +02:00
|
|
|
bool saveHistory(char *fname, int max_lines, bool appendFlag, bool encodeFlag);
|
2001-10-28 07:26:15 +01:00
|
|
|
|
2006-06-12 01:06:00 +02:00
|
|
|
void pg_append_history(const char *s, PQExpBuffer history_buf);
|
|
|
|
void pg_send_history(PQExpBuffer history_buf);
|
2006-02-11 22:55:35 +01:00
|
|
|
|
2001-11-05 18:46:40 +01:00
|
|
|
#endif /* INPUT_H */
|