ArchiveCheckConfiguredCB check_configured_cb;
ArchiveFileCB archive_file_cb;
ArchiveShutdownCB shutdown_cb;
} ArchiveModuleCallbacks;
typedef const ArchiveModuleCallbacks *(*ArchiveModuleInit) (void);
</programlisting>
Only the <function>archive_file_cb</function> callback is required. The
others are optional.
</para>
</sect1>
<sect1 id="archive-module-callbacks">
<title>Archive Module Callbacks</title>
<para>
The archive callbacks define the actual archiving behavior of the module.
The server will call them as required to process each individual WAL file.
</para>
<sect2 id="archive-module-startup">
<title>Startup Callback</title>
<para>
The <function>startup_cb</function> callback is called shortly after the
module is loaded. This callback can be used to perform any additional
initialization required. If the archive module has any state, it can use
<structfield>state->private_data</structfield> to store it.
<programlisting>
typedef void (*ArchiveStartupCB) (ArchiveModuleState *state);
</programlisting>
</para>
</sect2>
<sect2 id="archive-module-check">
<title>Check Callback</title>
<para>
The <function>check_configured_cb</function> callback is called to determine
whether the module is fully configured and ready to accept WAL files (e.g.,
its configuration parameters are set to valid values). If no
<function>check_configured_cb</function> is defined, the server always
assumes the module is configured.
<programlisting>
typedef bool (*ArchiveCheckConfiguredCB) (ArchiveModuleState *state);
</programlisting>
If <literal>true</literal> is returned, the server will proceed with
archiving the file by calling the <function>archive_file_cb</function>
callback. If <literal>false</literal> is returned, archiving will not
proceed, and the archiver will emit the following message to the server log:
<screen>
WARNING: archive_mode enabled, yet archiving is not configured
</screen>
In the latter case, the server will periodically call this function, and
archiving will proceed only when it returns <literal>true</literal>.
</para>
<note>
<para>
When returning <literal>false</literal>, it may be useful to append