2 * psql - the PostgreSQL interactive terminal
4 * Copyright (c) 2000-2009, PostgreSQL Global Development Group
11 #include "postgres_fe.h"
15 #ifdef USE_ASSERT_CHECKING
17 #define psql_assert(p) assert(p)
19 #define psql_assert(p)
22 #define atooid(x) ((Oid) strtoul((x), NULL, 10))
25 * Safer versions of some standard C library functions. If an
26 * out-of-memory condition occurs, these functions will bail out
27 * safely; therefore, their return value is guaranteed to be non-NULL.
29 extern char *pg_strdup(const char *string
);
30 extern void *pg_malloc(size_t size
);
31 extern void *pg_malloc_zero(size_t size
);
32 extern void *pg_calloc(size_t nmemb
, size_t size
);
34 extern bool setQFout(const char *fname
);
37 psql_error(const char *fmt
,...)
38 /* This lets gcc check the format string for consistency. */
39 __attribute__((format(printf
, 1, 2)));
41 extern void NoticeProcessor(void *arg
, const char *message
);
43 extern volatile bool sigint_interrupt_enabled
;
45 extern sigjmp_buf sigint_interrupt_jmp
;
47 extern volatile bool cancel_pressed
;
49 /* Note: cancel_pressed is defined in print.c, see that file for reasons */
51 extern void setup_cancel_handler(void);
53 extern void SetCancelConn(void);
54 extern void ResetCancelConn(void);
56 extern PGresult
*PSQLexec(const char *query
, bool start_xact
);
58 extern bool SendQuery(const char *query
);
60 extern bool is_superuser(void);
61 extern bool standard_strings(void);
62 extern const char *session_username(void);
64 extern char *expand_tilde(char **filename
);