aboutsummaryrefslogtreecommitdiff
path: root/src/bin/scripts/common.h
blob: 8a6431e724504622aa12ba25d852f1a9a1074e8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include "postgres_fe.h"

#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif

#ifndef HAVE_GETOPT_LONG
#include "getopt_long.h"
#endif

#include "libpq-fe.h"
#include "pqexpbuffer.h"

#ifndef HAVE_OPTRESET
int			optreset;
#endif

const char *get_user_name(const char *progname);

#define _(x) gettext((x))
void		init_nls(void);

typedef void (*help_handler) (const char *);

void		handle_help_version_opts(int argc, char *argv[], const char *fixed_progname, help_handler hlp);

extern char *simple_prompt(const char *prompt, int maxlen, bool echo);

PGconn *connectDatabase(const char *dbname, const char *pghost, const char *pgport,
		const char *pguser, bool require_password, const char *progname);

PGresult *
			executeQuery(PGconn *conn, const char *command, const char *progname, bool echo);

int
			check_yesno_response(const char *string);