summaryrefslogtreecommitdiff
path: root/src/bin/psql/input.h
blob: c91e9ca7b19dd60df794b33e3df1eb50ad0d547b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef INPUT_H
#define INPUT_H

#include <config.h>
#include <c.h>
#include <stdio.h>
#include "settings.h"


/* If some other file needs to have access to readline/history, include this
 * file and save yourself all this work.
 *
 * USE_READLINE and USE_HISTORY are the definite pointers regarding existence or not.
 */
#ifdef HAVE_LIBREADLINE
#ifdef HAVE_READLINE_H
#include <readline.h>
#define USE_READLINE 1
#else
#if defined(HAVE_READLINE_READLINE_H)
#include <readline/readline.h>
#define USE_READLINE 1
#endif
#endif
#endif

#if defined(HAVE_LIBHISTORY) || (defined(HAVE_LIBREADLINE) && defined(HAVE_HISTORY_IN_READLINE))
#if defined(HAVE_HISTORY_H)
#include <history.h>
#define USE_HISTORY 1
#else
#if defined(HAVE_READLINE_HISTORY_H)
#include <readline/history.h>
#define USE_HISTORY 1
#endif
#endif
#endif


char *
			gets_interactive(const char *prompt);

char *
			gets_fromFile(FILE *source);


void
			initializeInput(int flags);

bool
			saveHistory(const char *fname);

void
			finishInput(void);

#endif