PostgreSQL Source Code  git master
pg_backup_utils.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * pg_backup_utils.h
4  * Utility routines shared by pg_dump and pg_restore.
5  *
6  *
7  * Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/bin/pg_dump/pg_backup_utils.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 
15 #ifndef PG_BACKUP_UTILS_H
16 #define PG_BACKUP_UTILS_H
17 
18 #include "common/logging.h"
19 
20 typedef enum /* bits returned by set_dump_section */
21 {
22  DUMP_PRE_DATA = 0x01,
23  DUMP_DATA = 0x02,
26 } DumpSections;
27 
28 typedef void (*on_exit_nicely_callback) (int code, void *arg);
29 
30 extern const char *progname;
31 
32 extern void set_dump_section(const char *arg, int *dumpSections);
33 extern void on_exit_nicely(on_exit_nicely_callback function, void *arg);
34 extern void exit_nicely(int code) pg_attribute_noreturn();
35 
36 #define fatal(...) do { pg_log_error(__VA_ARGS__); exit_nicely(1); } while(0)
37 
38 #endif /* PG_BACKUP_UTILS_H */
const char * progname
Definition: pg_standby.c:36
void on_exit_nicely(on_exit_nicely_callback function, void *arg)
void(* on_exit_nicely_callback)(int code, void *arg)
void exit_nicely(int code) pg_attribute_noreturn()
void set_dump_section(const char *arg, int *dumpSections)
DumpSections
#define pg_attribute_noreturn()
Definition: c.h:147
void * arg