1/*
2 * psql - the PostgreSQL interactive terminal
3 *
4 * Copyright (c) 2000-2019, PostgreSQL Global Development Group
5 *
6 * src/bin/psql/common.h
7 */
8#ifndef COMMON_H
9#define COMMON_H
10
11#include <setjmp.h>
12
13#include "libpq-fe.h"
14#include "fe_utils/print.h"
15#include "fe_utils/psqlscan.h"
16
17extern bool openQueryOutputFile(const char *fname, FILE **fout, bool *is_pipe);
18extern bool setQFout(const char *fname);
19
20extern char *psql_get_variable(const char *varname, PsqlScanQuoteType quote,
21 void *passthrough);
22
23extern void NoticeProcessor(void *arg, const char *message);
24
25extern volatile bool sigint_interrupt_enabled;
26
27extern sigjmp_buf sigint_interrupt_jmp;
28
29extern void setup_cancel_handler(void);
30
31extern void SetCancelConn(void);
32extern void ResetCancelConn(void);
33
34extern PGresult *PSQLexec(const char *query);
35extern int PSQLexecWatch(const char *query, const printQueryOpt *opt);
36
37extern bool SendQuery(const char *query);
38
39extern bool is_superuser(void);
40extern bool standard_strings(void);
41extern const char *session_username(void);
42
43extern void expand_tilde(char **filename);
44
45extern bool recognized_connection_string(const char *connstr);
46
47#endif /* COMMON_H */
48