2 * psql - the PostgreSQL interactive terminal
4 * Copyright (c) 2000-2021, PostgreSQL Global Development Group
12 * If some other file needs to have access to readline/history, include this
13 * file and save yourself all this work.
15 * USE_READLINE is what to conditionalize readline-dependent code on.
17 #ifdef HAVE_LIBREADLINE
18 #define USE_READLINE 1
20 #if defined(HAVE_READLINE_READLINE_H)
21 #include <readline/readline.h>
22 #if defined(HAVE_READLINE_HISTORY_H)
23 #include <readline/history.h>
25 #elif defined(HAVE_EDITLINE_READLINE_H)
26 #include <editline/readline.h>
27 #if defined(HAVE_EDITLINE_HISTORY_H)
28 #include <editline/history.h>
30 #elif defined(HAVE_READLINE_H)
32 #if defined(HAVE_HISTORY_H)
35 #endif /* HAVE_READLINE_READLINE_H, etc */
36 #endif /* HAVE_LIBREADLINE */
38 #include "pqexpbuffer.h"
41 extern char *gets_interactive(const char *prompt
, PQExpBuffer query_buf
);
42 extern char *gets_fromFile(FILE *source
);
44 extern void initializeInput(int flags
);
46 extern bool printHistory(const char *fname
, unsigned short int pager
);
48 extern void pg_append_history(const char *s
, PQExpBuffer history_buf
);
49 extern void pg_send_history(PQExpBuffer history_buf
);