summaryrefslogtreecommitdiff
path: root/src/bin/scripts/common.h
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2003-03-18 22:19:47 +0000
committerPeter Eisentraut <peter_e@gmx.net>2003-03-18 22:19:47 +0000
commit9e0ab7126d106debb3fbdbc0e808368432cf39f0 (patch)
tree63d924e978ce0e50fc57bf44c30bdc8564f9a0f3 /src/bin/scripts/common.h
parentcf1cf8964925cd36dc7bf034a968a4e44ede382a (diff)
downloadpostgresql-9e0ab7126d106debb3fbdbc0e808368432cf39f0.tar.gz
Reimplement create and drop scripts in C, to reduce repetitive
connections, increase robustness, add NLS, and prepare for Windows port. (vacuumdb and clusterdb will follow later.)
Diffstat (limited to 'src/bin/scripts/common.h')
-rw-r--r--src/bin/scripts/common.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/bin/scripts/common.h b/src/bin/scripts/common.h
new file mode 100644
index 0000000000..52e7b0c3fc
--- /dev/null
+++ b/src/bin/scripts/common.h
@@ -0,0 +1,35 @@
+#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);
+char *get_progname(char *argv0);
+
+#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);