PostgreSQL Source Code git master
Loading...
Searching...
No Matches
input.h
Go to the documentation of this file.
1/*
2 * psql - the PostgreSQL interactive terminal
3 *
4 * Copyright (c) 2000-2026, PostgreSQL Global Development Group
5 *
6 * src/bin/psql/input.h
7 */
8#ifndef INPUT_H
9#define INPUT_H
10
11/*
12 * If some other file needs to have access to readline/history, include this
13 * file and save yourself all this work.
14 *
15 * USE_READLINE is what to conditionalize readline-dependent code on.
16 */
17#ifdef HAVE_LIBREADLINE
18#define USE_READLINE 1
19
20/*
21 * Readline headers trigger a lot of warnings with our preferred compiler flags
22 * (at least -Wstrict-prototypes is known to be problematic). The system_header
23 * pragma hides warnings from within the rest of this file, if supported.
24 */
25#ifdef HAVE_PRAGMA_GCC_SYSTEM_HEADER
26#pragma GCC system_header
27#endif
28
29#if defined(HAVE_READLINE_READLINE_H)
30#include <readline/readline.h>
31#if defined(HAVE_READLINE_HISTORY_H)
32#include <readline/history.h>
33#endif
34#elif defined(HAVE_EDITLINE_READLINE_H)
35#include <editline/readline.h>
36#if defined(HAVE_EDITLINE_HISTORY_H)
37#include <editline/history.h>
38#endif
39#elif defined(HAVE_READLINE_H)
40#include <readline.h>
41#if defined(HAVE_HISTORY_H)
42#include <history.h>
43#endif
44#endif /* HAVE_READLINE_READLINE_H, etc */
45#endif /* HAVE_LIBREADLINE */
46
47#include "pqexpbuffer.h"
48
49
50extern char *gets_interactive(const char *prompt, PQExpBuffer query_buf);
51extern char *gets_fromFile(FILE *source);
52
53extern void initializeInput(int flags);
54
55extern bool printHistory(const char *fname, unsigned short int pager);
56
57extern void pg_append_history(const char *s, PQExpBuffer history_buf);
59
60#endif /* INPUT_H */
void pg_send_history(PQExpBuffer history_buf)
Definition input.c:135
bool printHistory(const char *fname, unsigned short int pager)
Definition input.c:494
char * gets_interactive(const char *prompt, PQExpBuffer query_buf)
Definition input.c:67
char * gets_fromFile(FILE *source)
Definition input.c:186
void initializeInput(int flags)
Definition input.c:344
void pg_append_history(const char *s, PQExpBuffer history_buf)
Definition input.c:113
static rewind_source * source
Definition pg_rewind.c:89
static int fb(int x)