| 1 |
/* |
| 2 |
* psql - the PostgreSQL interactive terminal |
| 3 |
* |
| 4 |
* Copyright (c) 2000-2025, 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 |
#include <signal.h> |
| 13 |
|
| 14 |
#include "fe_utils/print.h" |
| 15 |
#include "fe_utils/psqlscan.h" |
| 16 |
#include "libpq-fe.h" |
| 17 |
|
| 18 |
extern bool openQueryOutputFile(const char *fname, FILE **fout, bool *is_pipe); |
| 19 |
extern bool setQFout(const char *fname); |
| 20 |
|
| 21 |
extern char *psql_get_variable(const char *varname, PsqlScanQuoteType quote, |
| 22 |
void *passthrough); |
| 23 |
|
| 24 |
extern void NoticeProcessor(void *arg, const char *message); |
| 25 |
|
| 26 |
extern volatile sig_atomic_t sigint_interrupt_enabled; |
| 27 |
|
| 28 |
extern sigjmp_buf sigint_interrupt_jmp; |
| 29 |
|
| 30 |
extern void psql_setup_cancel_handler(void); |
| 31 |
|
| 32 |
extern void SetShellResultVariables(int wait_result); |
| 33 |
|
| 34 |
extern PGresult *PSQLexec(const char *query); |
| 35 |
extern int PSQLexecWatch(const char *query, const printQueryOpt *opt, FILE *printQueryFout, int min_rows); |
| 36 |
|
| 37 |
extern bool SendQuery(const char *query, int num_copy_from_stdin); |
| 38 |
|
| 39 |
extern bool is_superuser(void); |
| 40 |
extern bool standard_strings(void); |
| 41 |
extern const char *session_username(void); |
| 42 |
extern char *get_conninfo_value(const char *keyword); |
| 43 |
|
| 44 |
extern void expand_tilde(char **filename); |
| 45 |
extern void clean_extended_state(void); |
| 46 |
|
| 47 |
extern bool recognized_connection_string(const char *connstr); |
| 48 |
|
| 49 |
#endif /* COMMON_H */ |