PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
archive_module.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------
2 *
3 * archive_module.h
4 * Exports for archive modules.
5 *
6 * Copyright (c) 2022-2025, PostgreSQL Global Development Group
7 *
8 * src/include/archive/archive_module.h
9 *
10 *-------------------------------------------------------------------------
11 */
12#ifndef _ARCHIVE_MODULE_H
13#define _ARCHIVE_MODULE_H
14
15/*
16 * The value of the archive_library GUC.
17 */
19
20typedef struct ArchiveModuleState
21{
22 /*
23 * Private data pointer for use by an archive module. This can be used to
24 * store state for the module that will be passed to each of its
25 * callbacks.
26 */
29
30/*
31 * Archive module callbacks
32 *
33 * These callback functions should be defined by archive libraries and returned
34 * via _PG_archive_module_init(). ArchiveFileCB is the only required callback.
35 * For more information about the purpose of each callback, refer to the
36 * archive modules documentation.
37 */
40typedef bool (*ArchiveFileCB) (ArchiveModuleState *state, const char *file, const char *path);
42
44{
50
51/*
52 * Type of the shared library symbol _PG_archive_module_init that is looked
53 * up when loading an archive library.
54 */
55typedef const ArchiveModuleCallbacks *(*ArchiveModuleInit) (void);
56
58
59/* Support for messages reported from archive module callbacks. */
60
62
63#define arch_module_check_errdetail \
64 pre_format_elog_string(errno, TEXTDOMAIN), \
65 arch_module_check_errdetail_string = format_elog_string
66
67#endif /* _ARCHIVE_MODULE_H */
struct ArchiveModuleState ArchiveModuleState
bool(* ArchiveFileCB)(ArchiveModuleState *state, const char *file, const char *path)
PGDLLIMPORT char * XLogArchiveLibrary
Definition: pgarch.c:92
bool(* ArchiveCheckConfiguredCB)(ArchiveModuleState *state)
struct ArchiveModuleCallbacks ArchiveModuleCallbacks
void(* ArchiveShutdownCB)(ArchiveModuleState *state)
PGDLLEXPORT const ArchiveModuleCallbacks * _PG_archive_module_init(void)
Definition: basic_archive.c:82
void(* ArchiveStartupCB)(ArchiveModuleState *state)
PGDLLIMPORT char * arch_module_check_errdetail_string
Definition: pgarch.c:93
#define PGDLLIMPORT
Definition: c.h:1274
#define PGDLLEXPORT
Definition: c.h:1289
ArchiveFileCB archive_file_cb
ArchiveShutdownCB shutdown_cb
ArchiveCheckConfiguredCB check_configured_cb
ArchiveStartupCB startup_cb
Definition: regguts.h:323