diff options
author | Heikki Linnakangas | 2013-03-27 16:10:40 +0000 |
---|---|---|
committer | Heikki Linnakangas | 2013-03-27 16:10:40 +0000 |
commit | 7800a71291690dcc34eb3b7aab18750b5a7ebe2c (patch) | |
tree | ce2832159c7f6486c12faff5191b114339ee8065 /src/bin/pg_dump/dumputils.h | |
parent | 1cea9bbb21e9e90dc7085ce605d9160e7161fa58 (diff) |
Move some pg_dump function around.
Move functions used only by pg_dump and pg_restore from dumputils.c to a new
file, pg_backup_utils.c. dumputils.c is linked into psql and some programs
in bin/scripts, so it seems good to keep it slim. The parallel functionality
is moved to parallel.c, as is exit_horribly, because the interesting code in
exit_horribly is parallel-related.
This refactoring gets rid of the on_exit_msg_func function pointer. It was
problematic, because a modern gcc version with -Wmissing-format-attribute
complained if it wasn't marked with PF_PRINTF_ATTRIBUTE, but the ancient gcc
version that Tom Lane's old HP-UX box has didn't accept that attribute on a
function pointer, and gave an error. We still use a similar function pointer
trick for getLocalPQBuffer() function, to use a thread-local version of that
in parallel mode on Windows, but that dodges the problem because it doesn't
take printf-like arguments.
Diffstat (limited to 'src/bin/pg_dump/dumputils.h')
-rw-r--r-- | src/bin/pg_dump/dumputils.h | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/src/bin/pg_dump/dumputils.h b/src/bin/pg_dump/dumputils.h index 5734c336178..356e8ebd32d 100644 --- a/src/bin/pg_dump/dumputils.h +++ b/src/bin/pg_dump/dumputils.h @@ -19,14 +19,6 @@ #include "libpq-fe.h" #include "pqexpbuffer.h" -typedef enum /* bits returned by set_dump_section */ -{ - DUMP_PRE_DATA = 0x01, - DUMP_DATA = 0x02, - DUMP_POST_DATA = 0x04, - DUMP_UNSECTIONED = 0xff -} DumpSections; - typedef struct SimpleStringListCell { struct SimpleStringListCell *next; @@ -40,14 +32,9 @@ typedef struct SimpleStringList } SimpleStringList; -typedef void (*on_exit_nicely_callback) (int code, void *arg); - extern int quote_all_identifiers; -extern const char *progname; -extern void (*on_exit_msg_func) (const char *modulename, const char *fmt, va_list ap) -__attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 0))); +extern PQExpBuffer (*getLocalPQExpBuffer) (void); -extern void init_parallel_dump_utils(void); extern const char *fmtId(const char *identifier); extern const char *fmtQualifiedId(int remoteVersion, const char *schema, const char *id); @@ -79,17 +66,6 @@ extern void buildShSecLabelQuery(PGconn *conn, const char *catalog_name, extern void emitShSecLabels(PGconn *conn, PGresult *res, PQExpBuffer buffer, const char *target, const char *objname); extern void set_dump_section(const char *arg, int *dumpSections); -extern void -write_msg(const char *modulename, const char *fmt,...) -__attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 3))); -extern void -vwrite_msg(const char *modulename, const char *fmt, va_list ap) -__attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 0))); -extern void -exit_horribly(const char *modulename, const char *fmt,...) -__attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 3), noreturn)); -extern void on_exit_nicely(on_exit_nicely_callback function, void *arg); -extern void exit_nicely(int code) __attribute__((noreturn)); extern void simple_string_list_append(SimpleStringList *list, const char *val); extern bool simple_string_list_member(SimpleStringList *list, const char *val); |