]> begriffs open source - ai-pg/blob - full-docs/txt/archive-module-init.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / archive-module-init.txt
1
2 49.1. Initialization Functions #
3
4    An archive library is loaded by dynamically loading a shared library
5    with the archive_library's name as the library base name. The normal
6    library search path is used to locate the library. To provide the
7    required archive module callbacks and to indicate that the library is
8    actually an archive module, it needs to provide a function named
9    _PG_archive_module_init. The result of the function must be a pointer
10    to a struct of type ArchiveModuleCallbacks, which contains everything
11    that the core code needs to know to make use of the archive module. The
12    return value needs to be of server lifetime, which is typically
13    achieved by defining it as a static const variable in global scope.
14 typedef struct ArchiveModuleCallbacks
15 {
16     ArchiveStartupCB startup_cb;
17     ArchiveCheckConfiguredCB check_configured_cb;
18     ArchiveFileCB archive_file_cb;
19     ArchiveShutdownCB shutdown_cb;
20 } ArchiveModuleCallbacks;
21 typedef const ArchiveModuleCallbacks *(*ArchiveModuleInit) (void);
22
23    Only the archive_file_cb callback is required. The others are optional.