autodoc.git/
traditional_manual/
chapter_9.html
Branch:
Tag:
Non-build tags
All tags
No tags
2017-07-21
2017-07-21 11:36:32 by Pontus Östlund <ponost@roxen.com>
ed0ac87e886843632bb72a561ff258015501d656 (
10098
lines) (+
4586
/-
5512
)
[
Show
|
Annotate
]
Branch:
master
There was an XML syntax error in this file.
1:
<!doctype html><html><head><title>Pike Reference Manual</title> <meta charset='utf-8'></head>
-
<body><dl><dt><h1 class='header'>9.
Specific Datatype Modules
</h1></dt><dd><dl><dt><h2 class='header'>
Module
<b class='ms datatype'>
String
</b></h2>
-
</dt><dd>
-
-
<
hr />
-
<
dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Constant</span>
-
<span class='homogen--name'><b>__HAVE_SPRINTF_NEGATIVE_F__</b></span>
-
</dt>
-
<dd><p><code><code class='datatype'>constant</code> <code class='datatype'>int</code> String.<code class='constant'>__HAVE_SPRINTF_NEGATIVE_F__</code></code></p></dd>
-
+
<body><dl><dt><h1 class='header'>9.
I/O
</h1></dt><dd><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>
Presence
of
this
symbol
indicates
that
<code>sprintf()</code>
supports
-
little
endian
output
for
the
<
tt
>
'F'
</
tt
>
-format
specifier
.</p>
+
<dd class='body--doc'><p>
This
is
the
basic
I/O
object,
it
provides socket and pipe
+
communication
as
well
as
file
access.
It
does not buffer reads and
+
writes by default, and provides no line-by-line reading, that is done
+
with
<
code
>
Stdio.FILE
</
code
>
object
.</p>
</dd>
-
<dt class='head--doc'>
See also
</dt>
-
<dd class='body--doc'><p>
<code>sprintf()</code>,
<code>lfun::_sprintf()</code></p>
-
</dd></dl>
-
-
-
<hr
/>
-
<dl
class='group--doc'>
-
<dt
class='head--type'><span
class='homogen--type'>Constant</span>
-
<span
class='homogen--name'><b>__HAVE_SPRINTF_STAR_MAPPING__</b></span>
-
</dt>
-
<dd><p><code><code
class='datatype'>constant</code>
<code
class='datatype'
>
int
</code>
String.<code
class='constant'>__HAVE_SPRINTF_STAR_MAPPING__
<
/
code></code>
</p></dd>
-
-
<dt
class='head--doc'>Description</dt>
-
<dd
class='body--doc'><p>Presence
of
this
symbol
indicates
that
<code>sprintf()</code>
supports
-
mappings
for
the
<tt>'*'</tt>-modifier
syntax
.</p>
+
<dt class='head--doc'>
Note
</dt>
+
<dd class='body--doc'><p>
The
file
or
stream
will
normally be closed when this object is
+
destructed (unless there are more objects that refer to the same
+
file
through use of
<code>
assign
</code>
or
<code>
dup
</code>
).
Objects do not contain
+
cyclic
references
in
themselves,
so
they
will
be destructed timely
+
when
they
run
out
of
references
.</p>
</dd> <dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>
sprintf()
</code>
,
<
code>lfun::_sprintf()<
/
code></
p>
+
<dd class='body--doc'><p><code>
Stdio.FILE
</code></p>
</dd></dl>
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
capitalize
</b></span>
+
<span class='homogen--name'><b>
assign
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
string
</code> <b><span class='method'>
capitalize
</span>(</b><code class='
datatype
'>
string
</code> <code class='argument'>
str
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
int
</code> <b><span class='method'>
assign
</span>(</b><code class='
object unresolved
'>
File
</code>
|<code
class='object unresolved'>Fd
<
/
code
>
<code
class='argument'>
o
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Convert
the
first
character
in
<code>
str
</code> to
upper
case,
and return the
-
new string
.</p>
+
<dd class='body--doc'><p>
This
function
takes
a
clone
of Stdio.File and assigns all
+
variables of this file from it. It can be used together with
<code>
dup()
</code>
+
to
move
files
around
.</p>
</dd> <dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>
lower_case
()</code>
,
<
code>upper_case()<
/
code></
p>
+
<dd class='body--doc'><p><code>
dup
()</code></p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
common
_
prefix
</b></span>
+
<span class='homogen--name'><b>
async
_
connect
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
string
</code> <b><span class='method'>
common
_
prefix
</span>(</b><code class='datatype'>
array
</code>
(
<code class='datatype'>string</code>) <code class='argument'>
strs
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
int
</code> <b><span class='method'>
async
_
connect
</span>(</b><code class='datatype'>
string
</code>
<code class='
argument'>host</code>, <code class='
datatype'>
int</code>|<code class='datatype'>
string</code>
<code class='argument'>port</code>, <code class='datatype'>function</code>(<code class='datatype'>int</code>, <code class='datatype'>mixed</code> ... :<code class='datatype'>void</code>
) <code class='argument'>
callback
</code>
,
<
code class='datatype'>mixed</code> ... <code class='argument'>args</code><
b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Find
the
longest
common
prefix from an array of strings
.</p>
-
<
/dd></dl>
-
-
-
<hr />
-
<dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>count</b></span>
-
</dt>
-
<dd><
p>
<code><code
class='datatype'>int</code>
<b><span
class='method'>count</span>(</b><code
class='datatype'>string</code>
<code
class='argument'>haystack
<
/
code>
, <code class='datatype'>string</code> <code class='argument'>needle</code><b>
)</
b></
code>
</p></dd>
-
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Count the number of non-overlapping times the string <code>needle</code>
-
occurs in the string <code>haystack</code>. The special cases for the needle
-
<code class='expr'>""</code> is that it occurs one time in the empty string
,
zero
-
times
in a one character string and between every character
-
(length-1) in any other string
.</p>
+
<dd class='body--doc'><p>
Open
a
TCP/IP
connection
asynchronously
.</p>
+
<
p
>
This
function
is
similar
to
<code>
connect
()</code>,
but
works
asynchronously
.</p>
</dd>
-
<dt class='head--doc'>
See also
<
/dt>
-
<dd
class
='
body--doc'><
p
><code>search()</code>, <code>`/()</code></p>
-
</dd></dl>
-
-
-
<hr />
-
<dl class='group
-
-doc
'>
-
<
dt class='head--type'><span class='homogen--type'>Method<
/span>
-
<span
class='homogen--name'>
<
b>expand_tabs</b></span>
-
</dt>
-
<dd><p><
code
><code
class='
datatype
'>
string
</code>
<
b><span class='method'>expand_tabs<
/
span>(</b><code class='datatype'>string</code> <code class='argument'>s</code>, <code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>tab_width</code>, <code class='datatype'>string</code>|<code class='datatype'>void</code> <code class='argument'>substitute_tab</code>, <code class='datatype'>string</code>|<code class='datatype'>void</code> <code class='argument'>substitute_space</code>, <code class='datatype'>string</code>|<code class='datatype'>void</code> <code class='argument'>substitute_newline</code><b>)</b></code></p></dd>
-
-
<
dt
class='head--doc'
>
Description</dt>
-
<dd
class='body--doc'
><
p>Expands tabs in a string to ordinary spaces, according to common
-
tabulation rules.<
/
p>
-
</
dd><
/dl>
-
-
-
<hr />
-
<dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>fuzzymatch</b></span>
-
</dt>
-
<
dd
><p><code><code
class='
datatype'>int(0..100)</code> <b><span class='method'>fuzzymatch</span>(</b><code class='datatype'>string</code> <code class='argument'>a</code>, <code class='datatype'>string</code> <code class='argument'>b</code><b>)</b></code></p></dd>
-
-
<dt class='head--doc'>Description</dt>
-
<dd class='
body--doc'><p>
This
function
compares
two
strings
using a fuzzy matching
-
routine
.
The higher the resulting value, the better the strings match.
</p>
+
<dt class='head--doc'><
span
id
='p-
host
'></span>
Parameter
<code class='
parameter
'>
host
</code></dt>
+
<dd></dd><dd class='body--doc'><p>
Hostname
or
IP
to
connect
to
.</p>
</dd>
-
+
<dt class='head--doc'><span id='p-port'></span>Parameter <code class='parameter'>port</code></dt>
+
<dd></dd><dd class='body--doc'><p>Port number or service name to connect to.</p>
+
</dd>
+
<dt class='head--doc'><span id='p-callback'></span>Parameter <code class='parameter'>callback</code></dt>
+
<dd></dd><dd class='body--doc'><p>Function to be called on completion.
+
The first argument will be <code class='expr'>1</code> if a connection was
+
successfully established, and <code class='expr'>0</code> (zero) on failure.
+
The rest of the arguments to <code>callback</code> are passed
+
verbatim from <code>args</code>.</p>
+
</dd>
+
<dt class='head--doc'><span id='p-args'></span>Parameter <code class='parameter'>args</code></dt>
+
<dd></dd><dd class='body--doc'><p>Extra arguments to pass to <code>callback</code>.</p>
+
</dd>
+
<dt class='head--doc'>Returns</dt>
+
<dd class='body--doc'><p>Returns <code class='expr'>0</code> on failure to open a socket, and <code class='expr'>1</code>
+
if <code>callback</code> will be used.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<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>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>This object is put in callback mode by this function. For
+
<code>callback</code> to be called, the backend must be active. See e.g.
+
<code>set_read_callback</code> for more details about backends and
+
callback mode.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>The socket will be in nonblocking state if the connection is
+
successful, and any callbacks will be cleared.</p>
+
</dd>
<dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>
Array.diff
()</code>, <code>
Array.diff
_
compare_table
()</code>
-
<code>
Array.diff
_
longest_sequence
()</code></p>
+
<dd class='body--doc'><p><code>
connect
()</code>, <code>
open
_
socket
()</code>
,
<code>
set
_
nonblocking
()</code></p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
hex2string
</b></span>
+
<span class='homogen--name'><b>
close
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
string
(
8bit
)</code> <b><span class='method'>
hex2string
</span>(</b><code class='datatype'>string
(8bit)
</code> <code class='argument'>
hex
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
int</code> <b><span class='method'>close</span>
(
</b><b>
)</
b></
code>
<br>
+
<code><code
class='datatype'>int
<
/code> <
b><span class='method'>
close
</span>(</b><code class='datatype'>string</code> <code class='argument'>
direction
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Convert
a
string
of
hexadecimal
digits
to
binary
-
data.
Non-hexadecimal
characters
will
be
ignored
when
between
-
tuples
.
Eg.
"00
00"
is
ok,
but
"0
000"
isn't
.</p>
+
<dd class='body--doc'><p>
Close
the
file.
Optionally,
specify
"r",
"w" or "rw"
to
close just
+
the
read,
just
the
write
or
both
read and write directions of the file
+
respectively
.
</p>
+
<p>
An
exception
is
thrown
if
an
I/O
error occurs
.</p>
</dd>
-
+
<dt class='head--doc'>Returns</dt>
+
<dd class='body--doc'><p>Nonzero is returned if the file wasn't open in the specified
+
direction, zero otherwise.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>This function will not call the <tt>close_callback</tt>.</p>
+
</dd>
<dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>
string2hex()
</code></p>
+
<dd class='body--doc'><p><code>
open
</code>
,
<
code>open_socket<
/
code></
p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
implode_nicely
</b></span>
+
<span class='homogen--name'><b>
connect
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>string</code> <b><span class='method'>
implode_nicely
</span>(</b><code class='datatype'>
array
</code>(<code class='datatype'>string</code>|<code class='datatype'>int</code>|<code class='datatype'>
float
</code>) <code class='argument'>
foo
</code>, <code class='datatype'>string</code>|<code class='datatype'>
void
</code> <code class='argument'>
separator
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='
modifier'>variant</code> <code class='
datatype'>
int</code> <b><span class='method'>connect</span>(</b><code class='datatype'>
string</code> <
code class='argument'>host</code>, <code class='datatype'>int(0..)</code>|<code class='datatype'>string</code> <code class='argument'>port</code><
b>
)
<
/b></code><br>
+
<code><code class='modifier'>variant</code> <code class='datatype'>int</code> <b><
span class='method'>
connect
</span>(</b><code class='datatype'>
string
</code>
<code class='argument'>host</code>, <code class='datatype'>int
(
0..)
<
/
code
>|<code
class='datatype'>string</code>
<code class='argument'>port</code>, <code class='datatype'>string</code> <code class='argument'>client</code>, <code class='datatype'>int(0..)</code>
|<code class='datatype'>
string</code> <code class='argument'>client_port</code><b>)</b></code><br>
+
<code><code class='modifier'>variant</code> <code class='datatype'>string</code> <b><span class='method'>connect</span>(</b><code class='datatype'>string</code> <code class='argument'>host</code>, <code class='datatype'>
int
(0..)
</code>|<code class='datatype'>
string
</code>
<code class='argument'>port</code>, <code class='datatype'>string</code> <code class='argument'>data</code><b>
)
</b></code><br>
+
<code><code
class='modifier'>variant
<
/
code
>
<code
class='
datatype'>string</code> <b><span class='method'>connect</span>(</b><code class='datatype'>string</code> <code class='
argument'>
host
</code>, <code class='datatype'>
int(0..)</code>|<code class='datatype'>
string</code>
<code class='argument'>port</code>, <code class='datatype'>int(0..0)</code>
|<code class='datatype'>
string
</code> <code class='argument'>
client
</code>
,
<
code class='datatype'>int(0..)</code>|<code class='datatype'>string</code> <code class='argument'>client_port</code>, <code class='datatype'>string</code> <code class='argument'>data</code><
b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
This
function
implodes
a
list
of
words
to
a
readable
string
,
e
.
g.
-
<code
class='expr'
>
({"straw","berry","pie"})
</code>
becomes
-
<
code
class='expr'
>
"straw, berry
and
pie"
</code>. If the
separator
is
omitted,
the
-
default
is
<code
class='expr'
>
"and"
</code>.
If
the
words
are
numbers
they
are
-
converted
to
strings
first.
</p>
+
<dd class='body--doc'><p>
Open
a
TCP/IP
connection
to
the
specified
destination.</p>
+
<p>
In
nonblocking
mode
,
success is indicated with the write-callback,
+
and failure with the close-callback or the read_oob-callback
.
</p>
+
<p>
The
<code>
host
</code>
argument is the hostname or IP number of the remote
+
machine.
<
/p>
+
<p> A local IP and port can be explicitly bound by specifying
+
<
code
>client</code>
and
<
code>client_port<
/code>.
</p>
+
<p>
If the
<code>data</code>
argument
is
included
the
socket will use
+
TCP_FAST_OPEN
if
posible. In this mode the the function will
+
return the part of the data that has not been sent to the remote
+
server yet instead of 1 (you will have to use
<code>
write
</code>
to send
+
this data)
.
</p>
+
<p>
Note
that TCP_FAST_OPEN requires server support,
the
connection
+
might
fail
even
though the remote server exists. It might be
+
advisable
to
retry
without TCP_FAST_OPEN (and remember this
+
fact)
</p>
</dd>
-
+
<dt class='head--doc'>Returns</dt>
+
<dd class='body--doc'><p>This function returns 1 or the remaining <code>data</code> for success, 0
+
otherwise.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>In nonblocking mode <code class='expr'>0</code> (zero) may be returned and
+
<code>errno()</code> set to <code class='expr'>EWOULDBLOCK</code> or <code class='expr'>WSAEWOULDBLOCK</code>.</p>
+
<p> This should not be regarded as a
+
connection failure. In nonblocking mode you need to wait for a
+
write or close callback before you know if the connection failed
+
or not.</p>
+
</dd>
<dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>
`*
()</code></p>
+
<dd class='body--doc'><p><code>
query_address
()</code>
,
<
code>async_connect()<
/
code>, <code>connect_unix()</code></
p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
int2char
</b></span>
+
<span class='homogen--name'><b>
connect_unix
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
string
</code> <b><span class='method'>
int2char
</span>(</b><code class='datatype'>
int
</code> <code class='argument'>
x
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
int
</code> <b><span class='method'>
connect_unix
</span>(</b><code class='datatype'>
string
</code> <code class='argument'>
path
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Same
as
sprintf("%c",x);
</p>
+
<dd class='body--doc'><p>
Open
a
UNIX domain socket connection to the specified destination.
</p>
</dd>
-
<dt class='head--doc'>
See also
</dt>
-
<dd class='body--doc'><p><code>
sprintf()
</code></p>
+
<dt class='head--doc'>
Returns
</dt>
+
<dd class='body--doc'><p>
Returns
<code
class='expr'
>
1
</code>
on success, and
<
code class='expr'>0<
/
code> on failure.</
p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>Nonblocking mode is not supported while connecting</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
int2hex
</b></span>
+
<span class='homogen--name'><b>
create
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>string</code> <b><span class='
method
'>
int2hex
</span>(</b><code class='datatype'>int</code> <code class='argument'>
x
</code><b>)</b></code></p></dd>
+
<dd><p><code><
span class='object'>Stdio.File</span> <span class='class'>Stdio.File</span><b>(</b><b>)</b></
code
><br>
+
<code><span
class='
object'>Stdio.File</span> <span class='class'>Stdio.File</span><b>(</b><code class='
datatype'>string</code> <
code class='argument'>filename</code><
b>
)
<
/b></code><br>
+
<code><
span class='
object
'>
Stdio.File
</span>
<span class='class'>Stdio.File</span><b>
(</b><code class='datatype'>
string</code> <code class='argument'>filename</code>, <code class='datatype'>string</code> <code class='argument'>mode</code><b>)</b></code><br>
+
<code><span class='object'>Stdio.File</span> <span class='class'>Stdio.File</span><b>(</b><code class='datatype'>string</code> <code class='argument'>filename</code>, <code class='datatype'>string</code> <code class='argument'>mode</code>, <code class='datatype'>
int</code> <code class='argument'>
mask
</code><b>)</b></code><
br>
+
<code><span class='object'>Stdio.File<
/
span> <span class='class'>Stdio.File</span><b>(</b><code class='datatype'>string</code> <code class='argument'>descriptorname</code><b>)</b></code><br>
+
<code><span class='object'>Stdio.File</span> <span class='class'>Stdio.File</span><b>(</b><code class='datatype'>int</code> <code class='argument'>fd</code><b>)</b></code><br>
+
<code><span class='object'>Stdio.File</span> <span class='class'>Stdio.File</span><b>(</b><code class='datatype'>int</code> <code class='argument'>fd</code>, <code class='datatype'>string</code> <code class='argument'>mode</code><b>)</b></code></
p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Same
as <code class='expr'>
sprintf(
"
%x
"
,x);
</code>,
i
.
e
.
returns
the
integer
<
code
>
x
</
code
>
in
-
hexadecimal
base
using
lower
cased
symbols
.</p>
+
<dd class='body--doc'><p>
There
are four basic ways to create a Stdio.File object.
+
The first is calling it without any arguments, in which case the you'd
+
have to call <code>open()</code>, <code>connect()</code> or some other method which connects
+
the File object with a stream.</p>
+
<p> The second way is calling it with a <code>filename</code> and open <code>mode</code>. This is
+
the same thing
as
cloning and then calling
<code
>open()</code>,
except shorter and
+
faster.</p>
+
<p> The third way is to call it with <code>descriptorname</code> of <code
class='expr'>"
stdin
"</code>,
+
<code class='expr'>"stdout"</code> or <code class='expr'>"stderr"</code>
.
This will open the specified
+
standard stream
.
</p>
+
<p>
For
the
advanced
users, you can use the file descriptors of the
+
systems (note: emulated by pike on some systems - like NT). This is
+
only useful for streaming purposes on unix systems. This is
<
b
>
not
+
recommended at all
</
b
>
if you don't know what you're into. Default
+
<code>mode</code>
for
this
is
<code
class='expr'>"rw"</code>
.</p>
</dd>
-
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>Open mode will be filtered through the system UMASK. You
+
might need to use <code>chmod()</code> later.</p>
+
</dd>
<dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>
sprintf
()</code></p>
+
<dd class='body--doc'><p><code>
open
()</code>
,
<
code>connect()<
/
code>, <code>Stdio.FILE</code>,</
p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
int2roman
</b></span>
+
<span class='homogen--name'><b>
dup
</b></span>
</dt>
-
<dd><p><code><code class='
datatype
'>
string
</code> <b><span class='method'>
int2roman
</span>(</b><
code class='datatype'>int</code> <code class='argument'>m</code><
b>)</b></code></p></dd>
+
<dd><p><code><code class='
object unresolved
'>
File
</code> <b><span class='method'>
dup
</span>(</b><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Converts
the
provided
integer to
a
roman
integer
(i
.
e.
a
string)
.</p>
+
<dd class='body--doc'><p>
This
function
returns
a
clone
of
Stdio
.
File
with
all variables
+
copied from this file
.</p>
</dd>
-
<dt class='head--doc'>Throws</dt>
-
<dd class='body--doc'><p>Throws an error if <code>m</code> is outside the range 0 to 10000.</p>
-
</dd></dl>
-
-
-
<hr />
-
<dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>int2size</b></span>
-
</dt>
-
<dd><p><code><code class='datatype'>string</code> <b><span class='method'>int2size</span>(</b><code class='datatype'>int</code> <code class='argument'>size</code><b>)</b></code></p></dd>
-
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Returns the size as a memory size string with suffix,
-
e.g. 43210 is converted into "42.2 kB". To be correct
-
to the latest standards it should really read "42.2 KiB",
-
but we have chosen to keep the old notation for a while.
-
The function knows about the quantifiers kilo, mega, giga,
-
tera, peta, exa, zetta and yotta.</p>
-
</dd></dl>
-
-
-
<hr />
-
<dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>levenshtein_distance</b></span>
-
</dt>
-
<dd><p><code><code class='datatype'>int</code> <b><span class='method'>levenshtein_distance</span>(</b><code class='datatype'>string</code> <code class='argument'>a</code>, <code class='datatype'>string</code> <code class='argument'>b</code><b>)</b></code></p></dd>
-
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>This function calculates the Levenshtein distance between two strings a
-
and b. The Levenshtein distance describes the minimal number of character
-
additions, removals or substitutions to apply to convert a to b.</p>
-
<p> Mathematically, the Levenshtein distance between two strings a, b is given
-
by lev_a,b(|a|,|b|) where</p>
-
<p> lev_a,b(i, j) == max(i, j), if min(i, j) == 0
-
lev_a,b(i, j) == min( lev_a,b(i, j-1)+1,
-
lev_a,b(i-1, j)+1,
-
lev_a,b(i-1, j-1) + a_i!=b_j ), else</p>
-
<p> Note that the first element in the minimum corresponds to inserting a
-
character to a (or deleting a character from b), the second to deleting a
-
character from a and the third to match or mismatch, depending on whether
-
the respective characters are equal.</p>
-
<p> Example: For example, the Levenshtein distance between "pike" and
-
"bikes" is 2, since the following two edits change one into the other,
-
and there is no way to do it with fewer than two edits:
-
- "pike" -> "bike" (substitute "p" with "b")
-
- "bike" -> "bikes" (add "s" at the end)</p>
-
<p> Note that the cost to compute the Levenshtein distance is roughly
-
proportional to the product of the two string lengths. So this function
-
is usually used to aid in fuzzy string matching, when at least one of the
-
strings is short.</p>
-
</dd></dl>
-
-
-
<hr />
-
<dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>normalize_space</b></span>
-
</dt>
-
<dd><p><code><code class='datatype'>string</code> <b><span class='method'>normalize_space</span>(</b><code class='datatype'>string</code> <code class='argument'>s</code>, <code class='datatype'>string</code>|<code class='datatype'>void</code> <code class='argument'>whitespace</code><b>)</b></code></p></dd>
-
-
<dt class='head--doc'><span id='p-s'></span>Parameter <code class='parameter'>s</code></dt>
-
<dd></dd><dd class='body--doc'><p>Is returned after white space in it has been normalised.
-
White space is normalised by stripping leading and trailing white space
-
and replacing sequences of white space characters with a single space.</p>
-
</dd>
-
<dt class='head--doc'><span id='p-whitespace'></span>Parameter <code class='parameter'>whitespace</code></dt>
-
<dd></dd><dd class='body--doc'><p>Defines what is considered to be white space eligible for normalisation.
-
It has a default value that starts with <code class='expr'>" \t\r\n\v\f"</code> and in
-
addition to that contains all whitespace characters part of Unicode.
-
The first character denotes the character for replacing whitespace
-
sequences.</p>
-
</dd>
+
<dt class='head--doc'>Note</dt>
-
<dd class='body--doc'><p>
Trailing
and
leading
whitespace around \r and \n characters
-
is stripped as well (only useful if they're not in the
<
code
>
whitespace
</
code
>
set)
.</p>
+
<dd class='body--doc'><p>
All
variables,
even
<
tt
>
id
</
tt
>
,
are copied
.</p>
</dd>
-
<dt class='head--doc'>
Note
</dt>
-
<dd class='body--doc'><p>
This function is a lot faster with just one argument (i.e. the builtin
-
whitespace set has an optimised
code
path
)
.
</p>
+
<dt class='head--doc'>
See also
</dt>
+
<dd class='body--doc'><p>
<code>assign
()</
code></
p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
range
</b></span>
+
<span class='homogen--name'><b>
errno
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
array</code>(<code class='datatype'>
int</code>
)
<b><span class='method'>
range
</span>(</b><
code class='datatype'>string</code> <code class='argument'>s</code><
b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>int</code> <b><span class='method'>
errno
</span>(</b><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Returns the
character
range
of
a
string
in
an
array
of two
-
elements
.
The first element contains the lower bound and the
-
second
the
upper. The precision
is
only
8
bits,
so
for
wide
-
strings only character blocks are known
.</p>
+
<dd class='body--doc'><p>Returns the
error
code
for
the
last
command
on
this
file
.
+
Error
code
is
normally
cleared
when
a
command
is
successful
.</p>
</dd></dl> <hr /> <dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>
Method
</span>
-
<span class='homogen--name'><b>
secure
</b></span>
+
<dt class='head--type'><span class='homogen--type'>
Inherit
</span>
+
<span class='homogen--name'><b>
Fd
</b></span>
</dt>
-
<dd><p><code><
code
class='datatype'>
string
<
/
code
>
<b><span
class='
method
'>
secure
</
span>(</b><
code
class='datatype'
>
string
</
code
> <
code
class='
argument
'>
str
</
code
><
b>)<
/
b></
code></p></dd>
+
<dd><p><code><
span
class='datatype'><code class='
modifier
'>
optional
</
code
>
inherit Fd
</
span
>
:
<
span
class='
inherit
'>
Fd
</
span
></code></p></dd>
+
</dl>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Marks the string as secure, which will clear the memory area
-
before freeing the string.</p>
-
</dd>
-
<dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>Object.secure()</code></p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
sillycaps
</b></span>
+
<span class='homogen--name'><b>
line_iterator
</b></span>
</dt>
-
<dd><p><code><code class='
datatype
'>
string
</code> <b><span class='method'>
sillycaps
</span>(</b><code class='datatype'>
string
</code> <code class='argument'>
str
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='
object unresolved
'>
String.SplitIterator
</code>
|<code
class='object unresolved'>LineIterator
<
/code> <
b><span class='method'>
line_iterator
</span>(</b><code class='datatype'>
int
</code>
|<code
class='datatype'>void
<
/
code
>
<code
class='argument'>
trim
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Convert
the
first
character
in
each
word
(separated
by
spaces)
in
-
<
code
>
str
</
code
>
to
upper
case,
and
return
the
new string
.</p>
+
<dd class='body--doc'><p>
Returns
an
iterator
that
will
loop
over
the
lines
in
this file.
+
If trim is true, all
<
tt
>
'\r'
</
tt
>
characters
will
be
removed
from
+
the
input
.</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
soundex
</b></span>
+
<span class='homogen--name'><b>
open
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>string</code> <b><span class='method'>
soundex
</span>(</b><code class='datatype'>string</code> <code class='argument'>
word
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
int</code> <b><span class='method'>open</span>(</b><code class='datatype'>
string</code> <
code class='argument'>filename</code>, <code class='datatype'>string</code> <code class='argument'>mode</code><
b>
)
<
/b></code><br>
+
<code><code class='datatype'>int</code> <b><
span class='method'>
open
</span>(</b><code class='datatype'>string</code> <code class='argument'>
filename
</code>
,
<
code class='datatype'>string</code> <code class='argument'>mode</code>, <code class='datatype'>int</code> <code class='argument'>mask</code><
b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Returns
the
soundex
value
of
<code>
word
</code>
according to
-
the
original
Soundex
algorithm,
patented
by
Margaret
O´Dell
-
and
Robert
C.
Russel
in 1918
.
The method is based on the phonetic
-
classification of sounds by how they are made. It was only intended
-
for hashing of english surnames, and even at that it isn
'
t
that
-
much
of a help
.</p>
-
</
dd
></
dl
>
-
-
-
<
hr /
>
-
<
dl
class='
group--doc
'>
-
<
dt
class='
head--type
'><
span
class='
homogen--type
'>
Method
</
span
>
-
<
span
class='
homogen--name
'><
b
>
status
</
b
></
span
>
-
</
dt
>
-
<
dd
><
p
><code><code class='
datatype
'>
string
</code>
<
b
><
span
class='
method
'>
status
</
span
>
(
</
b
><code class='
datatype
'>
int
</code> <code class='
argument
'>
verbose
</code><
b
>
)
</
b
></
code
></p></
dd
>
-
-
<
dt
class='
head--doc
'>
Description
</
dt
>
-
<
dd
class='
body--doc
'><p>
Get
string
table
statistics
.</p>
+
<dd class='body--doc'><p>
Open
a
file
for
read,
write or append. The parameter
<code>
mode
</code>
should
+
contain
one
or
more
of
the
following
letters:</p>
+
<table
class='box'><tr><td><code><code
class='key'>"r"</code></code></td><td><p>Open
file
for
reading
.
</p>
+
</td></tr>
+
<tr><td><code><code
class=
'
key'>"w"</code></code></td><td><p>Open
file
for
writing
.</p>
+
</
td
></
tr
>
+
<
tr
><
td><code><code
class='
key
'>
"a"
<
/code></code></td><td><p>Open
file for append (use with <code
class='
expr
'>
"w"
<
/code>).</p>
+
</td></tr>
+
<tr><td><code><code
class='
key
'>
"t"
</
code
><
/code></td><td><p>Truncate
file at open (use with <code
class='
expr
'>
"w"
<
/code
>
).
</
p
>
+
</
td
></
tr
>
+
<
tr
><
td
><code><code class='
key
'>
"c"
</code><
/code
><
/td><td><p>Create
file if it doesn't exist (use with <code
class='
expr
'>
"w"
</
code
>
).
</
p
>
+
<
/td></tr>
+
<tr><td><
code
><code
class='
key
'>
"x"
</code>
</code></td><td><p>Fail
if file already exists (use with
<code class='
expr
'>
"c"
</code>
).
<
/p
>
+
</
td
></
tr
>
+
</
table><
p><
code>mode<
/
code
>
should always contain at least one of the letters
+
<
code
class='
expr
'>
"r"
</
code
>
or
<
code
class='
expr
'>
"w"
<
/code>.</
p>
+
<p>
The
parameter
<code>mask</code> is protection bits to use if the file is
+
created
.
Default is
<
code class='expr'>0666<
/
code> (read+write for all in octal
+
notation).</
p>
</dd> <dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>
Returns
a
string
with
an
ASCII
table
containing
-
the current string table statistics
.</p>
+
<dd class='body--doc'><p>
This
function
returns
<code
class='expr'>1</code>
for
success,
<code
class='expr'>0</code>
otherwise
.</p>
</dd>
-
<dt class='head--doc'>
Note
</dt>
-
<dd class='body--doc'><p>
Currently returns the empty string (
<code
class='expr'
>
""
</code>
)
-
if
<code>
verbose
</code>
is zero.
</p>
-
</dd>
-
<dt class='head--doc'>Note</dt>
-
<dd class='body--doc'><p>The formatting and contents of the result
-
may vary between different versions of Pike.</p>
+
<dt class='head--doc'>
See also
</dt>
+
<dd class='body--doc'><p><code>
close()
</code>
,
<code>
create()
</code></p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
string2hex
</b></span>
+
<span class='homogen--name'><b>
open_socket
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
string
</code> <b><span class='method'>
string2hex
</span>(</b><code class='datatype'>string</code> <code class='argument'>
data
</code>, <code class='datatype'>
void
</code>|<code class='datatype'>int</code> <code class='argument'>
uppercase
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
int
</code> <b><span class='method'>
open_socket
</span>(</b><code class='datatype'>
int</code>|<code class='datatype'>
string</code>
|<code
class='datatype'>void
<
/
code
>
<code
class='argument'>
port
</code>, <code class='datatype'>
string
</code>|<code class='datatype'>
void</code> <code class='argument'>address</code>, <code class='datatype'>
int</code>
|<code
class='datatype'>string
<
/
code
>|<code
class='
datatype'>void</code> <code class='
argument'>
family_hint
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Convert
a
string
of
binary
data
to
a
hexadecimal
string
.</p>
+
<dd class='body--doc'><p>
This
makes this file into
a
socket
ready
for
connections.
The reason
+
for this function is so that you can set the socket
to
nonblocking
+
or
blocking (default is blocking) before you call <code>connect()</code>
.</p>
</dd>
-
<dt class='head--doc'><span id='p-
uppercase
'></span>Parameter <code class='parameter'>
uppercase
</code></dt>
-
<dd></dd><dd class='body--doc'><p>If
set
, the
string
will
use
upper
cased
characters
.</p>
+
<dt class='head--doc'><span id='p-
port
'></span>Parameter <code class='parameter'>
port
</code></dt>
+
<dd></dd><dd class='body--doc'><p>If
you give a port number to this function
, the
socket
will
be
+
bound to this port locally before connecting anywhere
.
This is
+
only useful for some silly protocols like
<
b>FTP<
/
b>. The port can
+
also be specified as a string, giving the name of the service
+
associated with the port. Pass -1 to not specify a port (eg to
+
bind only to an address).</
p>
</dd>
-
+
<dt class='head--doc'><span id='p-address'></span>Parameter <code class='parameter'>address</code></dt>
+
<dd></dd><dd class='body--doc'><p>You may specify an address to bind to if your machine has many IP
+
numbers.</p>
+
</dd>
+
<dt class='head--doc'><span id='p-family_hint'></span>Parameter <code class='parameter'>family_hint</code></dt>
+
<dd></dd><dd class='body--doc'><p>A protocol family for the socket can be specified. If no family is
+
specified, one which is appropriate for the address is automatically
+
selected. Thus, there is normally no need to specify it. If you
+
do not want to specify a bind address, you can provide the address
+
as a hint here instead, to allow the automatic selection to work
+
anyway.</p>
+
</dd>
+
<dt class='head--doc'>Returns</dt>
+
<dd class='body--doc'><p>This function returns 1 for success, 0 otherwise.</p>
+
</dd>
<dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>
hex2string
()</code></p>
+
<dd class='body--doc'><p><code>
connect
()</code>
,
<
code>set_nonblocking()<
/
code>, <code>set_blocking()</code></
p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
trim
</b></span>
+
<span class='homogen--name'><b>
openat
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>string</code> <b><span class='method'>
trim
</span>(</b><code class='datatype'>string</code> <code class='argument'>
s
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='
object unresolved'>File</code> <b><span class='method'>openat</span>(</b><code class='
datatype'>string</code> <
code class='argument'>filename</code>, <code class='datatype'>string</code> <code class='argument'>mode</code><
b>
)
<
/b></code><br>
+
<code><code class='object unresolved'>File</code> <b><
span class='method'>
openat
</span>(</b><code class='datatype'>string</code> <code class='argument'>
filename
</code>
,
<
code class='datatype'>string</code> <code class='argument'>mode</code>, <code class='datatype'>int</code> <code class='argument'>mask</code><
b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Trim
leading
and
trailing
white
spaces
characters
(space, tab,
-
newline,
carriage return, form feed, vertical tab and all the
-
white spaces defined in Unicode
)
from the string
<code>
s
</code>
.
</p>
+
<dd class='body--doc'><p>
Open
a
file
relative
to
an
open
directory.</p>
+
</dd>
+
<dt
class='head--doc'>See
also</dt>
+
<dd
class='body--doc'><p><code>File.statat(
)
</code>,
<code>
File.unlinkat()
</code></p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
trim_whites
</b></span>
+
<span class='homogen--name'><b>
openpt
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
string
</code> <b><span class='method'>
trim_whites
</span>(</b><code class='datatype'>string</code> <code class='argument'>
s
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
int
</code> <b><span class='method'>
openpt
</span>(</b><code class='datatype'>string</code> <code class='argument'>
mode
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Trim
leading
and
trailing
spaces
and
tabs
from
the
string
<code>
s
</code>.</p>
+
<dd class='body--doc'><p>
Open
the
master
end
of
a
pseudo-terminal
pair.
The parameter
+
<code>mode</code> should contain one or more of
the
following
letters:
<
/p>
+
<table class='box'><tr><td><
code><
code class='key'>"r"<
/code>
</code></td><td><p>Open terminal for reading
.</p>
+
</td></tr>
+
<tr><td><code><code class='key'>"w"</code></code></td><td><p>Open terminal for writing.</p>
+
</td></tr>
+
</table><p><code>mode</code> should always contain at least one of the letters
+
<code class='expr'>"r"</code> or <code class='expr'>"w"</code>.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>grantpt()</code></p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
width
</b></span>
+
<span class='homogen--name'><b>
pipe
</b></span>
</dt>
-
<dd><p><code><code class='
datatype
'>
int(8..8)
</code>
|<code
class='datatype'>int(16..16)
<
/code
>
|
<
code
class='
datatype
'>
int(32..32)
</
code
>
<b><
span
class='
method
'>
width
</
span
>
(
<
/b><
code class='datatype'>
string
</code> <code class='argument'>
s
</code><b>)</b></code></p></dd>
+
<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'>
required_properties
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Returns
the
width
of
a
string
.</p>
+
<dd class='body--doc'><p>
This
function creates a pipe between
the
object
it
was
called in
+
and an object that is returned
.</p>
</dd>
-
<dt class='head--doc'>
Returns
</dt>
-
<dd class='body--doc'><p>
Three
return
values
are
currently
possible:
</p>
-
<table class='box'><tr><td><code><code class='key'>
8
</code></code></td><td><p>The
string
<code>s</code>
only
contains
characters
<=
255
.</p>
+
<dt class='head--doc'><
span id='p-required_properties'><
/
span>Parameter <code class='parameter'>required_properties</code></
dt>
+
<dd
></dd><dd
class='body--doc'><p>
Binary
or
(<code>predef::`|()</code>)
of
required
<
code class='expr'>PROP_<
/
code> properties.</
p>
+
<table class='box'><tr><td><code><code class='key'>
PROP_IPC
</code></code></td><td><p>The
resulting
pipe
may
be
used
for
inter process communication
.</p>
</td></tr>
-
<tr><td><code><code class='key'>
16
</code></code></td><td><p>The
string
<code>s</code>
only
contains
characters <= 65535
.</p>
+
<tr><td><code><code class='key'>
PROP_NONBLOCK
</code></code></td><td><p>The
resulting
pipe
supports
nonblocking
I/O
.</p>
</td></tr>
-
<tr><td><code><code class='key'>
32
</code></code></td><td><p>The
string
<code>
s
</code>
contains characters >= 65536
.</p>
+
<tr><td><code><code class='key'>
PROP_SHUTDOWN
</code></code></td><td><p>The
resulting
pipe supports shutting down transmission in either
+
direction (see
<code>
close()
</code>
)
.</p>
</td></tr>
-
</table>
+
<
tr><td><code><code class='key'>PROP_BUFFERED<
/
code></code></td><td><p>The resulting pipe is buffered (usually 4KB).</p>
+
</td></tr>
+
<tr><td><code><code class='key'>PROP_BIDIRECTIONAL</code></code></td><td><p>The resulting pipe is bi-directional.</p>
+
</td></tr>
+
<tr><td><code><code class='key'>PROP_SEND_FD</code></code></td><td><p>The resulting pipe might support sending of file descriptors
+
(see <code>send_fd()</code> and <code>receive_fd()</code> for details).</p>
+
</td></tr>
+
<tr><td><code><code class='key'>PROP_REVERSE</code></code></td><td><p>The resulting pipe supports communication "backwards" (but
+
not necessarily "forwards", see <code>PROP_BIDIRECTIONAL</code>).</p>
+
</td></tr>
+
</
table>
<p>The default is <code class='expr'>PROP_NONBLOCK|PROP_BIDIRECTIONAL</code>.</p>
+
<p> If <code>PROP_BIDIRECTIONAL</code> isn't specified, the read-end is this
+
object, and the write-end is the returned object (unless
+
<code>PROP_REVERSE</code> has been specified, in which case it is the other
+
way around).</p>
+
<p> The two ends of a bi-directional pipe are indistinguishable.</p>
+
<p> If the File object this function is called in was open to begin with,
+
it will be closed before the pipe is created.</p>
</dd> <dt class='head--doc'>Note</dt>
-
<dd class='body--doc'><p>
It
is
possible
that
a
future
version
of
Pike may return
-
further values. In particular the width
<
code class='expr'
>
7
</
code
>
seems
-
like it could be useful.</p>
-
</dd></dl>
-
<dl><dt><h2 class='header'>Class <b class='ms datatype'>String.Bootstring</b></h2>
-
</dt><dd><dl class='group--doc'>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>This class implements
the
"Bootstring" string transcoder described in
-
<a
href='ftp://ftp.rfc-editor.org/in-notes/rfc3492.txt'>ftp://ftp.rfc-editor.org/in-notes/rfc3492.txt</a>.</p>
-
</dd></dl>
-
-
<hr
/>
-
<dl
class='group--doc'>
-
<dt
class='head--type'><span
class='homogen--type'>Method</span>
-
<span
class='homogen--name'><b>create</b></span>
-
</dt>
-
<dd><p><code><span
class='object'>String.Bootstring</span>
<span class='class'>String
.
Bootstring
</
span><b>(</b><code class='datatype'>int</code> <code class='argument'>base</code>, <code class='datatype'>int</code> <code class='argument'>tmin</code>, <code class='datatype'>int</code> <code class='argument'>tmax</code>, <code class='datatype'>int</code> <code class='argument'>skew</code>, <code class='datatype'>int</code> <code class='argument'>damp</code>, <code class='datatype'>int</code> <code class='argument'>initial_bias</code>, <code class='datatype'>int</code> <code class='argument'>initial_n</code>, <code class='datatype'>int</code> <code class='argument'>delim</code>, <code class='datatype'>string</code> <code class='argument'>digits</code><b>)</b></code></
p>
</dd>
-
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Creates a Bootstring transcoder instance using the specified parameters.</p>
+
<dd class='body--doc'><p>
Calling
this
function
with
an
argument
of <
tt
>
0
</
tt
>
is
not
the
+
same
as
calling
it
with
no
arguments
.</p>
</dd>
-
<dt class='head--doc'>
<span
id='p-base'>
</
span>Parameter <code class='parameter'>base</code></
dt>
-
<dd
></dd><dd
class='body--doc'><p>
The base used by the variable-length integers.
<
/p>
-
</dd>
-
<dt class='head--doc'><span id='p-tmin'></span>Parameter <
code
class='parameter'
>
tmin
</code>
</dt>
-
<dd></dd><dd
class='body--doc'>
<
p>The minimum threshold digit value for the variable-length integers.
-
Must be >=0 and <= tmax.</p>
-
</dd>
-
<dt class='head--doc'><span id='p-tmax'></span>Parameter <
code
class='parameter'
>
tmax
</code>
</dt>
-
<dd></dd><dd
class='body--doc'>
<
p>The maximum threshold digit value for the variable-length integers.
-
Must be <= base-1.</p>
-
</dd>
-
<dt class='head--doc'><span id='p-skew'></span>Parameter <
code
class='parameter'
>
skew
</code>
</dt>
-
<dd></dd><dd
class='body--doc'><p>The
skew
term for the bias adapation. Must be >= 1.
<
/p>
-
</dd>
-
<dt class='head--doc'><span id='p-damp'></span>Parameter <
code
class='parameter'
>
damp
</code>
</dt>
-
<dd></dd><dd
class='body--doc'>
<
p
>
The damping factor for the bias adaption. Must be >= 2.</p>
-
</dd>
-
<dt class='head--doc'><span id='p-initial
_
bias'>
</
span
>
Parameter
<code
class='parameter'
>
initial
_
bias
</code>
</dt>
-
<dd></dd><dd
class='body--doc'><p>The
initial
bias for the variable-length integer thresholding.
-
initial_bias % base must be <= base - tmin.
<
/p
>
-
</dd>
-
<dt class='head--doc'><span id='p-initial
_
n'>
</
span
>
Parameter
<code
class='parameter'
>
initial
_
n
</code>
</dt>
-
<dd></dd><dd
class='body--doc'>
<
p>The first
code
point outside the "basic" set of code points.</p
>
-
</
dd>
-
<dt class='head--doc'><span id='p-delim'></span>Parameter <
code
class='parameter'
>
delim</code></dt>
-
<dd></dd><dd
class='body--doc'><p>The
"basic"
code point used as the delimiter.
<
/p>
-
</dd>
-
<dt class='head--doc'><span id='p-digits'></span>Parameter <
code
class='parameter'
>
digits
</code></
dt>
-
<dd></dd><dd class='body--doc'><
p>
The "basic" code points used as digits. The length of the string
-
should be the same as the base parameter.</p>
+
<dt class='head--doc'>
See
also
</dt>
+
<dd class='body--doc'><p><code>
Process.create_process()
</code>
,
<code>
send_fd()
</code>
,
<code>
receive_fd()
</code>
,
+
<code>
PROP_IPC
</code>
,
<
code
>
PROP
_
NONBLOCK
</
code
>
,
<code>
PROP
_
SEND_FD
</code>
,
+
<
code
>
PROP
_
SHUTDOWN
</
code
>
,
<code>
PROP
_
BUFFERED
</code>
,
<code>
PROP_REVERSE
</code>
,
+
<code>
PROP_BIDIRECTIONAL
</code></p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
decode
</b></span>
+
<span class='homogen--name'><b>
query_buffer_mode
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
string
</code>
<
b><span
class='
method
'>
decode
</
span
>
(
<
/b><
code class='datatype'>
string
</code> <
code
class='
argument
'>
s
</
code
><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
array
</code>
(
<
code
class='
object unresolved
'>
Stdio.Buffer
</
code
>
|
<code class='datatype'>
int(0..0)
</code>
)
<
b><span
class='
method
'>
query_buffer_mode
</
span
>
(
<
/
b>
<b>
)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Decodes
a Bootstring encoded string of "basic" code points back
-
to
the
original
string
space.</p>
-
</dd></dl>
-
-
-
<hr
/>
-
<dl
class='group--doc'>
-
<dt
class='head--type'><span
class='homogen--type'>Method</span>
-
<span
class='homogen--name'><b>encode</b></span>
-
</dt>
-
<dd><p><code><code
class='datatype'>string</code>
<b><span
class='method'>encode
<
/span>(</b><
code
class='datatype'
>
string</code> <code class='argument'>s</code><b>
)</
b></
code>
</p></dd>
-
-
<dt
class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Encodes a string using Bootstring encoding into a string constisting
-
only of "basic" code points
(
<
initial_n
).</p>
-
</dd></dl>
-
</dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>String.Buffer</b></h2>
-
</dt><dd><dl class='group--doc'>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>A buffer, used for building strings. It's
-
conceptually similar to a string, but you can only <code>add</code>
-
strings to it, and you can only <code>get</code> the value from it once.</p>
-
<p> There is a reason for those seemingly rather odd limitations,
-
it makes it possible to do some optimizations that really speed
-
things up.</p>
-
<p> You do not need to use this class unless you add very many
-
strings together, or very large strings.</p>
+
<dd class='body--doc'><p>
Get
the
active
input
and
output
buffers
that
have
been
+
set
with
<code>
set_buffer_mode
()</code> (
if
any
).</p>
</dd>
-
<dt class='head--doc'>Example</dt>
-
<dd class='example'><pre><p>For the fastest possible operation, write your code like this:</p>
-
<pre><code><span class='ns'>String</span><span class='delim'>.</span>Buffer b <span class='delim'>=</span> <span class='ns'>String</span><span class='delim'>.</span>Buffer<span class='delim'>(</span> <span class='delim'>)</span><span class='delim'>;</span>
-
-
<span class='type'>function</span> add <span class='delim'>=</span> b->add<span class='delim'>;</span>
-
-
.. call add several times in code ...
-
-
<span class='type'>string</span> result <span class='delim'>=</span> b->get<span class='delim'>(</span><span class='delim'>)</span><span class='delim'>;</span> <span class='comment'>// also clears the buffer</span>
-
</code></pre></pre></dd></dl>
-
-
<hr />
-
<dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>_search</b></span>
-
</dt>
-
<dd><p><code><code class='datatype'>int(0..)</code> <b><span class='method'>search</span>(</b><span class='class'>String.Buffer</span> <span class='argument'>from</span>, <code class='datatype'>int</code> <code class='argument'>character</code>, <code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>start</code>, <code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>end</code><b>)</b></code></p></dd>
-
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Search for a <code>character</code> in the buffer, starting the scan
-
from <code>start</code> and ending at <code>end</code> (inclusive).</p>
-
</dd>
+
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>Returns
to
position
in
the
buffer
where
the
character
was
found
-
on
success,
and
<code>
UNDEFINED
</code>
on
failure
.</p>
+
<dd class='body--doc'><p>Returns
an
array
with
two
elements:</p>
+
<table
class='box'><tr><td
colspan='2'>Array</td></tr>
+
<tr><td><code><code
class='object
unresolved'>Stdio.Buffer</code>
<code
class='key'>0</code></code></td><td><p>The
current
input
buffer.</p>
+
</td></tr>
+
<tr><td><code><code
class='object
unresolved'>Stdio.Buffer
<
/
code>
<
code class='key'>1<
/code>
</code></td><td><p>The
current
output buffer
.</p>
+
</td></tr>
+
</table>
</dd> <dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>
Stdio.Buffer()->
_
search()</code>, <code>search()</code>, <code>lfun::
_
search
()</code></p>
+
<dd class='body--doc'><p><code>
set
_
buffer
_
mode
()</code></p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>_
search
</b></span>
+
<span class='homogen--name'><b>
query
_
read_callback
</b></span>
<br>
+
<span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>query_write_callback</b></span><br>
+
<span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>query_read_oob_callback</b></span><br>
+
<span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>query_write_oob_callback</b></span><br>
+
<span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>query_close_callback</b></span><br>
+
<span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>query_callbacks</b></span><br>
</dt>
-
<dd><p><code><code class='
datatype
'>
int
(
0..
)</code> <b><span class='method'>
search
</span>(</b><
span
class='class'>
String.Buffer
</
span
> <span class='
argument
'>
from
</span>
,
<code class='datatype'>
string
</code> <code class='
argument
'>
substring
</code>
,
<code class='datatype'>int</code>
|
<code class='datatype'>
void
</code> <code class='
argument
'>
start
</code>, <code class='datatype'>
int
</code>|<code class='datatype'>
void
</code>
<code class='
argument
'>
end
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='
object unresolved
'>
read_callback_t</code> <b><span class='method'>query_read_callback</span>
(
</b><b>
)</
b></
code>
<br>
+
<code><code
class='object unresolved'>write_callback_t
<
/code> <
b><span class='method'>
query_write_callback
</span>(</b><
b>)</b></code><br>
+
<code><code
class='
datatype'>function</code>(<code
class
=
'
datatype'
>
mixed
</
code
>
,
<
code class='datatype'>string</code>:<code class='datatype'>int</code>) <b><
span class='
method
'>
query_read_oob_callback
</span>
(</b><b>)</b></code><br>
+
<code><code
class='datatype'>function
<
/
code
>(<code
class='datatype'>
mixed
</code>
:<code
class='datatype'>int
<
/
code
>)
<b><span
class='
method
'>
query_write_oob_callback
</
span>(</b><b>)</b></
code>
<br>
+
<code><code
class='datatype'>function
<
/
code
>(<code
class='datatype'>
mixed</code>:<code class='datatype'>
int</code>
)
<
b><span class='method'>query_close_callback</span>(</b><b>)</b></
code
><br>
+
<code><code
class='datatype'>
array
</code>
(<code
class='datatype'>function
<
/
code
>(<code
class='
datatype
'>
mixed
</code>, <code class='datatype'>
void
</code>|<code class='datatype'>
string
</code>
:
<code class='
datatype
'>
int
</code>
))
<b>
<span class='method'>query_callbacks</span>(</b><b>
)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Search
for
a
<code>
substring
</code>
in
the
buffer,
starting
the
scan
-
from
<code>
start
</code> and
ending at
<code>
end
</code>
(inclusive)
.</p>
+
<dd class='body--doc'><p>
These
functions return the currently installed callbacks
for
the
+
respective events.
<
/p>
+
<p> <
code>
query_callbacks
</code>
returns
the
callbacks
in
the
same order as
+
<code>
set_callbacks
</code> and <code>
set_nonblocking
</code>
expect them
.</p>
</dd>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>Returns to position in the buffer where the substring was found
-
on success, and <code>UNDEFINED</code> on failure.</p>
-
</dd>
+
<dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>
Stdio.Buffer()->
_
search
()</code>, <code>
search()
</code>, <code>
lfun::
_
search()
</code></p>
+
<dd class='body--doc'><p><code>
set
_
nonblocking
()</code>, <code>
set_read_callback
</code>,
+
<code>
set
_
write_callback
</code>
,
<
code>set_read_oob_callback<
/
code>,
+
<code>set_write_oob_callback</code>, <code>set_close_callback</code>,
+
<code>set_callbacks</code></
p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>_
sizeof
</b></span>
+
<span class='homogen--name'><b>
query
_
id
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
int
</code> <b><span class='method'>
sizeof
</span>(</b>
<
span class='class'>String.Buffer</span> <span class='argument'>arg</span> <
b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
mixed
</code> <b><span class='method'>
query_id
</span>(</b><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Returns
the
size
of
the
buffer
.</p>
+
<dd class='body--doc'><p>
This
function returns
the
<tt>id</tt>
that
has
been set with <code>set_id()</code>
.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>set_id()</code></p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
_sprintf
</b></span>
+
<span class='homogen--name'><b>
read
</b></span>
</dt>
-
<dd><p><code><
span
class='datatype'>string</
span
> <b><span class='method'>
sprintf
</span>(</b><
span
class='datatype'>
string
</
span
> <
span
class='
constant
'>
format
</
span
>,
...
<
span
class='
class
'>
String.Buffer
</
span
>
<
span
class='
constant
'>
arg
</
span
>
...
<b>)</b></code></p></dd>
+
<dd><p><code><
code
class='datatype'>string
(8bit)
</
code
> <b><span class='method'>
read
</span>(</b><
code
class='datatype'>
int
</
code
>
|<code
class='datatype'>void
<
/code>
<code
class='
argument
'>
nbytes
</
code
>, <
code
class='
datatype
'>
bool
</
code
>
|
<
code
class='
datatype
'>
void
</
code
>
<code
class='argument'>not_all
<
/code><
b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
It
is
possible
to
<code>
sprintf
</code>
a
String.Buffer
object
-
as
<
tt
>
%s
</
tt
>
just
as
if
it
was a string.
</p>
+
<dd class='body--doc'><p>
Read
(optionally
buffered)
data
from a file or a stream.
<
/p>
+
<p> Proxy function for <
code>
Fd::read()
</code>
,
that
adds
support for
+
the
buffering configured by
<
code
>
set_buffer_mode()
</
code
>
</p>
+
</dd>
+
<dt
class='head--doc'>See
also</dt>
+
<dd
class='body--doc'><p><code>read_function()</code>,
<code>write()</code>,
<
code>Fd::read()<
/
code></
p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
`+
</b></span>
+
<span class='homogen--name'><b>
read_function
</b></span>
</dt>
-
<dd><p><code><code class='
object
unresolved
'>
String.Buffer
</code>
res
=
<code class='
class
'>
String.Buffer()
</code>
 + 
<code class='
class
'>
what
</code></code></p></dd>
-
</dl>
+
<dd><p><code><code class='
datatype'>function</code>(:<code
class=
'
datatype'
>
string
</code>
)
<b><span
class
=
'method'>read_function
<
/span>(</b><
code class='
datatype
'>
int
</code>
<code class='
argument
'>
nbytes
</code><
b>)<
/
b></
code></p></dd>
-
-
<hr />
-
<dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>`+=</b></span>
-
</dt>
-
<dd><p><code><code class='class'>String.Buffer()</code> += <code class='class'>what</code></code></p></dd>
-
</dl>
-
-
-
<hr />
-
<dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>add</b></span>
-
</dt>
-
<dd><p><code><code class='datatype'>int</code> <b><span class='method'>add</span>(</b><code class='datatype'>string</code>|<code class='object unresolved'>String.Buffer</code> ... <code class='argument'>data</code><b>)</b></code></p></dd>
-
+
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Adds
<code>
data
</code>
to
the
buffer
.
</p>
-
</dd>
-
<dt
class='head--doc'>Returns</dt>
-
<dd
class='body--doc'><p>Returns
the
size
of
the
buffer.</p>
-
</dd>
-
<dt
class='head--doc'>Note</dt>
-
<dd
class='body--doc'><p>Pike
7.8
and
earlier
did
not
support adding
<code>String.
Buffer
</code>
s
-
directly
.</p>
+
<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,
eg
for
the
fourth
argument
to
+
<code>String.
SplitIterator
</code>.</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
cast
</b></span>
+
<span class='homogen--name'><b>
send_fd
</b></span>
</dt>
-
<dd><p><code><
b>(</b><span
class='datatype'>
int
</
span
>
<b>)</b><span
class='class'>String.Buffer
<
/span>()<br><
b>
(
<
/b><
span class='
datatype
'>
float
</span>
<b>)</b><span class='class'>String.Buffer</span>
(
)
<
br><b>(<
/b><
span
class='
datatype'>string</span><b>)</b><span
class=
'
class'
>
String.Buffer
</
span
>
()
<
br><b>(</b><span
class='
datatype'>array</span><b>)</b><span
class=
'
class'
>
String.Buffer
</
span
>
()<br><b>(</b><span
class='datatype'>mapping
<
/span><b>)</b><span
class='
class
'>
String.Buffer
</
span
>
()
<
br><
b>
(</b><span class='datatype'>multiset</span><b>
)</b><
span class='class'>String.Buffer<
/
span>()</
code></p></dd>
+
<dd><p><code><
code
class='datatype'>
void
</
code
> <b><span class='
method
'>
send_fd
</span>(</b><
code
class='
object
unresolved
'>
File
</
code
>
|
<
code
class='
object
unresolved
'>
Fd
</
code
> <
code
class='
argument
'>
file
</
code
><b>)</b></code></p></dd>
+
</dl>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>It is possible to cast a String.Buffer object to
-
a <code class='expr'>string</code> and an <code class='expr'>int</code>.</p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
clear
</b></span>
+
<span class='homogen--name'><b>
set_blocking
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>void</code> <b><span class='method'>
clear
</span>(</b><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>void</code> <b><span class='method'>
set_blocking
</span>(</b><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Empty
the
buffer
, and
don't
care
about
the
old
content
.</p>
+
<dd class='body--doc'><p>
This
function
clears all callbacks and sets a stream to blocking
+
mode. i.e. reading
,
writing
and
closing
will
wait
until
data
has
+
been transferred before returning
.</p>
</dd> <dt class='head--doc'>Note</dt>
-
<dd class='body--doc'><p>
This
function
was
not
available
in
Pike
7
.
8
and
earlier
.</p>
+
<dd class='body--doc'><p>
The
callbacks are cleared and blocking mode is set in one atomic
+
operation, so no callback gets called in between if the backend
+
is running in another thread.</p>
+
<p> Even so, if the stream is in callback mode (i.e. if any
+
callbacks are installed) then only the backend thread can use
+
this
function
reliably;
it
might
otherwise already be running
in
+
a
callback which is about to call e
.
g.
<code>write</code>
when the stream
+
becomes blocking
.</p>
</dd> <dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>
get
()</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> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
create
</b></span>
+
<span class='homogen--name'><b>
set_nonblocking_keep_callbacks
</b></span>
<br>
+
<span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>set_blocking_keep_callbacks</b></span><br>
</dt>
-
<dd><p><code><
span
class='
object
'>
String.Buffer
</
span
> <span class='
class
'>
String.Buffer
</span><b>
(
</b><code class='datatype'>
int
</code> <
code
class='
argument
'>
initial
_
size
</
code
><b>)</b></code></p></dd>
+
<dd><p><code><
code
class='
datatype
'>
void
</
code
> <
b><
span class='
method
'>
set_nonblocking_keep_callbacks
</span>
(
<
/
b><
b>)<
/b><
/
code
><br>
+
<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>
Initializes
a
new
buffer
.</p>
-
<
p
>
If no
<code>
initial
_
size
</code>
is specified
,
256 is used. If you
-
know approximately how big the buffer will be, you can optimize
-
the operation of
<code>
add
()</code>
(slightly) by passing the size to this
-
function.
</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> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
get
</b></span>
+
<span class='homogen--name'><b>
set_buffer_mode
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
string
</code> <b><span class='method'>
get
</span>(</b><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
set_buffer_mode
</span>(</b><
code class='object unresolved'>Stdio.Buffer</code>|<code class='datatype'>int(0..0)</code> <code class='argument'>in</code>, <code class='object unresolved'>Stdio.Buffer</code>|<code class='datatype'>int(0..0)</code> <code class='argument'>out</code><
b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Get
the
data
from
the
buffer
.</p>
+
<dd class='body--doc'><p>
Toggle
the
file
to
Buffer mode.</p>
+
<p> In this mode reading and writing will be done via Buffer
+
objects, in
the
directions you included buffers
.</p>
</dd>
-
+
<dt class='head--doc'><span id='p-in'></span>Parameter <code class='parameter'>in</code></dt>
+
<dd></dd><dd class='body--doc'><p>Input buffer. If this buffer is non-empty, its contents
+
will be returned after any already received data.</p>
+
</dd>
+
<dt class='head--doc'><span id='p-out'></span>Parameter <code class='parameter'>out</code></dt>
+
<dd></dd><dd class='body--doc'><p>Output buffer. If this buffer is non-empty, its contents
+
will be sent after any data already queued for sending.</p>
+
</dd>
<dt class='head--doc'>Note</dt>
-
<dd class='body--doc'><p>This will
clear
the
data
in
the buffer</p>
+
<dd class='body--doc'><p>
Normally you call <code>write</code> to re-trigger the write callback if
+
you do not output anything in it (which will stop it from
+
re-occuring again).</p>
+
<p>
This will
work
with
buffered output mode as well, but simply
+
adding more
data
to
the
output
buffer
will work as well.
</p>
</dd> <dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>
get
_
copy
()</code>
,
<
code>clear()<
/
code></
p>
+
<dd class='body--doc'><p><code>
query
_
buffer_mode
()</code></p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
get
_
copy
</b></span>
+
<span class='homogen--name'><b>
set
_
callbacks
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
string
</code> <b><span class='method'>
get
_
copy
</span>(</b><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
set
_
callbacks
</span>(</b><
code class='object unresolved'>read_callback_t</code>|<code class='datatype'>void</code> <code class='argument'>read_cb</code>, <code class='object unresolved'>write_callback_t</code>|<code class='datatype'>void</code> <code class='argument'>write_cb</code>, <code class='datatype'>void</code>|<code class='datatype'>function</code>(<code class='datatype'>mixed</code>:<code class='datatype'>int</code>) <code class='argument'>close_cb</code>, <code class='datatype'>void</code>|<code class='datatype'>function</code>(<code class='datatype'>mixed</code>, <code class='datatype'>string</code>:<code class='datatype'>int</code>) <code class='argument'>read_oob_cb</code>, <code class='datatype'>void</code>|<code class='datatype'>function</code>(<code class='datatype'>mixed</code>:<code class='datatype'>int</code>) <code class='argument'>write_oob_cb</code><
b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Get
the
data
from
the
buffer
.
Significantly
slower
than
<code>
get
</code>,
-
but
does not
clear
the
buffer
.</p>
+
<dd class='body--doc'><p>
Installs
all
the
specified
callbacks
at
once
.
Use
<code>UNDEFINED</code>
+
to
keep the current setting for a callback.
<
/p>
+
<p> Like <
code>
set_nonblocking
</code>,
the callbacks are installed atomically.
+
As
opposed
to
<code>set_nonblocking</code>, this function
does not
do
+
anything with
the
stream, and it doesn't even have to be open
.</p>
</dd> <dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>
get()
</code></p>
+
<dd class='body--doc'><p><code>
set_read_callback
</code>
,
<
code>set_write_callback<
/
code>,
+
<code>set_read_oob_callback</code>, <code>set_write_oob_callback</code>,
+
<code>set_close_callback</code>, <code>query_callbacks</code></
p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
putchar
</b></span>
+
<span class='homogen--name'><b>
set_read_callback
</b></span>
<br>
+
<span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>set_write_callback</b></span><br>
+
<span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>set_read_oob_callback</b></span><br>
+
<span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>set_write_oob_callback</b></span><br>
+
<span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>set_close_callback</b></span><br>
+
<span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>set_fs_event_callback</b></span><br>
</dt>
-
<dd><p><code><code class='datatype'>void</code> <b><span class='method'>
putchar
</span>(</b><code class='datatype'>int</code> <code class='argument'>
c
</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'>
int</code>
)
<code class='argument'>
read_cb
</code><b>)</b></code><
br>
+
<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='object unresolved'>Buffer</code>:<code class='datatype'>int</code>) <code class='argument'>read_cb</code><b>)</b></code><br>
+
<code><code class='datatype'>void</code> <b><span class='method'>set_write_callback</span>(</b><code class='datatype'>function</code>(<code class='datatype'>mixed</code>:<code class='datatype'>int</code>) <code class='argument'>write_cb</code><b>)</b></code><br>
+
<code><code class='datatype'>void</code> <b><span class='method'>set_write_callback</span>(</b><code class='datatype'>function</code>(<code class='datatype'>mixed</code>, <code class='object unresolved'>Buffer</code>:<code class='datatype'>int</code>) <code class='argument'>write_cb</code><b>)</b></code><br>
+
<code><code class='datatype'>void</code> <b><span class='method'>set_read_oob_callback</span>(</b><code class='datatype'>function</code>(<code class='datatype'>mixed</code>, <code class='datatype'>string</code>:<code class='datatype'>int</code>) <code class='argument'>read_oob_cb</code><b>)</b></code><br>
+
<code><code class='datatype'>void</code> <b><span class='method'>set_write_oob_callback</span>(</b><code class='datatype'>function</code>(<code class='datatype'>mixed</code>:<code class='datatype'>int</code>) <code class='argument'>write_oob_cb</code><b>)</b></code><br>
+
<code><code class='datatype'>void</code> <b><span class='method'>set_close_callback</span>(</b><code class='datatype'>function</code>(<code class='datatype'>mixed</code>:<code class='datatype'>int</code>) <code class='argument'>close_cb</code><b>)</b></code><br>
+
<code><code class='datatype'>void</code> <b><span class='method'>set_fs_event_callback</span>(</b><code class='datatype'>function</code>(<code class='datatype'>mixed</code>, <code class='datatype'>int</code>:<code class='datatype'>int</code>) <code class='argument'>fs_event_cb</code>, <code class='datatype'>int</code> <code class='argument'>event_mask</code><b>)</b></code></
p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Appends
the
character
<code>
c
</code>
at
the
end
of the
string
.</p>
-
<
/dd
><
/dl
>
-
-
-
<
hr
/>
-
<dl
class='group--doc'
>
-
<
dt
class=
'
head--type'>
<
span
class='
homogen--type
'>
Method
</
span
>
-
<span
class='homogen--name'>
<
b
>
sprintf
</
b
></
span
>
-
<
/dt
>
-
<
dd
><p><code><code
class='datatype'
>
int
</
code
> <
b
><
span class='method'
>
sprintf
</
span
>
(
</
b
><
code
class='object
unresolved'
>
strict
_
sprintf_format
</code> <
code
class='argument'
>
format
</code>, <code
class='object
unresolved'
>
sprintf
_
args
</code> ... <code
class='argument'
>
args
</code><
b
>
)
</
b
><
/
code></
p
></
dd
>
-
-
<
dt
class=
'
head
--
doc'
>
Description
</
dt
>
-
<dd
class=
'
body--doc'
><
p
>
Appends
the
output
from
<code>
sprintf
</code>
at
the end of the
string
.
-
Returns
the
resulting
size
of the
String
.
Buffer
.</p>
-
</
dd
></
dl
>
-
</
dd
></
dl
><
dl
><
dt
><
h2 class='header'
>
Class
<
b
class='ms
datatype'
>
String.Iterator
</
b
></
h2
>
-
</
dt
><
dd
><
dl
class='group
--
doc
'
>
-
<dt
class=
'
head
-
-doc'
>
Description
</
dt
>
-
<
dd
class='body--doc'
><p>
An
object
of
this
class
is
returned
by <code>
get
_
iterator()
</code>
when
-
called
with
a
string
.</p>
+
<dd class='body--doc'><p>
These
functions set
the
various
callbacks, which will be called
+
when various events occur on the stream. A zero as argument will
+
remove the callback.
<
/p>
+
<p> A <
code>
Pike.Backend
</code>
object
is responsible for calling
the
+
callbacks.
It requires a thread to be waiting in it to execute
+
the calls. That means that only one
of the
callbacks will be
+
running at a time, so you don't need mutexes between them
.</p>
+
<
p
>
Unless you've specified otherwise with the
<
code>set_backend<
/
code
>
+
function, the default backend
<
code>Pike.DefaultBackend<
/
code
>
will be
+
used. It
'
s normally activated by returning
<
code
class='
expr
'>-
1
</
code
>
from the
+
<
tt
>
main
</
tt
>
function and will then execute in the main thread.
</
p
>
+
<
ul
>
+
<
li
><p>
When data arrives on the stream,
<code>
read_cb
<
/
code
>
will be called with
+
some or all of that data as the second argument.
</
p
>
+
<p>
If the file is in buffer mode, the second argument will be a Buffer.
<
/p
>
+
<
p>
This will always be the same buffer, so data you do not use in
+
one read callback can be simply left in the buffer, when new
+
data arrives it will be appended
</
p
>
+
</
li
><
li><p>When
the
stream has buffer space over for writing, <code
>
write
_
cb
</code>
+
will be called so that you can write more data to it.
<
/p>
+
<p> This callback is also called after the remote end of a socket
+
connection has closed the write direction. An attempt to write
+
data to it in that case will generate a <
code>
System.EPIPE
</code>
errno.
+
If the remote end has closed both directions simultaneously
+
(the usual case)
,
Pike will first attempt to call
<code
>close_cb</code>,
+
then this callback (unless <code
>
close
_
cb
</code>
has closed the stream)
.
</p>
+
<p> If the file is in buffer mode, the second argument will be a Buffer
.
</p>
+
<p> You should add data to write to this buffer
.
</p>
+
</li><li><p>When
out-of-band
data arrives on the stream,
<code>
read_oob_cb
</code>
+
will be called with some or all of that data as the second
+
argument.
<
/p
>
+
</
li
><
li><p>When the stream allows out-of-band data to be sent,
+
<
code>
write_oob_cb
</
code
>
will be called so that you can write more
+
out-of-band data to it.
</
p
>
+
<
p>
If the OS doesn
'
t separate the write events for normal and
+
out
-
of
-
band data, Pike will try to call <code
>
write_oob_cb
</
code
>
first.
+
If it doesn
'
t write anything, then <code
>
write_cb
<
/code
>
will
be
tried.
+
This also means that
<code>
write_oob_cb
</code>
might
get called when
the
+
remote
end of
a connection has closed
the
write direction
.
</p>
+
</li><li><p>When
an
error
or
an
end-
of
-stream
in
the
read direction
+
occurs, <code>close_cb</code> will be called
.
<code>errno</code> will return the
+
error, or zero in the case of an end-of-stream
.</p>
+
<
p> The name of this callback is rather unfortunate since it
+
really has nothing to do with a close: The stream is still
+
open when <code>close_cb<
/
code
>
is called (you might not be able to read
+
and/or write to it, but you can still use things like
+
<
code>query_address<
/
code
>
, and the underlying file descriptor is still
+
allocated). Also, this callback will not be called for a local
+
close, neither by a call to
<
code>close<
/
code
>
or by destructing this
+
object.
</
p
>
+
<
p
>
Also,
<
code
>
close_cb
<
/code
>
will not be called if a remote close only
+
occurs in the write direction; that is handled by
<
code>write_cb</code>
+
(or possibly <code
>
write_oob_cb
</
code
>
).
</
p
>
+
<
p> Events to <code>read_cb<
/
code
>
and
<
code
>
close_cb
<
/code>
will be automatically
+
deregistered if an end
-
of
-
stream occurs, and all events in the
+
case of an error. I.e. there won
'
t be any more calls to the
+
callbacks unless they are reinstalled. This doesn
'
t affect the
+
callback settings
-
<code
>
query_read_callback
</
code
>
et al will still
+
return the installed callbacks.
<
/p>
+
</li></ul><p>If
the stream is a socket performing a nonblocking connect (see
+
<code
>
open_socket
<
/code> and <code>connect</code>), a connection failure will call
+
<code>close_cb</code>, and a successful connect will call either
+
<code>read_cb</code> or <code>write_cb</code> as above.</
p>
+
<p>
All
callbacks
will
receive
the
<tt>id</tt>
set
by <code>
set
_
id
</code>
as
+
first
argument.</p>
+
<p>
If a callback returns <code class='expr'>-1</code>, no other callback or call out
+
will be
called
by
the
backend in that round
.
I.e. the caller of
+
the backend will get control back right away. For the default
+
backend that means it will immediately start another round and
+
check files and call outs anew.
</p>
</dd>
-
<dt class='head--doc'>
See also
<
/dt>
-
<dd class='body--doc'><p><code>get_iterator</code></p>
-
</dd></dl>
-
-
<hr />
-
<dl class='group--doc'>
-
<dt class='head--type'><
span
class
='
homogen--type'>Inherit</span>
-
<span class='homogen--name'><b>predef::Iterator</b></span>
-
</dt>
-
<dd><
p
><code><span class='datatype'>inherit predef::Iterator</span> : <span class='inherit'>predef::Iterator</span></code></p></dd>
-
</dl>
-
</dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>String.Replace</b></h2>
-
</dt><dd><dl class='group
-
-doc'>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>This is a "compiled" version of the <code>replace</code> function applied on
-
a string, with more than one replace string. The replace strings
-
are given to the create method as a <i>from</i> and <i>to</i> array
-
and are then analyzed. The <code class='expr'>`()</code> is then called with a
-
string and the replace rules in the Replace object will be
-
applied. The Replace object is used internally by the Pike
-
optimizer and need not be used manually.</p>
-
</dd></dl>
-
-
<hr />
-
<dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
_
decode</b></span>
-
</dt>
-
<dd><p><code><span class=
'
class'
>
String.Replace
</span> <
b><span class='method'>decode_value</span>(</b><span class='datatype'>string(8bit)</span> <span class='argument'>data</span>)</b></
code
></p></dd>
-
</dl>
-
-
-
<hr
/>
-
<dl
class='
group--doc
'>
-
<dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
_
encode
</
b></span>
-
</dt>
-
<dd><p><
code><
span class='datatype'>string(8bit)<
/
span> <b><span class='method'>encode_value</span>(</b><span class='class'>String.Replace</span> <span class='argument'>data</span>)</b></code></p></dd>
-
</dl>
-
-
-
<hr />
-
<dl class='group--doc'>
-
<
dt
class='head--type'
>
<span class='homogen--type'>Method</span>
-
<
span class='homogen--name'><b>`()</b></span>
-
</dt>
-
<
dd><
p><code><code class='datatype'>string<
/
code> res = <code class='class'>String.Replace()</code>()</code></p></
dd>
-
<
/dl>
-
-
-
<hr />
-
<dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>create</b></span>
-
</dt>
-
<
dd
><p><code><span
class='
object'>String.Replace</span> <span class='class'>String.Replace</span><b>(</b><b>)</b></code><br>
-
<code><span class='object'>String.Replace</span> <span class='class'>String.Replace</span><b>(</b><code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>string</code>)<b>)</b></code><br>
-
<code><span class='object'>String.Replace</span> <span class='class'>String.Replace</span><b>(</b><code class='datatype'>array</code>(<code class='datatype'>string</code>) <code class='argument'>from</code>, <code class='datatype'>array</code>(<code class='datatype'>string</code>)|<code class='datatype'>string</code> <code class='argument'>to</code><b>)</b></code></p></dd>
-
</dl>
-
</dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>String.SingleReplace</b></h2>
-
</dt><dd><dl class='group--doc'>
-
<dt class='head--doc'>Description</dt>
-
<dd class='
body--doc'><p>
This
is
a
"compiled"
version
of
the <code>replace</code> function applied on
-
a string, with just
one
replace
string.
The
replace
strings are
-
given
to
the
create method as a <i>
from
</i>
and
<
i>tom</i> string and
-
are then analyzed. The <
code
class='expr'
>
`()</code> is then called with a string
-
and the replace rule in the Replace object will be applied
.
The
-
Replace object is used internally by the Pike optimizer and need
-
not be used manually.</p>
-
</dd></dl>
-
-
<hr />
-
<dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
_
decode
</
b></span>
-
</dt>
-
<dd><p><
code>
<span
class='class'>String.SingleReplace</span>
<b><span class='method'>decode_value</span>(</b><span class='datatype'>string(8bit)</span> <span class='argument'>data</span>)</b></code></p></dd>
-
</dl>
-
-
-
<hr />
-
<dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>_encode</b></span>
-
</dt>
-
<dd><p><code><span class='datatype'>string(8bit)</span> <b><span class='method'>encode_value</span>(</b><span class='class'>String
.
SingleReplace
</
span> <span class='argument'>data</span>)</b></code></
p>
</dd>
-
</
dl>
-
-
-
<hr />
-
<dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>`()</b></span>
-
</dt>
-
<
dd>
<p><code><code class='datatype'>string</code> res = <code class='class'>String.SingleReplace()</code>()</code></p></dd>
-
</dl>
-
-
-
<hr />
-
<dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>create</b></span>
-
</dt>
-
<dd><p><code><span class='object'>String.SingleReplace</span> <span class='class'>String.SingleReplace</span><b>(</b><code class='datatype'>string</code>|<code class='datatype'>void</code> <code class='argument'>from</code>, <code class='datatype'>string</code>|<code class='datatype'>void</code> <code class='argument'>to</code><b>)</b></code></p></dd>
-
+
<dt class='head--doc'><span
id
='p-
event
_
mask
'></span>
Parameter
<code class='
parameter
'>
event
_
mask
</code></dt>
+
<dd></dd><dd class='body--doc'><p>
An
event
mask
specifing
bitwise
OR
of one
or
more
event
types
to
+
monitor,
selected
from <code>
Stdio
.
NOTE
_
WRITE
</code>
and
friends
.</p>
+
</dd>
<dt class='head--doc'>Note</dt>
-
<dd class='body--doc'><p>
May
be
called
with
either
zero
or
two arguments
.</p>
-
</dd></dl>
-
</dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>String.SplitIterator</b></h2>
-
</dt><dd><dl class='group--doc'>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>An iterator that iterates over substrings of a string, separated
-
by a character or several different characters.</p>
+
<dd class='body--doc'><p>
These
functions
do
not
set
the
file
nonblocking
.</p>
</dd> <dt class='head--doc'>Note</dt>
-
<dd class='body--doc'><p>
Typically
you don't need to explicitly use the SplitIterator.
-
Expressions like the following
are
automatically
optimized
into
-
using a SplitIterator.
<
/p>
-
<pre><
code><
span class='lang'>foreach<
/
span><span class='delim'>(</span>str<span class='delim'>/</span><span class='string'>"\n"</span><span class='delim'>,</span> <span class='type'>string</span> line<span class='delim'>)</span>
-
write<span class='delim'>(</span><span class='string'>"%s\n"</span><span class='delim'>,</span> line<span class='delim'>)</span><span class='delim'>;</span>
-
</
code>
</pre></dd></dl>
-
-
<hr
/>
-
<dl
class='group--doc'>
-
<dt
class='head--type'><span
class='homogen--type'>Method
<
/span>
-
<span class='homogen--name'><b>create</b></span>
-
</dt>
-
<dd><p><
code>
<span class='object'>String.SplitIterator</span> <span class='class'>String.SplitIterator</span><b>(</b><code class='datatype'>string</code> <code class='argument'>buffer</code>, <code class='datatype'>int</code>|<code class='datatype'>array</code>(<code class='datatype'>int</code>)|<code class='datatype'>multiset</code>(<code class='datatype'>int</code>) <code class='argument'>split_
set
</code>, <code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>flags</code>, <code class='datatype'>function</code>
(
:<code class='datatype'>string</code>
)
|
<
code class='datatype'>void<
/code>
<code class='argument'>feed</code><b>)</b></code></p></dd>
-
-
<dt class='head--doc'><span id='p-buffer'></span>Parameter <code class='parameter'>buffer</code></dt>
-
<dd></dd><dd class='body--doc'><p>The string to split
.</p>
+
<dd class='body--doc'><p>
Callbacks
are
also
set
by
<code>
set_callbacks
</code>
and
+
<code>
set
_
nonblocking
()</code>.</p>
</dd>
-
<dt class='head--doc'><
span
id
='
p
-
split_set
'><
/span
>
Parameter
<code
class=
'
parameter'
>
split
_
set
</code></
dt
>
-
<
dd
></
dd
>
<dd
class='body--doc'
><
p
>
The
character
or
characters
to
split
on
.</p>
+
<dt class='head--doc'>
Note
<
/dt>
+
<dd
class
='
body
-
-doc
'><
p
>
After
a callback has been called, it's disabled until it has
+
accessed the stream accordingly, i.e. the
<code>
write
_
cb
</code>
callback
+
is disabled after it's been called until something has been
+
written with
<
code>write<
/
code
>
, and the
<
code
>
write_oob_cb
</
code
>
callback is
+
likewise disabled until something has been written with
+
<
code
>
write_oob
<
/code
>
.
Since
the
data
already
has
been read when the read
+
callbacks are called, this effect is not noticeable for them
.</p>
</dd>
-
<dt class='head--doc'><
span id='p-flags'><
/
span>Parameter <code class='parameter'>flags</code></
dt>
-
<dd
></dd><dd
class='body--doc'><p>
Skip
empty
elements
if
set.</p>
+
<dt class='head--doc'>
Note
</dt>
+
<dd class='body--doc'><p>
Installing
callbacks
means
that
you will start doing I/O on the
+
stream from the thread running the backend. If you are running
+
these
set
functions from another thread you must be prepared
+
that the callbacks can be called immediately by the backend
+
thread, so it might not be safe to continue using the stream in
+
this thread
.</p>
+
<p> Because of that, it's useful to talk about "callback mode" when
+
any callback is installed. In callback mode the stream should be
+
seen as "bound" to the backend thread. For instance, it's only
+
the backend thread that reliably can end callback mode before
+
the stream is "handed over" to another thread.</p>
</dd>
-
<dt class='head--doc'><
span
id
='p-
feed
'></
span
>
Parameter
<
code
class='
parameter
'>
feed
</
code
></dt>
-
<dd></dd><dd class='body--doc'><p>
Callback
function
that
is
called
once
the
<
code
>
buffer
</
code
>
is
used up
-
and
the
SplitIterator
wants
more
data.
</p>
+
<dt class='head--doc'>
Note
<
/dt>
+
<dd
class
='
body--doc'><
p
>Callback mode has nothing to do with nonblocking mode
-
although
+
the two often are used together they don
'
t have to be.</p
>
+
</
dd
>
+
<dt
class='head--doc'>Note
<
/dt>
+
<dd
class='
body--doc
'><
p>The file object will stay referenced from the backend object as
+
long as there are callbacks that can receive events.<
/
p
>
+
</
dd>
+
<
dt
class='head--doc'
>
Bugs</dt>
+
<dd
class='body--doc'
><
p>Setting a close callback without a read callback currently only
+
works when there's no risk of getting more data on the stream.
+
Otherwise the close callback will be silently deregistered if
+
data arrives.<
/
p>
+
</
dd>
+
<
dt class='head--doc'>Note</dt>
+
<
dd class='body--doc'><p>
fs_event
callbacks
only trigger on systems
that
support
these
events.
+
Currently,
this includes systems that use kqueue, such as Mac OS X,
+
and various flavours of BSD.
<
/p
>
+
</
dd
>
+
<dt
class='head--doc'>See
also</dt>
+
<dd
class='body--doc'><p><code>set_callbacks</code>,
<code>set_nonblocking()</code>,
<code>set_id()</code>,
+
<code>set_backend</code>,
<code>query_read_callback</code>,
<code>query_write_callback</code>,
+
<code>query_read_oob_callback</code>,
<
code>query_write_oob_callback<
/
code>,
+
<code>query_close_callback</code></
p>
</dd></dl> <hr /> <dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Inherit</span>
-
<span class='homogen--name'><b>predef::Iterator</b></span>
-
</dt>
-
<dd><p><code><span class='datatype'>inherit predef::Iterator</span> : <span class='inherit'>predef::Iterator</span></code></p></dd>
-
</dl>
-
</dd></dl><dl><dt><h2 class='header'>Module <b class='ms datatype'>String.Elite</b></h2>
-
</dt><dd>
-
-
<hr />
-
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
elite
_
string
</b></span>
+
<span class='homogen--name'><b>
set
_
id
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
string
</code> <b><span class='method'>
elite
_
string
</span>(</b><code class='datatype'>
string
</code> <code class='argument'>
in
</code>
,
<
code class='datatype'>void</code>|<code class='datatype'>int(0..100)</code> <code class='argument'>leetp</code>, <code class='datatype'>void</code>|<code class='datatype'>bool</code> <code class='argument'>eightbit</code><
b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
set
_
id
</span>(</b><code class='datatype'>
mixed
</code> <code class='argument'>
id
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Translates
a
string
to
1337
. The
optional
-
argument
leetp
is the
maximum
percentage
of
-
leetness
(100=max
leet,
0=no leet).
<
/p
>
-
<
p
>
The translation
is
performed
in
three
steps,
-
first
the
neccesary
elite
translations
(picture
->
pic,
-
cool->kewl
etc),
then
optional
translations
-
(ok->k,
dude->dood,
-ers
-
>
-
orz),
then
-
calls elite
_
word on the resulting words.
</p>
+
<dd class='body--doc'><p>
This
function
sets
the
<tt>id</tt> of this file
. The
<tt>id</tt> is mainly
+
used
as
an identifier that
is
sent as
the
first
argument
to all
+
callbacks.
The
default
<
tt
>
id
<
/tt
>
is
<code
class='expr'>0</code>
(zero).
Another
possible
+
use
of
the
<tt>id</tt>
is
to
hold
all
data
related
to
this
file
in a
+
mapping
or
array.</p>
+
</dd>
+
<dt
class='head
--
doc'>See
also</dt>
+
<dd
class='body--doc'><p><code>query
_
id()
</
code></
p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
elite
_
word
</b></span>
+
<span class='homogen--name'><b>
set
_
nonblocking
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
string
</code> <b><span class='method'>
elite
_
word
</span>(</b><code class='
datatype
'>
string
</code> <code class='argument'>
in
</code>, <code class='datatype'>
void
</code>
|
<code class='datatype'>int
(0..100
)</code> <code class='argument'>
leetp
</code>, <code class='datatype'>
void
</code>
|
<code class='datatype'>int(
0..2
)</code> <code class='argument'>
eightbit
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
set
_
nonblocking
</span>(</b><code class='
object unresolved
'>
read_callback_t
</code> <code class='argument'>
read_callback
</code>, <code class='
object unresolved'>write_callback_t</code> <code class='argument'>write_callback</code>, <code class='
datatype'>
function
</code>
(
<code class='datatype'>
mixed</code>:<code class='datatype'>
int
</code>
)
<
code class='argument'>close_callback<
/code>
<b>)</b></code><br>
+
<code><code
class='datatype'>void
<
/
code
>
<b><span
class='
method'>set_nonblocking</span>(</b><code class='object unresolved'>read_callback_t</code> <code class='
argument'>
read_callback
</code>, <code class='
object unresolved'>write_callback_t</code> <code class='argument'>write_callback</code>, <code class='
datatype'>
function
</code>
(
<code class='datatype'>
mixed</code>:<code class='datatype'>
int
</code>) <code class='argument'>close_callback</code>, <code class='datatype'>function</code>
(
<code class='datatype'>mixed</code>, <code class='datatype'>string</code>:<code class='datatype'>int</code>
)
<
code class='argument'>read_oob_callback<
/code>
,
<code class='
datatype'>function</code>(<code class='datatype'>mixed</code>:<code class='datatype'>int</code>) <code class='
argument'>
write_oob_callback
</code><b>)</b></code><
br>
+
<code><code class='datatype'>void<
/
code> <b><span class='method'>set_nonblocking</span>(</b><b>)</b></code></
p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Translates
one
word
to
1337.
The
optional
-
argument
leetp
is
the
maximum percentage of
-
leetness
(100=max leet, 0=no leet)
.
-
elite_word
only
do character-based translation,
-
for instance from "k" to "|<", but no language
-
translation (no "cool" to "kewl").
<
/p>
-
</dd></dl>
-
</dd></dl><dl><dt><h2
class='
header
'>
Module
<
b class='ms datatype'>String.HTML<
/
b
>
</h2>
-
</dt><dd><dl
class='group--doc'>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Functions that helps generating HTML. All
functions
generates
-
HTML
that
is
XHTML compliant as well as backwards compatible
-
with old HTML standards in what extent is possible
.
</p>
-
</dd></dl>
-
-
<hr
/>
-
<dl
class='group--doc'>
-
<dt
class='head--type'><span
class='homogen--type'>Method</span>
-
<span
class='homogen--name'><b>pad_rows</b></span>
-
</dt>
-
<dd><p><code><code class='datatype'>array</code>(<code class='datatype'>array</code>(<code class='datatype'>string</code>)) <b><span class='method'>pad_rows</span>(</b><code class='datatype'>array</code>(<code class='datatype'>array</code>(<code class='datatype'>string</code>)) <code class='argument'>rows</code>
,
<code class='datatype'>void</code>|<code class='datatype'>string</code> <code class='argument'>padding</code><b>)</b></code></p></dd>
-
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Pads out
the
rows in a array of rows to equal length. The new elements in
-
the rows
will
have
the value provided in <code>padding</code>, or "&nbsp;"
.</p>
-
</dd></dl>
-
-
-
<hr />
-
<dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>select</b></span>
-
</dt>
-
<dd><p><code><code class='datatype'>string</code> <b><span class='method'>select</span>(</b><code class='datatype'>string</code> <code class='argument'>name</code>, <code class='datatype'>array</code>(<code class='datatype'>string</code>)|<code class='datatype'>array</code>(<code class='datatype'>array</code>(<code class='datatype'>string</code>)) <code class='argument'>choices</code>, <code class='datatype'>void</code>|<code class='datatype'>string</code> <code class='argument'>selected</code><b>)</b></code></p></dd>
-
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Creates an HTML select list.</p>
+
<dd class='body--doc'><p>
This
function
sets
a
stream
to
nonblocking
mode
and
installs
the
+
specified
callbacks
.
See
the
<
code
class='
expr
'>
set_*_callback
</
code
> functions
+
for
details
about
them
.
If
no
arguments
are
given
, the
callbacks
+
will
be
cleared
.</p>
</dd>
-
<dt class='head--doc'><
span id='p-name'><
/
span>Parameter <code class='parameter'>name</code></
dt>
-
<dd
></dd><dd
class='body--doc'><p>
The
name
of
the
select
list.
Will
be
used
in
the
name
attribute
-
of
the
select
element
.</p>
+
<dt class='head--doc'>
Note
</dt>
+
<dd class='body--doc'><p>
As
opposed
to
calling
the
set
callback
functions
separately,
+
this
function
will set all
the
callbacks
and nonblocking mode
+
atomically
so
that
no callback gets called in between. That
+
avoids races in case
the
backend
is executed by another thread
.</p>
</dd>
-
<dt class='head--doc'><
span id='p-choices'><
/
span>Parameter <code class='parameter'>choices</code></
dt>
-
<dd
></dd><dd
class='body--doc'><p>
May
either
be
an
array
of
strings,
where
each
string
is a choice
,
-
or
an
array
of
pairs
.
A
pair is an array with two strings
.
The
-
first
string
is
the
value of the choice while the second string
-
is
the presentation text associated with the value
.</p>
+
<dt class='head--doc'>
Note
</dt>
+
<dd class='body--doc'><p>
Out-of-band
data
was
not
be
supported
on
Pike
0.5
and
earlier
,
+
and
not
on
Pike
0
.
6
through
7
.
4
if
they
were
compiled
with
the
+
option
<tt>'--without-oob'</tt>
.</p>
</dd>
-
<dt class='head--doc'>
<span
id='p-selected'>
</
span>Parameter <code class='parameter'>selected</code></
dt>
-
<dd
></dd><dd
class='body--doc'><p>
The value that should be selected by default, if any.
<
/p
>
-
</
dd
>
-
<dt
class='head--doc'
>
Example
</
dt
>
-
<dd
class='example'>
<
pre
><
p
>
select("language"
,
-
(
{ ({ "eng"
,
"English" }
),
-
(
{ "swe"
,
"Swedish" }
)
,
-
(
{ "nor", "Norwegian" }
)
})
,
-
"swe"
)
;
</
p
>
-
</
pre
></dd></dl>
+
<dt class='head--doc'>
See
also
</dt>
+
<dd class='body--doc'><p>
<code>set_blocking()</code>
, <
code
>
set_callbacks
</
code
>
,
<
code
>
set_read_callback()
</
code
>
,
+
<
code
>
set_write_callback()
<
/code
>
,
<
code
>
set_read_oob_callback
(
)</code>
,
+
<code>set_write_oob_callback
()
</code>
,
<code>set_close_callback
()
</code>
+
<code>set_nonblocking_keep_callbacks
()
</code>
,
+
<code>set_blocking_keep_callbacks(
)</
code
></
p
>
+
</dd></dl>
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
simple_obox
</b></span>
+
<span class='homogen--name'><b>
tcgetattr
</b></span>
<br>
+
<span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>tcsetattr</b></span><br>
</dt>
-
<dd><p><code><code class='datatype'>
string
</code> <b><span class='method'>
simple_obox
</span>(</b><
code class='datatype'
>
array
</
code
>
(
<
code class='datatype'>array<
/code>
(
<
code class='datatype'
>
string
<
/
code>
))
<code class='
argument'>rows</code>, <code class='
datatype'>
void
</code>
|<code
class='datatype'>string
<
/code
>
<
code
class='
argument
'>
frame_color
</
code
>
,
<
code class='datatype'>void<
/
code
>
|
<code class='datatype'>
string
</code> <code class='argument'>
cell_color
</code>
,
<
code class='datatype'
>
void
</
code
>
|
<
code class='datatype'>string<
/code>
<
code class='argument'
>
width
<
/
code>
,
<code class='datatype'>
void
</code>
|<code
class='datatype'>string
<
/code
>
<
code
class='
argument
'>
padding
</
code
>
, <code class='datatype'>void</code>|<code class='datatype'>function</code>
(<
code class='datatype'>int<
/
code
>
,
<code class='datatype'>
int
</code>
,
<code class='
datatype
'>
string
</code>, <code class='datatype'>string</code>
:<code
class='datatype'>string
<
/
code
>)
<code
class='argument'>
cell_callback
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
mapping
</code> <b><span class='method'>
tcgetattr
</span>(</b><
b
>
)
</
b
></code><
br
>
+
<code><code class='datatype'>
int
</code> <
b
><
span
class='
method
'>
tcsetattr
</
span
>
(
</
b
><code class='datatype'>
mapping
</code> <code class='argument'>
attr
</code><
b
>
)
</
b
></code><
br
>
+
<code><code class='datatype'>
int
</code> <
b
><
span
class='
method
'>
tcsetattr
</
span
>(</
b
><code class='datatype'>
mapping
</code> <code class='
argument
'>
attr
</code>, <code class='datatype'>string</code> <code class='argument'>
when
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
This
function
should
solve
most
of
the
obox
needs
that
arises
.
It
-
creates
a
table
out
of
the
array
of
arrays
of
strings
fed
into
it
.
-
The
tables
will
(
with
default
settings)
have
a
thin
black
outline
-
around
the
table
and
between
its
cells
.
Much
effort
has
gone
into
-
finding
a
simple
HTML
reresentation
of
such
obox
that
is
rendered
-
in
a
similar
way
in
all
popular
browsers
. The
current
-
implementation
has been
tested
against
IE,
Netscape,
Mozilla
,
-
Opera
and
Konquest
.</p>
+
<dd class='body--doc'><p>
Gets/sets
term
attributes.
The
returned
value/the
<code>attr</code> parameter
+
is a mapping on
the
form</p>
+
<table
class='box'><tr><td><code><code
class='key'>"ispeed"</code>
: <code class='datatype'>int(-1
.
.)</code></code></td><td><p>In
baud rate.</p>
+
</td></tr>
+
<tr><td><code><code
class='key'>"ospeed"</code>
:
<code
class='datatype'>int(-1..)</code></code></td><td><p>Out
baud
rate.</p>
+
</td></tr>
+
<tr><td><code><code
class='key'>"csize"</code>
:
<code
class='datatype'>int(-1..-1)</code>|<code
class='datatype'>int(5..8)</code></code></td><td><p>Character
size
in
bits
.
</p>
+
</td></tr>
+
<tr><td><code><code
class='key'>"rows"</code> : <code class='datatype'>int</code></code></td><td><p>Terminal rows.</p>
+
</td></tr>
+
<tr><td><code><code class='key'>"columns"</code> : <code class='datatype'>int</code></code></td><td><p>Terminal columns.</p>
+
</td></tr>
+
<tr><td><code><code class='key'>flag_name</code> : <code class='datatype'>bool</code></code></td><td><p>
The
value
of
a named flag. The flag name is
+
the string describing the termios flags
(
IGNBRK,
BRKINT,
+
IGNPAR,
PARMRK, INPCK, ISTRIP, INLCR, IGNCR, ICRNL, IUCLC,
+
IXON, IXANY, IXOFF, IMAXBEL, OPOST, OLCUC, ONLCR, OCRNL,
+
ONOCR, ONLRET, OFILL, OFDEL, OXTABS, ONOEOT, CSTOPB, CREAD,
+
PARENB, PARODD, HUPCL, CLOCAL, CRTSCTS, ISIG, ICANON, XCASE,
+
ECHO, ECHOE, ECHOK, ECHONL, ECHOCTL, ECHOPRT, ECHOKE, FLUSHO,
+
NOFLSH, TOSTOP, PENDIN). See
the
manpage
for
termios
or
+
other documentation for more information
.
All
flags
are
not
+
available on all platforms.</p>
+
</td></tr>
+
<tr><td><code><code
class='key'>character_name</code>
:
<code
class='datatype'>int(8bit)</code></code></td><td><p>Sets
the
value
of
a
control
character
(VINTR,
VQUIT, VERASE,
+
VKILL,
VEOF, VTIME, VMIN, VSWTC, VSTART, VSTOP, VSUSP, VEOL,
+
VREPRINT, VDISCARD, VWERASE, VLNEXT, VEOL2). All control
+
characters are not available on
all
platforms.</p>
+
</td></tr>
+
</table><p>Negative
values are not allowed as indata, but might appear in the
+
result from <code>tcgetattr</code> when the actual value is unknown
.
<code>tcsetattr</code>
+
returns 0 if failed.</p>
+
<p>
The
argument <code>when</code> to <code>tcsetattr</code> describes when the
+
changes
are to take effect:</p>
+
<table class='box'><tr><td><code><code class='key'>"TCSANOW"</code></code></td><td><p>The change occurs immediately (default).</p>
+
</td></tr>
+
<tr><td><code><code class='key'>"TCSADRAIN"</code></code></td><td><p>The change occurs after all output
has been
written.</p>
+
</td></tr>
+
<tr><td><code><code
class='key'>"TCSAFLUSH"</code></code></td><td><p>The
change
occurs
after all output has been written
,
+
and
empties input buffers
.</p>
+
</td></tr>
+
</table>
</dd>
-
<dt class='head--doc'><span id='p-rows'></span>Parameter <code class='parameter'>rows</code></dt>
-
<dd></dd><dd class='body--doc'><p>Simply an array of arrays with strings. The strings are the
-
values that should appear in the table cells. All rows should
-
have equal number of cells, otherwise the result will not be
-
very eye pleasing.</p>
-
</dd>
-
<dt class='head--doc'><span id='p-frame_color'></span>Parameter <code class='parameter'>frame_color</code></dt>
-
<dd></dd><dd class='body--doc'><p>The color of the surrounding frame. Defaults to "#000000".</p>
-
</dd>
-
<dt class='head--doc'><span id='p-cell_color'></span>Parameter <code class='parameter'>cell_color</code></dt>
-
<dd></dd><dd class='body--doc'><p>The background color of the cells. Defaults to "#ffffff".</p>
-
</dd>
-
<dt class='head--doc'><span id='p-width'></span>Parameter <code class='parameter'>width</code></dt>
-
<dd></dd><dd class='body--doc'><p>The border width. Defaults to "1".</p>
-
</dd>
-
<dt class='head--doc'><span id='p-padding'></span>Parameter <code class='parameter'>padding</code></dt>
-
<dd></dd><dd class='body--doc'><p>The amount of padding in each cell. Defaults to "3".</p>
-
</dd>
-
<dt class='head--doc'><span id='p-cell_callback'></span>Parameter <code class='parameter'>cell_callback</code></dt>
-
<dd></dd><dd class='body--doc'><p>If provided, the cell callback will be called for each cell. As
-
in parameters it will get the current x and y coordinates in the
-
table. The upper left cell is 0,0. In addition to the
-
coordinates it will also receive the background color and the
-
contents of the current cell. It is expected to return a
-
td-element.</p>
-
</dd>
+
<dt class='head--doc'>Example</dt>
-
<dd class='example'><pre><p>
function
cb
=
lambda(int
x,
int
y, string bgcolor, string contents) {
-
if(y%2) return "
&
lt;td bgcolor='#aaaaff'&
gt;"
+contents+
"
</td>";
-
return "<td bgcolor='"+bgcolor+"'>"+contents+"</td>";
-
}
-
simple_obox(my_rows
,
"
#0000a0
"
,
0,
"
1
",
"
3
"
, cb
);</p>
+
<dd class='example'><pre><p>
//
setting
the
terminal
in
raw
mode:
+
Stdio.stdin-
>
tcsetattr(([
"
ECHO
"
:0
,"
ICANON
"
:
0,"
VMIN
"
:0
,"
VTIME
"
:0]
)
)
;</p>
</pre></dd>
-
<dt class='head--doc'>
See also
</dt>
-
<dd class='body--doc'><p><code>
pad_
rows</code></p>
+
<dt class='head--doc'>
Note
</dt>
+
<dd class='body--doc'><p>
Unknown flags are ignored by
<code>
tcsetattr()</code>. <code>tcsetattr</code> always
+
changes the attribute, so only include attributes that actually
+
should be altered in the attribute mapping.</p>
+
</dd>
+
<dt class='head--doc'>Bugs</dt>
+
<dd class='body--doc'><p>Terminal
rows
and columns setting by
<
code>tcsetattr()<
/code>
is not
+
currently supported.
</p>
</dd></dl>
-
<dl><dt><h2 class='header'>Class <b class='ms datatype'>
String
.
HTML.OBox
</b></h2>
+
<
/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>
Provides
the
same
functionality
as
the
<code>
simple_obox
</code>
function
,
-
in
a
"streaming"
way
.
The
real
gain
is
different
addtition
methods
-
as
well
as
the
possibility
to
change
the
cell
callback
at
any
time
.</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'>
See also
</dt>
-
<dd class='body--doc'><p>
simple_obox
</p>
+
<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 /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
add
_
cell
</b></span>
+
<span class='homogen--name'><b>_
get_iterator
</b></span>
</dt>
-
<dd><p><code><
code
class='
datatype
'>
void
</
code
> <
b><
span class='method'>
add_cell
</span>(</
b
><code class='
datatype
'>
string
</code> <code class='
argument
'>
contents
</code><b>)</b></code></p></dd>
+
<dd><p><code><
span
class='
class
'>
Stdio.FILE
</
span
> <span class='method'>
a
</span>
;<br>
+
foreach
(
a; index; value ) or
<
br><
/
code
><code
><code
class='
modifier
'>
protected
</code>
<code class='
datatype
'>
object
</code>
<b>
<span class='method'>_get_iterator</span>(</b><b>
)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Adds
a
cell
with
the
provided
content
.</p>
+
<dd class='body--doc'><p>
Returns
an
iterator
that
will loop over
the
lines
in this file
.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>line_iterator()</code></p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
add_raw_cell
</b></span>
+
<span class='homogen--name'><b>
getchar
</b></span>
</dt>
-
<dd><p><code><code class='
datatype
'>
void
</code> <
b><span
class='
method
'>
add_raw_cell
</
span
>
(
<
/
b><
code
class='
datatype
'>
string
</
code
>
<
code class='argument'>cell<
/
code
><b>)</b></code></p></dd>
+
<dd><p><code><code class='
modifier
'>
local
</code>
<
code
class='
datatype
'>
int
</
code
>
<b><
span
class='
method
'>
getchar
</
span
>
(
</
b
><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Adds
this
cell
to
the
table
unmodified,
e
.
g.
it
should
have
an
enclosing
-
td
or
th
element
.</p>
+
<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
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>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
add_row
</b></span>
+
<span class='homogen--name'><b>
gets
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
add_row
</span>(</b><code class='datatype'>
array
</code>
(
<code class='datatype'>
string
</code>
)
<code class='argument'>
cells
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
string
</code> <b><span class='method'>
gets
</span>(</b><code class='datatype'>
bool
</code>
|
<code class='datatype'>
void
</code> <code class='argument'>
not_all
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Adds
a
complete
row.
If
the
current
row
is
nonempty a
-
new row will be started
.</p>
-
</dd></dl>
-
-
-
<hr />
-
<dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>add_tagdata_cell</b></span>
-
</dt>
-
<dd><p><code><code class='datatype'>void</code> <b><span class='method'>add_tagdata_cell</span>(</b><code class='datatype'>string</code> <code class='argument'>tag</code>, <code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>string</code>) <code class='argument'>args</code>, <code class='datatype'>string</code> <code class='argument'>contents</code><b>)</b></code></p></dd>
-
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Creates a cell from the provided arguments and adds it to the table.</p>
+
<dd class='body--doc'><p>
Read
one
line
of
input
with
support
for
input
conversion
.</p>
</dd>
-
<dt class='head--doc'><span id='p-
tag
'></span>Parameter <code class='parameter'>
tag
</code></dt>
-
<dd></dd><dd class='body--doc'><p>
The
name
of
the
element
that
should
be
produces
.
Typically
-
"td"
or
"th"
.</p>
+
<dt class='head--doc'><span id='p-
not_all
'></span>Parameter <code class='parameter'>
not_all
</code></dt>
+
<dd></dd><dd class='body--doc'><p>
Set
this
parameter
to
ignore
partial
lines
at
EOF
.
This
+
is
useful
for eg monitoring a growing logfile
.</p>
</dd>
-
<dt class='head--doc'><
span
id
='
p
-
args
'><
/span
>
Parameter
<code class='
parameter
'>
args
</code>
</dt>
-
<dd></dd><dd
class='body--doc'><p>A
mapping
with
the
elements attributes
.</p>
+
<dt class='head--doc'>
Returns
<
/dt>
+
<dd
class
='
body
-
-doc
'><
p
>
This
function returns the line read if successful, and
<code class='
expr
'>
0
</code>
if
+
no
more
lines
are
available
.</p>
</dd>
-
<dt class='head--doc'><
span
id
='
p
-
contents
'><
/span
>
Parameter
<code
class='parameter'
>
contents
</code></
dt
>
-
<
dd
></
dd
>
<dd
class='body--doc'
><
p
>
The element contents.
</p>
+
<dt class='head--doc'>
See also
<
/dt>
+
<dd
class
='
body
-
-doc
'><
p
><code>
ngets()
</code>
,
<
code>read()<
/
code
>
,
<
code
>
line_iterator()
</
code
>
,
<
code
>
set_charset()
<
/code
></p>
</dd></dl> <hr /> <dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>
Method
</span>
-
<span class='homogen--name'><b>
cast
</b></span>
+
<dt class='head--type'><span class='homogen--type'>
Inherit
</span>
+
<span class='homogen--name'><b>
file
</b></span>
</dt>
-
<dd><p><code><
b>(</b><
span class='datatype'>
int</span><b>)</b><span
class='class'>String.HTML.OBox
</span>
()<br><b>(</b><span
class='datatype'>float</span><b>)</b><span
class='class'>String.HTML.OBox
<
/
span
>()<br><b>(</b><span
class='
datatype
'>
string
</span><
b>)<
/
b><span class='class'>String.HTML.OBox</span>()<br><b>(</b><span class='datatype'>array</span><b>)</b><span class='class'>String.HTML.OBox</span>()<br><b>(</b><span class='datatype'>mapping</span><b>)</b><span class='class'>String.HTML.OBox</span>()<br><b>(</b><span class='datatype'>multiset</span><b>)</b><span class='class'>String.HTML.OBox</span>()</
code></p></dd>
-
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>It is possible to case this object to a string, which does the same
-
as calling <code>render</code>, and to an array, which returns the cells in an
-
array of rows.</p>
-
</dd></dl>
-
-
-
<hr />
-
<dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>create</b></span>
-
</dt>
-
<dd><p><code><span class='object'>String.HTML.OBox</span> <span class='class'>String.HTML.OBox</span><b>(</b><code class='datatype'>void</code>|<code class='datatype'>string</code> <code class='argument'>frame_color</code>, <code class='datatype'>void</code>|<code class='datatype'>string</code> <code class='argument'>cell_color</code>, <code class='datatype'>void</code>|<code class='datatype'>string</code> <code class='argument'>width</code>, <code class='datatype'>void</code>|<code class='datatype'>string</code> <code class='argument'>padding</code>, <code class='datatype'>void</code>|<code class='datatype'>function</code>(<code class='datatype'>int</code>, <code class='datatype'>int</code>, <code class='datatype'>string</code>, <code class='datatype'>string</code>:<code class='datatype'>string</code>) <code class='argument'>cell_callback</code><b>)</b></code></p></dd>
+
<dd><p><code><span class='datatype'>
inherit
File
</span>
:
<span class='
inherit
'>
file
</span></code></p></dd>
</dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
new
_
row
</b></span>
+
<span class='homogen--name'><b>
line
_
iterator
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
new
_
row
</span>(</b><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
object
</code> <b><span class='method'>
line
_
iterator
</span>(</b><
code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>trim</code><
b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Begin
a
new
row
.
Succeeding
cells
will be
added
to this
-
row
instead
of
the
current
.</p>
+
<dd class='body--doc'><p>
Returns
an
iterator
that will loop over the lines in this file
.
+
If
<code>trim</code>
is true, all <tt>'\r'</tt> characters
will be
removed
+
from the input.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>It's not supported
to
call
this
method more than once
+
unless
a
call
to <code>seek</code> is done in advance. Also note that it's
+
not possible to intermingle calls to <code>read</code>, <code>gets</code> or other
+
functions that read data with
the
line iterator, it will produce
+
unexpected results since the internal buffer in the iterator will not
+
contain sequential file-data in those cases
.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>_get_iterator()</code></p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
pad_rows
</b></span>
+
<span class='homogen--name'><b>
ngets
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
pad_rows
</span>(</b><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
array
</code>
(<code
class='datatype'>string
<
/code>) <
b><span class='method'>
ngets
</span>(</b><
code class='datatype'>void</code>|<code class='datatype'>int(1..)</code> <code class='argument'>n</code>, <code class='datatype'>bool</code>|<code class='datatype'>void</code> <code class='argument'>not_all</code><
b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Ensures
that
all
rows
have
the
same
number
of
cells
.</p>
+
<dd class='body--doc'><p>
Get
<code>n</code>
lines.</p>
+
</dd>
+
<dt
class='head--doc'><span
id='p-n'></span>Parameter
<code
class='parameter'>n</code></dt>
+
<dd></dd><dd
class='body--doc'><p>Number
of
lines to get, or all remaining if zero
.</p>
+
</dd>
+
<dt class='head--doc'><span id='p-not_all'></span>Parameter <code class='parameter'>not_all</code></dt>
+
<dd></dd><dd class='body--doc'><p>Set this parameter to ignore partial lines at EOF. This
+
is useful for eg monitoring a growing logfile.</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
render
</b></span>
+
<span class='homogen--name'><b>
openat
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>string</code> <b><span class='method'>
render
</span>(</b><b>)</b></code></p></dd>
+
<dd><p><code><code class='
object unresolved'>FILE</code> <b><span class='method'>openat</span>(</b><code class='
datatype'>string</code> <
code class='argument'>filename</code>, <code class='datatype'>string</code> <code class='argument'>mode</code><
b>
)
<
/b></code><br>
+
<code><code class='object unresolved'>FILE</code> <b><
span class='method'>
openat
</span>(</b><
code class='datatype'>string</code> <code class='argument'>filename</code>, <code class='datatype'>string</code> <code class='argument'>mode</code>, <code class='datatype'>int</code> <code class='argument'>mask</code><
b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Returns
the
result
.</p>
+
<dd class='body--doc'><p>
Same
as
<code>Stdio
.
File()->openat()
</
code>, but returns an <code>Stdio.FILE</code>
+
object.</
p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>Stdio.File()->openat()</code></p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
set_cell_callback
</b></span>
+
<span class='homogen--name'><b>
pipe
</b></span>
</dt>
-
<dd><p><code><code class='
datatype
'>
void
</code> <b><span class='method'>
set_cell_callback
</span>(</b><code class='datatype'>
function
</code>
(
<code class='datatype'>int</code>
,
<code class='
datatype'>int</code>, <code class='datatype'>string</code>, <code class='datatype'>string</code>:<code class='datatype'>string</code>) <code class='
argument'>
cell_callback
</code><b>)</b></code></p></dd>
-
</dl>
+
<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>
-
-
<hr />
-
<dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>set_extra_args</b></span>
-
</dt>
-
<dd><p><code><code class='datatype'>void</code> <b><span class='method'>set_extra_args</span>(</b><code class='datatype'>array</code>(<code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>string</code>)) <code class='argument'>extra_args</code><b>)</b></code></p></dd>
-
+
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
The
argument
in
the
mappings
will
be
added
to
the cell in the
-
cooresponding column of the table
.</p>
+
<dd class='body--doc'><p>
Same
as
<code>Stdio.File()->pipe()</code>,
but
returns
an
<code>Stdio.FILE</code>
+
object.</p>
+
</dd>
+
<dt
class='head--doc'>See
also</dt>
+
<dd
class='body--doc'><p><code>Stdio
.
File()->pipe()
</
code></
p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
set_extra_args
</b></span>
+
<span class='homogen--name'><b>
printf
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
set_extra_args
</span>(</b><code class='datatype'>
mapping
</code>
(
<code class='
datatype
'>
string
</code>
:
<code class='datatype'>
string
</code>
)
<code class='argument'>
extra_args
</code><b>)</b></code></p></dd>
+
<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>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
The
argument
in
the
mapping
will
be
added
to
all
created
table cells.
</p>
+
<dd class='body--doc'><p>
This
function
does
approximately
the
same
as:
+
<code
class='expr'><code>write</code>(<code>sprintf</code>(<code>format</code>,@<code>data</code>))</code>.</p>
+
</dd>
+
<dt
class='head--doc'>See
also</dt>
+
<dd
class='body--doc'><p><code>write()</code>,
<
code>sprintf()<
/
code></
p>
</dd></dl>
-
</dd></dl></dd></dl></dd></dl><dl><dt><h2 class='header'>Module <b class='ms datatype'>Array</b></h2>
-
</dt><dd><dl class='group--doc'>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>General functions to operate on arrays.</p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
all
</b></span>
+
<span class='homogen--name'><b>
read
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
bool
</code> <b><span class='method'>
all
</span>(</b><code class='datatype'>
array
</code>
<code class='
argument
'>
a
</code>
,
<code class='
datatype
'>
function
</code>
(<code class='datatype'>int(0..0)</code>
, <code class='datatype'>
mixed
</code>
... :
<code class='datatype'>
mixed
</code>
)
<code class='argument'>
predicate
</code>
,
<
code class='datatype'>mixed</code> ... <code class='argument'>extra_args</code><
b>)</b></code></p></dd>
+
<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>
Returns
1 if all of the elements in
<code>
a
</code>
fulfills the requirement
-
<code>predicate</code>
(
<code>a</code>[<i>i</i>], @<code>extra_args</code>
)
,
otherwise
0.
The
-
predicate
should
return non-zero
for
an element that meets the
-
requirements
and zero for those that do not
.</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'>Example</dt>
-
<dd class='example'><pre><p>Array.all( ({ 2, 4, 6, 8 }), `<, 17 )</p>
-
</pre></dd>
+
<dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>
any
</code>, <code>
has
_
value
</code></p>
+
<dd class='body--doc'><p><code>
Stdio.File()->read()
</code>, <code>
set
_
charset()
</code>
,
<
code>unread()<
/
code></
p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
any
</b></span>
+
<span class='homogen--name'><b>
set_charset
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
bool
</code> <b><span class='method'>
any
</span>(</b><code class='datatype'>
array
</code>
<code class='
argument'>a</code>, <code class='
datatype'>
function
</code>
(<code
class='datatype'>int(0..0)
<
/
code
>,
<code
class='
datatype'>mixed</code> ... :<code class='datatype'>mixed</code>) <code class='
argument'>
predicate
</code>
,
<
code class='datatype'>mixed</code> ... <code class='argument'>extra_args</code><
b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
set_charset
</span>(</b><code class='datatype'>
string
</code>
|
<code class='datatype'>
void
</code> <code class='argument'>
charset
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Returns
1
if
any
of
the
elements
in
<code>a</code>
fulfills
the
requirement
-
<code>
predicate
</code>
(
<code>a</code>[<i>i</i>],
@
<code>
extra_args
</code>
),
otherwise
0
.
The
-
predicate
should
return
non-zero
for
an
element
that
meets
the
-
requirements
and
zero
for
those
that
do
not.</p>
-
</dd>
-
<dt class='head--
doc
'>
Example
</dt>
-
<dd class='
example
'><
pre
><
p
>
Array.any
( (
{
2,
4,
6,
8
}
)
,
`>,
5
)</
p
>
-
</
pre
></
dd
>
-
<
dt
class='head
--
doc'
>
See
also
</
dt
>
-
<
dd
class='body
--
doc'
><
p
><
code
>
all
</
code
>
,
<
code
>
has_value
</
code
></p>
+
<dd class='body--doc'><p>
Sets
the
input
and
output
charset
of
this
file
to
the
specified
+
<code>
charset
</code>
.
If
<code>
charset
</code>
is
0
or not specified the environment
+
is
used
to
try
to
detect
a
suitable
charset.</p>
+
<p>
The
default
charset
if
this
function
is
not
called is
+
<tt>"ISO-8859-1"</tt>
.</p>
+
</dd><dt class='head--
fixme
'>
FIXME
</dt>
+
<dd class='
body--fixme
'><
p
>
Consider using one of
+
ISO-IR-196 (
<
tt
>
"\e%G"</tt> - switch to UTF-8 with return)
+
or ISO-IR-190
(
<tt>"\e%/G"</tt>
- switch to UTF-8 level 1 no return)
+
or ISO-IR-191
(
<tt>"\e%/H"</tt>
- switch to UTF-8 level
2
no
return)
+
or ISO-IR-192 (<tt>"\e%/I"</tt> - switch to UTF-
8
level 3 no return
)
+
or ISO-IR-193 (
<
tt>"\e%
/
J"</tt
>
- switch to UTF-16 level 1 no return)
+
or ISO-IR-194 (
<
tt>"\e%
/
K"</tt
>
- switch to UTF-16 level 2 no return)
+
or ISO-IR-195 (
<
tt>"\e%
/
L"</tt
>
- switch to UTF-16 level 3 no return)
+
or ISO-IR-162 (
<
tt>"\e%/@"</tt>
-
switch to UCS
-
2 level 1)
+
or ISO-IR-163 (<tt
>
"\e%/A"</tt>
- switch to UCS-4 level 1)
+
or ISO-IR-174 (
<
tt>"\e%
/
C"</tt
>
- switch to UCS-2 level 2)
+
or ISO-IR-175 (
<
tt>"\e%/D"</tt>
-
switch to UCS
-
4 level 2)
+
or ISO-IR-176 (<tt
>
"\e%/E"
<
/tt
>
- switch to UCS-2 level 3)
+
or ISO-IR-177 (
<
tt
>
"\e%/F"
</
tt
>
- switch to UCS-4 level 3)
+
or ISO-IR-178 (
<
tt
>
"\e%B"
</
tt
>
- switch to UTF-1)
+
automatically to encode wide strings.
</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
arrayify
</b></span>
+
<span class='homogen--name'><b>
ungets
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
array
</code> <b><span class='method'>
arrayify
</span>(</b><code class='datatype'>
void
</code>
|<code
class='datatype'>array
<
/
code
>|<code
class='
datatype'>mixed</code> <code class='
argument'>
x
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
ungets
</span>(</b><code class='datatype'>
string
</code> <code class='argument'>
s
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Make
an
array
of
the
argument,
if
it isn't already. An undefined
-
argument gives
the
empty
array
.
This
is useful when something is
-
either
an
array
or
a
basic
datatype
,
for
instance in headers from
-
the MIME module
or
Protocols
.
HTTP.Server.
</p>
+
<dd class='body--doc'><p>
This
function
puts
a
line
back
in
the
input
buffer
.
The
line
+
can
then
be
read
with
eg
<code>read()</code>
,
<code>gets()</code>
or
<code>getchar()</code>
.</p>
</dd>
-
<dt class='head--doc'><
span id='p-x'><
/
span>Parameter <code class='parameter'>x</code></
dt>
-
<dd
></dd><dd
class='body--doc'><p>
Result
depends
of
the
argument
type:</p>
-
<dl
class='group
-
-doc'>
<
dt>arrayp(x)<
/
dt>
-
<dd><
p>
arrayify(x) => x</p>
+
<dt class='head--doc'>
Note
</dt>
+
<dd class='body--doc'><p>
The
string
is
autoterminated
by
an
extra line
-
feed.
</p>
</dd>
-
<dt>
undefinedp(x)
</dt>
-
<dd><p>
arrayify
(
x
)
=>
(
{}
)</
p
>
-
<
/dd
>
-
<
dt>otherwise<
/
dt
>
-
<
dd
>
<p>arrayify
(
x
)
=> ({ x })
</
p
>
-
</
dd
>
-
</dl>
+
<dt
class='head--doc'
>
See also
</dt>
+
<dd
class='body--doc'
><p>
<code>read
()
</code>,
<code>gets
()</
code
>
,
<
code
>
getchar()
</
code
>
,
<
code
>
unread
()</
code
></
p
>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
columns
</b></span>
+
<span class='homogen--name'><b>
unread
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
array
</code>
(<code
class='datatype'>array
<
/code>) <
b><span class='method'>
columns
</span>(</b><code class='datatype'>
array
</code> <code class='argument'>
x
</code>
,
<
code class='datatype'>array</code> <code class='argument'>ind</code><
b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
unread
</span>(</b><code class='datatype'>
string
</code> <code class='argument'>
s
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Get
multiple
columns
from
an
array.</p>
-
<p>
This
function
is
equvivalent
to
-
<pre>
-
map(ind,
lambda(mixed
i)
{
return column
(
x
,
i
)
;
})
-
</
pre
></p>
+
<dd class='body--doc'><p>
This
function
puts
a
string
back
in
the
input
buffer.
The
string
+
can
then
be
read
with
eg
<code>read
(
)</code>
,
<code>gets(
)
</code>
or
<
code>getchar()<
/
code
>
.
</p>
</dd> <dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>
column
()</code></p>
+
<dd class='body--doc'><p><code>
read
()</code>
,
<
code>gets()<
/
code>, <code>getchar()</code>, <code>ungets()</code></
p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
combinations
</b></span>
+
<span class='homogen--name'><b>
write
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
array
</code>
(
<
code
class='
datatype
'>
array
</
code
>
)
<b><
span
class='
method
'>
combinations
</
span
>(</
b
><code class='datatype'>
array
</code> <code class='argument'>
arr
</code>, <code class='datatype'>
int
</code> <code class='argument'>
len
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
int
</code>
<
b><span
class='
method
'>
write
</
span
>
(
<
/
b><
code
class='
datatype
'>
array
</
code
>(<
code class='datatype'>string<
/
code
>
)|
<code class='datatype'>
string
</code> <code class='argument'>
what
</code>, <code class='datatype'>
mixed
</code>
...
<code class='argument'>
fmt
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Returns
an array of all combinations of length
<code>
len
</code>
of
-
elements
from
<code>arr</code>
.</p>
+
<dd class='body--doc'><p>
Write
<code>
what
</code>
with
support
for
output_conversion
.</p>
</dd> <dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>
permute
()</code></p>
+
<dd class='body--doc'><p><code>
Stdio.File
()
->write()
</code></p>
</dd></dl>
-
+
</dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>Stdio.Port</b></h2>
+
</dt><dd><dl class='group--doc'>
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Handles listening to socket ports. Whenever you need a bound
+
socket that is open and listens for connections you should
+
use this program.</p>
+
</dd></dl>
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
common_prefix
</b></span>
+
<span class='homogen--name'><b>
accept
</b></span>
</dt>
-
<dd><p><code><code class='
datatype
'>
array
</code> <b><span class='method'>
common_prefix
</span>(</b><
code class='datatype'>array</code>(<code class='datatype'>array</code>) <code class='argument'>arrs</code><
b>)</b></code></p></dd>
+
<dd><p><code><code class='
object unresolved
'>
File
</code> <b><span class='method'>
accept
</span>(</b><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Find
the
longest
common
prefix
from
an
array
of
arrays
.</p>
+
<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
+
<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>
String
.
common_prefix
</code></p>
+
<dd class='body--doc'><p><code>
Stdio
.
File
</code></p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
compact_diff3
</b></span>
+
<span class='homogen--name'><b>
accept
</b></span>
</dt>
-
<dd><p><code><code class='
datatype'>array</code>(<code
class=
'
datatype'
>
array
</code>
(<code
class='datatype'>array
<
/code>)) <
b><span class='method'>
compact_diff3
</span>(</b><
code class='datatype'>array</code> <code class='argument'>a</code>, <code class='datatype'>array</code> <code class='argument'>
b
</code
>
, <code class='datatype'>array</code> <code class='argument'>old</code><b>
)</b></code></p></dd>
+
<dd><p><code><code class='
object
unresolved
'>
Stdio.File
</code> <b><span class='method'>
accept
</span>(</b><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Given
three
arrays
like
those
returned
from
<
code
>
diff3
<
/code
>
,
this
-
function
"compacts"
the
diff3
result
by
removing
all
differences
-
where
<tt>a</tt>
and
<tt>b</tt>
agrees
against
<
tt
>
old
<
/tt
>
.
The
result
is
-
on
the
same
form
as
the
result
from
<code>
diff
</code>
,
and
doesn
'
t
-
include
the
sequence
from
<tt>old</tt>
.</p>
+
<dd class='body--doc'><p>
Get
the
first
connection
request
waiting
for
this port and return
+
it as a connected socket.
<
/p
>
+
<
p
>
If
no
connection
request is waiting and
the
port
is
in
nonblocking
+
mode
(i.e. an accept callback is installed) then zero is returned.
+
Otherwise
this function waits until
a
connection
has arrived.
<
/p
>
+
<
p
>
In
Pike
7
.
8
and
later
the
returned
object
is
created
via
<code>
fd_factory()
</code>
.</p>
+
</dd>
+
<dt
class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>In Pike 7.7
and
later the resulting file object will be assigned
+
to
the
same
backend
as the port object
.</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
count
</b></span>
+
<span class='homogen--name'><b>
bind
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>int</code> <b><span class='method'>
count
</span>(</b><code class='datatype'>
array
</code>|<code class='datatype'>
mapping
</code>
|
<code class='
datatype
'>
multiset
</code> <code class='
argument
'>
haystack
</code>
,
<code class='datatype'>
mixed
</code>
<code class='
argument
'>
needle
</code>
<b>
)<
/b></
code
><br>
-
<code><code
class='
datatype
'>
mapping
</code>
(
<code class='datatype'>
mixed
</code>
:
<code class='datatype'>
int
</code>
)
<
b><span class='method'>count</span>(</b><
code class='
datatype
'>
array
</code>
|
<code class='datatype'>
mapping
</code>|<code class='datatype'>
multiset
</code> <code class='argument'>
haystack
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>int</code> <b><span class='method'>
bind
</span>(</b><code class='datatype'>
int
</code>|<code class='datatype'>
string
</code>
<code class='
argument
'>
port
</code>
,
<code class='
datatype
'>
void
</code>
|
<code class='datatype'>
function
</code>
(:
<code class='
datatype void
'>
void
</code>)
<code class='
argument
'>
accept_callback
</code>
,
<code class='datatype'>
void
</code>
|
<code class='datatype'>
string
</code> <code class='
argument
'>
ip
</code>
,
<code class='datatype'>
void
</code>|<code class='datatype'>
string
</code> <code class='argument'>
reuse_port
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Returns
the
number
of
occurrences
of
<code>
needle
</code>
in
<
code>haystack<
/
code
>
.
-
If the optional <code>
needle
</code>
argument
is
omitted
, <code>
count
</code>
instead
-
works
similar
to
the
unix
command
<tt>sort|uniq
-c</tt>,
returning
-
a
mapping
with
the
number
of
occurrences
of
each
element
in
-
<
code
>
haystack
<
/code
>
.
For
array
or
mapping
<
code
>
haystack
<
/code
>
s,
it's
the
values
-
that
are
counted,
for
multisets
the
indices,
as
you'd
expect
.</p>
+
<dd class='body--doc'><p>
Opens
a
socket and binds it to port
number
on
the
local
machine.
+
If the second argument is present, the socket is set to
+
nonblocking and the callback funcition is called whenever
+
something connects to it. The callback will receive the id for
+
this port as argument and should typically call
<code>
accept
</code>
to
+
establish a connection.
<
/p
>
+
<
p
> If the optional
argument
<code>
ip
</code> is
given
, <code>
bind
</code>
will try to bind
+
to
an
interface
with
that
host
name
or
IP
number.
Omitting this
+
will
bind
to
all
available
IPv4
addresses;
specifying
"::"
will
+
bind
to
all
IPv4
and
IPv6 addresses.
<
/p
>
+
<
p
>
If
the
OS
supports
TCP_FASTOPEN it is enabled automatically.
<
/p
>
+
<
p
>
If
the
OS
supports
SO_REUSEPORT
it
is
enabled
if
the
fourth
argument
is
true
.</p>
</dd>
-
+
<dt class='head--doc'>Returns</dt>
+
<dd class='body--doc'><p>1 is returned on success, zero on failure. <code>errno</code> provides
+
further details about the error in the latter case.</p>
+
</dd>
<dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>
String.count
</code>, <code>
search</code>, <code>has
_
value
</code></p>
+
<dd class='body--doc'><p><code>
accept
</code>, <code>
set
_
id
</code></p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
diff
</b></span>
+
<span class='homogen--name'><b>
bind_unix
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
array
</code>
(
<
code
class='
datatype
'>
array
</
code
>(<code class='datatype'>
array
</code>
))
<
b><span
class='
method
'>
diff
</
span
>
(
<
/b><
code class='datatype'>
array
</code>
<code class='
argument
'>
a
</code>
,
<code class='datatype'>
array
</code> <code class='argument'>
b
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
int
</code>
<
b><span
class='
method
'>
bind_unix
</
span
>(<
/b><
code class='datatype'>
string
</code> <
code
class='
argument
'>
path
</
code
>
,
<code class='datatype'>
void
</code>
|
<code class='
datatype
'>
function
</code>
(:
<code class='datatype
void
'>
void
</code>
)
<code class='argument'>
accept_callback
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Calculates
which
parts
of
the
arrays
that
are
common
to
both
, and
-
which
parts
that
are
not
.</p>
+
<dd class='body--doc'><p>
Opens
a
Unix
domain
socket at
the
given
path
in
the
file
system.
+
If the second argument is present
,
the socket is set to
+
nonblocking
and
the callback funcition is called whenever
+
something
connects
to
it.
The
callback
will receive the id for
+
this port as argument and should typically call <code>accept</code> to
+
establish a connection
.</p>
</dd> <dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>
Returns
an
array
with
two elements
,
the
first
is
an array of parts in
-
array
<code>
a
</code>
,
and
the
second
is
an
array
of
parts
in
array
<code>b</code>
.</p>
+
<dd class='body--doc'><p>
1
is
returned
on
success
,
zero
on
failure.
<code>
errno
</code>
provides
+
further
details
about
the
error
in
the
latter case
.</p>
</dd>
-
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>This function is only available on systems that support Unix domain
+
sockets.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p><code>path</code> had a quite restrictive length limit (~100 characters)
+
prior to Pike 7.8.334.</p>
+
</dd>
<dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>
diff_compare_table()
</code>, <code>
diff
_
longest_sequence()
</code>
,
-
<
code>String.fuzzymatch()<
/
code></
p>
+
<dd class='body--doc'><p><code>
accept
</code>, <code>
set
_
id
</code></p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
diff3
</b></span>
+
<span class='homogen--name'><b>
close
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
array
</code>
(<code
class='datatype'>array
<
/code>(<code class='datatype'>array</code>)) <
b><span class='method'>
diff3
</span>(</b><
code class='datatype'>array</code> <code class='argument'>a</code>, <code class='datatype'>array</code> <code class='argument'>
b
</code
>
, <code class='datatype'>array</code> <code class='argument'>c</code><b>
)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
close
</span>(</b><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Return
the
three-way difference between the arrays
.</p>
-
</dd>
-
<dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>Array.diff()</code>, <code>Array.diff_longest_sequence()</code></p>
+
<dd class='body--doc'><p>
Closes
the
socket
.</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
diff_compare_table
</b></span>
+
<span class='homogen--name'><b>
create
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
array
</code>
(
<code class='datatype'>
array
</code>(<code class='datatype'>int</code>)
)
<b><span class='
method
'>
diff_compare_table
</span>(</b><code class='datatype'>
array
</code> <code class='argument'>
a
</code>, <code class='datatype'>
array
</code> <code class='argument'>b</code><b>)</b></code></p></dd>
+
<dd><p><code><
span class='object'>Stdio.Port</span> <span class='class'>Stdio.Port</span><b>(</b><b>)</b></
code
><br>
+
<code><span
class='
object'>Stdio.Port</span> <span class='class'>Stdio.Port</span><b>(</b><code class='
datatype'>
int
</code>
|
<code class='datatype'>
string
</code>
<code class='argument'>port</code><b>)</b></code><br>
+
<code><span class='object'>Stdio.Port</span> <span class='class'>Stdio.Port</span><b>
(<
/b><
code class='datatype'>int</code>
|<code class='datatype'>string</code> <code class='argument'>port</code>, <code class='datatype'>function</code>(:<code class='datatype void'>void</code>
) <
code class='argument'>accept_callback</code><
b>
)
<
/b></code><br>
+
<code><
span class='
object
'>
Stdio.Port
</span>
<span class='class'>Stdio.Port</span><b>
(</b><code class='datatype'>
int
</code>
|<code
class='datatype'>string
<
/
code
>
<code
class='argument'>
port
</code>, <code class='datatype'>
function
</code>
(:<code
class='datatype void'>void
<
/
code
>)
<code
class='argument'>
accept_callback</code>, <code class='datatype'>string</code> <code class='argument'>ip</code><
b
>)
</
b></
code><
br>
+
<code><span class='object'>Stdio.Port</span> <span class='class'>Stdio.Port</span><
b>
(</b><code class='argument'>"stdin"</code><b>
)</b></code><
br>
+
<code><span class='object'>Stdio.Port<
/
span> <span class='class'>Stdio.Port</span><b>(</b><code class='argument'>"stdin"</code>, <code class='datatype'>function</code>(:<code class='datatype void'>void</code>) <code class='argument'>accept_callback</code><b>)</b></code></
p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Returns
an
array
which
maps
from
index
in
<code>
a
</code>
to
corresponding
-
indices
in
<code>
b
</code>.</p>
-
<p>
<pre>
-
>
Array.diff_compare_table(
({
"a","b","c"
}),
({
"
b
"
,
"b",
"c",
"d",
"b" }));
-
Result: ({
-
({ })
,
-
({
-
0
,
-
1,
-
4
-
})
,
-
({
-
2
-
})
-
})
-
</
pre
></p>
+
<dd class='body--doc'><p>
If
the
first
argument
is
other
than
<code
class='expr'
>
"stdin"
</code>
the
arguments will
+
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
it
actually
is
a
socket
to
begin
with
,
and
is
equivalent
to
+
creating
a
port
and
initializing
it
with
<
code>listen_fd<
/
code
>
(0).
</p>
</dd> <dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>
diff()
</code>
,
<
code>diff_longest_sequence()<
/
code>, <code>String.fuzzymatch()</code></
p>
+
<dd class='body--doc'><p><code>
bind
</code></p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
diff_dyn_longest_sequence
</b></span>
+
<span class='homogen--name'><b>
create
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
array
</code>(<code class='datatype'>
int
</code>) <b><span class='
method
'>
diff_dyn_longest_sequence
</span>(</b><code class='
datatype
'>
array
</code> <code class='
argument
'>
a
</code>
,
<code class='datatype'>
array
</code> <code class='argument'>
b
</code><b>)</b></code></p></dd>
+
<dd><p><code><
span class='object'>Stdio.Port</span> <span class='class'>Stdio.Port</span><b>(</b><
code class='datatype'>
int
</code>
|<code class='datatype'>string</code> <code class='argument'>port</code>, <code class='datatype'>void</code>|<code class='datatype'>function</code>
(
:
<code class='datatype
void
'>
void
</code>) <
code class='argument'>accept_callback</code>, <code class='datatype'>void</code>|<code class='datatype'>string</code> <code class='argument'>ip</code><
b>
)
<
/b></code><br>
+
<code><
span class='
object
'>
Stdio.Port
</span>
<span class='class'>Stdio.Port</span><b>
(</b><code class='
argument
'>
"stdin"
</code>
,
<code class='
datatype
'>
void
</code>
|<code
class='datatype'>function
<
/
code
>(:<code
class='datatype
void
'>
void
</code>
)
<code class='argument'>
accept_callback
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Gives
the
longest
sequence
of
indices
in
<code>
b
</code>
that have corresponding
-
values
in
the same
order
in
<code>
a
</code>.</p>
-
<p>
This
function performs the same operation as
<code>
diff_longest_sequence()
</code>,
-
but
uses
a
different
algorithm
,
which
in
some
rare
cases
might
be
faster
-
(usually
it
's
slower
though
).</p>
+
<dd class='body--doc'><p>
When
called
with
an
int
or
any
string except
<code
class='expr'
>
"stdin"
</code>
as
+
first
argument,
this
function
does
the same
as
<code>
bind()
</code>
would do
+
with the same arguments
.</p>
+
<p>
When
called
with
<code
class='expr'
>
"stdin"
</code>
as argument
,
a socket is created
+
out
of
the
file
descriptor 0. This is only useful if that actually
+
IS
a
socket
to begin with
,
and
is
equivalent
to
creating
a
port
and
+
initializing
it
with
<code>listen_fd</code>(0
).</p>
</dd> <dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>
diff_longest_sequence()
</code>, <code>
diff()</code>, <code>diff
_
compare_table()
</code>
,
-
<
code>String.fuzzymatch()<
/
code></
p>
+
<dd class='body--doc'><p><code>
bind
</code>, <code>
listen
_
fd
</code></p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
diff_longest_sequence
</b></span>
+
<span class='homogen--name'><b>
errno
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
array</code>(<code class='datatype'>
int</code>
)
<b><span class='method'>
diff_longest_sequence
</span>(</b><
code class='datatype'>array</code> <code class='argument'>a</code>, <code class='datatype'>array</code> <code class='argument'>
b
</code
>
<b>
)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>int</code> <b><span class='method'>
errno
</span>(</b><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Gives
the
longest
sequence
of
indices
in
<code>b</code>
that
have
corresponding
-
values
in
the
same
order
in
<code>a</code>.</p>
-
</dd>
-
<dt
class='head--doc'>See
also</dt>
-
<dd
class='body--doc'><p><code>diff()</code>,
<code>diff_compare_table()</code>,
<code>String
.
fuzzymatch()
</
code></
p>
+
<dd class='body--doc'><p>
If
the
last
call
done
on
this
port
failed,
this
function will
+
return
an
integer
describing
what
went
wrong.
Refer
to
your
unix
+
manual
for
further information
.</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
dwim
_
sort_func
</b></span>
+
<span class='homogen--name'><b>
fd
_
factory
</b></span>
</dt>
-
<dd><p><code><code class='
datatype
'>
int(-1..1)
</code>
<b><span
class='method'>dwim_sort_func
<
/span>(</b><
code class='
datatype
'>
string
</code> <
code class='argument'
>
a
<
/code>,
<code
class='
datatype
'>
string
</
code
>
<
code class='argument'>b<
/
code
><b>)</b></code></p></dd>
+
<dd><p><code><code class='
modifier
'>
protected
</code> <code class='
object unresolved
'>
Fd
</code> <
b
><
span
class='
method
'>
fd_factory
</
span
>
(
<
/
b><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Sort
without
respect
to
number
formatting
(
most
notably
leading
-
zeroes)
.</p>
+
<dd class='body--doc'><p>
Factory
creating
empty
<code>Fd</code>
objects.</p>
+
<p>
This
function is called by <code>accept
(
)</code>
when
it needs to create
+
a new file
.</p>
</dd></dl> <hr /> <dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>
Method
</span>
-
<span class='homogen--name'><b>
everynth
</b></span>
+
<dt class='head--type'><span class='homogen--type'>
Inherit
</span>
+
<span class='homogen--name'><b>
_port
</b></span>
</dt>
-
<dd><p><code><
code
class='datatype'>
array</code>(<code
class='datatype'>mixed
</
code
>
)
<
b><
span class='
method
'>
everynth
</span>
(
</
b><
code
class='datatype'
>
array
</
code
>
(
<
code class='datatype'>mixed<
/
code
>
)
<
code class='argument'>a<
/
code
>
, <code class='datatype'>void</code>|<code class='datatype'>int</code> <code class='argument'>n</code>, <code class='datatype'>void</code>|<code class='datatype'>int</code> <code class='argument'>start</code><b>)</b></code></p></dd>
+
<dd><p><code><
span
class='datatype'>
inherit
_port
</
span
>
:
<span class='
inherit
'>
_port
</span></code></
p
></
dd
>
+
</
dl
>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Return an array with every <code>n</code>:th element of the array <code>a</code>.</p>
-
<p> If <code>n</code> is zero every other element will be returned.</p>
-
</dd>
-
<dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>splice()</code>, <code>`/()</code></p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
flatten
</b></span>
+
<span class='homogen--name'><b>
listen_fd
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
array
</code> <b><span class='method'>
flatten
</span>(</b><code class='datatype'>
array
</code> <code class='argument'>
a
</code>, <code class='datatype'>
mapping
</code>
(
<code class='datatype'>
array
</code>:<code class='datatype
'>array</code>)|<code
class=
'
datatype'
>void</code> <code class='argument'>
state
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
int
</code> <b><span class='method'>
listen_fd
</span>(</b><code class='datatype'>
int
</code> <code class='argument'>
fd
</code>, <code class='datatype'>
void
</code>
|
<code class='datatype'>
function
</code>
(
:<code class='datatype
void
'>void</code>
)
<code class='argument'>
accept_callback
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Flatten
a
multi-dimensional
array
to a
one-dimensional
array
.</p>
+
<dd class='body--doc'><p>
This
function does the same as <code>bind</code>, except that instead of
+
creating
a
new
socket
and bind it
to a
port,
it expects the file
+
descriptor <code>fd</code> to be an already open port
.</p>
</dd> <dt class='head--doc'>Note</dt>
-
<dd class='body--doc'><p>
Prior
to
Pike
7.5.7
it
was
not
safe
to
call
this
function
-
with
cyclic
data-structures
.</p>
+
<dd class='body--doc'><p>
This
function
is
only
for
the
advanced
user,
and
is
generally
used
+
when
sockets
are
passed to Pike at exec time
.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>bind</code>, <code>accept</code></p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
greedy
_
diff
</b></span>
+
<span class='homogen--name'><b>
query
_
address
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
array
</code>
(<code
class='datatype'>array
<
/code>(<code class='datatype'>array</code>)) <
b><span class='method'>
greedy
_
diff
</span>(</b><
code class='datatype'>array</code> <code class='argument'>from</code>, <code class='datatype'>array</code> <code class='argument'>to</code><
b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
string
</code> <b><span class='method'>
query
_
address
</span>(</b><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Like
<code>Array.diff</code>,
but
tries
to
generate
bigger
continuous
chunks
of
the
-
differences,
instead
of
maximizing
the
number
of
difference
chunks.
More
-
specifically,
<code>greedy_diff</code>
optimizes
the
cases
where
<code>
Array
.
diff
</code>
returns
-
<code class='expr'>
({
..., A, Z, B,
(
{}
)
, C,
.
.. })
</
code
>
-
<code class='expr'>(
{ ..., A, X, B, Y+B, C, ... }
)</code>
-
into
the
somewhat
shorter
diff
arrays
-
<
code
class='
expr
'>
({ ..., A, Z, B+C, ... })
</
code
>
-
<
code
class='
expr
'>
({ ..., A, X+B+Y, B+C, ... })
<
/code
></p>
+
<dd class='body--doc'><p>
Get
the
address
and
port
of
the
local
socket
end-point.</p>
+
</dd>
+
<dt
class='head--doc'>Returns</dt>
+
<dd
class='body--doc'><p>This
function
returns
the
address
and port
of
a
socket
end-point
+
on
the
form
<code
class='expr'
>
"x
.
x.x.x port"
</code>
(IPv4) or
+
<code class='expr'>
"x:x:x:x:x:x:x:x
port"</code>
(
IPv6
).</
p
>
+
<p>
If there is some error querying or formatting the address,
+
<code class='expr'>
0</code>
(
zero
)
is returned and
<
code>errno()<
/code>
will
return
the
+
error
code.</p>
+
<
/dd>
+
<dt
class='
head--doc
'>
Throws
</
dt
>
+
<
dd
class='
body--doc
'><
p
>
An error is thrown if the socket isn't bound.
</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
interleave
_
array
</b></span>
+
<span class='homogen--name'><b>
query
_
backend
</b></span>
</dt>
-
<dd><p><code><code class='
datatype'>array</code>(<code
class=
'
datatype'
>
int
</code>
)
<b><span class='method'>
interleave
_
array
</span>(</b><
code class='datatype'>array</code>(<code class='datatype'>mapping</code>(<code class='datatype'>int</code>:<code class='datatype'>mixed</code>)) <code class='argument'>tab</code><
b>)</b></code></p></dd>
+
<dd><p><code><code class='
object
unresolved
'>
Pike.Backend
</code> <b><span class='method'>
query
_
backend
</span>(</b><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Interleave
a
sparse
matrix
.</p>
-
<
p
>
Returns an array with offsets that describe how to shift the
-
rows of
<code>
tab
</code>
so that only at most one non-zero value exists in
-
every column.
</p>
+
<dd class='body--doc'><p>
Return
the
backend
used for the accept callback
.</p>
+
<
/dd
>
+
<dt
class='head--doc'>See
also</dt>
+
<dd
class='body--doc'>
<
p><
code>
set_backend
</code></p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
longest
_
ordered_sequence
</b></span>
+
<span class='homogen--name'><b>
query
_
fd
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
array</code>(<code class='datatype'>
int</code>
)
<b><span class='method'>
longest
_
ordered_sequence
</span>(</b><
code class='datatype'>array</code> <code class='argument'>a</code><
b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>int</code> <b><span class='method'>
query
_
fd
</span>(</b><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Find
the
longest
ordered
sequence
of
elements.</p>
-
<p>
This function returns an array of the indices in the longest
-
ordered sequence of elements in the array
.</p>
-
</dd>
-
<dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>diff()</code></p>
+
<dd class='body--doc'><p>
Returns
the
file
descriptor
number
associated
with
this
object
.</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
lyskom
_
sort_func
</b></span>
+
<span class='homogen--name'><b>
query
_
id
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
int(-1..1)
</code> <b><span class='method'>
lyskom
_
sort_func
</span>(</b><
code class='datatype'>string</code> <code class='argument'>a</code>, <code class='datatype'>string</code> <code class='argument'>
b
</code
>
<b>
)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
mixed
</code> <b><span class='method'>
query
_
id
</span>(</b><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Sort
comparison
function
that
does
not
care
about
case,
nor
about
-
the
contents
of any parts of
the
string
enclosed
with
'()'
</p>
-
<
p
>
Example:
"Foo
(bar)" is given the same weight as "foo (really!)"
</p>
+
<dd class='body--doc'><p>
This
function
returns
the
id
for
this
port.
The
id
is
normally
the
+
first
argument
to
accept_callback.
</p>
+
<
/dd
>
+
<dt
class='head--doc'>See
also</dt>
+
<dd
class='body--doc'>
<
p><code>set_id<
/
code></
p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
oid
_
sort_func
</b></span>
+
<span class='homogen--name'><b>
set
_
backend
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
int(-1..1)
</code> <b><span class='method'>
oid
_
sort_func
</span>(</b><code class='
datatype'>string</code>
<code class=
'
argument'
>
a
</code>
,
<code class='
datatype'>string</code> <code class='
argument'>
b
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
set
_
backend
</span>(</b><code class='
object
unresolved
'>
Pike.Backend
</code> <code class='argument'>
backend
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Sort
with
care
of
numerical sort
for
OID
values,
e
.
g.
-
"1.2.1" before "1.11.1".
</p>
+
<dd class='body--doc'><p>
Set
the
backend
used
for
the
accept
callback
.</p>
</dd>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><table class='box'><tr><td><code><code class='key'>-1</code></code></td><td><p><code class='expr'>a<b</code></p>
-
</td></tr>
-
<tr><td><code><code class='key'>0</code></code></td><td><p><code class='expr'>a==b</code></p>
-
</td></tr>
-
<tr><td><code><code class='key'>1</code></code></td><td><p><code class='expr'>a>b</code></p>
-
</td></tr>
-
</table></dd>
+
<dt class='head--doc'>Note</dt>
-
<dd class='body--doc'><p>
In
Pike
7.6
and
older
this
function
returned
<code
class='expr'>0</code>
both
when
-
<code
class='expr'>a<b</code>
and
<code
class='expr'>
a
==b</code>
.</p>
+
<dd class='body--doc'><p>
The
backend
keeps
a
reference
to
this
object
as
long
as
the
port
+
is
accepting
connections,
but this object does not keep
a
+
reference
to
the backend
.</p>
</dd> <dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>
sort
_
array
</code></p>
+
<dd class='body--doc'><p><code>
query
_
backend
</code></p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
partition
</b></span>
+
<span class='homogen--name'><b>
set_id
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
array
</code>
(<code
class='datatype'>array
<
/code>) <
b><span class='method'>
partition
</span>(</b><code class='datatype'>
array</code> <code class='argument'>a</code>, <code class='datatype'>function</code>(<code class='datatype'>int(0..0)</code>, <code class='datatype'>
mixed</code>
... :
<code class='
datatype'>mixed</code>) <code class='
argument'>
arbiter
</code>
,
<
code class='datatype'>mixed</code> ... <code class='argument'>extra_args</code><
b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
mixed
</code> <b><span class='method'>
set_id
</span>(</b><code class='datatype'>mixed</code> <code class='argument'>
id
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Splits
an
array
in
two,
according
to
an
arbitration
function
-
<code>arbiter</code>
. The
elements
in
<code>a</code>
who return non-zero for the
-
expression
<code>
arbiter</code>
(
<
code>a<
/code>
[<i>i</i>], @<code>extra_args</code> ) end up in
-
the first sub-array, the others in the second
.
The order is
-
preserved from the original array.
</p>
+
<dd class='body--doc'><p>
This
function
sets
the
id
used
for
accept_callback
by
this
port
.
+
The
default
id
is
<code>
this_object
(
)
</code>.</p>
</dd>
-
<dt class='head--doc'>Example</dt>
-
<dd class='example'><pre><p>Array.partition( enumerate( 9 ), lambda(int n) { return n>3 && n<7; } );
-
> ({ ({ 4, 5, 6 }), ({ 0, 1, 2, 3, 7, 8 }) })</p>
-
</pre></dd>
+
<dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>
filter
</code>
,
<
code>`
/
</code>, <code>`%</code></
p>
+
<dd class='body--doc'><p><code>
query_id
</code></p>
</dd></dl>
-
+
</dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>Stdio.UDP</b></h2>
+
</dt><dd><dl class='group--doc'>
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>UDP (User Datagram Protocol) handling.</p>
+
</dd></dl>
-
+
<hr /> <dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>
Method
</span>
-
<span class='homogen--name'><b>
permute
</b></span>
+
<dt class='head--type'><span class='homogen--type'>
Constant
</span>
+
<span class='homogen--name'><b>
MSG_OOB
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
array
</code>
<b><span class='method'>permute</span>(</b><code class='datatype'>array</code> <code class='argument'>in</code>, <code class='datatype'>int(0
..
)
<
/
code
>
<code
class='
argument
'>
number
</code><
b>)<
/
b></
code></p></dd>
-
-
<dt class='head--
doc
'>
Description
</dt>
-
<dd class='body--
doc
'><p>
Give
a
specified permutation of an array
.</p>
-
<p> The number of permutations is equal to <code class='expr'>sizeof(<code>in</code>)!</code>
-
(the factorial of the size of the given array).</p>
-
</dd>
-
<dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>shuffle()</code></p>
+
<dd><p><code><code class='datatype'>
constant
</code>
Stdio
.
UDP
.<code class='
constant
'>
MSG_OOB
</code></code></p></dd>
+
<dt class='head--
fixme
'>
FIXME
</dt>
+
<dd class='body--
fixme
'><p>
Document
this
constant
.</p>
</dd></dl> <hr /> <dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>
Method
</span>
-
<span class='homogen--name'><b>
pop
</b></span>
+
<dt class='head--type'><span class='homogen--type'>
Constant
</span>
+
<span class='homogen--name'><b>
MSG_PEEK
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
array
</code> <
b><span class='method'>pop</span>(</b><
code class='
datatype
'>
array
</code>
<
code class='argument'>list<
/code><
b>)<
/
b></code></
p></dd>
-
-
<dt class='head--
doc
'>
Description
</dt>
-
<dd class='body--
doc
'><p>
Pops
and
returns the last value of the array, shortening the
-
array by one element
.
-
If there are no elements in the array then 0 is returned otherwise
-
an array is returned where the first returned element is the popped
-
value, and the second element is the modified array.
</p>
-
</dd>
-
<dt class='head--doc'>Example</dt>
-
<dd class='example'><pre><p>Array.pop(({ "a", "b", "c", "d" }));
-
> ({ "d", ({ "a", "b", "c" }) })</p>
-
</pre></dd>
-
<dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>ADT.Stack</code>, <code>ADT.Stack.pop</code>, <code>ADT.Stack.quick_pop</code></p>
+
<dd><p><code><code class='datatype'>
constant
</code>
Stdio.UDP.
<code class='
constant
'>
MSG_PEEK
</code></code></p></dd>
+
<dt class='head--
fixme
'>
FIXME
</dt>
+
<dd class='body--
fixme
'><p>
Document
this
constant
.</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
push
</b></span>
+
<span class='homogen--name'><b>
add_membership
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
array
</code> <b><span class='method'>
push
</span>(</b><code class='datatype'>
array
</code> <code class='argument'>
list
</code>, <code class='datatype'>
mixed
</code> <code class='argument'>
element
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
int
</code> <b><span class='method'>
add_membership
</span>(</b><code class='datatype'>
string
</code> <code class='argument'>
group
</code>, <code class='datatype'>
void
</code>
|<code
class='datatype'>string
<
/
code
>
<code
class='argument'>
address
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Threats
an Array as
a
stack
and pushes the element onto the
-
end
.</p>
+
<dd class='body--doc'><p>
Join
a
multicast
group
.</p>
</dd>
-
<dt class='head--doc'>
Example
</dt>
-
<dd class='
example
'><
pre
><
p
>
Array
.
push(({
"
a
",
"b",
"c",
"d"
}),
"e");
-
>
({
"a",
"b",
"c",
"d",
"e"
})
</p>
-
</
pre
></dd>
+
<dt class='head--doc'><
span id='p-group'><
/
span>Parameter <code class='parameter'>group</code></
dt>
+
<dd
></dd><dd
class='
body--doc
'><
p
><
code
>
group</code> contains the address of the multicast group the
+
application wants to join
.
It must be
a
valid
multicast
address.</p>
+
</dd>
+
<dt
class='head--doc'><span
id='p-address'></span>Parameter <code class='parameter'>address</code></dt>
+
<dd></dd><dd
class='body--doc'><p><code>address</code>
is
the
address
of
the
local
interface
with
which
+
the system should join to the multicast group. If not provided
+
the system will select an appropriate interface.
</p>
+
<
p> See also the Unix man page for setsocketopt IPPROTO_IP IP_ADD_MEMBERSHIP
+
and IPPROTO_IPV6 IPV6_JOIN_GROUP.<
/
p
>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>The <code>address</code> parameter is currently not supported for IPv6.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>This function did not support IPv6 in Pike 7.8 and earlier.</p>
+
</dd>
<dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>
ADT.Stack
</code>
,
<
code>ADT.Stack.push<
/
code></
p>
+
<dd class='body--doc'><p><code>
drop_membership()
</code></p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
reduce
</b></span>
+
<span class='homogen--name'><b>
bind
</b></span>
</dt>
-
<dd><p><code><code class='
datatype
'>
mixed
</code> <b><span class='method'>
reduce
</span>(</b><code class='datatype'>
function
</code>
(:
<code class='datatype
void
'>
void
</code>
)
<code class='argument'>
fun
</code>, <code class='datatype'>
array
</code> <code class='argument'>
arr
</code>, <code class='datatype'>
mixed
</code>|<code class='datatype'>
void
</code> <code class='argument'>
zero
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='
object unresolved
'>
UDP
</code> <b><span class='method'>
bind
</span>(</b><code class='datatype'>
int
</code>
|
<code class='datatype'>
string
</code> <code class='argument'>
port
</code>, <code class='datatype'>
string
</code>
|<code
class='datatype'>void
<
/
code
>
<code
class='argument'>
address
</code>, <code class='datatype'>
string
</code>|<code class='datatype'>
bool
</code> <code class='argument'>
no_reuseaddr
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
<code>reduce()</code>
sends
the
first
two
elements
in
<code>arr</code> to <code>fun</code>,
-
then the result and the next element in <code>arr</code> to <code>fun</code> and
-
so on
.
Then it returns the result. The function will return
-
<
code>zero<
/
code> if <code>arr</code> is the empty array. If <code>arr</code> has
-
only one element, that element will be returned.</
p>
+
<dd class='body--doc'><p>
Binds
a
port
for
receiving
or
transmitting
UDP
.</p>
</dd>
-
<dt class='head--doc'>
See
also
</dt>
-
<dd class='body--doc'><p><code>
rreduce
()</code></p>
+
<dt class='head--doc'>
<span
id='p-port'>
</
span>Parameter <code class='parameter'>port</code></
dt>
+
<dd
></dd><dd
class='body--doc'><p>
Either a port number or the name of a service as listed in
+
<
tt>/etc/services</tt>.</p>
+
</dd>
+
<dt class='head--doc'><span id='p-address'></span>Parameter <
code
class='parameter'
>
address</code></dt>
+
<dd></dd><dd class='body--doc'><p>Local address to bind to.</p>
+
</dd>
+
<dt class='head--doc'><span id='p-no_reuseaddr'></span>Parameter <code class='parameter'>no_reuseaddr</code></dt>
+
<dd></dd><dd class='body--doc'><p>If set to <code class='expr'>1</code>, Pike will not set the <code class='expr'>SO_REUSEADDR</code> option
+
on the UDP port.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p><code class='expr'>SO_REUSEADDR</code> is never applied when binding a random port
+
(
<code class='expr'>bind(0
)</code>
).
</p>
+
<p> In general, <code class='expr'>SO_REUSEADDR</code> is not desirable on UDP ports.
+
Unless used for receiving multicast, be sure to never bind a
+
non-random port without setting <code class='expr'>no_reuseaddr</code> to <code class='expr'>1</code>.</p>
+
</dd>
+
<dt class='head--doc'>Throws</dt>
+
<dd class='body--doc'><p>Throws error when unable to bind port.</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
rreduce
</b></span>
+
<span class='homogen--name'><b>
close
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
mixed
</code> <b><span class='method'>
rreduce
</span>(</b><
code class='datatype'>function</code>(:<code class='datatype void'>void</code>) <code class='argument'>fun</code>, <code class='datatype'>array</code> <code class='argument'>arr</code>, <code class='datatype'>mixed</code>|<code class='datatype'>void</code> <code class='argument'>zero</code><
b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
bool
</code> <b><span class='method'>
close
</span>(</b><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
<code>rreduce()</code>
sends
the
last
two elements in <code>arr</code> to <code>fun</code>,
-
then the third last element in <code>arr</code> and the result to <code>fun</code> and
-
so on
.
Then it returns the result. The function will return
-
<
code>zero<
/
code> if <code>arr</code> is the empty array. If <code>arr</code> has
-
only one element, that element will be returned.</
p>
+
<dd class='body--doc'><p>
Closes
an
open
UDP
port
.</p>
</dd>
-
<dt class='head--doc'>
See also
</dt>
-
<dd class='body--doc'><p><
code>reduce()<
/
code></
p>
+
<dt class='head--doc'>
Note
</dt>
+
<dd class='body--doc'><p>
This method was introduced in Pike 7.5.
</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
search_array
</b></span>
+
<span class='homogen--name'><b>
connect
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
int
</code> <b><span class='method'>
search_array
</span>(</b><code class='datatype'>
array
</code> <code class='argument'>
arr
</code>, <code class='datatype'>
string
</code>|<code class='datatype'>
function
</code>
(:<code
class='datatype void'>void
<
/
code
>)|<code
class='
datatype'>int</code> <code class='
argument'>
fun
</code>
,
<
code class='datatype'>mixed</code> ... <code class='argument'>args</code><
b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
bool
</code> <b><span class='method'>
connect
</span>(</b><code class='datatype'>
string
</code> <code class='argument'>
address
</code>, <code class='datatype'>
int
</code>|<code class='datatype'>
string
</code> <code class='argument'>
port
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p><
code
>
search_array()
<
/code
>
works
like
<code>
map
()</code>
,
only
it
returns
the
index
-
of
the
first
call
that returnes true instead.</p>
-
<p>
If
no
call
returns
true,
-1
is returned
.</p>
+
<dd class='body--doc'><p>
Establish an UDP connection.
<
/p
>
+
<
p
>
This function connects an UDP socket previously created with
+
<code>
Stdio.UDP
()</code>
to
a
remote
socket.
The
<code>address</code>
is
the
IP
name
or
+
number
for
the
remote
machine
.</p>
</dd>
-
+
<dt class='head--doc'>Returns</dt>
+
<dd class='body--doc'><p>Returns <code class='expr'>1</code> on success, <code class='expr'>0</code> (zero) otherwise.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>If the socket is in nonblocking mode, you have to wait
+
for a write or close callback before you know if the connection
+
failed or not.</p>
+
</dd>
<dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>
sum
()</code>, <code>
map
()</code></p>
+
<dd class='body--doc'><p><code>
bind
()</code>, <code>
query_address
()</code></p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
shift
</b></span>
+
<span class='homogen--name'><b>
drop_membership
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
array
</code> <b><span class='method'>
shift
</span>(</b><code class='datatype'>
array
</code> <code class='argument'>
list
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
int
</code> <b><span class='method'>
drop_membership
</span>(</b><code class='datatype'>
string
</code> <code class='argument'>
group
</code>
,
<
code class='datatype'>void</code>|<code class='datatype'>string</code> <code class='argument'>address</code><
b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Shifts
the
first
value of the array off and returns it, shortening
-
the array by 1 and moving everything down
.
If there are no elements
-
in the array it returns 0.
-
Returns an array where the first element is the shifted value and the
-
second element is the modified array.
</p>
+
<dd class='body--doc'><p>
Leave
a
multicast
group
.</p>
</dd>
-
<dt class='head--doc'>
Example
</dt>
-
<dd class='
example
'><
pre
><
p
>
Array
.
shift(({
"
a
",
"b",
"c",
"d"}));
-
>
({
"a",
({
"b",
"c",
"d"
})
})
</p>
-
</
pre
></dd>
+
<dt class='head--doc'><
span id='p-group'><
/
span>Parameter <code class='parameter'>group</code></
dt>
+
<dd
></dd><dd
class='
body--doc
'><
p
><
code
>
group</code> contains the address of the multicast group the
+
application wants to join
.
It must be
a
valid
multicast
address.</p>
+
</dd>
+
<dt
class='head--doc'><span
id='p-address'></span>Parameter
<code
class='parameter'>address</code></dt>
+
<dd></dd><dd
class='body--doc'><p><code>address</code>
is
the
address
of
the
local interface with which
+
the system should join to the multicast group. If not provided
+
the system will select an appropriate interface.
</p>
+
<
p> See also the Unix man page for setsocketopt IPPROTO_IP IP_DROP_MEMBERSHIP
+
and IPPROTO_IPV6 IPV6_LEAVE_GROUP.<
/
p
>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>The <code>address</code> parameter is currently not supported for IPv6.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>This function did not support IPv6 in Pike 7.8 and earlier.</p>
+
</dd>
<dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>
ADT.Stack
</code></p>
+
<dd class='body--doc'><p><code>
add_membership()
</code></p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
shuffle
</b></span>
+
<span class='homogen--name'><b>
enable_broadcast
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
array
</code> <b><span class='method'>
shuffle
</span>(</b><
code class='datatype'>array</code> <code class='argument'>arr</code><
b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
bool
</code> <b><span class='method'>
enable_broadcast
</span>(</b><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
<code>shuffle()</code>
gives
back
the
same
elements,
but
in
random
order.
-
The
array
is
modified
destructively
.</p>
+
<dd class='body--doc'><p>
Set
the
broadcast
flag.
+
If
enabled
then
sockets
receive
packets sent to a broadcast
+
address
and
they are allowed to send packets to a
+
broadcast address
.</p>
</dd>
-
<dt class='head--doc'>
See also
</dt>
-
<dd class='body--doc'><p><code>
permute
()</
code
></p>
+
<dt class='head--doc'>
Returns
</dt>
+
<dd class='body--doc'><p>
Returns
<code
class='expr'
>
1</code> on success, <code class='expr'>0</code>
(
zero
)
otherwise.
</
p
>
+
</
dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><
p>
This is normally only avalable to root users.</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
sort
_
array
</b></span>
+
<span class='homogen--name'><b>
enable
_
multicast
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
array
</code> <b><span class='method'>
sort
_
array
</span>(</b><code class='datatype'>
array
</code> <code class='argument'>
arr
</code>
,
<
code class='datatype'>function</code>(:<code class='datatype void'>void</code>)|<code class='datatype'>void</code> <code class='argument'>cmp</code>, <code class='datatype'>mixed</code> ... <code class='argument'>args</code><
b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
bool
</code> <b><span class='method'>
enable
_
multicast
</span>(</b><code class='datatype'>
string
</code> <code class='argument'>
reply_address
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
This
function sorts
the
array
<code>arr</code>
after
a
compare-function
-
<code>cmp</code> which takes two arguments and should return <code class='expr'>1</code> if the
-
first argument is larger then the second
.
Returns the sorted array
-
-
<
code>arr<
/
code> is not sorted destructively.</
p>
-
<p> The remaining arguments <code>args</code> will be sent as 3rd, 4th etc. argument
-
to <code>cmp</code>.</p>
-
<p> If <code>cmp</code> is omitted, <code>`>()</code> is used instead.</p>
+
<dd class='body--doc'><p>
Set
the
local
device
for
a
multicast
socket
.</p>
</dd>
-
<dt class='head--doc'>
See
also
</
dt
>
-
<
dd
class='
body--doc
'><
p><
code>
map()
</
code
>
,
<
code
>
sort()
</
code
>
,
<
code
>
`>()
</
code
>
,
<
code
>
dwim
_
sort
_
func
</
code
>
,
<
code
>
lyskom_sort_func
</
code
>
,
-
<
code
>
oid_sort_func
<
/code
></p>
+
<dt class='head--doc'>
<span
id='p-reply_address'>
</
span
>
Parameter
<
code
class='
parameter
'>
reply_address
<
/
code></
dt
>
+
<
dd
></
dd
>
<dd
class='body--doc'>
<
p
>
Local address that should appear in the multicast packets.
</
p
>
+
<
p
>
See also the Unix man page for setsocketopt IPPROTO
_
IP IP
_
MULTICAST_IF
+
and IPPROTO_IPV6 IPV6_MULTICAST_IF.
</
p
>
+
<
/dd
>
+
<
dt class='head--doc'>Note<
/
dt
>
+
<dd
class='body--doc'
><
p
>
This function did not support IPv6 in Pike 7.8.
</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
splice
</b></span>
+
<span class='homogen--name'><b>
errno
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
array
</code>
(<code
class='datatype'>mixed
<
/code>) <
b><span class='method'>
splice
</span>(</b><
code class='datatype'>array</code>(<code class='datatype'>mixed</code>) <code class='argument'>arr1</code>, <code class='datatype'>array</code>(<code class='datatype'>mixed</code>) <code class='argument'>arr2</code>, <code class='datatype'>array</code>(<code class='datatype'>mixed</code>) ... <code class='argument'>more_arrays</code><
b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
int
</code> <b><span class='method'>
errno
</span>(</b><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Splice
two or more arrays.</p>
-
<p> This means that
the
returned
array
has
the
first
element
in
the
-
first given array, then the first argument in next array and so
-
on
for
all
arrays.
Then
the
second
elements are added, etc
.</p>
-
</dd>
-
<dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>`/()</code>, <code>`*()</code>, <code>`+()</code>, <code>`-()</code>, <code>everynth()</code></p>
+
<dd class='body--doc'><p>
Returns
the
error
code
for
the
last
command
on
this
object.
+
Error
code
is
normally
cleared
when
a
command
is
successful
.</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
sum
</b></span>
+
<span class='homogen--name'><b>
get_type
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
mixed
</code>
<
b><span
class='
method
'>
sum
</
span
>
(
<
/
b><
code
class='
datatype
'>
array
</
code
>
<
code class='argument'>a<
/
code
><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
array
</code>
(
<
code
class='
datatype
'>
int
</
code
>
)
<b><
span
class='
method
'>
get_type
</
span
>
(
</
b
><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Sum
the
elements
of
an
array using `+
.
The empty array
-
results in 0.
</p>
+
<dd class='body--doc'><p>
Returns
socket
type
and
protocol
family
.</p>
</dd></dl> <hr /> <dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>
Method
</span>
-
<span class='homogen--name'><b>
sum_arrays
</b></span>
+
<dt class='head--type'><span class='homogen--type'>
Inherit
</span>
+
<span class='homogen--name'><b>
UDP
</b></span>
</dt>
-
<dd><p><code><
code
class='datatype'>
array</code>
<b><span class='method'>sum
_
arrays
</span>
(</b><code
class='datatype'>function</code>(<code class='datatype'>int(0..0)</code> ...
:
<code
class='datatype'>mixed
<
/code>)
<code
class='
argument
'>
sum
</
code
>
,
<
code class='datatype'>array<
/code>
...
<
code class='argument'>args<
/
code
><
b>)<
/
b
></
code
>
</p></dd>
+
<dd><p><code><
span
class='datatype'>
inherit
_
Stdio.UDP
</span> : <
span
class='
inherit
'>
UDP
</
span
></code></
p
></
dd
>
+
</
dl
>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Applies the function <code>sum</code> columnwise on the elements in the
-
provided arrays. E.g. <code class='expr'>sum_array(`+,a,b,c)</code> does the same
-
as <code class='expr'>`+(a[*],b[*],c[*])</code>.</p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
transpose
</b></span>
+
<span class='homogen--name'><b>
query_address
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
array
</code>
(<code
class='datatype'>array
<
/code>) <
b><span class='method'>
transpose
</span>(</b><
code class='datatype'>array</code>(<code class='datatype'>array</code>) <code class='argument'>matrix</code><
b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
string
</code> <b><span class='method'>
query_address
</span>(</b><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Takes
an
array
of
equally
sized
arrays
(essentially
a
matrix
of size M*N)
-
and
returns
the
transposed
(N*M)
version
of it
,
where
rows
and
columns
-
are
exchanged
for
one
another
.</p>
+
<dd class='body--doc'><p>
Returns
the
local
address
of
a
socket
on
the
form
"x.x.x.x
port".
+
If
this
file
is
not
a
socket,
not
connected
or
some
other
error
occurs,
+
zero
is
returned
.</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
uniq
</b></span>
+
<span class='homogen--name'><b>
query_backend
</b></span>
</dt>
-
<dd><p><code><code class='
datatype
'>
array
</code> <b><span class='method'>
uniq
</span>(</b><
code class='datatype'>array</code> <code class='argument'>a</code><
b>)</b></code></p></dd>
+
<dd><p><code><code class='
object unresolved
'>
Pike.Backend
</code> <b><span class='method'>
query_backend
</span>(</b><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Remove
elements
that
are
duplicates
.</p>
+
<dd class='body--doc'><p>
Return
the
backend
used
for the read callback
.</p>
</dd>
-
<dt class='head--doc'>
Returns</dt>
-
<dd
class='body--doc'>
<
p>This function returns an copy of the array <code>a<
/
code> with all
-
duplicate values removed. The order of the values is kept in the
-
result; it's always the first of several equal elements that is
-
kept.</p>
-
</dd>
-
<
dt
class='head--doc'
>
Note</dt>
-
<dd class='body--doc'><p>
Elements are compared with
<code>
`==</code>. They are also hashed (see
-
<code>lfun::
_
_hash
</code>
for further details if the array contains
-
objects).
</p>
+
<dt class='head--doc'>
See
also
</dt>
+
<dd class='body--doc'><p><code>
set
_
backend
</code></p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
uniq2
</b></span>
+
<span class='homogen--name'><b>
query_fd
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
array
</code> <b><span class='method'>
uniq2
</span>(</b><
code class='datatype'>array</code> <code class='argument'>a</code><
b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
int
</code> <b><span class='method'>
query_fd
</span>(</b><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Perform
the
same
action
as
the
Unix
uniq command on an array,
-
that is, fold consecutive occurrences of the same element into
-
a single element of the result array:</p>
-
<p> aabbbcaababb -> abcabab
.</p>
-
<p> See also the <code>uniq</code> function.</p>
+
<dd class='body--doc'><p>
Gets
the
file
descriptor
for
this
UDP
port
.</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
unshift
</b></span>
+
<span class='homogen--name'><b>
read
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
array
</code> <b><span class='method'>
unshift
</span>(</b><code class='datatype'>
array
</code> <code class='
argument
'>
list
</code>
,
<code class='datatype'>
mixed
</code> <code class='argument'>
element
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
mapping
</code>
(<code
class='datatype'>string
<
/code>:<code class='datatype'>int</code>|<code class='datatype'>string</code>) <
b><span class='method'>
read
</span>(</b><
b>)</b></
code
><br>
+
<code><code
class='datatype'>
mapping
</code>
(<code
class='datatype'>string
<
/
code
>:<code
class='
datatype
'>
int
</code>
|<code
class='datatype'>string
<
/
code
>)
<b><span
class='
method'>read</span>(</b><code class='
datatype'>
int
</code> <code class='argument'>
flag
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Does
the
opposite
of "shift"
.
Or
the
opposite of
a
"push"
,
-
depending
on
how
you look at it. Prepends the element to
-
the front
of
the
array
and
returns
the
new array.
</p>
+
<dd class='body--doc'><p>
Read
from
the
UDP
socket
.
</p>
+
<p>
Flag
<code>flag</code>
is
a
bitfield
,
1
for
out
of
band
data
and
2
for
peek
</p>
</dd>
-
<dt class='head--doc'>
Example
</dt>
-
<dd class='
example
'><
pre><
p>
Array.unshift
((
{
"b",
"c",
"d"
}),
"
a
"
);
-
>
({
"a",
"b",
"c",
"
d
"
})</p>
-
</pre></dd>
-
<dt
class='head--doc'>See
also</dt>
-
<dd
class='body--doc'><p><code>ADT.Stack</code></p>
-
</dd></dl>
-
<dl><dt><h2
class='header'>Class
<b
class='ms
datatype'>Array.Iterator</b></h2>
-
</dt><dd><dl
class='group--doc'>
-
<dt
class='head--doc'>Description</dt>
-
<dd
class='body--doc'><p>An
object
of
this
class
is
returned
by
<code>get_iterator()</code>
when
-
called
with
an
array.
</p>
+
<dt class='head--doc'>
Returns
</dt>
+
<dd class='
body--doc
'><p>
mapping
(
string:int|string) in the form
+
(
[
+
"
data
"
:
string received data
+
"
ip
"
:
string
received
from
this
ip
+
"port"
: int ...and this port
+
])
</p>
</dd> <dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>
get
_
iterator
</code></p>
+
<dd class='body--doc'><p><code>
set
_
read_callback()
</code>
,
<
code>MSG_OOB<
/
code>, <code>MSG_PEEK</code></
p>
</dd></dl>
-
<hr />
-
<dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Inherit</span>
-
<span class='homogen--name'><b>predef::Iterator</b></span>
-
</dt>
-
<dd><p><code><span class='datatype'>inherit predef::Iterator</span> : <span class='inherit'>predef::Iterator</span></code></p></dd>
-
</dl>
-
</dd></dl></dd></dl><dl><dt><h2 class='header'>Module <b class='ms datatype'>Mapping</b></h2>
-
</dt><dd>
+
<hr /> <dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>
Constant
</span>
-
<span class='homogen--name'><b>
delete
</b></span>
+
<dt class='head--type'><span class='homogen--type'>
Method
</span>
+
<span class='homogen--name'><b>
send
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
constant
</code>
Mapping.
<code class='
constant
'>
delete
</code></code></p></dd>
+
<dd><p><code><code class='datatype'>
int
</code> <
b><span class='method'>send</span>(</b><
code class='
datatype
'>
string
</code>
<
code class='argument'>to<
/code>
,
<
code class='datatype'>int<
/
code>|<code class='datatype'>string</code> <code class='argument'>port</code>, <code class='datatype'>string</code> <code class='argument'>message</code><b>)</b></code><br>
+
<code><code class='datatype'>int</code> <b><span class='method'>send</span>(</b><code class='datatype'>string</code> <code class='argument'>to</code>, <code class='datatype'>int</code>|<code class='datatype'>string</code> <code class='argument'>port</code>, <code class='datatype'>string</code> <code class='argument'>message</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>
Alias
for
<code>
m_delete()
</code>
</p>
-
</dd></dl>
-
<dl><dt><h2
class='header'>Class
<b
class='ms
datatype'
>
Mapping.Iterator
</
b
></
h2
>
-
<
/dt
>
<dd><dl
class='group--doc'>
-
<dt
class='head--doc'
>
Description
</
dt
>
-
<dd
class='body--doc'><p>An
object
of
this
class
is
returned
by
<code>get_iterator()</code>
when
-
called
with
a mapping
.</p>
+
<dd class='body--doc'><p>
Send
data
to a UDP socket. The recipient address will be
<code>
to
</code>
+
and
port
will
be <code
>
port
</
code
>
.
</
p
>
+
<
p
>
Flag
<
code
>
flag
</
code
>
is
a
bitfield,
1
for
out
of
band
data
and
+
2
for
don't
route
flag
.</p>
</dd>
-
<dt class='head--doc'>
See
also
</dt>
-
<dd class='body--doc'><p><code>
get_iterator
</code></p>
+
<dt class='head--doc'>
Returns</dt>
+
<dd
class='body--doc'>
<
table class='box'><tr><td><code><code class='key'>(0..)<
/
code></code></td><td><p>The number of bytes that were actually written.</p>
+
</td></tr>
+
<tr><td><code><code class='key'>(..-1)</code></code></td><td><p>Failed to send the <code>message</code>. Check <code>errno()</code> for
+
the cause. Common causes are:</p>
+
<table class='box'><tr><td><code><code class='key'>System.EMSGSIZE</code></code></td><td><p>The <code>message</code> is too large to send unfragmented.</p>
+
</td></tr>
+
<tr><td><code><code class='key'>System.EWOULDBLOCK</code></code></td><td><p>The send buffers are full.</p>
+
</td></tr>
+
</table></td></tr>
+
</table>
+
</dd>
+
<
dt
class='head--doc'
>
Throws</dt>
+
<dd class='body--doc'><p>
Throws errors on invalid arguments and uninitialized object.
<
/p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>Versions of Pike prior to 8.1.5 threw errors also on EMSGSIZE
+
(<
code
class='expr'
>
"Too big message"
</code>
) and EWOULDBLOCK
+
.(
<
code class='expr'>"Message would block."<
/
code>). These versions of Pike also
+
did not update the object errno on this function failing.</
p>
</dd></dl>
-
<hr />
-
<dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Inherit</span>
-
<span class='homogen--name'><b>predef::Iterator</b></span>
-
</dt>
-
<dd><p><code><span class='datatype'>inherit predef::Iterator</span> : <span class='inherit'>predef::Iterator</span></code></p></dd>
-
</dl>
-
</dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>Mapping.ShadowedMapping</b></h2>
-
</dt><dd><dl class='group--doc'>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>A mapping look-alike that overrides (ie shadows) another <code>parent</code> mapping.</p>
-
<p> The class implements most of the usual mapping operations.</p>
-
</dd></dl>
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
create
</b></span>
+
<span class='homogen--name'><b>
set_backend
</b></span>
</dt>
-
<dd><p><code><
span
class='
object
'>
Mapping.ShadowedMapping
</
span
> <span class='
class
'>
Mapping.ShadowedMapping
</span>
<b>
(</b><code class='
datatype'>mapping</code>|<code class='
object unresolved'>
ShadowedMapping
</code> <code class='argument'>
parent
</code>
,
<
code class='datatype'>mapping</code>|<code class='datatype'>void</code> <code class='argument'>shadow</code>, <code class='datatype'>bool</code>|<code class='datatype'>void</code> <code class='argument'>modify_parent</code><
b>)</b></code></p></dd>
+
<dd><p><code><
code
class='
datatype
'>
void
</
code
> <
b><
span class='
method
'>
set_backend
</span>(</b><code class='object unresolved'>
Pike.Backend
</code> <code class='argument'>
backend
</code><b>)</b></code></p></dd>
-
<dt class='head--doc'><
span id='p-parent'><
/
span>Parameter <code class='parameter'>parent</code></
dt>
-
<dd
></dd><dd
class='body--doc'><p>
Mapping
to
be
shadowed
.</p>
+
<dt class='head--doc'>
Description
</dt>
+
<dd class='body--doc'><p>
Set
the
backend
used for the read callback
.</p>
</dd>
-
<dt class='head--doc'><
span id='p-shadow'><
/
span>Parameter <code class='parameter'>shadow</code></
dt>
-
<dd
></dd><dd
class='body--doc'><p>
Initial
shadow
of
<code>parent</code>
.</p>
+
<dt class='head--doc'>
Note
</dt>
+
<dd class='body--doc'><p>
The
backend
keeps
a reference to this object as long as there can
+
be calls to the read callback, but this object does not keep a
+
reference to the backend
.</p>
</dd>
-
<dt class='head--doc'>
<span
id='p-modify_parent'>
</
span>Parameter <code class='parameter'>modify_parent</code></
dt>
-
<dd
></dd><dd
class='body--doc'><p>
Modifications should be done to
<code>
parent
</code>
rather than
-
to
<
code>shadow<
/
code>. If this is set, only entries that are
-
already present in <code>shadow</code> can be modified by later
-
operations.</
p>
+
<dt class='head--doc'>
See
also
</dt>
+
<dd class='body--doc'><p><code>
query_backend
</code></p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
create
</b></span>
+
<span class='homogen--name'><b>
set_blocking
</b></span>
</dt>
-
<dd><p><code><
span
class='
object
'>
Mapping.ShadowedMapping
</
span
> <span class='
class
'>
Mapping.ShadowedMapping
</span>
<b>
(</b><
code class='datatype'>mapping</code>|<code class='object unresolved'>ShadowedMapping</code> <code class='argument'>parent</code><
b>)</b></code></p></dd>
-
</dl>
+
<dd><p><code><
code
class='
datatype
'>
object
</
code
> <
b><
span class='
method
'>
set_blocking
</span>(</b><b>)</b></code></p></dd>
-
-
<hr />
-
<dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Variable</span>
-
<span class='homogen--name'><b>parent</b></span>
-
</dt>
-
<dd><p><code><code class='modifier'>protected</code> <code class='datatype'>mapping</code>|<code class='object unresolved'>ShadowedMapping</code> Mapping.ShadowedMapping.<b><span class='variable'>parent</span></b></code></p></dd>
-
</dl>
-
</dd></dl></dd></dl><dl><dt><h2 class='header'>Module <b class='ms datatype'>Multiset</b></h2>
-
</dt><dd><dl class='group--doc'>
+
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Multiset
handling.</p>
-
</dd></dl><dl><dt><h2
class='header'>Class <b class='ms datatype'>Multiset.Iterator</b></h2>
-
</dt><dd><dl class='group--doc'>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>An
object
of
this
class is returned by <code>get_iterator()</code> when
-
called with a multiset
.</p>
-
</dd>
-
<dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>get_iterator</code></p>
+
<dd class='body--doc'><p>
Sets
this
object
to
be
blocking
.</p>
</dd></dl>
-
<hr />
-
<dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Inherit</span>
-
<span class='homogen--name'><b>predef::Iterator</b></span>
-
</dt>
-
<dd><p><code><span class='datatype'>inherit predef::Iterator</span> : <span class='inherit'>predef::Iterator</span></code></p></dd>
-
</dl>
-
</dd></dl></dd></dl><dl><dt><h2 class='header'>Module <b class='ms datatype'>Int</b></h2>
-
</dt><dd>
+
<hr /> <dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>
Constant
</span>
-
<span class='homogen--name'><b>
NATIVE
_
MIN
</b></span>
<br>
-
<span class='homogen--type'>Constant</span>
-
<span class='homogen--name'><b>NATIVE_MAX</b></span><br>
+
<dt class='head--type'><span class='homogen--type'>
Method
</span>
+
<span class='homogen--name'><b>
set
_
buffer
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
constant
</code>
Int.
<
code
class='
constant
'>
NATIVE
_
MIN
</code></code><br>
-
<code><code class='datatype'>
constant
</code>
Int.
<
code
class='
constant
'>
NATIVE
_
MAX
</code></code></p></dd>
+
<dd><p><code><code class='datatype'>
void
</code> <
b><span
class='
method
'>
set
_
buffer
</
span>(</b><
code
class='datatype'
>
int
</code>
<
code class='argument'>bufsize</code>, <code class='datatype'>string</code> <code class='argument'>mode</code><b>)</b></code><
br>
+
<code><code class='datatype'>
void
</code> <
b><span
class='
method
'>
set
_
buffer
</
span>(</b><
code
class='datatype'
>
int
</code>
<
code class='argument'>bufsize<
/
code><b>)</b></code></
p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
The
limits
for
using
the
native
representation
of integers on
the
-
current
architecture.
Any
integer
that is outside this range uses
-
a
more
complex
and slower representation
.
Also, some builtin
-
functions that don't expect very large integers might start to
-
complain about invalid argument type when given values outside
-
this range (they typically say something like "Expected integer,
-
got object").
</p>
-
<p>
<code>NATIVE_MIN</code>
is
not
greater
than
<code
class='expr'>-2147483648</code>
-
(<code
class='expr'>-0x80000000</code>).</p>
-
<p>
<code>NATIVE_MAX</code>
is
not
less
than
<code class='expr'>
2147483647
</code>
-
(
<code class='expr'>
0x7fffffff
</code>
)
.</p>
+
<dd class='body--doc'><p>
Set
internal
socket
buffer.</p>
+
<p>
This
function
sets
the
internal
buffer
size
of
a
socket
or
stream
.</p>
+
<p>
The
second
argument
allows
you
to
set
the
read
or
write
buffer
by
+
specifying
<code class='expr'>
"r"
</code>
or
<code class='expr'>
"w"
</code>.</p>
</dd> <dt class='head--doc'>Note</dt>
-
<dd class='body--doc'><p>
The
size
of
the
native
integers
can
be
controlled
when
Pike
is
-
compiled
with
the
configure
flags
<
code
class='
expr'>
--
with-int-int
</
code
>
,
-
<
code
class='
expr'>
--
with-long-int
</code>,
and
<code
class='expr'
>
--with-long-long-int
</code>
. The
-
default is to use the longest available integer type that fits
-
inside a pointer, which typically means that it's 64 bit on "true"
-
64 bit architectures.
</p>
+
<dd class='body--doc'><p>
It
is
not
guaranteed
that
this
function
actually
does
anything,
+
but
it
certainly
helps
to
increase data transfer speed when it does.
<
/p>
+
</dd>
+
<dt
class='
head--doc
'>
See also
</
dt
>
+
<
dd
class='
body--doc
'><
p><code>open_socket()<
/code>, <code>
accept()
</code></p>
</dd></dl> <hr /> <dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Variable</span>
-
<span class='homogen--name'><b>inf</b></span>
-
</dt>
-
<dd><p><code><code class='object unresolved'>Inf</code> Int.<b><span class='variable'>inf</span></b></code></p></dd>
-
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>An object that behaves like positive infinity.</p>
-
</dd></dl>
-
-
-
<hr />
-
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
parity
</b></span>
+
<span class='homogen--name'><b>
set_fd
</b></span>
</dt>
-
<dd><p><code><code class='
datatype
'>
bool
</code> <b><span class='method'>
parity
</span>(</b><code class='datatype'>int
(0..)
</code> <code class='argument'>
value
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='
object unresolved
'>
UDP
</code> <b><span class='method'>
set_fd
</span>(</b><code class='datatype'>int</code> <code class='argument'>
fd
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Returns
the
parity
of
the integer
<code>
value
</code>
.
If
the
-
parity
is odd 1 is returned. If it is even 0 is
-
returned.
</p>
+
<dd class='body--doc'><p>
Use
the
file
descriptor
<code>
fd
</code>
for
UDP.</p>
+
</dd>
+
<dt
class='head--doc'>See
also</dt>
+
<dd
class='body--doc'>
<
p><code>bind<
/
code></
p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
reflect
</b></span>
+
<span class='homogen--name'><b>
set_multicast_ttl
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>int
(0..)
</code> <b><span class='method'>
reflect
</span>(</b><code class='datatype'>int</code> <code class='argument'>
value
</code>
,
<
code class='datatype'>int(0..)</code> <code class='argument'>bits</code><
b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>int</code> <b><span class='method'>
set_multicast_ttl
</span>(</b><code class='datatype'>int</code> <code class='argument'>
ttl
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Reverses
the
order
of
the
low
order <code>bits</code> number of bits
-
of
the
value
<code>value</code>
.</p>
+
<dd class='body--doc'><p>
Set
the
time-to-live
value
of
outgoing
multicast
packets
+
for
this
socket
.</p>
</dd>
-
+
<dt class='head--doc'><span id='p-ttl'></span>Parameter <code class='parameter'>ttl</code></dt>
+
<dd></dd><dd class='body--doc'><p>The number of router hops sent multicast packets should
+
survive.</p>
+
<p> It is very important for multicast packets to set the
+
smallest TTL possible. The default before calling this
+
function is 1 which means that multicast packets don't
+
leak from the local network unless the user program
+
explicitly requests it.</p>
+
<p> See also the Unix man page for setsocketopt IPPROTO_IP IP_MULTICAST_TTL
+
and IPPROTO_IPV6 IPV6_MULTICAST_HOPS.</p>
+
</dd>
<dt class='head--doc'>Note</dt>
-
<dd class='body--doc'><p>
Any
higher
order
bits
of
the
value
will
be cleared
.
-
The returned value will thus be unsigned
.</p>
+
<dd class='body--doc'><p>
This
function
did
not
support
IPv6
in
Pike
7
.
8
and
earlier
.</p>
</dd> <dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>
reverse()</code>, <code>swap
_
word
()</code>
,
<
code>swap_long()<
/
code></
p>
+
<dd class='body--doc'><p><code>
add
_
membership
()</code></p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
swap
_
long
</b></span>
+
<span class='homogen--name'><b>
set
_
nonblocking
</b></span>
</dt>
-
<dd><p><code><code class='
datatype
'>
int
(
32bit
)</code> <b><span class='method'>
swap
_
long
</span>(</b><code class='datatype'>
int
(
32bit
)</code> <code class='argument'>
i
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='
object unresolved
'>
UDP</code> <b><span class='method'>set_nonblocking</span>
(
</b><b>
)</
b></
code>
<br>
+
<code><code
class='object unresolved'>UDP
<
/code> <
b><span class='method'>
set
_
nonblocking
</span>(</b><code class='datatype'>
function</code>(<code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>
int
</code>|<code class='datatype'>string</code>
)
,
<
code class='datatype'>mixed<
/code>
... :
<code class='
datatype'>void</code>) <code class='
argument'>
read_cb
</code>
,
<
code class='datatype'>mixed</code> ... <code class='argument'>extra_args</code><
b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Swaps
the
upper
and
lower
word
in
a
longword,
and
the
upper
and
-
lower
bytes
in
the
words.
Simply
put, the bytes are reversed
.</p>
+
<dd class='body--doc'><p>
Set
this
object
to
nonblocking
mode.</p>
+
<p>
If
<code>read_cb</code>
and
<code>extra_args</code>
are
specified,
they
will
be
passed
on
+
to
<code>set_read_callback()</code>
.</p>
</dd>
-
<dt class='head--doc'>
See also
</dt>
-
<dd class='body--doc'><p><
code>swap_word()<
/
code></
p>
+
<dt class='head--doc'>
Returns
</dt>
+
<dd class='body--doc'><p>
The called object.
</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
swap
_
word
</b></span>
+
<span class='homogen--name'><b>
set
_
read_callback
</b></span>
</dt>
-
<dd><p><code><code class='
datatype
'>
int(16bit)
</code> <b><span class='method'>
swap
_
word
</span>(</b><code class='datatype'>
int
(
16bit
)</code> <code class='argument'>
i
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='
object unresolved
'>
UDP
</code> <b><span class='method'>
set
_
read_callback
</span>(</b><code class='datatype'>
function</code>(<code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>
int
</code>|<code class='datatype'>string</code>
)
,
<
code class='datatype'>mixed<
/code>
... :
<code class='
datatype void'>void</code>) <code class='
argument'>
read_cb
</code>
,
<
code class='datatype'>mixed</code> ... <code class='argument'>extra_args</code><
b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Swaps
the
upper
and
lower
byte
in
a
word
.</p>
+
<dd class='body--doc'><p>
The
<code>read_cb</code> function will receive a mapping similar to
the
mapping
+
returned
by
<code>read()</code>:</p>
+
<table
class='box'><tr><td><code><code
class='key'>"data"</code>
: <code class='datatype'>string</code></code></td><td><p>Received data
.</p>
+
</td></tr>
+
<tr><td><code><code class='key'>"ip"</code> : <code class='datatype'>string</code></code></td><td><p>Data was sent from this IP.</p>
+
</td></tr>
+
<tr><td><code><code class='key'>"port"</code> : <code class='datatype'>int</code></code></td><td><p>Data was sent from this port.</p>
+
</td></tr>
+
</table>
</dd>
-
+
<dt class='head--doc'>Returns</dt>
+
<dd class='body--doc'><p>The called object.</p>
+
</dd>
<dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>
swap_long
()</code></p>
+
<dd class='body--doc'><p><code>
read
()</code></p>
</dd></dl>
-
<dl><dt><h2 class='header'>Class <b class='ms datatype'>Int.Inf</b></h2>
-
</dt><dd><dl class='group--doc'>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>The type of <code>Int.inf</code>. Do not create more instances of this.</p>
-
</dd></dl></dd></dl></dd></dl><dl><dt><h2 class='header'>Module <b class='ms datatype'>Float</b></h2>
-
</dt><dd>
+
-
<hr />
-
<dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Constant</span>
-
<span class='homogen--name'><b>DIGITS_10</b></span><br>
-
<span class='homogen--type'>Constant</span>
-
<span class='homogen--name'><b>MIN_10_EXP</b></span><br>
-
<span class='homogen--type'>Constant</span>
-
<span class='homogen--name'><b>MAX_10_EXP</b></span><br>
-
<span class='homogen--type'>Constant</span>
-
<span class='homogen--name'><b>MIN</b></span><br>
-
<span class='homogen--type'>Constant</span>
-
<span class='homogen--name'><b>MAX</b></span><br>
-
<span class='homogen--type'>Constant</span>
-
<span class='homogen--name'><b>EPSILON</b></span><br>
-
</dt>
-
<dd><p><code><code class='datatype'>constant</code> Float.<code class='constant'>DIGITS_10</code></code><br>
-
<code><code class='datatype'>constant</code> Float.<code class='constant'>MIN_10_EXP</code></code><br>
-
<code><code class='datatype'>constant</code> Float.<code class='constant'>MAX_10_EXP</code></code><br>
-
<code><code class='datatype'>constant</code> Float.<code class='constant'>MIN</code></code><br>
-
<code><code class='datatype'>constant</code> Float.<code class='constant'>MAX</code></code><br>
-
<code><code class='datatype'>constant</code> Float.<code class='constant'>EPSILON</code></code></p></dd>
+
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>These constants define the limits for floats on the current
-
architecture:</p>
-
<dl class='group--doc'><dt>DIGITS_10</dt>
-
<dd><p>The number of decimal digits that can be represented. Any number
-
with this many decimal digits can be stored in a float and
-
converted back to decimal form without change. <code>DIGITS_10</code> is
-
not less than <code class='expr'>6</code>.</p>
-
</dd>
-
<dt>MIN_10_EXP</dt>
-
<dt>MAX_10_EXP</dt>
-
<dd><p>Limits of the exponent in decimal base. 10 raised to any number
-
within this range can be represented in normalized form.
-
<code>MIN_10_EXP</code> is not greater than <code class='expr'>-37</code>. <code>MAX_10_EXP</code> is
-
not less than <code class='expr'>37</code>.</p>
-
</dd>
-
<dt>MIN</dt>
-
<dd><p>The smallest normalized float greater than zero. It's not
-
greater than <code class='expr'>1e-37</code>.</p>
-
</dd>
-
<dt>MAX</dt>
-
<dd><p>The largest finite float. It's not less than <code class='expr'>1e37</code>.</p>
-
</dd>
-
<dt>EPSILON</dt>
-
<dd><p>The difference between 1 and the smallest value greater than 1
-
that can be represented. It's not greater than <code class='expr'>1e-5</code>.</p>
-
</dd>
-
</dl>
-
</dd>
-
<dt class='head--doc'>Note</dt>
-
<dd class='body--doc'><p>The size of the float type can be controlled when Pike is compiled
-
with the configure flags <code class='expr'>--with-double-precision</code> and
-
<code class='expr'>--with-long-double-precision</code>. The default is to use the
-
longest available float type that fits inside a pointer.</p>
-
</dd></dl>
-
-
+
<hr /> <dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>
Constant
</span>
-
<span class='homogen--name'><b>
FLOAT
_
PRECISION</b></span><br>
-
<span class='homogen--
type
'>Constant
</
span>
-
<span class='homogen--name'><
b>
DOUBLE_PRECISION
</
b></
span>
<br>
-
<span class='homogen--type'>Constant</span>
-
<span class='homogen--name'><b>LONG_DOUBLE_PRECISION</b></span><br>
+
<dt class='head--type'><span class='homogen--type'>
Method
</span>
+
<span class='homogen--name'><b>
set
_type</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
constant
</code>
Float.
<code class='
constant
'>
FLOAT
_
PRECISION
</code></code><br>
-
<code><code class='
datatype
'>
constant
</code>
Float.
<
code
class='
constant
'>
DOUBLE
_
PRECISION
</code></code><
br
>
-
<code><code class='datatype'>
constant
</code>
Float.
<code class='
constant
'>
LONG_DOUBLE_PRECISION
</code></code></p></dd>
+
<dd><p><code><code class='
object unresolved'>UDP</code> <b><span class='method'>set_type</span>(</b><code class='
datatype'>
int
</code> <code class='
argument
'>
sock
_
type
</code><
b>)<
/
b></
code><br>
+
<code><code class='
object unresolved
'>
UDP
</code> <
b><span
class='
method
'>
set
_
type
</
span>(</b><
code
class='datatype'
>
int
</code>
<
code class='argument'
>
sock_type
<
/
code>
,
<code class='datatype'>
int
</code> <code class='
argument
'>
family
</code><
b>)<
/
b></
code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Tells
which
C compiler float
type
that is used for Pike floats.
-
Only one of these constants will exist (with the value <code class='expr'>1</code>)
-
at runtime.</p>
-
<dl class='group--doc'><dt>FLOAT_PRECISION</dt>
-
<dd><p>The <code class='expr'>float</code> type of the C compiler is used.</p>
-
</dd>
-
<dt>DOUBLE_PRECISION</dt>
-
<dd><p>The <code class='expr'>double</code> type of the C compiler is used.</p>
-
</dd>
-
<dt>LONG_DOUBLE_PRECISION</dt>
-
<dd><p>The <code class='expr'>long double</code> type of the C compiler is used.</p>
-
</dd>
-
</dl>
-
</dd>
-
<dt class='head--doc'>Note</dt>
-
<dd class='body--doc'><p>The float type can be controlled when Pike is compiled with the
-
configure flags <code class='expr'>--with-double-precision</code>
and
-
<code
class='expr'>--with-long-double-precision</code>
.
The default is to use the
-
longest available float type that fits inside a pointer.
</p>
+
<dd class='body--doc'><p>
Sets
socket
type and
protocol
family
.</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
isnan
</b></span>
+
<span class='homogen--name'><b>
wait
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>bool</code> <b><span class='method'>
isnan
</span>(</b><code class='datatype'>float</code> <code class='argument'>
x
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>bool</code> <b><span class='method'>
wait
</span>(</b><code class='datatype'>
int</code>|<code class='datatype'>
float</code> <code class='argument'>
timeout
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Returns
true
if <code>
x
</code>
is
nan
.</p>
+
<dd class='body--doc'><p>
Check for data and wait max. <code>timeout</code> seconds.</p>
+
</dd>
+
<dt class='head--doc'>
Returns
</dt>
+
<dd
class='body--doc'><p>Returns
<code class='expr'>1</code>
if
data are ready,
<code
class='expr'
>
0
</code>
(zero)
otherwise
.</p>
</dd></dl>
-
</dd></dl><dl><dt><h2 class='header'>Module <b class='ms datatype'>
Function
</b></h2>
+
</dd></dl><dl><dt><h2 class='header'>Module <b class='ms datatype'>
Stdio.Terminfo
</b></h2>
</dt><dd> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
Y
</b></span>
+
<span class='homogen--name'><b>
getFallbackTerm
</b></span>
</dt>
-
<dd><p><code><code class='
datatype
'>
function
</code>
(:
<code class='
datatype
void
'>
void
</code>
)
<b><span class='method'>
Y
</span>(</b><code class='datatype'>
function
</code>
(:<code
class='datatype void'>void
<
/
code
>)
<code
class='argument'>
f
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='
modifier
'>
protected
</code>
<code class='
object
unresolved
'>
Termcap
</code> <b><span class='method'>
getFallbackTerm
</span>(</b><code class='datatype'>
string
</code> <code class='argument'>
term
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
The
dreaded
fixpoint
combinator
"Y".</p>
-
<p>
The
Y
combinator
is
useful
when writing recursive lambdas
.
It
-
converts
a
lambda
that expects a self-reference as its first argument
-
into one which can be called without this argument
.</p>
+
<dd class='body--doc'><p>
Returns
an
object
describing
the
fallback
terminal
for
the
terminal
+
<code>term</code>
.
This
is
usually
equvivalent
to
<code>Stdio
.
Terminfo.getTerm("dumb")
</
code>.</
p>
</dd>
-
<dt class='head--doc'>Example</dt>
-
<dd class='example'><pre><p>This example creates a lambda that computes the faculty function.</p>
-
<pre><code><span class='ns'>Function</span><span class='delim'>.</span>Y<span class='delim'>(</span><span class='lang'>lambda</span><span class='delim'>(</span><span class='type'>function</span> f<span class='delim'>,</span> <span class='type'>int</span> n<span class='delim'>)</span> <span class='delim'>{</span> <span class='lang'>return</span> n<span class='delim'>></span>1? n<span class='delim'>*</span>f<span class='delim'>(</span>n<span class='delim'>-</span>1<span class='delim'>)</span> <span class='delim'>:</span> 1<span class='delim'>;</span> <span class='delim'>}</span><span class='delim'>)</span>
-
</code></pre>
-
</pre></dd>
+
<dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><
code>this_function<
/
code></
p>
+
<dd class='body--doc'><p>
Stdio.Terminfo.getTerm
</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
call_callback
</b></span>
+
<span class='homogen--name'><b>
getTerm
</b></span>
</dt>
-
<dd><p><code><code class='
datatype
'>
void
</code> <b><span class='method'>
call_callback
</span>(</b><code class='datatype'>
function
</code>
(:
<code class='datatype
void
'>void</code>
)
<code class='argument'>
f
</code>
,
<
code class='datatype'>mixed</code> ... <code class='argument'>args</code><
b>)</b></code></p></dd>
+
<dd><p><code><code class='
object unresolved
'>
Termcap
</code> <b><span class='method'>
getTerm
</span>(</b><code class='datatype'>
string
</code>
|
<code class='datatype'>void</code> <code class='argument'>
term
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Call
a
callback
function,
but
send
throws
from
the
callback
-
function
(ie
,
errors)
to
master
()
->handle_error
.
-
Also
accepts
if
f
is
zero
(0)
without
error
.</p>
+
<dd class='body--doc'><p>
Returns
an
object
describing
the
terminal
term.
If
term
is
not
specified
,
it
will
+
default
to
<code>getenv
(
"TERM"
)
</code> or if that fails to "dumb"
.
</p>
+
<p>
Lookup
of
terminal information will first be done in the systems terminfo
+
database, and
if
that
fails
in
the
termcap
database
.
If neither database exists, a
+
hardcoded entry for "dumb" will be used.
</p>
</dd>
-
<dt class='head--doc'>
Example
</dt>
-
<dd class='
example
'><
pre
>
<pre><code>Functions
.
call_callback(the_callback
,
some,arguments);</code></pre><p>equals</p>
-
<pre><code><span
class='delim'>{</span>
-
<span class='type'>mixed</span> err<span class='delim'>=</span><span class='lang'>catch</span> <span class='delim'>{</span> <span class='lang'>if</span> <span class='delim'>(</span>the_callback<span class='delim'>)</span> the_callback<span class='delim'>(</span>some<span class='delim'>
,
</span>arguments<span
class='delim'>)</span><span class='delim'>;</span> <span class='delim'>}</span><span class='delim'>;</span>
-
<span class='lang'>if</span> <span class='delim'>(</span>err<span class='delim'>)</span> master<span class='delim'>(</span><span class='delim'>)</span>->handle_error<span class='delim'>(</span>err<span class='delim'>)</span><span class='delim'>;</span>
-
<span class='delim'>}</span>
-
</code></pre><p>(Approximately, since call_callback also calls handle_error
-
if 0 were thrown
.
)
</p>
-
</
pre></
dd></dl>
+
<dt class='head--doc'>
See also
</dt>
+
<dd class='
body--doc
'><
p
>
Stdio
.
Terminfo.getTerminfo
,
Stdio.Terminfo.getTermcap
,
Stdio
.
getFallbackTerm
</p>
+
</dd></dl>
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
composite
</b></span>
+
<span class='homogen--name'><b>
getTermcap
</b></span>
</dt>
-
<dd><p><code><code class='
datatype'>function</code>(:<code
class=
'
datatype void'
>
void
</code>
)
<b><span class='method'>
composite
</span>(</b><code class='datatype'>
function
</code>
(:<code
class='datatype void'>void
<
/
code
>)
... <code
class='argument'>
f
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='
object
unresolved
'>
Termcap
</code> <b><span class='method'>
getTermcap
</span>(</b><code class='datatype'>
string
</code> <code class='argument'>
term
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Creates
a
composite
function
of
the
provided
functions.
The
-
composition
function
of
f()
and
g(),
q(x)=f(g(x)),
is created by
-
<code class='expr'>function q = Function
.
composite(f, g);
</
code>.</
p>
+
<dd class='body--doc'><p>
Returns
the
terminal
description
object
for
<code>term</code>
from
the
+
systems
termcap
database.
Returns
0
if
not
found
.</p>
</dd>
-
<dt class='head--doc'>
Example
</dt>
-
<dd class='
example
'><
pre
>
<pre><code>map<span class='delim'>(</span>input<span class='delim'>/</span><span class='string'>"
,
"</span><span
class='delim'>,</span>
-
<span class='ns'>Function</span><span class='delim'>
.
</span>composite<span class='delim'>(</span><span class='ns'>String</span><span class='delim'>
.</
span
>
trim<span class='delim'>,</span> upper_case<span class='delim'>)</span><span class='delim'>)</span><span class='delim'>;</span>
-
</
code></pre>
-
</pre></
dd></dl>
+
<dt class='head--doc'>
See also
</dt>
+
<dd class='
body--doc
'><
p
>
Stdio.Terminfo.getTerm
,
Stdio
.
Terminfo
.
getTerminfo
</
p
>
+
</dd></dl>
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
curry
</b></span>
+
<span class='homogen--name'><b>
getTerminfo
</b></span>
</dt>
-
<dd><p><code><code class='
datatype'>function</code>(<code
class=
'
datatype'
>
mixed
</code>
... :
<
code class='datatype'>function</code>(<code class='datatype'>mixed</code> ... :<code class='datatype'>mixed</code>|<code class='datatype'>void</code>)) <
b><span class='method'>
curry
</span>(</b><code class='datatype'>
function
</code>
(:<code
class='datatype void'>void
<
/
code
>)
<code
class='argument'>
f
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='
object
unresolved
'>
Terminfo
</code> <b><span class='method'>
getTerminfo
</span>(</b><code class='datatype'>
string
</code> <code class='argument'>
term
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Partially
evaluate
a
function
call.</p>
-
<p>
This
function allows N parameters to be given to a function taking
-
M parameters (N<=M), yielding a new function taking M-N parameters.
<
/p
>
-
<
p
>
What is actually returned
from
this function is a function taking N
-
parameters,
and
returning
a
function
taking
M-N
parameters
.</p>
+
<dd class='body--doc'><p>
Returns
the
terminal
description
object
for
<
code
>
term
<
/code
> from
the
+
systems
terminfo
database.
Returns
0
if
not
found
.</p>
</dd>
-
<dt class='head--doc'>
Example
</dt>
-
<dd class='
example
'><
pre><
p>
This
example creates a function adding 7 to its argument
.</p>
-
<
pre><code>Function.curry(`+)(7)<
/
code></pre>
-
</pre></
dd></dl>
+
<dt class='head--doc'>
See also
</dt>
+
<dd class='
body--doc
'><p>
Stdio.Terminfo.getTerm,
Stdio
.
Terminfo.getTermcap
</p>
+
</dd></dl>
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
defined
</b></span>
+
<span class='homogen--name'><b>
is_tty
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
string
</code> <b><span class='method'>
defined
</span>(</b><
code class='datatype'>function</code>(:<code class='datatype void'>void</code>) <code class='argument'>fun</code><
b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
int
</code> <b><span class='method'>
is_tty
</span>(</b><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Returns
a
string
with filename and linenumber where
<code>
fun
</code>
-
was
defined.</p>
-
<p>
Returns <code class='expr'>0</code> (zero) when no line
can
be
found
,
e.g.
for
-
builtin functions
and
functions
in destructed objects
.</p>
+
<dd class='body--doc'><p>Returns
1
if
<code>
Stdio.stdin
</code>
is
connected
to
an interactive
+
terminal
that
can
handle
backspacing
,
carriage
return without
+
linefeed,
and
the
like
.</p>
</dd></dl>
-
+
<dl><dt><h2 class='header'>Class <b class='ms datatype'>Stdio.Terminfo.MetaTerminfoDB</b></h2>
+
</dt><dd><dl class='group--doc'>
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p><code>TerminfoDB</code> that merges several directorys.</p>
+
</dd></dl>
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
splice_call
</b></span>
+
<span class='homogen--name'><b>
create
</b></span>
</dt>
-
<dd><p><code><
code
class='
datatype
'>
mixed
</
code
> <
b><
span class='
method
'>
splice_call
</span>(</b><code class='datatype'>array</code>
<code class='argument'>args</code>, <code class='datatype'>function</code>
(
:
<code class='
datatype
void
'>
void
</code>
)
<code class='
argument'>f</code>, <code class='
datatype'>
mixed
</code>|<code class='datatype'>void</code>
...
<code class='argument'>
extra
</code><b>)</b></code></p></dd>
+
<dd><p><code><
span
class='
object
'>
Stdio.Terminfo.MetaTerminfoDB
</
span
> <span class='
class
'>
Stdio.Terminfo.MetaTerminfoDB
</span>
<b>
(</b><code class='datatype'>array</code>
(
<code class='
object
unresolved
'>
TerminfoDB
</code>
|
<code class='datatype'>
string
</code>)|<code class='datatype'>void</code> <code class='argument'>
dbs
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Calls
the
given
function
with the
<code>
args
</code>
array plus the optional
-
extra arguments as its arguments and returns the result
.</p>
-
<p> Most useful in conjunction with <code>map</code>, and particularly in combination
-
with <code>sscanf</code> with <code class='expr'>"...%{...%}..."</code> scan strings (which indeed
-
was what it was invented for in the first place).</p>
+
<dd class='body--doc'><p>
Create
a
new
Meta
<code>
TerminfoDB
</code>.</p>
</dd>
-
<dt class='head--doc'><span id='p-
args
'></span>Parameter <code class='parameter'>
args
</code></dt>
-
<dd></dd><dd class='body--doc'><p>
The
first
arguments
the
function
<code>
f
</code>
expects
.</p>
+
<dt class='head--doc'><span id='p-
dbs
'></span>Parameter <code class='parameter'>
dbs
</code></dt>
+
<dd></dd><dd class='body--doc'><p>
Array
with
elements
in
priority
order. Elements may be either
<
/p>
+
<table class='box'><tr><td><
code><
code class='object unresolved'>TerminfoDB<
/code>
</code></td><td><p>An
active <code>TerminfoDB</code>
.</p>
+
</td></tr>
+
<tr><td><code><code class='datatype'>string</code></code></td><td><p>A directory that may exist and contain a terminfo database.</p>
+
</td></tr>
+
</table>
</dd>
-
<dt class='head--doc'><span id='p-f'></span>Parameter <code class='parameter'>f</code></dt>
-
<dd></dd><dd class='body--doc'><p>The function to apply the arguments on.</p>
-
</dd>
-
<dt class='head--doc'><span id='p-extra'></span>Parameter <code class='parameter'>extra</code></dt>
-
<dd></dd><dd class='body--doc'><p>Optional extra arguments to send to <code>f</code>.</p>
-
</dd>
+
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>
Whatever
the
supplied
function
<code>
f
</code>
returns.</p>
-
</dd>
-
<dt class=
'
head--doc'>Example</dt>
-
<dd class='example'><pre><pre><code><span class='type'>class</span> Product<span class='delim'>(</span><span class='type'>string</span> name<span class='delim'>,</span> <span class='type'>string</span> version<span class='delim'>)</span>
-
<span class='delim'>{</span>
-
<span class='type'>string</span> _sprintf<span class='delim'>(</span><span class='delim'>)</span>
-
<span class='delim'>{</span>
-
<span class='lang'>return</span> sprintf<span class='delim'>(</span><span class='string'>"Product(%
s
/%s)"</span><span
class='delim'>,</span>
name<span class='delim'>
,
</span> version<span class='delim'>)</span><span class='delim'>;</span>
-
<span
class='delim'>}</span>
-
<span class='delim'>}</span>
-
map<span class='delim'>(</span><span class='delim'>(</span><span class='delim'>{</span> <span class='delim'>(</span><span class='delim'>{</span> <span class='string'>"pike"</span><span class='delim'>,</span> <span class='string'>"7.1.11"</span> <span class='delim'>}</span><span class='delim'>)</span><span class='delim'>,</span>
-
<span class='delim'>(</span><span class='delim'>{</span> <span class='string'>"whitefish"</span><span class='delim'>,</span> <span class='string'>"0.1"</span> <span class='delim'>}</span><span class='delim'>)</span> <span class='delim'>}</span><span class='delim'>)</span><span class='delim'>,</span>
-
<span class='ns'>Function</span><span class='delim'>.</span>splice_call<span class='delim'>,</span> Product<span class='delim'>)</span><span class='delim'>;</span>
-
<span class='delim'>(</span><span class='delim'>{</span> <span class='comment'>/* 2 elements */</span>
-
Product<span class='delim'>(</span>pike<span class='delim'>/</span>7.1<span class='delim'>.</span>11<span class='delim'>)</span><span class='delim'>,</span>
-
Product<span class='delim'>(</span>whitefish<span class='delim'>/</span>0.1<span class='delim'>)</span>
-
<span class='delim'>}</span><span class='delim'>)</span>
-
</code></pre>
-
</pre></dd></dl>
-
-
-
<hr />
-
<dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>uncurry</b></span>
-
</dt>
-
<dd><p><code><code class='datatype'>function</code>(<code class='datatype'>mixed</code> ... :<code class='datatype'>mixed</code>) <b><span class='method'>uncurry</span>(</b><code class='datatype'>function</code>(:<code class='datatype void'>void</code>) <code class='argument'>f</code><b>)</b></code></p></dd>
-
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>This function, given a function taking N parameters, returns a new
-
function taking N+1 parameters. The first argument
will be
-
ignored
.</p>
-
</dd>
-
<
dt class='head--doc'>Example<
/
dt
>
-
<
dd class='example'><pre><pre><code>> Function.uncurry(`+)(7,2,3)
-
Result: 5<
/
code></pre>
-
</pre></
dd></dl>
-
<dl><dt><h2 class='header'>Class <b class='ms datatype'>
Function
.
bind
</b></h2>
+
<dd class='body--doc'><p>
If
the
resulting
set
of
<code>
TerminfoDB
</code>'s
is
empty
,
+
the
object
will be
destructed
.</p>
+
</dd></
dl
>
+
</dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>
Stdio
.
Terminfo.Termcap
</b></h2>
</dt><dd><dl class='group--doc'> <dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Partially
evaluate
a
function call
.</p>
-
<
p> This function returns a function that when called will do the
-
specified argument mapping. It is similar to <code>curry<
/
code>, but allows
-
more dynamic changes of the argument evaluation, you can leave the
-
first argument unspecified while setting others, or simply change
-
the argument order.</p>
-
</
dd>
-
<
dt class='head--doc'><span id='p-f'><
/
span>Parameter <code class='parameter'>f</code></dt>
-
<dd></dd><dd class='body--doc'><p>The first argument is the function to be called.</p>
-
</dd>
-
<dt class='head--doc'><span id='p-bind_args'></span>Parameter <code class='parameter'>bind_args</code></dt>
-
<dd></dd><dd class='body--doc'><p>All other arguments are either a generic value, which will be sent
-
as-is to the function or one of the placeholder values defined in
-
<code>Function.Placeholder</code>, or one of your own implementation (inherit
-
<code>Function.Placeholder.Base</code> and implement the value function.).</p>
-
</dd>
-
<dt class='head--doc'>Example</dt>
-
<dd class='example'><pre><p>This example returns a function that limits the given argument
-
to between 0 and 99.</p>
-
<pre><code><span class='lang'>import</span> <span class='ns'>Function</span><span class='delim'>.</span>Placeholder<span class='delim'>;</span>
-
<span class='type'>function</span> clip <span class='delim'>=</span> <span class='ns'>Function</span><span class='delim'>.</span>bind<span class='delim'>(</span>limit<span class='delim'>,</span> 0<span class='delim'>,</span> arg0<span class='delim'>,</span> 100<span class='delim'>)</span><span class='delim'>;</span>
-
</code></pre>
-
</pre></dd></
dl>
+
<dd class='body--doc'><p>
Termcap
terminal
description
object
.</p>
+
</dd></dl>
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Variable</span>
-
<span class='homogen--name'><b>
f
</b></span>
<br>
-
<span class='homogen--type'>Variable</span>
-
<span class='homogen--name'><b>bind_args</b></span><br>
+
<span class='homogen--name'><b>
aliases
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
function</code>(:<code class='datatype void'>void</code>) Function.bind.<b><span class='variable'>f</span></b></code><br>
-
<code><code class='datatype'>
array</code>(<code class='datatype'>
mixed
</code>)
Function
.
bind
.<b><span class='variable'>
bind_args
</span></b></code></p></dd>
+
<dd><p><code><code class='datatype'>
array
</code>(<code class='datatype'>
string
</code>)
Stdio
.
Terminfo
.
Termcap
.<b><span class='variable'>
aliases
</span></b></code></p></dd>
</dl>
2455:
<dt class='head--type'><span class='homogen--type'>Method</span> <span class='homogen--name'><b>create</b></span> </dt>
-
<dd><p><code><span class='object'>
Function
.
bind
</span> <span class='class'>
Function
.
bind
</span><b>(</b><code class='datatype'>
function
</code>
(:
<code class='
datatype
void
'>void</code>
)
<code class='argument'>
f
</code>, <code class='datatype'>
mixed
</code>
...
<code class='argument'>
bind_args
</code><b>)</b></code></p></dd>
+
<dd><p><code><span class='object'>
Stdio
.
Terminfo.Termcap
</span> <span class='class'>
Stdio
.
Terminfo.Termcap
</span><b>(</b><code class='datatype'>
string
</code>
<code class='
argument'>cap</code>,
<code class=
'
object unresolved'
>
TermcapDB</code>|<code class='datatype'>
void</code> <code class='argument'>
tcdb
</code>, <code class='datatype'>
int
</code>
|<code
class='datatype'>void</code>
<code class='argument'>
maxrecurse
</code><b>)</b></code></p></dd>
</dl>
-
</dd></dl><dl><dt><h2 class='header'>Module <b class='ms datatype'>Function.Placeholder</b></h2>
-
</dt><dd><dl class='group--doc'>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Placeholder arguments for <code>Function.bind</code></p>
-
</dd></dl>
+
-
<hr />
-
<dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Constant</span>
-
<span class='homogen--name'><b>arg0</b></span><br>
-
<span class='homogen--type'>Constant</span>
-
<span class='homogen--name'><b>arg1</b></span><br>
-
<span class='homogen--type'>Constant</span>
-
<span class='homogen--name'><b>arg2</b></span><br>
-
<span class='homogen--type'>Constant</span>
-
<span class='homogen--name'><b>arg3</b></span><br>
-
<span class='homogen--type'>Constant</span>
-
<span class='homogen--name'><b>arg4</b></span><br>
-
<span class='homogen--type'>Constant</span>
-
<span class='homogen--name'><b>arg5</b></span><br>
-
<span class='homogen--type'>Constant</span>
-
<span class='homogen--name'><b>arg6</b></span><br>
-
<span class='homogen--type'>Constant</span>
-
<span class='homogen--name'><b>arg7</b></span><br>
-
<span class='homogen--type'>Constant</span>
-
<span class='homogen--name'><b>arg8</b></span><br>
-
<span class='homogen--type'>Constant</span>
-
<span class='homogen--name'><b>arg9</b></span><br>
-
</dt>
-
<dd><p><code><code class='datatype'>constant</code> Function.Placeholder.<code class='constant'>arg0</code></code><br>
-
<code><code class='datatype'>constant</code> Function.Placeholder.<code class='constant'>arg1</code></code><br>
-
<code><code class='datatype'>constant</code> Function.Placeholder.<code class='constant'>arg2</code></code><br>
-
<code><code class='datatype'>constant</code> Function.Placeholder.<code class='constant'>arg3</code></code><br>
-
<code><code class='datatype'>constant</code> Function.Placeholder.<code class='constant'>arg4</code></code><br>
-
<code><code class='datatype'>constant</code> Function.Placeholder.<code class='constant'>arg5</code></code><br>
-
<code><code class='datatype'>constant</code> Function.Placeholder.<code class='constant'>arg6</code></code><br>
-
<code><code class='datatype'>constant</code> Function.Placeholder.<code class='constant'>arg7</code></code><br>
-
<code><code class='datatype'>constant</code> Function.Placeholder.<code class='constant'>arg8</code></code><br>
-
<code><code class='datatype'>constant</code> Function.Placeholder.<code class='constant'>arg9</code></code></p></dd>
+
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>arg<n> will return an instance of <code>Arg</code> that returns the n:th arg.
-
For convenience for c++11 developers _0, _1 etc also works.</p>
-
<p> Note that arg0 is the first argument, not arg1</p>
-
</dd></dl>
-
-
+
<hr /> <dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Variable</span>
-
<span class='homogen--name'><b>rest</b></span>
-
</dt>
-
<dd><p><code><code class='object unresolved'>Arg</code> Function.Placeholder.<b><span class='variable'>rest</span></b></code></p></dd>
-
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Return all arguments not used by any <code>Arg</code> or <code>Splice</code>.</p>
-
<p> Unlike <code>Splice</code> this will return non-continous unused arguments.</p>
-
</dd>
-
<dt class='head--doc'>Example</dt>
-
<dd class='example'><pre><p>This creates a version of call_out that has the function argument as
-
the last argument</p>
-
<pre><code>import Function.Placeholder;
-
Function.bind( call_out, Arg(-1), rest)</code></pre>
-
</pre></dd></dl>
-
<dl><dt><h2 class='header'>Class <b class='ms datatype'>Function.Placeholder.Arg</b></h2>
-
</dt><dd><dl class='group--doc'>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Arg(x) returns the value of argument X</p>
-
</dd></dl>
-
-
<hr />
-
<dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>create</b></span>
-
</dt>
-
<dd><p><code><span class='object'>Function.Placeholder.Arg</span> <span class='class'>Function.Placeholder.Arg</span><b>(</b><code class='datatype'>int</code> <code class='argument'>num</code><b>)</b></code></p></dd>
-
</dl>
-
-
-
<hr />
-
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Inherit</span>
-
<span class='homogen--name'><b>
Base
</b></span>
+
<span class='homogen--name'><b>
TermMachine
</b></span>
</dt>
-
<dd><p><code><span class='datatype'>inherit
Base
</span> : <span class='inherit'>
Base
</span></code></p></dd>
+
<dd><p><code><span class='datatype'>inherit
TermMachine
</span> : <span class='inherit'>
TermMachine
</span></code></p></dd>
</dl> <hr /> <dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Variable</span>
-
<span class='homogen--name'><b>num</b></span>
-
</dt>
-
<dd><p><code><code class='datatype'>int</code> Function.Placeholder.Arg.<b><span class='variable'>num</span></b></code></p></dd>
-
</dl>
-
-
-
<hr />
-
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
value
</b></span>
+
<span class='homogen--name'><b>
tputs
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
mixed
</code> <b><span class='method'>
value
</span>(</b><code class='
object unresolved'>bind</code> <code class='argument'>x</code>, <code class='
datatype'>
array
</code> <code class='argument'>
args
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
string
</code> <b><span class='method'>
tputs
</span>(</b><code class='datatype'>
string
</code> <code class='argument'>
s
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
The
function
that is called to return the argument value.
</p>
+
<dd class='body--doc'><p>
Put
termcap
string
</p>
</dd></dl>
-
</dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>
Function
.
Placeholder
.
Expr
</b></h2>
+
</dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>
Stdio
.
Terminfo
.
TermcapDB
</b></h2>
</dt><dd><dl class='group--doc'> <dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Expr(x)
returns the result of calling
<
code>x<
/
code>.
-
The function will be passed the list of arguments.</
p>
-
<
p> If _splice is true, zero or more argument is returned in an array<
/
p
>
-
<
p> Function.Placeholder.arg1 is thus more or less equivalent to<
/
p
>
-
<
pre><code>Expr<span class='delim'>(<
/
span
><
span class='lang'>lambda<
/
span
><
span class='delim'
>
(
<
/span
><
span
class='
type
'>
array</span>
args
<
span
class='
delim'>)</span><span
class=
'
delim'
>
{
</
span
><
span class='lang'>return<
/
span
>
args
<
span class='delim'>[<
/
span
>
1
<
span class='delim'
>
]
<
/span><span
class='
delim
'>
;
<
/span><span
class='
delim
'>
}
</
span
><
span
class='
delim
'>
)
<
/span
>
<span
class='delim'>;
</
span
>
-
</code></pre>
+
<dd class='body--doc'><p>
Termcap
database
</p>
+
</
dd
></
dl
></
dd
></
dl
><
dl
><
dt
><
h2
class='
header
'>
Class
<
b
class='
ms
datatype
'>
Stdio.Terminfo.Terminfo
</
b
></
h2
>
+
</
dt
><
dd
><
dl
class='
group--doc
'>
+
<
dt
class='
head--doc
'>
Description
</
dt
>
+
<
dd
class='
body--doc
'><
p
>
Terminfo
terminal description object
</
p
>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Variable</span>
-
<span class='homogen--name'><b>
func
</b></span>
<br>
-
<span class='homogen--type'>Variable</span>
-
<span class='homogen--name'><b>_splice</b></span><br>
+
<span class='homogen--name'><b>
aliases
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
function
</code>(
:
<code class='datatype
void
'>
void
</code>)
Function
.
Placeholder
.
Expr
.<b><span class='variable'>
func
</span></b></code><
br>
-
<code><code class='datatype'>void<
/
code>|<code class='object unresolved'>bool</code> Function.Placeholder.Expr.<b><span class='variable'>_splice</span></b></code></
p></dd>
+
<dd><p><code><code class='datatype'>
array
</code>(<code class='datatype'>
string
</code>)
Stdio
.
Terminfo
.
Terminfo
.<b><span class='variable'>
aliases
</span></b></code></p></dd>
</dl>
2592:
<dt class='head--type'><span class='homogen--type'>Method</span> <span class='homogen--name'><b>create</b></span> </dt>
-
<dd><p><code><span class='object'>
Function
.
Placeholder
.
Expr
</span> <span class='class'>
Function
.
Placeholder
.
Expr
</span><b>(</b><code class='datatype'>
function
</code>
(:<code
class='datatype void'>void
<
/
code
>)
<code
class='argument'>
func
</code>
,
<
code class='datatype'>void</code>|<code class='object unresolved'>bool</code> <code class='argument'>_splice</code><
b>)</b></code></p></dd>
+
<dd><p><code><span class='object'>
Stdio
.
Terminfo
.
Terminfo
</span> <span class='class'>
Stdio
.
Terminfo
.
Terminfo
</span><b>(</b><code class='datatype'>
string
</code> <code class='argument'>
filename
</code><b>)</b></code></p></dd>
</dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Inherit</span>
-
<span class='homogen--name'><b>
Base
</b></span>
+
<span class='homogen--name'><b>
TermMachine
</b></span>
</dt>
-
<dd><p><code><span class='datatype'>inherit
Base
</span> : <span class='inherit'>
Base
</span></code></p></dd>
+
<dd><p><code><span class='datatype'>inherit
TermMachine
</span> : <span class='inherit'>
TermMachine
</span></code></p></dd>
</dl>
-
</dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>Function.Placeholder.Splice</b></h2>
-
</dt><dd><dl class='group--doc'>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Splice(from) adds all arguments starting with argument number <code class='expr'>from</code>,
-
optionally ending with end.
-
Equivalent to <code class='expr'>args[from .. end]</code></p>
-
</dd></dl>
+
-
<hr />
-
<dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>create</b></span>
-
</dt>
-
<dd><p><code><span class='object'>Function.Placeholder.Splice</span> <span class='class'>Function.Placeholder.Splice</span><b>(</b><code class='datatype'>int</code> <code class='argument'>from</code>, <code class='datatype'>void</code>|<code class='datatype'>int</code> <code class='argument'>end</code><b>)</b></code></p></dd>
-
</dl>
+
-
+
<hr /> <dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Variable</span>
-
<span class='homogen--name'><b>from</b></span><br>
-
<span class='homogen--type'>Variable</span>
-
<span class='homogen--name'><b>end</b></span><br>
-
</dt>
-
<dd><p><code><code class='datatype'>int</code> Function.Placeholder.Splice.<b><span class='variable'>from</span></b></code><br>
-
<code><code class='datatype'>void</code>|<code class='datatype'>int</code> Function.Placeholder.Splice.<b><span class='variable'>end</span></b></code></p></dd>
-
</dl>
-
-
-
<hr />
-
<dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Inherit</span>
-
<span class='homogen--name'><b>Base</b></span>
-
</dt>
-
<dd><p><code><span class='datatype'>inherit Base</span> : <span class='inherit'>Base</span></code></p></dd>
-
</dl>
-
</dd></dl></dd></dl></dd></dl><dl><dt><h2 class='header'>Module <b class='ms datatype'>Program</b></h2>
-
</dt><dd>
-
-
<hr />
-
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
all_inherits
</b></span>
+
<span class='homogen--name'><b>
tputs
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
array
</code>
(<code
class='datatype'>program
<
/code>) <
b><span class='method'>
all_inherits
</span>(</b><code class='datatype'>
program
</code> <code class='argument'>
p
</code><b>)</b></code></p></dd>
-
+
<dd><p><code><code class='datatype'>
string
</code> <b><span class='method'>
tputs
</span>(</b><code class='datatype'>
string
</code> <code class='argument'>
s
</code><b>)</b></code></p></dd>
+
<dt class='head--fixme'>FIXME</dt>
+
<dd class='body--fixme'><p>Document this function</p>
+
</dd></dl>
+
</dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>Stdio.Terminfo.TerminfoDB</b></h2>
+
</dt><dd><dl class='group--doc'>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Enumerate
all
programs
this program inherits, directly or indirectly.
-
Similar to inherit_tree() but returns
a
flat
array
.</p>
-
</dd>
-
<
dt class='head--doc'
>
Example
</
dt
>
-
<dd
class='example'
><
pre
><
p
>
>
class
a{}
-
>
class
b{}
-
> class c{ inherit a; }
-
> class d{ inherit b; inherit c; }
-
> Program
.
inherit_tree(d);
-
Result: ({
/
* 3 elements */
-
b
,
-
c,
-
a
-
})
</
p
>
-
</
pre
><
/
dd>
</dl>
+
<dd class='body--doc'><p>
Terminfo
database
for
a
single
directory
.</p>
+
</dd><
/dl
></
dd
><
/dl></
dd><
/dl
><
dl
>
<dt><h2
class
='header'>Class
<b
class
='ms
datatype'>Stdio
.
Readline<
/b
>
</
h2
>
+
</
dt
><dd>
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
defined
</b></span>
+
<span class='homogen--name'><b>
add_to_kill_ring
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
string
</code> <b><span class='method'>
defined
</span>(</b><code class='datatype'>
program
</code> <code class='argument'>
p
</code><b>)</b></code></p></dd>
-
-
<dt class='head--
doc
'>
Description
</dt>
-
<dd class='body--
doc
'><p>
Returns
a
string with filename and linenumber describing where
-
the program
<
code>p<
/
code> was defined.</
p>
-
<p> The returned string is of the format <code class='expr'>"filename:linenumber"</code>.</p>
-
<p> If it cannot be determined where the program was defined, <code class='expr'>0</code>
-
(zero) will be returned.</p>
+
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
add_to_kill_ring
</span>(</b><code class='datatype'>
string
</code> <code class='argument'>
s
</code><b>)</b></code></p></dd>
+
<dt class='head--
fixme
'>
FIXME
</dt>
+
<dd class='body--
fixme
'><p>
Document
this
function
</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
defined
</b></span>
+
<span class='homogen--name'><b>
create
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>string</code> <
b
><
span
class='
method
'>
defined
</
span
>
(
</
b
><code class='datatype'>
program
</code> <code class='argument'>
x
</code>, <code class='datatype'>string</code> <code class='argument'>
identifier
</code><b>)</b></code></p></dd>
+
<dd><p><code><
span class='object'>Stdio.Readline</span> <span class='class'>Stdio.Readline</span><b>(</b><
code class='datatype'>
object</code>|<code class='datatype'>void</code> <code class='argument'>infd</code>, <code class='datatype'>object</code>|<code class='datatype'>
string</code>
|<code
class='datatype'>void
<
/code
>
<
code
class='
argument
'>
interm
</
code
>
,
<
code class='datatype'>object<
/
code
>
|
<code class='datatype'>
void
</code> <code class='argument'>
outfd
</code>, <code class='datatype'>
object</code>|<code class='datatype'>
string</code>
|<code
class='datatype'>void
<
/
code
>
<code
class='argument'>
outterm
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Returns
a
string
with
filename
and
linenumber
where
<code>
idenfifier
</code>
-
in
<code>
x
</code>
was defined
.</p>
-
<
p
>
Returns
<code class='
expr
'>
0
</code>
(zero)
when
no
line
can
be
found,
e
.
g
.
for
-
builtin
functions.
</
p
>
-
<p>
If
<code>
idenfier
</code>
can
not
be
found
in
<code>
x
</code>
this
function
returns
-
where
the
program
is
defined
.</p>
+
<dd class='body--doc'><p>
Creates
a
Readline
object,
that
takes
input
from
<code>
infd
</code>
and
has
output
+
on
<code>
outfd
</code>.</p>
+
<
/dd
>
+
<dt
class='head--doc'><span
id='p-infd'></span>Parameter
<code
class='parameter'>infd
<
/
code
></dt>
+
<dd></dd><dd
class='
body--doc
'><
p>Defaults to <code>Stdio.stdin<
/code>
.</p>
+
</dd>
+
<dt
class='head--doc'><span
id='p-interm'></span>Parameter
<code
class='parameter'>interm</code></dt>
+
<dd></dd><dd
class='body--doc'><p>Defaults
to
<code>Stdio
.
Terminfo
.
getTerm()</code>.</p>
+
</dd>
+
<dt
class='head--doc'><span
id='p-outfd'></span>Parameter
<code
class='parameter'>outfd
</
code
>
</dt>
+
<
dd></dd><dd class='body--doc'><
p>
Defaults
to
<code>infd</code>,
unless
<code>
infd
</code>
is
0,
in
which
case
+
<code>
outfd
</code>
defaults
to
<code>Stdio.stdout</code>.</p>
+
</dd>
+
<dt
class='head--doc'><span
id='p-outterm'></span>Parameter
<code
class='parameter'>outterm</code></dt>
+
<dd></dd><dd
class='body--doc'><p>Defaults
to
<code>interm</code>
.</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
implements
</b></span>
+
<span class='homogen--name'><b>
delete
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
int
</code> <b><span class='method'>
implements
</span>(</b><code class='datatype'>
program
</code> <code class='argument'>
prog
</code>, <code class='datatype'>
program
</code> <code class='argument'>
api
</code><b>)</b></code></p></dd>
-
-
<dt class='head--
doc
'>
Description
</dt>
-
<dd class='body--
doc
'><p>
Returns
1
if
<
code>prog<
/
code> implements <code>api</code>.</
p>
+
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
delete
</span>(</b><code class='datatype'>
int
</code> <code class='argument'>
p1
</code>, <code class='datatype'>
int
</code> <code class='argument'>
p2
</code><b>)</b></code></p></dd>
+
<dt class='head--
fixme
'>
FIXME
</dt>
+
<dd class='body--
fixme
'><p>
Document
this
function
</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
inherit
_
list
</b></span>
+
<span class='homogen--name'><b>
delta
_
history
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
array
</code>
(<code
class='datatype'>program
<
/code>) <
b><span class='method'>
inherit
_
list
</span>(</b><code class='datatype'>
program
</code> <code class='argument'>
p
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
delta
_
history
</span>(</b><code class='datatype'>
int
</code> <code class='argument'>
d
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Returns
an
array
with
the
programs
that
<code>
p
</code>
has
inherited
.</p>
+
<dd class='body--doc'><p>
Changes
the
line
to
a line from
the
history
<code>
d
</code>
steps
from the
+
current entry (0 being the current line, negative values older,
+
and positive values newer)
.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>Only effective if you have a history object.</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
inherit_tree
</b></span>
+
<span class='homogen--name'><b>
edit
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
array
</code> <b><span class='method'>
inherit_tree
</span>(</b><code class='datatype'>
program
</code> <code class='argument'>
p
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
string
</code> <b><span class='method'>
edit
</span>(</b><code class='datatype'>
string
</code> <code class='argument'>
data
</code>
,
<
code class='datatype'>string</code>|<code class='datatype'>void</code> <code class='argument'>local_prompt</code>, <code class='datatype'>array</code>(<code class='datatype'>string</code>)|<code class='datatype'>void</code> <code class='argument'>attrs</code><
b>)</b></code></p></dd>
+
<dt class='head--fixme'>FIXME</dt>
+
<dd class='body--fixme'><p>Document this function</p>
+
</dd></dl>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Recursively builds a inheritance tree by
-
fetching programs inheritance lists.</p>
-
</dd>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>Returns an array with programs or arrays
-
as elements.</p>
-
</dd>
-
<dt class='head--doc'>Example</dt>
-
<dd class='example'><pre><p>> class a{}
-
> class b{}
-
> class c{ inherit a; }
-
> class d{ inherit b; inherit c; }
-
> Program.inherit_tree(d);
-
Result: ({ /* 3 elements */
-
d,
-
({ /* 1 element */
-
program
-
}),
-
({ /* 2 elements */
-
c,
-
({ /* 1 element */
-
program
-
})
-
})
-
})</p>
-
</pre></dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
inherits
</b></span>
+
<span class='homogen--name'><b>
enable_history
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
int
</code> <b><span class='method'>
inherits
</span>(</b><code class='datatype'>
program
</code>
|
<code class='datatype'>
object
</code>
<code class='
argument
'>
child
</code>
,
<code class='datatype'>
program
</code> <code class='argument'>
parent
</code><b>)</b></code></p></dd>
-
-
<dt class='head--
doc
'>
Description
</dt>
-
<dd class='body--
doc
'><p>
Returns
1
if
<
code>child<
/
code> has inherited <code>parent</code>.</
p>
+
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
enable_history
</span>(</b><code class='datatype'>
array
</code>
(
<code class='datatype'>
string
</code>
)|
<code class='
object unresolved
'>
History
</code>
|
<code class='datatype'>
int
</code> <code class='argument'>
hist
</code><b>)</b></code></p></dd>
+
<dt class='head--
fixme
'>
FIXME
</dt>
+
<dd class='body--
fixme
'><p>
Document
this
function
</p>
</dd></dl>
-
</dd></dl><dl><dt><h2 class='header'>Module <b class='ms datatype'>ADT</b></h2>
-
</dt><dd><dl class='group--doc'>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Various Abstract Data Types.</p>
-
</dd></dl>
+
-
<hr />
-
<dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Inherit</span>
-
<span class='homogen--name'><b>_ADT</b></span>
-
</dt>
-
<dd><p><code><span class='datatype'>inherit _ADT</span> : <span class='inherit'>_ADT</span></code></p></dd>
-
</dl>
-
<dl><dt><h2 class='header'>Class <b class='ms datatype'>ADT.BitBuffer</b></h2>
-
</dt><dd><dl class='group--doc'>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Implements a FIFO bit buffer, i.e. a buffer that operates on bits
-
instead of bytes. It is not designed for performance, but as a way
-
to handle complicated file formats and other standards where you
-
may need to work on unaligned data units of sub byte size, without
-
having to fry your brain while keeping track of all the bits
-
yourself.</p>
-
</dd>
-
<dt class='head--doc'>Example</dt>
-
<dd class='example'><pre><p>> ADT.BitBuffer b=ADT.BitBuffer();
-
> b->put1(2);
-
(1) Result: ADT.BitBuffer(11)
-
> b->put0(15);
-
(2) Result: ADT.BitBuffer("\300\0"0)
-
> b->drain();
-
(3) Result: "\300\0"
-
> sizeof(b);
-
(4) Result: 1</p>
-
</pre></dd></dl>
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
_sizeof
</b></span>
+
<span class='homogen--name'><b>
eof
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
int
</code> <b><span class='method'>
sizeof
</span>(</b>
<
span class='class'>ADT.BitBuffer</span> <span class='argument'>arg</span> <
b>)</b></code></p></dd>
-
-
<dt class='head--
doc
'>
Description
</dt>
-
<dd class='body--
doc
'><p>
<code>sizeof()</code>
will
return the number of bits in the buffer.
</p>
+
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
eof
</span>(</b><b>)</b></code></p></dd>
+
<dt class='head--
fixme
'>
FIXME
</dt>
+
<dd class='body--
fixme
'><p>
Document
this
function
</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
create
</b></span>
+
<span class='homogen--name'><b>
get_history
</b></span>
</dt>
-
<dd><p><code><
span
class='object'>
ADT.BitBuffer
</
span
> <span class='
class
'>
ADT.BitBuffer
</span>
<b>
(</b><
code class='datatype'>void</code>|<code class='datatype'>string</code> <code class='argument'>data</code><
b>)</b></code></p></dd>
-
-
<dt class='head--
doc
'>
Description
</dt>
-
<dd class='body--
doc
'><p>
The
buffer
can be initialized with initial data during creation.
</p>
+
<dd><p><code><
code
class='object
unresolved
'>
History
</
code
> <
b><
span class='
method
'>
get_history
</span>(</b><b>)</b></code></p></dd>
+
<dt class='head--
fixme
'>
FIXME
</dt>
+
<dd class='body--
fixme
'><p>
Document
this
function
</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
drain
</b></span>
+
<span class='homogen--name'><b>
get_input_controller
</b></span>
</dt>
-
<dd><p><code><code class='
datatype
'>
string
</code> <b><span class='method'>
drain
</span>(</b><b>)</b></code></p></dd>
+
<dd><p><code><code class='
object unresolved
'>
InputController
</code> <b><span class='method'>
get_input_controller
</span>(</b><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Drains
the
buffer
of
all
full
(8
-
bits
wide)
bytes.
</p>
+
<dd class='body--doc'><p>
get
current
input
control
object</p>
+
</dd>
+
<dt
class='head--doc'>Returns</dt>
+
<dd
class='body
-
-doc'><p>Terminal
input
controller object
</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
feed
</b></span>
+
<span class='homogen--name'><b>
get_output_controller
</b></span>
</dt>
-
<dd><p><code><code class='object unresolved'>
this_program
</code> <b><span class='method'>
feed
</span>(</b><
code class='datatype'>string</code> <code class='argument'>x</code><
b>)</b></code></p></dd>
+
<dd><p><code><code class='object unresolved'>
OutputController
</code> <b><span class='method'>
get_output_controller
</span>(</b><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Adds
full
bytes
to
the
buffer.
</p>
+
<dd class='body--doc'><p>
get
current
output
control
object</p>
+
</dd>
+
<dt
class='head--doc'>Returns
</
dt>
+
<dd class='body--doc'><
p>
Terminal output controller object</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>get</b></span>
+
<span class='homogen--name'><b>get
_prompt
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
int
</code> <b><span class='method'>get</span>(</b><
code class='datatype'>int</code> <code class='argument'>bits</code><
b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
string
</code> <b><span class='method'>get
_prompt
</span>(</b><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Get
<code>bits</code> from
the
buffer.</p>
-
</dd>
-
<dt
class='head--doc'>Throws</dt>
-
<dd
class='body--doc'><p>Throws an error in case of data underflow
.</p>
-
</dd>
-
<dt class='head--doc'>Note</dt>
-
<dd class='body--doc'><p>The bits are extracted with the most significant bit first.</p>
+
<dd class='body--doc'><p>
Return
the
current
prompt
string
.</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
put
</b></span>
+
<span class='homogen--name'><b>
getcursorpos
</b></span>
</dt>
-
<dd><p><code><code class='
object unresolved
'>
this_program
</code> <b><span class='method'>
put
</span>(</b><
code class='datatype'>int</code> <code class='argument'>value</code>, <code class='datatype'>int</code> <code class='argument'>bits</code><
b>)</b></code></p></dd>
-
-
<dt class='head--
doc
'>
Description
</dt>
-
<dd class='body--
doc
'><p>
Put
<code>bits</code>
number of bits with the value
<
code>value<
/
code> into the
-
buffer.</
p>
-
</dd>
-
<dt class='head--doc'>Note</dt>
-
<dd class='body--doc'><p><code>value</code> must not be larger than what can be stored with the
-
number of bits given in <code>bits</code>.</p>
-
</dd>
-
<dt class='head--doc'>Note</dt>
-
<dd class='body--doc'><p>The bits are added to the buffer with the most significant
-
bit first.</p>
+
<dd><p><code><code class='
datatype
'>
int
</code> <b><span class='method'>
getcursorpos
</span>(</b><b>)</b></code></p></dd>
+
<dt class='head--
fixme
'>
FIXME
</dt>
+
<dd class='body--
fixme
'><p>
Document
this
function
</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
put0
</b></span>
+
<span class='homogen--name'><b>
getmark
</b></span>
</dt>
-
<dd><p><code><code class='
object unresolved
'>
this_program
</code> <b><span class='method'>
put0
</span>(</b><
code class='datatype'>int</code> <code class='argument'>bits</code><
b>)</b></code></p></dd>
-
-
<dt class='head--
doc
'>
Description
</dt>
-
<dd class='body--
doc
'><p>
Put
<code>bits</code>
number of 0 bits into the buffer.
</p>
+
<dd><p><code><code class='
datatype
'>
int
</code> <b><span class='method'>
getmark
</span>(</b><b>)</b></code></p></dd>
+
<dt class='head--
fixme
'>
FIXME
</dt>
+
<dd class='body--
fixme
'><p>
Document
this
function
</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
put1
</b></span>
+
<span class='homogen--name'><b>
gettext
</b></span>
</dt>
-
<dd><p><code><code class='
object unresolved
'>
this_program
</code> <b><span class='method'>
put1
</span>(</b><
code class='datatype'>int</code> <code class='argument'>bits</code><
b>)</b></code></p></dd>
-
-
<dt class='head--
doc
'>
Description
</dt>
-
<dd class='body--
doc
'><p>
Put
<code>bits</code>
number of 1 bits into the buffer.
</p>
+
<dd><p><code><code class='
datatype
'>
string
</code> <b><span class='method'>
gettext
</span>(</b><b>)</b></code></p></dd>
+
<dt class='head--
fixme
'>
FIXME
</dt>
+
<dd class='body--
fixme
'><p>
Document
this
function
</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
read
</b></span>
+
<span class='homogen--name'><b>
history
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
string
</code> <b><span class='method'>
read
</span>(</b><code class='datatype'>
void</code>|<code class='datatype'>
int</code> <code class='argument'>
bytes
</code><b>)</b></code></p></dd>
-
-
<dt class='head--
doc
'>
Description
</dt>
-
<dd class='body--
doc
'><p>
Reads
<code>bytes</code>
(or less) bytes from the buffer and returns as
-
string.
</p>
+
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
history
</span>(</b><code class='datatype'>int</code> <code class='argument'>
n
</code><b>)</b></code></p></dd>
+
<dt class='head--
fixme
'>
FIXME
</dt>
+
<dd class='body--
fixme
'><p>
Document
this
function
</p>
</dd></dl>
-
</dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>ADT.CircularList</b></h2>
-
</dt><dd><dl class='group--doc'>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>This is an circular list implemented by an array. It has a constant time
-
complexity for pop and push. It has a limited max size but it can be
-
increased with the method allocate.</p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
_equal
</b></span>
+
<span class='homogen--name'><b>
insert
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
bool
</code> <b><span class='method'>
equal
</span>(</b><
span
class='
class
'>
ADT.CircularList
</
span
> <
span
class='argument'>
from
</
span
>, <code class='datatype'>
mixed
</code> <code class='argument'>
coll
</code><b>)</b></code></p></dd>
-
-
<dt class='head--
doc
'>
Returns
</dt>
-
<dd class='body--
doc
'><p>
Returns
<tt>true</tt>
if the object
<
code>coll<
/
code> is a <code>CircularList</code>
-
and contains the same values in the same order.</
p>
+
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
insert
</span>(</b><
code
class='
datatype
'>
string
</
code
> <
code
class='argument'>
s
</
code
>, <code class='datatype'>
int
</code> <code class='argument'>
p
</code><b>)</b></code></p></dd>
+
<dt class='head--
fixme
'>
FIXME
</dt>
+
<dd class='body--
fixme
'><p>
Document
this
function
</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
_get_iterator
</b></span>
+
<span class='homogen--name'><b>
kill
</b></span>
</dt>
-
<dd><p><code><
span
class='
class
'>
ADT.CircularList
</
span
> <span class='method'>
a
</span>
;<br>
-
foreach
(
a; index; value ) or
<
br><
/
code
><code
><code
class='
object unresolved
'>
CircularListIterator
</code> <
b><span class='method'>_get_iterator</span>(</b><
code class='
datatype
'>
void
</code>
|
<code class='datatype'>int</code> <code class='argument'>
ind
</code><b>)</b></code></p></dd>
-
-
<dt class='head--
doc
'>
Description
</dt>
-
<dd class='body--
doc
'><p>
Create
and initiate a new CircularListIterator that could be used
-
to iterate over
this
list.
</p>
-
</dd>
-
<dt class='head--doc'><span id='p-ind'></span>Parameter <code class='parameter'>ind</code></dt>
-
<dd></dd><dd class='body--doc'><p>If an <code>ind</code> value is supplied the iterator will be positioned at
-
that index.</p>
-
</dd>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>An iterator.</p>
+
<dd><p><code><
code
class='
datatype
'>
void
</
code
> <
b><
span class='method'>
kill
</span>(</
b
><code class='
datatype
'>
int
</code> <code class='
argument
'>
p1
</code>
,
<code class='datatype'>int</code> <code class='argument'>
p2
</code><b>)</b></code></p></dd>
+
<dt class='head--
fixme
'>
FIXME
</dt>
+
<dd class='body--
fixme
'><p>
Document
this
function
</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>_
indices
</b></span>
+
<span class='homogen--name'><b>
kill
_
ring_yank
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
array
</code> <b><span class='method'>
indices
</span>(</b>
<
span class='class'>ADT.CircularList</span> <span class='argument'>arg</span> <
b>)</b></code></p></dd>
-
-
<dt class='head--
doc
'>
Returns
</dt>
-
<dd class='body--
doc
'><p>
The
indices in
this
list as an array.
</p>
+
<dd><p><code><code class='datatype'>
string
</code> <b><span class='method'>
kill_ring_yank
</span>(</b><b>)</b></code></p></dd>
+
<dt class='head--
fixme
'>
FIXME
</dt>
+
<dd class='body--
fixme
'><p>
Document
this
function
</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>_
insert_element
</b></span>
+
<span class='homogen--name'><b>
list
_
completions
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>void</code> <b><span class='method'>_
insert_element
</span>(</b><code class='datatype'>
int
</code>
<code class='
argument'>index</code>, <code class='
datatype'>
mixed
</code> <code class='argument'>
value
</code><b>)</b></code></p></dd>
-
-
<dt class='head--
doc
'>
Description
</dt>
-
<dd class='body--
doc
'><p>
Insert
an
element in the list at the position
<
code>index<
/
code>, the value
-
at the position <code>index</code> and all above will have their index increased
-
by one.</
p>
-
</dd>
-
<dt class='head--doc'><span id='p-index'></span>Parameter <code class='parameter'>index</code></dt>
-
<dd></dd><dd class='body--doc'><p>The index to insert the value at.</p>
-
</dd>
-
<dt class='head--doc'><span id='p-value'></span>Parameter <code class='parameter'>value</code></dt>
-
<dd></dd><dd class='body--doc'><p>The new value.</p>
-
</dd>
-
<dt class='head--doc'>Throws</dt>
-
<dd class='body--doc'><p>An error if the index is out of range.</p>
+
<dd><p><code><code class='datatype'>void</code> <b><span class='method'>
list
_
completions
</span>(</b><code class='datatype'>
array
</code>
(
<code class='datatype'>
string
</code>
)
<code class='argument'>
c
</code><b>)</b></code></p></dd>
+
<dt class='head--
fixme
'>
FIXME
</dt>
+
<dd class='body--
fixme
'><p>
Document
this
function
</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
_remove_element
</b></span>
+
<span class='homogen--name'><b>
message
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
mixed
</code> <b><span class='method'>
_remove_element
</span>(</b><code class='datatype'>
int
</code> <code class='argument'>
index
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
message
</span>(</b><code class='datatype'>
string
</code> <code class='argument'>
msg
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Remove
the
values
at index <code>index</code> from the list.</p>
-
</dd>
-
<dt class='head--doc'><span id='p-index'></span>Parameter <code class='parameter'>index</code></dt>
-
<dd></dd><dd class='body--doc'><p>The index
to
remove.</p>
-
</dd>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>The removed value.</p>
-
</dd>
-
<dt class='head--doc'>Throws</dt>
-
<dd class='body--doc'><p>An error if
the
index
is out of range.
</p>
+
<dd class='body--doc'><p>
Print
a
message
to the
output
device
</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
_search
</b></span>
+
<span class='homogen--name'><b>
newline
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
int
</code> <b><span class='method'>
search
</span>(</b><
span class='class'>ADT.CircularList</span> <span class='argument'>from</span>, <code class='datatype'>mixed</code> <code class='argument'>value</code>, <code class='datatype'>void</code>|<code class='datatype'>int</code> <code class='argument'>start</code><
b>)</b></code></p></dd>
-
-
<dt class='head--
doc
'>
Description
</dt>
-
<dd class='body--
doc
'><p>
Search
the
list for a specific value. Return the index of the first
-
value that is equal to
<
code>value<
/
code>. If no value was found <code class='expr'>UNDEFINED</code>
-
is returned instead</
p>
-
</dd>
-
<dt class='head--doc'><span id='p-value'></span>Parameter <code class='parameter'>value</code></dt>
-
<dd></dd><dd class='body--doc'><p>The value to find</p>
-
</dd>
-
<dt class='head--doc'><span id='p-start'></span>Parameter <code class='parameter'>start</code></dt>
-
<dd></dd><dd class='body--doc'><p>If a start value is supplied it will start searching at the index
-
<code>start</code>.</p>
-
</dd>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>Returns the index of the found value or <code class='expr'>UNDEFINED</code>.</p>
-
</dd>
-
<dt class='head--doc'>Throws</dt>
-
<dd class='body--doc'><p>An error if the start is out of range.</p>
+
<dd><p><code><code class='datatype'>
string
</code> <b><span class='method'>
newline
</span>(</b><b>)</b></code></p></dd>
+
<dt class='head--
fixme
'>
FIXME
</dt>
+
<dd class='body--
fixme
'><p>
Document
this
function
</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
_sizeof
</b></span>
+
<span class='homogen--name'><b>
pointmark
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
int
</code>
<
b><span
class='
method
'>
sizeof
</
span
>
(
<
/
b>
<span class='
class
'>
ADT.CircularList
</span>
<
span class='argument'>arg<
/
span
>
<b>)</b></code></p></dd>
-
-
<dt class='head--
doc
'>
Returns
</dt>
-
<dd class='body--
doc
'><p>
The
number of elements in
this
list.
</p>
+
<dd><p><code><code class='datatype'>
array
</code>
(
<
code
class='
datatype
'>
int
</
code
>
)
<b><span class='
method
'>
pointmark
</span>
(
</
b
><b>)</b></code></p></dd>
+
<dt class='head--
fixme
'>
FIXME
</dt>
+
<dd class='body--
fixme
'><p>
Document
this
function
</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
_values
</b></span>
+
<span class='homogen--name'><b>
read
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
array
</code> <b><span class='method'>
values
</span>(</b>
<
span
class='class'>
ADT.CircularList
</
span
> <
span
class='argument'>
arg
</
span
> <b>)</b></code></p></dd>
-
-
<dt class='head--
doc
'>
Returns
</dt>
-
<dd class='body--
doc
'><p>
The
values in
this
list as an array.
</p>
+
<dd><p><code><code class='datatype'>
string
</code> <b><span class='method'>
read
</span>(</b><
code
class='
datatype'>string</code>|<code
class
=
'
datatype'
>
void
</
code
> <
code
class='argument'>
prompt
</
code
>
,
<
code class='datatype'>array</code>(<code class='datatype'>string</code>)|<code class='datatype'>void</code> <code class='argument'>attrs</code><
b>)</b></code></p></dd>
+
<dt class='head--
fixme
'>
FIXME
</dt>
+
<dd class='body--
fixme
'><p>
Document
this
function
</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
`+
</b></span>
+
<span class='homogen--name'><b>
redisplay
</b></span>
</dt>
-
<dd><p><code><code class='
object unresolved
'>
CircularList
</code>
res =
<
code
class='
class
'>
ADT.CircularList
(
)
</
code
>
 + 
<code class='
class
'>
coll
</code><
/
code
></p></dd>
-
-
<dt
class='
head--doc
'>
Description
</
dt
>
-
<
dd
class='
body--doc
'><
p>Addition operator<
/
p>
-
<p> Append the content of this CircularList and @<
code>
coll
<
/
code
>
and
-
return the results as a new <code>CircularList</code>.</p>
-
</dd>
-
<dt
class='
head--doc
'><
span id='p-coll'><
/
span
>
Parameter
<code class='
parameter
'>
coll
</code><
/dt
>
-
<
dd
></
dd
><
dd class='body--doc'><p>The lists to append to this list<
/p>
-
</dd>
-
<dt class='head--
doc
'>
Returns
</dt>
-
<dd class='body--
doc
'><p>
The
result
of the append as a new
<
code>CircularList<
/
code>.</
p>
+
<dd><p><code><code class='
datatype
'>
void
</code> <
b><span
class='
method
'>
redisplay</span>
(</
b
><code class='
datatype
'>
int
</code>
<code class='
argument
'>
clear
</
code
>
,
<
code
class='
datatype
'>
int
</code>
|
<code class='
datatype
'>
void
</
code
> <code class='
argument
'>
nobackup
</code><
b
>
)
<
/b
></
code
></p></dd>
+
<dt class='head--
fixme
'>
FIXME
</dt>
+
<dd class='body--
fixme
'><p>
Document
this
function
</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
`[]
</b></span>
+
<span class='homogen--name'><b>
region
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
mixed
</code>
res =
<
code class='class'
>
ADT.CircularList()
<
/code>[ <code
class='
class
'>
index
</
code
>
 ]
</
code
><
/p></dd>
-
-
<dt
class='
head--doc
'>
Description
</
dt
>
-
<dd
class='body--doc'><p>Index
operator</p>
-
</dd>
-
<dt
class='head--doc'>
<
span id='p-index'></span>Parameter <
code class='
parameter
'>
index
</code><
/dt
>
-
<
dd><
/
dd
><
dd class='body--doc'><p>The index to get the value for, could be negative to index from the end.<
/
p>
-
</dd>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>The value at the index <
code>
index
</
code></
p>
-
</dd>
-
<dt class='head--
doc
'>
Throws
</dt>
-
<dd class='body--
doc
'><p>
An
error
if the index is out of range.
</p>
+
<dd><p><code><code class='datatype'>
string
</code> <
b
><
span
class='
method
'>
region
</
span
>
(
</
b
><
code
class='
datatype
'>
int
</
code
>
...
<code class='
argument
'>
args
</code><
b
>
)
</
b
></code></p></dd>
+
<dt class='head--
fixme
'>
FIXME
</dt>
+
<dd class='body--
fixme
'><p>
Document
this
function
</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
`[]=
</b></span>
+
<span class='homogen--name'><b>
set_blocking
</b></span>
</dt>
-
<dd><p><code><code class='
class
'>
ADT.CircularList()
</code>
[ <code
class='class'>index
<
/code
>
 ] = 
<
code class='class'>value</code></code></p></dd>
-
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Index assign operator.
-
Set the value at the index <code>index</code> to be <code>value</code></p>
-
</dd>
-
<dt class='head--doc'><
span
id='p-index'></span>Parameter <code
class='
parameter
'>
index</code></dt>
-
<dd></dd><dd class='body--doc'><p>The index to
set</
p>
-
</dd>
-
<dt class='head--doc'><
span
id='p-value'
></
span
>
Parameter
<
code class='parameter'
>
value
</
code
></
dt>
-
<dd></dd><dd class='body--doc'><p>The new value</p>
-
</dd>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>The new value at the index <
code>
index
</
code></
p>
-
</dd>
-
<dt class='head--
doc
'>
Throws
</dt>
-
<dd class='body--
doc
'><p>
An
error
if the index is out of range.
</p>
+
<dd><p><code><code class='
datatype
'>
void
</code> <
b
><span class='
method
'>set
_blocking
</span>
(
</
b
><
b
>
)
</
b
></code></p></dd>
+
<dt class='head--
fixme
'>
FIXME
</dt>
+
<dd class='body--
fixme
'><p>
Document
this
function
</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
add
</b></span>
+
<span class='homogen--name'><b>
set_echo
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>void</code> <b><span class='method'>
add
</span>(</b><code class='datatype'>
mixed
</code> <code class='argument'>
value
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>void</code> <b><span class='method'>
set_echo
</span>(</b><code class='datatype'>
int
</code> <code class='argument'>
onoff
</code><b>)</b></code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Add
a
value
at
the
front of the list
</p>
+
<dd class='body--doc'><p>
Set
text
echo
on
or
off.
</p>
</dd>
-
<dt class='head--doc'><span id='p-
value
'></span>Parameter <code class='parameter'>
value
</code></dt>
-
<dd></dd><dd class='body--doc'><p>
The
value
to
add.</p>
-
</dd>
-
<dt
class='head--doc'>Throws</dt>
-
<dd
class='body--doc'><p>An
error if the list is full
.</p>
+
<dt class='head--doc'><span id='p-
onoff
'></span>Parameter <code class='parameter'>
onoff
</code></dt>
+
<dd></dd><dd class='body--doc'><p>
1
for
echo,
0
for
no
echo
.</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
allocate
</b></span>
+
<span class='homogen--name'><b>
set_nonblocking
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>void</code> <b><span class='method'>
allocate
</span>(</b><code class='datatype'>
int
</code>
<code class='
argument
'>
elements
</code>
<b>
)<
/b></
code
></p></dd>
-
-
<dt
class='
head--doc
'>
Description
</
dt
>
-
<
dd class='body--doc'
><
p
>
Increase the maxsize of the CircularlList.
</p>
-
</dd>
-
<dt class='head--
doc
'><
span id='p-elements'><
/
span>Parameter <code class='parameter'>elements</code></
dt>
-
<dd
></dd><dd
class='body--
doc
'><p>
Add
this
number of new elements to the list.
</p>
+
<dd><p><code><code class='datatype'>void</code> <b><span class='method'>
set_nonblocking
</span>(</b><code class='datatype'>
function
</code>
(:
<code class='
datatype void
'>
void
</code>)
<code class='
argument
'>
f
</
code
><
b
>
)
<
/b
></
code></
p></dd>
+
<dt class='head--
fixme
'>
FIXME
</dt>
+
<dd class='body--
fixme
'><p>
Document
this
function
</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
cast
</b></span>
+
<span class='homogen--name'><b>
set_prompt
</b></span>
</dt>
-
<dd><p><code><b>(</b><
span
class='datatype'><code class='datatype'>array</code><
/span
><
b
>)</
b
><
span
class='
class
'>
ADT.CircularList
</
span
>
(
)</code></p></dd>
+
<dd><p><code><
code class='datatype'>string</code> <
b>
<span class='method'>set_prompt</span>
(</b><
code
class='datatype'>
string
<
/
code
>
<code
class='
argument'>newp</code>, <code class='
datatype'>array</code>
(
<
code class='datatype'
>
string
<
/code
>)
|
<
code class='datatype'>void<
/
code
>
<
code
class='
argument
'>
newattrs
</
code
>
<b>
)</
b></
code></p></dd>
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>
Cast
operator
.</p>
+
<dd class='body--doc'><p>
Set
the prompt string
.</p>
</dd>
-
<dt class='head--doc'><span id='p-
type
'></span>Parameter <code class='parameter'>
type
</code></dt>
-
<dd></dd><dd class='body--doc'><p>
Casts
to
this type.
</p>
-
<p> Casts to the following types are supported:</p>
-
<table class='box'><tr><td><code><code class='key'>"array"</code></code></td><td><p>Cast the content of this list to an array.</p>
-
</td></tr>
-
</table>
+
<dt class='head--doc'><span id='p-
newp
'></span>Parameter <code class='parameter'>
newp
</code></dt>
+
<dd></dd><dd class='body--doc'><p>
New
prompt
string
</p>
</dd>
-
<dt class='head--doc'>
Returns
</dt>
-
<dd class='body--doc'><p>
An
array with the contents of this list.
</p>
+
<dt class='head--doc'><
span id='p-newattrs'><
/
span>Parameter <code class='parameter'>newattrs</code></
dt>
+
<dd
></dd><dd
class='body--doc'><p>
Terminal
attributes
</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
clear
</b></span>
+
<span class='homogen--name'><b>
setcursorpos
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
clear
</span>(</b><b>)</b></code></p></dd>
-
-
<dt class='head--
doc
'>
Description
</dt>
-
<dd class='body--
doc
'><p>
Clear
the
contents of the list.
</p>
+
<dd><p><code><code class='datatype'>
int
</code> <b><span class='method'>
setcursorpos
</span>(</b><
code class='datatype'>int</code> <code class='argument'>p</code><
b>)</b></code></p></dd>
+
<dt class='head--
fixme
'>
FIXME
</dt>
+
<dd class='body--
fixme
'><p>
Document
this
function
</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
create
</b></span>
+
<span class='homogen--name'><b>
setmark
</b></span>
</dt>
-
<dd><p><code><
span
class='
object
'>
ADT.CircularList
</
span
> <span class='
class
'>
ADT.CircularList
</span>
<b>
(</b><code class='datatype'>
array</code>|<code class='datatype'>
int</code> <code class='argument'>
arg
</code><b>)</b></code></p></dd>
-
-
<dt class='head--
doc
'>
Description
</dt>
-
<dd class='body--
doc
'><p>
Creates
a
new
<
code>CircularList<
/
code> around the array arg or a new
-
<code>CircularList</code> with the maximum size of arg.</
p>
+
<dd><p><code><
code
class='
datatype
'>
int
</
code
> <
b><
span class='
method
'>
setmark
</span>(</b><code class='datatype'>int</code> <code class='argument'>
p
</code><b>)</b></code></p></dd>
+
<dt class='head--
fixme
'>
FIXME
</dt>
+
<dd class='body--
fixme
'><p>
Document
this
function
</p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
delete_value
</b></span>
+
<span class='homogen--name'><b>
write
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
int
</code> <b><span class='method'>
delete_value
</span>(</b><code class='datatype'>
mixed
</code> <code class='argument'>
value
</code><
b>)</b></
code
></p></dd>
-
-
<dt
class='
head--doc
'>
Description
</
dt>
-
<dd class='body--doc'><p>Remove the first occurrence of the value <
code>
value
<
/
code
>
from the list.</p>
-
</dd>
-
<dt
class='
head--doc
'><
span id='p-value'><
/
span
>
Parameter
<code class='
parameter
'>
value
</code><
/dt
>
-
<
dd
></
dd
><
dd class='body--doc'><p>The value to remove from the list.<
/p>
-
</dd>
-
<dt class='head--
doc
'>
Returns
</dt>
-
<dd class='body--
doc
'><p>
The
index
of the removed element or -1 if there was no value to
-
remove.
</p>
+
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
write
</span>(</b><code class='datatype'>
string
</code> <code class='argument'>
msg
</code>
,
<code class='
datatype
'>
void
</code>
|
<code class='
datatype
'>
int
</
code
> <code class='
argument
'>
word_wrap
</code><
b
>
)
<
/b
></
code
></p></dd>
+
<dt class='head--
fixme
'>
FIXME
</dt>
+
<dd class='body--
fixme
'><p>
Document
this
function
</p>
</dd></dl>
-
+
<dl><dt><h2 class='header'>Class <b class='ms datatype'>Stdio.Readline.DefaultEditKeys</b></h2>
+
</dt><dd>
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
first
</b></span>
+
<span class='homogen--name'><b>
backward_char
</b></span>
</dt>
-
<dd><p><code><code class='
object unresolved
'>
CircularListIterator
</code> <b><span class='method'>
first
</span>(</b><b>)</b></code></p></dd>
+
<dd><p><code><code class='
datatype
'>
void
</code> <b><span class='method'>
backward_char
</span>(</b><b>)</b></code></p></dd>
+
</dl>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Create and initiate a new CircularListIterator that could be used
-
to iterate over this list.</p>
-
</dd>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>An iterator positioned at the first element in the list.</p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
is
_
empty
</b></span>
+
<span class='homogen--name'><b>
backward
_
delete_char
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
bool
</code> <b><span class='method'>
is
_
empty
</span>(</b><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
backward
_
delete_char
</span>(</b><b>)</b></code></p></dd>
+
</dl>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>Returns <code class='expr'>1</code> if the list is empty otherwise <code class='expr'>0</code>.</p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
last
</b></span>
+
<span class='homogen--name'><b>
backward_kill_word
</b></span>
</dt>
-
<dd><p><code><code class='
object unresolved
'>
CircularListIterator
</code> <b><span class='method'>
last
</span>(</b><b>)</b></code></p></dd>
+
<dd><p><code><code class='
datatype
'>
void
</code> <b><span class='method'>
backward_kill_word
</span>(</b><b>)</b></code></p></dd>
+
</dl>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Create and initiate a new CircularListIterator that could be used
-
to iterate over this list.</p>
-
</dd>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>An iterator positioned after the last element in the list.</p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
max
_
size
</b></span>
+
<span class='homogen--name'><b>
backward
_
word
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
int
</code> <b><span class='method'>
max
_
size
</span>(</b><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
backward
_
word
</span>(</b><b>)</b></code></p></dd>
+
</dl>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>Returns the maximal size of this list.</p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
peek
_
back
</b></span>
+
<span class='homogen--name'><b>
beginning
_
of_line
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
mixed
</code> <b><span class='method'>
peek
_
back
</span>(</b><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
beginning
_
of_line
</span>(</b><b>)</b></code></p></dd>
+
</dl>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>The value at the back of the list but do not remove it from the list.</p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
peek
_
front
</b></span>
+
<span class='homogen--name'><b>
capitalize
_
word
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
mixed
</code> <b><span class='method'>
peek
_
front
</span>(</b><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
capitalize
_
word
</span>(</b><b>)</b></code></p></dd>
+
</dl>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>The value at the front of the list but do not remove it from the list.</p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
pop
_
back
</b></span>
+
<span class='homogen--name'><b>
clear
_
screen
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
mixed
</code> <b><span class='method'>
pop
_
back
</span>(</b><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
clear
_
screen
</span>(</b><b>)</b></code></p></dd>
+
</dl>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Remove the value at the back of the list and return it.</p>
-
</dd>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>The value at the back of the list.</p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
pop_front
</b></span>
+
<span class='homogen--name'><b>
create
</b></span>
</dt>
-
<dd><p><code><
code
class='
datatype
'>
mixed
</
code
> <
b><
span class='
method
'>
pop_front
</span>(</b><b>)</b></code></p></dd>
+
<dd><p><code><
span
class='
object
'>
Stdio.Readline.DefaultEditKeys
</
span
> <span class='
class
'>
Stdio.Readline.DefaultEditKeys
</span>
<b>
(</b><
code class='datatype'>object</code> <code class='argument'>readline</code><
b>)</b></code></p></dd>
+
</dl>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Remove the value at the front of the list and return it.</p>
-
</dd>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>The value at the front of the list.</p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
push
_
back
</b></span>
+
<span class='homogen--name'><b>
delete
_
char
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>void</code> <b><span class='method'>
push
_
back
</span>(</b><
code class='datatype'>mixed</code> <code class='argument'>value</code><
b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>void</code> <b><span class='method'>
delete
_
char
</span>(</b><b>)</b></code></p></dd>
+
</dl>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Add a new value at the end of the list.</p>
-
</dd>
-
<dt class='head--doc'><span id='p-value'></span>Parameter <code class='parameter'>value</code></dt>
-
<dd></dd><dd class='body--doc'><p>The value to add.</p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
push
_
front
</b></span>
+
<span class='homogen--name'><b>
delete
_
char_or_eof
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>void</code> <b><span class='method'>
push
_
front
</span>(</b><
code class='datatype'>mixed</code> <code class='argument'>value</code><
b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>void</code> <b><span class='method'>
delete
_
char_or_eof
</span>(</b><b>)</b></code></p></dd>
+
</dl>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Add a new value at the end of the list.</p>
-
</dd>
-
<dt class='head--doc'><span id='p-value'></span>Parameter <code class='parameter'>value</code></dt>
-
<dd></dd><dd class='body--doc'><p>The value to add.</p>
-
</dd></dl>
-
<dl><dt><h2 class='header'>Class <b class='ms datatype'>ADT.CircularList.CircularListIterator</b></h2>
-
</dt><dd><dl class='group--doc'>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>This is the iterator for the CircularList. It implements the
-
IndexIterator and the OutputIterator.</p>
-
</dd></dl>
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>_
equal
</b></span>
+
<span class='homogen--name'><b>
down
_
history
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
bool
</code> <b><span class='method'>
equal
</span>(</b><
span class='class'>ADT.CircularList.CircularListIterator</span> <span class='argument'>from</span>, <code class='datatype'>mixed</code> <code class='argument'>iter</code><
b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
down_history
</span>(</b><b>)</b></code></p></dd>
+
</dl>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Compare this iterator with another iterator.</p>
-
</dd>
-
<dt class='head--doc'><span id='p-iter'></span>Parameter <code class='parameter'>iter</code></dt>
-
<dd></dd><dd class='body--doc'><p>The iterator to compare with</p>
-
</dd>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>Returns <tt>true</tt> if both iterators iterates over the same
-
objects and are positioned at the same spot.</p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
`!
</b></span>
+
<span class='homogen--name'><b>
downcase_word
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
bool
</code>
res = !
<
code
class='
class
'>
ADT.CircularList.CircularListIterator
()</
code
></code></p></dd>
+
<dd><p><code><code class='datatype'>
void
</code> <
b><span
class='
method
'>
downcase_word</span>
(
</b><b>
)</
b
></code></p></dd>
+
</dl>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>Returns <tt>false</tt> if the iterator has reached the end.</p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
`+
</b></span>
+
<span class='homogen--name'><b>
end_of_line
</b></span>
</dt>
-
<dd><p><code><code class='
object unresolved
'>
CircularListIterator
</code>
res =
<
code
class='
class
'>
ADT.CircularList.CircularListIterator
(
)
</
code
>
 + 
<
code class='class'
>
steps
</
code
></code></p></dd>
+
<dd><p><code><code class='
datatype
'>
void
</code> <
b><span
class='
method
'>
end_of_line</span>
(</
b
><
b
>
)
</
b
></code></p></dd>
+
</dl>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Move the iterator <code>steps</code> steps forward (negative value on <code>steps</code>
-
will cause the iterator to move backwards) and return the result
-
as a new iterator.</p>
-
</dd>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>A new iterator positioned <code>steps</code> steps forward.</p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
`+=
</b></span>
+
<span class='homogen--name'><b>
forward_char
</b></span>
</dt>
-
<dd><p><code><code class='
class
'>
ADT.CircularList.CircularListIterator()
</code>
 += 
<
code
class='
class
'>
steps
</
code
></code></p></dd>
+
<dd><p><code><code class='
datatype
'>
void
</code>
<
b><span
class='
method
'>
forward_char
</
span
>
(
</
b><b>)</b></
code></p></dd>
+
</dl>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Move this iterator <code>steps</code> steps forward (negative value on <code>steps</code>
-
will cause the iterator to move backwards) and return the result.</p>
-
</dd>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>This iterator positioned <code>steps</code> steps forward.</p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
`-
</b></span>
+
<span class='homogen--name'><b>
forward_word
</b></span>
</dt>
-
<dd><p><code><code class='
object unresolved
'>
CircularListIterator
</code>
res =
<
code
class='
class
'>
ADT.CircularList.CircularListIterator
(
)
</
code
>
 - 
<
code class='class'
>
steps
</
code
></code></p></dd>
+
<dd><p><code><code class='
datatype
'>
void
</code> <
b><span
class='
method
'>
forward_word</span>
(</
b
><
b
>
)
</
b
></code></p></dd>
+
</dl>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Move the iterator <code>steps</code> steps backwards (negative value on
-
<code>steps</code> will cause the iterator to move forwards) and return
-
the result as a new iterator.</p>
-
</dd>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>A new iterator positioned <code>steps</code> steps backwards.</p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
`<
</b></span>
+
<span class='homogen--name'><b>
kill_line
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
bool
</code>
res =
<
code
class='
class
'>
ADT.CircularList.CircularListIterator
(
)
</
code
>
 < 
<
code class='class'
>
iter
</
code
></code></p></dd>
+
<dd><p><code><code class='datatype'>
void
</code> <
b><span
class='
method
'>
kill_line</span>
(</
b
><
b
>
)
</
b
></code></p></dd>
+
</dl>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Less then operator</p>
-
</dd>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>Returns <tt>true</tt> if this iterator has a lower index
-
then <code>iter</code>.</p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
`>
</b></span>
+
<span class='homogen--name'><b>
kill_region
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
bool
</code>
res =
<
code
class='
class
'>
ADT.CircularList.CircularListIterator
(
)
</
code
>
 > 
<
code class='class'
>
iter
</
code
></code></p></dd>
+
<dd><p><code><code class='datatype'>
void
</code> <
b><span
class='
method
'>
kill_region</span>
(</
b
><
b
>
)
</
b
></code></p></dd>
+
</dl>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Greater then operator</p>
-
</dd>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>Returns <tt>true</tt> if this iterator has a higher index
-
then <code>iter</code>.</p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
create
</b></span>
+
<span class='homogen--name'><b>
kill_ring_save
</b></span>
</dt>
-
<dd><p><code><
span class='object'>ADT.CircularList.CircularListIterator</span> <span class='class'>ADT.CircularList.CircularListIterator</span><b>(</b><
code class='datatype'>
object
</code> <
code class='argument'
>
list
<
/code>,
<code
class='
datatype
'>
void
</
code
>
|
<
code class='datatype'>int<
/
code
>
<
code class='argument'>start</code><
b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
void
</code> <
b
><
span
class='
method
'>
kill_ring_save
</
span
>
(
</
b
><b>)</b></code></p></dd>
+
</dl>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Creates a new iterator for the CircularList <code>list</code>. If <code>start</code> is
-
supplied it will try to position the iterator at <code>start</code>.</p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
distance
</b></span>
+
<span class='homogen--name'><b>
kill_whole_line
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
int
</code> <b><span class='method'>
distance
</span>(</b><
code class='datatype'>object</code> <code class='argument'>iter</code><
b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
kill_whole_line
</span>(</b><b>)</b></code></p></dd>
+
</dl>
-
<dt class='head--doc'><span id='p-iter'></span>Parameter <code class='parameter'>iter</code></dt>
-
<dd></dd><dd class='body--doc'><p>The iterator to measure the distance to.</p>
-
</dd>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>Returns distance between this iterator and <code>iter</code>.</p>
-
</dd>
-
<dt class='head--doc'>Throws</dt>
-
<dd class='body--doc'><p>An error if the two iterator could not be compared.</p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
get
_
collection
</b></span>
+
<span class='homogen--name'><b>
kill
_
word
</b></span>
</dt>
-
<dd><p><code><code class='
object unresolved
'>
CircularList
</code> <b><span class='method'>
get
_
collection
</span>(</b><b>)</b></code></p></dd>
+
<dd><p><code><code class='
datatype
'>
void
</code> <b><span class='method'>
kill
_
word
</span>(</b><b>)</b></code></p></dd>
+
</dl>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>Returns the CircularList this iterator currently iterates over.</p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
has_next
</b></span>
+
<span class='homogen--name'><b>
newline
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
bool
</code> <b><span class='method'>
has_next
</span>(</b><
code class='datatype'>void</code>|<code class='datatype'>int</code> <code class='argument'>steps</code><
b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
newline
</span>(</b><b>)</b></code></p></dd>
+
</dl>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>Returns <tt>true</tt> if it is possible to move <code>steps</code> steps
-
forwards, if <code>steps</code> weren't supplied it check if it is
-
possible to move one step forward.</p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
has
_
previous
</b></span>
+
<span class='homogen--name'><b>
quoted
_
insert
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
bool
</code> <b><span class='method'>
has
_
previous
</span>(</b><
code class='datatype'>void</code>|<code class='datatype'>int</code> <code class='argument'>steps</code><
b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
quoted
_
insert
</span>(</b><b>)</b></code></p></dd>
+
</dl>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>Returns <tt>true</tt> if it is possible to move <code>steps</code> steps
-
backwards, if <code>steps</code> weren't supplied it check if it is
-
possible to move one step backward.</p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
index
</b></span>
+
<span class='homogen--name'><b>
redisplay
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
int
</code> <b><span class='method'>
index
</span>(</b><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
redisplay
</span>(</b><b>)</b></code></p></dd>
+
</dl>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>The index at the current position.</p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
set
_
value
</b></span>
+
<span class='homogen--name'><b>
self
_
insert_command
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
mixed
</code> <b><span class='method'>
set
_
value
</span>(</b><code class='datatype'>
mixed
</code> <code class='argument'>
val
</code><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
self
_
insert_command
</span>(</b><code class='datatype'>
string
</code> <code class='argument'>
str
</code><b>)</b></code></p></dd>
+
</dl>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Set the value at the current position.</p>
-
</dd>
-
<dt class='head--doc'><span id='p-val'></span>Parameter <code class='parameter'>val</code></dt>
-
<dd></dd><dd class='body--doc'><p>The new value</p>
-
</dd>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>Returns the old value</p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
value
</b></span>
+
<span class='homogen--name'><b>
set_default_bindings
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
mixed
</code> <b><span class='method'>
value
</span>(</b><b>)</b></code></p></dd>
+
<dd><p><code><code class='
modifier'>protected</code> <code class='
datatype'>
void
</code> <b><span class='method'>
set_default_bindings
</span>(</b><b>)</b></code></p></dd>
+
</dl>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>The value at the current position.</p>
-
</dd></dl>
-
</dd></dl></dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>ADT.Heap</b></h2>
-
</dt><dd><dl class='group--doc'>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>This class implements a (min-)heap. The value of a child node will
-
always be greater than or equal to the value of its parent node.
-
Thus, the top node of the heap will always hold the smallest value.</p>
-
</dd></dl>
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>_
sizeof
</b></span>
+
<span class='homogen--name'><b>
set
_
mark
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
int
</code> <b><span class='method'>
sizeof
</span>(</b>
<
span class='class'>ADT.Heap</span> <span class='argument'>arg</span> <
b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
set_mark
</span>(</b><b>)</b></code></p></dd>
+
</dl>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Returns the number of elements in the heap.</p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
adjust
</b></span>
+
<span class='homogen--name'><b>
swap_mark_and_point
</b></span>
</dt>
-
<dd><p><code><code class='
object unresolved
'>
Element
</code> <b><span class='method'>
adjust
</span>(</b><
code class='datatype'>mixed</code> <code class='argument'>value</code><
b>)</b></code></p></dd>
+
<dd><p><code><code class='
datatype
'>
void
</code> <b><span class='method'>
swap_mark_and_point
</span>(</b><b>)</b></code></p></dd>
+
</dl>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Takes a value in the heap and sorts it through the heap to maintain
-
its sort criteria (increasing order).</p>
-
</dd>
-
<dt class='head--doc'><span id='p-value'></span>Parameter <code class='parameter'>value</code></dt>
-
<dd></dd><dd class='body--doc'><p>Either the element handle returned by <code>push()</code>, or the pushed
-
value itself.</p>
-
</dd>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>Returns the element handle for the value (if present in the heap),
-
and <code class='expr'>0</code> (zero) otherwise.</p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
low
_
peek
</b></span>
+
<span class='homogen--name'><b>
transpose
_
chars
</b></span>
</dt>
-
<dd><p><code><code class='
object unresolved
'>
Element
</code> <b><span class='method'>
low
_
peek
</span>(</b><b>)</b></code></p></dd>
+
<dd><p><code><code class='
datatype
'>
void
</code> <b><span class='method'>
transpose
_
chars
</span>(</b><b>)</b></code></p></dd>
+
</dl>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Returns the <code>Element</code> on top of the heap (which is also the one with
-
the smallest value in the heap) without removing it.</p>
-
</dd>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>Returns the smallest <code>Element</code> on the heap if any, and
-
<code class='expr'>UNDEFINED</code> otherwise.</p>
-
</dd>
-
<dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>peek()</code>, <code>low_pop()</code>, <code>pop()</code></p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
low
_
pop
</b></span>
+
<span class='homogen--name'><b>
up
_
history
</b></span>
</dt>
-
<dd><p><code><code class='
object unresolved
'>
Element
</code> <b><span class='method'>
low
_
pop
</span>(</b><b>)</b></code></p></dd>
+
<dd><p><code><code class='
datatype
'>
void
</code> <b><span class='method'>
up
_
history
</span>(</b><b>)</b></code></p></dd>
+
</dl>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Removes and returns the <code>Element</code> on top of the heap,
-
which also is the smallest value in the heap.</p>
-
</dd>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>Returns <code>UNDEFINED</code> if the heap is empty.</p>
-
</dd>
-
<dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>pop()</code>, <code>peek()</code>, <code>push()</code>, <code>remove()</code></p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
peek
</b></span>
+
<span class='homogen--name'><b>
upcase_word
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
mixed
</code> <b><span class='method'>
peek
</span>(</b><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
upcase_word
</span>(</b><b>)</b></code></p></dd>
+
</dl>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Returns the item on top of the heap (which is also the smallest value
-
in the heap) without removing it.</p>
-
</dd>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>Returns the smallest value on the heap if any, and
-
<code class='expr'>UNDEFINED</code> otherwise.</p>
-
</dd>
-
<dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>low_peek()</code>, <code>pop()</code></p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
pop
</b></span>
+
<span class='homogen--name'><b>
yank
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
mixed
</code> <b><span class='method'>
pop
</span>(</b><b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
yank
</span>(</b><b>)</b></code></p></dd>
+
</dl>
+
</dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>Stdio.Readline.History</b></h2>
+
</dt><dd>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Removes and returns the item on top of the heap,
-
which also is the smallest value in the heap.</p>
-
</dd>
-
<dt class='head--doc'>Throws</dt>
-
<dd class='body--doc'><p>Throws an error if the heap is empty.</p>
-
</dd>
-
<dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>low_pop()</code>, <code>peek()</code>, <code>push()</code>, <code>remove()</code></p>
-
</dd></dl>
-
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
push
</b></span>
+
<span class='homogen--name'><b>
create
</b></span>
</dt>
-
<dd><p><code><
code
class='object
unresolved
'>
Element
</
code
> <
b><
span class='
method
'>
push
</span>(</b><code class='datatype'>
mixed
</code> <code class='argument'>
value
</code><b>)</b></code></p></dd>
+
<dd><p><code><
span
class='object'>
Stdio.Readline.History
</
span
> <span class='
class
'>
Stdio.Readline.History
</span>
<b>
(</b><code class='datatype'>
int
</code> <code class='argument'>
maxhist
</code>
,
<
code class='datatype'>void</code>|<code class='datatype'>array</code>(<code class='datatype'>string</code>) <code class='argument'>hist</code><
b>)</b></code></p></dd>
+
</dl>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Push an element onto the heap. The heap will automatically sort itself
-
so that the smallest value will be at the top.</p>
-
</dd>
-
<dt class='head--doc'>Returns</dt>
-
<dd class='body--doc'><p>Returns an element handle, which can be used with
-
<code>adjust()</code> and <code>remove()</code>.</p>
-
</dd>
-
<dt class='head--doc'>Note</dt>
-
<dd class='body--doc'><p>If <code>value</code> is a <code>Heap.Element</code> and already present on the heap
-
this is equivalent to calling <code>adjust()</code>.</p>
-
</dd>
-
<dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>pop()</code>, <code>remove()</code></p>
-
</dd></dl>
+
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
remove
</b></span>
+
<span class='homogen--name'><b>
encode
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
void
</code> <b><span class='method'>
remove
</span>(</b><
code class='datatype'>mixed</code> <code class='argument'>value</code><
b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
string
</code> <b><span class='method'>
encode
</span>(</b><b>)</b></code></p></dd>
+
</dl>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Remove a value from the heap.</p>
-
</dd>
-
<dt class='head--doc'><span id='p-value'></span>Parameter <code class='parameter'>value</code></dt>
-
<dd></dd><dd class='body--doc'><p>Value to remove.</p>
-
</dd>
-
<dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>push()</code>, <code>pop()</code></p>
-
</dd></dl>
-
<dl><dt><h2 class='header'>Class <b class='ms datatype'>ADT.Heap.Element</b></h2>
-
</dt><dd><dl class='group--doc'>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Heap element.</p>
-
</dd></dl>
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
create
</b></span>
+
<span class='homogen--name'><b>
finishline
</b></span>
</dt>
-
<dd><p><code><
span
class='
object
'>
ADT.Heap.Element
</
span
> <span class='
class
'>
ADT.Heap.Element
</span>
<b>
(</b><code class='datatype'>
mixed
</code> <code class='argument'>
value
</code><b>)</b></code></p></dd>
+
<dd><p><code><
code
class='
datatype
'>
void
</
code
> <
b><
span class='
method
'>
finishline
</span>(</b><code class='datatype'>
string
</code> <code class='argument'>
text
</code><b>)</b></code></p></dd>
</dl> <hr /> <dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>
Variable
</span>
-
<span class='homogen--name'><b>
value
</b></span>
+
<dt class='head--type'><span class='homogen--type'>
Method
</span>
+
<span class='homogen--name'><b>
get_history_num
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
mixed
</code>
ADT.Heap.Element.
<b><span class='
variable
'>
value
</span></b></code></p></dd>
+
<dd><p><code><code class='datatype'>
int
</code> <b><span class='
method
'>
get_history_num
</span>
(
</b><
b>)<
/
b></
code></p></dd>
</dl>
-
</dd></dl></dd></dl><dl><dt><h2 class='header'>Class <b class='ms datatype'>ADT.History</b></h2>
-
</dt><dd><dl class='group--doc'>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>A history is a stack where you can only push entries. When the stack has
-
reached a certain size the oldest entries are removed on every push.
-
Other proposed names for this data type is leaking stack and table
-
(where you push objects onto the table in one end and objects are falling
-
off the table in the other.</p>
-
</dd></dl>
+
-
<hr />
-
<dl class='group--doc'>
-
<dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>_indices</b></span>
-
</dt>
-
<dd><p><code><code class='datatype'>array</code>(<code class='datatype'>int</code>) <b><span class='method'>indices</span>(</b> <span class='class'>ADT.History</span> <span class='argument'>arg</span> <b>)</b></code></p></dd>
+
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>Returns the index numbers of the history entries
-
available.</p>
-
</dd></dl>
-
-
+
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
-
<span class='homogen--name'><b>
_sizeof
</b></span>
+
<span class='homogen--name'><b>
history
</b></span>
</dt>
-
<dd><p><code><code class='datatype'>
int
</code> <b><span class='method'>
sizeof
</span>(</b> <
span
class='class'>
ADT.History
</
span
> <
span
class='argument'>
arg
</
span
>
<b>)</b></code></p></dd>
+
<dd><p><code><code class='datatype'>
string
</code> <b><span class='method'>
history
</span>(</b>
<code
class='datatype'>int
<
/code>
<code
class='
argument'>n</code>, <code
class
=
'
datatype'
>
string
</
code
> <
code
class='argument'>
text
</
code
><b>)</b></code></p></dd>
+
</dl>
-
<dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>A <code>sizeof</code> operation on this object returns the number
-
of elements currently in the history, e.g. <= the current
-
max size.</p>
-
</dd></dl>
+