1 /*-------------------------------------------------------------------------
4 * Utility routines shared by pg_dump and pg_restore.
7 * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
10 * src/bin/pg_dump/pg_backup_utils.h
12 *-------------------------------------------------------------------------
15 #ifndef PG_BACKUP_UTILS_H
16 #define PG_BACKUP_UTILS_H
18 typedef enum /* bits returned by set_dump_section */
22 DUMP_POST_DATA = 0x04,
23 DUMP_UNSECTIONED = 0xff
26 typedef void (*on_exit_nicely_callback) (int code, void *arg);
28 extern const char *progname;
30 extern void set_dump_section(const char *arg, int *dumpSections);
31 extern void write_msg(const char *modulename, const char *fmt,...) pg_attribute_printf(2, 3);
32 extern void vwrite_msg(const char *modulename, const char *fmt, va_list ap) pg_attribute_printf(2, 0);
33 extern void on_exit_nicely(on_exit_nicely_callback function, void *arg);
34 extern void exit_nicely(int code) pg_attribute_noreturn();
36 extern void exit_horribly(const char *modulename, const char *fmt,...) pg_attribute_printf(2, 3) pg_attribute_noreturn();
38 #endif /* PG_BACKUP_UTILS_H */