PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
common.h
Go to the documentation of this file.
1 /*
2  * psql - the PostgreSQL interactive terminal
3  *
4  * Copyright (c) 2000-2017, 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 
16 #define atooid(x) ((Oid) strtoul((x), NULL, 10))
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, bool escape, bool as_ident);
22 
23 extern void psql_error(const char *fmt,...) pg_attribute_printf(1, 2);
24 
25 extern void NoticeProcessor(void *arg, const char *message);
26 
27 extern volatile bool sigint_interrupt_enabled;
28 
29 extern sigjmp_buf sigint_interrupt_jmp;
30 
31 extern void setup_cancel_handler(void);
32 
33 extern void SetCancelConn(void);
34 extern void ResetCancelConn(void);
35 
36 extern PGresult *PSQLexec(const char *query);
37 extern int PSQLexecWatch(const char *query, const printQueryOpt *opt);
38 
39 extern bool SendQuery(const char *query);
40 
41 extern bool is_superuser(void);
42 extern bool standard_strings(void);
43 extern const char *session_username(void);
44 
45 extern void expand_tilde(char **filename);
46 
47 extern bool recognized_connection_string(const char *connstr);
48 
49 #endif /* COMMON_H */
bool recognized_connection_string(const char *connstr)
Definition: common.c:2140
bool SendQuery(const char *query)
Definition: common.c:1183
void setup_cancel_handler(void)
Definition: common.c:288
bool openQueryOutputFile(const char *fname, FILE **fout, bool *is_pipe)
Definition: common.c:49
volatile bool sigint_interrupt_enabled
Definition: common.c:230
bool standard_strings(void)
Definition: common.c:2008
#define pg_attribute_printf(f, a)
Definition: c.h:633
void SetCancelConn(void)
Definition: common.c:402
void void NoticeProcessor(void *arg, const char *message)
Definition: common.c:198
bool setQFout(const char *fname)
Definition: common.c:84
bool is_superuser(void)
Definition: common.c:1985
PGresult * PSQLexec(const char *query)
Definition: common.c:599
char * psql_get_variable(const char *varname, bool escape, bool as_ident)
Definition: common.c:124
void psql_error(const char *fmt,...) pg_attribute_printf(1
int PSQLexecWatch(const char *query, const printQueryOpt *opt)
Definition: common.c:654
void ResetCancelConn(void)
Definition: common.c:432
static char * filename
Definition: pg_dumpall.c:84
void * arg
void expand_tilde(char **filename)
Definition: common.c:2053
const char * session_username(void)
Definition: common.c:2032
sigjmp_buf sigint_interrupt_jmp
Definition: common.c:232
static char * connstr
Definition: pg_dumpall.c:67