postgresql/src/bin/psql/input.h

48 lines
1.2 KiB
C
Raw Normal View History

2000-01-19 00:30:24 +01:00
/*
* psql - the PostgreSQL interactive terminal
*
2005-01-01 06:43:09 +01:00
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
2000-01-19 00:30:24 +01:00
*
* $PostgreSQL: pgsql/src/bin/psql/input.h,v 1.24 2006/02/11 21:55:35 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
#if defined(HAVE_READLINE_READLINE_H)
#include <readline/readline.h>
#elif defined(HAVE_EDITLINE_READLINE_H)
#include <editline/readline.h>
2002-09-04 22:31:48 +02:00
#elif defined(HAVE_READLINE_H)
#include <readline.h>
#endif
#if defined(HAVE_READLINE_HISTORY_H)
#include <readline/history.h>
#elif defined(HAVE_EDITLINE_HISTORY_H)
#include <editline/history.h>
2002-09-04 22:31:48 +02:00
#elif defined(HAVE_HISTORY_H)
#include <history.h>
#endif
#endif
char *gets_interactive(const char *prompt);
char *gets_fromFile(FILE *source);
void initializeInput(int flags);
bool saveHistory(char *fname);
void pgadd_history(char *s, PQExpBuffer history_buf);
void pgclear_history(PQExpBuffer history_buf);
void pgflush_history(PQExpBuffer history_buf);
#endif /* INPUT_H */