-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharchive-module-init.html
More file actions
42 lines (40 loc) · 5.9 KB
/
archive-module-init.html
File metadata and controls
42 lines (40 loc) · 5.9 KB
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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>49.1. 初期化関数</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="archive-modules.html" title="第49章 アーカイブモジュール" /><link rel="next" href="archive-module-callbacks.html" title="49.2. アーカイブモジュールコールバック" /><meta name="viewport" content="width=device-width,initial-scale=1.0" /></head><body id="docContent" class="container-fluid col-10"><div class="other_version"><a href="https://www.postgresql.jp/document/">バージョンごとのドキュメント一覧</a></div><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="4" align="center"><a accesskey="h" href="index.html">PostgreSQL 18.3文書</a></th></tr><tr><td width="10%" align="left"></td><td width="10%" align="left"></td><td width="60%" align="center"><a href="archive-modules.html" title="第49章 アーカイブモジュール">第49章 アーカイブモジュール</a></td><td width="20%" align="right"><div class="actions"><a class="issue" title="github" href="https://github.com/pgsql-jp/jpug-doc/issues/new?template=bug_report.yml&what-happened=version 18.3 : archive-module-init.html">誤訳等の報告
</a></div></td></tr><tr><td width="10%" align="left"><a accesskey="p" href="archive-modules.html" title="第49章 アーカイブモジュール">前へ</a> </td><td width="10%" align="left"><a accesskey="u" href="archive-modules.html" title="第49章 アーカイブモジュール">上へ</a></td><td width="60%" align="center">49.1. 初期化関数</td><td width="20%" align="right"> <a accesskey="n" href="archive-module-callbacks.html" title="49.2. アーカイブモジュールコールバック">次へ</a></td></tr></table><hr /></div><div class="sect1" id="ARCHIVE-MODULE-INIT"><div class="titlepage"><div><div><h2 class="title" style="clear: both">49.1. 初期化関数 <a href="#ARCHIVE-MODULE-INIT" class="id_link">#</a></h2></div></div></div><span class="original">
<title>Initialization Functions</title>
</span><a id="id-1.8.16.8.2" class="indexterm"></a><p>
<span class="original">
An archive library is loaded by dynamically loading a shared library with the
<xref linkend="guc-archive-library"/>'s name as the library base name. The
normal library search path is used to locate the library. To provide the
required archive module callbacks and to indicate that the library is
actually an archive module, it needs to provide a function named
<function>_PG_archive_module_init</function>. The result of the function
must be a pointer to a struct of type
<structname>ArchiveModuleCallbacks</structname>, which contains everything
that the core code needs to know to make use of the archive module. The
return value needs to be of server lifetime, which is typically achieved by
defining it as a <literal>static const</literal> variable in global scope.
</span>
アーカイブライブラリは、<a class="xref" href="runtime-config-wal.html#GUC-ARCHIVE-LIBRARY">archive_library</a>の名前をライブラリ・ベース名とする共有ライブラリを動的にロードすることによってロードされます。
通常のライブラリ検索パスを使用してライブラリが検索されます。
必要なアーカイブモジュールコールバックを提供し、ライブラリが実際にアーカイブモジュールであることを示すには、<code class="function">_PG_archive_module_init</code>という名前の関数を提供する必要があります。
関数の結果は、コアコードがアーカイブモジュールを利用するために必要なすべての情報を含む<code class="structname">ArchiveModuleCallbacks</code>型の構造体へのポインタである必要があります。
戻り値は、サーバのライフタイムである必要があります。これは、通常、グローバルスコープで<code class="literal">static const</code>変数として定義することによって達成されます。
</p><pre class="programlisting">
typedef struct ArchiveModuleCallbacks
{
ArchiveStartupCB startup_cb;
ArchiveCheckConfiguredCB check_configured_cb;
ArchiveFileCB archive_file_cb;
ArchiveShutdownCB shutdown_cb;
} ArchiveModuleCallbacks;
typedef const ArchiveModuleCallbacks *(*ArchiveModuleInit) (void);
</pre><p>
<span class="original">
Only the <function>archive_file_cb</function> callback is required. The
others are optional.
</span>
<code class="function">archive_file_cb</code>コールバックのみが必要です。
その他はオプションです。
</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="archive-modules.html" title="第49章 アーカイブモジュール">前へ</a> </td><td width="20%" align="center"><a accesskey="u" href="archive-modules.html" title="第49章 アーカイブモジュール">上へ</a></td><td width="40%" align="right"> <a accesskey="n" href="archive-module-callbacks.html" title="49.2. アーカイブモジュールコールバック">次へ</a></td></tr><tr><td width="40%" align="left" valign="top">第49章 アーカイブモジュール </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 18.3文書">ホーム</a></td><td width="40%" align="right" valign="top"> 49.2. アーカイブモジュールコールバック</td></tr></table></div></body></html>