Header And Logo

PostgreSQL
| The world's most advanced open source database.

Typedefs | Enumerations | Functions | Variables

pg_backup_utils.h File Reference

This graph shows which files directly or indirectly include this file:

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 Documentation

typedef void(* on_exit_nicely_callback)(int code, void *arg)

Definition at line 26 of file pg_backup_utils.h.


Enumeration Type Documentation

Enumerator:
DUMP_PRE_DATA 
DUMP_DATA 
DUMP_POST_DATA 
DUMP_UNSECTIONED 

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;


Function Documentation

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 
)
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,
  ... 
)

Variable Documentation

const char* progname

Definition at line 35 of file pg_archivecleanup.c.