Skip to content

Commit 33c75a1

Browse files
committed
FFI 拡張を新規翻訳
1 parent b53e60d commit 33c75a1

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

+340
-330
lines changed

reference/ffi/book.xml

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,42 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 46a9cdd2dbef4ec89bf65fad9930e2feb78bbb98 Maintainer: nsfisis Status: working -->
3+
<!-- EN-Revision: 46a9cdd2dbef4ec89bf65fad9930e2feb78bbb98 Maintainer: nsfisis Status: ready -->
44

55
<book xml:id="book.ffi" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
66
<?phpdoc extension-membership="bundled" ?>
7-
<title>Foreign Function Interface</title>
7+
<title>外部関数インターフェース</title>
88
<titleabbrev>FFI</titleabbrev>
99

1010
<preface xml:id="intro.ffi">
1111
&reftitle.intro;
1212
<para>
13-
This extension allows the loading of shared libraries (<filename>.DLL</filename> or
14-
<filename>.so</filename>), calling of C functions and accessing of C data structures
15-
in pure PHP, without having to have deep knowledge of the Zend extension API, and
16-
without having to learn a third “intermediate” language.
17-
The public API is implemented as a single class <classname>FFI</classname> with
18-
several static methods (some of them may be called dynamically), and overloaded object
19-
methods, which perform the actual interaction with C data.
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 のデータとのやり取りを行います。
2020
</para>
2121
<caution>
2222
<para>
23-
FFI is dangerous, since it allows to interface with the system on a very low level.
24-
The FFI extension should only be used by developers having a working knowledge of C
25-
and the used C APIs. To minimize the risk, the FFI API usage may be restricted
26-
with the <link linkend="ini.ffi.enable">ffi.enable</link> &php.ini; directive.
23+
FFI は、システムと低レベルでやり取りできるため危険です。
24+
FFI 拡張は、C 言語および使用する C API についての実用的な知識を持つ開発者のみが
25+
用いるべきです。リスクを最小化するため、FFI API の使用は
26+
<link linkend="ini.ffi.enable">ffi.enable</link> &php.ini; ディレクティブによって制限できます。
2727
</para>
2828
</caution>
2929
<note>
3030
<para>
31-
The FFI extension does not render the classic PHP extension API obsolete; it is merely
32-
provided for ad-hoc interfacing with C functions and data structures.
31+
FFI 拡張は、古くからある PHP 拡張の API を廃止しようとしているわけではなく、
32+
C の関数やデータ構造へのアドホックなインターフェースを提供するにすぎません。
3333
</para>
3434
</note>
3535
<tip>
3636
<para>
37-
Currently, accessing FFI data structures is significantly (about 2 times) slower
38-
than accessing native PHP arrays and objects. Therefore, it makes no sense to use
39-
the FFI extension for speed; however, it may make sense to use it to reduce memory
40-
consumption.
37+
今のところ、FFI のデータ構造へのアクセスは、ネイティブな PHP の配列やオブジェクトへのアクセスと比べて
38+
非常に (約 2 倍) 低速です。したがって、速度のために FFI 拡張を使うことには意味がありません。
39+
しかし、メモリ消費を減らすために使うのは意味があるかもしれません。
4140
</para>
4241
</tip>
4342
</preface>

reference/ffi/configure.xml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: cffb5f52894aa8a29109e3802e2257c56b51bcb6 Maintainer: nsfisis Status: working -->
3+
<!-- EN-Revision: cffb5f52894aa8a29109e3802e2257c56b51bcb6 Maintainer: nsfisis Status: ready -->
44

55
<section xml:id="ffi.installation" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
66
&reftitle.install;
77

88
<para>
9-
To enable the FFI extension, PHP has to be configured with
10-
<option role="configure">--with-ffi</option>.
9+
FFI 拡張を有効にするには、
10+
<option role="configure">--with-ffi</option> を付けて
11+
PHP をビルドする必要があります。
1112
</para>
1213

1314
<para>
14-
Windows users have to include <filename>php_ffi.dll</filename> into &php.ini;
15-
to enable the FFI extension.
15+
Windows ユーザーが FFI 拡張を有効にするには、
16+
&php.ini; に <filename>php_ffi.dll</filename> を含める必要があります。
1617
</para>
1718

1819
</section>

reference/ffi/ctype/getalignment.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 9e0804888ae46a50f28d98514a8d5e70a34e069c Maintainer: nsfisis Status: working -->
3+
<!-- EN-Revision: 9e0804888ae46a50f28d98514a8d5e70a34e069c Maintainer: nsfisis Status: ready -->
44

55
<refentry xml:id="ffi-ctype.getalignment" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
66
<refnamediv>
77
<refname>FFI\CType::getAlignment</refname>
8-
<refpurpose>Description</refpurpose>
8+
<refpurpose>説明</refpurpose>
99
</refnamediv>
1010

1111
<refsect1 role="description">

reference/ffi/ctype/getarrayelementtype.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 9e0804888ae46a50f28d98514a8d5e70a34e069c Maintainer: nsfisis Status: working -->
3+
<!-- EN-Revision: 9e0804888ae46a50f28d98514a8d5e70a34e069c Maintainer: nsfisis Status: ready -->
44

55
<refentry xml:id="ffi-ctype.getarrayelementtype" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
66
<refnamediv>
77
<refname>FFI\CType::getArrayElementType</refname>
8-
<refpurpose>Description</refpurpose>
8+
<refpurpose>説明</refpurpose>
99
</refnamediv>
1010

1111
<refsect1 role="description">

reference/ffi/ctype/getarraylength.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 9e0804888ae46a50f28d98514a8d5e70a34e069c Maintainer: nsfisis Status: working -->
3+
<!-- EN-Revision: 9e0804888ae46a50f28d98514a8d5e70a34e069c Maintainer: nsfisis Status: ready -->
44

55
<refentry xml:id="ffi-ctype.getarraylength" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
66
<refnamediv>
77
<refname>FFI\CType::getArrayLength</refname>
8-
<refpurpose>Description</refpurpose>
8+
<refpurpose>説明</refpurpose>
99
</refnamediv>
1010

1111
<refsect1 role="description">

reference/ffi/ctype/getattributes.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 9e0804888ae46a50f28d98514a8d5e70a34e069c Maintainer: nsfisis Status: working -->
3+
<!-- EN-Revision: 9e0804888ae46a50f28d98514a8d5e70a34e069c Maintainer: nsfisis Status: ready -->
44

55
<refentry xml:id="ffi-ctype.getattributes" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
66
<refnamediv>
77
<refname>FFI\CType::getAttributes</refname>
8-
<refpurpose>Description</refpurpose>
8+
<refpurpose>説明</refpurpose>
99
</refnamediv>
1010

1111
<refsect1 role="description">

reference/ffi/ctype/getenumkind.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 9e0804888ae46a50f28d98514a8d5e70a34e069c Maintainer: nsfisis Status: working -->
3+
<!-- EN-Revision: 9e0804888ae46a50f28d98514a8d5e70a34e069c Maintainer: nsfisis Status: ready -->
44

55
<refentry xml:id="ffi-ctype.getenumkind" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
66
<refnamediv>
77
<refname>FFI\CType::getEnumKind</refname>
8-
<refpurpose>Description</refpurpose>
8+
<refpurpose>説明</refpurpose>
99
</refnamediv>
1010

1111
<refsect1 role="description">

reference/ffi/ctype/getfuncabi.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 9e0804888ae46a50f28d98514a8d5e70a34e069c Maintainer: nsfisis Status: working -->
3+
<!-- EN-Revision: 9e0804888ae46a50f28d98514a8d5e70a34e069c Maintainer: nsfisis Status: ready -->
44

55
<refentry xml:id="ffi-ctype.getfuncabi" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
66
<refnamediv>
77
<refname>FFI\CType::getFuncABI</refname>
8-
<refpurpose>Description</refpurpose>
8+
<refpurpose>説明</refpurpose>
99
</refnamediv>
1010

1111
<refsect1 role="description">

reference/ffi/ctype/getfuncparametercount.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 55e1ffbb74003fdd5d956afcc134669b2d493986 Maintainer: nsfisis Status: working -->
3+
<!-- EN-Revision: 55e1ffbb74003fdd5d956afcc134669b2d493986 Maintainer: nsfisis Status: ready -->
44

55
<refentry xml:id="ffi-ctype.getfuncparametercount" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
66
<refnamediv>
77
<refname>FFI\CType::getFuncParameterCount</refname>
8-
<refpurpose>Retrieve the count of parameters of a function type</refpurpose>
8+
<refpurpose>関数型の引数の数を取得する</refpurpose>
99
</refnamediv>
1010

1111
<refsect1 role="description">
@@ -28,9 +28,9 @@
2828
<refsect1 role="returnvalues">
2929
&reftitle.returnvalues;
3030
<para>
31-
Returns the number of parameters for the underlying function type.
32-
If the underlying type is not a function, an
33-
<exceptionname>FFI\Exception</exceptionname> is thrown.
31+
内部的に保持している関数型の引数の数を返します。
32+
内部的に保持している型が関数でない場合、
33+
<exceptionname>FFI\Exception</exceptionname> をスローします。
3434
</para>
3535
</refsect1>
3636

reference/ffi/ctype/getfuncparametertype.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 184bc21699133fda630f0327fcd7d636a14d45fb Maintainer: nsfisis Status: working -->
3+
<!-- EN-Revision: 184bc21699133fda630f0327fcd7d636a14d45fb Maintainer: nsfisis Status: ready -->
44

55
<refentry xml:id="ffi-ctype.getfuncparametertype" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
66
<refnamediv>
77
<refname>FFI\CType::getFuncParameterType</refname>
8-
<refpurpose>Retrieve the type of a function parameter</refpurpose>
8+
<refpurpose>関数の引数の型を取得する</refpurpose>
99
</refnamediv>
1010

1111
<refsect1 role="description">
@@ -15,7 +15,7 @@
1515
<methodparam><type>int</type><parameter>index</parameter></methodparam>
1616
</methodsynopsis>
1717
<para>
18-
Returns the type of a parameter for the underlying function type.
18+
内部的に保持している関数型の引数の型を返します。
1919
</para>
2020

2121
</refsect1>
@@ -27,7 +27,7 @@
2727
<term><parameter>index</parameter></term>
2828
<listitem>
2929
<para>
30-
Index of the function parameter, zero-based.
30+
関数の引数の添字 (ゼロ始まり)。
3131
</para>
3232
</listitem>
3333
</varlistentry>
@@ -37,10 +37,10 @@
3737
<refsect1 role="returnvalues">
3838
&reftitle.returnvalues;
3939
<para>
40-
Returns the type of a parameter for the underlying function type.
41-
If the underlying type is not a function, or the given index is outside
42-
of the range of parameters of the function, an
43-
<exceptionname>FFI\Exception</exceptionname> is thrown.
40+
内部的に保持している関数型の引数の型を返します。
41+
内部的に保持している型が関数でない場合や、
42+
与えられた添字がその関数の引数の範囲外の場合、
43+
<exceptionname>FFI\Exception</exceptionname> をスローします。
4444
</para>
4545
</refsect1>
4646

0 commit comments

Comments
 (0)