~ubuntu-branches/ubuntu/hardy/postgresql-8.4/hardy-backports

« back to all changes in this revision

Viewing changes to src/bin/psql/common.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-03-20 12:00:13 UTC
  • Revision ID: james.westby@ubuntu.com-20090320120013-hogj7egc5mjncc5g
Tags: upstream-8.4~0cvs20090328
ImportĀ upstreamĀ versionĀ 8.4~0cvs20090328

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * psql - the PostgreSQL interactive terminal
 
3
 *
 
4
 * Copyright (c) 2000-2009, PostgreSQL Global Development Group
 
5
 *
 
6
 * $PostgreSQL$
 
7
 */
 
8
#ifndef COMMON_H
 
9
#define COMMON_H
 
10
 
 
11
#include "postgres_fe.h"
 
12
#include <setjmp.h>
 
13
#include "libpq-fe.h"
 
14
 
 
15
#ifdef USE_ASSERT_CHECKING
 
16
#include <assert.h>
 
17
#define psql_assert(p) assert(p)
 
18
#else
 
19
#define psql_assert(p)
 
20
#endif
 
21
 
 
22
#define atooid(x)  ((Oid) strtoul((x), NULL, 10))
 
23
 
 
24
/*
 
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.
 
28
 */
 
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);
 
33
 
 
34
extern bool setQFout(const char *fname);
 
35
 
 
36
extern void
 
37
psql_error(const char *fmt,...)
 
38
/* This lets gcc check the format string for consistency. */
 
39
__attribute__((format(printf, 1, 2)));
 
40
 
 
41
extern void NoticeProcessor(void *arg, const char *message);
 
42
 
 
43
extern volatile bool sigint_interrupt_enabled;
 
44
 
 
45
extern sigjmp_buf sigint_interrupt_jmp;
 
46
 
 
47
extern volatile bool cancel_pressed;
 
48
 
 
49
/* Note: cancel_pressed is defined in print.c, see that file for reasons */
 
50
 
 
51
extern void setup_cancel_handler(void);
 
52
 
 
53
extern void SetCancelConn(void);
 
54
extern void ResetCancelConn(void);
 
55
 
 
56
extern PGresult *PSQLexec(const char *query, bool start_xact);
 
57
 
 
58
extern bool SendQuery(const char *query);
 
59
 
 
60
extern bool is_superuser(void);
 
61
extern bool standard_strings(void);
 
62
extern const char *session_username(void);
 
63
 
 
64
extern char *expand_tilde(char **filename);
 
65
 
 
66
#endif   /* COMMON_H */