Skip to content

Commit 495d4bd

Browse files
authored
FFI 拡張を新規翻訳 (#316)
* 未訳ファイル reference/ffi/**/*.xml を追加 * FFI 拡張を新規翻訳
1 parent 911532b commit 495d4bd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+3954
-0
lines changed

reference/ffi/book.xml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- $Revision$ -->
3+
<!-- EN-Revision: 46a9cdd2dbef4ec89bf65fad9930e2feb78bbb98 Maintainer: nsfisis Status: ready -->
4+
5+
<book xml:id="book.ffi" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
6+
<?phpdoc extension-membership="bundled" ?>
7+
<title>外部関数インターフェース</title>
8+
<titleabbrev>FFI</titleabbrev>
9+
10+
<preface xml:id="intro.ffi">
11+
&reftitle.intro;
12+
<para>
13+
この拡張は、Zend 拡張 API の深い知識が無くとも、あるいは第三の中間言語を学ぶことをせずとも、
14+
純粋な PHP で共有ライブラリ (<filename>.DLL</filename> または <filename>.so</filename>)
15+
を読み込んだり、C の関数を呼び出したり、C のデータ構造にアクセスしたりすることを
16+
可能とします。
17+
公開 API は単一のクラス <classname>FFI</classname> として実装されています。
18+
このクラスの static メソッド (そのうちのいくつかは非 static メソッドとしても呼び出せます) や
19+
オーバーロードされたオブジェクトメソッドが、実際の C のデータとのやり取りを行います。
20+
</para>
21+
<caution>
22+
<para>
23+
FFI は、システムと低レベルでやり取りできるため危険です。
24+
FFI 拡張は、C 言語および使用する C API についての実用的な知識を持つ開発者のみが
25+
用いるべきです。リスクを最小化するため、FFI API の使用は
26+
<link linkend="ini.ffi.enable">ffi.enable</link> &php.ini; ディレクティブによって制限できます。
27+
</para>
28+
</caution>
29+
<note>
30+
<para>
31+
FFI 拡張は、古くからある PHP 拡張の API を廃止しようとしているわけではなく、
32+
C の関数やデータ構造へのアドホックなインターフェースを提供するにすぎません。
33+
</para>
34+
</note>
35+
<tip>
36+
<para>
37+
今のところ、FFI のデータ構造へのアクセスは、ネイティブな PHP の配列やオブジェクトへのアクセスと比べて
38+
非常に (約 2 倍) 低速です。したがって、速度のために FFI 拡張を使うことには意味がありません。
39+
しかし、メモリ消費を減らすために使うのは意味があるかもしれません。
40+
</para>
41+
</tip>
42+
</preface>
43+
44+
&reference.ffi.setup;
45+
&reference.ffi.examples;
46+
&reference.ffi.ffi;
47+
&reference.ffi.ffi.cdata;
48+
&reference.ffi.ffi.ctype;
49+
&reference.ffi.ffi.exception;
50+
&reference.ffi.ffi.parserexception;
51+
</book>
52+
53+
<!-- Keep this comment at the end of the file
54+
Local variables:
55+
mode: sgml
56+
sgml-omittag:t
57+
sgml-shorttag:t
58+
sgml-minimize-attributes:nil
59+
sgml-always-quote-attributes:t
60+
sgml-indent-step:1
61+
sgml-indent-data:t
62+
indent-tabs-mode:nil
63+
sgml-parent-document:nil
64+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
65+
sgml-exposed-tags:nil
66+
sgml-local-catalogs:nil
67+
sgml-local-ecat-files:nil
68+
End:
69+
vim600: syn=xml fen fdm=syntax fdl=2 si
70+
vim: et tw=78 syn=sgml
71+
vi: ts=1 sw=1
72+
-->

reference/ffi/configure.xml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- $Revision$ -->
3+
<!-- EN-Revision: cffb5f52894aa8a29109e3802e2257c56b51bcb6 Maintainer: nsfisis Status: ready -->
4+
5+
<section xml:id="ffi.installation" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
6+
&reftitle.install;
7+
8+
<para>
9+
FFI 拡張を有効にするには、
10+
<option role="configure">--with-ffi</option> を付けて
11+
PHP をビルドする必要があります。
12+
</para>
13+
14+
<para>
15+
Windows ユーザーが FFI 拡張を有効にするには、
16+
&php.ini; に <filename>php_ffi.dll</filename> を含める必要があります。
17+
</para>
18+
19+
</section>
20+
21+
22+
<!-- Keep this comment at the end of the file
23+
Local variables:
24+
mode: sgml
25+
sgml-omittag:t
26+
sgml-shorttag:t
27+
sgml-minimize-attributes:nil
28+
sgml-always-quote-attributes:t
29+
sgml-indent-step:1
30+
sgml-indent-data:t
31+
indent-tabs-mode:nil
32+
sgml-parent-document:nil
33+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
34+
sgml-exposed-tags:nil
35+
sgml-local-catalogs:nil
36+
sgml-local-ecat-files:nil
37+
End:
38+
vim600: syn=xml fen fdm=syntax fdl=2 si
39+
vim: et tw=78 syn=sgml
40+
vi: ts=1 sw=1
41+
-->
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- $Revision$ -->
3+
<!-- EN-Revision: 9e0804888ae46a50f28d98514a8d5e70a34e069c Maintainer: nsfisis Status: ready -->
4+
5+
<refentry xml:id="ffi-ctype.getalignment" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
6+
<refnamediv>
7+
<refname>FFI\CType::getAlignment</refname>
8+
<refpurpose>説明</refpurpose>
9+
</refnamediv>
10+
11+
<refsect1 role="description">
12+
&reftitle.description;
13+
<methodsynopsis role="FFI\\CType">
14+
<modifier>public</modifier> <type>int</type><methodname>FFI\CType::getAlignment</methodname>
15+
<void/>
16+
</methodsynopsis>
17+
<para>
18+
19+
</para>
20+
21+
&warn.undocumented.func;
22+
23+
</refsect1>
24+
25+
<refsect1 role="parameters">
26+
&reftitle.parameters;
27+
&no.function.parameters;
28+
</refsect1>
29+
30+
<refsect1 role="returnvalues">
31+
&reftitle.returnvalues;
32+
<para>
33+
34+
</para>
35+
</refsect1>
36+
37+
38+
</refentry>
39+
<!-- Keep this comment at the end of the file
40+
Local variables:
41+
mode: sgml
42+
sgml-omittag:t
43+
sgml-shorttag:t
44+
sgml-minimize-attributes:nil
45+
sgml-always-quote-attributes:t
46+
sgml-indent-step:1
47+
sgml-indent-data:t
48+
indent-tabs-mode:nil
49+
sgml-parent-document:nil
50+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
51+
sgml-exposed-tags:nil
52+
sgml-local-catalogs:nil
53+
sgml-local-ecat-files:nil
54+
End:
55+
vim600: syn=xml fen fdm=syntax fdl=2 si
56+
vim: et tw=78 syn=sgml
57+
vi: ts=1 sw=1
58+
-->
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- $Revision$ -->
3+
<!-- EN-Revision: 9e0804888ae46a50f28d98514a8d5e70a34e069c Maintainer: nsfisis Status: ready -->
4+
5+
<refentry xml:id="ffi-ctype.getarrayelementtype" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
6+
<refnamediv>
7+
<refname>FFI\CType::getArrayElementType</refname>
8+
<refpurpose>説明</refpurpose>
9+
</refnamediv>
10+
11+
<refsect1 role="description">
12+
&reftitle.description;
13+
<methodsynopsis role="FFI\\CType">
14+
<modifier>public</modifier> <type>FFI\CType</type><methodname>FFI\CType::getArrayElementType</methodname>
15+
<void/>
16+
</methodsynopsis>
17+
<para>
18+
19+
</para>
20+
21+
&warn.undocumented.func;
22+
23+
</refsect1>
24+
25+
<refsect1 role="parameters">
26+
&reftitle.parameters;
27+
&no.function.parameters;
28+
</refsect1>
29+
30+
<refsect1 role="returnvalues">
31+
&reftitle.returnvalues;
32+
<para>
33+
34+
</para>
35+
</refsect1>
36+
37+
38+
</refentry>
39+
<!-- Keep this comment at the end of the file
40+
Local variables:
41+
mode: sgml
42+
sgml-omittag:t
43+
sgml-shorttag:t
44+
sgml-minimize-attributes:nil
45+
sgml-always-quote-attributes:t
46+
sgml-indent-step:1
47+
sgml-indent-data:t
48+
indent-tabs-mode:nil
49+
sgml-parent-document:nil
50+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
51+
sgml-exposed-tags:nil
52+
sgml-local-catalogs:nil
53+
sgml-local-ecat-files:nil
54+
End:
55+
vim600: syn=xml fen fdm=syntax fdl=2 si
56+
vim: et tw=78 syn=sgml
57+
vi: ts=1 sw=1
58+
-->
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- $Revision$ -->
3+
<!-- EN-Revision: 9e0804888ae46a50f28d98514a8d5e70a34e069c Maintainer: nsfisis Status: ready -->
4+
5+
<refentry xml:id="ffi-ctype.getarraylength" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
6+
<refnamediv>
7+
<refname>FFI\CType::getArrayLength</refname>
8+
<refpurpose>説明</refpurpose>
9+
</refnamediv>
10+
11+
<refsect1 role="description">
12+
&reftitle.description;
13+
<methodsynopsis role="FFI\\CType">
14+
<modifier>public</modifier> <type>int</type><methodname>FFI\CType::getArrayLength</methodname>
15+
<void/>
16+
</methodsynopsis>
17+
<para>
18+
19+
</para>
20+
21+
&warn.undocumented.func;
22+
23+
</refsect1>
24+
25+
<refsect1 role="parameters">
26+
&reftitle.parameters;
27+
&no.function.parameters;
28+
</refsect1>
29+
30+
<refsect1 role="returnvalues">
31+
&reftitle.returnvalues;
32+
<para>
33+
34+
</para>
35+
</refsect1>
36+
37+
38+
</refentry>
39+
<!-- Keep this comment at the end of the file
40+
Local variables:
41+
mode: sgml
42+
sgml-omittag:t
43+
sgml-shorttag:t
44+
sgml-minimize-attributes:nil
45+
sgml-always-quote-attributes:t
46+
sgml-indent-step:1
47+
sgml-indent-data:t
48+
indent-tabs-mode:nil
49+
sgml-parent-document:nil
50+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
51+
sgml-exposed-tags:nil
52+
sgml-local-catalogs:nil
53+
sgml-local-ecat-files:nil
54+
End:
55+
vim600: syn=xml fen fdm=syntax fdl=2 si
56+
vim: et tw=78 syn=sgml
57+
vi: ts=1 sw=1
58+
-->
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- $Revision$ -->
3+
<!-- EN-Revision: 9e0804888ae46a50f28d98514a8d5e70a34e069c Maintainer: nsfisis Status: ready -->
4+
5+
<refentry xml:id="ffi-ctype.getattributes" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
6+
<refnamediv>
7+
<refname>FFI\CType::getAttributes</refname>
8+
<refpurpose>説明</refpurpose>
9+
</refnamediv>
10+
11+
<refsect1 role="description">
12+
&reftitle.description;
13+
<methodsynopsis role="FFI\\CType">
14+
<modifier>public</modifier> <type>int</type><methodname>FFI\CType::getAttributes</methodname>
15+
<void/>
16+
</methodsynopsis>
17+
<para>
18+
19+
</para>
20+
21+
&warn.undocumented.func;
22+
23+
</refsect1>
24+
25+
<refsect1 role="parameters">
26+
&reftitle.parameters;
27+
&no.function.parameters;
28+
</refsect1>
29+
30+
<refsect1 role="returnvalues">
31+
&reftitle.returnvalues;
32+
<para>
33+
34+
</para>
35+
</refsect1>
36+
37+
38+
</refentry>
39+
<!-- Keep this comment at the end of the file
40+
Local variables:
41+
mode: sgml
42+
sgml-omittag:t
43+
sgml-shorttag:t
44+
sgml-minimize-attributes:nil
45+
sgml-always-quote-attributes:t
46+
sgml-indent-step:1
47+
sgml-indent-data:t
48+
indent-tabs-mode:nil
49+
sgml-parent-document:nil
50+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
51+
sgml-exposed-tags:nil
52+
sgml-local-catalogs:nil
53+
sgml-local-ecat-files:nil
54+
End:
55+
vim600: syn=xml fen fdm=syntax fdl=2 si
56+
vim: et tw=78 syn=sgml
57+
vi: ts=1 sw=1
58+
-->

0 commit comments

Comments
 (0)