Header And Logo

PostgreSQL
| The world's most advanced open source database.

common.h

Go to the documentation of this file.
00001 /*
00002  * psql - the PostgreSQL interactive terminal
00003  *
00004  * Copyright (c) 2000-2013, PostgreSQL Global Development Group
00005  *
00006  * src/bin/psql/common.h
00007  */
00008 #ifndef COMMON_H
00009 #define COMMON_H
00010 
00011 #include "postgres_fe.h"
00012 #include <setjmp.h>
00013 #include "libpq-fe.h"
00014 
00015 #define atooid(x)  ((Oid) strtoul((x), NULL, 10))
00016 
00017 extern bool setQFout(const char *fname);
00018 
00019 extern void
00020 psql_error(const char *fmt,...)
00021 /* This lets gcc check the format string for consistency. */
00022 __attribute__((format(PG_PRINTF_ATTRIBUTE, 1, 2)));
00023 
00024 extern void NoticeProcessor(void *arg, const char *message);
00025 
00026 extern volatile bool sigint_interrupt_enabled;
00027 
00028 extern sigjmp_buf sigint_interrupt_jmp;
00029 
00030 extern volatile bool cancel_pressed;
00031 
00032 /* Note: cancel_pressed is defined in print.c, see that file for reasons */
00033 
00034 extern void setup_cancel_handler(void);
00035 
00036 extern void SetCancelConn(void);
00037 extern void ResetCancelConn(void);
00038 
00039 extern PGresult *PSQLexec(const char *query, bool start_xact);
00040 
00041 extern bool SendQuery(const char *query);
00042 
00043 extern bool is_superuser(void);
00044 extern bool standard_strings(void);
00045 extern const char *session_username(void);
00046 
00047 extern void expand_tilde(char **filename);
00048 
00049 #endif   /* COMMON_H */