Skip to content

Commit 9505983

Browse files
committed
ffi: fix XML to get remove of useless wrapping para tags
1 parent be7b118 commit 9505983

File tree

7 files changed

+160
-191
lines changed

7 files changed

+160
-191
lines changed

reference/ffi/examples.xml

Lines changed: 49 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 8859c8b96cd9e80652813f7bcf561432a5e9f934 Maintainer: nsfisis Status: ready -->
4-
5-
<chapter xml:id="ffi.examples" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
3+
<!-- EN-Revision: 9626d496d692241a3530eac1efe2ac4fe8bdce1a Maintainer: nsfisis Status: ready -->
4+
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="ffi.examples">
65
&reftitle.examples;
76
<section xml:id="ffi.examples-basic">
87
<title>FFI の基本的な使い方</title>
@@ -16,10 +15,9 @@
1615
それらは、このライブラリが利用できないシステムでは動きません。
1716
</para>
1817
</note>
19-
<para>
20-
<example xml:id="ffi.examples.function">
21-
<title>共有ライブラリの関数を呼ぶ</title>
22-
<programlisting role="php">
18+
<example xml:id="ffi.examples.function">
19+
<title>共有ライブラリの関数を呼ぶ</title>
20+
<programlisting role="php">
2321
<![CDATA[
2422
<?php
2523
// FFI オブジェクトを作成し、libc を読み込んで printf() 関数をエクスポートする
@@ -30,43 +28,41 @@ $ffi = FFI::cdef(
3028
$ffi->printf("Hello %s!\n", "world");
3129
?>
3230
]]>
33-
</programlisting>
34-
&example.outputs;
35-
<screen>
31+
</programlisting>
32+
&example.outputs;
33+
<screen>
3634
<![CDATA[
3735
Hello world!
3836
]]>
39-
</screen>
40-
</example>
41-
</para>
37+
</screen>
38+
</example>
4239
<note>
4340
<para>
4441
C の関数のうちのいくつかは、特定の呼び出し規約 (例: <literal>__fastcall</literal>、
4542
<literal>__stdcall</literal>、<literal>,__vectorcall</literal> など) を必要とすることに注意してください。
4643
</para>
4744
</note>
48-
<para>
49-
<example xml:id="ffi.examples.structure">
50-
<title>関数を呼び出し、構造体を引数経由で返す</title>
51-
<programlisting role="php">
45+
<example xml:id="ffi.examples.structure">
46+
<title>関数を呼び出し、構造体を引数経由で返す</title>
47+
<programlisting role="php">
5248
<![CDATA[
5349
<?php
5450
// gettimeofday() のバインディングを作成する
5551
$ffi = FFI::cdef("
5652
typedef unsigned int time_t;
5753
typedef unsigned int suseconds_t;
58-
54+
5955
struct timeval {
6056
time_t tv_sec;
6157
suseconds_t tv_usec;
6258
};
63-
59+
6460
struct timezone {
6561
int tz_minuteswest;
6662
int tz_dsttime;
6763
};
68-
69-
int gettimeofday(struct timeval *tv, struct timezone *tz);
64+
65+
int gettimeofday(struct timeval *tv, struct timezone *tz);
7066
", "libc.so.6");
7167
// C のデータ構造を作成する
7268
$tv = $ffi->new("struct timeval");
@@ -79,9 +75,9 @@ var_dump($tv->tv_sec);
7975
var_dump($tz);
8076
?>
8177
]]>
82-
</programlisting>
83-
&example.outputs.similar;
84-
<screen>
78+
</programlisting>
79+
&example.outputs.similar;
80+
<screen>
8581
<![CDATA[
8682
int(0)
8783
int(1555946835)
@@ -92,13 +88,11 @@ object(FFI\CData:struct timezone)#3 (2) {
9288
int(0)
9389
}
9490
]]>
95-
</screen>
96-
</example>
97-
</para>
98-
<para>
99-
<example xml:id="ffi.examples.variable-existing">
100-
<title>既存の C の変数にアクセスする</title>
101-
<programlisting role="php">
91+
</screen>
92+
</example>
93+
<example xml:id="ffi.examples.variable-existing">
94+
<title>既存の C の変数にアクセスする</title>
95+
<programlisting role="php">
10296
<![CDATA[
10397
<?php
10498
// FFI オブジェクトを作成し、libc を読み込んで errno 変数をエクスポートする
@@ -109,19 +103,17 @@ $ffi = FFI::cdef(
109103
var_dump($ffi->errno);
110104
?>
111105
]]>
112-
</programlisting>
113-
&example.outputs;
114-
<screen>
106+
</programlisting>
107+
&example.outputs;
108+
<screen>
115109
<![CDATA[
116110
int(0)
117111
]]>
118-
</screen>
119-
</example>
120-
</para>
121-
<para>
122-
<example xml:id="ffi.examples.variable-creating">
123-
<title>C の変数を作成して書き換える</title>
124-
<programlisting role="php">
112+
</screen>
113+
</example>
114+
<example xml:id="ffi.examples.variable-creating">
115+
<title>C の変数を作成して書き換える</title>
116+
<programlisting role="php">
125117
<![CDATA[
126118
<?php
127119
// 新しい C の int 変数を作成する
@@ -137,17 +129,16 @@ $x->cdata += 2;
137129
var_dump($x->cdata);
138130
?>
139131
]]>
140-
</programlisting>
141-
&example.outputs;
142-
<screen>
132+
</programlisting>
133+
&example.outputs;
134+
<screen>
143135
<![CDATA[
144136
int(0)
145137
int(5)
146138
int(7)
147139
]]>
148-
</screen>
149-
</example>
150-
</para>
140+
</screen>
141+
</example>
151142
<para>
152143
<example xml:id="ffi.examples.array">
153144
<title>C の配列を扱う</title>
@@ -182,10 +173,9 @@ int(8192)
182173
</screen>
183174
</example>
184175
</para>
185-
<para>
186-
<example xml:id="ffi.examples.enum">
187-
<title>C の enum を扱う</title>
188-
<programlisting role="php">
176+
<example xml:id="ffi.examples.enum">
177+
<title>C の enum を扱う</title>
178+
<programlisting role="php">
189179
<![CDATA[
190180
<?php
191181
$a = FFI::cdef('typedef enum _zend_ffi_symbol_kind {
@@ -200,17 +190,16 @@ var_dump($a->ZEND_FFI_SYM_CONST);
200190
var_dump($a->ZEND_FFI_SYM_VAR);
201191
?>
202192
]]>
203-
</programlisting>
204-
&example.outputs;
205-
<screen>
193+
</programlisting>
194+
&example.outputs;
195+
<screen>
206196
<![CDATA[
207197
int(0)
208198
int(2)
209199
int(3)
210200
]]>
211-
</screen>
212-
</example>
213-
</para>
201+
</screen>
202+
</example>
214203
</section>
215204
<section xml:id="ffi.examples-callback">
216205
<title>PHP のコールバック</title>
@@ -226,9 +215,9 @@ $zend = FFI::cdef("
226215
typedef int (*zend_write_func_t)(const char *str, size_t str_length);
227216
extern zend_write_func_t zend_write;
228217
");
229-
218+
230219
echo "Hello World 1!\n";
231-
220+
232221
$orig_zend_write = clone $zend->zend_write;
233222
$zend->zend_write = function($str, $len) {
234223
global $orig_zend_write;
@@ -288,7 +277,7 @@ opcache_compile_file(__DIR__ . "/dummy.php");
288277
<![CDATA[
289278
#define FFI_SCOPE "DUMMY"
290279
#define FFI_LIB "libc.so.6"
291-
280+
292281
int printf(const char *format, ...);
293282
]]>
294283
</programlisting>
@@ -322,7 +311,6 @@ $d->printf("Hello %s!\n", "world");
322311
</informalexample>
323312
</section>
324313
</chapter>
325-
326314
<!-- Keep this comment at the end of the file
327315
Local variables:
328316
mode: sgml

reference/ffi/ffi/cast.xml

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 10beb4156579b621246bca461be7a0017bc280ad Maintainer: nsfisis Status: ready -->
4-
5-
<refentry xml:id="ffi.cast" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
3+
<!-- EN-Revision: 9626d496d692241a3530eac1efe2ac4fe8bdce1a Maintainer: nsfisis Status: ready -->
4+
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="ffi.cast">
65
<refnamediv>
76
<refname>FFI::cast</refname>
87
<refpurpose>C の型キャストを実行する</refpurpose>
@@ -57,26 +56,24 @@
5756

5857
<refsect1 role="changelog">
5958
&reftitle.changelog;
60-
<para>
61-
<informaltable>
62-
<tgroup cols="2">
63-
<thead>
64-
<row>
65-
<entry>&Version;</entry>
66-
<entry>&Description;</entry>
67-
</row>
68-
</thead>
69-
<tbody>
70-
<row>
71-
<entry>8.3.0</entry>
72-
<entry>
73-
<methodname>FFI::cast</methodname> を static メソッドとして呼び出すのは非推奨となりました。
74-
</entry>
75-
</row>
76-
</tbody>
77-
</tgroup>
78-
</informaltable>
79-
</para>
59+
<informaltable>
60+
<tgroup cols="2">
61+
<thead>
62+
<row>
63+
<entry>&Version;</entry>
64+
<entry>&Description;</entry>
65+
</row>
66+
</thead>
67+
<tbody>
68+
<row>
69+
<entry>8.3.0</entry>
70+
<entry>
71+
<methodname>FFI::cast</methodname> を static メソッドとして呼び出すのは非推奨となりました。
72+
</entry>
73+
</row>
74+
</tbody>
75+
</tgroup>
76+
</informaltable>
8077
</refsect1>
8178

8279
</refentry>

reference/ffi/ffi/load.xml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 965e20aa04e351a46200f1df658e717eb654efd4 Maintainer: nsfisis Status: ready -->
4-
5-
<refentry xml:id="ffi.load" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
3+
<!-- EN-Revision: 9626d496d692241a3530eac1efe2ac4fe8bdce1a Maintainer: nsfisis Status: ready -->
4+
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="ffi.load">
65
<refnamediv>
76
<refname>FFI::load</refname>
87
<refpurpose>C のヘッダーファイルから C の宣言を読み込む</refpurpose>
@@ -88,11 +87,9 @@
8887

8988
<refsect1 role="seealso">
9089
&reftitle.seealso;
91-
<para>
92-
<simplelist>
93-
<member><methodname>FFI::scope</methodname></member>
94-
</simplelist>
95-
</para>
90+
<simplelist>
91+
<member><methodname>FFI::scope</methodname></member>
92+
</simplelist>
9693
</refsect1>
9794

9895
</refentry>

reference/ffi/ffi/new.xml

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 10beb4156579b621246bca461be7a0017bc280ad Maintainer: nsfisis Status: ready -->
4-
5-
<refentry xml:id="ffi.new" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
3+
<!-- EN-Revision: 9626d496d692241a3530eac1efe2ac4fe8bdce1a Maintainer: nsfisis Status: ready -->
4+
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="ffi.new">
65
<refnamediv>
76
<refname>FFI::new</refname>
87
<refpurpose>C のデータ構造を作成する</refpurpose>
@@ -67,26 +66,24 @@
6766

6867
<refsect1 role="changelog">
6968
&reftitle.changelog;
70-
<para>
71-
<informaltable>
72-
<tgroup cols="2">
73-
<thead>
74-
<row>
75-
<entry>&Version;</entry>
76-
<entry>&Description;</entry>
77-
</row>
78-
</thead>
79-
<tbody>
80-
<row>
81-
<entry>8.3.0</entry>
82-
<entry>
83-
<methodname>FFI::new</methodname> を static メソッドとして呼び出すのは非推奨となりました。
84-
</entry>
85-
</row>
86-
</tbody>
87-
</tgroup>
88-
</informaltable>
89-
</para>
69+
<informaltable>
70+
<tgroup cols="2">
71+
<thead>
72+
<row>
73+
<entry>&Version;</entry>
74+
<entry>&Description;</entry>
75+
</row>
76+
</thead>
77+
<tbody>
78+
<row>
79+
<entry>8.3.0</entry>
80+
<entry>
81+
<methodname>FFI::new</methodname> を static メソッドとして呼び出すのは非推奨となりました。
82+
</entry>
83+
</row>
84+
</tbody>
85+
</tgroup>
86+
</informaltable>
9087
</refsect1>
9188

9289
</refentry>

reference/ffi/ffi/scope.xml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 9e0804888ae46a50f28d98514a8d5e70a34e069c Maintainer: nsfisis Status: ready -->
4-
5-
<refentry xml:id="ffi.scope" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
3+
<!-- EN-Revision: 9626d496d692241a3530eac1efe2ac4fe8bdce1a Maintainer: nsfisis Status: ready -->
4+
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="ffi.scope">
65
<refnamediv>
76
<refname>FFI::scope</refname>
87
<refpurpose>事前ロード中にパースされた C の宣言を使って FFI オブジェクトをインスタンス化する</refpurpose>
@@ -46,11 +45,9 @@
4645

4746
<refsect1 role="seealso">
4847
&reftitle.seealso;
49-
<para>
50-
<simplelist>
51-
<member><methodname>FFI::load</methodname></member>
52-
</simplelist>
53-
</para>
48+
<simplelist>
49+
<member><methodname>FFI::load</methodname></member>
50+
</simplelist>
5451
</refsect1>
5552

5653
</refentry>

0 commit comments

Comments
 (0)