Skip to content

Commit 6308157

Browse files
committed
wip
1 parent c3bef87 commit 6308157

File tree

2 files changed

+16
-29
lines changed

2 files changed

+16
-29
lines changed

reference/ffi/ffi.cdata.xml

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,74 +13,63 @@
1313
<section xml:id="ffi-cdata.intro">
1414
&reftitle.intro;
1515
<para>
16-
!!!
17-
<classname>FFI\CData</classname> objects can be used in a number of ways as a regular
16+
<classname>FFI\CData</classname> オブジェクトは、通常の PHP データのように様々な方法で使用できます:
1817

19-
PHP data:
2018
<itemizedlist>
2119
<listitem>
2220
<simpara>
23-
!!!
24-
C data of scalar types can be read and assigned via the <property>$cdata</property> property, e.g.
21+
スカラー型の C のデータは <property>$cdata</property> プロパティを通してアクセスできます。例:
2522
<code>$x = FFI::new('int'); $x-&gt;cdata = 42;</code>
2623
</simpara>
2724
</listitem>
2825
<listitem>
2926
<simpara>
30-
!!!
31-
C struct and union fields can be accessed as regular PHP object property, e.g.
27+
C の構造体や共用体のフィールドは通常の PHP のオブジェクトプロパティのようにアクセスできます。例:
3228
<code>$cdata-&gt;field</code>
3329
</simpara>
3430
</listitem>
3531
<listitem>
3632
<simpara>
37-
!!!
38-
C array elements can be accessed as regular PHP array elements, e.g.
33+
C の配列要素は通常の PHP の配列要素のようにアクセスできます。例:
3934
<code>$cdata[$offset]</code>
4035
</simpara>
4136
</listitem>
4237
<listitem>
4338
<simpara>
44-
!!!
45-
C arrays can be iterated using &foreach; statements.
39+
C の配列は &foreach; 文を使って反復できます。
4640
</simpara>
4741
</listitem>
4842
<listitem>
4943
<simpara>
50-
!!!
51-
C arrays can be used as arguments of <function>count</function>.
44+
C の配列は <function>count</function> の引数として使えます。
5245
</simpara>
5346
</listitem>
5447
<listitem>
5548
<simpara>
56-
!!!
57-
C pointers can be dereferenced as arrays, e.g. <code>$cdata[0]</code>
49+
!!! dereference
50+
C のポインタは配列のように dereference できます。例: <code>$cdata[0]</code>
5851
</simpara>
5952
</listitem>
6053
<listitem>
6154
<simpara>
62-
!!!
63-
C pointers can be compared using regular comparison operators (<code>&lt;</code>,
64-
<code>&lt;=</code>, <code>==</code>, <code>!=</code>, <code>&gt;=</code>, <code>&gt;</code>).
55+
C のポインタは通常の比較演算子を使って比較できます (<code>&lt;</code>、
56+
<code>&lt;=</code>、<code>==</code>、<code>!=</code>、<code>&gt;=</code>、<code>&gt;</code>)。
6557
</simpara>
6658
</listitem>
6759
<listitem>
6860
<simpara>
69-
!!!
70-
C pointers can be incremented and decremented using regular <code>+</code>/<code>-</code>/
71-
<code>++</code>/<code>--</code> operations, e.g. <code>$cdata += 5</code>
61+
C のポインタは通常の <code>+</code>/<code>-</code>/
62+
<code>++</code>/<code>--</code> 演算子を使ってインクリメント・デクリメントできます。例: <code>$cdata += 5</code>
7263
</simpara>
7364
</listitem>
7465
<listitem>
7566
<simpara>
76-
!!!
77-
C pointers can be subtracted from another using regular <code>-</code> operations.
67+
C のポインタは通常の <code>-</code> 演算子を使って他のポインタと引き算できます。
7868
</simpara>
7969
</listitem>
8070
<listitem>
8171
<simpara>
82-
!!!
83-
C pointers to functions can be called as a regular PHP closure, e.g. <code>$cdata()</code>
72+
C の関数ポインタは通常の PHP のクロージャのように呼び出せます。例: <code>$cdata()</code>
8473
</simpara>
8574
</listitem>
8675
<listitem>
@@ -98,8 +87,7 @@
9887
</listitem>
9988
<listitem>
10089
<simpara>
101-
!!!
102-
<classname>FFI\CData</classname> can now be assigned to structs and fields as of PHP 8.3.0.
90+
PHP 8.3.0 以降、<classname>FFI\CData</classname> は構造体やフィールドに代入できるようになりました。
10391
</simpara>
10492
</listitem>
10593
</itemizedlist>

reference/ffi/ffi.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
<reference xml:id="class.ffi" role="class" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
66

7-
!!!
8-
<title>Main interface to C code and data</title>
7+
<title>C のコードやデータへの主要インターフェース</title>
98
<titleabbrev>FFI</titleabbrev>
109

1110
<partintro>

0 commit comments

Comments
 (0)