reference/filesystem/functions/fscanf.xml
4225e50bc391ddba99e367c231463da0dc04357d
...
...
@@ -1,6 +1,6 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.fscanf">
3
+
<refentry xml:id="function.fscanf" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>fscanf</refname>
6
6
<refpurpose>Parses input from a file according to a format</refpurpose>
...
...
@@ -9,21 +9,20 @@
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>mixed</type><methodname>fscanf</methodname>
13
-
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
12
+
<type class="union"><type>array</type><type>int</type><type>false</type><type>null</type></type><methodname>fscanf</methodname>
13
+
<methodparam><type>resource</type><parameter>stream</parameter></methodparam>
14
14
<methodparam><type>string</type><parameter>format</parameter></methodparam>
15
-
<methodparam choice="opt"><type>mixed</type><parameter role="reference">...</parameter></methodparam>
15
+
<methodparam rep="repeat"><type>mixed</type><parameter role="reference">vars</parameter></methodparam>
16
16
</methodsynopsis>
17
17
<para>
18
18
The function <function>fscanf</function> is similar to
19
19
<function>sscanf</function>, but it takes its input from a file
20
-
associated with <parameter>handle</parameter> and interprets the
21
-
input according to the specified <parameter>format</parameter>, which is
22
-
described in the documentation for <function>sprintf</function>.
20
+
associated with <parameter>stream</parameter> and interprets the
21
+
input according to the specified <parameter>format</parameter>.
23
22
</para>
24
23
<para>
25
24
Any whitespace in the format string matches any whitespace in the input
26
-
stream. This means that even a tab <literal>\t</literal> in the format
25
+
stream. This means that even a tab (<literal>\t</literal>) in the format
27
26
string can match a single space character in the input stream.
28
27
</para>
29
28
<para>
...
...
@@ -36,22 +35,14 @@
36
35
<para>
37
36
<variablelist>
38
37
<varlistentry>
39
-
<term><parameter>handle</parameter></term>
38
+
<term><parameter>stream</parameter></term>
40
39
<listitem>
41
40
&fs.file.pointer;
42
41
</listitem>
43
42
</varlistentry>
43
+
&strings.scanf.parameter.format;
44
44
<varlistentry>
45
-
<term><parameter>format</parameter></term>
46
-
<listitem>
47
-
<para>
48
-
The specified format as described in the
49
-
<function>sprintf</function> documentation.
50
-
</para>
51
-
</listitem>
52
-
</varlistentry>
53
-
<varlistentry>
54
-
<term><parameter>...</parameter></term>
45
+
<term><parameter>vars</parameter></term>
55
46
<listitem>
56
47
<para>
57
48
The optional assigned values.
...
...
@@ -70,31 +61,10 @@
70
61
function will return the number of assigned values. The optional
71
62
parameters must be passed by reference.
72
63
</para>
73
-
</refsect1>
74
-
75
-
<refsect1 role="changelog">
76
-
&reftitle.changelog;
77
64
<para>
78
-
<informaltable>
79
-
<tgroup cols="2">
80
-
<thead>
81
-
<row>
82
-
<entry>&Version;</entry>
83
-
<entry>&Description;</entry>
84
-
</row>
85
-
</thead>
86
-
<tbody>
87
-
<row>
88
-
<entry>4.3.0</entry>
89
-
<entry>
90
-
Before this time, the maximum number of characters read from
91
-
the file was 512 (or up to the first \n, whichever came first).
92
-
But now, arbitrarily long lines will be read and scanned.
93
-
</entry>
94
-
</row>
95
-
</tbody>
96
-
</tgroup>
97
-
</informaltable>
65
+
If there are more substrings expected in the <parameter>format</parameter>
66
+
than there are available within <parameter>string</parameter>,
67
+
&null; will be returned. On other errors, &false; will be returned.
98
68
</para>
99
69
</refsect1>
100
70

...
...
@@ -147,7 +117,6 @@ luigi florist it
147
117
</refsect1>
148
118

149
119
</refentry>
150
-

151
120
<!-- Keep this comment at the end of the file
152
121
Local variables:
153
122
mode: sgml
154
123