Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
2 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*-------------------------------------------------------------------------
 *
 * archive_module.h
 *      Exports for archive modules.
 *
 * Copyright (c) 2022-2026, PostgreSQL Global Development Group
 *
 * src/include/archive/archive_module.h
 *
 *-------------------------------------------------------------------------
 */
#ifndef _ARCHIVE_MODULE_H
#define _ARCHIVE_MODULE_H
 
/*
 * The value of the archive_library GUC.
 */
extern PGDLLIMPORT char *XLogArchiveLibrary;
 
typedef struct ArchiveModuleState
{
    /*
     * Private data pointer for use by an archive module.  This can be used to
     * store state for the module that will be passed to each of its
     * callbacks.
     */
    void       *private_data;
} ArchiveModuleState;
 
/*
 * Archive module callbacks
 *
 * These callback functions should be defined by archive libraries and returned
 * via _PG_archive_module_init().  ArchiveFileCB is the only required callback.
 * For more information about the purpose of each callback, refer to the
 * archive modules documentation.
 */
typedef void (*ArchiveStartupCB) (ArchiveModuleState *state);
typedef bool (*ArchiveCheckConfiguredCB) (ArchiveModuleState *state);
typedef bool (*ArchiveFileCB) (ArchiveModuleState *state, const char *file, const char *path);
typedef void (*ArchiveShutdownCB) (ArchiveModuleState *state);
 
typedef struct ArchiveModuleCallbacks
{
    ArchiveStartupCB startup_cb;
    ArchiveCheckConfiguredCB check_configured_cb;
    ArchiveFileCB archive_file_cb;
    ArchiveShutdownCB shutdown_cb;
} ArchiveModuleCallbacks;
 
/*
 * Type of the shared library symbol _PG_archive_module_init that is looked
 * up when loading an archive library.
 */
typedef const ArchiveModuleCallbacks *(*ArchiveModuleInit) (void);
 
extern PGDLLEXPORT const ArchiveModuleCallbacks *_PG_archive_module_init(void);
 
/* Support for messages reported from archive module callbacks. */
 
extern PGDLLIMPORT char *arch_module_check_errdetail_string;
 
#define arch_module_check_errdetail \
    pre_format_elog_string(errno, TEXTDOMAIN), \
    arch_module_check_errdetail_string = format_elog_string
 
#endif                          /* _ARCHIVE_MODULE_H */