autodoc.git/
traditional_manual/
chapter_9.html
Branch:
Tag:
Non-build tags
All tags
No tags
2003-07-22
2003-07-22 16:57:10 by Henrik Grubbström (Grubba) <grubba@grubba.org>
0f4adfbcad44eeebb47ff8ba10b38954a3391158 (
120
lines) (+
85
/-
35
)
[
Show
|
Annotate
]
Branch:
8.0
AutoDoc updates.
Rev: lib/modules/Stdio.pmod/module.pmod:1.178
81:
<dd class='body--doc'><p>The socket may be opened with <code>open_socket()</code> ahead of the call to this function, but it is not required.</p> <p> For <code>callback</code> to be called, the backend must be active (ie
-
<code>main()</code> must have returned <code class='expr'>-1</code>).</p>
+
<code>main()</code> must have returned <code class='expr'>-1</code>
, or <code>Pike.DefaultBackend</code>
+
get called in some other way
).</p>
<p> The socket will be in non-blocking state if <code class='expr'>1</code> has been
-
returned, and any callbacks will be cleared.</p>
+
returned, and any
non-blocking
callbacks will be cleared.</p>
</dd> <dt class='head--doc'>See also</dt> <dd class='body--doc'><p><code>connect()</code>, <code>open_socket()</code>, <code>set_nonblocking()</code></p>
383:
<dt class='head--doc'>Description</dt> <dd class='body--doc'><p>Returns an iterator that will loop over the lines in this file.
-
If trim is true, all '\r' characters will be removed from the
-
input.</p>
+
If trim is true, all
<tt>
'\r'
</tt>
characters will be removed from
+
the input.</p>
</dd></dl>
808:
<dt class='head--doc'>Description</dt> <dd class='body--doc'><p>Returns a function that when called will call <code>read</code> with nbytes as argument. Can be used to get various callback
-
functions,
as
an
example
the fourth argument to
-
String.SplitIterator.</p>
+
functions,
eg
for
the fourth argument to
+
<code>
String.SplitIterator
</code>
.</p>
</dd></dl>
883:
<dd class='body--doc'><p>This function sets a stream to blocking mode. i.e. all reads and writes will wait until data has been transferred before returning.</p> </dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>Calling this function will also clear all non-blocking callbacks.</p>
+
</dd>
<dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>set_nonblocking()</code></p>
+
<dd class='body--doc'><p><code>set_nonblocking()</code>
,
<
code>set_nonblocking_keep_callbacks()<
/
code>,
+
<code>set_blocking_keep_callbacks()</code></
p>
</dd></dl>
915:
<code><code class='datatype'>void</code> <b><span class='method'>set_blocking_keep_callbacks</span>(</b><b>)</b></code></p></dd> <dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
toggle
between blocking and nonblocking,
-
without changing the callbacks</p>
+
<dd class='body--doc'><p>
Toggle
between blocking and nonblocking,
+
without changing the callbacks
.
</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>set_nonblocking()</code>, <code>set_blocking()</code></p>
</dd></dl>
959:
<dt class='head--doc'>Note</dt> <dd class='body--doc'><p>This function does not set the file nonblocking.</p> </dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>The <tt>close_callback</tt> can also be set by calling
+
<code>set_nonblocking()</code>.</p>
+
</dd>
<dt class='head--doc'>See also</dt> <dd class='body--doc'><p><code>set_nonblocking()</code>, <code>close</code> <code>query_close_callback()</code>, <code>set_read_callback()</code>,
1048:
be called with some or all of this data. When the stream allows out-of-band data to be sent, <code>write_oob_callback</code> will be called so that you can write out-of-band data to it.</p>
-
<p> All callbacks will have the <tt>id</tt> of file as first argument when called
-
(see <code>set_id()</code>).</p>
-
<p> If no arguments are given, the callbacks will not be changed. The
-
stream will just be set to nonblocking mode.</p>
+
<p> All callbacks will have the <tt>id</tt> of
the
file as first argument
+
when called (see <code>set_id()</code>).</p>
</dd> <dt class='head--doc'>Note</dt>
-
<dd class='body--doc'><p>Out-of-band data will
note
be supported if Pike was compiled with the
+
<dd class='body--doc'><p>
If no arguments are given, the callbacks will be cleared.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>
Out-of-band data will
not
be supported if Pike was compiled with the
option <tt>'--without-oob'</tt>.</p> </dd> <dt class='head--doc'>See also</dt> <dd class='body--doc'><p><code>set_blocking()</code>, <code>set_id()</code>, <code>set_read_callback()</code>,
-
<code>set_write_callback()</code>, <code>set_close_callback()</code></p>
+
<code>set_write_callback()</code>, <code>set_close_callback()</code>
+
<
code>set_nonblocking_keep_callbacks()<
/
code>, <code>set_blocking_keep_callbacks()</code></
p>
</dd></dl>
1068:
<dt class='head--type'><span class='homogen--type'>Method</span> <span class='homogen--name'><b>set_read_callback</b></span> </dt>
-
<dd><p><code><code class='datatype'>void</code> <b><span class='method'>set_read_callback</span>(</b><code class='datatype'>function</code>(<code class='datatype'>mixed</code>, <code class='datatype'>string</code>:<code class='datatype'>void</code>) <code class='argument'>read_
cb
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>void</code> <b><span class='method'>set_read_callback</span>(</b><code class='datatype'>function</code>(<code class='datatype'>mixed</code>, <code class='datatype'>string</code>:<code class='datatype'>void</code>) <code class='argument'>read_
callback
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt> <dd class='body--doc'><p>This function sets the <tt>read_callback</tt> for the file. The <tt>read_callback</tt> is called whenever there is data to read from the file.</p>
-
<p> The callback is called with the <tt>id</tt> of the file as first argument and
-
some or all of its data as second.</p>
+
<p> The callback is called with the <tt>id</tt> of the file as
+
first argument and some or all of its data as second.</p>
</dd> <dt class='head--doc'>Note</dt> <dd class='body--doc'><p>This function does not set the file nonblocking.</p> </dd>
-
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>The <tt>read_callback</tt> can also be set by calling
+
<code>set_nonblocking()</code>.</p>
+
</dd>
<dt class='head--doc'>See also</dt> <dd class='body--doc'><p><code>set_nonblocking()</code>, <code>read()</code>, <code>query_read_callback()</code>, <code>set_write_callback()</code>,
1115:
<dt class='head--doc'>Note</dt> <dd class='body--doc'><p>This function does not set the file nonblocking.</p> </dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>The <tt>write_callback</tt> can also be set by calling
+
<code>set_nonblocking()</code>.</p>
+
</dd>
<dt class='head--doc'>See also</dt> <dd class='body--doc'><p><code>set_nonblocking()</code>, <code>write()</code>, <code>query_write_callback()</code>, <code>set_read_callback()</code>,
1353:
</dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>Stdio.FILE</b></h2> </dt><dd><dl class='group--doc'> <dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Stdio.FILE is a buffered version of Stdio.File, it inherits Stdio.File and
-
has most of the functionality of Stdio.File. However, it has an input buffer
-
that allows line-by-line input.
Note
that
the
output part of Stdio.FILE is
-
not buffered
at this moment
.</p>
+
<dd class='body--doc'><p>
<code>
Stdio.FILE
</code>
is a buffered version of
<code>
Stdio.File
</code>
, it inherits
+
<code>
Stdio.File
</code>
and has most of the functionality of
<code>
Stdio.File
</code>
.
+
However, it has an input buffer that allows line-by-line input.
</p>
+
<p>
It
also
has
support for automatic charset conversion for both input
+
and
output
(see <code>Stdio.FILE()->set_charset()</code>).</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>The output
part of
<code>
Stdio.FILE
</code>
is
currently
not buffered.</p>
</dd></dl> <hr />
1386:
<dd class='body--doc'><p>This function returns one character from the input stream.</p> </dd> <dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>Returns the
ASCII
value of the character.</p>
+
<dd class='body--doc'><p>Returns the
ISO-10646
(Unicode)
value of the character.</p>
</dd> <dt class='head--doc'>Note</dt> <dd class='body--doc'><p>Returns an <code class='expr'>int</code> and not a <code class='expr'>string</code> of length 1.</p>
1430:
<dt class='head--doc'>Description</dt> <dd class='body--doc'><p>Returns an iterator that will loop over the lines in this file.
-
If trim is true, all '\r' characters will be removed from the
-
input.</p>
+
If
<code>
trim
</code>
is true, all
<tt>
'\r'
</tt>
characters will be removed
+
from the input.</p>
</dd> <dt class='head--doc'>See also</dt> <dd class='body--doc'><p><code>_get_iterator()</code></p>
1456:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>pipe</b></span>
+
</dt>
+
<dd><p><code><code class='object unresolved'>File</code> <b><span class='method'>pipe</span>(</b><code class='datatype'>void</code>|<code class='datatype'>int</code> <code class='argument'>flags</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Same as <code>Stdio.File()->pipe()</code>.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>Returns an <code>Stdio.File</code> object, NOT a <code>Stdio.FILE</code> object.</p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
<span class='homogen--name'><b>printf</b></span> </dt> <dd><p><code><code class='datatype'>int</code> <b><span class='method'>printf</span>(</b><code class='datatype'>string</code> <code class='argument'>format</code>, <code class='datatype'>mixed</code> ... <code class='argument'>data</code><b>)</b></code></p></dd>
1477:
<dd><p><code><code class='datatype'>string</code> <b><span class='method'>read</span>(</b><code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>bytes</code>, <code class='datatype'>void</code>|<code class='datatype'>bool</code> <code class='argument'>now</code><b>)</b></code></p></dd> <dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Read <code>bytes</code> with buffering and support for input conversion.</p>
+
<dd class='body--doc'><p>Read <code>bytes</code>
(wide-) characters
with buffering and support for
+
input conversion.</p>
</dd> <dt class='head--doc'>See also</dt> <dd class='body--doc'><p><code>Stdio.File()->read()</code>, <code>set_charset()</code></p>
1493:
<dt class='head--doc'>Description</dt> <dd class='body--doc'><p>Sets the input and output charset of this file to the specified
-
charset.</p>
+
<code>
charset
</code>
.</p>
+
<p> The default charset is <tt>"ISO-8859-1"</tt>.</p>
</dd></dl>
1547:
<dt class='head--doc'>Description</dt> <dd class='body--doc'><p>This function completes a connection made from a remote machine to this port. It returns a two-way stream in the form of a clone of
-
Stdio.File. The new file is by
default
set to blocking mode.</p>
+
<code>
Stdio.File
</code>
. The new file is by
initially
set to blocking mode.</p>
</dd> <dt class='head--doc'>See also</dt> <dd class='body--doc'><p><code>Stdio.File</code></p>
1592:
be passed to <code>bind()</code>.</p> <p> When create is called with <code class='expr'>"stdin"</code> as the first argument, a socket is created out of the file descriptor <code class='expr'>0</code>. This is only
-
useful if
that
actually is a socket to begin with.</p>
+
useful if
it
actually is a socket to begin with.</p>
</dd> <dt class='head--doc'>See also</dt> <dd class='body--doc'><p><code>bind</code></p>
3861:
<dd><p><code><code class='object unresolved'>File</code> Stdio.<b><span class='variable'>stderr</span></b></code></p></dd> <dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>An instance of FILE("stderr"), the standard error stream. Use this
+
<dd class='body--doc'><p>An instance of
<tt>
FILE("stderr")
</tt>
, the standard error stream. Use this
when you want to output error messages.</p>
-
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>predef::werror()</code></p>
</dd></dl>
3874:
<dd><p><code><code class='object unresolved'>FILE</code> Stdio.<b><span class='variable'>stdin</span></b></code></p></dd> <dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>An instance of FILE("stdin"), the standard input stream. Use this
+
<dd class='body--doc'><p>An instance of
<tt>
FILE("stdin")
</tt>
, the standard input stream. Use this
when you want to read anything from the standard input. This example will read lines from standard input for as long as there are more lines to read. Each line will then be written to stdout together
-
with the line number. We could use <code>Stdio.stdout.write</code> instead
-
of just <code>write</code>, since they are the same function.</p>
+
with the line number. We could use <code>Stdio.stdout.write
()
</code> instead
+
of just <code>write
()
</code>, since they are the same function.</p>
</dd> <dt class='head--doc'>Example</dt> <dd class='example'><pre><p>int main()
3899:
<dd><p><code><code class='object unresolved'>File</code> Stdio.<b><span class='variable'>stdout</span></b></code></p></dd> <dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>An instance of FILE("stdout"), the standatd output stream. Use this
+
<dd class='body--doc'><p>An instance of
<tt>
FILE("stdout")
</tt>
, the standatd output stream. Use this
when you want to write anything to the standard output.</p>
-
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>predef::write()</code></p>
</dd></dl>