postgresql/src/bin/psql/input.h

54 lines
1.3 KiB
C
Raw Normal View History

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-01-02 17:58:17 +01:00
* $PostgreSQL: pgsql/src/bin/psql/input.h,v 1.34 2010/01/02 16:57:59 momjian Exp $
2000-01-19 00:30:24 +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
* file and save yourself all this work.
*
* USE_READLINE is the definite pointers regarding existence or not.
*/
#ifdef HAVE_LIBREADLINE
2002-09-04 22:31:48 +02:00
#define USE_READLINE 1
2002-09-04 22:31:48 +02:00
#if defined(HAVE_READLINE_READLINE_H)
#include <readline/readline.h>
#if defined(HAVE_READLINE_HISTORY_H)
#include <readline/history.h>
#endif
#elif defined(HAVE_EDITLINE_READLINE_H)
#include <editline/readline.h>
#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>
#if defined(HAVE_HISTORY_H)
2002-09-04 22:31:48 +02:00
#include <history.h>
#endif
#endif /* HAVE_READLINE_READLINE_H, etc */
#endif /* HAVE_LIBREADLINE */
#include "pqexpbuffer.h"
char *gets_interactive(const char *prompt);
char *gets_fromFile(FILE *source);
void initializeInput(int flags);
bool saveHistory(char *fname, int max_lines, bool appendFlag, bool encodeFlag);
void pg_append_history(const char *s, PQExpBuffer history_buf);
void pg_send_history(PQExpBuffer history_buf);
#endif /* INPUT_H */