PostgreSQL Source Code  git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
common.h
Go to the documentation of this file.
1 /*
2  * psql - the PostgreSQL interactive terminal
3  *
4  * Copyright (c) 2000-2024, 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);
38 
39 extern bool is_superuser(void);
40 extern bool standard_strings(void);
41 extern const char *session_username(void);
42 
43 extern void expand_tilde(char **filename);
44 extern void clean_extended_state(void);
45 
46 extern bool recognized_connection_string(const char *connstr);
47 
48 #endif /* COMMON_H */
void * arg
static char * connstr
Definition: pg_dumpall.c:88
static char * filename
Definition: pg_dumpall.c:119
void expand_tilde(char **filename)
Definition: common.c:2195
void psql_setup_cancel_handler(void)
Definition: common.c:313
volatile sig_atomic_t sigint_interrupt_enabled
Definition: common.c:292
char * psql_get_variable(const char *varname, PsqlScanQuoteType quote, void *passthrough)
Definition: common.c:176
const char * session_username(void)
Definition: common.c:2174
PGresult * PSQLexec(const char *query)
Definition: common.c:620
sigjmp_buf sigint_interrupt_jmp
Definition: common.c:294
bool recognized_connection_string(const char *connstr)
Definition: common.c:2317
int PSQLexecWatch(const char *query, const printQueryOpt *opt, FILE *printQueryFout, int min_rows)
Definition: common.c:675
void SetShellResultVariables(int wait_result)
Definition: common.c:501
void NoticeProcessor(void *arg, const char *message)
Definition: common.c:267
void clean_extended_state(void)
Definition: common.c:2279
bool standard_strings(void)
Definition: common.c:2154
bool is_superuser(void)
Definition: common.c:2134
bool setQFout(const char *fname)
Definition: common.c:132
bool openQueryOutputFile(const char *fname, FILE **fout, bool *is_pipe)
Definition: common.c:56
bool SendQuery(const char *query)
Definition: common.c:1082
PsqlScanQuoteType
Definition: psqlscan.h:53