
Go to the source code of this file.
Typedefs | |
| typedef void(* | on_exit_nicely_callback )(int code, void *arg) |
Enumerations | |
| enum | DumpSections { DUMP_PRE_DATA = 0x01, DUMP_DATA = 0x02, DUMP_POST_DATA = 0x04, DUMP_UNSECTIONED = 0xff } |
Functions | |
| void | set_dump_section (const char *arg, int *dumpSections) |
| void | write_msg (const char *modulename, const char *fmt,...) __attribute__((format(PG_PRINTF_ATTRIBUTE |
| void void | vwrite_msg (const char *modulename, const char *fmt, va_list ap) __attribute__((format(PG_PRINTF_ATTRIBUTE |
| void void void | on_exit_nicely (on_exit_nicely_callback function, void *arg) |
| void | exit_nicely (int code) __attribute__((noreturn)) |
Variables | |
| const char * | progname |
| typedef void(* on_exit_nicely_callback)(int code, void *arg) |
Definition at line 26 of file pg_backup_utils.h.
| enum DumpSections |
Definition at line 18 of file pg_backup_utils.h.
{
DUMP_PRE_DATA = 0x01,
DUMP_DATA = 0x02,
DUMP_POST_DATA = 0x04,
DUMP_UNSECTIONED = 0xff
} DumpSections;
| void exit_nicely | ( | int | code | ) |
Definition at line 112 of file pg_backup_utils.c.
References function, i, on_exit_nicely_index, and on_exit_nicely_list.
{
int i;
for (i = on_exit_nicely_index - 1; i >= 0; i--)
(*on_exit_nicely_list[i].function) (code,
on_exit_nicely_list[i].arg);
#ifdef WIN32
if (parallel_init_done && GetCurrentThreadId() != mainThreadId)
ExitThread(code);
#endif
exit(code);
}
| void void void on_exit_nicely | ( | on_exit_nicely_callback | function, | |
| void * | arg | |||
| ) |
Definition at line 98 of file pg_backup_utils.c.
References exit_horribly(), MAX_ON_EXIT_NICELY, NULL, on_exit_nicely_index, and on_exit_nicely_list.
Referenced by init_parallel_dump_utils(), and on_exit_close_archive().
{
if (on_exit_nicely_index >= MAX_ON_EXIT_NICELY)
exit_horribly(NULL, "out of on_exit_nicely slots\n");
on_exit_nicely_list[on_exit_nicely_index].function = function;
on_exit_nicely_list[on_exit_nicely_index].arg = arg;
on_exit_nicely_index++;
}
| void set_dump_section | ( | const char * | arg, | |
| int * | dumpSections | |||
| ) |
Definition at line 40 of file pg_backup_utils.c.
References _, DUMP_UNSECTIONED, exit_nicely, and progname.
{
/* if this is the first call, clear all the bits */
if (*dumpSections == DUMP_UNSECTIONED)
*dumpSections = 0;
if (strcmp(arg, "pre-data") == 0)
*dumpSections |= DUMP_PRE_DATA;
else if (strcmp(arg, "data") == 0)
*dumpSections |= DUMP_DATA;
else if (strcmp(arg, "post-data") == 0)
*dumpSections |= DUMP_POST_DATA;
else
{
fprintf(stderr, _("%s: unrecognized section name: \"%s\"\n"),
progname, arg);
fprintf(stderr, _("Try \"%s --help\" for more information.\n"),
progname);
exit_nicely(1);
}
}
| void void vwrite_msg | ( | const char * | modulename, | |
| const char * | fmt, | |||
| va_list | ap | |||
| ) |
| void write_msg | ( | const char * | modulename, | |
| const char * | fmt, | |||
| ... | ||||
| ) |
| const char* progname |
Definition at line 35 of file pg_archivecleanup.c.
1.7.1