#include "postgres_fe.h"
#include "pg_backup_utils.h"
#include "parallel.h"
Go to the source code of this file.
Defines | |
#define | MAX_ON_EXIT_NICELY 20 |
Functions | |
void | set_dump_section (const char *arg, int *dumpSections) |
void | write_msg (const char *modulename, const char *fmt,...) |
void | vwrite_msg (const char *modulename, const char *fmt, va_list ap) |
void | on_exit_nicely (on_exit_nicely_callback function, void *arg) |
void | exit_nicely (int code) |
Variables | |
const char * | progname = NULL |
struct { | |
on_exit_nicely_callback function | |
void * arg | |
} | on_exit_nicely_list [MAX_ON_EXIT_NICELY] |
static int | on_exit_nicely_index |
#define MAX_ON_EXIT_NICELY 20 |
Definition at line 22 of file pg_backup_utils.c.
Referenced by on_exit_nicely().
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 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.
Referenced by main().
{ /* 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 vwrite_msg | ( | const char * | modulename, | |
const char * | fmt, | |||
va_list | ap | |||
) |
Definition at line 84 of file pg_backup_utils.c.
Referenced by ahlog(), exit_horribly(), warn_or_exit_horribly(), and write_msg().
{ if (progname) { if (modulename) fprintf(stderr, "%s: [%s] ", progname, _(modulename)); else fprintf(stderr, "%s: ", progname); } vfprintf(stderr, _(fmt), ap); }
void write_msg | ( | const char * | modulename, | |
const char * | fmt, | |||
... | ||||
) |
Definition at line 71 of file pg_backup_utils.c.
References vwrite_msg().
Referenced by _allocAH(), _check_database_version(), _discoverArchiveFormat(), _getFilePos(), _getObjectDescription(), _printTocEntry(), convertOperatorReference(), die_on_query_failure(), dumpAgg(), dumpBlobs(), dumpCast(), dumpDatabase(), dumpEncoding(), dumpFunc(), dumpRule(), dumpSequence(), dumpSequenceData(), dumpStdStrings(), dumpTableData_copy(), dumpTrigger(), dumpType(), findParentsByOid(), format_function_arguments_old(), getAggregates(), getBlobs(), getConstraints(), getDependencies(), getFuncs(), getIndexes(), getNamespaces(), getOpclasses(), getOperators(), getOpfamilies(), getSchemaData(), getTableAttrs(), getTables(), getTriggers(), getTypes(), main(), notice_processor(), parseOidArray(), ReadHead(), repairDependencyLoop(), restore_toc_entry(), SetArchiveRestoreOptions(), SortTocFromFile(), warn_or_exit_horribly(), and WriteHead().
{ va_list ap; va_start(ap, fmt); vwrite_msg(modulename, fmt, ap); va_end(ap); }
void* arg |
Definition at line 27 of file pg_backup_utils.c.
Referenced by _bt_mkscankey(), _copyA_Indirection(), _copyArrayCoerceExpr(), _copyBooleanTest(), _copyCaseExpr(), _copyCoerceToDomain(), _copyCoerceViaIO(), _copyCollateClause(), _copyCollateExpr(), _copyConvertRowtypeExpr(), _copyDefElem(), _copyFieldSelect(), _copyFieldStore(), _copyNamedArgExpr(), _copyNullTest(), _copyRelabelType(), _copyTypeCast(), _equalA_Indirection(), _equalArrayCoerceExpr(), _equalBooleanTest(), _equalCaseExpr(), _equalCoerceToDomain(), _equalCoerceViaIO(), _equalCollateClause(), _equalCollateExpr(), _equalConvertRowtypeExpr(), _equalDefElem(), _equalFieldSelect(), _equalFieldStore(), _equalNamedArgExpr(), _equalNullTest(), _equalRelabelType(), _equalTypeCast(), _outA_Indirection(), _outArrayCoerceExpr(), _outBooleanTest(), _outCaseExpr(), _outCoerceToDomain(), _outCoerceViaIO(), _outCollateClause(), _outCollateExpr(), _outConvertRowtypeExpr(), _outDefElem(), _outFieldSelect(), _outFieldStore(), _outNamedArgExpr(), _outNullTest(), _outRelabelType(), _outTypeCast(), _readArrayCoerceExpr(), _readBooleanTest(), _readCaseExpr(), _readCoerceToDomain(), _readCoerceViaIO(), _readCollateExpr(), _readConvertRowtypeExpr(), _readFieldSelect(), _readFieldStore(), _readNamedArgExpr(), _readNullTest(), _readRelabelType(), add_one(), add_one_float8(), advance_windowaggregate(), ATColumnChangeRequiresRewrite(), bit(), bitlength(), bitnot(), bitoctetlength(), bitshiftleft(), bitshiftright(), bittoint4(), bittoint8(), bpcharlen(), bpcharoctetlen(), build_subplan(), canonicalize_ec_expression(), clause_selectivity(), coerce_record_to_complex(), coerce_to_target_type(), ComputeIndexAttrs(), ConvertTriggerToFK(), deparseFuncExpr(), deparseOpExpr(), DispatchJobForTocEntry(), dmetaphone(), dmetaphone_alt(), dtoi8(), eval_const_expressions_mutator(), evaluate_function(), examine_variable(), exec_simple_check_node(), ExecEvalCoalesce(), ExecEvalFuncArgs(), ExecEvalMinMax(), ExecEvalRow(), ExecEvalXml(), ExecIndexBuildScanKeys(), ExecInitExpr(), ExecMakeFunctionResultNoSets(), ExecuteDoStmt(), expand_boolean_index_clause(), expand_function_arguments(), exprCollation(), expression_tree_walker(), exprLocation(), exprSetCollation(), exprType(), exprTypmod(), FigureColnameInternal(), find_ec_member_for_tle(), find_param_referent(), fix_indexqual_operand(), flatten_set_variable_args(), float4up(), float8up(), ftoi8(), get_agg_expr(), get_call_expr_arg_stable(), get_call_expr_argtype(), get_func_expr(), get_oper_expr(), get_rule_expr(), get_windowfunc_expr(), gincost_opexpr(), gincost_scalararrayopexpr(), ginExtractEntries(), HandleSlashCmds(), i8tod(), i8tof(), i8tooid(), inline_function(), int28(), int2um(), int2up(), int48(), int4inc(), int4um(), int4up(), int82(), int84(), int8inc(), int8um(), int8up(), isSimpleNode(), list_member_strip(), match_eclass_clauses_to_index(), match_index_to_operand(), numeric_exp(), numeric_inc(), numeric_ln(), numeric_round(), numeric_sqrt(), numeric_trunc(), oidtoi8(), ParseFuncOrColumn(), pg_digest(), pg_hmac(), pgp_pub_decrypt_bytea(), pgp_pub_decrypt_text(), pgp_pub_encrypt_bytea(), pgp_pub_encrypt_text(), pgp_sym_decrypt_bytea(), pgp_sym_decrypt_text(), pgp_sym_encrypt_bytea(), pgp_sym_encrypt_text(), PLy_function_build_args(), postgresGetForeignPaths(), predicate_refuted_by_simple_clause(), proc_exit(), proc_exit_prepare(), pull_ands(), pull_ors(), raw_expression_tree_walker(), relabel_to_typmod(), reorder_function_arguments(), runShellCommand(), shmem_exit(), simplify_and_arguments(), simplify_or_arguments(), soundex(), strip_array_coercion(), text_format(), tlist_member_ignore_relabel(), transformAggregateCall(), transformCaseExpr(), txid_snapshot_xip(), varbit(), xmlcomment(), and xmlelement().
Definition at line 26 of file pg_backup_utils.c.
Referenced by exit_nicely(), plpgsql_compile(), plpgsql_compile_inline(), and PrepareToInvalidateCacheTuple().
int on_exit_nicely_index [static] |
Definition at line 30 of file pg_backup_utils.c.
Referenced by exit_nicely(), and on_exit_nicely().
struct { ... } on_exit_nicely_list[MAX_ON_EXIT_NICELY] [static] |
Referenced by exit_nicely(), and on_exit_nicely().
const char* progname = NULL |
Definition at line 20 of file pg_backup_utils.c.